engine-adapters: clan-inventory-render — the clan-native rendering layer (production) + family-1's write-side proof #185

Closed
opened 2026-07-30 04:21:28 +00:00 by ben · 1 comment
Owner

Parent

Issue #175 (engine-adapters:smoke-clan) — split out per Ben's ruling B+C2 (2026-07-30) on the inventory-schema gap the smoke caught (the #184/#151 split precedent). Spec #161 / ADR 0102; the third real defect a family smoke has surfaced (after smoke-idp's two).

What to build

The clan-native inventory rendering layer, as production code in the clan adapter (ruling C2 — the DDR 0010 quarantine preserved: clan's fast-drifting schema is known in exactly one place; the adapter's OurCloud structured model stays the stable internal shape):

  1. Render-on-write: every Config/Vars/Supply/Enroll mutation renders the OurCloud model to clan's own native inventory.json (camelCase deploy.targetHost; OurCloud-only fields — name/role/vars specs — folded into clan's constructs or kept out of clan's file entirely, never written into it) through the existing single-writer commit path. What lands in the config repo is a file clan's CLI actually consumes.
  2. Parse-on-read: the adapter reads clan's native schema back faithfully — a round-trip of a real clan inventory is byte-stable on clan's fields and never injects OurCloud artifacts (today it destroys deploy.targetHost and injects empty name fields — the caught defect).
  3. Golden round-trip tests against a real clan flake (non-negotiable per the ruling): the smoke's failing Go round-trip test graduates into the adapter's permanent regression seam, plus goldens from the golden-lab pin's template.
  4. The write-side family-1 smoke leg (the half #175 could not honestly run): enroll via install/join, vars generate+rotate, closure seeding driven end-to-end through the real adapter against the golden clan-lab flake. Deploy/rollback stay proven via the working-tree form with the NAT honesty limit documented (per #175). Family 1 is proven only when this leg passes — this ticket gates #183 via a native dependency.

Acceptance criteria

  • Given clan's own golden inventory.json, When it round-trips through the adapter, Then clan's fields are byte-stable and no OurCloud-only field appears in the file.
  • Given an AddNode/AttachService/SetVarSpec mutation, When it commits, Then the repo's inventory.json is clan-native and clan machines update consumes it without eval error on the lab.
  • Given the write-side smoke leg on the golden lab, When enroll/vars/supply run through the real adapter, Then each passes with evidence attached (the #175 pattern).
  • Given the existing seam suites, When they run, Then every confirmed contract is untouched (the rendering layer is internal to the adapter — no seam change).

Blocked by

None — its code dependencies (#162, #164) are closed. This ticket blocks #183 (the real-hardware close-out must not run on an adapter that writes an inventory clan cannot read).

Task manifest

task: engine-adapters:clan-inventory-render
implements_seam: "docs/seams/clan.md — contract unchanged; ADR 0102's 'inventory.json as data' promise made true"
interface: "internal clan-native rendering layer (render-on-write / parse-on-read) behind the existing Config/Vars/Supply/Enroll faces"
seam: "internal/clan seam tests + golden round-trip corpus vs a real clan flake; write-side lab smoke leg"
acceptance:
  - given: clan's golden inventory
    when: round-tripped through the adapter
    then: clan fields byte-stable, no OurCloud fields injected
  - given: the write-side lab leg
    when: enroll/vars/supply drive the real adapter
    then: pass with evidence — family 1 proven
depends_on: [clan-adapter-core, clan-adapter-config-vars-supply]
out_of_scope: [seam shape changes, the NAT-blocked revision-pinned deploy form on the lab (honesty limit, documented), smoke-scaffolding shims (ruling C2 rejects them)]
needs_human_decision: []
## Parent Issue #175 (`engine-adapters:smoke-clan`) — split out per **Ben's ruling B+C2 (2026-07-30)** on the inventory-schema gap the smoke caught (the #184/#151 split precedent). Spec #161 / ADR 0102; the third real defect a family smoke has surfaced (after smoke-idp's two). ## What to build **The clan-native inventory rendering layer, as production code in the clan adapter** (ruling C2 — the DDR 0010 quarantine preserved: clan's fast-drifting schema is known in exactly one place; the adapter's OurCloud structured model stays the stable internal shape): 1. **Render-on-write:** every Config/Vars/Supply/Enroll mutation renders the OurCloud model to **clan's own native `inventory.json`** (camelCase `deploy.targetHost`; OurCloud-only fields — `name`/`role`/`vars` specs — folded into clan's constructs or kept out of clan's file entirely, never written into it) through the existing single-writer commit path. What lands in the config repo is a file clan's CLI actually consumes. 2. **Parse-on-read:** the adapter reads clan's native schema back faithfully — a round-trip of a real clan inventory is byte-stable on clan's fields and never injects OurCloud artifacts (today it destroys `deploy.targetHost` and injects empty `name` fields — the caught defect). 3. **Golden round-trip tests against a real clan flake** (non-negotiable per the ruling): the smoke's failing Go round-trip test graduates into the adapter's permanent regression seam, plus goldens from the golden-lab pin's template. 4. **The write-side family-1 smoke leg** (the half #175 could not honestly run): enroll via install/join, vars generate+rotate, closure seeding driven end-to-end through the real adapter against the golden clan-lab flake. Deploy/rollback stay proven via the working-tree form with the NAT honesty limit documented (per #175). **Family 1 is *proven* only when this leg passes** — this ticket gates #183 via a native dependency. ## Acceptance criteria - [ ] Given clan's own golden inventory.json, When it round-trips through the adapter, Then clan's fields are byte-stable and no OurCloud-only field appears in the file. - [ ] Given an AddNode/AttachService/SetVarSpec mutation, When it commits, Then the repo's inventory.json is clan-native and `clan machines update` consumes it without eval error on the lab. - [ ] Given the write-side smoke leg on the golden lab, When enroll/vars/supply run through the real adapter, Then each passes with evidence attached (the #175 pattern). - [ ] Given the existing seam suites, When they run, Then every confirmed contract is untouched (the rendering layer is internal to the adapter — no seam change). ## Blocked by None — its code dependencies (#162, #164) are closed. This ticket **blocks #183** (the real-hardware close-out must not run on an adapter that writes an inventory clan cannot read). ## Task manifest ```yaml task: engine-adapters:clan-inventory-render implements_seam: "docs/seams/clan.md — contract unchanged; ADR 0102's 'inventory.json as data' promise made true" interface: "internal clan-native rendering layer (render-on-write / parse-on-read) behind the existing Config/Vars/Supply/Enroll faces" seam: "internal/clan seam tests + golden round-trip corpus vs a real clan flake; write-side lab smoke leg" acceptance: - given: clan's golden inventory when: round-tripped through the adapter then: clan fields byte-stable, no OurCloud fields injected - given: the write-side lab leg when: enroll/vars/supply drive the real adapter then: pass with evidence — family 1 proven depends_on: [clan-adapter-core, clan-adapter-config-vars-supply] out_of_scope: [seam shape changes, the NAT-blocked revision-pinned deploy form on the lab (honesty limit, documented), smoke-scaffolding shims (ruling C2 rejects them)] needs_human_decision: [] ```
Author
Owner

Done — family 1 is proven (commit 8f36509 on main)

The clan-native inventory rendering layer is real production code and the write-side family-1 smoke leg passed through the REAL adapter on a golden clan-lab (clan-core db4db726), 2026-07-30.

The fix (DDR 0010 quarantine preserved, ruling C2)

  • internal/clan/render.go — the ONE place clan's native inventory schema lives. Render-on-write maps the stable OurCloud model → clan's native inventory.json (camelCase deploy.targetHost; unmodelled clan fields — meta/tags/machineClass/buildHost — carried verbatim so the round-trip is byte-stable on clan's schema). OurCloud-only name/role/vars are kept OUT of clan's file — homed in the .ourcloud/inventory.json sidecar, committed in the same single-writer commit. Parse-on-read reads clan's native file back faithfully and heals a legacy inline inventory on first write.
  • whole_composition.go — the one consumer that read OurCloud fields out of clan's file (the fleet projection) now reads via clan.ReadPlacement; clan's schema stays in one place. No confirmed seam changed shape.
  • errors.go — the missing_var classifier now matches clan's real "Couldn't find var" message (the decision-independent #175 fix).

Acceptance

  • AC1 — internal/clan/render_test.go: golden round-trip corpus against clan's real native shape — byte-stable on clan's fields, no OurCloud key injected, legacy-heal, instances-are-clan-native, idempotence. ✅
  • AC2 — golden lab: clan's strict inventory module (nix eval .#clan.inventory) consumes the adapter-rendered inventory without eval error, deploy.targetHost intact; clan machines list reads it. Negative control: an inline role key is a HARD clan eval error (The option 'inventory.machines.node1.role' does not exist) — the exact defect this closes. ✅
  • AC3 — golden lab, through the REAL adapter: Supply.Seed reads deploy.targetHost back and nix flake archive-s closures to node2 (parse-on-read end-to-end of the field the #175 defect destroyed); Vars.Generate seals with scoped rotation (S13 Q3). ✅
  • AC4 — every existing seam suite green; go build ./.../vet/gofmt clean. ✅

Evidence & harness

docs/spike-findings/smoke-clan-render-185.md; control-plane/cmd/smoke-clan-render + scripts/smoke-clan-render.sh (run inside nix develop on a clan-lab). Lab destroyed after.

Consequences

  • Family 1 is proven; #183's native dependency is satisfied — the real-hardware close-out is unblocked.
  • Surfaced defect filed as #186: the adapter's vars --prompt-input flag is unrecognised by the pinned clan CLI (answered/rotation generate fails) — the clan vars-CLI transport, out of this ticket's rendering scope (the #184/#185 split precedent). The seal runs through the adapter today; rotation-scoping is proven at the clan seam.
  • Substrate honesty limits carried from #175: the image-node full-system toplevel eval-gate fails assertions (used the inventory-module eval instead); the revision-pinned deploy form is NAT-blocked (deploy/rollback stay proven via the working-tree form, #182).
## Done — family 1 is proven (commit `8f36509` on `main`) The clan-native inventory rendering layer is real production code and the write-side family-1 smoke leg passed through the REAL adapter on a golden clan-lab (clan-core `db4db726`), 2026-07-30. ### The fix (DDR 0010 quarantine preserved, ruling C2) - **`internal/clan/render.go`** — the ONE place clan's native inventory schema lives. **Render-on-write** maps the stable OurCloud model → clan's native `inventory.json` (camelCase `deploy.targetHost`; unmodelled clan fields — `meta`/`tags`/`machineClass`/`buildHost` — carried verbatim so the round-trip is byte-stable on clan's schema). OurCloud-only `name`/`role`/`vars` are kept OUT of clan's file — homed in the `.ourcloud/inventory.json` **sidecar**, committed in the same single-writer commit. **Parse-on-read** reads clan's native file back faithfully and **heals** a legacy inline inventory on first write. - **`whole_composition.go`** — the one consumer that read OurCloud fields out of clan's file (the fleet projection) now reads via `clan.ReadPlacement`; clan's schema stays in one place. No confirmed seam changed shape. - **`errors.go`** — the `missing_var` classifier now matches clan's real "Couldn't find var" message (the decision-independent #175 fix). ### Acceptance - **AC1** — `internal/clan/render_test.go`: golden round-trip corpus against clan's real native shape — byte-stable on clan's fields, **no** OurCloud key injected, legacy-heal, instances-are-clan-native, idempotence. ✅ - **AC2** — golden lab: clan's strict inventory module (`nix eval .#clan.inventory`) consumes the adapter-rendered inventory **without eval error**, `deploy.targetHost` intact; `clan machines list` reads it. Negative control: an inline `role` key is a HARD clan eval error (`The option 'inventory.machines.node1.role' does not exist`) — the exact defect this closes. ✅ - **AC3** — golden lab, through the REAL adapter: `Supply.Seed` reads `deploy.targetHost` back and `nix flake archive`-s closures to node2 (parse-on-read end-to-end of the field the #175 defect destroyed); `Vars.Generate` seals with scoped rotation (S13 Q3). ✅ - **AC4** — every existing seam suite green; `go build ./...`/`vet`/gofmt clean. ✅ ### Evidence & harness `docs/spike-findings/smoke-clan-render-185.md`; `control-plane/cmd/smoke-clan-render` + `scripts/smoke-clan-render.sh` (run inside `nix develop` on a clan-lab). Lab destroyed after. ### Consequences - **Family 1 is proven; #183's native dependency is satisfied** — the real-hardware close-out is unblocked. - Surfaced defect filed as **#186**: the adapter's vars `--prompt-input` flag is unrecognised by the pinned clan CLI (answered/rotation generate fails) — the clan vars-CLI transport, out of this ticket's rendering scope (the #184/#185 split precedent). The seal runs through the adapter today; rotation-scoping is proven at the clan seam. - Substrate honesty limits carried from #175: the image-node full-system toplevel eval-gate fails assertions (used the inventory-module eval instead); the revision-pinned deploy form is NAT-blocked (deploy/rollback stay proven via the working-tree form, #182).
ben closed this issue 2026-07-30 05:28:34 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#185
No description provided.