issue-265: fix docs stage resume detection for no-op runs #266
Loading…
Reference in a new issue
No description provided.
Delete branch "bug/issue-265/fix-docs-resume-no-op-detection"
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?
What & why
determineResumeStageWithGitrequired both aPi-Loop-Stage: 4git commit and a validdocs.diffartifact to treat thedocsstage as complete on resume. A no-op docs run (nothing to sync — the diff already matched the docs) never creates that commit, only writes an emptydocs.diff. This caused resume to fall through toremediate(the last stage with a commit) and needlessly re-run the already-completed docs stage — costing an extra LLM round-trip on every resume after a no-op docs stage (e.g. when themrstage failed transiently right after).docs.diffis written unconditionally (even empty) as the stage's documented resume marker (ADR-015 §9) — the resume algorithm just wasn't trusting it on its own fordocs. This PR makes it do so: a validdocs.diffartifact alone is now sufficient completion evidence fordocs, without also requiring a commit. The reset SHA falls back to theremediatestage's commit, since a no-op docs stage leaves the working tree unchanged from that point.Per-file breakdown
Modified:
src/run/services/determineResumeStage.ts— core fix: when walking stages in reverse to find the last completed one, a validdocs.diffwithout a matching commit is now treated asdocscompletion (falling back to theremediatecommit for the reset SHA), instead of falling through further back in history.src/run/services/determineResumeStage.test.ts— updated the existing no-op-docs test to assert the new (fixed)mrresume target; added a new test covering the double-no-op case (bothremediateanddocsmade no commit).src/orchestrator/services/runPipeline.ts— updated a stale comment describing the old "harmless re-run" behavior.src/orchestrator/services/runPipeline.resume.e2e.test.ts— updated the gated e2e assertions (PILOOP_E2E=1) to expect resume-to-mrregardless of whether the docs stage committed.docs/adr/015-documentation-sync-stage.md— updated §9 (Resume integration) to describe the new resume contract.IMPLEMENTATION_PLAN.md— updated the resume-integration bullet to match.Verification
npm test— 1976/1976 passingnpm run lint— cleannpm run build— cleanCloses #265