observability: certsource-presented-leaf — the certificate source seam — what does this name PRESENT? — and its TLS-presentation adapter #812

Closed
opened 2026-08-25 10:58:55 +00:00 by matou-build-agent · 2 comments

Parent

Feature spec: #792 — control-panel observability child spec: network (P11) (DDR 0204).
Design ticket #761; slice-map fan-in #770; wayfinder map #7.
Slice certsource-presented-leaf of docs/slices/observability.yaml; covers spec #792 stories 6–11 (source half), 45–46.

What to build

The certificate source is seamed at the question the maramataka failure actually asked: what does
this name present?
One interface returning, per served name, the subject, the issuer as a
display name, the covered names (for the host count) and the validity window — read from the
leaf the door actually presents.

An unreadable name is reported honestly rather than omitted silently, and an expiry is never
fabricated (ADR 0100).

Rejected: reading Caddy's certmagic store off disk. The store is the material, not the truth —
a stored certificate the door is not serving is exactly the case that misleads — and it would
couple the control plane to the certmagic layout and the caddy user's file permissions, inheriting
docs/GOTCHAS.md #32, a storage-layout hazard the product surface has no business carrying.
certpersist keeps its harvest-time job unchanged.

Read docs/GOTCHAS.md #32 before touching the certificate path.

Acceptance criteria

  • (story 46) Given the certificate source seam, when it reads, then it reports per served name: the subject, the issuer as a display name, the covered names, and the validity window — from the leaf the door actually presents.
  • (story 46) Given a name that cannot be read, then it reports that name's absence honestly rather than omitting it silently, and never fabricates an expiry.
  • (story 25) Given a private-path community whose leaf is signed by the community's own CA, then the issuer display name carries the community's CA — the adapter reports it as the door presents it and invents no vendor noun.
  • (story 11) Given a community that re-used its persisted certificate store across a re-founding (ADR 0176), then the read carries the certificates' own dates — the source states facts and adds no re-founding narrative.
  • Given certpersist, then its harvest-time job is unchanged by this slice.
  • Given the adapter, then it performs a TLS presentation read and does not read Caddy's certmagic store off disk.

Blocked by

  • founding:deploy-gateway (#57 — done, satisfied)

Task manifest

task: observability:certsource-presented-leaf
interface: a certificate source interface — `what does this name present?` — returning per served name
  the subject, issuer display name, covered names and validity window, plus an honest absence for an unreadable
  name; with a v1 TLS-presentation adapter
seam: 'Go unit tests for the adapter against a **scripted TLS presentation** (prior art `heartbeat_test.go`,
  `monitor_test.go`): issuer / expiry / covered names parsed from the presented leaf; an unreadable name
  reported rather than omitted; no expiry ever fabricated; `certpersist` untouched'
acceptance:
- given: a served name presenting a leaf covering nine hosts
  when: the source reads
  then: subject, issuer display name, nine covered names and the validity window are reported
- given: a served name that cannot be read
  when: the source reads
  then: that name's absence is reported honestly and no expiry is fabricated
- given: a private-path leaf signed by the community's own CA
  when: the source reads
  then: the issuer display name is what the door presents
- given: the certmagic store on disk
  when: the adapter runs
  then: it is not read — the adapter reads the presented leaf
depends_on:
- founding:deploy-gateway
out_of_scope:
- certificate lifecycle mechanics — the ACME account, rate-limit budgets, harvest/seed (`certpersist`
  keeps that job)
- the device-certificate inventory (enroll/Fleet's world)
- the community CA's root-key posture and expiry (rescue's recovery readiness)
- 'reading Caddy''s certmagic store (explicitly rejected; GOTCHAS #32)'
- any renew lever — renewal is an automatic loop
needs_human_decision: []

Emitted by /to-tickets over docs/slices/observability.yaml in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.

