Repository navigation
fix(fork-ci): only a comment with the lens marker is a lens report (#865) - #983
Conversation
) The merge gate read any comment that looked like a lens report (a `## Lens A` heading, `safe to merge`, `covered:`/`checks:` lines) as a broken report, and held the head until someone deleted or edited it. Now a comment is a lens report only when it carries the lens marker: a line that starts with the lens field (`lens:`, `lens=`, `lens —`, `lens –`), names a read (`read at` and a hex sha), or has a lens field with a hex sha after it, read with Markdown stripped, in code blocks and quotes too. A lens report that is not one valid read still blocks, exactly as before. A look-alike without the marker neither reads nor blocks: the run log and the head check's summary name it as "not a lens report" with the reason, and a required lens it was meant to be still fails as missing. One rule on both sides: lens.has_marker and its TS port hasMarker, with new shared `scans` vectors (a `not_lens` field) both sides replay. The review kit's `check` reads the same rule (`not a lens, no lens marker`), and COMMENTS.md defines the marker with checked examples. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps both sides: #956's post reading (reviews, inline comments, post age, unread flags, pyUnicodeCheck, lensEntries for lens_start) and #865's lens marker rule (a look-alike without the marker is no lens report: notLens). - lensComment.ts: pyUnicodeCheck moves into looksProblem; lensEntries reads looksProblem + hasMarker and returns notLens; lensScan passes it on. - review.vectors.json: every vector from both sides; the about text keeps both additions. No vector's expectation changed. - reviewRules.test.ts / review_judge.test.py: both sides' sections and fields; scan() reads scan_posts over #956's vector_pr. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: merge-path · reviewer: Claude Opus 5.5 (merge-path lens) · read at: 89340e9 🤖 Generated with Claude Code |
|
lens: state · reviewer: state lens agent (Opus 5.5) · read at: 89340e9 Repro: posts in order, required lens state, head = the read sha (aaaa... below stands for the full 40-character sha): 🤖 Generated with Claude Code |
|
lens: code · reviewer: claude-opus-5-5 · read at: 89340e9 blocker: none state: reviewed at head 89340e9. Checked:
🤖 Generated with Claude Code |
…round 1) A comment without the lens marker that holds an open blocker, major or NOT SAFE is most likely a real report with a broken header. It now blocks as a comment-keyed entry, as on main, so an older or newer clean read of that lens never lets it through, required lens or not. Its reason names the missing marker and the fix: post a new comment whose first line is the lens header, and delete the old one or start it with `not a lens:`. A look-alike with no open finding still never blocks and is named. - One classifier per language: lens.Review.report_problem and reportProblem (lensComment.ts); every reader calls it. - head-check: the marker hint and fix come first; the required-lenses hint only when no look-alike exists; a WARN mark for the not-a-lens-report row. - lens_start keeps notLens and tells the agent its post was ignored. - review kit: `reads nothing, no lens marker` for a blocking look-alike. - Shared vectors: 7 scans and 5 reads for the new rule. - Docs: release notes, pr-queue and head-check READMEs, COMMENTS.md, SKILL.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: merge-path r2 · reviewer: Claude Opus 5.5 (merge-path lens) · read at: b1a1a45 round 1, judged at this head:
Probe bodies. Each follows a valid clean read of the head by the same lens, and the head passes: 🤖 Generated with Claude Code |
|
lens: state · reviewer: state lens agent (Opus 5.5) · read at: b1a1a45 Round 1 judged (each at the root):
🤖 Generated with Claude Code |
|
lens: code r2 · reviewer: claude-opus-5-5 · read at: b1a1a45 verdict: safe to merge round 1, fixed at the root: an unmarked look-alike with an open finding now holds the head. state: reviewed at b1a1a45 (the diff since 89340e9:
🤖 Generated with Claude Code |
…ill blocks (#865 round 2) - report_problem/reportProblem read a comment without the marker with read_findings(unmarked): its first two lines as heading and title line, and "not safe to merge" on any line outside a fenced block as NOT SAFE. Shared scans and reads vectors for both shapes, with and without a required lens; "not safe to run twice" stays clean. - head_gate's check-run summary shows a WARN row as warn, not ok. - One way-out constant per language (HELD_WAY_OUT); the head-check reason says the fix and the way out once and names held comments by where they are, also in "lenses found". - The queue posts a held reason with REPOST_PLAIN (the header described, lens-free) instead of a garbled header line. - Docs: a held comment also stops holding once edited to hold no open finding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
not a lens: narrow check after round 2 Verdict: SAFE TO MERGE (head 236fa9f). No blocker, no major. Two minor doc/edge notes below; neither needs another round.
Tests, one file at a time, all pass: Minor:
🤖 Generated with Claude Code |
Fixes #865
Problem
The merge gate treated any comment from a counted author that looked like a lens report (a
## Lens Aheading,safe to merge,covered:andchecks:lines,lens:mid-line) as a broken lens report. That comment held the head until someone deleted or edited it, and nothing said why.The rule
A comment is a lens report only when it carries the lens marker. The marker is a line (read with Markdown stripped, in code blocks and quotes too, both ways of reading HTML and links) that does one of these:
lens:, alsolens=,lens —,lens –)read atand a hex sha)Each outcome:
## Lens Aplusread at: <sha>,reviewer: lens-a · read at: <sha>, a header in a code block, andnot a lens:with an unquotedread at <sha>.blocker:ormajor:line that is notnone, NOT SAFE on its first two lines (a heading and the title line under it) or averdict:line, ornot safe to mergeon any line outside a fenced code block, asread_findings(unmarked)reads them). It is most likely a real report with a broken header, so it blocks, keyed by that comment, as on main. This holds whether or not a lens is required, and whatever an older or newer read of that lens says: an older clean read never wins over it. The reason names the missing marker and the fix: post a NEW comment whose first line islens: <name> · reviewer: <who> · read at: <sha>(editing the marker in does not count), and delete the old one or edit it to start withnot a lensand a colon (HELD_WAY_OUT, one constant per language). It also stops holding once edited so it holds no open finding: the same people could delete it, and the gate keeps no history.not a lens report (<where>)(WARN: it passes but is not green), name it with the reason:no lens marker (...); it looks like one: <the old reason>. If the comment was meant as a required lens's report, that lens still fails as missing.N comment(s) look like a lens report but carry no lens marker: post a NEW comment ..., and the way out once when one holds an open finding). The rest of the reason,lenses found:included, names a held comment only by where it is; its row says why. The gate's check-run summary (head_gate.py) shows thenot a lens reportrow aswarntoo. The queue posts a held reason with the header described in words (REPOST_PLAIN), so its comment stays readable and never looks like a lens report. The hint to checkrequired-lensesappears only when no look-alike exists.The marker is defined in
fork-kit/review/COMMENTS.md("The lens marker"), with checked examples.One source of the rule
lens.Review.report_problem→(why, kind)with kindBROKEN(marker, not one valid read),HELD(no marker, open finding) orNOT_LENS(no marker, no open finding).lens_problem,not_lens_reportandscan_postsall call it, so the rule and the reason text live once (NO_MARKER,REPOST).looks_problemis the old "looks like" reader, unchanged.unmarked_heldlists the held ones for head-check.reportProbleminapps/server/src/fork/reviewRules/lensComment.ts, withlensProblem,notLensReportandlensEntriescalling it;REPOSTis the same text.lens_startkeepsnotLensand adds a note per ignored post telling the agent the gate counts no read from it, why, and how to post it again; a held post is a stuck entry whose reason carries the fix.review.vectors.jsonscansgets an optionalnot_lensfield ([where, why]), which both sides replay and check in their field lists. There are 9 new vectors, and 3 vectors that blocked before are renamed and now expectnot_lens. Round 1 adds 7scans(clean read then newer unmarked blocker; the same with NOT SAFE; an unmarked open major; posted twice; edited or hidden; an unmarked note with no finding; edited tonot a lens:) and 5reads(the same cases with and without a required lens), solens_start's copy of the verdict is held to head-check's too.review_kit.py checkreadsnot a lens, no lens marker(no finding) orreads nothing, no lens marker(open finding, blocks), both exit 1, each with a red-check mutation.SKILL.md§6 and COMMENTS.md (verdict table, a checked example) say what those words mean.checkbefore posting: this was already true in the kit. The SKILL.md lens prompt, §6 "Check before posting" and REVIEW.md all say so. T3's server-sidelens_reporttool (part of Review rules as a fork feature: finish the judge (C3, C4) and the lens tools (T3-T5) #888) does not exist yet.State question (tests)
every problem with the marker is the old answer), and the recorded 2021-case corpus still replays. The only changed answers are 7lens_problemand 3reviewed_headcases, all without a marker, and the corpus test counts them and checks they have nolens:line and no read. A PR whose only look-alike was such a comment now reads as "no lens comments", as if it had never been posted.EDITED): post a new one. Editing it to start withnot a lens:clears it.Trade-off
A lens report written with no marker at all (a heading only, no
lens:and noread at <sha>) used to block. It still blocks when it holds an open finding, so a broken header can never hide a blocker behind an older clean read. With no open finding it now counts for nothing: if that lens is required (required-lenses, or areviewblock inenforce), the head check still fails as "missing"; if it is not required, the summary names it in aWARNrow, but the head can pass. That is the cost: a clean report with a broken header for a lens nobody requires is lost, rather than blocking the PR with no one seeing why.RELEASE-NOTES.mdsays so under Upgrade.Out of scope: a header written with a full-width colon (U+FF1A) is silently no report on main and here. That is old behaviour, now #989.
Round 1 fixes
scan_posts,lensEntries, and the no-required-lens case inhead_check.verdict); the PR's own tests pinned itHELDNO_HEADER entry keyed by comment, as on main, so no read of that lens wins over it, required or not. The pinning tests (lens.test.py) now assert it holds. Vectors: clean read + newer unmarked blocker / NOT SAFE held, heading-only note passes and is named, no required lens + unmarked blocker held;readsvectors holdlens_startto the samereport_problem(Python) andreportProblem(TS); every reader calls itrequired-lensesconfig hint and gave no fixnot a lens reportrow was greenokWARNmark:WARNin the log,warnin the summaryreadsvector heldlens_startto the rule;lens_startdroppednotLensreadsvectors added;lens_startkeepsnotLensand tells the agent its post was ignored, why, and how to post itRound 2 fixes
## Lens correctness, round 2then**NOT SAFE to merge**) or in a sentence (Not safe to merge: ...) passed as aWARNafter a clean read; main blocked itreport_problem/reportProblemcallread_findings(body, unmarked=True)/readFindings(body, true), which reads the first two non-blank lines as a heading and its title line and treatsnot safe to mergeon any line outside a fenced block as NOT SAFE. Marked reports read as before; "not safe to run twice" stays clean. Vectors: 3scans(under the heading, in a sentence, prose and fenced stay clean) and 5reads(both shapes with and without a required lens, prose passes); tests inlens.test.pyandhead_check.test.py, re-run gives the same answerhead_gate.verdict_textprintedokfor aWARNrow on the check runhead_check.mark:warn;head_gate.test.pycovers ok, warn and fail rowslenses found:repeated each held comment's long reasonHELD_WAY_OUTper language, in the held reason and inmarker_hint; the inline sentence inhead_check.verdictis gone; held comments are named by where they are in the reason and inlenses found:. Test: onepost a NEW comment, one way out, noNO_MARKERtext in the reasonno_lens_textpostsREPOSTasREPOST_PLAIN(the header described, lens-free) when the whole stays lens-free, and the way out is lens-free as written; tests inlens.test.pyandpr_queue.test.pylens.test.pytestGeneral vs project
WARNrow and the kit's verdict words. They are fixed grammar infork-ci/actions/pr-queueandhead-check, shared with T3 throughreview.vectors.json.required-lenses, the config'sreviewblock) and the override prefix. Nothing here adds a setting; a project changes nothing to get the new rule, and its old comments keep their answers as described above.Tests
Python, all OK:
lens.test.py(newMarkerclass, corpus categories),head_check.test.py(summary rows, required-lens reason),pr_queue.test.py(an inline look-alike holds nothing),review_judge.test.py(vectors),fork-kit/review/tests/comments.test.py, pluspr_queue_laws,head_gate,review_guide,review_config,review_glob,plan,evalandpinned.TS:
vp test run apps/server/src/fork/reviewRules/passes.vp run check:changed: all pass.Round 1, each file run on its own:
lens.test.py(93),head_check.test.py(266),review_judge.test.py(56),pr_queue.test.py(420),fork-kit/review/tests/comments.test.py(44),reviewRules.test.ts(22),lensStart.test.ts(48): all pass.vp fmt,vp linton the changed TS, and the server typecheck pass.Round 2, each file run on its own:
lens.test.py(96),review_judge.test.py(56),head_check.test.py(268),head_gate.test.py(109),pr_queue.test.py(421),comments.test.py(44),review_glob.test.py,review_config.test.py,reviewRules.test.ts(22),lensStart.test.ts(48): all pass. Each new test failed before its fix.vp run check:changed: all pass..github/scripts/fork-owned-paths.test.pyneedsjq, which this machine lacks (2 fail locally for that reason; CI runs them).The open #956 touches the same readers (
lensComment.tslensScan→lensEntries, the vectors,review_judge.test.py). Its newreadsvectors hold no look-alikes, so the merge after it lands is mechanical.🤖 Generated with Claude Code