Repository navigation
ci(review): count only a completed review, not one that stated its mode - #740
Conversation
The verify step passed any bot comment citing this run that contained 'Review mode:'. On taskless/taskless #619 (run 47226766621) the model wrote that line into its progress checklist, stopped after 11 turns, and the action still rewrote the header to 'Claude finished', so an unfinished review reported success. The prompt now requires 'Review status: complete' as the last line of the top-level comment, and the step accepts a comment only if it ends on that line and shows no unchecked '- [ ]' item and no 'in progress' heading outside fenced code. The marker is plain text because the action's update_claude_comment tool strips HTML comments. The focus workflow's copy of the step gets the same fix with 'Focus status: complete'.
|
@claude /review |
|
Claude finished @aibex-agent[bot]'s task in 4m 38s —— View job Review mode: incremental — read 0 prior review thread(s) before reviewing.
SummaryThis hardens the two on-demand review/focus workflows so the verify step requires proof a review/focus pass actually finished, not just that it started (the taskless/taskless #619 failure mode: the mode line got written into an in-progress checklist, the run stopped early, and the old Walked through both embedded Python checkers (
No correctness, security, or test-adequacy issues beyond that nit. The duplication between the two workflow files is intentional and explained in the comments (no shared composite action, to avoid loading from the PR's contributor-authored tree with a write token) — consistent with the rest of this file's existing pattern. |
|
|
||
| path, run_id, mode_line, done_line = sys.argv[1:5] | ||
| this_run = re.compile(r"runs/" + re.escape(run_id) + r"(?![0-9])") | ||
| fenced = re.compile(r"^[ \t]*(```|~~~).*?^[ \t]*\1", re.M | re.S) |
There was a problem hiding this comment.
[New] Minor/low-confidence: the fence-stripping regex captures only the first 3 fence characters as group 1 (``` or ~~~), so a 4+ backtick opening fence (used to nest a literal triple-backtick example inside) isn't matched as a unit — the extra backtick is consumed by the lazy .*?, and the closing-fence search can then match an inner triple-backtick line instead of the real outer closer. That would leave part of the nested block outside the stripped region, so a - [ ] or #-heading inside it could falsely fail the completion check. This requires a fairly unusual comment shape (4+ backtick fence nesting a 3-backtick example) that seems unlikely from this bot's own output, so not blocking — just flagging for awareness since the checker is meant to fail closed on exactly this kind of false negative.
There was a problem hiding this comment.
Fixed in b7f4245: the opener now captures the full run ({3,} / ~{3,}) and the closer must repeat it, so a four-backtick fence nesting a triple-backtick example is stripped whole. Applied to both workflows; a nested fixture now strips cleanly while an unfenced - [ ] is still caught.
— AI Coding Agent
A fence opened with four backticks to nest a triple-backtick example was closed at the inner fence, leaving the rest of the block to the checklist and heading tests. Match the opener's full run and require the closer to repeat it, as CommonMark does.
The on-demand review's verify step passed any bot comment that cited this run and contained
Review mode:. On taskless/taskless #619 (run 47226766621) the model wrote that line into its progress checklist early, stopped after 11 turns and 2 Bash denials with no inline comments and no summary, and the action still rewrote the header to "Claude finished ... View job". The comment ended on### Review in progresswith unchecked items, and the status said "Review posted".Change
Review status: completeas the last line of the top-level comment, written only in the final update.@json/ run-id anchoring / Bot-only filtering, and now passes a comment only if it has the mode line, ends on the completion line, and shows no unchecked- [ ]item and no#-heading containing "in progress" outside fenced code. It logs reason codes, never comment text, and fails closed.update_claude_commenttool runs the body throughsanitizeContent, which strips<!-- -->(checked at the pinned0a8d3c94).claude-code-focus-on-demand.ymlgets the same fix withFocus status: complete, since the two copies are meant to stay in step.Tested by extracting each step's
run:script and running it against fixture comments withghstubbed: a #619-shaped partial body, a marker written early, a numeric-prefix run id, and a partial body beside an older completed review are rejected; a complete body, a bold marker with CRLF, and a complete body quoting a task list in a fence are accepted. CI-only change, so no changeset.