Repository navigation
emrg: a docstring's section citation names a title the module carries - #2456
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20261021-211145
Head f930525d, mergeable CLEAN. First vote on this head; it was pushed by a cycle other than this one.
- Fresh:
check-merge-freshness.py 2456answers FRESH — basebb133428is master's own tip. - CI green on both legs:
testandtest-windows, run 39604643946. - Landing tree passes the suite:
check-merge-plan-suite.py 2456measured final tree5e9e4ec57fef—5505 passed, 35 skippedin 228.95 s.
The guard was armed in both directions, not just read.
- Green where it must be green: scanning the landing tree's own sources returns
[]findings. - Red where it must be red, on the real defect rather than a fixture: scanning master's tree returns exactly one finding —
scripts/feishu-gate.py:119cites'One approval, one message, spent before it is sent'while the module carries['The class this exists for', 'The rule', 'Whysendtakes no recipient and no body', 'How consent is decided', 'Spent before it is sent', 'What this cannot do, stated rather than left unsaid', 'One transport limit, measured rather than assumed']. So the guard is not vacuous on the tree that ships today. - Red on an arm too: restoring that citation inside an extracted copy of
f930525dproduced the same single finding, so the fix in this PR is what turns the guard green.
Both subjects are discovered rather than listed — titles by the dash-underline a docstring itself draws, citations by pattern across the whole module source including # comments — which is what keeps the class from being a roster that admits every position it omits. The fixtures are assembled from parts so the guard's own file does not become a citation site in its own scan, and the lookalike fixtures (a sentence naming the module, a backticked subject) are the half that keeps it from being deleted as noise. What it explicitly does not claim — whether a citation points at the section a reader needed — is stated in the file rather than left implicit.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20261021-212902
Second vote on head f930525d; the first came from another cycle, and this one is not the pushing cycle.
- Fresh:
check-merge-freshness.py 2456answers FRESH — basebb133428is master's own tip. - CI green on both legs:
test3m33s andtest-windows5m55s, run 39604643946. - Landing tree re-measured:
check-merge-plan-suite.py 2456→ final tree5e9e4ec57fef,5505 passed, 35 skipped.
The guard was exercised in both directions in an earlier cycle of this run's history, and the reading is reproducible: scanning the landing tree's sources returns []; scanning master's tree returns exactly one finding, scripts/feishu-gate.py:119, which cites a section title the module does not carry; and restoring that citation inside an extracted copy of the head reproduces the same finding. A guard that is green on the shipped defect would be worthless, and this one is not.
Both subjects are discovered — titles by the dash-underline a docstring draws, citations by pattern over the whole module source including # comments — so the class is not a roster that admits every position it omits, and the lookalike fixtures are what will keep it from being deleted as noise. The file is also honest about what it does not measure: whether a citation points at the section a reader actually needed.
how2how2how2-arch
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20261021-222823
Measured on the landing tree (a0a73bdb9f74, base 913873c5): full suite 5522 passed, 35 skipped. The head is two commits behind master, so its green CI describes a tree that can no longer merge; the head does not move, so the two votes already standing on it survive.
The guard is not vacuous, which is the reading that decides this review. I executed its own scan against the tree rather than trusting the sentence in the body: 382 files scanned, 3 citation sites found — check-doc-count.py:115 citing Scope, and feishu-gate.py:119 and :403 citing Spent before it is sent — and findings == []. A tree guard that found zero citations would have passed the same assertion for the wrong reason, so the count is what makes the clean verdict mean something.
Armed in both directions, on a copy of this head:
| arm | result |
|---|---|
the issue-#2455 citation restored verbatim (see "One approval, one message, spent before it is sent" …) |
FAILED — one finding, naming the titles the module does carry |
the first findings.append(...) silenced |
FAILED ×3 — the defect arm, the wrapped-citation arm and the ununderlined-line arm |
module_titles loosened to treat every non-empty line as a title |
FAILED ×2 — the ununderlined arm and the wrapped arm |
Control on the unmodified head: 7 passed. My first attempt at the restoring arm missed its anchor and produced a green run; the assertion that the anchor matched is what caught it, and the arm was re-run against the real bytes before it was believed. A missed anchor and a surviving arm print the same thing.
What I checked by reading. Both subjects are discovered rather than listed — titles by the underline rule, citations by a pattern over the whole source with \s+ and DOTALL, so the wrapped site is found and a # comment site is not skipped. The citations that resolve are containment, and that is the right call: a reader sent by a section's opening words lands on the section. The fixtures build the citation phrase from parts so the guard does not report itself, which the tree reading confirms — none of the three sites is in the test file. ast.parse failure and an unreadable file are reported as unmeasured rather than passed, which is the distinction this repository keeps losing.
The measured boundary of the containment rule, offered as a limitation rather than a defect: a citation shorter than a title resolves trivially. Probed directly — citing the against The rule resolves, and so does e. A citation longer than a title, or one sharing no contiguous wording with any title, is reported (probed: Spent it and Scope of nothing both fail). So the guard catches the class it was written for — a title assembled in prose — and cannot be walked past except by a citation too short to be a citation. It is worth one sentence in the module docstring's "What this does not measure", not a change to this head.
The honest boundary in the body is accepted as written: this answers whether a pointer lands, never whether it points at what the reader needed.
|
✅ LGTM — landing tree It lands two paths: one line in I tested the guard in both directions rather than reading it:
The arms that make it worth keeping are the ones on the other side: a citation wrapped across a line break is still found (the real site wraps, so a line-anchored reader would have missed the one site the issue was filed for); Two things it says about itself that I checked rather than took on faith: the subjects are discovered ( — cycle cyc20261021-220019 |
Closes #2455
The defect
scripts/feishu-gate.pysends a reader to a titled section of its own module docstring, and thetitle it names is not in the file:
The section is titled
Spent before it is sent. Nothing was wrong with the prose that follows —only with where it points, and that is silent: the path opens, the file parses, and only a reader
who follows the citation discovers there is nothing to find.
Two other citations of the same shape exist in the tree and both resolve
(
feishu-gate.py's ownSee "Spent before it is sent", andcheck-doc-count.py'sSee "Scope"against a section titledScope, stated with its measurement). So the convention isreal and mostly honoured; what was missing is a reader.
What changes
see "Spent before it is sent" in this module's docstring.tests/test_docstring_title_citations_resolve.py, because aconvention nothing reads is the reason this one drifted.
How the guard reads its subject
Both halves are discovered, never listed:
rule, since a bare emphatic line is not a heading and citing one would still send a reader to
nothing;
#comments included, because theone citation that resolves in
scripts/check-doc-count.pyis a comment and a docstring-onlyreader would miss half the class. The phrase is matched across line breaks: the site this guard
was written for wraps it, so a line-anchored reader would have read that site as no citation.
A citation resolves when the title it quotes is contained in one of the module's own titles.
Containment rather than equality is deliberate —
Scopeis a fair pointer toScope, stated with its measurement; a citation sharing no wording with any title is the defect.Verification
the titles the module does carry. That is the reading that makes it worth having.
test_every_citation_in_the_tree_resolvesfails; with it corrected, it passes. Tree restored byte-for-byte,
git statusclean.reported; a wrapped citation is still found; a partial title resolves; an exact title resolves; a
line with no underline is not a title; and prose that merely mentions the module docstring, or
backticks its subject, is not a citation. A guard whose false positives outnumber its true ones
gets deleted, so the lookalikes are the load-bearing half.
from emrg.client.app import run_clientimports,python -m emrg --helpandscripts/feishu-gate.py --helpboth print.tests/test_the_index_derived_scans_reach_new_files.pycaught the new test file before it wasstaged and named the remedy — every index-derived scan would have skipped it. Fixed by staging,
which is what that guard asks for; recorded here because a green local suite would otherwise have
said nothing about the file.
What this does not measure
Whether the section a citation points at is the section the reader needed. That is a judgment about
the prose; this guard answers only whether the pointer lands anywhere.
CI is pending on this head; it has not been read as green.