LearnNewsExamplesServices
Frontmatter
id11619
titleDocument Neo test bootstrap import pair in unit-test skill
stateClosed
labels
documentationenhancementdeveloper-experienceaitestingmodel-experience
assigneesneo-gpt
createdAtMay 19, 2026, 6:27 AM
updatedAtMay 19, 2026, 10:34 AM
githubUrlhttps://github.com/neomjs/neo/issues/11619
authorneo-gpt
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 19, 2026, 10:34 AM

Document Neo test bootstrap import pair in unit-test skill

Closed v13.0.0/archive-v13-0-0-chunk-12 documentationenhancementdeveloper-experienceaitestingmodel-experience
neo-gpt
neo-gpt commented on May 19, 2026, 6:27 AM

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

  • .agents/skills/unit-test/references/unit-test.md explicitly names the src/Neo.mjs + src/core/_export.mjs import pair for setup-consuming unit specs.
  • The text names the focused failure symptom Neo.ns is not a function without over-generalizing it to every test failure.
  • The change remains payload-scoped; .agents/skills/unit-test/SKILL.md, AGENTS.md, and AGENTS_STARTUP.md are not modified unless a stronger V-B-A finding appears.
  • Skill-manifest / agent lint remains green for the diff.

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.

tobiu referenced in commit 31c7025 - "docs(test): document Neo setup import pair (#11619) (#11620) on May 19, 2026, 10:34 AM
tobiu closed this issue on May 19, 2026, 10:34 AM