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

+2
View File
@@ -10,6 +10,8 @@ examples/plugin-multi-export/solver.so
# Local cargo home used on hosts with a read-only $HOME
.cargo-home/
# Local rustup home used for cross-target `cargo check` verification
.rustup-home/
# Generated plugin fixture manifests/artifacts
examples/plugin-demo/build/