fix(cli): show why diagnose and upgrade-plan collection failed in Markdown output #9696
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.50) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 562 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.379
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #9696"
general
weight: 0.35
loopx-agent
Goal And Delivered Outcome
diagnoseorupgrade-plancannot collect (for example because the registry is not valid JSON), the payload isok: falsewith the exception text inerror. The Markdown renderers printok, the null fields, and a genericrecommended_action, but omiterror. The default Markdown output therefore reports that collection failed without stating why, while JSON carries the reason.- Before: with a corrupt registry,
loopx diagnose --goal-id Gandloopx upgrade-plan --goal-id Gomittederrorin Markdown output.- After: both render
- error: <markdown_scalar(error)>directly after- ok: Falsewhenevererroris present, leaving successful output unchanged (unitandreal_entrypointrows below).main.Author Declaration
Implemented against
errorfield (as #9112 did forquota should-run).| Criterion (spec clause) | Disposition | Symbol / path | Test or command |
| --- | --- | --- | --- |
| A failed
diagnosecollection's Markdown includes the JSONerror| implemented |loopx/presentation/renderers/diagnose_markdown.py::render_diagnosis_markdown|tests/test_markdown_failure_reason.py|| A failed
upgrade-plancollection's Markdown includes the JSONerror| implemented |loopx/upgrade.py::render_upgrade_plan_markdown|tests/test_markdown_failure_reason.py|| Successful output is unchanged | implemented | line emitted only when
payload.get("error")is truthy | verified unchanged for healthy registered Goals |mainafter #9482 movedrender_diagnosis_markdowntoloopx/presentation/renderers/diagnose_markdown.py. Kept zeroAnyannotations, routed error text throughmarkdown_scalar, and verified bothdiagnoseandupgrade-plancorrupt-registry paths throughloopx.cli:main.Scope And Continuation
Validation
214d757cd| Check kind | Result | Public-safe evidence / limitation |
| --- | --- | --- |
|
unit|passed|tests/test_markdown_failure_reason.py(both commands fail on base and pass on214d757cd; verified on Python 3.13/3.14 prior to rebase and re-verified on214d757cdwith Python 3.15). ||
static|passed|py_compileandgit diff --checkclean on all 3 files. ||
real_entrypoint|passed|loopx.cli:mainfordiagnoseandupgrade-planagainst a corrupt registry emits- error: <json error>in Markdown; exit 1. |pytest/ruffwill also run on the PR.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
N/A
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses, or no paired RFC changed.none.Signed-off-bytrailer (git commit -s).