idip: keri-stack-nix — KERIA + witness + schema server packaged for the gateway, doors behind the front door #771

Closed
opened 2026-08-25 04:26:47 +00:00 by ben · 3 comments
Owner

Parent

Feature spec: #767 (idip; wayfinder map #725).

What to build

The IDIP identity stack as first-class gateway services (research #727, ADRs 0196/0199, DDR 0200): KERIA, a witness, and the credential schema server packaged for NixOS — nothing KERI is in nixpkgs, so this builds the four pure-Python derivations (hio, multicommand, keri, keria) plus a NixOS module — each service with its own unit and a declared health check (ADR 0112: no declared check, no activation). Ingress: the KERIA admin, CESR, boot, witness-HTTP and schema doors served as apex subdomains behind the front door on 443 with real certificates, exempt from the ADR 0074 browser gate; /boot gated by invite-token forward-auth (the check's consumer arrives with the keria adapter — until then the gate refuses everything, fail-closed); the witness's TCP port stays private. One witness, not the 6-AID demo topology. This slice owns the version-pin decision: matou-app runs KERIA 0.2.0-rc1 / signify-ts 0.3.0-rc2 (monkey-patched), upstream is 0.4.0/0.4.0 — pick informed by prototype #732's rc1 behaviours and record the choice. This slice BLOCKS every stack consumer (slice-map ruling): the adapter, bridge and join page test against this real packaged stack, never doubles.

Acceptance criteria

  • (story 8, provisioning half) Given the module is deployed to a lab gateway, when the units start, then KERIA, the witness and the schema server each pass their own declared health check and appear as distinct units.
  • Given the front door, when the doors are probed from outside, then admin/CESR/boot/schema answer over TLS on their apex subdomains without the browser gate, /boot refuses without a live invite token (fail-closed until the adapter arrives), and the witness TCP port is unreachable publicly.
  • Given the version pin, when the stack lands, then the chosen KERIA/signify-ts versions and the reason are recorded (prototype #732's rc1 findings weighed).

Blocked by

  • bootstrap:skeleton (#23) (done — satisfied)
  • engine-adapters:clan-inventory-render (done — satisfied)

Task manifest

task: idip:keri-stack-nix
interface: 'the KERIA + witness + schema-server NixOS module: per-service units with declared health checks
  (ADR 0112), front-door ingress (apex subdomains, browser-gate exempt, /boot invite-token forward-auth
  fail-closed, witness TCP private), version pins recorded'
seam: 'nix build of the module derivations + clan-lab stand-up: health checks green, outside-in door probes
  (TLS live, /boot 403 without token, witness port closed)'
acceptance:
- given: the module deployed to a lab gateway
  when: units start
  then: KERIA/witness/schema server each pass their declared health check
- given: the front door
  when: doors probed from outside
  then: admin/CESR/boot/schema TLS-live sans browser gate; /boot refuses without a live invite token;
    witness TCP private
depends_on:
- bootstrap:skeleton
- engine-adapters:clan-inventory-render
out_of_scope:
- the conditional seed-leg wiring (IDIP chosen ⇒ provision this instead of kanidm) — seed-leg-idip
- the invite-token issuing surface — keria-adapter-core
- multi-witness pools / Mātou-run witnesses (spec Out of Scope)
needs_human_decision: []
## Parent Feature spec: #767 (idip; wayfinder map #725). ## What to build The IDIP identity stack as first-class gateway services (research #727, ADRs 0196/0199, DDR 0200): KERIA, a witness, and the credential schema server packaged for NixOS — nothing KERI is in nixpkgs, so this builds the four pure-Python derivations (hio, multicommand, keri, keria) plus a NixOS module — each service with its own unit and a declared health check (ADR 0112: no declared check, no activation). Ingress: the KERIA admin, CESR, boot, witness-HTTP and schema doors served as apex subdomains behind the front door on 443 with real certificates, exempt from the ADR 0074 browser gate; `/boot` gated by invite-token forward-auth (the check's consumer arrives with the keria adapter — until then the gate refuses everything, fail-closed); the witness's TCP port stays private. One witness, not the 6-AID demo topology. This slice owns the version-pin decision: matou-app runs KERIA 0.2.0-rc1 / signify-ts 0.3.0-rc2 (monkey-patched), upstream is 0.4.0/0.4.0 — pick informed by prototype #732's rc1 behaviours and record the choice. This slice BLOCKS every stack consumer (slice-map ruling): the adapter, bridge and join page test against this real packaged stack, never doubles. ## Acceptance criteria - [ ] (story 8, provisioning half) Given the module is deployed to a lab gateway, when the units start, then KERIA, the witness and the schema server each pass their own declared health check and appear as distinct units. - [ ] Given the front door, when the doors are probed from outside, then admin/CESR/boot/schema answer over TLS on their apex subdomains without the browser gate, `/boot` refuses without a live invite token (fail-closed until the adapter arrives), and the witness TCP port is unreachable publicly. - [ ] Given the version pin, when the stack lands, then the chosen KERIA/signify-ts versions and the reason are recorded (prototype #732's rc1 findings weighed). ## Blocked by - bootstrap:skeleton (#23) (done — satisfied) - engine-adapters:clan-inventory-render (done — satisfied) ## Task manifest ```yaml task: idip:keri-stack-nix interface: 'the KERIA + witness + schema-server NixOS module: per-service units with declared health checks (ADR 0112), front-door ingress (apex subdomains, browser-gate exempt, /boot invite-token forward-auth fail-closed, witness TCP private), version pins recorded' seam: 'nix build of the module derivations + clan-lab stand-up: health checks green, outside-in door probes (TLS live, /boot 403 without token, witness port closed)' acceptance: - given: the module deployed to a lab gateway when: units start then: KERIA/witness/schema server each pass their declared health check - given: the front door when: doors probed from outside then: admin/CESR/boot/schema TLS-live sans browser gate; /boot refuses without a live invite token; witness TCP private depends_on: - bootstrap:skeleton - engine-adapters:clan-inventory-render out_of_scope: - the conditional seed-leg wiring (IDIP chosen ⇒ provision this instead of kanidm) — seed-leg-idip - the invite-token issuing surface — keria-adapter-core - multi-witness pools / Mātou-run witnesses (spec Out of Scope) needs_human_decision: [] ```

swarm-claim host=elitebook-distributed-server-03 run=10055
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=10055 (automated multi-host claim — lowest live claim id works this ticket)

Ruled by agent under ADR 0174 — veto anytime.

Decision (the version pin this slice owns): package the stack at the matched upstream pair — KERIA 0.4.0 on keripy (keri) 1.2.13, hio 0.6.14, multicommand 1.0.0, Python 3.12, with signify-ts 0.4.0 the app-side counterpart. The matou stack's KERIA 0.2.0-rc1 / signify-ts 0.3.0-rc2 (monkey-patched) is not carried forward.

Why (weighing prototype #732's rc1 findings):

  • #732's load-bearing finding was that on KERIA 0.2.0-rc1 revocation does not propagate to a verifier agent at all — and its own conclusion was that ADR 0196's TEL re-check must be issuer-side regardless (the keria adapter answers "is this credential currently issued?"), so the rc1 propagation bug is not something we need to preserve rc1 to work around. #732 explicitly flags "KERIA 0.4.0 may improve propagation — verify at build time."
  • Research docs/research/2026-08-24-keria-stack-on-nixos.md §6 recommends pinning one keripy for both KERIA and the witness (matou runs two keripy generations — 1.2.2 + 1.1.0rc2 — in one stack); 0.4.0/1.2.13/0.4.0 is the single matched line upstream today.
  • The runtime monkey-patches (unknown-sender escrow / immediate registration notify) are dropped — whether the IDSS join flow needs them depends on the keria-adapter join path (out of scope here, keria-adapter-core); flagged for that slice, re-addable as a patches = [ ] list on the keria derivation if the join flow proves it needs them.

Why it is a two-way door: the pin is expressed as version constants in the renderer (internal/clan/keri.go), reverted by editing those constants and re-running the pin test; nothing member-facing or security-posture-widening turns on the choice, and it is provable by the nix build + the founding drive's identity legs.

What proves it: RenderKeri emits the pinned buildPythonPackage versions (asserted by TestKeriPins); the live matched-pair behaviour (revocation propagation in 0.4.0; Netbird flows per ADR 0199) rides the founding drive and the keria adapter, per the slice-map ruling that consumers test against this real packaged stack.

Recorded as design DDR ADR 0207.

**Ruled by agent under ADR 0174 — veto anytime.** **Decision (the version pin this slice owns):** package the stack at the **matched upstream pair** — **KERIA 0.4.0 on keripy (keri) 1.2.13, hio 0.6.14, multicommand 1.0.0, Python 3.12**, with **signify-ts 0.4.0** the app-side counterpart. The matou stack's KERIA 0.2.0-rc1 / signify-ts 0.3.0-rc2 (monkey-patched) is **not** carried forward. **Why (weighing prototype #732's rc1 findings):** - #732's load-bearing finding was that on **KERIA 0.2.0-rc1 revocation does not propagate to a verifier agent at all** — and its own conclusion was that ADR 0196's TEL re-check must be **issuer-side regardless** (the keria adapter answers "is this credential currently issued?"), so the rc1 propagation bug is not something we need to preserve rc1 to work around. #732 explicitly flags "KERIA 0.4.0 may improve propagation — verify at build time." - Research `docs/research/2026-08-24-keria-stack-on-nixos.md` §6 recommends pinning **one** keripy for both KERIA and the witness (matou runs two keripy generations — 1.2.2 + 1.1.0rc2 — in one stack); 0.4.0/1.2.13/0.4.0 is the single matched line upstream today. - The runtime **monkey-patches** (unknown-sender escrow / immediate registration notify) are **dropped** — whether the IDSS join flow needs them depends on the keria-adapter join path (out of scope here, `keria-adapter-core`); flagged for that slice, re-addable as a `patches = [ ]` list on the keria derivation if the join flow proves it needs them. **Why it is a two-way door:** the pin is expressed as version constants in the renderer (`internal/clan/keri.go`), reverted by editing those constants and re-running the pin test; nothing member-facing or security-posture-widening turns on the choice, and it is provable by the nix build + the founding drive's identity legs. **What proves it:** `RenderKeri` emits the pinned `buildPythonPackage` versions (asserted by `TestKeriPins`); the live matched-pair behaviour (revocation propagation in 0.4.0; Netbird flows per ADR 0199) rides the founding drive and the keria adapter, per the slice-map ruling that consumers test against this real packaged stack. Recorded as design DDR **ADR 0207**.

close-report for #771 — status success

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

envelope
{
  "issue": 771,
  "status": "success",
  "commits": [
    "65251e4895237a105891e3f94c5980ec896fdf5c"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "docs/adr/0207-design-keri-stack-version-pins.md",
    "internal/clan/frontdoor.go",
    "internal/clan/keri.go",
    "internal/clan/keri_test.go",
    "internal/controlapi/authgate.go",
    "internal/controlapi/boot_gate_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/ ./internal/controlapi/ ./internal/provision/ ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "nix-instantiate --parse (rendered keri-stack.nix + front-door.nix)",
      "exit_code": 0
    },
    {
      "command": "pre-push gate: nix develop .#go-ci (build + golangci-lint + full go test)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "story 8 — units start, KERIA/witness/schema each pass their own declared health check and appear as distinct units": "internal/clan/keri.go renders three DISTINCT systemd units (keria, keri-witness, keri-schema), each with its OWN declared health check as an ExecStartPost healthWait polling its loopback door (:3902/spec.yaml, :5642/, :7723/health) — a unit that never answers fails loud (ADR 0112/0100). Pinned by TestRenderKeri_ThreeDistinctUnitsEachWithADeclaredCheck. Live units-green rides the founding drive per the slice-map ruling (nix build of the derivations needs network absent in the sandbox).",
    "front door — admin/CESR/boot/schema TLS-live sans browser gate; /boot refuses without a live invite token (fail-closed until adapter); witness TCP private": "frontdoor.go KeriIngress renders admin/CESR/witness/schema as apex subdomains proxied to loopback with NO forward_auth (gate-exempt); /boot alone forward_auths to the control plane's /authz/idip-boot; controlapi.WithKeriBootGate(nil) (wired fail-closed in main.go) 403s every request until the keria adapter supplies a checker. The witness TCP port (5632) is never fronted and the module opens no firewall port (only 80/443 stand). Pinned by TestRenderFrontDoor_KeriDoorsUngated / _KeriBootIsInviteGatedFailClosed / _KeriWitnessTCPNotFronted and controlapi TestKeriBootGate_FailsClosedWithoutAChecker / _AllowsALiveInviteDeniesTheRest. Live TLS door probes ride the drive.",
    "version pin — chosen KERIA/signify-ts versions and reason recorded (prototype #732 rc1 findings weighed)": "docs/adr/0207-design-keri-stack-version-pins.md records the ruling (KERIA 0.4.0 / keripy 1.2.13 / hio 0.6.14 / multicommand 1.0.0 / Python 3.12 / signify-ts 0.4.0), weighing #732's rc1 revocation-propagation finding; the pins are version consts in keri.go asserted by TestKeriPins. Ruled by agent under ADR 0174 and posted to the issue thread."
  },
  "summary": "Packaged the IDIP identity stack (KERIA + one witness + schema server) as three health-checked NixOS units behind the front door on 443, with /boot fail-closed and the version pin ruled (ADR 0207).",
  "blockers": []
}
**close-report** for #771 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 771, "status": "success", "commits": [ "65251e4895237a105891e3f94c5980ec896fdf5c" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "docs/adr/0207-design-keri-stack-version-pins.md", "internal/clan/frontdoor.go", "internal/clan/keri.go", "internal/clan/keri_test.go", "internal/controlapi/authgate.go", "internal/controlapi/boot_gate_test.go" ], "tests": [ { "command": "go test ./internal/clan/ ./internal/controlapi/ ./internal/provision/ ./control-plane/...", "exit_code": 0 }, { "command": "nix-instantiate --parse (rendered keri-stack.nix + front-door.nix)", "exit_code": 0 }, { "command": "pre-push gate: nix develop .#go-ci (build + golangci-lint + full go test)", "exit_code": 0 } ], "criteria": { "story 8 — units start, KERIA/witness/schema each pass their own declared health check and appear as distinct units": "internal/clan/keri.go renders three DISTINCT systemd units (keria, keri-witness, keri-schema), each with its OWN declared health check as an ExecStartPost healthWait polling its loopback door (:3902/spec.yaml, :5642/, :7723/health) — a unit that never answers fails loud (ADR 0112/0100). Pinned by TestRenderKeri_ThreeDistinctUnitsEachWithADeclaredCheck. Live units-green rides the founding drive per the slice-map ruling (nix build of the derivations needs network absent in the sandbox).", "front door — admin/CESR/boot/schema TLS-live sans browser gate; /boot refuses without a live invite token (fail-closed until adapter); witness TCP private": "frontdoor.go KeriIngress renders admin/CESR/witness/schema as apex subdomains proxied to loopback with NO forward_auth (gate-exempt); /boot alone forward_auths to the control plane's /authz/idip-boot; controlapi.WithKeriBootGate(nil) (wired fail-closed in main.go) 403s every request until the keria adapter supplies a checker. The witness TCP port (5632) is never fronted and the module opens no firewall port (only 80/443 stand). Pinned by TestRenderFrontDoor_KeriDoorsUngated / _KeriBootIsInviteGatedFailClosed / _KeriWitnessTCPNotFronted and controlapi TestKeriBootGate_FailsClosedWithoutAChecker / _AllowsALiveInviteDeniesTheRest. Live TLS door probes ride the drive.", "version pin — chosen KERIA/signify-ts versions and reason recorded (prototype #732 rc1 findings weighed)": "docs/adr/0207-design-keri-stack-version-pins.md records the ruling (KERIA 0.4.0 / keripy 1.2.13 / hio 0.6.14 / multicommand 1.0.0 / Python 3.12 / signify-ts 0.4.0), weighing #732's rc1 revocation-propagation finding; the pins are version consts in keri.go asserted by TestKeriPins. Ruled by agent under ADR 0174 and posted to the issue thread." }, "summary": "Packaged the IDIP identity stack (KERIA + one witness + schema server) as three health-checked NixOS units behind the front door on 443, with /boot fail-closed and the version pin ruled (ADR 0207).", "blockers": [] } ``` </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.

Reference
Matou/idss#771
No description provided.