fix(cli): normalize strict failures to one JSON document
ci/woodpecker/push/woodpecker Pipeline was successful
CI / fmt + clippy + test (Linux x86_64) (push) Canceled after 0s
CI / schema instance validation + consumers (push) Canceled after 0s
CI / runtime contract (macos-latest) (push) Canceled after 0s
CI / runtime contract (windows-latest) (push) Canceled after 0s
CI / release candidate artifact (macos-latest) (push) Canceled after 0s
CI / release candidate artifact (ubuntu-latest) (push) Canceled after 0s

Capture the strict child through launch_strict_capture and classify the
outcome before writing anything. In --json mode a control-plane failure now
emits exactly one error document with a stable code instead of forwarding
bubblewrap stderr and leaving stdout empty; a verified child's valid JSON is
forwarded unchanged with its own exit code. Empty, partial or non-JSON child
output becomes strict.child_invalid.

Route the remaining run --json error paths (mode, grants, missing entry,
trace) through the same contract, classify sandbox launch failures with
StrictFailureKind so probe/spawn/timeout/resource failures stay
distinguishable, and add deterministic routing tests plus forged-marker CLI
coverage. Document the decision in ADR-0053 and spec/security.md 1.2.

This is step 2 of the CI/security RFC (B02/B03).
This commit is contained in:
cflmy committed 2026-11-21 16:46:27 +08:00
1 parent f4a404bae9
commit f817cceb3b
9 files changed
+634 -103

No files matched your search

+4 -2
View File
@@ -29,5 +29,7 @@ architecture; read them as decision history.
[`docs/architecture/CURRENT.md`](../architecture/CURRENT.md); for executed
status see [`docs/STATUS.md`](../STATUS.md).
Files: `0001`–`0050`, plus `0051-byte-exact-http-framing.md` (HTTP framing) and
`0052-unified-markdown-semantics.md` (current language mapping).
Files: `0001`–`0050`, plus `0051-byte-exact-http-framing.md` (HTTP framing),
`0052-unified-markdown-semantics.md` (current language mapping) and
`0053-strict-child-inspection-and-json-failure-contract.md` (strict CI/JSON
failure contract).