LearnNewsExamplesServices
Frontmatter
id18809
titleThe engine''s archaeology mirror and the published guard disagree, and the hook is the permissive side
stateClosed
labels
bugaitestingbuild
assigneesneo-opus-ada
createdAtSep 16, 2026, 8:50 PM
updatedAtSep 18, 2026, 5:39 PM
githubUrlhttps://github.com/neomjs/neo/issues/18809
authorneo-opus-vega
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 18, 2026, 5:39 PM

The engine's archaeology mirror and the published guard disagree, and the hook is the permissive side

Closed v13.2.0/archive-v13-2-0-chunk-21 bugaitestingbuild
neo-opus-vega
neo-opus-vega commented on Sep 16, 2026, 8:50 PM

Context

neomjs/neo keeps a mirrored copy of the archaeology guard at buildScripts/util/check-ticket-archaeology.mjs, and its own comment states the contract:

"Both patterns mirror the published guard rather than paraphrasing it, because the ONLY thing this change buys is the two agreeing."

CI runs the published binary (neo-agent-skills-ticket-archaeology). The pre-commit hook runs the local copy. They do not agree, and the hook is the permissive side — so a clean commit is not evidence about CI.

Live latest-open sweep 2026-09-16T18:50Z — latest 20 open issues plus a targeted search on the guard: only #18794 (the escape gap, whose AC-5 asks for exactly this predicate) and #17171. A2A sweep of the latest 30 messages: no competing claim.

The Problem

Measured at origin/dev, both guards run over this repository:

guard population findings
published (neo-agent-skills-ticket-archaeology) 1993 tracked .mjs 23
local (buildScripts/util/check-ticket-archaeology.mjs) 1136 (src, test/playwright, itself) 2

The populations differ, so the totals are not directly comparable — but the disagreement is not explained by scope. Three files inside the local guard's own scan surface report findings from the published guard and zero from the local one:

file published finding local
test/playwright/component/dashboard/DockSplitterPaint.spec.mjs:130 "The rendered half of RA-2" 0
test/playwright/unit/component/GallerySortSelection.spec.mjs:228 "the contract Cycle-1 RA1 asked for" 0
test/playwright/e2e/core/RefreshDomCorpseRepro.spec.mjs:91,100,133,143,176,193 Refresh #1 / Refresh #2 0

Two distinct causes, both measured:

  1. The local copy has no review-archaeology detection at all. The published guard carries six REVIEW_ARCHAEOLOGY_PATTERNS (RA-N, "review round N", "previous review cycle", …); grep -c REVIEW_ARCHAEOLOGY buildScripts/util/check-ticket-archaeology.mjs → 0. An entire detection family is missing locally.
  2. Numeric and prose handling differ. Refresh #1, product truth #1, pull request 11982 are findings for the published guard and not for the local one.

Why it costs

The mirror exists so the hook catches what CI catches, early. Inverted, it is worse than no mirror: an author gets a green hook, pushes, and CI fails on a line the hook read and approved. That happened twice today — PR #18793 (the prose form) and PR #18808 (RA-3) — and in both cases the flagged line was pre-existing, surfaced only because the PR staged the file.

It is also the property check-guard-ci-parity was relocated here to hold, one level in: mirror existence is what that lint checks; mirror agreement is what nothing checks.

The Architectural Reality

The local copy is not a pure duplicate. It carries engine-specific work the published guard does not have — DEFAULT_SCAN_PATHS, the exported SCAN_SURFACE, the absent-root diagnostic, and --dirs (#18754 / PR #18790). ScanSurfaceAlignment.spec.mjs imports that export, so the local module has consumers beyond the hook.

The published guard has --base, -i, -q and the full detection set. Neither is a superset of the other, which is how they drifted without anyone noticing.

The Fix — the decision is the deliverable

Recommended: one source, two callers. neo-agent-skills is already a dependency here and its binary already runs in this repository's CI. .husky/pre-commit can invoke the published binary with the staged paths, exactly as CI invokes it with --base. The divergence class then cannot exist, and it matches where the substrate is going — skills is becoming the installer for what several repos need, and hooks are that class.

What must not be lost: the scan-surface work. DEFAULT_SCAN_PATHS / SCAN_SURFACE / the absent-root diagnostic are engine data about which trees this repo audits, and the alignment spec depends on them. Either they move into the published guard as configuration the caller supplies, or a thin engine-local module keeps them and delegates the detection.

Alternative: keep the mirror and make the agreement mechanical. A spec that runs both binaries over a fixture corpus and asserts identical verdicts — #18794's AC-5 already asks for this. Cheaper now, and it keeps two implementations to maintain forever.

Sequencing. Aligning detection (adding the review-archaeology family locally) is the safe direction — it makes the hook stricter, so it can land independently. Aligning escapes must wait for neo-agent-skills 0.1.9 to publish (neo-agent-skills#84), because widening the local escape first makes the hook accept what CI still rejects.

Acceptance Criteria

  • AC-1: a recorded decision — single source, or mirror-plus-agreement-spec — with the rejected alternative and why.
  • AC-2: a predicate that fails when the two disagree, run over a fixture corpus rather than over this repository, so it does not assert today's damage.
  • AC-3: the three files above report the same verdict from whichever guard the hook runs, and the ~20 pre-existing findings are either repaired or recorded with reasons. Not silently baselined: each is a real decay-prone ref or a real false positive, and which one it is must be stated per site.
  • AC-4: SCAN_SURFACE, DEFAULT_SCAN_PATHS and the absent-root diagnostic survive in a form ScanSurfaceAlignment.spec.mjs can still import.
  • AC-5: the escape-semantics half is explicitly deferred to after 0.1.9 publishes, with the sequencing reason recorded.

Out of Scope

  • The escape gap itself — neo-agent-skills#83 / #84, and #18794 tracks the engine mirror of it.
  • Changing what either guard should detect. This is about the two agreeing, not about the rule.

Avoided Traps

  • ⛔ Do not align the escapes locally first. Hook green, CI red is the worse direction, and it is the exact failure this ticket documents.
  • ⛔ Do not baseline the ~20 findings to make the suites green. Several are genuine decay-prone refs (RA-2, Cycle-1 RA1, retired ticket-ref-ok markers) and several are plausible false positives (Refresh #1, writer-1). A blanket baseline hides both kinds.
  • ⛔ Do not delete the local module without rehoming its exports. ScanSurfaceAlignment.spec.mjs imports SCAN_SURFACE, and #18754's absent-root diagnostic exists because the guard died in a fresh clone.
  • ⛔ Do not assert parity by diffing the two files. Identical pattern lists do not imply identical verdicts — detection is where both divergences live, and a text diff would have reported these two as "in sync".

Related

#18794 (escape gap; its AC-5 asks for the agreement predicate) · neo-agent-skills#83 / #84 (root fix, v0.1.9) · #18754 / PR #18790 (the scan-surface work in the local copy) · #18793 and #18808 (the two PRs this cost) · #17783 / PR #18753 (check-guard-ci-parity, which checks mirror existence)

Origin Session ID: 5bf0b816-b919-40fc-9c18-fee751fd1635

Retrieval Hint: "engine archaeology mirror diverges from published guard hook permissive review archaeology patterns missing one source two callers"