Repository navigation
Stop the ADR-048 daemon fixture spawning a nodespaced that isn't a build of this checkout (closes #2224) - #2258
Conversation
…ild of this checkout (closes #2224) `SpawnedDaemon` resolved the daemon to spawn from `NODESPACED_TEST_BIN`, else the hand-staged `src-tauri/binaries/` sidecar. Both are git-ignored artifacts nothing keeps in sync with the source tree, and cargo's mtime-based freshness check treats build outputs copied in from another checkout as up to date, so a preceding `cargo build --bin nodespaced` does not guarantee the binary matches. An out-of-date daemon still speaks the current gRPC surface, so every RPC succeeds and only its behaviour differs — which surfaced as `ai_chat_send_to_idle_test` burning its full 300s deadline with the chat node back at `status: "idle"` and no assistant reply, indistinguishable from a regression in whatever change was being pushed. - Resolve `target/debug/nodespaced` ahead of the sidecar: it is the artifact a developer's own `cargo build --bin nodespaced` actually refreshes. - Refuse to spawn a daemon older than the `.rs` sources of the crates compiled into it, naming both files and how to rebuild, instead of letting the mismatch surface minutes later as a behavioural test failure. - Forward `RUST_LOG` to the spawned daemon so its own breadcrumbs can be raised above the fixture's `warn` default when diagnosing a stall. - Include the polled node in the ai-chat timeout panic, so the message shows what the chat node actually held rather than only two derived counters. Also collapses a `collapsible_match` in an agent test that failed `cargo clippy --all-targets` on main and blocked `quality:fix`. Co-Authored-By: Claude <[email protected]>
Independent verificationNot self-merging — this closes a report filed as a production regression, and the finding is that it wasn't one. That conclusion deserves a second reader before it lands. The claim this PR rests on, and how it was establishedThe report's signature (
Four green runs against a current daemon, one red against the old one, same machine, same test, same command shape. The md5s are how I know the three "different" stale paths ( The mechanism is confirmed from the daemon's own log rather than inferred: Where I'd push back on myself
Reviewer attention worth spending
|
Independent verification (mstomar125)Read the full diff directly, not just the investigation summary. Root-cause claim: cross-checked against PR#2168's own regression test
Test coverage: 4 cases are well-targeted — stale-rejected, Drive-by clippy fix ( Risk surface: zero production code touched — this is entirely Given this unblocks every core push today, merging now. APPROVE. (posted as a comment, not a formal GitHub review — same |
Closes #2224.
What was actually wrong
Not the daemon's turn-completion path. The runs that failed spawned a 2026-07-24
nodespaced, not a build ofmain.nodespace-app-test-support::resolve_daemon_binary()resolvedNODESPACED_TEST_BIN, else the hand-staged sidecar atsrc-tauri/binaries/nodespaced-<triple>. Both are git-ignored artifacts nothing keeps in sync with the checkout, and cargo's freshness check is mtime-based, so build outputs copied in from another checkout (the standard shortcut for a fresh worktree, which has no Rust build cache) date newer than the sources and register as up to date.An out-of-date daemon still speaks the current gRPC surface, so every RPC in the suite succeeds and only its behaviour differs. Here that behaviour was the pre-#2168 one: a turn whose inference call fails resets
statustoidleand appends nothing. #2168 (39d4f08a, 2026-08-19) is what replaced that with a visible assistant message — so any daemon built before that date produces exactlystatus="idle", assistant_count=0, and the test burns its full 300s deadline before saying so.Evidence
Byte-identical binaries, none of them a current build (a real debug
nodespacedis ~99 MB today):Pointing the test at that July binary reproduces the report verbatim — same signature, same duration:
with the daemon's own log explaining it one second into the turn:
Current
mainpasses, repeatedly, with a freshly built daemon: isolated run 39.65s ok; the gate's own step 5 (cargo test -p nodespace-app -- --test-threads=1,NODESPACED_TEST_BINset) 30.79s ok with the whole suite green; and again after this change, 22.88s ok, suite green.The change
target/debug/nodespacedover the sidecar. It is the one artifact a developer's owncargo build --bin nodespacedrefreshes; the sidecar is staged only bydev:tauri:sidecarsand can be arbitrarily old..rsfiles underpackages/{daemon,agent,core,nlp-engine,nodespace-types}/src. Fails in 0.01s naming both files and how to rebuild, instead of surfacing minutes later as a behavioural failure attributed to whatever is being pushed. Unknowable inputs (no daemon sources, unstat-able binary) stay silent — this catches one specific mismatch, it is not a second way for the fixture to refuse to start.RUST_LOGto the spawned daemon (still defaulting towarn). The daemon'sinfo!breadcrumbs were filtered out before reaching the drain threads, which is why theContextOverflowline above was invisible from the test side.tests/daemon_binary_freshness_test.rscovers the check: stale rejected with an actionable message, fresh accepted, the newest crate deciding (a daemon rebuilt after apackages/daemonedit is still stale oncepackages/agentmoves on), and unanswerable comparisons staying quiet. It runs in the gate's owncargo test -p nodespace-appstep.Out-of-scope drive-by
packages/agent/tests/live_resolve_query_decomposition_shapes.rsfailedcargo clippy --all-targets -- -D warnings(collapsible_match) onmain, blocking the mandatoryquality:fix. Collapsed exactly as clippy directs — behaviour-preserving, test-only. Worth noting thatrust:lintis not part of the pre-push gate, which is how it landed.What was ruled out
packages/agentmerges. Freshmainpasses; reproducing the failure requires the July binary.agent_loop.rs's completion paths. Onmaineveryrun_turnreturn carries non-empty text (including the no-usable-final-text fallback), so theOkarm always appends; theErrarm appends the failure message. The only remaining zero-append idle paths are cancellation (deliberate, no message by design) and a failedappend_assistant_message— neither reachable here.nodespace_core::models::AiChatMessageandnodespace_types::ai_chat::AiChatMessageare field-for-field identical, and the node dump now in the panic confirms the node genuinely held no assistant message.No production code changed.
🤖 Generated with Claude Code