The descriptor's anysync block omits id (the any-sync network-configuration id) — Coa's ClientConfigSchema refuses the backend probe, every IDSS-originated build is withheld at page-ready, and matou-app's client would start with an empty id #1807

Closed
opened 2026-09-24 03:00:11 +00:00 by ben · 3 comments
Owner

Proven (cold manual founding #2 of whakatohea-demo, 2026-09-24 ~03:00 UTC, gateway 134.199.167.181, build ff4a5263)

With the logo header worked around by hand (#1806), POST https://coa.matou.nz/api/submit answered 200 accepted — and parked:

state: page-ready
autoBuildRefused: backend probe failed: config, keria-admin, keria-boot, schema-server, witness-oobi, anysync-coordinator
probes[0]: config  ok=false  detail="invalid ClientConfig: missing/invalid anysync.id"   (the other five: skipped)

The served descriptor GET https://whakatohea-demo.idss.nz/api/client-config:

"anysync": {"networkId": "N5GREZPBhqyLBUzkYviCWK4bvTss9qkRR6q8WxLPKdJQKKZC",
            "nodes": [{"peerId": "12D3KooWFZvF…", "addresses": ["whakatohea-demo.idss.nz:3001"], "types": ["coordinator"]}, … tree :3003, file :3005]}

— networkId and nodes present (#1681's writer works), no id.

Coa packages/schema/src/client-config.ts:18-24: anysync: z.object({ id: z.string(), networkId: z.string(), nodes: z.array(…) }).optional() — the block is optional, but once present id is required. server/src/backend-prober.ts:36-44 turns the zod issue into missing/invalid anysync.id and short-circuits the remaining five probes. For an auto-dispatching origin (idss) a failed probe parks the submission and records autoBuildRefused (submit.ts, story 24), so no IDSS-originated build can ever auto-dispatch on a gateway with any-sync installed.

matou-app reads the same field: frontend/src/lib/clientConfig.ts:313 return config.anysync ?? { id: '', networkId: '', nodes: [] } — the built app would run with id: ''. In any-sync, id is the network configuration id (the Mongo _id of the network document, bumped with epoch), distinct from networkId; the client's nodeconf needs both.

The value is on the box, one line above the one the writer reads:

/var/lib/anysync/etc/coordinator/network.yml
1: id: 6ab447f3ab8339c1fe66b6c1
2: networkId: "N5GREZPBhqyLBUzkYviCWK4bvTss9qkRR6q8WxLPKdJQKKZC"

(config.yml carries the same pair under network:; anysync-confapply logged id: 6ab4509aea866df71bbe09a3 epoch: 1 at boot — note that is a DIFFERENT id from network.yml's: confapply writes the network into Mongo and Mongo mints its own _id; which of the two the client must carry needs checking against any-sync's nodeconf — the coordinator serves the Mongo one to clients via NetworkConfiguration, so the descriptor should probably read it back from the coordinator/Mongo rather than from network.yml. Verify before choosing.)

The writer: internal/clan/anysync.go ~L869-935, systemd.services.anysync-descriptor — yq '.networkId' + the three peerIds off coordinator/network.yml into /var/lib/anysync/etc/client-anysync.json ({networkId, nodes}), which the control plane folds into the descriptor's anysync block every 30 s (#1681).

Fix

  1. anysync-descriptor: emit id alongside networkId — from the coordinator's live NetworkConfiguration (the id Mongo minted, matching what the coordinator hands any-sync clients) or, if they are proven equal in practice, yq '.id' network.yml. Record which and why in the unit's comment.
  2. The control plane's descriptor fold (#1681) passes id through untouched; internal/descriptorprobe (the founding tail's outside-in probe, spec #1495 story 10) validates the block the way Coa does — id, networkId, nodes[].peerId/addresses/types — so the tail catches this BEFORE submitting instead of Coa catching it after.
  3. cmd/rehearsal-coa validates ClientConfig with the same schema Coa uses (import @coa/schema is not available in Go — mirror the required paths) so the drives go red on a missing id. Today the fake accepts anything: the app legs are 45/45 green while the real Coa has never once passed a probe (#1522/#1531).
  4. Proof: curl https://<apex>/api/client-config | jq .anysync.id non-empty on a fresh founding, and a real-Coa submit whose backendReport.ok is true.

Why this matters

This is the THIRD wire mismatch on the same 200-line path in one evening (#1774 path, #1806 part header, this field), each masked by the fake. Ticket 3 in #1806 and item 3 here are the same lesson: the rehearsal Coa must refuse everything the real Coa refuses.

Relates to: #1806, #1805, #1774, #1681, #1673, #1522, #1531, #1495, ADR 0226, ADR 0062, DDR 0228.

## Proven (cold manual founding #2 of `whakatohea-demo`, 2026-09-24 ~03:00 UTC, gateway `134.199.167.181`, build `ff4a5263`) With the logo header worked around by hand (#1806), `POST https://coa.matou.nz/api/submit` answered **200 accepted** — and parked: ``` state: page-ready autoBuildRefused: backend probe failed: config, keria-admin, keria-boot, schema-server, witness-oobi, anysync-coordinator probes[0]: config ok=false detail="invalid ClientConfig: missing/invalid anysync.id" (the other five: skipped) ``` The served descriptor `GET https://whakatohea-demo.idss.nz/api/client-config`: ```json "anysync": {"networkId": "N5GREZPBhqyLBUzkYviCWK4bvTss9qkRR6q8WxLPKdJQKKZC", "nodes": [{"peerId": "12D3KooWFZvF…", "addresses": ["whakatohea-demo.idss.nz:3001"], "types": ["coordinator"]}, … tree :3003, file :3005]} ``` — `networkId` and `nodes` present (#1681's writer works), **no `id`**. Coa `packages/schema/src/client-config.ts:18-24`: `anysync: z.object({ id: z.string(), networkId: z.string(), nodes: z.array(…) }).optional()` — the block is optional, but once present `id` is required. `server/src/backend-prober.ts:36-44` turns the zod issue into `missing/invalid anysync.id` and short-circuits the remaining five probes. For an auto-dispatching origin (`idss`) a failed probe parks the submission and records `autoBuildRefused` (`submit.ts`, story 24), so **no IDSS-originated build can ever auto-dispatch** on a gateway with any-sync installed. matou-app reads the same field: `frontend/src/lib/clientConfig.ts:313` `return config.anysync ?? { id: '', networkId: '', nodes: [] }` — the built app would run with `id: ''`. In any-sync, `id` is the network *configuration* id (the Mongo `_id` of the network document, bumped with `epoch`), distinct from `networkId`; the client's nodeconf needs both. The value is on the box, one line above the one the writer reads: ``` /var/lib/anysync/etc/coordinator/network.yml 1: id: 6ab447f3ab8339c1fe66b6c1 2: networkId: "N5GREZPBhqyLBUzkYviCWK4bvTss9qkRR6q8WxLPKdJQKKZC" ``` (`config.yml` carries the same pair under `network:`; `anysync-confapply` logged `id: 6ab4509aea866df71bbe09a3 epoch: 1` at boot — note that is a DIFFERENT id from network.yml's: confapply writes the network into Mongo and Mongo mints its own `_id`; which of the two the client must carry needs checking against any-sync's `nodeconf` — the coordinator serves the Mongo one to clients via `NetworkConfiguration`, so the descriptor should probably read it back from the coordinator/Mongo rather than from network.yml. Verify before choosing.) The writer: `internal/clan/anysync.go` ~L869-935, `systemd.services.anysync-descriptor` — `yq '.networkId'` + the three `peerId`s off `coordinator/network.yml` into `/var/lib/anysync/etc/client-anysync.json` (`{networkId, nodes}`), which the control plane folds into the descriptor's `anysync` block every 30 s (#1681). ## Fix 1. `anysync-descriptor`: emit `id` alongside `networkId` — from the coordinator's live `NetworkConfiguration` (the id Mongo minted, matching what the coordinator hands any-sync clients) or, if they are proven equal in practice, `yq '.id' network.yml`. Record which and why in the unit's comment. 2. The control plane's descriptor fold (#1681) passes `id` through untouched; `internal/descriptorprobe` (the founding tail's outside-in probe, spec #1495 story 10) validates the block the way Coa does — `id`, `networkId`, `nodes[].peerId/addresses/types` — so the tail catches this BEFORE submitting instead of Coa catching it after. 3. `cmd/rehearsal-coa` validates `ClientConfig` with the same schema Coa uses (import `@coa/schema` is not available in Go — mirror the required paths) so the drives go red on a missing `id`. Today the fake accepts anything: the app legs are 45/45 green while the real Coa has never once passed a probe (#1522/#1531). 4. Proof: `curl https://<apex>/api/client-config | jq .anysync.id` non-empty on a fresh founding, and a real-Coa submit whose `backendReport.ok` is true. ## Why this matters This is the THIRD wire mismatch on the same 200-line path in one evening (#1774 path, #1806 part header, this field), each masked by the fake. Ticket 3 in #1806 and item 3 here are the same lesson: the rehearsal Coa must refuse everything the real Coa refuses. Relates to: #1806, #1805, #1774, #1681, #1673, #1522, #1531, #1495, ADR 0226, ADR 0062, DDR 0228.
Author
Owner

Which id — resolved by reading the coordinator's store (podman exec anysync-mongo mongosh, db coordinator per coordinator/config.yml:38, collection nodeConf):

{ _id: ObjectId("6ab4509aea866df71bbe09a3"), networkId: "N5GREZPBhqyLBUzkYviCWK4bvTss9qkRR6q8WxLPKdJQKKZC", enable: true, epoch: 1 }

That _id is what the coordinator serves to any-sync clients as the network configuration id (it matches the id: … epoch: 1 line anysync-confapply printed). network.yml's id: 6ab447f3ab8339c1fe66b6c1 is the id any-sync-network create minted before confapply inserted the document — Mongo minted a new _id on insert, so the two differ and the Mongo one is authoritative. Fix item 1 should therefore read the id back from the coordinator (or Mongo), not from network.yml — or make confapply insert with _id = network.yml's id so the two agree and the file is enough. Either way, the descriptor must carry 6ab4509aea866df71bbe09a3 on this box.

**Which id — resolved by reading the coordinator's store** (`podman exec anysync-mongo mongosh`, db `coordinator` per `coordinator/config.yml:38`, collection `nodeConf`): ``` { _id: ObjectId("6ab4509aea866df71bbe09a3"), networkId: "N5GREZPBhqyLBUzkYviCWK4bvTss9qkRR6q8WxLPKdJQKKZC", enable: true, epoch: 1 } ``` That `_id` is what the coordinator serves to any-sync clients as the network configuration id (it matches the `id: … epoch: 1` line `anysync-confapply` printed). `network.yml`'s `id: 6ab447f3ab8339c1fe66b6c1` is the id `any-sync-network create` minted before confapply inserted the document — Mongo minted a new `_id` on insert, so the two differ and **the Mongo one is authoritative**. Fix item 1 should therefore read the id back from the coordinator (or Mongo), not from network.yml — or make confapply insert with `_id` = network.yml's `id` so the two agree and the file is enough. Either way, the descriptor must carry `6ab4509aea866df71bbe09a3` on this box.

swarm-claim host=matou-dev-server-01 run=31489
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=31489 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1807 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1807,
  "status": "success",
  "commits": [
    "7d3d84fa88eef4852763348ea5da21a3bc6409f3"
  ],
  "changed_files": [
    "STATUS.md",
    "cmd/rehearsal-coa/coa.go",
    "cmd/rehearsal-coa/coa_test.go",
    "cmd/rehearsal-coa/main.go",
    "internal/clan/anysync.go",
    "internal/clan/anysync_test.go",
    "internal/clientconfig/clientconfig.go",
    "internal/clientconfig/clientconfig_test.go",
    "internal/descriptorprobe/prober.go",
    "internal/descriptorprobe/prober_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/clientconfig/ ./internal/descriptorprobe/ ./cmd/rehearsal-coa/ ./internal/clan/ ./internal/wireconvention/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/clientconfig/... ./internal/descriptorprobe/... ./cmd/rehearsal-coa/... ./internal/clan/...",
      "exit_code": 0
    },
    {
      "command": "gofmt -l (changed files)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Item 1 — anysync-descriptor emits id from the coordinator's live NetworkConfiguration (Mongo nodeConf._id), with the unit comment recording which id and why (ben's ruling: Mongo _id authoritative)": "internal/clan/anysync.go renderAnysyncDescriptor reads nodeConf._id via `podman exec anysync-mongo mongosh`, retried + fail-loud, and emits `id: $id`; proven by TestRenderAnySync_DescriptorCarriesNetworkConfigId",
    "Item 2 — the control-plane descriptor fold passes id through, and descriptorprobe validates the block the way Coa does (id/networkId/nodes[].peerId,addresses,types)": "orgconfig.FileAnysyncReader already passes the whole block through as map[string]any (untouched); internal/descriptorprobe now calls clientconfig.Validate; proven by TestProbeDescriptor_AnysyncBlockValidatedWhenPresent",
    "Item 3 — cmd/rehearsal-coa validates ClientConfig with the same required paths Coa uses so drives go red on a missing id": "cmd/rehearsal-coa httpBackendProbe (wired in main.go) fetches /api/client-config and parks (200 + autoBuildRefused) on a clientconfig.Validate failure; proven by TestFakeCoa_ParksWhenDescriptorMissingAnysyncId + TestFakeCoa_DispatchesWhenDescriptorValid",
    "Item 4 — live proof (curl .anysync.id non-empty on a fresh founding; real-Coa submit with backendReport.ok true)": "DEFERRED: requires lab infra with the real Coa; not runnable in the sandbox. The wire fix + strict fake + tests close the loop that masked it; live-founding proof is a rehearsal drive."
  },
  "summary": "The descriptor emits anysync.id (the coordinator's Mongo nodeConf._id), and both the founding tail's descriptor probe and the rehearsal Coa now refuse a block missing it via a shared ClientConfig validator.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1807 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1807, "status": "success", "commits": [ "7d3d84fa88eef4852763348ea5da21a3bc6409f3" ], "changed_files": [ "STATUS.md", "cmd/rehearsal-coa/coa.go", "cmd/rehearsal-coa/coa_test.go", "cmd/rehearsal-coa/main.go", "internal/clan/anysync.go", "internal/clan/anysync_test.go", "internal/clientconfig/clientconfig.go", "internal/clientconfig/clientconfig_test.go", "internal/descriptorprobe/prober.go", "internal/descriptorprobe/prober_test.go" ], "tests": [ { "command": "go test ./internal/clientconfig/ ./internal/descriptorprobe/ ./cmd/rehearsal-coa/ ./internal/clan/ ./internal/wireconvention/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/clientconfig/... ./internal/descriptorprobe/... ./cmd/rehearsal-coa/... ./internal/clan/...", "exit_code": 0 }, { "command": "gofmt -l (changed files)", "exit_code": 0 } ], "criteria": { "Item 1 — anysync-descriptor emits id from the coordinator's live NetworkConfiguration (Mongo nodeConf._id), with the unit comment recording which id and why (ben's ruling: Mongo _id authoritative)": "internal/clan/anysync.go renderAnysyncDescriptor reads nodeConf._id via `podman exec anysync-mongo mongosh`, retried + fail-loud, and emits `id: $id`; proven by TestRenderAnySync_DescriptorCarriesNetworkConfigId", "Item 2 — the control-plane descriptor fold passes id through, and descriptorprobe validates the block the way Coa does (id/networkId/nodes[].peerId,addresses,types)": "orgconfig.FileAnysyncReader already passes the whole block through as map[string]any (untouched); internal/descriptorprobe now calls clientconfig.Validate; proven by TestProbeDescriptor_AnysyncBlockValidatedWhenPresent", "Item 3 — cmd/rehearsal-coa validates ClientConfig with the same required paths Coa uses so drives go red on a missing id": "cmd/rehearsal-coa httpBackendProbe (wired in main.go) fetches /api/client-config and parks (200 + autoBuildRefused) on a clientconfig.Validate failure; proven by TestFakeCoa_ParksWhenDescriptorMissingAnysyncId + TestFakeCoa_DispatchesWhenDescriptorValid", "Item 4 — live proof (curl .anysync.id non-empty on a fresh founding; real-Coa submit with backendReport.ok true)": "DEFERRED: requires lab infra with the real Coa; not runnable in the sandbox. The wire fix + strict fake + tests close the loop that masked it; live-founding proof is a rehearsal drive." }, "summary": "The descriptor emits anysync.id (the coordinator's Mongo nodeConf._id), and both the founding tail's descriptor probe and the rehearsal Coa now refuse a block missing it via a shared ClientConfig validator.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1807
No description provided.