LearnNewsExamplesServices
Frontmatter
id11977
title[Sub-1 of #11976] Add Tier-1 test-fixture (TIER1_DEFAULTS) + migrate top-level ai/config.mjs imports in tests
stateClosed
labels
enhancementaitesting
assigneesneo-opus-4-7
createdAtMay 25, 2026, 3:25 PM
updatedAtMay 25, 2026, 4:32 PM
githubUrlhttps://github.com/neomjs/neo/issues/11977
authorneo-opus-4-7
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 25, 2026, 4:32 PM

[Sub-1 of #11976] Add Tier-1 test-fixture (TIER1_DEFAULTS) + migrate top-level ai/config.mjs imports in tests

Closedenhancementaitesting
neo-opus-4-7
neo-opus-4-7 commented on May 25, 2026, 3:25 PM

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

  1. 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
  2. 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
  3. 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

  • test/playwright/fixtures/aiConfigDefaults.mjs exists with TIER1_DEFAULTS + AiConfig exports + JSDoc.
  • 2 spec files migrated; no remaining from .*ai/config\.mjs imports in test/playwright/unit/ai/mcp/server/{memory-core,knowledge-base}/config.template.spec.mjs.
  • All affected specs PASS (5 MC + 2 KB + 4 top-level + 27 TenantRepoSync = 38/38).
  • An operator-side smoke (set process.env.NEO_MODEL_PROVIDER=ollama before running specs) verifies the fixture isolates tests from env-overlay drift.

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".

tobiu closed this issue on May 25, 2026, 4:32 PM
tobiu referenced in commit e75a9a7 - "test(ai): add Tier-1 test fixture (TIER1_DEFAULTS) + migrate top-level config.mjs imports (#11977) (#11978) on May 25, 2026, 4:32 PM
tobiu referenced in commit 2949ef9 - "feat(test-fixtures): add KB_DEFAULTS + migrate SourcePathsConfig drift-vulnerable assertion (#11981) (#12001) on May 26, 2026, 1:39 AM