A file written into a marked block, so a shared hosts file keeps every line that is not the mesh's (hq 128) #30

Merged
jschoubben merged 4 commits from feat/a-file-written-into-a-marked-block into main 2026-09-26 22:59:21 +00:00
Owner

A file resource may say "into": "block": the host owns only the lines between # BEGIN mesh <id> and # END mesh <id> and keeps everything outside byte for byte (novox/hq issue 128; ADR 0102's idea for text files).

  • New region appended at the end (one separating blank line), or at the start with the optional "at": "start" — dhcpcd scopes every line after interface X to that interface.
  • A region already present is never moved; drift inside it is corrected and reported.
  • Never held on an adopted node (written into, replaces nothing) — same path as into: json.
  • Undeclare restores a previously recorded region, or removes the markers (and the blank line the host added, if still blank); a file the mesh created is removed when only whitespace is left.
  • Refused: marker lines in content, unpaired markers in the file (left untouched), sealed/bytes/secrets/create-once, at without block, an id with a line break.
  • Existing file keeps its mode and owner (restored after the atomic rename).
  • Vocabulary Version stays 1 (the into: json precedent); an older host refuses the unknown into, so hosts roll out before a controller that emits it.

Second commit: gofmt of internal/bootstrap/control_test.go — main fails its own fmt step without it; drop it if fixed elsewhere.

make check green.

A `file` resource may say `"into": "block"`: the host owns only the lines between `# BEGIN mesh <id>` and `# END mesh <id>` and keeps everything outside byte for byte (novox/hq issue 128; ADR 0102's idea for text files). - New region appended at the end (one separating blank line), or at the start with the optional `"at": "start"` — dhcpcd scopes every line after `interface X` to that interface. - A region already present is never moved; drift inside it is corrected and reported. - Never held on an adopted node (written into, replaces nothing) — same path as `into: json`. - Undeclare restores a previously recorded region, or removes the markers (and the blank line the host added, if still blank); a file the mesh created is removed when only whitespace is left. - Refused: marker lines in content, unpaired markers in the file (left untouched), sealed/bytes/secrets/create-once, `at` without block, an id with a line break. - Existing file keeps its mode and owner (restored after the atomic rename). - Vocabulary Version stays 1 (the `into: json` precedent); an older host refuses the unknown `into`, so **hosts roll out before a controller that emits it**. Second commit: gofmt of `internal/bootstrap/control_test.go` — main fails its own fmt step without it; drop it if fixed elsewhere. `make check` green.
jschoubben added 2 commits 2026-09-26 21:59:43 +00:00
jschoubben added 2 commits 2026-09-26 22:12:30 +00:00
jschoubben merged commit e688b3b816 into main 2026-09-26 22:59:21 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-host#30