roadmap: #265 filed

This commit is contained in:
Yeachan-Heo 2026-04-26 04:31:09 +00:00
parent d5568eb7a4
commit 897535478c

View File

@ -16921,3 +16921,15 @@ Acceptance: a downstream caller can pattern-match on `RuntimeErrorKind::TurnBudg
**Status:** Open. No source code changed. Filed 2026-04-26 13:05 KST. Branch: feat/jobdori-168c-emission-routing. HEAD: `d0aa18e` (post-#263 fast-forward verification onto gaebal-gajae's `--compact` help-text-vs-dispatch-mismatch pinpoint). Cluster delta: Turn-budget-primitive cluster 0→1 (founder, NEW SOLO CLUSTER); complementary-pinpoint-pair-bundle discovery-pattern extended (sister to #245+#250 WebSearch client/server pair, now #262+#264 turn-budget CLI-parse/runtime-primitive pair). Smaller-scope by design (matches #253/#254/#257/#258/#260/#261/#262/#263 context-budget discipline). Sister: #262 (CLI parse-side; #262+#264 bracket the full turn-budget concern across two structural layers). Distinct from silent-fallback family (#258/#260/#262 catalogue silent-mutation at boundaries; #264 catalogues a missing typed primitive layer that those boundaries would land typed errors INTO). Distinct from #254 MCP Resources lifecycle (also runtime-protocol layer but resource-handle axis, not iteration/turn axis). Eleventh-cycle concurrent-dogfood-rebase parity will be confirmed local==origin==fork at HEAD `d0aa18e+#264` after push. **Status:** Open. No source code changed. Filed 2026-04-26 13:05 KST. Branch: feat/jobdori-168c-emission-routing. HEAD: `d0aa18e` (post-#263 fast-forward verification onto gaebal-gajae's `--compact` help-text-vs-dispatch-mismatch pinpoint). Cluster delta: Turn-budget-primitive cluster 0→1 (founder, NEW SOLO CLUSTER); complementary-pinpoint-pair-bundle discovery-pattern extended (sister to #245+#250 WebSearch client/server pair, now #262+#264 turn-budget CLI-parse/runtime-primitive pair). Smaller-scope by design (matches #253/#254/#257/#258/#260/#261/#262/#263 context-budget discipline). Sister: #262 (CLI parse-side; #262+#264 bracket the full turn-budget concern across two structural layers). Distinct from silent-fallback family (#258/#260/#262 catalogue silent-mutation at boundaries; #264 catalogues a missing typed primitive layer that those boundaries would land typed errors INTO). Distinct from #254 MCP Resources lifecycle (also runtime-protocol layer but resource-handle axis, not iteration/turn axis). Eleventh-cycle concurrent-dogfood-rebase parity will be confirmed local==origin==fork at HEAD `d0aa18e+#264` after push.
## Pinpoint #265 — Non-interactive output has no `stream-json` event lane even though the provider path already streams internally, forcing automation to choose between human text streaming and one-shot summary JSON
Dogfooded 2026-04-26 13:30 KST on `feat/jobdori-168c-emission-routing` at HEAD `d5568eb` (post-#264). Fresh CLI verification shows `claw --help` advertises only `--output-format text|json`, and `cargo run --quiet --bin claw -- --output-format stream-json -p "noop"` fails immediately with `[error-kind: cli_parse] error: unsupported value for --output-format: stream-json (expected text or json)`. Source inspection confirms the mode boundary is structural: `CliOutputFormat` has only `Text` and `Json` (`rust/crates/rusty-claude-cli/src/main.rs:793-805`), `run_turn_with_output` only dispatches `Text`, `Json`, and compact variants (`main.rs:4638-4648`), while the actual Anthropic client path always uses streaming internally (`MessageRequest { stream: true }` at `main.rs:7928`) and converts provider stream chunks into `AssistantEvent` values in `consume_stream` (`main.rs:7966-8095`). Those events are accumulated and returned, not exposed as a line-delimited machine stream.
Concrete failure mode: automation and downstream claws cannot observe turn progress as typed JSON events while a prompt is running. In `text` mode the operator sees live human-rendered Markdown/tool output, but parsers have to scrape terminal prose. In `json` mode the consumer receives one final envelope only after the turn completes, so long-running tool loops, post-tool stalls, prompt-cache events, tool starts/results, auto-compaction, and future #264 budget warnings/exhaustion cannot be routed until the end (or at all, depending on envelope fields). This is exactly the surface that would need to carry #264's `TurnBudgetWarning` before exhaustion and #260's compact-envelope observability fields during execution; without a stream-json lane, those typed runtime events have nowhere deterministic to go.
Gap. This is an **event/log opacity gap at the CLI output layer**, distinct from #260 and #263. #260 is about fields silently missing from the final compact JSON envelope; #263 is stale help text for an existing compact-JSON path; #265 is the absence of a machine-readable streaming output mode despite the provider stream and internal `AssistantEvent` pipeline already existing. It is also distinct from #264: #264 defines the missing turn-budget primitive/events; #265 identifies the CLI event lane those events need to surface through in non-interactive automation.
Required fix shape: (a) add `CliOutputFormat::StreamJson` parsed from `--output-format stream-json` and documented in help; (b) add a `run_prompt_stream_json` dispatch path that emits JSON Lines with stable event names (`message_start`, `text_delta`, `tool_use`, `tool_result`, `usage_delta`, `prompt_cache`, `auto_compaction`, `turn_budget_warning`, `turn_budget_exhausted`, `message_stop`, `error`, `final_summary`); (c) ensure human Markdown rendering is disabled or explicitly separated when `stream-json` is active so stdout remains valid JSONL; (d) include stable sequence numbers and timestamps so consumers can reconstruct order without scraping; (e) add tests that `--output-format stream-json` is accepted, stdout is JSONL-only, tool-use and final-summary events both appear, and runtime errors are emitted as typed `error` events before non-zero exit. Acceptance: a downstream claw can run `claw --output-format stream-json -p "..."` and react to tool/budget/compaction/error events before the final assistant message, with no terminal-prose scraping.
**Status:** Open. No source code changed. Filed 2026-04-26 13:30 KST. Branch: feat/jobdori-168c-emission-routing. HEAD: `d5568eb` before filing. Cluster delta: CLI-event-stream-observability +1; prerequisite output lane for #260/#264 follow-up implementation. Concrete delta this cycle: ROADMAP-only pinpoint appended after live help/parse/source verification.