Repository navigation
Lens reader: look-alike headers block, NFKC rule, Unicode guard, long-line cap - #1039
Conversation
…-line cap - A lens header or marker that shows only once folded as GitHub renders it (zero-width space, Cyrillic or Greek look-alike letters, HTML references, backslash escapes) is a broken lens report: it blocks and never reads. - The three cases changed by reading NFKC after entity decoding are shared vectors, and the rule is documented. - Both sides guard the Unicode version the same way: hasMarker and every Python rule refuse text whose code points the two Unicodes assign otherwise. - NFKC reads at most 4,096 characters of each line, and the normalised line is remembered: a 64 KB line of U+FDFA reads in about 0.1 s. - A full-width number sign is no heading look-alike. Fixes #1005 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
lens: merge-path · reviewer: lens agent (Claude Opus 5.5) · read at: f8c470b Checks in detail:
🤖 Generated with Claude Code |
|
lens: code · reviewer: Claude Opus 5.5 · read at: f8c470b What I checked (detached checkout of the head, read-only):
Considered and dropped:
Verdict: SAFE TO MERGE. 🤖 Generated with Claude Code |
|
lens: state · reviewer: Claude Opus 5.5 · read at: f8c470b State answers (probed against the head, and against main for comparison):
Tests run at the head: Verdict: SAFE TO MERGE. 🤖 Generated with Claude Code |
- A post whose author does not count is only logged when this Python's Unicode refuses its text (lens.scan_posts): it neither reads nor blocks. - pr_queue catches lens.UnicodeDrift per PR: update() tells that PR once per head and passes over it, so the sweep goes on; a PR a stopped run left OFF is left OFF with its one comment (never the stored read); a reason it cannot clean is left out of its comment. - Folding reads a line end an HTML reference writes ( , , 
) as a space, as GitHub shows it, in Python and T3 alike, with shared scan vectors. - The look-alike reason gives the held way out (delete or opt out the old comment), on both sides and in the vectors. - Tests for the folded has_marker, settled in no_lens_text and the table version refusal; the same-Unicode test no longer depends on the runner's Python. - README: what a look-alike lens name does, and the queue's UnicodeDrift handling. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-line cap (#1039) * Lens reader: look-alike headers block, NFKC rule, Unicode guard, long-line cap - A lens header or marker that shows only once folded as GitHub renders it (zero-width space, Cyrillic or Greek look-alike letters, HTML references, backslash escapes) is a broken lens report: it blocks and never reads. - The three cases changed by reading NFKC after entity decoding are shared vectors, and the rule is documented. - Both sides guard the Unicode version the same way: hasMarker and every Python rule refuse text whose code points the two Unicodes assign otherwise. - NFKC reads at most 4,096 characters of each line, and the normalised line is remembered: a 64 KB line of U+FDFA reads in about 0.1 s. - A full-width number sign is no heading look-alike. Fixes #1005 Co-Authored-By: Claude Opus 5.5 <[email protected]> * Lens reader round 1: UnicodeDrift never stops the gate or the queue - A post whose author does not count is only logged when this Python's Unicode refuses its text (lens.scan_posts): it neither reads nor blocks. - pr_queue catches lens.UnicodeDrift per PR: update() tells that PR once per head and passes over it, so the sweep goes on; a PR a stopped run left OFF is left OFF with its one comment (never the stored read); a reason it cannot clean is left out of its comment. - Folding reads a line end an HTML reference writes ( , , 
) as a space, as GitHub shows it, in Python and T3 alike, with shared scan vectors. - The look-alike reason gives the held way out (delete or opt out the old comment), on both sides and in the vectors. - Tests for the folded has_marker, settled in no_lens_text and the table version refusal; the same-Unicode test no longer depends on the runner's Python. - README: what a look-alike lens name does, and the queue's UnicodeDrift handling. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…-line cap (#1039) * Lens reader: look-alike headers block, NFKC rule, Unicode guard, long-line cap - A lens header or marker that shows only once folded as GitHub renders it (zero-width space, Cyrillic or Greek look-alike letters, HTML references, backslash escapes) is a broken lens report: it blocks and never reads. - The three cases changed by reading NFKC after entity decoding are shared vectors, and the rule is documented. - Both sides guard the Unicode version the same way: hasMarker and every Python rule refuse text whose code points the two Unicodes assign otherwise. - NFKC reads at most 4,096 characters of each line, and the normalised line is remembered: a 64 KB line of U+FDFA reads in about 0.1 s. - A full-width number sign is no heading look-alike. Fixes #1005 Co-Authored-By: Claude Opus 5.5 <[email protected]> * Lens reader round 1: UnicodeDrift never stops the gate or the queue - A post whose author does not count is only logged when this Python's Unicode refuses its text (lens.scan_posts): it neither reads nor blocks. - pr_queue catches lens.UnicodeDrift per PR: update() tells that PR once per head and passes over it, so the sweep goes on; a PR a stopped run left OFF is left OFF with its one comment (never the stored read); a reason it cannot clean is left out of its comment. - Folding reads a line end an HTML reference writes ( , , 
) as a space, as GitHub shows it, in Python and T3 alike, with shared scan vectors. - The look-alike reason gives the held way out (delete or opt out the old comment), on both sides and in the vectors. - Tests for the folded has_marker, settled in no_lens_text and the table version refusal; the same-Unicode test no longer depends on the runner's Python. - README: what a look-alike lens name does, and the queue's UnicodeDrift handling. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Does all of #1005. Python (
fork-ci/actions/pr-queue) and T3's pure copy (apps/server/src/fork/reviewRules) change together and replay the same new shared vectors.What changed, per item
Review.lookalike_problem/lookalikeProblem). It blocks like any broken report, keyed by that comment, and never counts as a read. The folded text is used only for this check, never for a read or a round. Shared scan vectors cover: a zero-width space inlens, Cyrillic letters, Greek letters, a Cyrillic letter and noread at, a zero-width space inside the sha (each after an older clean read, which does not outvote it), and a header written only in HTML references with no other comment (blocks, reads nothing).has_marker/hasMarkeralso look at the folded body, andno_lens_textfolds until the text stops changing.blocker: xblocks;none+ zero-width space + accent readsnonéand blocks; a full-widthnonewritten as entities reads as none. The rule is documented inreview_judge.pyand the README.hasMarkernow runspyUnicodeChecklike the other TS rules (it is added to the TS test's list). Python names its Unicode (lens.PY_UNICODE, the version in the shared table). When the running Python's Unicode differs, every rule (lens_header,has_marker,lens_key,fold,read_findings,looks_problem,report_problem) raiseslens.UnicodeDrifton text with code points the two Unicodes assign differently, the same way T3 refuses. Text both read alike is still read.lens_problemandread_findings(before: 1.2 to 1.4 s on this machine, 5.5 s in the issue). Two linear vectors with a 500 ms bound cover it, on both sides.#is no heading. A heading look-alike needs one to six plain#and a space or tab on the raw line (as GitHub renders it); the wordlensis still read in NFKC. A scan vector shows# Lens codeis not flagged, while# Lens codeis.Failing-first: before the fix, the new Python vectors failed (7 scans, 2 linear) and so did the
UnicodeVersiontests. In TS, the scan, linear and Unicode-guard tests failed. All pass after the fix:review_judge.test.py,lens.test.py,pr_queue.test.py,head_check.test.py,review_guide.test.py,pinned.test.py, the fork-kit review tests, thereviewRulesvitest files andvp run check:changed.No upstream (non-fork) file changed, so there are no seam lines.
State answer
# Lenstext is no report and is not flagged.General vs project
Everything is general: the lens grammar, folding, the Unicode guard and the cap are the same for every project. There are no project facts and no config change.
Left
Nothing.
Round 1
Sources: the merge-path lens (NOT SAFE), the code lens and the state lens on this PR.
mainmerged in first (no conflicts).UnicodeDrift, which failed the head check of any PR.pr_queue.pynever caught it, so the run died with a traceback, again on every run throughrecover().scan_postscatchesUnicodeDriftin the ignored-author branch and only logs the post.pr_queuecatches it per PR:update()prints it, tells that PR once per head (tell, kindunicode), and the sweep goes on to the next PR.finish_plan()leaves a PR that a stopped run turned OFF as OFF, with its one comment. It never falls back to the stored read, and the queue goes on.leave_off()leaves out a reason it cannot clean, and still posts the comment.lens.test.pyUnicodeVersion.test_a_post_whose_author_does_not_count_is_only_logged_on_another_unicode.pr_queue.test.pyReviewOnAnotherUnicode(4 tests: armed PR passed over and the queue goes on, dry run, stopped-run PR, uncleanable reason). All errored withUnicodeDrifton the old code. , ,
) became real line breaks before the line checks. A valid report that quotes one in inline code before header-like text blocked as "look-alike letters".lens.fold_textand the newlensComment.foldTextfold line by line and read a decoded line end as a space (as GitHub shows it). This is used byhas_markerandlookalike_problemon both sides.has_marker: scan vector "a lens heading over a header written with zero-width spaces carries the marker and blocks".settledinno_lens_text: Cyrillicеcases inFullWidth.test_text_the_queue_posts_never_reads_as_a_lens_form. Table-version refusal inpy_assigned:UnicodeVersion.test_a_table_of_another_unicode_is_refused. Each test fails when its line is undone.LOOKALIKEnow ends withHELD_WAY_OUT(delete the old one or edit it to start withnot a lensand a colon), in Python and TS.test_the_same_unicode_reads_any_textdepended on the runner's Python.UNIDATA=lens.PY_UNICODE.UnicodeDrifthandling. Theunicodenotify kind is added.Runs on this round's head (Python 3.12,
python3 -I -B, one at a time):lens.test.py(108),review_judge.test.py(56),pr_queue.test.py(458) andpr_queue_laws.test.py(3) all pass.vp test run apps/server/src/fork/reviewRules/reviewRules.test.tspasses (22).vp run check:changedpasses. Nothing failed, so there was nothing to compare withmain, and no test was skipped for lack of local sockets.Fixes #1005
🤖 Generated with Claude Code