a failed deploy row persists no error detail — the fault forgets why (fail-loud gap at S11) #546

Closed
opened 2026-08-14 22:22:48 +00:00 by ben · 3 comments
Owner

Symptom

The 2026-08-14 cold-machine proof drive failed at the deploy checklist's control-plane row. Diagnosing after the fact was blind: founding-state.json persists only {"id":"control-plane","status":"failed"} — no error text, no output tail. The clan deploy's stderr streams to the UI as the running row's Detail line, which is documented live-snapshot-only ("derived at publish time and never persisted", internal/founding/deploy.go DeployRow.Detail), and the helper's stderr is captured nowhere on disk. Once the operator navigates away (or takes the S11 recover path, which tears the VM down), the only evidence of WHY the deploy failed is gone.

The deploy fault surface (ADR 0100 fail-loud) promises honest, diagnosable failure — a failed step with no persisted reason fails loud but forgets why.

Rule

When a deploy row transitions to failed, persist the failure evidence in the step record: the final error line plus a bounded tail (say the last 50–100 lines) of the streamed tool output for that row. It should survive app restart and the recover path (it describes the PREVIOUS attempt), and the S11 fault callout should render it (or offer it as expandable detail) so the operator can paste something actionable.

Proof

Force a deploy failure (e.g. unreachable guest mid-deploy); relaunch the app; the failed row's persisted record carries the error tail, and it survives choosing "delete and stand up again".

