docs(roadmap): add #458 — no portable success-detection field across --output-format json envelopes; only kind is universal#3071
Open
Yeachan-Heo wants to merge 1 commit into
Conversation
…--output-format json envelopes; only kind is universal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ROADMAP pinpoint #458 — cross-subcommand JSON envelope catalog: only
kindis universalDogfooded for the 2026-05-24 09:00 Clawhip pinpoint nudge (message 1508031832669814834).
Catalog of top-level fields across success envelopes
Clean isolated env, no
.claw.json, fresh git-init workspace:kindstatusactionsummarymessagereportstatus"status""ok"mcp"mcp""ok""list"skills"skills""list"agents"agents""list"doctor"doctor"sandbox"sandbox"init"init"system-prompt"system-prompt"version"version"Only
kindis universal. Every other top-level discriminator is present on some envelopes and missing on others.Why it matters
if response["status"] == "ok"works for exactly 2 of 9 subcommands (status,mcp) and silently returns false/None for the other 7 because the field doesn't exist.if response["action"] == "list"works for 3 of 9 and breaks for the rest.Why distinct from existing items
{error, type}vs{kind, error})doctormessage/reportbyte-duplication (one symptom)This is the structural fact that no single top-level field is present on every success envelope, so no portable success detection is possible across the catalog without per-subcommand special-casing.
Trace
Every envelope is emitted from a separate code path with no shared envelope constructor:
statusJSON atmain.rs:5738emits"status": "ok"directlymcpJSON emits bothstatus:"ok"andaction:"list"skills/agentsemitaction:"list"andsummarybut nostatusdoctorJSON atmain.rs:1905-1923emitskind/message/report/has_failures/summary{ok,warn,fail,total}/checks[]— nostatusfield at all, while everychecks[i]has its ownstatussandbox/init/system-prompt/versioneach emit different ad-hoc shapesThere is no
EnvelopeBuilder/BaseEnvelopeshared struct that guarantees a uniform success/error discriminator.Required fix shape (full detail in ROADMAP entry)
(a) Define a single shared
BaseEnvelope:{kind, status: "ok"|"warn"|"error", action: …|null, summary: "<one-line>", details: <command-specific>}. Two universal fields:kind+status. (b) Drop ad-hocmessage/reportin favor ofsummary(one line) + optionaltext_render. (c)doctorrollup: top-levelstatusderived fromhas_failuresandsummary.warnings. (d) Contract test that parses every subcommand's JSON, assertskindmatches subcommand name andstatus ∈ {ok,warn,error}. (e) Doc the envelope indocs/json-envelope-contract.md.Acceptance check (one-liner)
Should print no FAILs.
—
[repo owner's gaebal-gajae (clawdbot) 🦞]