Skip to content

refactor: move daemon-shared contracts out of commands#741

Merged
thymikee merged 1 commit into
mainfrom
codex/move-daemon-contracts
Jun 10, 2026
Merged

refactor: move daemon-shared contracts out of commands#741
thymikee merged 1 commit into
mainfrom
codex/move-daemon-contracts

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Moves daemon/platform-shared contracts and helper logic out of src/commands so production daemon and platform code no longer imports the CLI command layer. Old command module paths remain as thin re-export shims for compatibility.

Hardens the CI layering guard from warn-only to failure, and updates the fallow health baseline key for the moved interaction-targeting module.

Closes #726

Touched files: 51. Scope stayed within the requested daemon/platform command-layer import refactor.

Validation

pnpm check:tooling passed: lint, typecheck, MCP metadata check, and build.

rg -n "from '.commands/" src/daemon src/platforms --glob '!/tests/' --glob '!.test.ts' returned no matches.

pnpm check:fallow --base origin/main passed.

pnpm exec vitest run --project unit --no-file-parallelism --maxWorkers 1 passed: 237 files, 2206 tests.

pnpm test:smoke passed with environment-gated loopback cases skipped.

pnpm test:integration:provider passed: 19 files, 38 passed, 10 skipped.

pnpm format and git diff --check passed.

@thymikee thymikee force-pushed the codex/move-daemon-contracts branch from 36c8358 to 00d640c Compare June 10, 2026 10:51
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.2 MB 1.2 MB -1.2 kB
JS gzip 386.1 kB 385.2 kB -889 B
npm tarball 497.7 kB 497.3 kB -464 B
npm unpacked 1.7 MB 1.7 MB -1.2 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.6 ms 21.2 ms -0.4 ms
CLI --help 33.3 ms 33.3 ms +0.0 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/input-actions.js +9.4 kB +3.6 kB
dist/src/8699.js +9.0 kB +2.3 kB
dist/src/cli.js -46 B -13 B
dist/src/session.js +23 B +12 B
dist/src/interaction.js -31 B -12 B

@thymikee

Copy link
Copy Markdown
Member Author

CI review note: the Layering Guard job is red before it reaches the actual import check because ripgrep is not available on the GitHub runner (line 5: rg: command not found). This guard either needs to use a command available in the bare runner checkout, or run after whatever setup installs repo tooling. The failure does not currently prove remaining src/commands imports; it is a guard environment issue.

@thymikee thymikee force-pushed the codex/move-daemon-contracts branch from e60efa0 to dfedaab Compare June 10, 2026 11:20
@thymikee

Copy link
Copy Markdown
Member Author

Review finding: the moved positional helpers are not layer-neutral yet. src/core/interaction-positionals.ts imports ../client-types.ts and ../daemon/selectors.ts, and src/core/wait-positionals.ts imports ../daemon/handlers/parse-utils.ts plus ../daemon/selectors.ts. Since daemon code now imports these core/*positionals.ts helpers, this leaves a daemon -> core -> daemon/client type dependency behind the clean direct-import guard. It also keeps a type path back toward src/commands through client-types.ts.

Can we move the shared selector splitting / timeout parsing pieces to a lower shared module (or keep these helpers in the CLI layer and give the daemon a daemon-local parser) so src/core/** and daemon-shared helpers do not depend on daemon or public client layers?

@thymikee thymikee force-pushed the codex/move-daemon-contracts branch from dfedaab to 8f00def Compare June 10, 2026 11:55
@thymikee thymikee force-pushed the codex/move-daemon-contracts branch from 8f00def to b284e71 Compare June 10, 2026 12:09
@thymikee thymikee merged commit 963ffc2 into main Jun 10, 2026
20 checks passed
@thymikee thymikee deleted the codex/move-daemon-contracts branch June 10, 2026 12:28
@github-actions

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: extract shared contracts out of src/commands so daemon/platforms stop importing the CLI layer (M2-2)

1 participant