## Parent Feature spec: **#792** — control-panel observability child spec: network (P11) (DDR 0204). Design ticket #761; slice-map fan-in **#770**; wayfinder map #7. Slice `certsource-presented-leaf` of `docs/slices/observability.yaml`; covers spec #792 stories 6–11 (source half), 45–46. ## What to build The certificate source is seamed at the question the maramataka failure actually asked: **what does this name present?** One interface returning, per served name, the subject, the issuer as a **display name**, the covered names (for the host count) and the validity window — read from the leaf **the door actually presents**. An unreadable name is **reported honestly** rather than omitted silently, and an expiry is never fabricated (ADR 0100). **Rejected: reading Caddy's certmagic store off disk.** The store is the material, not the truth — a stored certificate the door is not serving is exactly the case that misleads — and it would couple the control plane to the certmagic layout and the caddy user's file permissions, inheriting `docs/GOTCHAS.md` #32, a storage-layout hazard the product surface has no business carrying. `certpersist` keeps its harvest-time job unchanged. Read `docs/GOTCHAS.md` #32 before touching the certificate path. ## Acceptance criteria - [ ] (story 46) Given the certificate source seam, when it reads, then it reports per served name: the subject, the issuer as a display name, the covered names, and the validity window — from the leaf the door actually presents. - [ ] (story 46) Given a name that cannot be read, then it reports that name's absence **honestly** rather than omitting it silently, and **never fabricates an expiry**. - [ ] (story 25) Given a private-path community whose leaf is signed by the community's own CA, then the issuer display name carries the community's CA — the adapter reports it as the door presents it and invents no vendor noun. - [ ] (story 11) Given a community that re-used its persisted certificate store across a re-founding (ADR 0176), then the read carries the certificates' own dates — the source states facts and adds no re-founding narrative. - [ ] Given `certpersist`, then its harvest-time job is unchanged by this slice. - [ ] Given the adapter, then it performs a TLS presentation read and **does not** read Caddy's certmagic store off disk. ## Blocked by - `founding:deploy-gateway` (#57 — done, satisfied) ## Task manifest ```yaml task: observability:certsource-presented-leaf interface: a certificate source interface — `what does this name present?` — returning per served name the subject, issuer display name, covered names and validity window, plus an honest absence for an unreadable name; with a v1 TLS-presentation adapter seam: 'Go unit tests for the adapter against a **scripted TLS presentation** (prior art `heartbeat_test.go`, `monitor_test.go`): issuer / expiry / covered names parsed from the presented leaf; an unreadable name reported rather than omitted; no expiry ever fabricated; `certpersist` untouched' acceptance: - given: a served name presenting a leaf covering nine hosts when: the source reads then: subject, issuer display name, nine covered names and the validity window are reported - given: a served name that cannot be read when: the source reads then: that name's absence is reported honestly and no expiry is fabricated - given: a private-path leaf signed by the community's own CA when: the source reads then: the issuer display name is what the door presents - given: the certmagic store on disk when: the adapter runs then: it is not read — the adapter reads the presented leaf depends_on: - founding:deploy-gateway out_of_scope: - certificate lifecycle mechanics — the ACME account, rate-limit budgets, harvest/seed (`certpersist` keeps that job) - the device-certificate inventory (enroll/Fleet's world) - the community CA's root-key posture and expiry (rescue's recovery readiness) - 'reading Caddy''s certmagic store (explicitly rejected; GOTCHAS #32)' - any renew lever — renewal is an automatic loop needs_human_decision: [] ``` --- *Emitted by `/to-tickets` over `docs/slices/observability.yaml` in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.*
Author
Member

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

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

close-report for #812 — status success

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

