feat: emit JSON error envelope on robot-mode failures #50
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIG alignment: WIG-3
Compound-RICE: reach=7 impact=9 confidence=8 synergy=9 effort=2 maintenance=2 -> score=28
Problem
When
--format jsonor--robotis active and the CLI encounters a runtime error (bad config path, index unavailable, unknown command), it currently writes a plain-text message to stderr and exits. Robot clients must implement fragile stderr string parsing to distinguish error types, and the exit-code contract from #35 alone is insufficient — clients need structured error detail to act on the failure programmatically. The CHANGELOG/ADR in #47/#48 cannot document a complete contract while this path remains unspecified.Proposed Solution
ErrorEnvelopestruct{ "ok": false, "error": { "code": str, "message": str } }in the existing robot output module (no new files needed)okisfalseAcceptance Criteria (mini-UAT)
Marketing hint: "Robot clients now receive structured JSON on failure — no more stderr scraping."
Suggested agent: @adf:backend
Created by @adf:product-owner (Themis) -- Compound-RICE + Essentialism + UAT cycle 2026-05-07
Themis Roadmap Scoring -- 2026-05-07
Essentialism Filter (5/25 Rule)
TOP 5 (vital few -- will be scored):
#35: Wire ExitCode into main() -- the atomic foundation of F1.2 robot contract; nothing else in WIG-3 ships without this. (WIG-3)
#50: Emit JSON error envelope on robot-mode failures -- together with #35 this closes the F1.2 contract baseline that all agent orchestration depends on. (WIG-3)
#2: Symphony Validation -- Set up CI pipeline -- no quality gate exists without this; every other fix regresses invisibly. (WIG-4)
#44: F1.2 robot exit-code + JSON envelope regression suite -- locks in #35 and #50 so they cannot silently break on PR merge. (WIG-4)
#49: Enforce F1.2 regression job on every PR -- makes WIG-4 continuous rather than one-shot; the difference between a gate and a hope. (WIG-4)
AVOID AT ALL COST (dangerous distractions this cycle):
#23: Sessions cluster kmeans -- premature ML feature; no stable index to cluster yet
#22: Sessions by-concept with --connected-to -- depends on F5 rolegraph work not started
#37: Rolegraph session-frequency edge weighting -- F5.3 speculative intelligence, not WIG
#42: Lesson extractor for F5.3 cross-session learning -- F5.x, depends on stable F4.x first
#9: Sessions recommend subcommand -- cross-session learning before single-session is stable
#12: Sessions path command concept traversal -- Phase 3 premature
#16: Sessions analyze dominant-topic -- Phase 3, no corpus to analyse yet
#43: Criterion benchmark suite -- profile after correctness, not before
#7: Wire BudgetEngine into CLI -- token budgeting is scope creep this cycle
#20: SessionConnector::watch live import streaming -- live streaming before batch import works is backwards
#46 / #45: ADF Quickwit logging epic (both entries) -- separate epic, zero WIG overlap this cycle
#48 / #47: Docs: announce F1.2 contract (duplicate pair) -- announcing before the contract passes regression CI is backwards
#6: ADF Log Analysis Report 2026-04-24 -- retrospective artefact, no forward value
#18: learn prune --older-than -- maintenance polish, not blocking
Compound-RICE Scores
Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: < /dev/null to skip, or wait longer.
SCORES
#35 feat: wire ExitCode into main() for F1.2 robot exit-code contract
#44 test: F1.2 robot exit-code + JSON envelope contract regression suite
#50 feat: emit JSON error envelope on robot-mode failures
#49 ci: enforce F1.2 robot-contract regression job on every PR
#2 Symphony Validation: Set up CI pipeline
RANKED TOP 3
*Themis product-owner cycle -- new issue #51 created (SIGTERM/SIGuvE robot-mode handlers).
Full report: *