Skip to content

C3 — Health hooks: failure-triggered checks that troubleshoot and report #9571

Open

Description

@dezren39

C3 — Health hooks: failure-triggered checks that troubleshoot and report

Component of the reporting-architecture program (starter epic #9568).
Source: Drew's directive, Reports chat, 2026-11-13 09:11 CST.
Statements: S1.3.

Scope

Checks like "PM stack reachable" and "OpenCode working" stop being
interval polls and become hook scripts that fire on failure-to-connect:

  • On a failed connect (from any caller: PM stack surfaces, lane launches,
    aggregator ticks), the hook fires immediately, runs a bounded
    troubleshoot sequence (reachability, service state, auth/credential
    health, recent changes), and reports what occurred — a note to the
    queues/PM-health category chat, escalating to Reports when it is an
    exception and to the main chat when Drew is blocked.
  • The hook records the incident into the PM-stack event store so C6 can
    render an incident page and C8 can ingest it (first-appearance data for
    error strings starts here).
  • Recovery is also an event: the same hook reports the recovery (the
    watchdog's new-alert/recovery pattern, event-driven).

Boundaries / collisions

  • This is the successor to the disabled opencode-session-minder's
    detection role — hooks, not a revived cron (the Fleet CA coordinator's
    finding stands: no durable monitor covered sessions after 2026-11-08;
    this component closes that gap by trigger, not by schedule).
  • fleet-watchdog / fleet-minder keep their current duties until the hooks
    prove out; the design names the overlap and the cutover test.
  • Troubleshoot actions are bounded and named in design (read-only probes
    first; any state-changing remediation is a separate, gated step).

Acceptance

  • Merged design: trigger surface (who calls, what counts as
    failure-to-connect), probe sequence per check, report format,
    escalation rules.
  • PM-stack-reachable and OpenCode-working hooks live, with one real
    failure + recovery cycle each recorded end-to-end.
  • Incident records land in the event store in the shape C6/C8 consume.

Activity

  1. developing-today commented on Nov 13, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged — task 19037 (lane code-c)

  3. added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    priority/normalOrdinary priority (the default)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 17, 2026
  4. 412 remaining items

  5. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: parked
    task: 20918
    lane: oc-code-03
    stage: verified -> parked-prerequisite-not-ready

    Parked task 20918 for 30 minutes. Fresh state: PR #12226 remains OPEN/unmerged at 1b4e841; CodeRabbit is NEUTRAL and Proof is SKIPPED. No failure injection or cutover test is safe until Slice C merges. Resume condition: #12226 merged with required checks passing; then execute both hook failure/recovery cycles, verify C6/C8 incident shape, and maintain 14 consecutive cutover days. Keep fleet-watchdog and fleet-minder active. No worktree or code changes were made.

  6. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up queue task 20918 to revalidate the Slice D prerequisite for #9571. Will not run failure injection or cutover activity unless PR #12226 is merged with required checks passing; fleet-watchdog and fleet-minder remain active.

  7. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · resumed task 20918 for #9571

  8. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked task 20918 for prerequisite merge

  9. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Task 20918 claimed, freshly verified, and parked for 20 minutes. Issue #9571 remains OPEN; prerequisite PR #12226 remains OPEN/unmerged at 1b4e841547d1b09f44d336f45d88594afd9af3c6 (CodeRabbit NEUTRAL, Proof SKIPPED). No worktree, failure injection, or cutover activity. Keep fleet-watchdog and fleet-minder active. Resume after #12226 merges with required checks passing; then run both hook cycles, verify C6/C8 shape, and begin/continue 14 consecutive days of cutover evidence. Sandbox bookkeeping deferred to fleet reconciliation.

  10. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: picked_up
    task: 20918
    worker: repo-worker-code
    lane: oc-code-08
    origin: openchamber-scheduled-lane

    Claimed and checkpointed task 20918. Fresh verification: #9571 remains OPEN with parked lifecycle labels and no hard-stop labels. Prerequisite PR #12226 remains OPEN/unmerged at 1b4e841547d1b09f44d336f45d88594afd9af3c6; it is mergeable, but CodeRabbit is NEUTRAL and Proof SKIPPED. Slice D cannot begin before the prerequisite merges with required checks passing. No failure injection or cutover activity will run; fleet-watchdog and fleet-minder stay active.

  11. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: parked
    task: 20918
    worker: repo-worker-code
    lane: oc-code-08
    origin: openchamber-scheduled-lane

    Task 20918 parked for 20 minutes. PR #12226 remains OPEN/unmerged at 1b4e841547d1b09f44d336f45d88594afd9af3c6; CodeRabbit is NEUTRAL and Proof is SKIPPED, so required green checks are unavailable. Slice D must not run before Slice C merges. No failure injection, cutover activity, worktree, or source changes. Fleet-watchdog and fleet-minder remain active.

    Resume after #12226 merges with required checks passing; then revalidate and run both hook failure/recovery cycles, verify C6/C8 incident shape, and begin/continue the 14-day evidence window.

  12. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Picked up by felix — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while felix posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  13. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Progress from felix: still working

  14. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Progress from felix: still working

  15. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Progress from felix: still working

  16. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: slice-d-validation-landed
    by: agent felix (kind muse, Muse sandbox seat; queue task 20918, worker felix)
    at: 2026-11-22

    Slice D moved from "parked on Slice C" to validated-at-the-hook-level. PR #12600 carries the full record (doc/2026-11-22T14-55-23Z_c3-health-hooks_slice-d-validation/, with drill harness + raw evidence). Summary:

    Real failure + recovery cycles — done for both hooks (shipped runner on main 9794191, sandbox, disposable stand-ins; no production service touched):

    • pm-stack-reachable: hard down (connection refused) -> down/critical, incident d50ada41; /board 503 with intake up -> down again with the SAME incidentId (open-outage reuse); /board 200 -> up, recoveryOf lineage, recoveryDelivered true; steady state -> transient, no record. All throat POSTs captured.
    • opencode-working: nothing on the production port 13420 (verified free on this seat) -> down/warning, incident 295e4e8b; stand-in /global/health 200 -> up with lineage; steady state -> transient, no record.
    • Runner suite on main: 22 passed.

    C6/C8 shape verification — done, one real gap found. Hook-local JSONL record conforms to the design contract. PR #12226's AuditEvent mapping conforms to the design's append section (its tests run against the real EventsStore: 3 pass). BUT the full incident record never reaches the events stream: the throat POST is a reduced body and the stream's closed StreamEvent shape cannot carry evidence — C6 cannot pair recovery with down from the stream, and C8's first-appearance error strings never arrive. Filed as #12599 (design decision needed), triage packet enqueued same pass (task 21050), three minor diffs included. Acceptance bullet 3 is therefore only partially satisfiable until #12599 is decided; bullet 2 stays open until a production cycle lands in the production stream.

    Cutover — honestly not started (day 0 of 14). Read-only laptop checks: sentinel/aggregator/opencode active, all services up, hookDispatchedStates unset, no health-hook-incidents.jsonl on the laptop, zero health-hook-incident events — no hook has ever fired in production. The drill cycles validate the hooks but do not count toward the cutover (condition 3 requires cycles in the production events stream). Day 0 = first full day after PR #12226 merges AND the laptop runs the merged code with hooks firing from production callers. Nothing retired; fleet-watchdog/fleet-minder keep all duties.

    Remaining, in order: merge #12226 -> production failure/recovery cycle per hook in the production stream -> #12599 decision -> start the 14-day clock. Claim released free.

  17. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Released by felix (outcome: free). Slice D hook-level validation landed in PR #12600: real failure/recovery cycles for both hooks, C6/C8 shape verified (gap filed as #12599, task 21050). Production cycles await PR #12226 merge; 14-day cutover not started (day 0 defined on the issue).

  18. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: merged
    by: agent felix (kind muse, Muse sandbox seat; queue task 20918, worker felix)
    at: 2026-11-22

    The Slice D validation record is merged: #12600
    (doc/2026-11-22T14-55-23Z_c3-health-hooks_slice-d-validation/ — record, drill harness, and raw evidence.)

    What it establishes: both hooks ran a real failure-plus-recovery cycle end-to-end through the shipped runner against disposable stand-ins — pm-stack-reachable through down (same incidentId reused across the open outage) to a delivered recovery with correct lineage, opencode-working from a genuine down on the production port to up; steady state produces no record in both. Runner suite on main: 22 passed. Felix spot-checked the committed evidence before merge: no credential values in any artifact (the captures record authorization presence only).

    C6/C8 verdict: the hook-local record and PR #12226's AuditEvent mapping conform to the design; the one real gap — the full incident record never reaches the events stream, so C6 cannot pair a recovery with its down event from the stream — is filed as #12599 with its triage packet (task 21050) enqueued.

    Cutover: day 0 of 14, honestly. No hook has ever fired in production (read-only laptop checks: no incident JSONL, zero health-hook-incident events in the stream), and drill cycles do not count toward condition 3. Day 0 is defined in the record: the first full day after #12226 merges and the laptop runs the merged code with hooks firing from production callers. Remaining Slice D chain: merge #12226 -> one production cycle per hook in the stream -> #12599 decision -> start the clock. Nothing retired.

  19. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: decision — #12599 decided; acceptance bullet 3 unblocked in its amended form
    by: agent felix (kind muse, Muse sandbox seat; queue task 21050)
    at: 2026-11-22

    The #12599 design decision is recorded: #12599 (comment)

    Decision (option b, specified): the events stream stays the thin audit index exactly as the C3 design's append section specifies (PR #12226's projection is the whole stream contract); the alerts ledger becomes the incident record of detail — the throat POST gains a validated healthHook extension carrying the full incident record, stored in the ledger against the incident; C6 reads detail from the alerts read surface; C8 reaches the evidence through C6's incident pages/blobs. The C3 design note is amended to state the two-store contract.

    Effect on this issue: acceptance bullet 3 ("incident records land in the event store in the shape C6/C8 consume") is satisfiable as amended — the audit projection lands in the stream (via #12226), the incident record itself lands in the ledger (via the implementation issues below). The three Slice D minor diffs are dispositioned in the same decision.

    Implementation, filed and enqueued in the same pass:

    Remaining on Slice D is unchanged otherwise: merge #12226 → production cycles in the stream → these two issues → the 14-day cutover clock can start per the day-0 definition in the Slice D record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/lLarge: multi-day or open-ended; expect staged check-inskind/designA design proposal (design-architect): multi-step, phased, decision-bearingpriority/normalOrdinary priority (the default)queue/parkedQueue task is parked (waiting on CI, time, or an event)queue/queuedHas a queued queue taskstatus/parkedDeliberately paused with a recorded resume conditionstatus:in-reviewtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions