GeezerVison is showing github.com — C3 aggregator: throat healthHook extension — store the full incident record in the alerts ledger + read projection (#12599 decision b) · Issue #12602 · developing-today/code
C3 aggregator: throat healthHook extension — store the full incident record in the alerts ledger + read projection (#12599 decision b) #12602DescriptionProblem
Per the #12599 decision (option b, recorded 2026-11-22, queue task 21050): the alerts ledger is the C3 incident record of detail, and the events stream stays the thin audit index. The aggregator side of that decision does not exist yet: POST /api/alerts has no way to receive the full health-hook incident record, the alerts ledger stores none of it, and the alerts read surface cannot return it. Until this lands, C6 (#9574) has no detail read path for health-hook incidents and #9571's acceptance bullet 3 holds only in its audit-projection half.
Scope (aggregator, pm-stack/aggregator)
- Intake extension. Accept a
healthHook extension on POST /api/alerts carrying the full incident record in the C3 design shape (target, state, caller, firedAt, observedAt, incidentId, recoveryOf, evidence{…}). Validate it with a dedicated validator in the house style (validateStackHealth is the model): malformed extension = 400, store failure = logged, never fails the incident post. The extension is accepted only for source: "health-hook" and may co-ride with the stackHealth extension for that source only — amend the existing mutual-exclusion rule (needsDrew / stackHealth / decisionSet) for exactly that pairing; all other pairings stay exclusive.
- Ledger storage. Store the record in the Turso alerts ledger against the incident the post creates or closes: the down record on the
opened incident event's detail, the recovery record on the closed event's detail (or an equivalent ledger slot — name the choice in the PR and keep it queryable per incident). No new tables unless the PR justifies one.
- Read projection. Expose the stored record on the alerts read surface so C6 can fetch an incident's full record by incident: extend the
/api/alerts.json projection or add a per-incident read — follow the Design: delivered means delivered — one truth contract for the aggregator alert throat #3702 truth contract (store rows are internal; HTTP surfaces project; no secret material in any projection — the record carries none by design, since the hook never puts secret values in evidence).
- Design amendment. In the same PR, amend
doc/2026-11-20T00-46-00Z_design_c3-health-hooks/note.md: (a) the Report format section states the two-store contract from the C3 health hooks: incident evidence never reaches the events stream — throat POST drops evidence/incidentId/recoveryOf (#9571 Slice D finding) #12599 decision (stream = audit index per the append section; ledger = record of detail; hook-local JSONL = the hook's dedup/lineage working state, not a consumer surface); (b) the authHealth.status vocabulary becomes resolved|missing|unknown with unknown defined as "the lookup itself could not run; reason in detail" (C3 health hooks: incident evidence never reaches the events stream — throat POST drops evidence/incidentId/recoveryOf (#9571 Slice D finding) #12599 sub-decision 3 — the runner already emits this; do not change the runner); (c) the title template's <target> is noted as the target's display name.
Gate
Land after PR #12226 merges — it adds the health-hook AuditEvent append inside the same stackHealth intake branch this work extends. The two changes must compose: the AuditEvent append stays exactly as #12226 specifies it (this issue does not change the stream shape).
Acceptance
- A health-hook POST carrying the extension stores the full record in the ledger; a drill down + recovery pair (Slice D harness shape) reads back from the read surface with
incidentId / recoveryOf lineage and full evidence intact.
- Extension validation rejects malformed records with a 400 naming the field; posts without the extension, and the other extensions' behaviour, are unchanged.
- Tests: intake validation, storage round-trip, read projection, mutual-exclusion amendment; the existing alerts and events suites pass unchanged (the events stream shape is untouched).
- The design note amendment is in the same PR.
Refs #12599 (decision), #9571 (acceptance bullet 3), #9574 (C6 consumer), #9576 (C8, via C6). Activitydeveloping-today commented on Nov 22, 2026 dezren39 commented on Nov 22, 2026
🤖 Agent note · picked up — task 21051 (lane oc-code-01)
dezren39 commented on Nov 22, 2026
🤖 Agent note · parked — task 21051 (lane oc-code-01)
dezren39 commented on Nov 22, 2026 agent-note:v1
event: gate status — still gated, blocker updated
by: agent felix (kind muse, Muse sandbox seat; queue task 21052)
at: 2026-11-22
Gate check for this issue's chain (#12226 -> #12602 -> #12603): PR #12226 was reviewed in full and did NOT merge. Two blocking findings, both verified against the code: (1) incidents opened by the new aggregator-tick / lane-launch hook firings have no guaranteed recovery firing, so a short outage can leave a permanently open incident and an unpaired down in the audit stream; (2) the launch_one test fixture doesn't patch the hook helper, so the test suite can spawn the real hook. Full review: #12226 (review) (latest review by felix's seat).
This issue remains gated on #12226 merging with the recovery guarantee in place. The AuditEvent append this issue composes with is confirmed present and correct in #12226's diff (mapping per the design's append section; stable-id replay in EventsStore makes repeat posts safe) — no change to this issue's scope. dezren39 commented on Nov 22, 2026
Picked up by repo-worker-code on lane oc-code-02 (openchamber-scheduled-lane). Fresh check confirms #12602 is OPEN with no hard-stop labels and no implementation PR; required gate PR #12226 is still OPEN on the shared alerts-intake branch. No worktree or edits started. dezren39 commented on Nov 22, 2026
PR opened: #12646 — intake healthHook extension + validator, ledger storage on the opened/closed event details, per-incident read GET /api/alerts/:id, and the design-note amendment, all as scoped. Tests: new test/health-hook.test.ts 8/8 (validator + down/recovery round-trip drill), alerts suite 55/55, typecheck clean; the full aggregator suite's 14 failures are identical on pristine main in this environment (verified by diffing failing-file sets). Merging now; the runner half (#12603) follows on top. dezren39 commented on Nov 22, 2026
Merged: #12646 (merge commit 167b8b1dfd6e6ea166b931743a654b703a37a705); this issue auto-closed via the PR's Closes #12602.
Done-when check against the issue text:
- Gate: PR C3 health hooks: wire opencode-working into lane launchers and aggregator ticks (#9571) #12226 merged first (
fd83eaa2fb) after re-verification at its head — its AuditEvent append composes in the same stackHealth intake branch and is untouched. ✓
- Intake:
healthHook extension accepted on the throat POST, source-gated to health-hook, validated in the validateStackHealth house style, 400-before-store on malformed. ✓
- Storage: full record on the incident events'
detail — opened event (down record), closed event (recovery record) — the named slot, no new tables. ✓
- Projection: per-incident read
GET /api/alerts/:id (incident + full event history) plus the existing /api/alerts.json events projection; no secret material in records by design. ✓
- Co-ride: healthHook + stackHealth accepted (health-hook source only); all other pairings keep the pre-existing exclusion behavior. ✓
- Design amendment in the same PR: two-store contract,
authHealth vocabulary with unknown defined, <target> = display name. ✓
- Tests: new round-trip drill (down + recovery read back with lineage + evidence intact; extension-less posts byte-identical), alerts suite 55/55, typecheck clean; full-suite failure set identical to pristine main (pre-existing environmental boot-suite timeouts). ✓
Proceeding to the runner half, #12603, on top of this merge.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|