Repository navigation
Conversation
|
The duplicate check flags two examples with different language tags as identical. On head Run this from the repository root with import sys
sys.path.insert(0, "tests")
from test_docs_adjacent_fenced_blocks import adjacent_repeats
page = "~~~python\n1 / 2\n~~~\n\n~~~ruby\n1 / 2\n~~~\n"
print(adjacent_repeats(page)) # actual [(1, 5)], expected []
print(adjacent_repeats(page.replace("ruby", "python"))) # actual and expected [(1, 5)]Keep the opening fence's info string with the body when comparing blocks. The original duplicate in AI-assisted. |
Kam471
left a comment
There was a problem hiding this comment.
Reviewed head e434ca04e9.
Commands:
python tests/test_docs_adjacent_fenced_blocks.py-> Ran 3 tests, OK (0.6 s), 61 docs pages scanned- Negative control: main's
docs/character_models.md+ this test -> FAIL "the block at line 312 is repeated at line 322" git diff --check main...HEAD-> clean
The detector reports only byte-identical blocks separated by blank lines, handles longer/shorter fences and tildes, and has synthetic tests for both the positive and the near-miss (one-line difference, prose between blocks, empty blocks). Removing the second copy is correct; the surrounding text still refers to the single manifest.
Verdict: LGTM.
|
You are right, and the fix is in The detector now keeps the opening fence's info string with the body and compares both, so two languages with the same text are two examples, not a duplicate:
Thanks for the precise repro — it was the whole report. AI-assisted. |
12bb7fb to
9f99b01
Compare
|
Rebased onto The Round 44 merge rewrote On head If a guard for a defect that is no longer in the tree is not worth carrying, say so and I will close it — the cases are small enough to fold into an existing docs test instead. AI-assisted. |
|
Two things after today's round-44 merge batch (main 561b65a): your guard is valuable and green — I ran it against current main and it now reports nothing, because the character_models.md duplication it targets was fixed on main independently — but that means git merge-tree now conflicts in character_models.md where your docs deletion overlaps the landed fix. The resolution is trivial: rebase, take main's side in that file, keep the guard file (it registers cleanly). The guard itself is well-scoped: identical-plus-blank-lines-only adjacency, fences and nesting handled by synthetic self-tests, and I confirmed the whole-docs scan is not vacuous (it flagged the exact repeat at 312/322 on pre-round-44 main). Coordination note: open PR #4490 adds a sibling repeated-LINES guard; the two are conflict-free and overlap in intent, so consider folding them into one checker eventually. Checks queued. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Thanks — and that conflict is already gone: the rebase landed at 11:40 UTC, before your comment. Head On #4490: agreed they overlap in intent, and the two checks are complementary — repeated lines anywhere versus repeated fenced blocks adjacent to each other. I would keep them separate until one lands, then fold both scans into a single docs checker in a follow-up, rather than have two PRs edit the same test file at once. If the maintainers would rather have the fold-up front instead, say so and I will close this one and put the block scan into #4490's file as a suggestion to its author. AI-assisted. |
|
Tested
|
What this is now
Rebased onto
561b65a8after the Round 44 merge.docs/character_models.mdno longer carries the repeated block onmain— its Reproduce section was rewritten during that merge, and nodone:for the item exists in the coordination thread — so the docs half of this PR is moot and was dropped in the rebase. What remains is the guard:tests/test_docs_adjacent_fenced_blocks.py.If the maintainers would rather not carry a guard for a defect that is no longer in the tree, closing this is the right call; the test's cases are small enough to lift into an existing docs test instead.
The test
Fails when two identical fenced blocks appear back to back in any
docs/*.md:As the tree stands, the scan finds no pair in 61 pages. The guard is aimed at the merge-leftover class the coordination issue tracks (repeated merges of the same PR leaving duplicated text), not at a live defect.
Tests run
Review notes: @Kam471's LGTM was on
e434ca04, before the info-string fix and this rebase; @shdann's report is fixed at9f99b0189.No GPU used, no game data. AI-assisted.
Depends on: none.