Context
PR #11618 fixed #11617 by adding the established Neo test bootstrap pair to setup-consuming test/playwright/unit/ai/scripts/*.spec.mjs files:
import Neo from '../../../../../src/Neo.mjs';
import * as core from '../../../../../src/core/_export.mjs';
Claude's #11618 review surfaced a non-blocking follow-up: the unit-test skill substrate should explicitly document this import-pair contract so the next setup-consuming spec does not rediscover the same Neo.ns is not a function failure.
Duplicate sweep performed before filing:
ask_knowledge_base(query='ticket for unit-test skill Neo core export imports setup consuming specs Neo.ns', type='ticket') surfaced #11578 and older test/bootstrap tickets, but no open skill-doc follow-up for the unit-test payload.
rg "setup-consuming|Neo\.ns|core/_export|Import Core Augmentation|src/Neo\.mjs" resources/content/issues resources/content/discussions -n found related historical bootstrap/import discussions and #11617/#11578-adjacent context, but no equivalent open ticket.
gh issue list --state open --search "setup Neo.ns core/_export unit-test skill" --json number,title,labels,assignees,url --limit 20 returned only #11617, which is the code-fix ticket already represented by PR #11618.
The Problem
The current unit-test payload partially encodes the rule:
.agents/skills/unit-test/references/unit-test.md:53 says every test file must import src/core/_export.mjs.
That is directionally correct, but the actual focused-spec fix required the explicit src/Neo.mjs + src/core/_export.mjs pair. The omission matters because test/playwright/setup.mjs can reference Neo.ns; a setup-consuming spec that lacks the bootstrap pair can pass under worker-order side effects but fail standalone with:
TypeError: Neo.ns is not a function
The Architectural Reality
This is skill-loaded substrate, not always-loaded AGENTS substrate. The owning location is the unit-test payload because the rule applies when writing or repairing Playwright unit specs, especially right-hemisphere test/playwright/unit/ai/** specs that import the shared setup() helper.
create-skill was consulted before filing. The fix should follow Progressive Disclosure: update the payload, not the lightweight SKILL.md router, and avoid adding broad always-loaded rules.
The Fix
Update .agents/skills/unit-test/references/unit-test.md to make the bootstrap contract explicit:
- Setup-consuming test files must import both
src/Neo.mjs and src/core/_export.mjs before calling or depending on test/playwright/setup.mjs behavior.
- Explain the concrete failure mode: missing bootstrap pair can surface as
Neo.ns is not a function in focused runs.
- Keep the addition short and local to the existing Critical Rules / Import Core Augmentation section.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
.agents/skills/unit-test/references/unit-test.md Critical Rules |
#11617 / PR #11618 empirical fix, existing import-pair patterns in AI unit specs |
State the required src/Neo.mjs + src/core/_export.mjs pair for setup-consuming specs |
If a test does not use setup or Neo globals, existing local patterns still govern |
This ticket updates the unit-test skill payload only |
rg confirms current payload names only core/_export; PR #11618 proves the pair fixes focused failures |
Acceptance Criteria
Out of Scope
- No further code changes to
test/playwright/unit/ai/scripts/*.spec.mjs; PR #11618 already handles the current files.
- No new skill, no router expansion, and no AGENTS.md always-loaded rule.
- No broader cleanup of all historical unit-test docs unless the existing payload directly contradicts this rule.
Avoided Traps
- Do not add this to
AGENTS.md: the load-frequency is too narrow for always-loaded substrate.
- Do not create a new skill:
unit-test already owns this domain.
- Do not frame
setup() as globally importing Neo; the lesson is that setup consumers must carry their own bootstrap imports.
Related
- #11617 — focused-code fix for standalone
ai/scripts specs failing Neo.ns setup mock.
- PR #11618 — implementation that proved the import-pair fix.
- #11578 — provenance for the setup mock that exposed the standalone dependency.
Origin Session ID: b61cfc87-e697-4395-a9d5-831f03fd8994
Handoff Retrieval Hints: search Memory Core for #11618 approved ai/scripts setup Neo.ns, #11617 standalone ai/scripts setup core augmentation, or unit-test skill import pair Neo core/_export.
Context
PR #11618 fixed #11617 by adding the established Neo test bootstrap pair to setup-consuming
test/playwright/unit/ai/scripts/*.spec.mjsfiles:import Neo from '../../../../../src/Neo.mjs'; import * as core from '../../../../../src/core/_export.mjs';Claude's #11618 review surfaced a non-blocking follow-up: the
unit-testskill substrate should explicitly document this import-pair contract so the next setup-consuming spec does not rediscover the sameNeo.ns is not a functionfailure.Duplicate sweep performed before filing:
ask_knowledge_base(query='ticket for unit-test skill Neo core export imports setup consuming specs Neo.ns', type='ticket')surfaced #11578 and older test/bootstrap tickets, but no open skill-doc follow-up for the unit-test payload.rg "setup-consuming|Neo\.ns|core/_export|Import Core Augmentation|src/Neo\.mjs" resources/content/issues resources/content/discussions -nfound related historical bootstrap/import discussions and #11617/#11578-adjacent context, but no equivalent open ticket.gh issue list --state open --search "setup Neo.ns core/_export unit-test skill" --json number,title,labels,assignees,url --limit 20returned only #11617, which is the code-fix ticket already represented by PR #11618.The Problem
The current
unit-testpayload partially encodes the rule:.agents/skills/unit-test/references/unit-test.md:53says every test file must importsrc/core/_export.mjs.That is directionally correct, but the actual focused-spec fix required the explicit
src/Neo.mjs+src/core/_export.mjspair. The omission matters becausetest/playwright/setup.mjscan referenceNeo.ns; a setup-consuming spec that lacks the bootstrap pair can pass under worker-order side effects but fail standalone with:The Architectural Reality
This is skill-loaded substrate, not always-loaded AGENTS substrate. The owning location is the
unit-testpayload because the rule applies when writing or repairing Playwright unit specs, especially right-hemispheretest/playwright/unit/ai/**specs that import the sharedsetup()helper.create-skillwas consulted before filing. The fix should follow Progressive Disclosure: update the payload, not the lightweightSKILL.mdrouter, and avoid adding broad always-loaded rules.The Fix
Update
.agents/skills/unit-test/references/unit-test.mdto make the bootstrap contract explicit:src/Neo.mjsandsrc/core/_export.mjsbefore calling or depending ontest/playwright/setup.mjsbehavior.Neo.ns is not a functionin focused runs.Contract Ledger Matrix
.agents/skills/unit-test/references/unit-test.mdCritical Rulessrc/Neo.mjs+src/core/_export.mjspair for setup-consuming specsrgconfirms current payload names onlycore/_export; PR #11618 proves the pair fixes focused failuresAcceptance Criteria
.agents/skills/unit-test/references/unit-test.mdexplicitly names thesrc/Neo.mjs+src/core/_export.mjsimport pair for setup-consuming unit specs.Neo.ns is not a functionwithout over-generalizing it to every test failure..agents/skills/unit-test/SKILL.md,AGENTS.md, andAGENTS_STARTUP.mdare not modified unless a stronger V-B-A finding appears.Out of Scope
test/playwright/unit/ai/scripts/*.spec.mjs; PR #11618 already handles the current files.Avoided Traps
AGENTS.md: the load-frequency is too narrow for always-loaded substrate.unit-testalready owns this domain.setup()as globally importing Neo; the lesson is that setup consumers must carry their own bootstrap imports.Related
ai/scriptsspecs failingNeo.nssetup mock.Origin Session ID: b61cfc87-e697-4395-a9d5-831f03fd8994
Handoff Retrieval Hints: search Memory Core for
#11618 approved ai/scripts setup Neo.ns,#11617 standalone ai/scripts setup core augmentation, orunit-test skill import pair Neo core/_export.