claw-code/rust/crates/rusty-claude-cli/src
YeonGyu-Kim 314f0c99fd feat(worker_boot): emit .claw/worker-state.json on every status transition
WorkerStatus is fully tracked in worker_boot.rs but was invisible to
external observers (clawhip, orchestrators) because opencode serve's
HTTP server is upstream and not ours to extend.

Solution: atomic file-based observability.

- emit_state_file() writes .claw/worker-state.json on every push_event()
  call (tmp write + rename for atomicity)
- Snapshot includes: worker_id, status, is_ready, trust_gate_cleared,
  prompt_in_flight, last_event, updated_at
- Add 'claw state' CLI subcommand to read and print the file
- Add regression test: emit_state_file_writes_worker_status_on_transition
  verifies spawning→ready_for_prompt transition is reflected on disk

This closes the /state dogfood gap without requiring any upstream
opencode changes. Clawhip can now distinguish a truly stalled worker
(status: trust_required or running with no recent updated_at) from a
quiet-but-progressing one.
2026-04-08 00:37:44 +09:00
..
init.rs Make .claw the only user-facing config namespace 2026-04-05 18:11:25 +00:00
input.rs Reduce REPL overhead for orchestration-heavy workflows 2026-04-02 07:19:14 +00:00
main.rs feat(worker_boot): emit .claw/worker-state.json on every status transition 2026-04-08 00:37:44 +09:00
render.rs feat: b5-context-compress — batch 5 wave 2 2026-04-07 15:19:45 +09:00