Skip to content

[feature] watch: block until a run needs a human, with NDJSON state transitions #51

Closed

Description

@smota

Split from #50 (item 1).

Problem

Meshloop has no command that waits for a run. In both live runs the origin agent wrote its own loop: run inspect --json every N seconds, diff node states with jq, and treat changes as events. Every orchestrator writes this loop again, and the result is only as good as status and inspect, which have known bugs (#46, #47).

Proposal

meshloop watch --graph <id> [--config <f>] [--db <f>] [--json] [--interval <s>]

  • Prints the current state, then one NDJSON line per change to a node or plan state: {ts, graph_id, node, from, to, note}.
  • Exits 0 when the run needs a person: any node is AwaitingReview, or the plan is awaiting_acceptance. Also exits 0 when the run finishes successfully.
  • Exits non-zero when a node fails or runs out of retries, or when the graph can't be resolved.
  • The last line gives the exit reason, e.g. {"exit": "awaiting_review", "nodes": [2]}.
  • Reads the store only and never needs to own the worker process, so it works on run --detach runs.
  • Update the meshloop-run and meshloop-status skills to use it instead of polling.

Relations

Acceptance criteria

  • Fixture test: a detached run where one node reaches AwaitingReview → watch exits 0 and its last line names that node.
  • Fixture test: a node fails → non-zero exit, and the reason names the node.
  • Unknown --graph → non-zero exit naming the graph id.
  • Works when the config is outside the current directory, given --config.

🤖 Generated with Claude Code

Activity

  1. smota commented on Oct 7, 2026

    @smota
    OwnerAuthor

    Workflow status: implemented in #69 (branch work/supervision-surface, base main @ d058307). Executor: Meshloop with Claude Sonnet workers, orchestrated and reviewed by Claude Code (Opus 5.5). Plans accepted by @smota. xtask check passes on bad9d72. Next owner: an independent reviewer (for-review:), then a human merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    drafted-by:claudeIssue, plan, or spec drafted by Claude in the current sessionenhancementNew feature or requestfor-implementation:claudeImplementation routed to Claude

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions