57/K2: The controller reads, judges against and keeps the catalogue's list of predefined keys (issue 661) #323

Merged
mesh-admin merged 6 commits from pkg/57-k2-predefined-keys into feat/57-config-and-provisioning 2026-10-14 06:52:25 +00:00
Contributor

Package K2 of design 57 (ADR 0348 clause 7), the controller's half. The catalogue's half (predefined.json and the merge-check rule) is the mesh-catalog pull request on the same branch name; this one must merge first and accepts a catalogue with or without the file.

Published list kept in the controller's store (predefined_list, migration 0098); F3's record mirrors (#315, not yet merged into feat/57) are the natural way onto the bus, left to whichever of F3 or K3 lands second (noted on issue 662).

The full description, tests and checklist are unchanged from the version reviewed in review 269: the build, module check and the merge gate read predefined.json strictly at the repository root and judge every manifest against it; registration keeps a catalogue trunk build's list only when its generation (git rev-list --count) is larger than the kept one; tests TestANewerBuildsListReplacesTheKeptOneAndAnOlderOneHeardLaterDoesNot, TestRegistrationPublishesTheNewestTrunkListAndJudgesEveryModuleAgainstIt, the module check and merge gate tests, the builder and catalogue tests. Left out: a key still holding a value (K3), a list-only change triggering a build (K3, issue 662). Checks: gofmt, go vet, go test -race, merge-check.sh (its drop check passes against the merge base; it fails against origin/main until main is brought into feat/57).

Package K2 of design 57 (ADR 0348 clause 7), the controller's half. The catalogue's half (predefined.json and the merge-check rule) is the mesh-catalog pull request on the same branch name; this one must merge first and accepts a catalogue with or without the file. Published list kept in the controller's store (`predefined_list`, migration 0098); F3's record mirrors (#315, not yet merged into feat/57) are the natural way onto the bus, left to whichever of F3 or K3 lands second (noted on issue 662). The full description, tests and checklist are unchanged from the version reviewed in review 269: the build, `module check` and the merge gate read `predefined.json` strictly at the repository root and judge every manifest against it; registration keeps a catalogue trunk build's list only when its generation (`git rev-list --count`) is larger than the kept one; tests `TestANewerBuildsListReplacesTheKeptOneAndAnOlderOneHeardLaterDoesNot`, `TestRegistrationPublishesTheNewestTrunkListAndJudgesEveryModuleAgainstIt`, the module check and merge gate tests, the builder and catalogue tests. Left out: a key still holding a value (K3), a list-only change triggering a build (K3, issue 662). Checks: gofmt, go vet, go test -race, merge-check.sh (its drop check passes against the merge base; it fails against origin/main until main is brought into feat/57).
mesh-admin added 4 commits 2026-10-14 05:52:27 +00:00
Mesh and node config may hold values only for keys on a fixed, reviewed list (hq ADR 0348 clause 7, design 57 package K2, issue 661). A build reads predefined.json at the root of the repository at the commit it builds and carries it with the commit's generation; module check and the merge gate read it from the tree. (Part 1 of 2: the changes to existing files.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The list itself, read strictly (catalogue/predefined.go); the controller keeps a catalogue trunk build's list in its store when its commit's generation is larger than the one kept (migration 0098), so an older build's list heard later never replaces a newer one, and loads it with its store (hq ADR 0348 clause 7, issue 661). Part 2 of 2: the new files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part 3: the list's own reading (catalogue/predefined.go) and the tests of the build, module check, merge gate and registration (hq ADR 0348 clause 7, issue 661).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prove the list is read strictly and judges module check, the gate and registration
mesh/delivery-group group pkg/57-k2-predefined-keys rejected: a member's own check failed
mesh/merge-gate head fbcf44702cd6 merged into trunk 9932adfa00fe — fail: head fbcf44702cd6 does not merge cleanly into trunk 9932adfa00fe: in conflict test…
mesh/repo-check head fbcf44702cd6 merged into trunk 9932adfa00fe — fail: head fbcf44702cd6 does not merge cleanly into trunk 9932adfa00fe: in conflict test…
mesh/delivery superseded: a newer head of the same pull request
fbcf44702c
Part 4: the tests of the list's reading and of the controller's commands on it (hq ADR 0348 clause 7, issue 661).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Contributor

Delivery novox/mesh-controller@197e60c97bcc — delivered since 2026-10-14T06:52:44Z

Delivery plan — builds nothing: the change touches no module of the mesh's graph

Group pkg/57-k2-predefined-keys, in order: novox/mesh-catalog@ff3f8ca192 → novox/mesh-controller@197e60c97b

  • composed together: pass — the change touches no module of the mesh's graph

Transitions

  • 2026-10-14 06:43 (new) → proposed (announced): novox/mesh-controller#323's head announced
  • 2026-10-14 06:48 proposed → checked (checked): a verdict names this commit and the trunk's head as its trunk commit
  • 2026-10-14 06:48 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
  • 2026-10-14 06:52 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
  • 2026-10-14 06:52 published → delivered (done): nothing for a walk to move

The commit's note under refs/notes/mesh-plan keeps every transition: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-controller@197e60c97bcc` — **delivered** since 2026-10-14T06:52:44Z **Delivery plan** — builds nothing: the change touches no module of the mesh's graph **Group** `pkg/57-k2-predefined-keys`, in order: novox/mesh-catalog@ff3f8ca192a4 → novox/mesh-controller@197e60c97bcc - composed together: pass — the change touches no module of the mesh's graph **Transitions** - 2026-10-14 06:43 (new) → proposed (announced): novox/mesh-controller#323's head announced - 2026-10-14 06:48 proposed → checked (checked): a verdict names this commit and the trunk's head as its trunk commit - 2026-10-14 06:48 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail - 2026-10-14 06:52 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move - 2026-10-14 06:52 published → delivered (done): nothing for a walk to move The commit's note under `refs/notes/mesh-plan` keeps every transition: `git log --notes=mesh-plan`.
Author
Contributor

Merge check at fbcf4470
Judged: head fbcf44702cd6 merged into trunk 221fe5a60d1f; read beside it: mesh-catalog a44d490d974c, mesh-controller-main 3479a35462b2, mesh-host 1a2677882380, mesh-tools 954e1a53eef9

  • mesh/merge-gate: PASS — the change touches no module of the mesh's graph
  • mesh/repo-check: FAIL — its merge-check.sh failed: testdata/store-tests: ./cmd/mesh-controller TestAConsumerFailingBesideAHealthyProviderIsItsOwn is listed on main and its test still exists, but the change drops it

Run by the build seat on ace as build-1791957167170754015 (builds --log build-1791957167170754015).

--- its merge-check.sh (go toolchain)
ok  	github.com/novox/mesh-controller/cmd/mesh-builder	1.077s
ok  	github.com/novox/mesh-controller/cmd/mesh-controller	169.745s
ok  	github.com/novox/mesh-controller/examples/objectstore-provisioner	1.014s
ok  	github.com/novox/mesh-controller/examples/postgres-provisioner	1.018s
ok  	github.com/novox/mesh-controller/examples/redis-provisioner	1.013s
ok  	github.com/novox/mesh-controller/examples/route-proxy	1.115s
ok  	github.com/novox/mesh-controller/internal/artifacts	1.045s
?   	github.com/novox/mesh-controller/internal/beside	[no test files]
ok  	github.com/novox/mesh-controller/internal/broker	3.953s
ok  	github.com/novox/mesh-controller/internal/builder	38.601s
ok  	github.com/novox/mesh-controller/internal/catalogue	7.997s
ok  	github.com/novox/mesh-controller/internal/conditions	2.552s
ok  	github.com/novox/mesh-controller/internal/envfile	1.056s
ok  	github.com/novox/mesh-controller/internal/facts	1.069s
ok  	github.com/novox/mesh-controller/internal/identity	4.268s
ok  	github.com/novox/mesh-controller/internal/inventory	35.623s
ok  	github.com/novox/mesh-controller/internal/lease	17.708s
ok  	github.com/novox/mesh-controller/internal/licences	3.579s
ok  	github.com/novox/mesh-controller/internal/licences/adapters	1.054s
ok  	github.com/novox/mesh-controller/internal/link	57.848s
ok  	github.com/novox/mesh-controller/internal/lint	2.285s
ok  	github.com/novox/mesh-controller/internal/outward	1.064s
ok  	github.com/novox/mesh-controller/internal/overlay	1.047s
ok  	github.com/novox/mesh-controller/internal/secrets	1.409s
ok  	github.com/novox/mesh-controller/internal/store	3.313s
ok  	github.com/novox/mesh-controller/internal/testbus	1.211s
ok  	github.com/novox/mesh-controller/internal/token	1.016s
testdata/store-tests: ./cmd/mesh-controller TestOneProviderDownAndThreeConsumersFailingAreOneCondition is listed on main and its test still exists, but the change drops it
testdata/store-tests: ./cmd/mesh-controller TestAConsumerFailingBesideAHealthyProviderIsItsOwn is listed on main and its test still exists, but the change drops it
**Merge check** at `fbcf4470` Judged: head `fbcf44702cd6` merged into trunk `221fe5a60d1f`; read beside it: mesh-catalog `a44d490d974c`, mesh-controller-main `3479a35462b2`, mesh-host `1a2677882380`, mesh-tools `954e1a53eef9` - `mesh/merge-gate`: **PASS** — the change touches no module of the mesh's graph - `mesh/repo-check`: **FAIL** — its merge-check.sh failed: testdata/store-tests: ./cmd/mesh-controller TestAConsumerFailingBesideAHealthyProviderIsItsOwn is listed on main and its test still exists, but the change drops it Run by the build seat on ace as `build-1791957167170754015` (`builds --log build-1791957167170754015`). ``` --- its merge-check.sh (go toolchain) ok github.com/novox/mesh-controller/cmd/mesh-builder 1.077s ok github.com/novox/mesh-controller/cmd/mesh-controller 169.745s ok github.com/novox/mesh-controller/examples/objectstore-provisioner 1.014s ok github.com/novox/mesh-controller/examples/postgres-provisioner 1.018s ok github.com/novox/mesh-controller/examples/redis-provisioner 1.013s ok github.com/novox/mesh-controller/examples/route-proxy 1.115s ok github.com/novox/mesh-controller/internal/artifacts 1.045s ? github.com/novox/mesh-controller/internal/beside [no test files] ok github.com/novox/mesh-controller/internal/broker 3.953s ok github.com/novox/mesh-controller/internal/builder 38.601s ok github.com/novox/mesh-controller/internal/catalogue 7.997s ok github.com/novox/mesh-controller/internal/conditions 2.552s ok github.com/novox/mesh-controller/internal/envfile 1.056s ok github.com/novox/mesh-controller/internal/facts 1.069s ok github.com/novox/mesh-controller/internal/identity 4.268s ok github.com/novox/mesh-controller/internal/inventory 35.623s ok github.com/novox/mesh-controller/internal/lease 17.708s ok github.com/novox/mesh-controller/internal/licences 3.579s ok github.com/novox/mesh-controller/internal/licences/adapters 1.054s ok github.com/novox/mesh-controller/internal/link 57.848s ok github.com/novox/mesh-controller/internal/lint 2.285s ok github.com/novox/mesh-controller/internal/outward 1.064s ok github.com/novox/mesh-controller/internal/overlay 1.047s ok github.com/novox/mesh-controller/internal/secrets 1.409s ok github.com/novox/mesh-controller/internal/store 3.313s ok github.com/novox/mesh-controller/internal/testbus 1.211s ok github.com/novox/mesh-controller/internal/token 1.016s testdata/store-tests: ./cmd/mesh-controller TestOneProviderDownAndThreeConsumersFailingAreOneCondition is listed on main and its test still exists, but the change drops it testdata/store-tests: ./cmd/mesh-controller TestAConsumerFailingBesideAHealthyProviderIsItsOwn is listed on main and its test still exists, but the change drops it ```
mesh-admin left a comment
Author
Contributor

Verdict: APPROVE at fbcf44702c

Independent review of K2 (issue 661, ADR 0348 clause 7), controller half. Nothing in the code must change; finding 1 is a body-only edit to make before merge (the sha stays the same).

What I ran in my own worktree of fbcf447 against a throwaway PostgreSQL 18 on 127.0.0.1 (dynamic_shared_memory_type=mmap):

  • gofmt -l cmd internal examples: empty. go vet ./...: clean.
  • sh merge-check.sh: exit 1, and only at the store-tests drop check (it compares with origin/main 3479a35, which lists TestOneProviderDownAndThreeConsumersFailingAreOneCondition and TestAConsumerFailingBesideAHealthyProviderIsItsOwn; feat/57 gets them with #322). The whole suite under -race passed.
  • The same script with origin/main replaced by the merge base 1601cb17: exit 0, and all three new store tests said PASS.
  • Mutations, each failing its test: the where dropped from KeepPredefined; registration not publishing; WithTemplatesFrom judging against the published list.
  • The catalogue's merge-check.sh (mesh-catalog#291 at ff3f8ca) with this controller as MESH_GATE: exit 0. A probe with an unknown field in predefined.json: this controller refused all 128 manifests by name, while main's controller let the file through.

Answers to the review's questions:
(a) Strict read: yes. One object; DisallowUnknownFields per key; the same rules a config value has; refused whole. Build (internal/builder/builder.go:286), module check (repository root above each manifest), gate (tree root).
(b) Migration 0098: numbered right. feat/57 ends at 0097, main at 0096 (the same 0096 file), and no other branch or open pull request (#322, #315, #297, #203, #182) holds 0097 or later. Generation by git rev-list --count: sound for what is compared, because only a build that passed publishable (build.go:685, trunk only) reaches the publish at build.go:712, and a later commit on one trunk is a descendant with strictly more ancestors (a merge or a squash included). Builds clone in full (no --depth), so the count is real. See finding 3 for where it fails.
(c) The catalogue's removal check: see mesh-catalog#291.

Findings:

  1. Must, body only: "#?? on pkg/57-f3-assignment-buckets" means F3's pull request, mesh-controller#315. Edit the body before merge.
  2. Should, record it before K3: ADR 0348 clause 7 says a change to predefined.json triggers the catalogue's build. Here only a module that names a key has the file in its build source (internal/builder/builder.go:325). Today no module names one, so a change to the list alone builds nothing, and the list is published only with the next catalogue build. That contradicts the clause's wording. In practice nothing reads the published list until K3, and the module check (step 1 of the catalogue's merge check) validates the file. I judge it not a blocker for feat/57. The smallest fix is about one line: also call rootHas(PredefinedFile) for the module that publishes the list, which is mesh-config (K3). Add that condition beside manifest.NamesPredefined(); the planner then maps a change to the file onto that module. Put it as a note on issue 662, or as its own issue, so the clause holds by the release.
  3. Should: a commit count is not an order after the trunk's history is rewritten (a force push or a reset to fewer commits) or after the repository is created again. The kept list then stands until the count passes the old one. The only sign is a stdout line (predefined.go:89), and no verb resets the list. A failure to publish (generation 0, a store error) is also only printed (build.go:712-714). Raise a condition, or at least say it on the bus.
  4. Should: no test proves that an off-trunk build of the catalogue (a pull request's head) publishes nothing. The order in takeIn guarantees it today; add a test so a later reorder cannot break it unseen.
  5. For information: the forge's checks at this head: mesh/merge-gate passed with "the change touches no module of the mesh's graph" (no module is built from feat/57, so no gate ran and nothing judged itself). mesh/repo-check is red on the same store-tests drop check as my run above. The group is rejected for that reason. A recheck is needed after #322 merges.
Verdict: APPROVE at fbcf44702cd6d0c193ec2ac978da4676e9911ef1 Independent review of K2 (issue 661, ADR 0348 clause 7), controller half. Nothing in the code must change; finding 1 is a body-only edit to make before merge (the sha stays the same). What I ran in my own worktree of fbcf447 against a throwaway PostgreSQL 18 on 127.0.0.1 (dynamic_shared_memory_type=mmap): - `gofmt -l cmd internal examples`: empty. `go vet ./...`: clean. - `sh merge-check.sh`: exit 1, and only at the store-tests drop check (it compares with origin/main 3479a35, which lists TestOneProviderDownAndThreeConsumersFailingAreOneCondition and TestAConsumerFailingBesideAHealthyProviderIsItsOwn; feat/57 gets them with #322). The whole suite under -race passed. - The same script with origin/main replaced by the merge base 1601cb17: exit 0, and all three new store tests said PASS. - Mutations, each failing its test: the `where` dropped from KeepPredefined; registration not publishing; WithTemplatesFrom judging against the published list. - The catalogue's merge-check.sh (mesh-catalog#291 at ff3f8ca) with this controller as MESH_GATE: exit 0. A probe with an unknown field in predefined.json: this controller refused all 128 manifests by name, while main's controller let the file through. Answers to the review's questions: (a) Strict read: yes. One object; DisallowUnknownFields per key; the same rules a config value has; refused whole. Build (internal/builder/builder.go:286), module check (repository root above each manifest), gate (tree root). (b) Migration 0098: numbered right. feat/57 ends at 0097, main at 0096 (the same 0096 file), and no other branch or open pull request (#322, #315, #297, #203, #182) holds 0097 or later. Generation by `git rev-list --count`: sound for what is compared, because only a build that passed `publishable` (build.go:685, trunk only) reaches the publish at build.go:712, and a later commit on one trunk is a descendant with strictly more ancestors (a merge or a squash included). Builds clone in full (no --depth), so the count is real. See finding 3 for where it fails. (c) The catalogue's removal check: see mesh-catalog#291. Findings: 1. **Must, body only:** "#?? on pkg/57-f3-assignment-buckets" means F3's pull request, mesh-controller#315. Edit the body before merge. 2. **Should, record it before K3:** ADR 0348 clause 7 says a change to predefined.json triggers the catalogue's build. Here only a module that names a key has the file in its build source (internal/builder/builder.go:325). Today no module names one, so a change to the list alone builds nothing, and the list is published only with the next catalogue build. That contradicts the clause's wording. In practice nothing reads the published list until K3, and the module check (step 1 of the catalogue's merge check) validates the file. I judge it not a blocker for feat/57. The smallest fix is about one line: also call `rootHas(PredefinedFile)` for the module that publishes the list, which is mesh-config (K3). Add that condition beside `manifest.NamesPredefined()`; the planner then maps a change to the file onto that module. Put it as a note on issue 662, or as its own issue, so the clause holds by the release. 3. **Should:** a commit count is not an order after the trunk's history is rewritten (a force push or a reset to fewer commits) or after the repository is created again. The kept list then stands until the count passes the old one. The only sign is a stdout line (predefined.go:89), and no verb resets the list. A failure to publish (generation 0, a store error) is also only printed (build.go:712-714). Raise a condition, or at least say it on the bus. 4. **Should:** no test proves that an off-trunk build of the catalogue (a pull request's head) publishes nothing. The order in takeIn guarantees it today; add a test so a later reorder cannot break it unseen. 5. **For information:** the forge's checks at this head: `mesh/merge-gate` passed with "the change touches no module of the mesh's graph" (no module is built from feat/57, so no gate ran and nothing judged itself). `mesh/repo-check` is red on the same store-tests drop check as my run above. The group is rejected for that reason. A recheck is needed after #322 merges.
Author
Contributor

Merge check at fbcf4470
Judged: head fbcf44702cd6 merged into trunk 9932adfa00fe

  • mesh/merge-gate: FAIL — head fbcf44702c does not merge cleanly into trunk 9932adfa00: in conflict testdata/store-tests
  • mesh/repo-check: FAIL — head fbcf44702c does not merge cleanly into trunk 9932adfa00: in conflict testdata/store-tests

Run by the build seat on shanks as build-1791959513182174626 (builds --log build-1791959513182174626).

head fbcf44702cd6 does not merge cleanly into trunk 9932adfa00fe: in conflict testdata/store-tests
**Merge check** at `fbcf4470` Judged: head `fbcf44702cd6` merged into trunk `9932adfa00fe` - `mesh/merge-gate`: **FAIL** — head fbcf44702cd6 does not merge cleanly into trunk 9932adfa00fe: in conflict testdata/store-tests - `mesh/repo-check`: **FAIL** — head fbcf44702cd6 does not merge cleanly into trunk 9932adfa00fe: in conflict testdata/store-tests Run by the build seat on shanks as `build-1791959513182174626` (`builds --log build-1791959513182174626`). ``` head fbcf44702cd6 does not merge cleanly into trunk 9932adfa00fe: in conflict testdata/store-tests ```
mesh-admin added 1 commit 2026-10-14 06:41:53 +00:00
Take the integration branch's store-test list before merging it
mesh/delivery-group group pkg/57-k2-predefined-keys checking: 1 of 2 member(s) ready
mesh/delivery superseded: a newer head of the same pull request
mesh/merge-gate head e75c376a7dd9 merged into trunk 9932adfa00fe — pass: the change touches no module of the mesh's graph
mesh/repo-check head e75c376a7dd9 merged into trunk 9932adfa00fe — pass: its merge-check.sh passed
e75c376a7d
The two lists added lines at the same place; taking the integration branch's here lets it merge cleanly, and the K2 store tests are listed again right after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mesh-admin added 1 commit 2026-10-14 06:42:56 +00:00
List the K2 store tests again, apart from the integration branch's new lines
mesh/merge-gate head 197e60c97bcc merged into trunk 9932adfa00fe — pass: the change touches no module of the mesh's graph
mesh/repo-check head 197e60c97bcc merged into trunk 9932adfa00fe — pass: its merge-check.sh passed
mesh/delivery delivered
mesh/delivery-group group pkg/57-k2-predefined-keys delivered: every member is delivered
197e60c97b
Placed above the lines both branches added at the end of the file, so the pull request merges into feat/57-config-and-provisioning without a conflict and the merged list is the union of both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mesh-admin merged commit fcdecb4361 into feat/57-config-and-provisioning 2026-10-14 06:52:25 +00:00
mesh-admin deleted branch pkg/57-k2-predefined-keys 2026-10-14 06:52:25 +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-controller#323