Skip to content

refactor(daemon): relocate the daemon client out of src/daemon #2342

Description

@thymikee

Part of #2335.

Purpose

src/daemon/client/ (9 files, 2,416 lines; zone daemon-client, rank 5) is the daemon's client, not the daemon. No daemon file imports it; its consumers are src/cli.ts, src/agent-device-client.ts, src/cli/commands/proxy.ts, src/commands/management/output.ts (via B) and src/cli/injected-daemon-dispatch.ts (type). Relocating it makes src/daemon server-only. This issue is a relocation; it does not promise a package.

Remaining server and root seams (inventory to carry into the PR)

  • src/daemon/config.ts (113, pure over host-kit/kernel), src/daemon/daemon-process.ts (122, host-kit), src/daemon/request-progress-protocol.ts (48, imports the request types C splits).
  • src/daemon/code-signature*.ts — moved by E.
  • src/daemon/session-store.tsfindUnrecoveredRepairCommitFailure from daemon-client-lifecycle.ts:17: a disk reader of session artifacts, to be extracted below both client and store.
  • src/core/lease-scope.ts (258, kernel-only) from the RPC layer.
  • src/remote/daemon-artifacts.ts (imports daemon types and recording/output-path.ts) and src/remote/remote-request-diagnostics.ts (imports session-store.ts).
  • src/command-catalog.ts, core/command-descriptor/registry.ts, timeout-policy.ts — A's package.
  • src/daemon/types.ts wire types — C's request module.
  • src/daemon/client/doctor-progress.ts — deleted by B.

Required behavior

  • Move the directory to src/daemon-client/ (zone name unchanged; targetDagZone in scripts/layering/model.ts updated from the src/daemon/client/ prefix). Rank stays 5.
  • The client's imports of src/daemon/* are reduced to the named shared kernel: config.ts, daemon-process.ts, request-progress-protocol.ts, the extracted session-artifact reader, and C's request module.
  • No behavior change in daemon launch, takeover, progress streaming or code-signature checks; test/integration/smoke-cli and the daemon lifecycle tests pass unchanged.

Completion conditions

  • src/daemon/client/ no longer exists; src/daemon contains only server code plus the shared kernel modules listed above.
  • The PR lists every remaining src/daemon and src/remote import from the relocated client, each with its seam named; the list is the input to any later packaging decision.
  • check:layering green (R5, R6 type-inversion ratchet, DAEMON_MODULARITY_BASELINE), eager-closure budgets green for src/cli.ts.

Dependencies

Blocked by A, B, C, E.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions