LearnNewsExamplesServices
Frontmatter
id13227
titleFail-build lint: ban DB-path aiConfig mutation in test/** (B4 orphan-bleed ratchet)
stateClosed
labels
enhancementaitestingarchitecture
assigneesneo-opus-grace
createdAtJun 14, 2026, 2:42 PM
updatedAtJun 21, 2026, 2:17 AM
githubUrlhttps://github.com/neomjs/neo/issues/13227
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 14, 2026, 3:36 PM

Fail-build lint: ban DB-path aiConfig mutation in test/** (B4 orphan-bleed ratchet)

Closed v13.1.0/archive-v13-1-0-chunk-2 enhancementaitestingarchitecture
neo-opus-grace
neo-opus-grace commented on Jun 14, 2026, 2:42 PM

Context

ADR-0019 §4 (B4, safety-critical) calls for a fail-build lint flagging aiConfig.<path> = … runtime assignments in tests — the #12335 orphan-bleed class (a test mutating shared config to point at its own DB → live-DB bleed, ~1,281 orphans). The B4 lint is unshipped (#12451 shipped only the A4 inline-process.env guard via PR #12472).

Scoped per the #12435 decomposition: start with Class A (DB-path mutations — the safety-critical subset), grandfather the current offenders, escape-marker for genuine new exceptions. The broad any aiConfig.<path> = lint + Class B (config-varying) are deferred pending the override-mechanism design question (see the decomposition).

The Fix

buildScripts/util/check-aiconfig-test-mutation.mjs — flags (aiConfig | Memory_Config.data).{storagePaths | engines.chroma.database | collections | logPath} = … assignments in test/** (code only — not comments/strings, mirroring check-ticket-archaeology.mjs), with a file-level allowlist of the current Class-A offenders + an aiconfig-mutation-ok: <reason> escape marker. Wired into lint-staged.

Acceptance Criteria

  • Lint flags a NEW DB-path mutation in a non-allowlisted test/** file (exit 1).
  • Allowlisted current offenders + escape-marker + comparisons/reads (== / === / const x = aiConfig.y) do NOT trip it.
  • Wired into lint-staged for test files.
  • Unit test covering detection, comparison/read exclusion, escape marker, and allowlist.

Out of Scope

  • Migrating the current Class-A offenders to by-construction isolation (#12435).
  • Class B config-varying mutations + the broad any aiConfig.<path> = lint (deferred pending the override-mechanism design — see #12435 decomposition).

Related

  • Parent: #12435 (B4 migration). Epic: #12456. Authority: ADR-0019 §4 (learn/agentos/decisions/0019-aiconfig-reactive-provider-ssot.md).

Release classification: post-release (test-infra hygiene; not v13.x-blocking).

Origin Session ID: 0f5d9f1d-0683-452d-aac1-f467297186ac

Authored by Claude Opus 4.8 (Claude Code), @neo-opus-grace (Grace).