cwd: packages/sdk
RELAYFLOWD_BIN=/Users/khaliqgant/.relayflows-toolchain/target/162085787/debug/relayflowd

$ npx vitest run --maxWorkers=2 --minWorkers=1

 RUN  v2.1.9 /Users/khaliqgant/flows-274-yaml/packages/sdk

stdout | tests/live-kernel.test.ts
LIVE_KERNEL relayflowd=/Users/khaliqgant/.relayflows-toolchain/target/162085787/debug/relayflowd
LIVE_KERNEL flows=/Users/khaliqgant/flows-274-yaml/packages/sdk/dist/cli.js

 ✓ tests/cli.test.ts (63 tests) 9795ms
   ✓ flows check CLI > binds a checked relative wrapper to the flow directory for worker execution 482ms
   ✓ flows check CLI > uses the raw Claude adapter model flag instead of accepting auth status as model proof 438ms
   ✓ flows check CLI > uses Codex login status and reports a rejected model as unavailable, not unauthenticated 313ms
   ✓ flows check CLI > refuses a nonconforming custom wrapper without calling it an authentication failure 328ms
   ✓ flows check CLI > accepts an exact allowlisted named-agent model and probes that model 327ms
   ✓ flows check CLI > checks the same named-agent contract from declarative JSON 323ms
   ✓ flows check CLI > refuses a typo model before probing or contacting relayflowd 328ms
   ✓ flows check CLI > maps every input refusal path to its declared kind without raw exceptions 1775ms
   ✓ flows run/resume CLI over the journal protocol > parses run options, submits the kernel dialect, and exits 0 on success 307ms
   ✓ flows run/resume CLI over the journal protocol > exits 3 and names the parked llm step 727ms
   ✓ flows run/resume CLI over the journal protocol > reports a needs_human agent step as parked for human recovery 337ms
   ✓ flows run/resume CLI over the journal protocol > classifies a typed hello refusal as a protocol error, not an unreachable daemon 366ms
   ✓ flows run/resume CLI over the journal protocol > follows a dispatched worker step instead of reporting a protocol error 672ms
   ✓ flows run/resume CLI over the journal protocol > bounds a worker wait by its lease and reports what it is waiting for 774ms
   ✓ flows run/resume CLI over the journal protocol > resumes a parked run from snapshot step types without reading journal sequence one 325ms
   ✓ flows run/resume CLI over the journal protocol > maps only run_not_found resumes to exit 2 971ms
 ✓ tests/observer-link.test.ts (39 tests) 157ms
 ✓ tests/preflight.test.ts (27 tests) 30ms
 ✓ tests/daemon-lifecycle.test.ts (42 tests) 26ms
 ✓ tests/authored-flow.test.ts (24 tests) 643ms
 ✓ tests/worker-cli.test.ts (13 tests) 21412ms
   ✓ custom wrapper execution identity > bounds wrapper execution after acknowledgement 341ms
   ✓ custom wrapper execution bounds are reader-owned > resolves when a conforming wrapper leaks a stdio pipe to a background helper 1843ms
   ✓ custom wrapper execution bounds are reader-owned > resolves when the leaked helper inherits stderr only 1865ms
   ✓ custom wrapper execution bounds are reader-owned > resolves when a wrapper leaks a stdio pipe and exits before identifying 3253ms
   ✓ custom wrapper execution bounds are reader-owned > journals a completionReason at the default bound when a wrapper leaks a stdio pipe 11256ms
   ✓ custom wrapper execution bounds are reader-owned > accepts the same over-8KiB payload whether or not it coalesces with the execute token 804ms
 ✓ tests/validate.test.ts (68 tests) 10ms
 ✓ tests/journal-client.test.ts (14 tests) 66ms
 ✓ tests/tick-source.test.ts (33 tests) 11ms
 ✓ tests/verb-field-lint.test.ts (78 tests) 175ms
 ✓ tests/cloud-run.test.ts (47 tests) 98ms
 ✓ tests/authored-flow-lifecycle-executor.test.ts (27 tests) 509ms
 ✓ tests/tick-runner.test.ts (22 tests) 715ms
 ✓ tests/stop-process-group.test.ts (6 tests) 6997ms
   ✓ every stop reaches the process group, not just the direct child > exits the run after an execution-timeout stop 1370ms
   ✓ every stop reaches the process group, not just the direct child > exits the run after a protocol terminate stop 398ms
   ✓ every stop reaches the process group, not just the direct child > kills a SIGTERM-deaf grandchild after a protocol terminate stop 1654ms
   ✓ every stop reaches the process group, not just the direct child > kills a SIGTERM-deaf grandchild after an execution-timeout stop 2091ms
   ✓ every stop reaches the process group, not just the direct child > holds the loop open long enough for the escalation to run 1177ms
   ✓ every stop reaches the process group, not just the direct child > terminate() forces a group that outlives SIGTERM 307ms
 ✓ tests/gate-contract.test.ts (20 tests) 63ms
 ✓ tests/cli-hn-monitor.test.ts (16 tests) 99ms
