Resume mapping: treat a valid no-code-change.json as implement-complete evidence #308
Labels
No labels
batch
bug
chore
documentation
enhancement
pi-loop
ready
resume
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-loop#308
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
Teach resume that a valid
no-code-change.jsonmeans the implement stage completed, so after a fatal comment-post failure the run resumes atreview— never re-running the implement LLM — and the short-circuit re-fires to (re)post or skip per the marker (ADR-021 §7).Background
Depends on: #306
The no-code-change path never writes
implementation.diffand never creates aPi-Loop-Stage: 1commit, so today's resume machinery falls back to artifact detection and would resume atimplement— re-invoking the LLM unnecessarily. The fix mirrors the existingisMrStageCompletepattern: treat the no-code-change artifact as implement-complete evidence.A fatal comment failure writes
error.jsonand nomr-result.json, which already marks the run incomplete (src/run/services/findIncompleteRun.ts— no change needed).Expected resume trace after this change: fatal comment failure →
error.jsonwritten → resume detects implement complete viano-code-change.json; review/remediate/docs/mr artifacts absent → resume atreview(the first stage after implement); pipeline logic skips implement viadefaultSkippedImplementResult(which re-reads the artifact) → short-circuit re-fires → marker check: absent → post; present → skip →ok: true.Implementation Details
In
src/run/services/determineResumeStage.ts:isImplementStageComplete(runDir): boolean— mirroringisMrStageComplete: returnstruewhenimplementation.diffis valid orno-code-change.jsonis present and valid (areadNoCodeChangeSignal-style check). A valid artifact means implement finished with its no-code verdict — there is nothing to re-run.implemententry wherever the map/isArtifactValidis consulted: indetermineResumeStartStage(iterate pastimplementwhen its diff is missing but the artifact is valid) and in theallArtifactsValidpre-check insidedetermineResumeStageWithGit.findLastStageCommit(IMPLEMENT_STAGE)stays absent and the resume result carrieslastStageCommitSha: undefined(working tree trusted as-is — it is clean by construction on this path).src/run/services/findIncompleteRun.ts: no change.Acceptance Criteria
determineResumeStartStagewithimplementation.diffabsent +no-code-change.jsonvalid → resumes atreview, notimplement.determineResumeStageWithGit(no stage commits) →{ resumeFromStage: 'review', lastStageCommitSha: undefined }.no-code-change.jsondoes NOT count as implement-complete (still resumes atimplement).src/run/services/determineResumeStage.test.ts; all existing resume tests still pass.Test Plan
npm testandnpm run lint.