Skip to content

refactor(daemon-contracts): drop the registration and claims fixture exports - #3689

Merged
thymikee merged 5 commits into
refactor/test-kit-drop-daemon-contractsfrom
refactor/daemon-contracts-fixtures
Oct 16, 2026
Merged

thymikee merged 5 commits into
refactor/test-kit-drop-daemon-contractsfrom
refactor/daemon-contracts-fixtures

Conversation

@thymikee

@thymikee thymikee commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

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

  1. git mv of the reconciler test into packages/daemon-contracts/src/device-claim-reconciliation.test.ts (pure, 100%).
  2. test-kit gains publishDaemonRegistration and deviceClaimFilePath; daemon and root importers switch to @agent-device/test-kit (specifiers, plus the resolveDeviceClaimPath → deviceClaimFilePath identifier 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).
  3. chore(gates): delete daemon-registration.fixtures.ts, device-claims.fixtures.ts and their two exports.
  4. Delete tmp-dir.fixtures.ts; six daemon-contracts tests import mkdtempForTestSync from 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

View guided diff Turn on auto-fix

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 28 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-16 06:04 UTC

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at ff09203. I found no problems in the diff.

Not blocking: deviceClaimFilePath in packages/test-kit/src/device-claim-fixtures.ts copies the path logic of resolveDeviceClaimRoot and resolveDeviceClaimPath in daemon-contracts. That looks deliberate, since it gives tests an independent check of the on-disk layout and keeps test-kit free of the daemon-contracts import that #3686 removed. If you want drift to fail in one place, a daemon-contracts test could assert that deviceClaimFilePath(k) equals resolveDeviceClaimPath(k). You can take this or leave it.

CI is still running on this head: 14 of 18 checks are queued or in progress, and none have failed. I did not run the typecheck, layering, fallow or unit gates myself. The 194/194 parity numbers come from the PR body and I did not reproduce them. This PR is stacked on #3686, and I only checked that test-kit has no daemon-contracts dependency at this head. I did not review #3686's own diff. No conflicts. Before merge, CI needs to finish green on this head and #3686 needs to land, after which GitHub will retarget this PR to main.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 15, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.24 MB 5.24 MB 0 B
Package (unpacked) 5.24 MB 5.24 MB 0 B
Package (download) 1.57 MB 1.57 MB +13 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 29.4 ms 29.7 ms +0.3 ms
CLI --help 82.4 ms 82.0 ms -0.4 ms

@thymikee
thymikee added this pull request to stack #3692 October 15, 2026 18:40
thymikee and others added 4 commits October 15, 2026 20:57
… module

Pure git mv; the test imports createDeviceClaimReconciler and only daemon-contracts' own code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e fixtures

Adds publishDaemonRegistration and deviceClaimFilePath as named exports and points the daemon and
root importers at them. deviceClaimFilePath restates the sha256 on-disk layout instead of
re-exporting the production resolver. daemon-contracts declares test-kit as a devDependency; the
claim reconciler test uses it from beside its module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re exports

daemon-registration.test.ts publishes through test-kit; device-claims.fixtures only re-exported
production functions, now reached through their modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… of a local copy

Removes the package's tmp-dir.fixtures.ts duplicate now that test-kit no longer depends on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the refactor/daemon-contracts-fixtures branch from ff09203 to 4e4294b Compare October 15, 2026 18:57
…ion resolver

deviceClaimFilePath restates the on-disk layout on purpose; this fails the moment the two copies
drift, including the AGENT_DEVICE_CLAIMS_DIR override.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Took the drift-test suggestion: packages/daemon-contracts/src/device-claim-paths.test.ts (named for device-claim-paths.ts) asserts deviceClaimFilePath(k) equals resolveDeviceClaimPath(k), with and without AGENT_DEVICE_CLAIMS_DIR set. Mutation check: switching test-kit's hash from sha256 to sha1 fails both cases; reverted. 2/2 pass, plus the earlier 194/194 parity set.

On the new head check:quick, check:layering, check:fallow, check:gate-manifest and pnpm format are clean. Two full check:affected --run passes failed only with 5s/30s timeouts in unrelated suites (iOS lifecycle, fuzz harness, adb host, claim-recovery composition) while the host load average was ~76; a different set failed each time, and every one passes in isolation (38/38 across those five files). CI is the authority on this head.

@thymikee

Copy link
Copy Markdown
Member Author

The code looks good at 701802c. This follows my earlier review at ff09203, and nothing from that review is left open.

All 23 checks pass. I did not run the drift test or the sha1 mutation locally, so I relied on your report and on green CI. I also did not run the layering scan locally, so I relied on CI and a grep.

There are no conflicts. #3689 is stacked on #3686, so it can merge once that base lands.

@thymikee
thymikee merged commit 5dce22a into main Oct 16, 2026
26 of 27 checks passed
@thymikee
thymikee deleted the refactor/daemon-contracts-fixtures branch October 16, 2026 06:03
thymikee added a commit that referenced this pull request Oct 16, 2026
…ctions-1

* origin/main:
  feat(react-devtools): inspect React components and profile renders through the Metro inspector (#3613)
  refactor(daemon-contracts): drop the registration and claims fixture exports (#3689)
  refactor(test-kit): drop the daemon-contracts dependency (#3686)
  refactor(test-kit): drop command-registry by making the replay-script generator a root fixture (#3687)
  fix(ios): handle delayed launch confirmations without stopping XCTest (#3682)
  refactor(test-kit): move the dispatch-disclosure harness out of contracts (#3690)
  refactor(test-kit): host the target classification capture fixture (#3691)
  ci: fold six CI jobs into four with parallel and background steps; cancel superseded and closed-PR runs (#3658)
  build(typescript): move root project references into tsconfig.typecheck.json (#3688)
  chore(daemon): declare @agent-device/proxy as a devDependency, since only a test imports it (#3685)
  refactor(settings): declare settings once and admit them per setting (#3662)

# Conflicts:
#	packages/platform-android/src/alert.ts
#	website/docs/docs/limrun.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant