Repository navigation
Description
Overview
A session that hands a task to review has nothing to wait on. It either stops, and the user has to come back and tell it the review is in, or it polls. This repository already has the pattern that works: bun run merge is started in the background, waits in a queue, and exits when the pull request lands or is ejected, and the harness re-invokes the session when the command exits. This issue gives NodeSpace the same thing for graph state: a nodespace command that blocks until a node or a saved query's result changes in a stated way, then prints what changed and exits.
Problem Statement
- Review is asynchronous and done by another session (Adapt the community implement and review workflows into NodeSpace delivery skills: test-first, review by a separate session, a decision per finding #3720). The implementing session keeps the context needed to address the findings, but nothing tells it when the review has come back.
- A harness plugin checks a session's task only while the session is active, so an idle session learns nothing.
- Having NodeSpace push a prompt into a session works only for sessions NodeSpace launched, and not in every harness.
- The daemon already streams node changes (
WatchNodes), which the desktop app uses. The CLI has no command over it.
Proposed Solution
- A CLI command that takes a node, or a saved query, and a condition, blocks until the condition holds, prints the node with its context (or the query's items) and exits 0. For a task in review the condition is that its review has an outcome: findings to address, or approved.
- It behaves like the merge wait: a status line at an interval while waiting, a timeout after which it exits with a distinct non-zero status, and a distinct exit when the thing it waits on can no longer reach the condition (the task was cancelled or deleted).
- The wait holds no state of its own. The task and its queue are the durable record; a wait that dies or times out loses nothing, and running it again resumes waiting.
- The implementing and reviewing skills name the command: after moving a task to review, start the wait in the background; when it returns with findings, address them and move the task back to review; when it returns approved, complete the task.
- The same command serves the other waits in the playbook: a task waiting on a person (Shape a standalone task when it is created, and let a task wait on a person (waiting status and waiting_on) #3722), and a reviewer waiting for fixes.
Documentation
- ADR-093 §1, §3 and §5 - the CLI is the one interface; what a task read returns; what a plugin watches during a turn
- ADR-094 §1, §2 and §7 - running a saved query, reading a node with what governs it, a read has a version a client can compare
- daemon-cli-protocol.md - the CLI and daemon contract
- Updates:
architecture/daemon-cli-protocol.md(the new command), ADR-093 §1 or an amendment naming the wait as part of the interface, and the skill reference shipped with the skill package. No prior ADR decides a blocking CLI command; write the amendment before the code.
Architecture Impact
Extends ADR-093 §1 (the CLI as the one interface a coding agent uses) with a blocking read. It does not change ADR-094's rule that a Play never instructs: nothing is pushed to a session. The session asks and waits.
Acceptance Criteria
- A command waits on a node until a stated condition on its fields holds, then prints the node with its context and exits 0
- A command waits on a saved query until its result gains or loses an item, or a named item appears, then prints the items and exits 0
- While waiting it prints a status line at an interval; it exits with a distinct non-zero status on timeout and another when the condition can no longer be reached
- It uses the daemon's change stream and does not poll on a timer; a daemon restart during a wait is survived or reported clearly
- The condition already holding when the command starts returns at once
- The skill reference and the implementing and reviewing skills describe the wait, with the skill-guidance wording for the new command and its output
- Tests cover: condition met later, already met, timeout, target cancelled, daemon unavailable
- Code passes
bun run quality:fix -
bun run test:changedpasses
Technical Specifications
Reference Files
packages/proto/proto/node_service.proto-WatchNodes(WatchRequest) returns (stream NodeEvent)packages/desktop-app/app-lib/src/watcher.rs,services/grpc_client.rs- the existing consumer of the streampackages/cli/src/commands/node.rs,query.rs,mod.rs- where the command belongsscripts/merge-pr.ts,scripts/merge-queue.ts- the wait this is modelled on: status lines, timeout, distinct exitspackages/skill/SKILL.md,packages/skill/references/- the CLI manual the skill ships
Implementation Details
- Express the condition with what the CLI already has for filters where possible, so no second condition language is added.
- Decide whether "review has an outcome" is a condition on the task alone or on the review queues of Adapt the community implement and review workflows into NodeSpace delivery skills: test-first, review by a separate session, a decision per finding #3720; the command should not know about review.
- Exit codes are part of the contract a skill relies on: document them.
- A harness that cannot run a background command gets no benefit; say which do (Confirm what each coding harness actually receives from NodeSpace #3721).
Dependencies
- Adapt the community implement and review workflows into NodeSpace delivery skills: test-first, review by a separate session, a decision per finding #3720 (the review flow that defines what a session waits for)
Related Issues
- Shape a standalone task when it is created, and let a task wait on a person (waiting status and waiting_on) #3722 (waiting on a person)
- Confirm what each coding harness actually receives from NodeSpace #3721 (which harnesses can run a background command)
- Run this repository's work through NodeSpace's built-in playbook and the adopted community workflow skills #3712 (the trial)
Non-Goals
- NodeSpace prompting or waking a session
- A notification outside the terminal
- A general event subscription API for third parties
Activity
malibio commentedon Oct 11, 2026
Baseline — Frontend: 324 test files passed (5873 tests)
Add nodespace wait: block until a node or a saved query's result chan…
Add nodespace wait: block until a node or a saved query's result chan…