Repository navigation
chore(loop): fix two gaps the loop's first real run exposed - #51
Conversation
… two The first real `pr-opened` run (task #48, PR #50) logged `GitHub actions executed: 2` while having executed four: `applyActions` ran the push and the PR creation in `finishRun`'s pre-flight, and only the label and comment were left in `actions` — the list the log line and the Step Summary count from. The two writes that matter most were the two the report did not mention, so the summary of a run that opened a PR read as if it had only tagged an issue. `finishRun` now keeps what the pre-flight executed and prepends it to the plan for the rest, so `actions` and `applied` describe the whole run in the order it happened (push → pr-create → label → comment). The report-boundary path is unaffected: `validatePush` refuses `pr-opened` there, so the pre-flight never runs and nothing is prepended.
…fault The first real loop PR (#50) showed the approval-required state is per *run*, not per PR: `CI` and `Loop` both sat at `completed/action_required`, and approving just the first ran CI to green while leaving `Loop` untouched — that is, the loop verified its own change without reviewing its own work. The UI button approves both, so the text now names the API path (`POST /actions/runs/<id>/approve`) and says which to pick when.
Coverage
|
|
Loop triage — PR #51 edits the loop host's own machinery ( Both claims check out read-only:
Verified: base sha Points for the reviewer.
Proposed action: label |
Two small fixes, both found by watching the loop do real work for the first time end to end: issue #48 → triage →
bugfix→ branch → PR #50. Neither is speculative.1. The run report hid the two writes that mattered
That
bugfixrun logged:Four actions, reported as two.
applyActionsruns the push and the PR creation infinishRun's pre-flight (so a failure can downgrade the outcome before it is recorded), and only the label and comment were left in theactionslist the log line and Step Summary count from. The summary of a run that opened a PR read as if it had only tagged an issue — exactly backwards for anyone auditing what the loop touched.finishRunnow keeps what the pre-flight executed and prepends it, soactionsandapplieddescribe the whole run in the order it happened:push → pr-create → label → comment.The report-boundary path is unaffected:
validatePushrefusespr-openedthere, so the pre-flight never runs and nothing is prepended.2. The docs told you to self-review
A loop PR creates two approval-gated runs, and I had written that a loop PR's checks are simply "waiting for the click". PR #50 showed the useful detail: approval is per run. Approving only
CIran it to green while leavingLoopuntouched — the loop verifies its own change without reviewing its own work.The UI's Approve workflows to run approves both; the API does them one at a time.
scripts/loop/README.mdnow names the API path and says which to pick when.Verification
finishRunthrough the realpr-openedpath against a local bare repo (git'surl.insteadOfstanding in for GitHub, a stubbedghthrough theexecseam): asserts all four actions are reported in order, thatappliedmatches, that the branch really lands, and that the task still reacheswaiting-merge. Green.All azure oracle checks passed./Test Files 22 passed).pnpm lint,pnpm fmt:check,node --checkclean.Note for the reviewer
This PR was written by me (the session), not by the loop, so it has no
loop-task:marker and is not a loop PR —pr-reviewdoes not apply. Its own CI runs without approval.