porch: consult raw outputs don't survive retries or builder cleanup — archive per-attempt artifacts
Problem
Consult raw review outputs are ephemeral twice over:
- Retries overwrite. Porch keeps one output file per iteration (
<id>-<phase>-iterN-<model>.txt); a retry of the same iteration overwrites the previous attempt's output at the same path. Attempt-level artifacts — the primary debugging evidence when a lane misbehaves — are destroyed by the very retry that works around the misbehavior.
- Cleanup deletes. Consult outputs live uncommitted in the builder worktree;
afx cleanup after merge deletes them all.
Field impact (adopting workspace, details scrubbed)
Three incidents of the gemini/agy impl-lane flake (hollow skip stubs with misleading self-diagnosis — see #1166) were reported across two builders and two days. Raw evidence survived for exactly one of the three, and only because a builder manually copied the logs out of the worktree before they were overwritten/cleaned. The other two incidents are unverifiable — including the first one observed (an empty-sandbox false REQUEST_CHANGES, the #1051 class), whose worktree was cleaned after merge.
Debugging intermittent consult-tooling failures (#1051, #1166, #1032/#1033 family) is evidence-starved by design today.
Proposal
- Porch archives each consult attempt's raw output (and the stub, if the attempt was skipped) to a durable per-project location — e.g.
codev/projects/<id>/consults/<phase>-iterN-attemptM-<model>.txt — never overwritten by retries.
- The archive dir is committed with the project state at the pr-ready gate (consistent with the "completion stats in status.yaml" convention), or at minimum survives in the main checkout after merge.
- Retention can be bounded (e.g. keep all attempts for the current iteration + final output per past iteration) if size is a concern; full impl prompts are ~1MB per attempt, so a cap or gitignore-with-local-retention split may be preferable to unconditional commit.
Non-goals
Fixing the flakes themselves (tracked in #1051/#1166 etc.) — this issue is about not destroying the evidence needed to fix them.
Areas: area/porch.
porch: consult raw outputs don't survive retries or builder cleanup — archive per-attempt artifacts
Problem
Consult raw review outputs are ephemeral twice over:
<id>-<phase>-iterN-<model>.txt); a retry of the same iteration overwrites the previous attempt's output at the same path. Attempt-level artifacts — the primary debugging evidence when a lane misbehaves — are destroyed by the very retry that works around the misbehavior.afx cleanupafter merge deletes them all.Field impact (adopting workspace, details scrubbed)
Three incidents of the gemini/agy impl-lane flake (hollow skip stubs with misleading self-diagnosis — see #1166) were reported across two builders and two days. Raw evidence survived for exactly one of the three, and only because a builder manually copied the logs out of the worktree before they were overwritten/cleaned. The other two incidents are unverifiable — including the first one observed (an empty-sandbox false REQUEST_CHANGES, the #1051 class), whose worktree was cleaned after merge.
Debugging intermittent consult-tooling failures (#1051, #1166, #1032/#1033 family) is evidence-starved by design today.
Proposal
codev/projects/<id>/consults/<phase>-iterN-attemptM-<model>.txt— never overwritten by retries.Non-goals
Fixing the flakes themselves (tracked in #1051/#1166 etc.) — this issue is about not destroying the evidence needed to fix them.
Areas:
area/porch.