Skip to content

fix(fork-ci): only a comment with the lens marker is a lens report (#865) - #983

Merged
scuttletoby merged 7 commits into
mainfrom
fix/865-lens-marker
Nov 22, 2026
Merged

scuttletoby merged 7 commits into
mainfrom
fix/865-lens-marker

Conversation

@scuttletoby

@scuttletoby scuttletoby commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Fixes #865

Problem

The merge gate treated any comment from a counted author that looked like a lens report (a ## Lens A heading, safe to merge, covered: and checks: 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:

  • starts with the lens field (lens:, also lens=, lens —, lens –)
  • names a read (read at and a hex sha)
  • has a lens field followed by a hex sha anywhere in the line

Each outcome:

  • Lens report, not one valid read. It blocks, exactly as before (fail closed). This includes a header that is not on the first line, two headers, a placeholder name, ## Lens A plus read at: <sha>, reviewer: lens-a · read at: <sha>, a header in a code block, and not a lens: with an unquoted read at <sha>.
  • No marker, looks like a report, holds an open finding (a blocker: or major: line that is not none, NOT SAFE on its first two lines (a heading and the title line under it) or a verdict: line, or not safe to merge on any line outside a fenced code block, as read_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 is lens: <name> · reviewer: <who> · read at: <sha> (editing the marker in does not count), and delete the old one or edit it to start with not a lens and 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.
  • No marker, looks like a report, no open finding. It is not a lens report. It neither reads nor blocks, and it adds no round. The run log, and the head check's summary row 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.
  • Head-check reason: when any look-alike exists, the failure reason starts with the fix (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 the not a lens report row as warn too. 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 check required-lenses appears only when no look-alike exists.
  • Everything else reads as before.

The marker is defined in fork-kit/review/COMMENTS.md ("The lens marker"), with checked examples.

One source of the rule

  • Gate: one classifier, lens.Review.report_problem → (why, kind) with kind BROKEN (marker, not one valid read), HELD (no marker, open finding) or NOT_LENS (no marker, no open finding). lens_problem, not_lens_report and scan_posts all call it, so the rule and the reason text live once (NO_MARKER, REPOST). looks_problem is the old "looks like" reader, unchanged. unmarked_held lists the held ones for head-check.
  • T3 copy: reportProblem in apps/server/src/fork/reviewRules/lensComment.ts, with lensProblem, notLensReport and lensEntries calling it; REPOST is the same text. lens_start keeps notLens and 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.
  • Shared vectors: review.vectors.json scans gets an optional not_lens field ([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 expect not_lens. Round 1 adds 7 scans (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 to not a lens:) and 5 reads (the same cases with and without a required lens), so lens_start's copy of the verdict is held to head-check's too.
  • Kit: review_kit.py check reads not a lens, no lens marker (no finding) or reads 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.
  • Lens tooling runs check before 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-side lens_report tool (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)

  • Old comments on open PRs: a comment with the marker gets the same answer as before, and so does one without it that holds an open finding (it blocks, as on main; the corpus's one such real report still blocks). There is a test for this (every problem with the marker is the old answer), and the recorded 2021-case corpus still replays. The only changed answers are 7 lens_problem and 3 reviewed_head cases, all without a marker, and the corpus test counts them and checks they have no lens: 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.
  • Runs again: the same posts give the same answer, held entries and notes included, and each look-alike is logged once per run.
  • Edited or deleted: an edited or hidden look-alike with no finding is still no report; one with an open finding still holds (edited or hidden) while the finding stays in its text; edited so it holds no open finding, it stops holding, the same as deleting it (the same people could delete it; COMMENTS.md, the pr-queue README and RELEASE-NOTES say so). A report edited to drop its marker counts as deleted only when it holds no open finding; with one it still holds. Editing the marker in makes it an edited report that reads nothing (EDITED): post a new one. Editing it to start with not a lens: clears it.
  • Two comments for one lens and head: the newer one is the entry, both count in the history, and the newer one is judged. A look-alike with no finding next to a real read never replaces or blocks it. An unmarked report with an open finding posted twice holds twice (one entry per comment).

Trade-off

A lens report written with no marker at all (a heading only, no lens: and no read 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 a review block in enforce), the head check still fails as "missing"; if it is not required, the summary names it in a WARN row, 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.md says 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

Lens Finding Fix
merge-path major, state blocker, code minor An unmarked report with an open blocker/major/NOT SAFE no longer held the head when the lens had an older clean read (scan_posts, lensEntries, and the no-required-lens case in head_check.verdict); the PR's own tests pinned it Fixed at the root: such a comment is a HELD NO_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; reads vectors hold lens_start to the same
code minor Two copies of the rule and the reason text per language One classifier per language: report_problem (Python) and reportProblem (TS); every reader calls it
merge-path, state, code minors The head-check reason led with the required-lenses config hint and gave no fix The marker hint comes first with the exact fix; the config hint only appears when no look-alike exists
merge-path minor The not a lens report row was green ok New WARN mark: WARN in the log, warn in the summary
state minor No reads vector held lens_start to the rule; lens_start dropped notLens reads vectors added; lens_start keeps notLens and tells the agent its post was ignored, why, and how to post it
merge-path minor Full-width colon header is silently no report (old behaviour) Out of scope: #989

Round 2 fixes

Lens Finding Fix
merge-path major, state minor 1 An unmarked look-alike whose NOT SAFE is on the line under its heading (## Lens correctness, round 2 then **NOT SAFE to merge**) or in a sentence (Not safe to merge: ...) passed as a WARN after a clean read; main blocked it Fixed at the root in the no-marker branch only: report_problem/reportProblem call read_findings(body, unmarked=True) / readFindings(body, true), which reads the first two non-blank lines as a heading and its title line and treats not safe to merge on any line outside a fenced block as NOT SAFE. Marked reports read as before; "not safe to run twice" stays clean. Vectors: 3 scans (under the heading, in a sentence, prose and fenced stay clean) and 5 reads (both shapes with and without a required lens, prose passes); tests in lens.test.py and head_check.test.py, re-run gives the same answer
code minor 1 head_gate.verdict_text printed ok for a WARN row on the check run Uses head_check.mark: warn; head_gate.test.py covers ok, warn and fail rows
code minor 2, merge-path minor 3 The head-check reason said "post a NEW comment" twice and the way out in two wordings; lenses found: repeated each held comment's long reason One HELD_WAY_OUT per language, in the held reason and in marker_hint; the inline sentence in head_check.verdict is gone; held comments are named by where they are in the reason and in lenses found:. Test: one post a NEW comment, one way out, no NO_MARKER text in the reason
code minor 3 The queue garbled the held reason ("first line is lens- · reviewer: · read @:") no_lens_text posts REPOST as REPOST_PLAIN (the header described, lens-free) when the whole stays lens-free, and the way out is lens-free as written; tests in lens.test.py and pr_queue.test.py
state minor 2, merge-path minor An unmarked held comment edited so it holds no open finding stops holding, undocumented Documented in COMMENTS.md, the pr-queue README, RELEASE-NOTES and this body; pinned by a lens.test.py test

General vs project

  • General (every repo using the gate): the marker rule, the held rule for an unmarked open finding, the reason texts, the WARN row and the kit's verdict words. They are fixed grammar in fork-ci/actions/pr-queue and head-check, shared with T3 through review.vectors.json.
  • Project: which lenses are required (required-lenses, the config's review block) 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 (new Marker class, 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, plus pr_queue_laws, head_gate, review_guide, review_config, review_glob, plan, eval and pinned.

  • 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 lint on 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.py needs jq, which this machine lacks (2 fail locally for that reason; CI runs them).

The open #956 touches the same readers (lensComment.ts lensScan → lensEntries, the vectors, review_judge.test.py). Its new reads vectors hold no look-alikes, so the merge after it lands is mechanical.

🤖 Generated with Claude Code

scuttletoby and others added 2 commits November 22, 2026 16:37
)

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>
@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: merge-path · reviewer: Claude Opus 5.5 (merge-path lens) · read at: 89340e9
covered: #865 and its "done when"; the PR body; the full diff at the head, including merge 89340e9: lens.py (marker_line, has_marker, lens_problem/looks_problem/not_lens_report, scan_posts), head_check.py verdict, review_kit.py verdict, lensComment.ts (hasMarker, lensEntries, lensScan), lensStart.ts callers, review.vectors.json, COMMENTS.md, RELEASE-NOTES.md, the head-check README.
checks: ran each changed test file once, one at a time: lens.test.py, head_check.test.py (265), pr_queue.test.py, review_judge.test.py (56), comments.test.py (43), and reviewRules.test.ts (21; it replays every vector, not_lens included). All pass. Merge check: diffed review.vectors.json by vector name across the merge base, main, the pre-merge branch and the head. Main's 284 vectors and the branch's 9 new ones are all present and unchanged (293). The only differences are the 3 vectors the branch renamed on purpose, so the merge flipped no vector. The TS merge keeps #956's lensEntries (age, skip, unread flags, pyUnicodeCheck, now in looksProblem) and adds notLens exactly as scan_posts does. Ran a probe of the Python gate on main and on the head: a valid blocker: none read of the head, then a newer comment from the same lens without the marker.
state: Comments already on open PRs keep their answer when they carry the marker. A run again gives the same result: scan_posts is pure apart from its log, which logs each comment once. Editing a report so the marker is gone is the same as deleting it. A comment with neither a marker nor a look is ignored, as before. What does change is old state: a lens's earlier valid read now outranks a newer unmarked report from that lens (major below).
verdict: not safe to merge
blocker: none
major: an unmarked follow-up report from a lens that holds an open blocker no longer holds the head when that lens already has a valid read covering it. In lens.py scan_posts (about line 516) and lensComment.ts lensEntries (about line 389), the look-alike is skipped (continue / return), so the lens's older entry stays its newest. The judge then reads that older report's blocker: none. So a lens can mean to block and the head still passes. Probe on the head: round 1 is a valid header with a read of this head and blocker: none; round 2 is a ## Lens merge-path, round 2 heading with blocker: found a bypass and no marker. Result: lens_reads shows only merge-path at this head, and not_lens_reports lists round 2. On main the same pair adds a comment without a first-line lens header entry that holds the head. The same happens when the older read is at an earlier head that same_change covers. This contradicts the PR body's trade-off ("if that lens is required ... the head check still fails as missing") and RELEASE-NOTES "Upgrade". required-lenses does not catch it, because the lens is not missing. The head check shows round 2 only as an ok row, and the missing-lens reason, which names unmarked comments, never fires. Fix that keeps #865's goal: a look-alike without the marker that holds an open blocker or major (review_judge.read_findings) or a NOT SAFE verdict should still hold the head. Make it a NO_HEADER entry with the reason no lens marker; ..., the same on both sides, plus a shared vector. The issue's case, a stray heading in a note with no open finding, still passes and is named. If the owner prefers the current rule, the PR body and RELEASE-NOTES should at least say that an older read of that lens then decides.
minor: head_check.py verdict (about line 234): when a required lens is missing and unmarked comments exist, the reason first says "No counted lens comment has that name: check it in required-lenses (one name per line)". That points the reader at the config. Only at the end does it give a count of unmarked comments, and it does not say what to do. Put the marker hint first when notes is non-empty, and say how to fix it: "N comment(s) look like a lens report but have no lens marker: post the report again with the header lens: <name> · reviewer: <who> · read at: <sha> as its first line (see the not a lens report rows)".
minor: the not a lens report (<where>) summary row is ok (green). A reader scanning for red will not see it. A neutral or warning mark would make it visible, although head-check has only ok/fail today.
minor: this is old behaviour, not new in this PR: a header written with a full-width colon (U+FF1A after lens and after read at) is neither a marker nor a look-alike, so on main and on this head it is silently no report. Normalising NFKC, or at least folding U+FF1A to :, in norm_line and normLine would close it. Separate issue.

🤖 Generated with Claude Code

@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: state · reviewer: state lens agent (Opus 5.5) · read at: 89340e9
verdict: not safe to merge
covered: issue #865, the PR body, the full diff at the head (lens.py, head_check.py, review_kit.py, lensComment.ts, the vectors, the tests, the READMEs), and the merge commit with #956
checks: ran lens.test.py, head_check.test.py (265), pr_queue.test.py, review_judge.test.py (56), comments.test.py (43) and reviewRules.test.ts (21), one at a time: all OK. Mutation: turning off the no-marker branch in scan_posts turns 7 subtests of review_judge.test.py red. Replayed the trade-off through review_judge.test.py's replay_reads (basic rules in enforce, findings judged) on this head and on main.
state: runs again: same answer, each look-alike logged once per Review. Edited after the run: a look-alike that gains the marker reads as edited (reads nothing, post a new one); a report edited to drop its marker counts as deleted, the same way out deletion already gives. Posted twice: the newer marked one is the entry; a look-alike never replaces a read. Deleted mid-run or a page cut: reading unchanged by this PR. Old state: 10 corpus answers change, all without a marker, and they are pinned. Rounds: a look-alike adds no history, so no round. Older kit or gate copies keep the stricter old rule.
merge with #956: both sides kept. Compared every vector by name across the base, both parents and the merge: only the PR's 3 renames differ, no other expectation changed, and every #956 section is there (reads, linear, unicode, 6 rounds, 10 findings). lensEntries keeps #956's age order, skip and unread flags and adds the notLens branch; pyUnicodeCheck moved into looksProblem.
blocker: a real lens report without the marker that names an open blocker or NOT SAFE no longer holds the head when that lens already has a clean read of the same head or the same change. Main holds it, this head passes it (lens.py:516, lensComment.ts:389, and lens.test.py:264 with :286 pins it on purpose). Repro below. The repo's own corpus shows the shape is real: of 25 flagged comments, 7 were real lens reports with a broken header, one of them NOT SAFE, and 6 were caught only by the heading rule this PR drops. Ways it happens: a second reviewer of the same lens, a correction posted after a clean report, a re-read after a merge of main (same change). With no required lens it also passes as the only comment (head_check.py:219). Fix: keep "not a lens report" only for a look-alike whose findings read clean or absent. One where review_judge.read_findings finds an open blocker or major, or a NOT SAFE verdict, stays a blocking entry whose reason names the missing marker and says to post a new comment with the header. #865's case (a heading with no open finding) still never blocks. Add a scans and a reads vector for both sides.
minor: when a required lens is missing, the reason starts with "check it in required-lenses (one name per line)", a config hint that is wrong here, and only then gives the count of unmarked comments (head_check.py:234). Neither that reason nor the row says what to do. Suggest: "N comment(s) look like a lens report but carry no lens marker (rows not a lens report): post a new comment whose first line is the lens header; editing that comment does not count".
minor: no reads vector holds an unmarked look-alike, so T3's lens_start copy of the verdict (lensStart.ts) is not held to head_check.verdict on this rule. lens_start also drops notLens and never tells the agent that its post was ignored.
major: none

Repro: posts in order, required lens state, head = the read sha (aaaa... below stands for the full 40-character sha):

post 1: header line for lens state reading the head, then "blocker: none" and "major: none"
post 2: "## Lens state", "reviewer: x", "blocker: a re-run loses data", "major: none"
main (251a347):  passes False (post 2 is a blocking entry)
this head:       passes True  (post 2 is only a "not a lens report" row, ok)

🤖 Generated with Claude Code

@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: code · reviewer: claude-opus-5-5 · read at: 89340e9

blocker: none
major: none
minor: an older read of the same lens still stands when the lens's newer comment has no marker. Example: round 1 posts a valid blocker: none read at head H. Round 2 then posts ## Code lens, round 2 with blocker: data loss in X and no lens: line or read at <sha>. lens_reads still gives code → H, and the not-marker comment is only an ok row, so the head passes. Before this PR, the round 2 comment blocked. The PR body's trade-off and the RELEASE-NOTES Upgrade paragraph cover only the "required lens is missing" case, which does not fire here because the lens has a read. Suggested follow-up: name this case in RELEASE-NOTES / COMMENTS.md, or keep failing closed for a look-alike with no marker that holds an open blocker: or major: line and is newer than that lens's read.
minor: fork-ci/actions/pr-queue/lens.py:516 repeats the marker rule and the reason text from not_lens_report (lens.py:389-391) instead of calling it. The TS side does the same: lensEntries (lensComment.ts:388-389) copies notLensReport. Python and TS agree through the shared vectors, but within each language there are now two copies of one rule.
minor: the failure reason for a missing required lens (fork-ci/actions/head-check/head_check.py:234) says the comments carry no lens marker but not what to do. Adding "post a new comment whose first line is lens: <name> · reviewer: <who> · read at: <sha>" would let a reviewer fix it without opening COMMENTS.md.

state: reviewed at head 89340e9. Checked:

  • The marker rule: every branch of read_problem that flags a header line, a lens field with a sha, a first-line lens:, a two-way header mismatch, or an opt-out with an unquoted read implies has_marker. The not-marker path only sees covered:/checks: fields, safe to merge, a mid-line lens:, a read at: with no sha, and headings. So every comment with the marker gets the same answer as on main.
  • The merge resolution: the Merge gate: a comment that only looks like a lens report must not block a PR #865 hunks reapply on fork(reviewRules): read lens posts as the gate does; lens_start follow-ups (#799, #841) #956's lensEntries (try/catch, post.where, vector_pr). Every reads vector and every other vector is unchanged against main. Only the 3 renamed scans vectors changed, and they now expect not_lens. 12 vectors are new. The head merges cleanly with the current main.
  • Tests at the head, one at a time, all pass: lens.test.py, head_check.test.py (265), pr_queue.test.py, review_judge.test.py (56), comments.test.py (43), and reviewRules.test.ts (21).
  • I undid each fix to check the tests fail without it:
    • The not-marker branch in scan_posts: review_judge gets 8 failures and lens.test gets 13.
    • hasMarker forced true in TS: 2 of 21 fail.
    • The near reason in head_check.verdict: test_a_look_alike_without_the_lens_marker_passes_and_is_named fails.
  • The trade-off: a report with no marker cannot name a lens or a head. A required lens still fails as missing, the kit's check exits 1 with not a lens, no lens marker, and SKILL.md says never to post it. The holes are a lens that is not required, and the older-read case above. Both need a lens that skips check and writes neither a lens: line nor a read at <sha>. I judge that acceptable for the problem Merge gate: a comment that only looks like a lens report must not block a PR #865 asks to fix, once it is documented.
  • The docs are done: COMMENTS.md "The lens marker", the gate words table, the examples, the head-check README and RELEASE-NOTES.

🤖 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>
@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: merge-path r2 · reviewer: Claude Opus 5.5 (merge-path lens) · read at: b1a1a45
covered: the round-1 fix commit b1a1a45 (the diff since 89340e9; the rest of that range is main merged in): lens.py (report_problem, lens_problem, not_lens_report, unmarked_held, scan_posts), head_check.py (verdict, marker_hint, the WARN mark), review_kit.py verdict, lensComment.ts (reportProblem, lensEntries), lensStart.ts, the new vectors, COMMENTS.md, RELEASE-NOTES.md, the pr-queue and head-check READMEs, the PR body, and the three round-1 reports.
checks: ran each of the PR's changed test files once, one at a time: lens.test.py OK, head_check.test.py (266) OK, review_judge.test.py (56) OK, comments.test.py (44) OK, reviewRules.test.ts (22) and lensStart.test.ts (48) pass. Parity probe: 35 comment bodies with no marker (labels in bold, lists, tables, headings, quotes, fences, indented code, HTML comments, <details>, a zero-width space, a Cyrillic o, a full-width colon, &#58;, \:, brackets, none, major: x, n/a, no —, NOT SAFE in a heading, on a verdict: line and in prose). For every body, report_problem and reportProblem give the same kind and the same reason, byte for byte. End-to-end probe of head_check.verdict: a clean read of the head, then a newer comment without the marker. Run with and without a required lens.
state: a run again gives the same answer, because scan_posts stays pure apart from its once-per-Review log. A held comment is keyed by the comment, so post order does not matter: an older or a newer clean read never clears it, and hiding it or editing it while the finding stays does not clear it either. It adds no history, so no round. A held comment stops holding when it is deleted, or edited to start with not a lens:, or edited so that its finding reads none (minor below). Old comments: one with the marker reads as before, and one without it that holds an open finding blocks as on main.
authors: scan_posts calls counts (lens_author_associations) before it reads any body. A stranger's comment can neither hold a head nor clear one. Deleting a comment, or editing it to start with not a lens:, needs edit rights on that comment: its author, or a user with write access to the repo. Those users can already delete any marked report, so the way out gives nobody a new power. The gate does not know who made an edit, and that was so before this PR.
parity: Python and TS agree on every vector and every probe. The two copies call one classifier each (report_problem and reportProblem), and the reason text is the same (NO_MARKER, REPOST).
verdict: not safe to merge
blocker: none
major: an unmarked report that says NOT SAFE on the line under its heading, or in a sentence, does not hold the head. Main holds it. report_problem reads an open finding through review_judge.read_findings. That function reads NOT SAFE only on the first line, or on the line after a lens header (first, review_judge.py:364, findings.ts:206), or on a verdict: line. An unmarked comment never has a lens header, so the reader looks only at its heading line. The title line, where COMMENTS.md says NOT SAFE is a blocker, is not read. Probe (bodies below), run on this head with head_check.verdict and the required lens merge-path: the head passes with "is the commit read". Python and TS both give not a lens report (a WARN row), so the head is green. The PR body and RELEASE-NOTES say an unmarked comment holding "NOT SAFE" still blocks, and COMMENTS.md says the same. This is the round-1 hole, narrowed but not closed at the root. Fix: when report_problem looks for a finding in a comment without the marker, read the first two non-blank lines as a heading plus a title line, the same way a header plus a title line is read. Also treat not safe to merge on any line outside a fence as NOT SAFE. Only the "safe to merge" phrase: the vector "prose that says not safe" (not safe to run twice) stays clean. Add a scans vector and a reads vector for both forms.
minor: editing a held comment so that its finding reads none makes it not a lens report. The lens's older clean read then decides, and nothing records the edit. A marked report edited in the same way reads nothing (EDITED). The rule gives no one a new power, because the same users could delete the comment. But the PR body's line "one with an open finding still holds (edited or hidden)" holds only while the finding is still in the text. Either say so in COMMENTS.md and RELEASE-NOTES, or treat an edited unmarked look-alike as held when it was first seen holding a finding. The gate keeps no history, so saying so is the practical choice.
minor: in head_check.verdict, the lenses found: part of a reason lists held entries by their full comment without a first-line lens header (<url>, <long reason>) key. With one held comment, the reason repeats the long REPOST text twice. This is cosmetic, and main does the same for marked broken reports.

round 1, judged at this head:

  • merge-path major, state blocker, code minor (an older clean read wins over a newer unmarked report that holds an open finding): fixed at the root for blocker: and major: lines in any form the findings reader knows, and for NOT SAFE on the heading line or a verdict: line. This holds with or without a required lens, for an older or a newer read, and for posts edited, hidden or posted twice. The vectors and the tests hold both sides to it. The NOT SAFE title-line and prose case is still open (major above).
  • head-check reason (config hint first, no fix given): fixed. marker_hint comes first and holds the REPOST text, and the required-lenses hint shows only when no look-alike exists.
  • not a lens report row was green: fixed. It is now WARN in the log and warn in the summary.
  • two copies of the rule per language: fixed. There is one classifier per language and every reader calls it.
  • no reads vector for lens_start, and notLens dropped: fixed.
  • full-width colon header: out of scope (Lens header with a full-width colon (U+FF1A) is silently no lens report #989). The findings reader folds NFKC, so blocker:x in an unmarked report is held.

Probe bodies. Each follows a valid clean read of the head by the same lens, and the head passes:

## Lens merge-path, round 2

Not safe to merge: the gate passes an unread head.
## Merge-path review

NOT SAFE TO MERGE

covered: x
checks: y

🤖 Generated with Claude Code

@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: state · reviewer: state lens agent (Opus 5.5) · read at: b1a1a45
verdict: safe to merge
covered: round 2 (last). The three round-1 reports, the PR body and its round-1 table, and the diff since 89340e9: the merge of main (cf1177e) and the fix b1a1a45. Read lens.py (report_problem, lens_problem, not_lens_report, scan_posts, unmarked_held), head_check.py (verdict, marker_hint, mark, report), review_kit.py verdict, lensComment.ts (reportProblem, lensEntries), lensStart.ts (notes), the 14 new vectors, the tests, COMMENTS.md and the pr-queue README.
checks: ran each changed test file once, one at a time: lens.test.py, head_check.test.py (266), review_judge.test.py (56), comments.test.py (44), pr_queue.test.py, reviewRules.test.ts (22) and lensStart.test.ts (48). All pass. Mutation: making report_problem see no findings (so every unmarked look-alike is NOT_LENS again) turns 9 tests of review_judge.test.py red, so the shared vectors pin the held rule. I classified this repository's real PR comments since October (about 1600) with the head's report_problem: 54 broken, 143 held, 129 not a lens report. None of the 129 is a report with an open finding. Every one that has a Blocking/Major section says none or SAFE, and none says NOT SAFE.
state: runs again: same answer. report_problem is pure, a held entry is keyed by the comment's URL and reason, and each not-a-lens post is logged once per Review. Old state: every answer moves only from block to pass, never the other way. A held or marked comment blocks as on main, so no open PR becomes newly stuck. The corpus's one real report without a marker and with an open major still blocks (lens.test.py pins it). Posted twice: two held entries, one per comment. Edited: a note edited to add a blocker now blocks; a held one edited or hidden still blocks; with the marker edited in it reads nothing (EDITED) until a new post; editing it to start with not a lens: clears it. An older or newer clean read never clears a held entry (keyed by comment, not by lens). lens_start: gateReads sees the same held entry, and notLens now gives the agent a note with the fix. Empty comment list: no lens comments. With a required lens, the config hint shows only when no look-alike exists.
blocker: none
major: none
minor: a look-alike with no marker passes as not a lens report when its NOT SAFE is only on the line under a heading and it has no blocker or major label. Example: ## Lens correctness, round 2 then **NOT SAFE to merge**. On main it blocked. read_findings reads the second line as a title only under a valid lens header (review_judge.py:362, findings.ts:202), and report_problem (lens.py:402, lensComment.ts:287) calls it as is. verdict: NOT SAFE and a NOT SAFE heading are both caught. No real comment on this repository has this shape, and the kit's check refuses such a post. Possible fix: for a comment without the marker, read the line after a first-line heading as a title too, with one scans vector.
minor: an unmarked held comment edited so that it holds no open finding (blocker: x → blocker: none) stops blocking: it becomes not a lens report. That is no hole, since the same people can delete it. But COMMENTS.md:8 says it holds "until it is deleted or starts with not a lens:", and the README (around line 626) gives the same ways out plus an override. Add "or edited so it holds no open finding (the same as deleting it)", or pin it with a vector.

Round 1 judged (each at the root):

  • round 1, fixed: the state blocker, merge-path major and code minor. An unmarked report with an open blocker, major or NOT SAFE beside an older clean read passed. It is now a HELD NO_HEADER entry keyed by comment, in both languages, required lens or not. The vectors cover a clean read then a newer unmarked blocker or NOT SAFE, an open major alone, posted twice, edited or hidden, and opted out. 7 scans and 5 reads vectors, replayed by both sides and by lens_start.
  • round 1, fixed: two copies of the rule per language. report_problem and reportProblem are the one source. lens_problem, not_lens_report, scan_posts, the kit's verdict and lensEntries all call them.
  • round 1, fixed: the head-check reason led with the config hint. marker_hint now comes first with the exact fix, and the config hint shows only when no look-alike exists.
  • round 1, fixed: the not-a-lens row was green. It is now WARN in the log and warn in the summary, and it still passes (mark, LOG_MARK).
  • round 1, fixed: no reads vector held lens_start, and lens_start dropped notLens. Both done (lensStart.test.ts covers held and ignored, in both orders).
  • round 1, moved: the full-width colon. It is old behaviour, now a separate issue.

🤖 Generated with Claude Code

@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: code r2 · reviewer: claude-opus-5-5 · read at: b1a1a45

verdict: safe to merge
blocker: none
major: none
minor: the WARN mark is missing from the gate's check-run summary. head_gate.verdict_text (fork-ci/actions/head-check/head_gate.py:714) still prints "ok" if g else "fail", and WARN is the truthy string 'warn', so a not a lens report row shows ok there. In this fork the head check runs only through fork-head-gate.yml → head_gate.py judge. The log and the step summary use head_check.report and show WARN/warn, but the check run on the PR, the page a reader sees, shows ok. The round-1 minor is fixed in one of the two places it prints. Fix: use head_check.mark(g) there, and add a head_gate.test.py case. A probe on this head with a row (not a lens report (url), WARN, ...) gives | not a lens report (url) | ok | ... |.
minor: the head-check reason says the fix twice and the way out in two wordings. With only an unmarked held report, head_check.verdict (head_check.py:244-245) returns marker_hint(1) plus its own "each that holds an open finding blocks until it is deleted or starts with not a lens:", then why. why already holds the HELD reason from report_problem (lens.py:403-404), which carries REPOST and "delete this one or start it with not a lens:" again. A probe counts post a NEW comment twice in one reason. The rule is one source, but the way-out text now has three copies in Python: NO_HEADER_WAY_OUT, the inline text in report_problem, and the inline text in head_check.verdict. Suggest dropping the inline sentence in head_check.verdict (keep marker_hint), or naming the way out once in lens.py and using it in both places.
minor: the queue posts the HELD reason garbled. pr_queue.leave_off (pr_queue.py:1660) passes why through lens.no_lens_text, which rewrites lens: to lens- and read at to read @, and blanks < >. The fix text then reads "post a NEW comment whose first line is lens- · reviewer: · read @: ...". The queue's own read_advice (NO_HEADER branch) still gives a correct way out and links the format doc, so nobody is left without one. The cleaning is needed (a queue comment must never carry the marker), but this sentence is now noise. Possible follow-up: leave the fix sentence out of the reason the queue posts, for example with a reason text that has no header example and points to lens_format_doc.

round 1, fixed at the root: an unmarked look-alike with an open finding now holds the head. report_problem returns HELD, and scan_posts and lensEntries make it a NO_HEADER entry keyed by the comment, so an older or newer clean read of that lens no longer wins. That holds with and without a required lens, and when the comment is edited or hidden. Only deleting it or starting it with not a lens: clears it.
round 1, fixed: one classifier per language. has_marker and looks_problem are each called once in Python, both in report_problem (looks_problem is also called for the stranger log, lens.py:544, unchanged). In TS, hasMarker and looksProblem are called only in reportProblem. lens_problem, not_lens_report, scan_posts, the kit's verdict and TS lensProblem, notLensReport and lensEntries all go through it. REPOST and NO_MARKER are each one constant per language. Only the way-out sentence is copied (minor above).
round 1, fixed: the missing-lens reason now leads with the marker hint and the fix, and the required-lenses hint only shows when there is no look-alike.
round 1, fixed: lens_start keeps notLens and tells the agent its post was ignored, why, and REPOST. The reads vectors now hold lens_start's verdict to head-check on this rule.

state: reviewed at b1a1a45 (the diff since 89340e9: lens.py, head_check.py, review_kit.py, lensComment.ts, lensStart.ts, the vectors, COMMENTS.md, SKILL.md, the tests). Runs again: the same answer each time. scan_posts runs three times per verdict (reads, not_lens_reports, unmarked_held) and logs each look-alike once per Review. Old state: a marked comment reads as before. An unmarked one with an open finding blocks as on main. Only unmarked ones with no open finding change, as the PR body says. Two posts: an unmarked held report posted twice holds twice, which a vector covers. The lazy import review_judge in report_problem avoids the import cycle, and every caller that imports lens has pr-queue on its path.
checks: ran each changed test file once, one at a time, at the head, all OK: lens.test.py, head_check.test.py (266), review_judge.test.py (56), pr_queue.test.py, comments.test.py (44), reviewRules.test.ts (22), lensStart.test.ts (48). Vectors since 89340e9: scans gained 9 (7 new, plus 1 renamed and split into 2) and reads gained 5. No existing vector changed. Then I undid each fix and ran the tests again:

  • HELD off in report_problem: lens.test has 5 failures and 12 errors, review_judge 9 failures, head_check 3, comments.test 7.
  • The marker hint first (if notes or held:) off: head_check has 6 failures.
  • WARN shown as ok in head_check.mark: head_check has 2 failures. Nothing covers head_gate.verdict_text (minor above).
  • The held reason in the if not read branch off: head_check has 3 failures.
  • The kit's HELD branch off: comments.test fails, including test_every_example_reads_as_it_says, so the new COMMENTS.md example is checked by the kit, and so does the RedCheck mutation.
  • TS reportProblem HELD off: reviewRules has 2 failures and lensStart 2.
  • The lensStart notes off: lensStart has 1 failure.

🤖 Generated with Claude Code

scuttletoby and others added 2 commits November 22, 2026 18:28
…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>
@scuttletoby

Copy link
Copy Markdown
Owner Author

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.

  1. Merge-path major: fixed at the root, in the no-marker branch only. read_findings(body, unmarked=True) / readFindings(body, true) are called only from report_problem (lens.py:419) and reportProblem (lensComment.ts:289); every other caller keeps the default, so marked reports read as before. Probe of 16 bodies through both classifiers: identical kind and reason in Python and TS. Held: NOT SAFE on the line under a heading, Not safe to merge: in a sentence, **not safe to merge** mid-paragraph, in a > quote, in an indented block. Not held: not safe to run twice, a fenced block. A not a lens: first line stays no report. With the fix undone once (Python, then TS): review_judge.test.py fails the 6 new scans/reads vectors, and reviewRules.test.ts and lensStart.test.ts each fail their vector test. All pass again once it is restored.
  2. head_gate.py:714 uses head_check.mark, so the not-a-lens row shows warn. head_gate.test.py covers the ok, warn and fail rows.
  3. There is one HELD_WAY_OUT per language (lens.py:98, lensComment.ts:76), and it appears once in the head-check reason (marker_hint). short_held cuts held entries to where they are, in the reason and in lenses found:.
  4. The queue posts REPOST_PLAIN. The new wording is the same in both languages, in 17 vector strings, in the READMEs and RELEASE-NOTES, and in the tests.
  5. COMMENTS.md, the pr-queue README, RELEASE-NOTES and the PR body say "stops holding once edited so it holds no open finding".
  6. The merge of main (72b6402) dropped nothing. No file changed on both sides, and every main-only file equals main in the merge commit. Main has since moved on (heavy: capacity checked by heavy itself, cost floor, reservations by kind/ttl/idle, 20 s NOT OK hold #981), so the PR is BEHIND, and the queue updates it.

Tests, one file at a time, all pass: lens.test.py, review_judge.test.py (56), head_check.test.py (268), head_gate.test.py (109), pr_queue.test.py (421), comments.test.py (44), reviewRules.test.ts (22), lensStart.test.ts (48).

Minor:

  • fork-ci/actions/head-check/README.md:222-233 does not say that a held comment stops holding once edited so it holds no open finding (point 5 asked for that README too). COMMENTS.md:317 names only delete or not a lens: there, but line 9 says it.
  • review_judge.py:373 / findings.ts:217 match not safe to merge per line. A hard-wrapped sentence (not safe at the end of one line, to merge on the next) is not held: it reads as a WARN row, where main held it. This is an edge case, and agent reports rarely hard-wrap. A follow-up could join each paragraph before matching.

🤖 Generated with Claude Code

@scuttletoby
scuttletoby merged commit 5460edd into main Nov 22, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge gate: a comment that only looks like a lens report must not block a PR

1 participant