envelope
{
  "issue": 812,
  "status": "success",
  "commits": [
    "cf9b91e"
  ],
  "changed_files": [
    "internal/certsource/certsource.go",
    "internal/certsource/certsource_test.go",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/certsource/ ./internal/certpersist/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go vet ./internal/certsource/ && go build ./... && golangci-lint run ./internal/certsource/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "story 46 — reports per served name subject, issuer display name, covered names, validity window from the leaf the door presents": "internal/certsource/certsource.go read()/Leaf; test TestPresent_ReportsSubjectIssuerCoveredNamesAndWindow (nine covered names, subject, issuer 'R3', window)",
    "story 46 — an unreadable name reported honestly, never fabricates an expiry": "Reading.Absence set with Leaf nil on handshake error and on empty presentation; test TestPresent_UnreadableNameReportedHonestlyNeverFabricatesExpiry (Leaf structurally absent so no window invented)",
    "story 25 — private-path leaf's issuer display name is the community's own CA verbatim, no vendor noun": "issuerDisplay() reports leaf.Issuer.CommonName verbatim; test TestPresent_PrivatePathIssuerIsWhatTheDoorPresents (issuer == 'IDSS community CA — Te Whānau')",
    "story 11 — re-founded persisted certificate carries its own original dates, no re-founding narrative": "NotBefore/NotAfter copied verbatim, no derived fields; test TestPresent_RefoundedStoreCarriesTheCertificatesOwnDates",
    "certpersist harvest-time job unchanged": "git diff shows no change under internal/certpersist/; ./internal/certpersist tests green",
    "adapter performs a TLS presentation read and does NOT read Caddy's certmagic store off disk": "TLSSource.dialAndPresent reads ConnectionState().PeerCertificates, no filesystem access; test TestPresent_ReadsPresentedLeafNotCertmagicStoreOnDisk (a different stale leaf in a certmagic-shaped store on disk is not consulted)"
  },
  "summary": "internal/certsource: a certificate Source seam answering 'what does this name present?' with a v1 TLS-presentation adapter that reads the presented leaf, reports an unreadable name honestly, never fabricates an expiry, and never reads the certmagic store on disk.",
  "blockers": []
}
**close-report** for #812 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 812, "status": "success", "commits": [ "cf9b91e" ], "changed_files": [ "internal/certsource/certsource.go", "internal/certsource/certsource_test.go", "STATUS.md" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/certsource/ ./internal/certpersist/", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go vet ./internal/certsource/ && go build ./... && golangci-lint run ./internal/certsource/", "exit_code": 0 } ], "criteria": { "story 46 — reports per served name subject, issuer display name, covered names, validity window from the leaf the door presents": "internal/certsource/certsource.go read()/Leaf; test TestPresent_ReportsSubjectIssuerCoveredNamesAndWindow (nine covered names, subject, issuer 'R3', window)", "story 46 — an unreadable name reported honestly, never fabricates an expiry": "Reading.Absence set with Leaf nil on handshake error and on empty presentation; test TestPresent_UnreadableNameReportedHonestlyNeverFabricatesExpiry (Leaf structurally absent so no window invented)", "story 25 — private-path leaf's issuer display name is the community's own CA verbatim, no vendor noun": "issuerDisplay() reports leaf.Issuer.CommonName verbatim; test TestPresent_PrivatePathIssuerIsWhatTheDoorPresents (issuer == 'IDSS community CA — Te Whānau')", "story 11 — re-founded persisted certificate carries its own original dates, no re-founding narrative": "NotBefore/NotAfter copied verbatim, no derived fields; test TestPresent_RefoundedStoreCarriesTheCertificatesOwnDates", "certpersist harvest-time job unchanged": "git diff shows no change under internal/certpersist/; ./internal/certpersist tests green", "adapter performs a TLS presentation read and does NOT read Caddy's certmagic store off disk": "TLSSource.dialAndPresent reads ConnectionState().PeerCertificates, no filesystem access; test TestPresent_ReadsPresentedLeafNotCertmagicStoreOnDisk (a different stale leaf in a certmagic-shaped store on disk is not consulted)" }, "summary": "internal/certsource: a certificate Source seam answering 'what does this name present?' with a v1 TLS-presentation adapter that reads the presented leaf, reports an unreadable name honestly, never fabricates an expiry, and never reads the certmagic store on disk.", "blockers": [] } ``` </details>
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#812
No description provided.