From fdde5e45cf959acca622b98e9ff247b51470aefc Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 26 May 2026 03:02:57 +0900 Subject: [PATCH] fix(#712): add missing action fields to doctor/status/bootstrap-plan/dump-manifests json responses --- ROADMAP.md | 2 ++ rust/crates/rusty-claude-cli/src/main.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/ROADMAP.md b/ROADMAP.md index 25cad837..c826dd29 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -7589,3 +7589,5 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed) 710. **`claw diff --output-format json` missing `action` and `working_directory` fields — both the ok and error paths in `render_diff_json_for` omitted `action` entirely (returning `null` at parse time) and omitted `working_directory`** — dogfooded 2026-05-26 on `8f8eb41e`. Both the clean/changes success path and the no-git-repo error path were missing the two envelope fields that automation uses for routing and provenance. Fix: added `action:"diff"` and `working_directory: cwd.display()` to both branches of `render_diff_json_for`; added contract-test assertions for both fields. Source: Jobdori dogfood on `8f8eb41e`, 2026-05-26. 711. **`version`, `system-prompt`, `export`, and `init` `--output-format json` responses all lacked an `action` field — returned `null` or omitted entirely** — dogfooded 2026-05-26 on `42c17bc4`. All four commands emitted `kind` + `status` but no `action`, making them inconsistent with all other JSON surfaces that include the verb. Fix: added `action:"show"` to `version` and `system-prompt`, `action:"export"` to all three `export` paths, `action:"init"` to `init`; added contract-test assertions for each. Source: Jobdori dogfood on `42c17bc4`, 2026-05-26. + +712. **`doctor`, `status`, `bootstrap-plan`, and `dump-manifests` `--output-format json` responses missing `action` field — consistent with batch of missing-action fixes in #710/#711** — dogfooded 2026-05-26 on `bae0099c`. `doctor` returned no `action`; `status` and `bootstrap-plan` same. `dump-manifests` had empty string. Fix: added `action:"doctor"` to doctor JSON, `action:"show"` to status and bootstrap-plan, `action:"dump"` to dump-manifests happy path. Source: Jobdori dogfood on `bae0099c`, 2026-05-26. diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index d9b5ec8a..028d0165 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -2139,6 +2139,7 @@ impl DoctorReport { let (ok_count, warn_count, fail_count) = self.counts(); json!({ "kind": "doctor", + "action": "doctor", "status": self.status(), "message": report, "report": report, @@ -2890,6 +2891,7 @@ fn dump_manifests_at_path( "{}", serde_json::to_string_pretty(&json!({ "kind": "dump-manifests", + "action": "dump", "commands": manifest.commands.entries().len(), "tools": manifest.tools.entries().len(), "bootstrap_phases": manifest.bootstrap.phases().len(), @@ -2922,6 +2924,7 @@ fn print_bootstrap_plan(output_format: CliOutputFormat) -> Result<(), Box>()); json!({ "kind": "status", + "action": "show", "status": if degraded { "degraded" } else { "ok" }, "config_load_error": context.config_load_error, "config_load_error_kind": context.config_load_error_kind,