refactor(daemon-contracts): drop the registration and claims fixture exports
Stacked on #3686 (test-kit stops depending on daemon-contracts, which this PR needs: daemon-contracts now declares test-kit as a devDependency, and test-kit → daemon-contracts would be a project-reference cycle). Base is #3686's branch; GitHub retargets to main when it merges. Review only the last four commits.
What
Removes daemon-contracts/daemon-registration-fixtures and daemon-contracts/device-claims-fixtures (daemon-contracts exports 17 → 15), moves the one test of daemon-contracts' own code out of daemon, and replaces the package's duplicated tmp-dir.fixtures.ts with test-kit's.
Fixture decisions
| Fixture | Importers by package | Outcome | Reason |
|---|---|---|---|
publishDaemonRegistration | daemon-contracts 1 (own test), daemon 5, root 1 (cli-device-status.test.ts) | test-kit named export | Shared across packages; daemon-contracts' own test now uses the same one, so the roughly 15-line duplicate the coordinator accepted is not needed. |
resolveDeviceClaimPath | daemon 7 (6 tests and session-idle-expiry-harness) | test-kit deviceClaimFilePath | Shared across daemon tests; restates the sha256 layout and AGENT_DEVICE_CLAIMS_DIR override so tests pin the on-disk contract instead of re-importing the production resolver. daemon-contracts' own tests never used it. |
createDeviceClaimReconciler | 1 daemon test | Case 2, moved into daemon-contracts | The test exercises only device-claim-reconciliation.ts. The coordinator chose to rewrite it through device-claim-recovery because daemon-contracts could not import test-kit; with #3686 it can, so the test moves as a pure git mv instead (named for its module) and keeps testing the unit directly. |
Commits
git mvof the reconciler test intopackages/daemon-contracts/src/device-claim-reconciliation.test.ts(pure, 100%).- test-kit gains
publishDaemonRegistrationanddeviceClaimFilePath; daemon and root importers switch to@agent-device/test-kit(specifiers, plus theresolveDeviceClaimPath→deviceClaimFilePathidentifier at its call sites); the moved test's two specifiers change (./device-claim-reconciliation.ts,./device-claims.ts); daemon-contracts declares test-kit (devDependencies+ tsconfig reference + lockfile). chore(gates): deletedaemon-registration.fixtures.ts,device-claims.fixtures.tsand their two exports.- Delete
tmp-dir.fixtures.ts; six daemon-contracts tests importmkdtempForTestSyncfrom test-kit.
Test-count parity (vitest run … --reporter=json)
All files this diff touches, plus every daemon-contracts test: 194 passed / 0 failed on origin/main (23 files, with the reconciler test at its daemon path), 194 / 0 here (same files, reconciler test at its new path; plus daemon-registration-owner.test.ts's 47, covered by #3686). Reconciler test alone: 2 / 0 before and after.
Selection: packages/daemon-contracts/src/device-claim-reconciliation.test.ts is under packages/*/src/**/*.test.ts (unit-core), collected by path; check:affected --run includes it. vi.mock: the moved test uses vi.fn only; none of the touched files adds one.
Surface
daemon-contracts exports 17 → 15; no new subpath on any package. test-kit adds two named exports from its one entry (sorted position). No barrels or export *. daemon-contracts: devDependencies and tsconfig references both declare test-kit.
Gates (on ff0920312, rebased on main after #3684)
check:quick, check:layering, check:fallow, check:gate-manifest, pnpm format, check:affected --run (exit 0; 1828 files, 15474 tests): all clean.
🤖 Generated with Claude Code