You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
daemon-lifecycle e2e: the it.fails status test passes for the wrong reason #422
e2e/daemon-lifecycle.test.ts:52-58: the comment says daemon status always writes raw JSON, whether or not --json is given. But src/cli/index.ts:1662-1663 prints formatStatus(...) when --json is absent. The it.fails test "daemon status prints a human-oriented view by default" passes for the wrong reason: it looks for "Daemon running", and the output is "Daemon: ()". The gap seems fixed, so the test should become a normal passing test on the real output, and the comment should be removed.
Folding in #429: the human view of daemon status (formatStatus, printed at src/cli/index.ts:1668 when --json is absent) has no test that pins it — deleting it leaves the suite green. The corrected test this issue calls for (assert the real first line, Daemon: running (worker), instead of the it.fails on "Daemon running") also catches that deletion, so the fix here should be written to fail when the human view is removed.
Confirmed — a Gap: the code prints the human view correctly; the test and its comment are wrong, and nothing pins the human view of daemon status. Reproduction on bug/422-repro (fa168178); the proposed fix is written there.
Reproduction
bug/422-repro from current origin/main, two test files:
src/expected-failures.test.ts (unit) — "the tracked test files hold no test written to pass by failing". Fails on main naming the offender: e2e/daemon-lifecycle.test.ts:58: it.fails("daemon status prints a human-oriented view by default"…). Green on the branch.
e2e/daemon-lifecycle.test.ts (fast lane) — the it.fails becomes a normal test asserting the real first line: expect(statusHuman.stdout.split("\n")[0]).toBe("Daemon: running (worker)"). Passes on main's code.
Command: pnpm test:e2e e2e/daemon-lifecycle.test.ts / pnpm exec vitest run --project unit src/expected-failures.test.ts
With the human view removed from the daemon status branch (src/cli/index.ts:1296 → writeResult only): the old it.failsstays green (3 passed | 1 expected fail); the corrected test fails on a named assertion (expected '{"devices":…' to be 'Daemon: running (worker)').
Root cause
e2e/daemon-lifecycle.test.ts:52-58: the comment's premise is false — runDaemon's status branch prints formatStatus(...) when --json is absent (src/cli/index.ts:1296), so the body's "Daemon running" can never appear and the it.fails passes whether or not the human view exists. No cheaper test reaches this either: on the same mutation src/cli/index.test.ts stays green (273 passed) — its ["daemon", "status"] test (line 1325) never asserts stdout, and the Daemon: … pins run status, not daemon status.
Simplest fix
Apply what the repro branch shows: drop the comment, make the test a normal it asserting the exact first line. One mutation note: also extend src/cli/index.test.ts:1325 (the connectExistingAdmin fake is already wired there) to assert stdout opens with Daemon: running (worker) — that kills the same mutation at unit cost (rule 7); the e2e test then pins the wire together with real processes.
Alternatives rejected
Only a unit test — leaves the wrong-reason it.fails, which the meta-test flags.
A comment-lint/oxlint rule for it.fails — the shape is a call, not a comment; the unit meta-test already covers every tracked test file.
Risk
The e2e assertion pins the first line only; a Console line may follow when the console is enabled — check a change there does not silently widen the assertion.
The meta-test scans git ls-files: confirm it sees src/, e2e/ and ui/ (its own first test pins this).
it.fails elsewhere (none today) will now fail CI — intended.
Handoff
Done: claim, reproduction on bug/422-repro (rebased from current main over the 2026-10-08 attempt), mutation evidence both ways, this report. Not done: the fix (report only, per this skill). Findings: the unit layer cannot see daemon status's human view at all (above); #429's fold-in verified. Blocked on: the maintainer's bug:ready.
Activity
V3RON commentedon Oct 9, 2026
Folding in #429: the human view of
daemon status(formatStatus, printed atsrc/cli/index.ts:1668when--jsonis absent) has no test that pins it — deleting it leaves the suite green. The corrected test this issue calls for (assert the real first line,Daemon: running (worker), instead of theit.failson "Daemon running") also catches that deletion, so the fix here should be written to fail when the human view is removed.Written by an agent.
test: reproduce #422 — the it.fails status test passes for the wrong …
V3RON commentedon Oct 16, 2026
Confirmed — a Gap: the code prints the human view correctly; the test and its comment are wrong, and nothing pins the human view of
daemon status. Reproduction onbug/422-repro(fa168178); the proposed fix is written there.Reproduction
bug/422-reprofrom currentorigin/main, two test files:src/expected-failures.test.ts(unit) — "the tracked test files hold no test written to pass by failing". Fails on main naming the offender:e2e/daemon-lifecycle.test.ts:58: it.fails("daemon status prints a human-oriented view by default"…). Green on the branch.e2e/daemon-lifecycle.test.ts(fast lane) — theit.failsbecomes a normal test asserting the real first line:expect(statusHuman.stdout.split("\n")[0]).toBe("Daemon: running (worker)"). Passes on main's code.Command:
pnpm test:e2e e2e/daemon-lifecycle.test.ts/pnpm exec vitest run --project unit src/expected-failures.test.tsWith the human view removed from the
daemon statusbranch (src/cli/index.ts:1296→writeResultonly): the oldit.failsstays green (3 passed | 1 expected fail); the corrected test fails on a named assertion (expected '{"devices":…' to be 'Daemon: running (worker)').Root cause
e2e/daemon-lifecycle.test.ts:52-58: the comment's premise is false —runDaemon'sstatusbranch printsformatStatus(...)when--jsonis absent (src/cli/index.ts:1296), so the body's"Daemon running"can never appear and theit.failspasses whether or not the human view exists. No cheaper test reaches this either: on the same mutationsrc/cli/index.test.tsstays green (273 passed) — its["daemon", "status"]test (line 1325) never asserts stdout, and theDaemon: …pins runstatus, notdaemon status.Simplest fix
Apply what the repro branch shows: drop the comment, make the test a normal
itasserting the exact first line. One mutation note: also extendsrc/cli/index.test.ts:1325(theconnectExistingAdminfake is already wired there) to assert stdout opens withDaemon: running (worker)— that kills the same mutation at unit cost (rule 7); the e2e test then pins the wire together with real processes.Alternatives rejected
it.fails, which the meta-test flags.daemon statusleaves the whole suite green #429 fold-in requires pinning.it.fails— the shape is a call, not a comment; the unit meta-test already covers every tracked test file.Risk
git ls-files: confirm it seessrc/,e2e/andui/(its own first test pins this).it.failselsewhere (none today) will now fail CI — intended.Handoff
Done: claim, reproduction on
bug/422-repro(rebased from current main over the 2026-10-08 attempt), mutation evidence both ways, this report.Not done: the fix (report only, per this skill).
Findings: the unit layer cannot see
daemon status's human view at all (above); #429's fold-in verified.Blocked on: the maintainer's
bug:ready.Written by an agent.
test: reproduce #422 — the it.fails status test passes for the wrong …
test: reproduce #422 — the it.fails status test passes for the wrong …
test: daemon status prints a human view, pinned at unit cost (#422) (#…