Post the comment at runPipeline's no-code-change short-circuit #306
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#306
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
Wire the post-and-mark service into the no-code-change branch of
runPipelineso that whenever the implement agent declares no code is needed, pi-loop deterministically comments on the source issue before returning success — with posting failures attributed to thewrite-backstage and aborting the run (ADR-021 §1–§5).Background
Depends on: #303, #304, #305
Today the no-code-change short-circuit (the
implementResult.noCodeChange !== undefinedblock insrc/orchestrator/services/runPipeline.ts, ~line 543) returnsok: truewithout commenting. This step makes the comment happen there and adds the run-pipeline result field downstream consumers (summary, CLI outcome) will read in a later step.closeIssueis never called and the existingcloseIssueAfterAutoMergemachinery is untouched — comment-only, per ADR-021.defaultSkippedImplementResult(the resume helper in runPipeline.ts) needs no change: it already re-readsno-code-change.json, which is what lets a resumed run re-enter this branch (ADR-021 §7).Implementation Details
In
src/orchestrator/services/runPipeline.ts, inside the no-code-change branch (after the existing log at ~line 547):const commentClient = makeCommentClient({ config, provider: issueRef.provider, originHost: origin.host })— same shape as the existing post-MR use at ~line 774.currentStage = 'write-back'before posting, so a thrown failure is attributed to write-back inerror.jsonand the console (ADR-021 §5). Note the branch currently sits withcurrentStage === 'implement'.postNoCodeChangeComment({ runDir, ref: issueRef, artifact: implementResult.noCodeChange, client: commentClient, now, logInfo }). It throws on failure (per the post service) or returns{ posted: false }when the marker pre-exists on resume — no double post.In
src/orchestrator/types/orchestrator.ts: extend the no-code-change variant of the run-pipeline result withnoCodeChangeComment?: NoCodeChangeCommentArtifact | undefined(the marker artifact when posted this run;undefinedwhen the marker pre-existed on resume). ExtendRunPipelineInputwith optional injectable seams (e.g.postNoCodeChangeComment?/readNoCodeChangeCommentSignal?-style, consistent with howmakeCommentClient/doWritebackare seams today) so this wiring is unit-testable without a live client or fs.Acceptance Criteria
noCodeChangeComment.posted: falsesemantics, run stillok: true.ok: falsewith an error report classifiable intoerror.jsonwhosestageiswrite-back; marker NOT written.defaultSkippedImplementResultreturning the artifact → short-circuit fires and posts or skips per the marker.closeIssue/closeIssueAfterAutoMergeuntouched; no newPi-Loop-Stagecommit introduced on this path.src/orchestrator/services/runPipeline.test.tscover the four cases above.Test Plan
npm testandnpm run lint.pi-loop opened and merged a pull request for this issue: #316