Docs stage re-runs unnecessarily on resume after a no-op run #265
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When the docs stage completes as a no-op (nothing to sync — the diff already matches the docs), it writes an empty
docs.diffbut creates noPi-Loop-Stage: 4commit. On resume,determineResumeStageWithGitrequired both a commit and a valid artifact to treatdocsas complete, so it fell through toremediate(the last stage with a commit) and re-ran the already-completed docs stage.Observed in practice:
remediatecompletes →docsruns and correctly says "No updates needed" →mrfails with a transientfetch failed. On resume,docsruns again (wasted ~31s + one LLM call) beforemrfails again.Root cause
docs.diffis written unconditionally (even empty) as the stage's documented resume marker (ADR-015 §9), but the resume algorithm didn't trust that marker on its own fordocs— it also required a commit, which a no-op docs run never produces.Fix
determineResumeStageWithGitnow treats a validdocs.diffartifact alone as sufficient completion evidence for thedocsstage, without requiring aPi-Loop-Stage: 4commit. The reset SHA falls back to theremediatestage's commit, since a no-op docs stage leaves the working tree unchanged.Scope
src/run/services/determineResumeStage.ts— core fixsrc/run/services/determineResumeStage.test.ts— updated + new unit testssrc/orchestrator/services/runPipeline.ts— stale comment updatesrc/orchestrator/services/runPipeline.resume.e2e.test.ts— updated gated e2e assertionsdocs/adr/015-documentation-sync-stage.md§9 — updated resume contract descriptionIMPLEMENTATION_PLAN.md— updated resume-integration bulletVerified:
npm test(1976/1976 passing),npm run lint(clean),npm run build(clean).