From 18aa6846eeaf2c44aefd9b9d611dca8c87264597 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Fri, 1 May 2026 17:14:23 -0400 Subject: [PATCH] design: align daemon cleanup test file list The implementation keeps the existing daemon-spawner path regression while adding pid-file serialization coverage, and adds a small daemon-pty-adapter assertion for the exposed protocolVersion field. Update the design checklist and files list before landing the code so the handoff matches the actual test scope. --- docs/auto-kill-old-daemons.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/auto-kill-old-daemons.md b/docs/auto-kill-old-daemons.md index 444036235..6932e819e 100644 --- a/docs/auto-kill-old-daemons.md +++ b/docs/auto-kill-old-daemons.md @@ -411,7 +411,7 @@ Drain hook behaviors: - `createLegacyDaemonAdapters` never calls `cleanupDaemonForProtocol(runtimeDir, PROTOCOL_VERSION)`. Loop bound is `PREVIOUS_DAEMON_PROTOCOL_VERSIONS` (compile-time). Add a runtime assertion test: spy on `cleanupDaemonForProtocol`, run the full startup path, assert no call was made with the current version. - `types.ts` invariant — `PREVIOUS_DAEMON_PROTOCOL_VERSIONS` must not contain `PROTOCOL_VERSION`. Add a trivial test asserting this. Catches the "forgot to remove v4 when shipping v5" mistake. -- `daemon-spawner.test.ts` unchanged — socket path scheme is untouched. +- `daemon-spawner.test.ts` keeps the socket-path regression and adds a pid-file serialization assertion. - `daemon-server.test.ts` unchanged — wire protocol is untouched. - `daemon-entry.ts` unchanged — no new signal handlers, no timer, no idle-exit logic. @@ -469,7 +469,9 @@ Before merge, confirm each of the following has not changed behaviorally: - `src/main/daemon/daemon-spawner.ts` — write `{ pid, startedAtMs }` pid-file JSON for newly spawned daemons. - `src/main/daemon/daemon-init.test.ts` — new file with `processLegacyVersion` and `createLegacyDaemonAdapters` unit tests. - `src/main/daemon/daemon-pty-router.test.ts` — new file with drain-hook tests. +- `src/main/daemon/daemon-pty-adapter.test.ts` — add coverage for the exposed `protocolVersion` field. - `src/main/daemon/daemon-health.test.ts` — add pid-file compatibility and SIGKILL revalidation tests. +- `src/main/daemon/daemon-spawner.test.ts` — add pid-file serialization coverage. - `src/main/daemon/types.test.ts` — trivial invariant tests on `PROTOCOL_VERSION` / `PREVIOUS_DAEMON_PROTOCOL_VERSIONS`. Explicitly **not** touched: `daemon-entry.ts`, `daemon-server.ts`, `daemon-main.ts`, `terminal-host.ts`, `session.ts`, `client.ts`, `pty-subprocess.ts`, `history-manager.ts`.