LearnNewsExamplesServices
Frontmatter
id18754
titlecheck-ticket-archaeology dies in a fresh clone: a scan root holding only gitignored files
stateClosed
labels
bugaitestingbuild
assigneesneo-opus-vega
createdAtSep 15, 2026, 9:41 PM
updatedAtSep 16, 2026, 8:51 PM
githubUrlhttps://github.com/neomjs/neo/issues/18754
authorneo-opus-vega
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 16, 2026, 2:29 PM

check-ticket-archaeology dies in a fresh clone: a scan root holding only gitignored files

Closed v13.2.0/archive-v13-2-0-chunk-21 bugaitestingbuild
neo-opus-vega
neo-opus-vega commented on Sep 15, 2026, 9:41 PM

Context

Found sideways while designing the CI-parity alignment predicate for #17783, and reproduced from two directions. DEFAULT_SCAN_PATHS in buildScripts/util/check-ticket-archaeology.mjs:16:

export const DEFAULT_SCAN_PATHS = ['ai', 'src', 'test/playwright', 'buildScripts/util/check-ticket-archaeology.mjs'];

ai is a scan root whose entire content is gitignored. .gitignore:112-113:

ai/mcp/server/*/config.mjs
ai/config.mjs

git ls-files ai → 0. Nothing under ai/ is tracked, by design — the directory holds generated MCP server configs and exists only after setup has run.

⛔ Not a stale root, and I published that wrong first. My initial read was that ai was a Body/Brain-split leftover pointing at a removed directory. It is not: the root is live and deliberate, and the zero has a different cause. Recorded because it changes what the fix is.

The Problem

Two failure modes, one cause.

1. The guard is unrunnable in a tree that has not generated its configs. @neo-opus-ada tried to run it locally to pre-empt a CI red on #18752 and it died:

find: ai: No such file or directory

My own clone has generated them, so the guard runs here and reads 1122 files — my tree masks the defect. That asymmetry is the expensive part: whether this guard works at all depends on local setup state, with no diagnostic saying so.

2. Local and CI verdicts differ by construction. In a set-up tree the guard scans gitignored generated .mjs config under ai/. CI checks out tracked files only, so those files are never present there. The guard's own output advertises the discrepancy without naming it:

full audit scope: ai, src, test/playwright, buildScripts/util/check-ticket-archaeology.mjs

That scope is accurate locally and unachievable in CI.

The Architectural Reality

ticket-archaeology-lint.yml's paths: filter is src/**/*.mjs, test/playwright/**/*.mjs, the guard itself, and the workflow — no ai/** entry. Its header states the invariant it is honouring:

"Mirror DEFAULT_SCAN_PATHS in buildScripts/util/check-ticket-archaeology.mjs: every path that triggers this gate must also be in the guard's scan scope, or the gate passes vacuously."

That is paths ⊆ scan, and the workflow satisfies it. The converse — scan ⊆ paths, every file the guard would scan being able to trigger the gate — cannot be satisfied for ai, because a paths: filter selects from tracked files and ai/ has none. The mirror is correct; the scan root is what makes the two sets unreconcilable.

This is load-bearing for #17783. The alignment predicate I am authoring there compares a workflow's paths: allowlist against the guard's declared scan surface. Keyed to declared strings, or even to local existence, it reds this correct mirror permanently — check-ticket-archaeology is the first guard it examines. The predicate needs to compare against what CI can see, and this root is the reason.

The Fix

Decide what ai is doing in the default scan surface, then make the guard honest about it:

  • If gitignored generated config should not be audited — it carries no durable JSDoc a human maintains — drop ai from DEFAULT_SCAN_PATHS. scan ⊆ paths then holds for this guard and the workflow needs no change.
  • If it should be audited, the root must resolve to something CI also sees, and the workflow's paths: must be able to trigger on it. Given the content is gitignored, this direction likely ends at the same place.
  • Either way, a declared root that is absent must produce a named diagnostic rather than a find stack — "scan root ai does not exist; run npm run prepare or remove it from DEFAULT_SCAN_PATHS" beats find: ai: No such file or directory.

Recommendation: the first. ai/ holds machine-generated config, which is precisely the category the ticket-archaeology rule does not govern.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
DEFAULT_SCAN_PATHS .gitignore:112-113; git ls-files ai → 0 drop ai; audit scope becomes CI-reachable — its export site + workflow header check-ticket-archaeology.mjs:16
absent-scan-root handling this ticket named diagnostic naming the root and the remedy none today — raw find failure guard's --help reproduced above
ticket-archaeology-lint.yml paths: the guard's scan surface unchanged under the recommendation — existing header invariant .github/workflows/ticket-archaeology-lint.yml:13

Decision Record impact

none. A scan-surface correction inside one guard.

Acceptance Criteria

  • Red-first: an arm reproduces the fresh-clone failure — the guard invoked with a DEFAULT_SCAN_PATHS member absent from the tree fails with a named diagnostic identifying the root, and reds against today's raw find error.
  • ai is resolved one way or the other, with the reason recorded at the export site rather than in this ticket alone.
  • git ls-files over every remaining DEFAULT_SCAN_PATHS member returns a non-zero count — no member is tracked-empty. This is the arm that keeps the class fixed rather than the instance.
  • The guard's full audit scope: output names only roots CI can also see, so a local verdict and a CI verdict are comparable.
  • ticket-archaeology-lint.yml is unchanged, or its change is justified against the header invariant it already states.
  • Post-merge: the #17783 alignment predicate evaluates check-ticket-archaeology as a covering mirror without a special case for this root.

Out of Scope

  • The alignment predicate itself — #17783, mine. This ticket removes its first false positive; it is not the predicate.
  • The 2 genuine ticket-archaeology findings the guard currently reports (CrossLinkIssuesUrl.spec.mjs:22, PoolingRuntimeUpdates.spec.mjs:5). Real, unrelated to the scan surface, and not annexed here.
  • Other guards' scan surfaces. check-fixed-sleeps, check-engine-brain-boundary, check-class-module-scope and check-file-sizes also export one; AC-3 checks this guard's members, and widening the sweep is a separate measurement.
  • Whether ai/ should exist in the engine at all. A Body/Brain boundary question, not a lint question.

Avoided Traps

⛔ Do not "fix" this by adding ai/** to the workflow's paths:. The filter selects from tracked files; ai/ has none, so the entry would govern nothing while reading as a rule — and it would make the vacuous-pass invariant in the workflow header false.

⛔ Do not read your own ai/ as evidence the root is live. The trap is real and points the other way: @neo-opus-ada measured that nothing in this repository writes ai/ any more and that no other neo checkout on her machine holds one — a directory present here is pre-split residue from before the Brain moved to neo-agent-brain. Its content being gitignored is why the zero is stable; its presence is local history, and a fresh clone has neither.

⛔ Do not verify the fix only in a set-up clone. That is what hid this: the guard runs fine here and dies for a peer. The red-first arm must simulate the absent root rather than rely on the tester's local state.

Related

  • #17783 — the CI-parity guard relocation and the alignment predicate that this unblocks.
  • #18752 — where @neo-opus-ada hit the local failure.
  • neomjs/neo-agent-brain#364 — the paths presence-rule revert whose design work surfaced this.

Origin Session ID: a2868f57-a008-4abf-b493-b87be1636964

Retrieval Hint: query_raw_memories("DEFAULT_SCAN_PATHS ai gitignored scan root fresh clone find no such file")

Live latest-open sweep: checked latest 20 open issues at 2026-09-15T19:41:12Z plus a 100-issue title scan for scan-root/archaeology terms; no equivalent found.

tobiu referenced in commit 375c3c5 - "fix(buildScripts): the archaeology guard's scan surface is one CI can also see (#18754) (#18790) on Sep 16, 2026, 2:29 PM
tobiu closed this issue on Sep 16, 2026, 2:29 PM
tobiu referenced in commit 643fc5a - "feat(buildScripts): a mirror's paths filter is held to what its guard reads (#18791) (#18793) on Sep 16, 2026, 3:51 PM