fix(cli): return safe structured scan failure details - #463
fix(cli): return safe structured scan failure details#463mldangelo-oai wants to merge 7 commits into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
# Conflicts: # sdk/typescript/src/cli.ts
|
@codex review Please review the current head, |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Return privacy-safe, machine-readable errors when scans or saved scan reruns fail in JSON or JSONL mode.
Addresses the structured-output request in #375.
Changes
SCAN_FAILEDandSCAN_REPLAY_UNAVAILABLEerror envelopes on structured stdout, including failures finding the latest completed scan.--full-outputenvelope shapes.Testing
bun test --timeout 30000 --only-failures tests-ts/runtime.test.ts tests-ts/knowledge-base.test.ts tests-ts/cli.test.ts tests-ts/cli-workbench.test.ts tests-ts/cli-publish.test.ts— 330 passed, 7 skipped, 0 failed, 3,691 assertions (Bun 1.3.14).bun test --timeout 30000 --only-failures tests-ts/api.test.ts --test-name-pattern 'validates knowledge-base documents before initializing the runtime|cleans up knowledge-base documents when a scan fails|attempts both preparation cleanups and preserves the preparation and cleanup failures'— 3 passed, 0 failed, 13 assertions.bun test --timeout 30000 --randomize --seed 12345 --only-failures ./tests-tswith JUnit reporting — 1,299 passed, 11 skipped, 0 failed, 9,500 assertions on301e5415(Bun 1.3.14). The first attempt failed the existing interactive-login cleanup test; that unchanged test passed in isolation, followed by a clean complete rerun with the same seed and original limits.pnpm run types— passed.pnpm exec prettier --check src/cli.ts src/knowledge-base.ts src/runtime.ts tests-ts/cli.test.ts tests-ts/knowledge-base.test.ts tests-ts/runtime.test.ts— passed.git diff 5d1afcd312933121e36dc892dcb12e8d2e3e1de3 HEAD --check— passed.Exact-head source rereview, three native code-review passes, and a separate source verifier found no remaining issues at
301e54159886185274b956d18ac84756477100cc. Fresh pushed-head standard SDK, cross-platform, and package CI remain pending.Risk and rollout
Structured scan failures now return a safe error envelope instead of empty stdout. They remain complete and parseable when token-count or truncation flags are supplied; successful-result and discovery formatting are unchanged. Local knowledge-base and plugin setup errors use the existing
ConfigurationErrortype, with underlying failures available throughcause; installer errors are unchanged. Detailed stderr may still contain local diagnostic context. This does not change scan execution, model moderation, refusal policy, account permissions, or partial-result sealing.Public disclosure review
Newly authored material was reviewed for public disclosure. Existing automated review comments contain access-restricted report references; maintainer cleanup remains outstanding.