engine-adapters: store-config-repo-docs — matrix, backup policy and the operator-key ledger as config-repo commits #166

Closed
opened 2026-07-29 05:09:36 +00:00 by ben · 1 comment
Owner

Parent

Engine-adapters child spec: #161 (ADRs 0102–0107; scoped on wayfinder #160 — Ben ruled live: per-family clan-lab smokes gate each family, the arc closes on a real-hardware end-to-end, tickets arm the swarm). Everything else agent-decided, post-hoc review pending.

What to build

The rebuild-surviving documents land as config-repo commits through the clan adapter's single-writer path (ADR 0103 §2): the access matrix + per-komiti role mappings (ADR 0078 §2), backup policy (ADR 0082 §1), and the operator-key ledger (ADR 0089 — public material + bookkeeping only, replica-safe; enforcement truth stays in recipient sets / principals / mesh admission).

Acceptance criteria

  • Given a policy confirm, a matrix change and a key mint/revoke, When each lands, Then it is one commit through the single writer, visible in a replica clone
  • Given a rebuild-from-checkout, When the control plane starts over the restored repo, Then policy, matrix and key ledger read back with no one re-entering anything
  • Given the key ledger document, When inspected, Then it carries no private material

Blocked by

  • engine-adapters:clan-adapter-core

Task manifest

task: engine-adapters:store-config-repo-docs
implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)"
interface: "the existing AccessMatrix / backup policy / rescue.KeyLedger ports — contracts unchanged"
seam: "owning packages' seam tests over the commit-backed store; a replica-clone integration test"
acceptance:
  - given: document writes; when: a fresh clone reads; then: state matches and nothing secret appears
depends_on: [engine-adapters:clan-adapter-core]
out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160)]
needs_human_decision: []
## Parent Engine-adapters child spec: #161 (ADRs 0102–0107; scoped on wayfinder #160 — Ben ruled live: per-family clan-lab smokes gate each family, the arc closes on a real-hardware end-to-end, tickets arm the swarm). Everything else agent-decided, post-hoc review pending. ## What to build The rebuild-surviving documents land as config-repo commits through the clan adapter's single-writer path (ADR 0103 §2): the access matrix + per-komiti role mappings (ADR 0078 §2), backup policy (ADR 0082 §1), and the operator-key ledger (ADR 0089 — public material + bookkeeping only, replica-safe; enforcement truth stays in recipient sets / principals / mesh admission). ## Acceptance criteria - [ ] Given a policy confirm, a matrix change and a key mint/revoke, When each lands, Then it is one commit through the single writer, visible in a replica clone - [ ] Given a rebuild-from-checkout, When the control plane starts over the restored repo, Then policy, matrix and key ledger read back with no one re-entering anything - [ ] Given the key ledger document, When inspected, Then it carries no private material ## Blocked by - engine-adapters:clan-adapter-core ## Task manifest ```yaml task: engine-adapters:store-config-repo-docs implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)" interface: "the existing AccessMatrix / backup policy / rescue.KeyLedger ports — contracts unchanged" seam: "owning packages' seam tests over the commit-backed store; a replica-clone integration test" acceptance: - given: document writes; when: a fresh clone reads; then: state matches and nothing secret appears depends_on: [engine-adapters:clan-adapter-core] out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160)] needs_human_decision: [] ```
Author
Owner

Done in abf4009 (on origin/main).

ADR 0103 §2 config-repo half: the three rebuild-surviving documents get their real backings over the clan single writer (clan.ConfigRepo.Mutate), via a new generic clan.RepoDoc[T] (internal/clan/repodoc.go) that mirrors the jsonstore.File contract (absent→(zero,false,nil); corrupt→refused through a newly-exported jsonstore.Decode) but commits instead of an atomic rename. Reads are straight off the working tree / a replica clone.

Port adapters, contracts unchanged:

  • member.ConfigRepoMatrix — ourcloud/access-matrix.json (ADR 0078 §2; SetPolicy upserts one service + commits)
  • backup.ConfigRepoPolicyStore — ourcloud/backup-policy.json (ADR 0082 §1; per-dataset Commit/Load, edit = new revision)
  • rescue.ConfigRepoKeyLedger — ourcloud/operator-keys.json (ADR 0089; whole-doc Load/Save; public material + bookkeeping only, no private key)

Evidence:

  • AC1 (each write = one commit through the single writer, visible in a replica clone) + AC2 (rebuild-from-checkout reads policy/matrix/key ledger back) + AC3 (key ledger carries no private material): control-plane/cmd/control-plane/configrepo_docs_integration_test.go — a policy confirm + matrix change + key mint/revoke land as four commits, a fresh git clone reads all three back, and the key doc holds hine.mesh/hine@ourcloud but nothing matching PRIVATE KEY/BEGIN OPENSSH.
  • Owning-package seams over a real git config repo: internal/member/matrixstore_test.go, internal/backup/policystore_configrepo_test.go, internal/rescue/keys_configrepo_test.go.

go build/vet/golangci-lint/full suite clean. Not wired into main.go — which ConfigRepo handle each store gets rides the compose root (#181).

Done in `abf4009` (on `origin/main`). ADR 0103 §2 config-repo half: the three rebuild-surviving documents get their real backings over the clan single writer (`clan.ConfigRepo.Mutate`), via a new generic `clan.RepoDoc[T]` (`internal/clan/repodoc.go`) that mirrors the `jsonstore.File` contract (absent→(zero,false,nil); corrupt→refused through a newly-exported `jsonstore.Decode`) but commits instead of an atomic rename. Reads are straight off the working tree / a replica clone. Port adapters, contracts unchanged: - `member.ConfigRepoMatrix` — `ourcloud/access-matrix.json` (ADR 0078 §2; `SetPolicy` upserts one service + commits) - `backup.ConfigRepoPolicyStore` — `ourcloud/backup-policy.json` (ADR 0082 §1; per-dataset `Commit`/`Load`, edit = new revision) - `rescue.ConfigRepoKeyLedger` — `ourcloud/operator-keys.json` (ADR 0089; whole-doc `Load`/`Save`; public material + bookkeeping only, no private key) Evidence: - **AC1** (each write = one commit through the single writer, visible in a replica clone) + **AC2** (rebuild-from-checkout reads policy/matrix/key ledger back) + **AC3** (key ledger carries no private material): `control-plane/cmd/control-plane/configrepo_docs_integration_test.go` — a policy confirm + matrix change + key mint/revoke land as four commits, a fresh `git clone` reads all three back, and the key doc holds `hine.mesh`/`hine@ourcloud` but nothing matching `PRIVATE KEY`/`BEGIN OPENSSH`. - Owning-package seams over a real git config repo: `internal/member/matrixstore_test.go`, `internal/backup/policystore_configrepo_test.go`, `internal/rescue/keys_configrepo_test.go`. `go build`/`vet`/`golangci-lint`/full suite clean. Not wired into `main.go` — which `ConfigRepo` handle each store gets rides the compose root (#181).
ben closed this issue 2026-07-29 20:38:14 +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#166
No description provided.