Sub-1 of #11976 — first slice of the test-config-drift migration. Validates the fixture-file pattern before the larger per-server subs.
Scope
Two existing imports of top-level ai/config.mjs in tests (both added by my own #11969 in the same session as the umbrella):
test/playwright/unit/ai/mcp/server/knowledge-base/config.template.spec.mjs:3
test/playwright/unit/ai/mcp/server/memory-core/config.template.spec.mjs:4
Both spots use the import in assertion-style (comparing per-server template fields to Tier-1 defaults) — the drift-vulnerable pattern.
The Fix
Create test/playwright/fixtures/aiConfigDefaults.mjs:
- Imports
AiConfig from ai/config.template.mjs
- Exports
TIER1_DEFAULTS = Object.freeze({...AiConfig.data}) — frozen snapshot for assertions
- Re-exports
AiConfig for mutation-style callers (same singleton, idempotent class registration from #11969)
- JSDoc explains the determinism rationale + the second-order overlay-chain concern
Migrate the 2 spec files:
- Replace
import AiConfig from '.../ai/config.mjs' with import {TIER1_DEFAULTS} from '.../test/playwright/fixtures/aiConfigDefaults.mjs'
- Update assertions to use
TIER1_DEFAULTS.X instead of AiConfig.X
Verify:
- 5/5 MC config-template tests still pass
- 2/2 KB config-template tests still pass
- Combined parallel run (
MC + KB + ai/config.template.spec.mjs + TenantRepoSyncService.spec.mjs) still passes 38/38 (the worker-collision scenario from #11969)
Acceptance Criteria
Out of Scope
- Per-server fixture files for MC/KB/GW/NL — those are Subs 2/3/4/5.
- The 46 memory-core imports — Sub-5 (largest, ships last).
Related
- Parent umbrella: #11976
- Sibling subs (not yet filed; per umbrella decomposition): KB (Sub-2), GW (Sub-3), NL (Sub-4), MC (Sub-5)
Handoff Retrieval Hint: "Sub-1 11976 test-fixture aiConfigDefaults TIER1_DEFAULTS top-level migration validation".
Sub-1 of #11976 — first slice of the test-config-drift migration. Validates the fixture-file pattern before the larger per-server subs.
Scope
Two existing imports of top-level
ai/config.mjsin tests (both added by my own #11969 in the same session as the umbrella):Both spots use the import in assertion-style (comparing per-server template fields to Tier-1 defaults) — the drift-vulnerable pattern.
The Fix
Create
test/playwright/fixtures/aiConfigDefaults.mjs:AiConfigfromai/config.template.mjsTIER1_DEFAULTS=Object.freeze({...AiConfig.data})— frozen snapshot for assertionsAiConfigfor mutation-style callers (same singleton, idempotent class registration from #11969)Migrate the 2 spec files:
import AiConfig from '.../ai/config.mjs'withimport {TIER1_DEFAULTS} from '.../test/playwright/fixtures/aiConfigDefaults.mjs'TIER1_DEFAULTS.Xinstead ofAiConfig.XVerify:
MC + KB + ai/config.template.spec.mjs + TenantRepoSyncService.spec.mjs) still passes 38/38 (the worker-collision scenario from #11969)Acceptance Criteria
test/playwright/fixtures/aiConfigDefaults.mjsexists withTIER1_DEFAULTS+AiConfigexports + JSDoc.from .*ai/config\.mjsimports intest/playwright/unit/ai/mcp/server/{memory-core,knowledge-base}/config.template.spec.mjs.process.env.NEO_MODEL_PROVIDER=ollamabefore running specs) verifies the fixture isolates tests from env-overlay drift.Out of Scope
Related
Handoff Retrieval Hint: "Sub-1 11976 test-fixture aiConfigDefaults TIER1_DEFAULTS top-level migration validation".