stdout | tests/live-kernel.test.ts > built flows CLI against live relayflowd > hn-monitor analyze-story reaches done through the real Claude analyzer CLI
LIVE_ANALYZER ready: claude -p --model claude-haiku-4-5-20251001 round-trip OK

 ✓ tests/daemon-lifecycle-live.test.ts (9 tests) 12210ms
   ✓ flows run against a data dir with no daemon (§6 test 7) > cold start spawns exactly one daemon, the run succeeds, and the daemon outlives the CLI 1945ms
   ✓ flows run against a data dir with no daemon (§6 test 7) > polls, bounded, for a daemon that holds the lock before it binds 2230ms
   ✓ flows run against a data dir with no daemon (§6 test 7) > attaches to a serving daemon that has not published a connection file 1014ms
   ✓ flows run against a data dir with no daemon (§6 test 7) > a second run attaches to the daemon the first one started, spawning nothing 1420ms
   ✓ flows run against a data dir with no daemon (§6 test 7) > detects a stale connection file left by a hard kill and starts a fresh daemon 2114ms
   ✓ concurrent invocations against one empty data dir (§6 test 15) > ends with exactly one daemon owning the socket, and both runs succeed 1127ms
   ✓ refusals from a spawn that cannot produce a daemon > names relayflowd_not_found rather than falling through to PATH 857ms
   ✓ refusals from a spawn that cannot produce a daemon > names daemon_start_failed and quotes the daemon log when startup dies 901ms
   ✓ refusals from a spawn that cannot produce a daemon > refuses a daemon speaking another protocol version instead of binding over it 601ms
 ✓ tests/backlog-picker.test.ts (14 tests) 98ms
 ✓ tests/backlog-picker-flow.test.ts (6 tests) 509ms
 ✓ tests/authored-flow-operation.test.ts (23 tests) 256ms
stdout | tests/live-kernel.test.ts > built flows CLI against live relayflowd > hn-monitor analyze-story reaches done through the real Claude analyzer CLI
LIVE_ANALYZER analysis: {"reasoning":"This story directly describes an AI agent that autonomously performs development workflow automation tasks—specifically opening and reviewing pull requests—which is a core application of intelligent agent systems and represents the exact intersection of agents and automation.","relevance_score":10,"story_title":"Show HN: an agent that opens and reviews its own pull requests [wake-nonce-7f3a91c4]"}

