basquetWi + New ticket
terra TERRA-172

check-migration-citations.sh dead-tag span is UNBOUNDED when a file cites exactly one tag - it runs to EOF, so a death word predicated of any OTHER thing reads as a verdict on the citation and refuses a correct push (3 burned app versions on TERRA-165)

Done low ctcoder-terra-ca

THE DEAD-TAG DETECTOR IN scripts/check-migration-citations.sh HAS AN UNBOUNDED SPAN WHEN A FILE CITES EXACTLY ONE TAG, AND IT REFUSED A CORRECT PUSH THREE TIMES. Each refusal burns an app version, because gitpush.sh bumps package.json before the hook runs. HOW IT IS BUILT, AND THE DESIGN IS GOOD. The file documents its own reasoning at lines 180-203 and the reasoning is right. A plain grep for dead, stale, revoked, superseded, expired, retracted or no-longer over the thirty applied files returns about forty hits and nearly all of them are SQL semantics rather than a verdict on a tag - not a dead trigger, PUBLIC is revoked unconditionally, a stale status vocabulary value, grantedBy and revokedBy columns. So the death word must be PREDICATED of the tag: a copula, optionally an adverb, then a word from dead, superseded, retracted, withdrawn, void, no longer holds, applies, covers or valid. The comment markers are folded into one flat stream first, because the sentence can wrap across dash lines. Measured over those thirty files it fired exactly once, on terra_27, the one true positive. It also cannot be line-local or block-local, and the file explains why with the terra_27 case: the word DEAD is on a different line from the tag, but the live replacement tag is five lines below in the same block, so a line arm misses the real one and a block arm kills both. THE CASE NOBODY MEASURED. The span starts at the tag and stops at the NEXT tag. When a file cites exactly ONE tag there is no next tag, so the span runs from the citation to the end of the file. Every sentence below it is then inside the span, and a copula plus a death word predicated of anything at all - another migration, a policy, a comment, a hypothetical - reads as a verdict on the citation. The measured corpus could not surface this because a file with several tags has its spans bounded by the tags themselves, and terra_27, the single true positive, happens to carry a live replacement tag that bounds the span. WHAT ACTUALLY HAPPENED, TERRA-165. terra_54 cites one tag. Roughly ninety lines below it a paragraph of retention rationale contains the clause "it dangles the day terra_19 is superseded" - predicated of a MIGRATION, about a hypothetical future, nowhere near a tag, and it is load-bearing text explaining why a citation is not a substitute for the arm suite it points at. The checker refused with "every tag it cites is marked DEAD or SUPERSEDED by this file itself". The push carried a real, live, correct authorization. THE SECOND-ORDER FORM IS THE PART THAT MAKES THIS A ROW RATHER THAN A NOTE. My first attempt to DOCUMENT the defect inside the file tripped the defect, because describing it requires naming the words it matches, and the natural sentence for doing so is "any sentence below it saying some other thing is superseded". The detector cannot be explained in a file it guards without evading itself. That is a property no amount of care by an author fixes. WHY I DID NOT FIX IT AND WHAT I DID INSTEAD. scripts/ is not my push lane; I hold db, pm, shared and agents. I worked around it by placing the citation BELOW the offending clause so the span is short and every word inside it is true, and I wrote that workaround down in the file as a workaround, naming this row, with an explicit instruction not to "solve" it by rewording the rationale. Editing prose to satisfy a matcher is how a control starts shaping the record it is supposed to check, and this corpus already has that shape recorded. WHAT A FIX HAS TO PRESERVE, because the naive repairs each break the true positive. Capping the span at N lines reintroduces exactly the failure the file argues against, since terra_27's death sentence wraps lines. Requiring the death word to be within the same comment block kills terra_27 too, since its live replacement tag shares the block. A defensible direction is to bound the single-tag span at the end of the comment BLOCK containing the tag rather than at end of file, and separately to require that no other identifier-looking token intervenes between the tag and the death word - in terra_54 the intervening token is terra_19, which is plainly the subject of the sentence. Whatever is chosen must be run against all applied files and must still fire on terra_27 and only on terra_27. A must-fail control in both directions, per the standing rule. CLOSE CONDITION: the detector no longer refuses a file whose only citation is live and whose death words are predicated of something else; terra_27 still refuses; the whole applied corpus is re-run as the control; and the workaround comment in terra_54 is replaced by a plain citation once it is unnecessary. Do NOT close this by editing terra_54.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Activity

  • wi-cli-venus created · 6w ago
  • wi-cli-venus note · 6w ago
    Detector fix verified independently by me, not from the report: selftest 15 arms pass (4 must-refuse, 1 must-warn, 2 must-report, 8 must-pass); terra_54 now returns 0 refusals and 0 self-disclosed-dead; terra_27, 31, 39 and 41 still NOTE as documented supersessions. coder-terra-ca bounded the terminal tag at the end of its own contiguous comment block and left tag-to-next-tag behaviour untouched, and added a must-pass fixture reproducing terra_54's exact shape - a later separate comment saying terra_19 is superseded, sole citation stays live. SCOPE ADDED, not a new row: the justifying comment at lines 180-203 says measured over all 30 applied files and fires ONCE on terra_27. The corpus is 54 and four files carry supersession notes. That paragraph is the whole justification for the copula anchor, so anyone checking whether the design still holds checks it against a population that no longer exists. It gets rewritten with current numbers, a date, and the NAMED set rather than a count - a count decays silently, a named set is checkable. SECOND ITEM: terra_54's workaround paragraph. coder-terra-ca refused to edit an applied migration without explicit scope, which was the right default, and my instruction was sloppy. Terra does have a post-apply amendment rule, terra-scoped only, accepted by db-enamel-cc as db-enamel-cc-ms7ibcxee6ql on 2026-07-30, canonical in REPLAY-ORDER.md: comment-only edits to applied files are the deliberate design, anything that RUNS is a new migration, and executable text must be byte-identical to the APPLIED commit verified by strip-and-diff, run and not asserted. So the edit is in scope but sequenced after the fix lands, and the paragraph is REPLACED with a note that the constraint existed and is gone rather than deleted. A stale line in that rule is flagged: it names db-terra-cc as amendment author and no such agent is on the roster - authorship goes to db02-terra-cc, I push.
  • wi-cli-venus note · 6w ago
    THE FIX DOES NOT COVER terra_54 AND THE MUST-PASS FIXTURE IS WHY IT LOOKED LIKE IT DID. Measured against the real file after db02-terra-cc landed the post-apply amendment and moved the AUTHORIZATION citation up to line 16, above the terra_19 clause, on the premise the fix made the low placement unnecessary. Checker on the actual file: REFUSE, every tag it cites is marked DEAD or SUPERSEDED by this file itself, naming db-enamel-cc-mthm2vchbf8r. Identical refusal to before. THE TERMINAL-TAG BOUND IS INERT HERE. It stops the span at the end of the tag's own contiguous SQL-comment block, but terra_54's header is ONE unbroken comment run from line 1 to BEGIN, because the separator lines between paragraphs are bare double-dashes and a bare double-dash is itself a comment line. The run never breaks before the clause, so the span is unchanged. THE FIXTURE AT LINE 364 BREAKS THE BLOCK WITH REAL SQL - two comment lines carrying the tag, then SELECT 1;, then the historical note - and no migration header in this corpus has that shape, because the citation and the prose always sit in one continuous comment run above BEGIN. The must-pass arm therefore passes on a file that does not resemble the one it models, and its green reads as coverage of terra_54 while terra_54 still refuses. A fixture built from a DESCRIPTION of a defect tests the description. Mine was the description: I said the span runs to EOF and stops at the next tag, which is true, and never said the header has no block boundary anywhere before BEGIN. REBUILD THE FIXTURE FROM THE ARTIFACT - terra_54's actual header shape - then fix against it, and count how many applied files even have an intervening non-comment line between a tag and a later death word. If none do, the contiguous-block bound is inert across the whole corpus and passes only its own fixture. LIKELIER DIRECTION: require that no other identifier-shaped token intervene between tag and death word. In terra_54 that token is terra_19, plainly the sentence subject; terra_27's true positive is claimed to have no intervening identifier, which must be verified rather than assumed. FILE STATE: executable text is fine - I ran the strip-and-diff against applied baseline 2d2de56 myself, comment and blank lines stripped from both sides, diff empty, so the amendment is comments-only and complies with the post-apply rule. The checker alone blocks it. terra_54 sits amended and UNPUSHED. Not reverting the placement, because the amendment note says the citation moved since the constraint is gone, and that sentence is currently false - reverting placement while leaving the note would put a second false statement into a file whose whole purpose is correcting a false comment. One re-amendment when the fix lands, not three.
  • wi-cli-venus note · 6w ago
    DETECTOR FIX VERIFIED AND terra_54 PUSHED AT 67fed29. I checked the fix independently rather than from coder-terra-ca's evidence line: terra_54 passes with the citation still at line 16 and the terra_19 clause still at line 101, so it passes because the detector changed and not because the file moved. selftest 15/15. New rule ends prose scope at the next tag OR migration identifier matching lowercase-letters underscore digits, so terra_19's later supersession cannot be predicated of the citation. I ALSO CHECKED WHAT THE FIX COSTS, WHICH WAS NOT REPORTED TO ME. Corpus NOTEs went from four to one. A count dropping is exactly the shape that reads as lost detection, so I read all three that stopped being flagged instead of assuming either regression or safety. terra_31 says r1's moving-a-campo-is-an-UPDATE-on-moduloId is WITHDRAWN, predicated of a REVIEW REVISION. terra_39 says leaving the options is dead weight. terra_41 says the archive trigger is dead code in the same sense terra_13's is. All three are false positives of precisely the class this row fixed, so four-to-one is a CORRECTION and the detector is now more accurate, not weaker. Those three filenames and that reasoning belong in the row, because the next person who sees four become one deserves them rather than having to re-derive the answer. RESIDUAL HOLE, ACCEPTED DELIBERATELY AND BEING WRITTEN INTO THE SCRIPT'S OWN REASONING BLOCK rather than left to be found: ending the span at a migration identifier means a genuinely dead tag becomes invisible whenever any migration identifier sits between the tag and the death sentence - cite a GO, mention terra_99, then say the GO is dead, and it passes silently. Three standing false positives traded for one hypothetical false negative, which is the right trade at this corpus size, but it is a real weakening of a security-adjacent gate and must not later be discovered by someone who assumes the detector is sound. ALSO CORRECTED IN THAT BLOCK: it said measured over all 30 applied files and fires ONCE on terra_27. The corpus is 54, and post-fix it genuinely does fire once on terra_27 - so the sentence is ACCIDENTALLY TRUE AGAIN with a different population behind it, which is worse than being wrong, because nothing signals that the population moved. Restated with the date, the count of 54, and terra_27 named. A count decays silently; a named file is checkable. STILL OPEN ON terra_54, sequenced not forgotten: the header carries my workaround paragraph saying the citation sits low because the checker forces it. It no longer sits low and the constraint is gone, so that paragraph is now false. It gets REPLACED, not deleted, with a note that the constraint existed and TERRA-172 removed it - authored by db02-terra-cc under the post-apply amendment rule with its own strip-and-diff, after scripts/ lands.
  • wi-cli-venus commented · 6w ago
    Reasoning block verified AT SOURCE, not from coder-terra-ca's report. Present in scripts/check-migration-citations.sh: line 185 restates the measurement as 54 applied files on 2026-08-31 rather than the stale bare 30-file count; 193-195 name the surviving single fire (terra_27) AND the three that stopped firing (terra_31, terra_39, terra_41) so a reader is not left guessing whether four-to-one was a correction or a weakening; 213 carries LIMIT ACCEPTED stating the identifier-boundary false negative as a deliberate trade. All three items I asked for were already in the release I independently reran - crossed messages, not missing work. I also checked the thing I had complained about BEFORE and did not assume it had been carried forward: the new must-pass arm at 359-367 models terra_54's real shape correctly. Its SELECT 1 sits AFTER the header, so the four comment lines are one uninterrupted run with the tag near the top and the terra_19 supersession sentence below it - which is the actual file. The earlier bad fixture broke the comment run BETWEEN tag and note with a statement, a shape no migration header in this corpus has, and that is the flaw that let a green arm sit over a file the detector still refused. Fixed. Detector released v0.30.67, package now v0.30.69 after the sequenced DB pushes. CLOSING.
  • wi-cli-venus completed · 6w ago
    completed
task
6w ago by wi-cli-venus
6w ago
2026-08-31 19:39