Found during the 2026-08-14 cold proof drive (#500 aftermath) — mesh + public-entry done, control-plane failed, and the cause was unrecoverable post-hoc.

## Symptom The 2026-08-14 cold-machine proof drive failed at the deploy checklist's **control-plane** row. Diagnosing after the fact was blind: `founding-state.json` persists only `{"id":"control-plane","status":"failed"}` — no error text, no output tail. The clan deploy's stderr streams to the UI as the running row's `Detail` line, which is documented live-snapshot-only ("derived at publish time and never persisted", `internal/founding/deploy.go` DeployRow.Detail), and the helper's stderr is captured nowhere on disk. Once the operator navigates away (or takes the S11 recover path, which tears the VM down), the only evidence of WHY the deploy failed is gone. The deploy fault surface (ADR 0100 fail-loud) promises honest, diagnosable failure — a failed step with no persisted reason fails loud but forgets why. ## Rule When a deploy row transitions to `failed`, persist the failure evidence in the step record: the final error line plus a bounded tail (say the last 50–100 lines) of the streamed tool output for that row. It should survive app restart and the recover path (it describes the PREVIOUS attempt), and the S11 fault callout should render it (or offer it as expandable detail) so the operator can paste something actionable. ## Proof Force a deploy failure (e.g. unreachable guest mid-deploy); relaunch the app; the failed row's persisted record carries the error tail, and it survives choosing "delete and stand up again". Found during the 2026-08-14 cold proof drive (#500 aftermath) — mesh + public-entry done, control-plane failed, and the cause was unrecoverable post-hoc.
Author
Owner

This was generated by AI during triage.

Triage

Category: bug
State: ready-for-agent

Verification (before grilling): checked the claim against the code rather than taking it at face value. The report says persisted state is bare {"id":...,"status":"failed"} with stderr captured nowhere — that's not quite right:

  • DeployFailure.Detail (a grepped error-token excerpt of the clan CLI's combined stdout+stderr, internal/clan/errors.go) is computed and is persisted to founding-state.json as part of Standup.Deploy (internal/founding/store.go). So diagnostic text does reach disk today.
  • The real gap is downstream of that: FoundingDeployOutcome.vue (the S11 failure panel) never renders failure.detail anywhere — only failure.headline, failure.noRollback, and the recovery option's own description text. The LOGGED drill-in dialog (FoundingStandup.vue) streams only a terse per-node Summary, not the excerpt.
  • Worse: the DeployRetryVM recovery path (restandFromReview) sets s.Standup = nil, which wipes the persisted Failure.Detail for the attempt that just failed — so after that recovery choice, even the on-disk copy is gone.
  • The raw combined output the excerpt is grepped from (internal/clan/cli.go Result.Output) is discarded after classification — only ~8 error-token lines survive, short of the 50–100 line tail this issue asks for.

Net: this is a rendering + retention gap, not a capture gap. The design contract already exists — docs/ux/flows/p1-founding.mermaid and docs/ux/wireframes/p1-founding/p1-s11-deploy-gateway.html both spec a failed-deploy state with a LOGGED tag/dialog carrying the deploy log with Download — so this doesn't need needs-design; the implementation just doesn't fully honor the contract yet. No .out-of-scope/ entry matches, and it isn't already-implemented.

This is a two-way door (revertible by commit, provable by test) with no host creds / live infra / design decision required, so routing ready-for-agent rather than ready-for-human or ready-for-session.

Agent Brief

Category: bug
Summary: A failed deploy step's diagnostic detail is computed and persisted but never reaches the operator, and the VM-retry recovery path destroys it — the S11 fault surface promises diagnosable failure but the operator can't see why.

Current behavior:

  • When a deploy step fails, the failure classifier grinds a short excerpt (a handful of error-token lines) out of the deploy tool's combined output and stores it as the failure's detail field, persisted alongside the deploy status.
  • The S11 failure panel does not render that detail anywhere in the UI — it shows a headline, a no-rollback flag, and the chosen recovery option's static description text.
  • The LOGGED drill-in dialog streams only a terse one-line summary per step, not the excerpt.
  • Choosing the VM-retry recovery option clears the whole standup record (to start the next attempt clean), which also erases the persisted detail describing the attempt that just failed.
  • The excerpt itself is short (~8 grepped lines); the fuller combined output it's drawn from is discarded after classification and never written anywhere.

Desired behavior:

  • The persisted failure detail for a failed deploy step is rendered to the operator on the S11 fault surface (matching the wireframe's LOGGED tag / log dialog with Download), not just implied by a static recovery-option description.
  • The detail captured is a bounded tail (roughly the last 50–100 lines) of the deploy tool's output for that step, not just a handful of grepped error-token lines — enough for the operator to paste something actionable.
  • The failure detail for the PREVIOUS attempt survives choosing the VM-retry recovery path and survives an app restart — it describes what already happened, so clearing state for the next attempt must not destroy the record of the last one.

Key interfaces:

  • The failure classification path (clan package's error/output classification) that currently produces a short grepped excerpt — widen what it captures/persists to a bounded line-count tail.
  • DeployFailure's persisted detail field — already reaches founding-state.json; make sure it (or a similarly-persisted previous-attempt record) is retained across the retry-VM recovery transition instead of being nulled out with the rest of the standup.
  • FoundingDeployOutcome.vue (S11 failure panel) — render the persisted failure detail per the wireframe's LOGGED/Download treatment.
  • The LOGGED drill-in dialog's per-step log entries — carry the fuller excerpt, not just the terse summary, for the failed step.

Acceptance criteria:

  • Forcing a deploy failure (e.g. unreachable guest mid-deploy) produces a persisted record containing a bounded tail (~50-100 lines) of the failing step's output, not just a handful of grepped lines.
  • The S11 failure UI displays that persisted detail (or offers it as expandable/downloadable detail per the wireframe), not just the recovery option's static description.
  • Choosing the VM-retry recovery path does not erase the previous attempt's persisted failure detail — it remains available describing that prior failure.
  • The persisted failure detail survives an app restart.
  • Test coverage proves persistence-across-restart and persistence-across-recovery-path (mirroring the issue's proof steps), plus a UI-level check that the S11 panel renders the detail.

Out of scope:

  • Changing where/how the clan CLI itself captures stdout/stderr (internal/clan/cli.go's combined capture is already fine as a source).
  • ADR 0100's fake-vs-real adapter wiring — unrelated to this gap despite similar "fail loud" language.
  • Any redesign of the S11 flow or wireframe — the existing contract already covers this; this is an implementation-conformance fix.
  • Non-deploy failure surfaces (mesh, public-entry) — scoped to the deploy row only, per the original report.
> *This was generated by AI during triage.* ## Triage **Category:** bug **State:** ready-for-agent **Verification (before grilling):** checked the claim against the code rather than taking it at face value. The report says persisted state is bare `{"id":...,"status":"failed"}` with stderr captured nowhere — that's not quite right: - `DeployFailure.Detail` (a grepped error-token excerpt of the clan CLI's combined stdout+stderr, `internal/clan/errors.go`) **is** computed and **is** persisted to `founding-state.json` as part of `Standup.Deploy` (`internal/founding/store.go`). So diagnostic text does reach disk today. - The real gap is downstream of that: `FoundingDeployOutcome.vue` (the S11 failure panel) never renders `failure.detail` anywhere — only `failure.headline`, `failure.noRollback`, and the recovery option's own description text. The LOGGED drill-in dialog (`FoundingStandup.vue`) streams only a terse per-node `Summary`, not the excerpt. - Worse: the `DeployRetryVM` recovery path (`restandFromReview`) sets `s.Standup = nil`, which wipes the persisted `Failure.Detail` for the attempt that just failed — so after that recovery choice, even the on-disk copy is gone. - The raw combined output the excerpt is grepped from (`internal/clan/cli.go` `Result.Output`) is discarded after classification — only ~8 error-token lines survive, short of the 50–100 line tail this issue asks for. Net: this is a **rendering + retention gap**, not a **capture gap**. The design contract already exists — `docs/ux/flows/p1-founding.mermaid` and `docs/ux/wireframes/p1-founding/p1-s11-deploy-gateway.html` both spec a failed-deploy state with a LOGGED tag/dialog carrying the deploy log with Download — so this doesn't need `needs-design`; the implementation just doesn't fully honor the contract yet. No `.out-of-scope/` entry matches, and it isn't already-implemented. This is a two-way door (revertible by commit, provable by test) with no host creds / live infra / design decision required, so routing `ready-for-agent` rather than `ready-for-human` or `ready-for-session`. ## Agent Brief **Category:** bug **Summary:** A failed deploy step's diagnostic detail is computed and persisted but never reaches the operator, and the VM-retry recovery path destroys it — the S11 fault surface promises diagnosable failure but the operator can't see why. **Current behavior:** - When a deploy step fails, the failure classifier grinds a short excerpt (a handful of error-token lines) out of the deploy tool's combined output and stores it as the failure's detail field, persisted alongside the deploy status. - The S11 failure panel does not render that detail anywhere in the UI — it shows a headline, a no-rollback flag, and the chosen recovery option's static description text. - The LOGGED drill-in dialog streams only a terse one-line summary per step, not the excerpt. - Choosing the VM-retry recovery option clears the whole standup record (to start the next attempt clean), which also erases the persisted detail describing the attempt that just failed. - The excerpt itself is short (~8 grepped lines); the fuller combined output it's drawn from is discarded after classification and never written anywhere. **Desired behavior:** - The persisted failure detail for a failed deploy step is rendered to the operator on the S11 fault surface (matching the wireframe's LOGGED tag / log dialog with Download), not just implied by a static recovery-option description. - The detail captured is a bounded tail (roughly the last 50–100 lines) of the deploy tool's output for that step, not just a handful of grepped error-token lines — enough for the operator to paste something actionable. - The failure detail for the PREVIOUS attempt survives choosing the VM-retry recovery path and survives an app restart — it describes what already happened, so clearing state for the next attempt must not destroy the record of the last one. **Key interfaces:** - The failure classification path (`clan` package's error/output classification) that currently produces a short grepped excerpt — widen what it captures/persists to a bounded line-count tail. - `DeployFailure`'s persisted detail field — already reaches `founding-state.json`; make sure it (or a similarly-persisted previous-attempt record) is retained across the retry-VM recovery transition instead of being nulled out with the rest of the standup. - `FoundingDeployOutcome.vue` (S11 failure panel) — render the persisted failure detail per the wireframe's LOGGED/Download treatment. - The LOGGED drill-in dialog's per-step log entries — carry the fuller excerpt, not just the terse summary, for the failed step. **Acceptance criteria:** - [ ] Forcing a deploy failure (e.g. unreachable guest mid-deploy) produces a persisted record containing a bounded tail (~50-100 lines) of the failing step's output, not just a handful of grepped lines. - [ ] The S11 failure UI displays that persisted detail (or offers it as expandable/downloadable detail per the wireframe), not just the recovery option's static description. - [ ] Choosing the VM-retry recovery path does not erase the previous attempt's persisted failure detail — it remains available describing that prior failure. - [ ] The persisted failure detail survives an app restart. - [ ] Test coverage proves persistence-across-restart and persistence-across-recovery-path (mirroring the issue's proof steps), plus a UI-level check that the S11 panel renders the detail. **Out of scope:** - Changing where/how the clan CLI itself captures stdout/stderr (`internal/clan/cli.go`'s combined capture is already fine as a source). - ADR 0100's fake-vs-real adapter wiring — unrelated to this gap despite similar "fail loud" language. - Any redesign of the S11 flow or wireframe — the existing contract already covers this; this is an implementation-conformance fix. - Non-deploy failure surfaces (mesh, public-entry) — scoped to the deploy row only, per the original report.
Author
Owner

swarm-claim host=matou-dev-server-01 run=6435
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=6435 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

close-report for #546 — status success

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

envelope
{
  "issue": 546,
  "status": "success",
  "commits": [
    "6a3513ea2f99648172bb912dd39892d475cba636"
  ],
  "changed_files": [
    "STATUS.md",
    "app/src/components/founding/FoundingDeployOutcome.vue",
    "app/src/lib/founding.ts",
    "app/tests/unit/foundingDeployGateway.test.ts",
    "internal/clan/adapter.go",
    "internal/clan/errors.go",
    "internal/clan/errors_detail_test.go",
    "internal/clan/testing/fake.go",
    "internal/founding/deploy.go",
    "internal/founding/deploy_test.go",
    "internal/founding/draft.go",
    "internal/founding/export_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/... ./internal/founding/...",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/clan/... ./internal/founding/...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/... ./internal/founding/... && go build ./...",
      "exit_code": 0
    },
    {
      "command": "cd app && vitest run (892 tests)",
      "exit_code": 0
    },
    {
      "command": "cd app && vue-tsc -p tsconfig.json --noEmit",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Forcing a deploy failure produces a persisted record containing a bounded tail (~50-100 lines) of the failing step's output, not just a handful of grepped lines": "clan.Failure gains Tail; classify() fills it via tail() bounded at failureTailLines=100 (internal/clan/adapter.go), carried to the persisted DeployFailure.Tail by buildDeployFailure (internal/founding/deploy.go). Pinned by TestTail_BoundsTheRawOutput, TestClassify_CarriesTailAlongsideExcerpt (internal/clan/errors_detail_test.go) and TestIssue546_FailedDeployPersistsFaultTailAcrossRestart (internal/founding/deploy_test.go).",
    "The S11 failure UI displays that persisted detail (or offers it as expandable/downloadable detail per the wireframe), not just the recovery option's static description": "FoundingDeployOutcome.vue renders faultDetail (tail, or the one-line detail when no tail) in an expandable <details data-field=fault-detail> with <pre data-field=fault-log> and a Download button (data-action=download-fault-log). Pinned by the new 'renders the persisted fault evidence' test in app/tests/unit/foundingDeployGateway.test.ts.",
    "Choosing the VM-retry recovery path does not erase the previous attempt's persisted failure detail — it remains available describing that prior failure": "restandFromReview retains st.Deploy.Failure into the new State.LastDeployFailure before clearing the stand-up (internal/founding/deploy.go, draft.go). Pinned by TestIssue546_RetryVMPreservesPreviousFaultDetail.",
    "The persisted failure detail survives an app restart": "DeployFailure.Tail and State.LastDeployFailure carry json tags and persist in founding-state.json; the MemoryStore JSON round-trip on load is the restart read. Pinned by TestIssue546_FailedDeployPersistsFaultTailAcrossRestart (reloads via LoadStateForTest and asserts the tail survives).",
    "Test coverage proves persistence-across-restart and persistence-across-recovery-path (mirroring the issue's proof steps), plus a UI-level check that the S11 panel renders the detail": "TestIssue546_FailedDeployPersistsFaultTailAcrossRestart (restart), TestIssue546_RetryVMPreservesPreviousFaultDetail (recover path), and the foundingDeployGateway UI test (S11 render) — all green."
  },
  "summary": "A failed deploy row now persists a bounded ~100-line tail of the failing step's raw output, retains it across the retry-VM recover path, and renders it as expandable/downloadable detail on the S11 fault surface.",
  "blockers": []
}
**close-report** for #546 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 546, "status": "success", "commits": [ "6a3513ea2f99648172bb912dd39892d475cba636" ], "changed_files": [ "STATUS.md", "app/src/components/founding/FoundingDeployOutcome.vue", "app/src/lib/founding.ts", "app/tests/unit/foundingDeployGateway.test.ts", "internal/clan/adapter.go", "internal/clan/errors.go", "internal/clan/errors_detail_test.go", "internal/clan/testing/fake.go", "internal/founding/deploy.go", "internal/founding/deploy_test.go", "internal/founding/draft.go", "internal/founding/export_test.go" ], "tests": [ { "command": "go test ./internal/clan/... ./internal/founding/...", "exit_code": 0 }, { "command": "golangci-lint run ./internal/clan/... ./internal/founding/...", "exit_code": 0 }, { "command": "go vet ./internal/clan/... ./internal/founding/... && go build ./...", "exit_code": 0 }, { "command": "cd app && vitest run (892 tests)", "exit_code": 0 }, { "command": "cd app && vue-tsc -p tsconfig.json --noEmit", "exit_code": 0 } ], "criteria": { "Forcing a deploy failure produces a persisted record containing a bounded tail (~50-100 lines) of the failing step's output, not just a handful of grepped lines": "clan.Failure gains Tail; classify() fills it via tail() bounded at failureTailLines=100 (internal/clan/adapter.go), carried to the persisted DeployFailure.Tail by buildDeployFailure (internal/founding/deploy.go). Pinned by TestTail_BoundsTheRawOutput, TestClassify_CarriesTailAlongsideExcerpt (internal/clan/errors_detail_test.go) and TestIssue546_FailedDeployPersistsFaultTailAcrossRestart (internal/founding/deploy_test.go).", "The S11 failure UI displays that persisted detail (or offers it as expandable/downloadable detail per the wireframe), not just the recovery option's static description": "FoundingDeployOutcome.vue renders faultDetail (tail, or the one-line detail when no tail) in an expandable <details data-field=fault-detail> with <pre data-field=fault-log> and a Download button (data-action=download-fault-log). Pinned by the new 'renders the persisted fault evidence' test in app/tests/unit/foundingDeployGateway.test.ts.", "Choosing the VM-retry recovery path does not erase the previous attempt's persisted failure detail — it remains available describing that prior failure": "restandFromReview retains st.Deploy.Failure into the new State.LastDeployFailure before clearing the stand-up (internal/founding/deploy.go, draft.go). Pinned by TestIssue546_RetryVMPreservesPreviousFaultDetail.", "The persisted failure detail survives an app restart": "DeployFailure.Tail and State.LastDeployFailure carry json tags and persist in founding-state.json; the MemoryStore JSON round-trip on load is the restart read. Pinned by TestIssue546_FailedDeployPersistsFaultTailAcrossRestart (reloads via LoadStateForTest and asserts the tail survives).", "Test coverage proves persistence-across-restart and persistence-across-recovery-path (mirroring the issue's proof steps), plus a UI-level check that the S11 panel renders the detail": "TestIssue546_FailedDeployPersistsFaultTailAcrossRestart (restart), TestIssue546_RetryVMPreservesPreviousFaultDetail (recover path), and the foundingDeployGateway UI test (S11 render) — all green." }, "summary": "A failed deploy row now persists a bounded ~100-line tail of the failing step's raw output, retains it across the retry-VM recover path, and renders it as expandable/downloadable detail on the S11 fault surface.", "blockers": [] } ``` </details>
ben closed this issue 2026-08-14 22:50:28 +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.

Dependencies

No dependencies set.

Reference
Matou/idss#546
No description provided.