stdout | tests/live-kernel.test.ts > surface resume after a real daemon kill > resumes a three-step run with each successful completion exactly once
LIVE_KERNEL kill -9 pid=10226 run=01M26FSXGGHJWBWQEENH6E3RDJ while step=two state=Running

 ✓ tests/direct-input.test.ts (4 tests) 4646ms
   ✓ direct .flow.ts input through the built CLI and live runtime > executes inline and file JSON input through relayflowd 1638ms
   ✓ direct .flow.ts input through the built CLI and live runtime > refuses missing and malformed input before contacting relayflowd 2090ms
   ✓ direct .flow.ts input through the built CLI and live runtime > does not import or execute authored code before daemon availability 465ms
   ✓ direct .flow.ts input through the built CLI and live runtime > refuses oversized file input before contacting relayflowd 453ms
 ✓ tests/work-package-consumer.test.ts (13 tests) 187ms
 ❯ tests/live-kernel.test.ts (30 tests | 1 failed) 63574ms
   ✓ built flows CLI against live relayflowd > runs rung (a), parks rung (b), and keeps JSON report-shaped 3304ms
   ✓ built flows CLI against live relayflowd > allows a deterministic run to exceed the bounded request timeout 32190ms
   ✓ built flows CLI against live relayflowd > follows a live worker dispatch through flows run 582ms
   ✓ built flows CLI against live relayflowd > runs an agent CLI end to end through the SDK worker 337ms
   ✓ built flows CLI against live relayflowd > f.agent lowers to a real agent step and dispatches through a live worker 1171ms
   ✓ built flows CLI against live relayflowd > f.agent's default flowPath anchors on cwd, not cwd's parent 492ms
   ✓ built flows CLI against live relayflowd > can always get a parked run to a late-attaching worker 5556ms
   ✓ built flows CLI against live relayflowd > reports a real manual-recovery NeedsHuman state as parked 670ms
   ✓ built flows CLI against live relayflowd > AgentWorker passes a declared model to an identified wrapper as RELAYFLOW_MODEL 2252ms
   ✓ built flows CLI against live relayflowd > AgentWorker refuses a nonconforming journal-submitted wrapper before exposing RELAYFLOW_MODEL 723ms
   ✓ built flows CLI against live relayflowd > AgentWorker executes the raw claude adapter with its real model flag 358ms
   ✓ built flows CLI against live relayflowd > AgentWorker executes the raw codex adapter with its real model flag 1026ms
   ✓ built flows CLI against live relayflowd > hn-monitor analyze-story reaches done through the real Claude analyzer CLI 11147ms
   × built flows CLI against live relayflowd > preflights before journaling and names an unreachable socket 489ms
     → expected [ Array(2) ] to deeply equal [ 'connection.json.tmp.9958', …(1) ]
   ✓ built flows CLI against live relayflowd > starts exactly one daemon when two runs race for one empty data dir 495ms
   ✓ surface resume after a real daemon kill > resumes a three-step run with each successful completion exactly once 1323ms
 ✓ tests/spec-parity.test.ts (31 tests) 166ms
 ✓ tests/worker-lease.test.ts (7 tests) 5ms
 ✓ tests/typed-output.test.ts (14 tests) 105ms
 ✓ tests/model-selection.test.ts (10 tests) 10ms
 ✓ tests/relayflowd-path.test.ts (10 tests) 2ms
 ✓ tests/json-schema-bound.test.ts (71 tests) 1350ms
   ✓ JSON Schema termination bound > walks a deep schema with an explicit stack rather than recursion 1132ms
 ✓ tests/yaml-local-agent-live.test.ts (7 tests) 2275ms
   ✓ YAML --local-agent through the built CLI and real daemon > runs with the checked step CLI and model and journals done 313ms
   ✓ YAML --local-agent through the built CLI and real daemon > runs with the checked named CLI and model and journals done 363ms
   ✓ YAML --local-agent through the built CLI and real daemon > runs with the checked flow CLI and model and journals done 363ms
   ✓ YAML --local-agent through the built CLI and real daemon > runs with the checked project CLI and model and journals done 364ms
   ✓ YAML --local-agent through the built CLI and real daemon > reports the agent process failure 360ms
 ✓ tests/local-dev-ux.test.ts (8 tests) 9ms
 ✓ tests/dependency-validation.test.ts (6 tests) 237ms
 ✓ tests/deterministic-llm.test.ts (5 tests) 34ms
 ✓ tests/bin.test.ts (7 tests) 564ms
 ✓ tests/hn-poller.test.ts (6 tests) 3ms
 ✓ tests/dir-watcher-poller.test.ts (6 tests) 2ms
 ✓ tests/hello-deterministic.test.ts (5 tests) 9ms
 ✓ tests/work-package-validator.test.ts (7 tests) 3ms
 ✓ tests/classify-outcome.test.ts (2 tests) 2219ms
   ✓ classifyOutcome > gives up and reports when a running run never becomes classifiable 2063ms
 ↓ tests/real-cli-adapters.test.ts (3 tests | 3 skipped)
 ✓ tests/parse-json-output.test.ts (7 tests) 1ms
 ✓ tests/cli-adapter.test.ts (3 tests) 2ms
 ✓ tests/journal-client-completion.test.ts (4 tests) 101ms
 ✓ tests/worker-cli-abort.test.ts (2 tests) 2508ms
   ✓ stops claude and its process group when lease ownership is lost 1245ms
   ✓ stops wrapper.mjs and its process group when lease ownership is lost 1262ms
 ✓ tests/direct-run-failure.test.ts (4 tests) 2ms
 ✓ tests/cli-progress-wait.test.ts (2 tests) 637ms
   ✓ run starts the wait clock on its first observed lease 313ms
   ✓ resume starts the wait clock on its first observed lease 323ms
 ✓ tests/placement.test.ts (54 tests) 7ms
 ✓ tests/memory.test.ts (18 tests) 4ms
 ✓ tests/local-agent-live.test.ts (5 tests) 41042ms
   ✓ built CLI local agent against a real daemon > dispatches through the wrapper and keeps --json stdout report-shaped 691ms
   ✓ built CLI local agent against a real daemon > runs beyond the initial 30-second lease without a second invocation 35747ms
   ✓ built CLI local agent against a real daemon > renders actual agent completion in text output 1275ms
   ✓ built CLI local agent against a real daemon > returns a failed run when the agent process fails 2643ms
   ✓ built CLI local agent against a real daemon > refuses a workspace it cannot pin before invoking the agent 685ms
 ✓ tests/worker-platform.test.ts (1 test) 2ms

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  tests/live-kernel.test.ts > built flows CLI against live relayflowd > preflights before journaling and names an unreachable socket
AssertionError: expected [ Array(2) ] to deeply equal [ 'connection.json.tmp.9958', …(1) ]

- Expected
+ Received

  Array [
-   "connection.json.tmp.9958",
+   "connection.json",
    "relayflowd.lock",
  ]

 ❯ tests/live-kernel.test.ts:1319:35
    1317|     expect(refused.status).toBe(2);
    1318|     expect(refused.stderr).toContain('REFUSED [cli_missing]');
    1319|     expect(runArtifacts(dataDir)).toEqual(before);
       |                                   ^
    1320| 
    1321|     // `--no-spawn` is what still makes an absent daemon a refusal: `f…

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

 Test Files  1 failed | 48 passed | 1 skipped (50)
      Tests  1 failed | 939 passed | 3 skipped (943)
   Start at  22:22:00
   Duration  106.13s (transform 517ms, setup 0ms, collect 2.69s, tests 173.59s, environment 4ms, prepare 1.31s)

exit: 1
