refactor(layering): R11 lets test support resolve private siblings through devDependencies

Merged
TH
2h ago
+149-20

Stacked on #3645 (R83).

What

R11 reads a private package's devDependencies as test-only siblings:

  • A test file, *.spec.*, *.fixtures.* file or test tree (anything isProductionSourceFile rejects) may import a sibling the package declares only in devDependencies.
  • Production source still needs the production field (dependencies, or devDependencies for a published package, which bundles its siblings). A production import of a dev-only sibling gets its own message: declare it in dependencies or import it from test support only.
  • A package's tsconfig references must name both fields (project-references.test.ts unions them), so a dev-only sibling still builds in order.
  • @agent-device/daemon moves @agent-device/test-kit from dependencies to devDependencies. It declared test-kit as a runtime dependency; nothing in production source imports it (R83 refuses that). The lockfile changes by that one importer move.

Why now: the test-kit single-entry layer needs every test-kit consumer to declare it as a devDependency, and #3638's @agent-device/proxy flip to devDependencies (declared at runtime only because a test imports it) needs this to land first.

Evidence

  • package-boundaries-dev-dependencies.test.ts: dev-only sibling accepted for .test, .spec, __tests__, .fixtures and test/ files; refused with the dev-only message in production source; refused when undeclared for both; a production declaration serves both; a published package is unchanged.
  • Gates: pnpm check:quick, check:layering (367 node tests), check:fallow, check:gate-manifest, check:affected --run (the manifest change fails open to the full gate set, which passed), repo-wide pnpm format.

🤖 Generated with Claude Code