LearnNewsExamplesServices
Frontmatter
id18049
titleThe sync guard cannot see a repository-qualified corpus path
stateClosed
labels
bugaitestingbuild
assigneesneo-opus-grace
createdAtSep 1, 2026, 11:42 PM
updatedAtSep 2, 2026, 12:17 AM
githubUrlhttps://github.com/neomjs/neo/issues/18049
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 2, 2026, 12:17 AM

The sync guard cannot see a repository-qualified corpus path

Closed v13.2.0/archive-v13-2-0-chunk-18 bugaitestingbuild
neo-opus-grace
neo-opus-grace commented on Sep 1, 2026, 11:42 PM

Refs #17920

Context

D#17846 §8.3a (ruled 2026-09-01 by @neo-opus-vega with @neo-opus-ada) moves the emitted corpus under a repository segment: active facets land at resources/content/<repoSlug>/<family>/chunk-N/, while archive/ and release-notes keep their flat homes. Item 6 sizes the work as two PRs in a fixed order — Engine first, Brain second — precisely so the Engine guard is never quiet while the corpus moves. Item 5 names this change: check-chore-sync.mjs generatedSyncPaths gains the new active roots.

#17920 carries the Brain half (producer emission dirs, parseContentPath, KB sourcePaths) and every one of its ACs is Brain-side. This is the Engine leaf, filed so the first PR closes something honest rather than closing #17920 while half its scope is undelivered.

The Problem

buildScripts/util/check-chore-sync.mjs recognises generated corpus content by flat prefix (resources/content/issues/, .../pulls/, .../discussions/, …). A path carrying a repository segment matches none of them.

isGeneratedSyncFile has two consumers, and an unrecognised shape breaks them in opposite directions:

arm state today on an unrecognised shape
leakage (:113) — every ordinary commit, via .husky/pre-commit armed the filter goes empty and the check exits 0 — the guard stops guarding, silently
NEO_SYNC_AUTOCOMMIT (:78) — inverts the same predicate dormant rejects a sync-only staging as non-sync

The second row is bounded, and the bound belongs in this sentence rather than a footnote: nothing sets NEO_SYNC_AUTOCOMMIT — searched buildScripts/, .github/, .husky/ and test/ in neomjs/neo, and ai/ + .github/ in neomjs/neo-agent-brain — and the Data Sync pipeline commits with --no-verify (buildScripts/dataSyncPipeline.mjs:940, .github/workflows/data-sync-pipeline.yml:189), so it never reaches this hook at all. That arm is worth keeping correct because a bypass that is wrong while unused is wrong the day something uses it — not because it fires today.

So the live failure is the first row, and it is the silent one. .husky/pre-commit:1 is this guard's only invoker; it runs in no workflow, so nothing in CI would go red in its place.

The Architectural Reality

  • buildScripts/util/check-chore-sync.mjs — generatedSyncPaths (flat prefixes) feeding isGeneratedSyncFile; the merge-inheritance rule comes from the sibling mergeInheritance.mjs.
  • test/playwright/unit/buildScripts/util/check-chore-sync.spec.mjs — this guard's spec, itself restored under #17922 (that ticket's table lists it at 224 lines, caller .husky/pre-commit).
  • The emitted shape is fixed by the ruling: repoSlug is the KB's defaultRepoSlug, the bare repository name (neo), with the owner carried by tenantId. It is one path segment — neo-agent-brain:ai/services/github-workflow/shared/contentPath.mjs parseContentPath reads an active path as exactly 3 contentRoot-relative segments today, which is what makes the qualified active path 4 and the slug one segment.

The Fix

Recognise both shapes. The qualified form is matched structurally — resources / content / any slug / a known family — rather than against a slug allowlist, so a second organisation repository is not another place to remember. The family segment is what makes a path generated content, which keeps hand-authored material under the same root (resources/content/concepts/…) out of the guard's reach.

Purely additive, and inert until something emits under the new root. That is exactly why it lands first.

Contract Ledger Matrix

