Skip to content

refactor(command-registry): move the wait-positionals test into the package - #3656

Merged
thymikee merged 2 commits into
mainfrom
refactor/move-wait-positionals-test
Oct 15, 2026
Merged

thymikee merged 2 commits into
mainfrom
refactor/move-wait-positionals-test

Conversation

@thymikee

@thymikee thymikee commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

What

src/__tests__/wait-positionals.test.ts tests parseWaitPositionals / resolveWaitBudgetMs from @agent-device/command-registry/wait-positionals and nothing in root src. That is procedure case 2 (a package's test living at root), so it moves beside the module it tests: packages/command-registry/src/wait-positionals.test.ts.

  • Commit 1: pure git mv (100% similarity).
  • Commit 2: the parser import becomes ./wait-positionals.ts; command-registry declares fast-check in devDependencies (the test uses it; the lockfile importer entry is added, pnpm install --frozen-lockfile passes).

The test still imports PROPERTY_RUNS from @agent-device/selectors/snapshot-geometry-fixtures (selectors is already a command-registry dependency). That specifier is changed when the fixture moves to test-kit.

Fixture decisions (root importers of the fixtures I own)

I classified every root src/test/scripts importer of the four fixture exports. This is the only one that tests package code. The others test root src/commands/**, src/platform-runtime*, the CLI or integration harnesses (root worker), or src/__tests__/daemon-composition/** (daemon thread), so they only get import-specifier edits when their fixture moves. src/__tests__/kernel/snapshot-ref-grammar.test.ts tests the kernel package and belongs to whoever owns kernel.

Parity

vitest run <file> --reporter=json: before 17 / 17 at src/__tests__/wait-positionals.test.ts; after 17 / 17 at packages/command-registry/src/wait-positionals.test.ts. Selected by unit-core (packages/*/src/**/*.test.ts) and ran under check:affected --run. No vi.mock.

Surface

exports count command-registry 21 -> 21. No new subpaths, barrels or export *. One new devDependency (fast-check, already used by the repo).

Gates

check:quick, check:layering, check:fallow, check:gate-manifest, pnpm format pass. pnpm check:affected --run fails open to the full set (a package manifest changed) and passes except one test unrelated to this diff: scripts/__tests__/eager-closure-budgets.test.ts > no APPROVED_OVER_CEILING row is stale reports packages/daemon/src/index.ts (the row added with the daemon single-entry change #3633). Nothing in this branch touches daemon or that table.

Pointer for the daemon thread: the comment at packages/daemon/src/sessions/handlers/__tests__/snapshot.test.ts:113 names src/__tests__/wait-positionals.test.ts; it should now read packages/command-registry/src/wait-positionals.test.ts. I left it alone because I only edit specifiers in daemon files.

🤖 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 3 files

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

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 517ef43. The test move into the command-registry package looks right, and it adds only a devDependency, so it touches no production route. Not blocking: the comment at https://github.com/callstack/agent-device/blob/517ef43/packages/daemon/src/sessions/handlers/__tests__/snapshot.test.ts#L113 still points to src/tests/wait-positionals.test.ts as the root-owned home of the #1800 rejection coverage, but this PR deletes that path. You could point it to packages/command-registry/src/wait-positionals.test.ts, or leave it. CI is still pending, with all checks queued and no failures yet. There are no conflicts. I did not run the moved test. I also did not check the other vitest project excludes in full, or whether the moved file's selectors imports resolve inside the package (the lockfile lists selectors as a dependency). The next step before merge is for CI to finish green.

@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
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstack.github.io/agent-device/pr-preview/pr-3656/

Built to branch gh-pages at 2026-10-15 13:30 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.25 MB 5.25 MB 0 B
Package (unpacked) 5.25 MB 5.25 MB 0 B
Package (download) 1.58 MB 1.58 MB +11 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 23.9 ms 23.0 ms -0.9 ms
CLI --help 64.1 ms 63.8 ms -0.3 ms

thymikee and others added 2 commits October 15, 2026 14:47
…ackage

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the test's fast-check dependency

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the refactor/move-wait-positionals-test branch from 517ef43 to 742a64a Compare October 15, 2026 12:47
@thymikee
thymikee merged commit 5356733 into main Oct 15, 2026
23 checks passed
@thymikee
thymikee deleted the refactor/move-wait-positionals-test branch October 15, 2026 13:37
@thymikee

Copy link
Copy Markdown
Member Author

The PR is ready at 742a64a. The earlier clean review of 517ef43 still holds, and the test now sits at packages/command-registry/src/wait-positionals.test.ts.

Not blocking: the comment at https://github.com/callstack/agent-device/blob/742a64a/packages/daemon/src/sessions/handlers/__tests__/snapshot.test.ts#L113 still points to src/__tests__/wait-positionals.test.ts as the "root-owned coverage". That path no longer exists, so it could name the new file beside the parser in the command-registry package. You can take or leave this.

I did not run the moved test or the CI gates, and I did not check that pnpm-lock.yaml matches package.json under --frozen-lockfile. Checks are still queued or running and none has failed. There are no conflicts. Merge once the queued checks go green.

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