Context
check-ticket-archaeology's failure message prescribes one remedy for a deliberate reference:
put a typed marker directly after the ref: "#1234 [not-ticket-ref: <reason>]"
It works for exactly one shape. Measured against findArchaeology() at neo-agent-skills@dev 3503c35, four comments each carrying the same valid marker:
| comment |
escape honoured? |
kinds reported |
#1234 [not-ticket-ref: deliberate, the contract] |
✅ yes |
— no finding |
Epic #1234 [not-ticket-ref: deliberate, the contract] |
❌ no |
tracking-reference |
Discussion #1234 [not-ticket-ref: deliberate, the contract] |
❌ no |
tracking-reference |
ADR 0004 [not-ticket-ref: deliberate, the contract] |
❌ no |
tracking-reference, invalid-escape |
So the escape excuses a bare #N and is powerless against all eight named forms the same message enumerates — issue, ticket, bug, PR, pull request, Epic, Discussion, ADR. Naming the reference you cite removes your only way to declare it deliberate, and on an ADR the marker is counted as a defect: invalid-escape fires on markers.length !== escaped.size + refs.size, so following the instruction produces two findings where there was one.
The Problem
Two mechanisms built on different models.
The escapes are offset-based: escapedRefOffsets() collects the index of each #N token carrying a marker, and the bare-numeric loop at the end of findArchaeology() skips those offsets. That loop is the only consumer.
NAMED_TRACKING_PATTERNS.some(pattern => pattern.test(comment)) is a whole-comment boolean evaluated before it. A boolean carries no token position, so there is nothing an offset can excuse — the named branch cannot honour an escape even in principle.
Widening REF_ESCAPE_RE to accept an ADR NNNN token therefore fixes the ADR row and leaves Epic #1234 exactly as inescapable. The named branch has to become token-scoped, matching per match with an index and subtracting the escaped offsets the way the numeric loop already does.
Two measured divergences between the engine copy and the published guard
The engine keeps a mirrored copy at buildScripts/util/check-ticket-archaeology.mjs, whose comment states the reason: "Both patterns mirror the published guard rather than paraphrasing it, because the ONLY thing this change buys is the two agreeing." CI here runs the published binary, so the hook is the permissive side of both gaps:
- The prose form. The published copy reads
pull request 11982 as a tracking ref; the local copy does not. Same guard name, same files, opposite verdicts (PR #18793: hook green, CI red).
- Review archaeology is absent locally. The published guard carries six
REVIEW_ARCHAEOLOGY_PATTERNS; the engine copy carries none. So RA-3, "round 2 review", "previous review cycle" and the rest pass every hook here and red CI (PR #18808).
Mirror existence is what check-guard-ci-parity checks. Mirror agreement is what nothing checks.
Current population
Zero findings in neomjs/neo's comments carry a named form with an attempted escape. The cost is paid by authors at the keyboard rather than by the corpus: the guard refuses the ref, the author follows the instruction, and it refuses again. Both engine authors who hit it (PRs #18793 and #18806) rephrased rather than escaped, which is why the corpus stays clean and the defect stays invisible.
Status
The root fix is open at neo-agent-skills#84 (ticket neo-agent-skills#83), v0.1.9: named patterns are matched per token, the escape pattern accepts a named token, and invalid-escape counts a marker bound to one as valid. Six contract arms, red-first against the reverted guard.
The published copy is where it has to start. Widening the engine mirror first would make the hook accept an escape CI still rejects — hook green, build red, the worse direction of the divergence above.
Acceptance Criteria
Out of Scope
- Whether ADR or Epic refs should be detected at all — they rot like any other ref, and that is settled.
- The CSS-colour escape and its context rule.
Avoided Traps
- ⛔ Do not widen
REF_ESCAPE_RE alone. It is the obvious one-line change and fixes only the ADR row.
- ⛔ Do not make the escape line-scoped. The design binds a marker to its token deliberately: a line may carry an annotated ref and a genuine one, and only the first is excused.
- ⛔ Do not fix the engine copy first. CI here runs the published binary.
- ⛔ Do not read "zero corpus findings" as low value. The remedy being unfollowable produces silence, not evidence.
Related
neo-agent-skills#83 / neo-agent-skills#84 (root fix) · #18793 · #18806 · #18808 (the three PRs these gaps blocked)
Origin Session ID: 5bf0b816-b919-40fc-9c18-fee751fd1635
Retrieval Hint: "ticket archaeology named tracking pattern whole-comment test ignores typed escape offsets Epic Discussion ADR inescapable engine mirror divergence"
Context
check-ticket-archaeology's failure message prescribes one remedy for a deliberate reference:It works for exactly one shape. Measured against
findArchaeology()atneo-agent-skills@dev3503c35, four comments each carrying the same valid marker:#1234 [not-ticket-ref: deliberate, the contract]Epic #1234 [not-ticket-ref: deliberate, the contract]tracking-referenceDiscussion #1234 [not-ticket-ref: deliberate, the contract]tracking-referenceADR 0004 [not-ticket-ref: deliberate, the contract]tracking-reference,invalid-escapeSo the escape excuses a bare
#Nand is powerless against all eight named forms the same message enumerates —issue,ticket,bug,PR,pull request,Epic,Discussion,ADR. Naming the reference you cite removes your only way to declare it deliberate, and on an ADR the marker is counted as a defect:invalid-escapefires onmarkers.length !== escaped.size + refs.size, so following the instruction produces two findings where there was one.The Problem
Two mechanisms built on different models.
The escapes are offset-based:
escapedRefOffsets()collects the index of each#Ntoken carrying a marker, and the bare-numeric loop at the end offindArchaeology()skips those offsets. That loop is the only consumer.NAMED_TRACKING_PATTERNS.some(pattern => pattern.test(comment))is a whole-comment boolean evaluated before it. A boolean carries no token position, so there is nothing an offset can excuse — the named branch cannot honour an escape even in principle.Widening
REF_ESCAPE_REto accept anADR NNNNtoken therefore fixes the ADR row and leavesEpic #1234exactly as inescapable. The named branch has to become token-scoped, matching per match with an index and subtracting the escaped offsets the way the numeric loop already does.Two measured divergences between the engine copy and the published guard
The engine keeps a mirrored copy at
buildScripts/util/check-ticket-archaeology.mjs, whose comment states the reason: "Both patterns mirror the published guard rather than paraphrasing it, because the ONLY thing this change buys is the two agreeing." CI here runs the published binary, so the hook is the permissive side of both gaps:pull request 11982as a tracking ref; the local copy does not. Same guard name, same files, opposite verdicts (PR #18793: hook green, CI red).REVIEW_ARCHAEOLOGY_PATTERNS; the engine copy carries none. SoRA-3, "round 2 review", "previous review cycle" and the rest pass every hook here and red CI (PR #18808).Mirror existence is what
check-guard-ci-paritychecks. Mirror agreement is what nothing checks.Current population
Zero findings in
neomjs/neo's comments carry a named form with an attempted escape. The cost is paid by authors at the keyboard rather than by the corpus: the guard refuses the ref, the author follows the instruction, and it refuses again. Both engine authors who hit it (PRs #18793 and #18806) rephrased rather than escaped, which is why the corpus stays clean and the defect stays invisible.Status
The root fix is open at
neo-agent-skills#84(ticketneo-agent-skills#83), v0.1.9: named patterns are matched per token, the escape pattern accepts a named token, andinvalid-escapecounts a marker bound to one as valid. Six contract arms, red-first against the reverted guard.The published copy is where it has to start. Widening the engine mirror first would make the hook accept an escape CI still rejects — hook green, build red, the worse direction of the divergence above.
Acceptance Criteria
Epic #N,Discussion #N,issue #N,PR #NandADR NNNNcarrying a valid typed marker produces no finding. (delivered byneo-agent-skills#84)tracking-reference. (delivered byneo-agent-skills#84)invalid-escape, named and bare alike. (delivered byneo-agent-skills#84)0.1.9publishes and the dependency bumps, so the two agree line for line — including the six review-archaeology patterns the engine copy is missing.Out of Scope
Avoided Traps
REF_ESCAPE_REalone. It is the obvious one-line change and fixes only the ADR row.Related
neo-agent-skills#83/neo-agent-skills#84(root fix) · #18793 · #18806 · #18808 (the three PRs these gaps blocked)Origin Session ID: 5bf0b816-b919-40fc-9c18-fee751fd1635
Retrieval Hint: "ticket archaeology named tracking pattern whole-comment test ignores typed escape offsets Epic Discussion ADR inescapable engine mirror divergence"