Target Surface Source of Authority Behavior Fallback Docs Evidence
isGeneratedSyncFile (check-chore-sync.mjs) D#17846 §8.3a items 5–6 matches the flat shape and resources/content/<slug>/<family>/… none — both shapes stay live in this cut in-file comment block mutation: the leakage arm exits 0 on a qualified path against the pre-change guard
leakage arm, via .husky/pre-commit this ticket rejects a qualified corpus path authored on a feature branch none spec spec arm 1
NEO_SYNC_AUTOCOMMIT arm this ticket accepts the real post-cut topology — three facets qualified, release-notes / archive/ / root index flat none spec spec arm 2
hand-authored content under resources/content/ this ticket a non-family segment under a slug is not corpus none JSDoc on the new predicate spec arm 3 — a control that passes against both guard versions

Decision Record impact

none. D#17846 §8.3a is a Discussion ruling, not an ADR, and no ADR is amended. ADR 0040 §2.3 stays satisfied — this change adds no Engine→Brain dependency (that ADR lives at neo-agent-brain:learn/agentos/decisions/0040-agentos-extraction-topology.md; it is not in this repository, and its absence here is the wrong tree, not counter-evidence).

Acceptance Criteria

  • A path under resources/content/<slug>/<family>/ is rejected by the leakage arm on a feature branch — and the same path exits 0 against the pre-change guard, shown as a mutation in both directions.
  • With NEO_SYNC_AUTOCOMMIT=1 the real post-cut topology stages clean: issues / discussions / pulls qualified, release-notes and archive/ flat, root index flat.
  • A non-family segment under a slug (resources/content/neo/concepts/…) is still not corpus data — a control that passes against both guard versions, so the match cannot have quietly widened to the whole root.
  • release-notes and archive/ keep their flat prefixes; this PR moves no path.
  • Post-merge only: when the Brain half of #17920 emits under the new root, the first sync-authoring attempt on a feature branch is rejected rather than passing quietly.

Out of Scope

  • The Brain half — producer emission dirs, parseContentPath, KB sourcePaths — is #17920.
  • Moving release-notes under a repository root (D#17846 §8.8, undecided) and dissolving archive/ into the version segment (§8.3a item 1, its own ticket, unowned).
  • Restoring coverage for the other buildScripts guards — #17922.
  • Why NEO_SYNC_AUTOCOMMIT has no setter in either repository. Captured as a defect-note; it belongs to #17920's pipeline restoration, not here.

Avoided Traps

  • Matching resources/content/<anything>/. It swallows hand-authored trees that merely share the root; the third AC is the control that keeps the match honest.
  • An allowlist of repository slugs. A second organisation repository would then fail open until someone remembered to extend the list — the same silent-open class this ticket closes.
  • Replacing the flat prefixes instead of adding to them. Both shapes are live simultaneously under the ruling; a transitional read breaks archive/ and release-notes.
  • Landing after the producer. The reverse order leaves a review-latency window in which the corpus has moved and the guard is quiet — item 6's stated reason for the ordering.

Related

  • #17920 — the Brain half, and the lane this splits from
  • #17922 — restored this guard's spec; sibling #17791 casualty
  • #17834 — the standing Data Sync alarm that #17920 diagnoses

Live latest-open sweep: checked the latest 20 open neomjs/neo issues at 2026-09-01T21:39Z — no equivalent ticket. A2A claim sweep over the last 12 messages, all read-states, same timestamp: no [lane-claim]/[lane-intent] on this surface. Memory Core rationale sweep: semantic recall is degraded right now (query_raw_memories refused with embedding write canary EMBEDDING_PROBE_TIMEOUT), so it was substituted with the D#17846 §8.3a ruling read at source plus query_recent_turns over this lane's decision thread — stated as a substitution, not as a clean sweep. Own-assignment sweep: #17922 is the same surface and owns spec restoration for 27 guards including this one; it does not cover the path shape. Structure-map gate: N/A — ai:structure-map is Brain-owned and absent from this repository's package.json; no new .mjs placement.

Retrieval Hint: query_raw_memories("check-chore-sync repository-qualified corpus path leakage arm silent open"); anchors D#17846 §8.3a items 5–6, commit 447f050afd.

Origin Session ID: 95546f3b-fc9e-4422-aa36-30db318969b3

Authored by Grace (Anthropic Claude Opus 5, Claude Code).