Repository navigation
refactor(layering): R11 lets test support resolve private siblings through devDependencies - #3659
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
Size Report
Startup median (7 runs, lower is better):
|
|
The code looks good at 0f751ba, and I found nothing that needs a change before merge. CI is still running: Repo Guards and Lint & Format run the layering scripts this PR changes, so wait for both to finish green. I did not run check:layering or the new node tests; I checked the new rule against the old predicate by reading it. I also did not check whether a bundler or knip gate depends on daemon declaring test-kit in dependencies. Not blocking, and you can take or leave these: package-export-surface.ts:275 classifies only the importing file, and relative imports skip the sibling check, so a production file could import a dev-only sibling such as a fixtures file through a relative path without a violation (a grep at this commit found no such import today); one rule in the relative branch of checkPackageInternalSites, that a production source file never imports a file isProductionSourceFile rejects, would close this for test-kit and every dev-only sibling. Also, workspaceDevDependencies at package-boundaries.ts:69 is optional, but its only constructor always sets it, so the fallbacks at package-boundaries.ts:287 and project-references.test.ts:168 never apply; making it required like workspaceDependencies would let you drop them. The Cubic P2 thread on the paths check at project-references.test.ts:174 still stands (#3659 (comment)). The reference union at :168 now includes dev-only siblings, but the paths check at :174 looks only at workspaceDependencies, so a private package with agent-device only in devDependencies would skip it. No package does that today, so this is a small test gap; checking the same union at :174 fixes it. Please reply on that thread once it is done. |
|
Addressed in the new head: the Cubic thread at project-references.test.ts (paths check reads the same union as references) is fixed and resolved, and |
|
This PR is ready at 954dd03. The Not blocking: On the open thread, the Cubic P2 about the I did not run the tests or the gates; I read the tests and the real-tree R11 pass by hand. I did not check whether any bundler or knip gate needs the daemon package to list test-kit under CI is still pending, and no check has failed. Repo Guards, Lint & Format and Typecheck & Package run the layering scripts and tsc that this diff touches, so they matter most. They should finish green on 954dd03 before merge. |
954dd03 to
0960c0a
Compare
|
Taken: the trailing |
|
The code in 75e42e0 looks good, and I found no problems. The earlier review at 954dd03 was also clean. The Cubic I read the head source and searched it. I did not run the layering tests, pnpm install, or the full gate. I know of no conflicts. The remaining checks are still queued and none has failed. Nothing is left in the code. Before merge, Repo Guards, Lint & Format, Typecheck & Package and Integration Tests need to finish green, since this change touches scripts/layering, the daemon manifest and the lockfile. |
… devDependencies R11 now reads a private package's devDependencies as test-only siblings: tests, specs, fixtures files and test trees may import through them, production source still needs dependencies, and the package tsconfig references must name both. The daemon moves test-kit to devDependencies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… dependency fields A private package that declares agent-device only in devDependencies needs the same tsconfig paths mapping, so the project-references test reads one union for references and paths. The dev-only set is required on WorkspacePackage now that its only constructor always sets it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndencies Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
75e42e0 to
fdd9cce
Compare
Stacked on #3645 (R83).
What
R11 reads a private package's
devDependenciesas test-only siblings:*.spec.*,*.fixtures.*file or test tree (anythingisProductionSourceFilerejects) may import a sibling the package declares only indevDependencies.dependencies, ordevDependenciesfor a published package, which bundles its siblings). A production import of a dev-only sibling gets its own message: declare it independenciesor import it from test support only.referencesmust name both fields (project-references.test.tsunions them), so a dev-only sibling still builds in order.@agent-device/daemonmoves@agent-device/test-kitfromdependenciestodevDependencies. 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/proxyflip todevDependencies(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__,.fixturesandtest/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.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-widepnpm format.🤖 Generated with Claude Code