Skip to content

A CLI command that waits until a node or a queue changes, so a session can wait for its review #3723

Closed

Description

@malibio

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

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:changed passes

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 stream
  • packages/cli/src/commands/node.rs, query.rs, mod.rs - where the command belongs
  • scripts/merge-pr.ts, scripts/merge-queue.ts - the wait this is modelled on: status lines, timeout, distinct exits
  • packages/skill/SKILL.md, packages/skill/references/ - the CLI manual the skill ships

Implementation Details

Dependencies

Related Issues

Non-Goals

  • NodeSpace prompting or waking a session
  • A notification outside the terminal
  • A general event subscription API for third parties

Activity

  1. malibio commented on Oct 11, 2026

    @malibio
    CollaboratorAuthor

    Baseline — Frontend: 324 test files passed (5873 tests)

  2. self-assigned this
    on Oct 11, 2026
  3. added a commit that references this issue on Oct 11, 2026
    c93cfc3
  4. added a commit that references this issue on Oct 11, 2026
    0656526
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions