feat(PR-06): one-command frozen-CLI acceptance, evidence and final docs

- tools/acceptance.sh: RFC §18.1 end-to-end acceptance against the frozen CLI
  release archive in an isolated tool home (build/test/bundle/archive-install/
  view help/verify/export/browse/explicit CSRF run/export+security+browser
  suites/CLI SHA check) and generation of docs/evidence/<CLI-SHA>/manifest.json
- tools/test-contract.sh + .woodpecker.yml CI lanes (remote CI unverified)
- docs/ACCEPTANCE.md gate table (P0 all PASS; U-01/U-04 honestly PARTIAL),
  docs/audits/protocol-conformance.md, ADR-0006 documented RFC deviations
- unicode/CRLF/duplicate-text examples + frozen goldens + tests (S-04)
- presentation degradation matrix tests (S-05..S-07), hostile-stdout escaping
  test (X-05), keyboard accessibility browser checks (U-03)
- final README/STATUS/COMPATIBILITY/CHANGELOG with honest limitations
This commit is contained in:
marqdo-view dev committed 2026-11-22 12:06:45 +08:00
1 parent 1f34daffb0
commit d641ca58ac
21 files changed
+1562 -70

No files matched your search

+29
View File
@@ -509,6 +509,35 @@ fn failed_run_reports_core_error_code_without_fake_success() {
assert!(!page.contains("data-run-state=\"succeeded\""));
}
#[test]
fn program_stdout_is_escaped_not_injected_as_markup() {
let tmp = std::path::PathBuf::from(env!("CARGO_TARGET_TMPDIR")).join(format!(
"hostile-stdout-{}-{}.json",
std::process::id(),
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.map(|d| d.as_nanos())
.unwrap_or(0)
));
std::fs::write(
&tmp,
r#"{"command":"run","success":true,"stdout":"<script>alert(1)</script>","stderr":"<img src=x onerror=alert(2)>","trace":[],"value":{"type":"int","decimal":"3"}}"#,
)
.unwrap();
let server = start_server_with(
"examples/control-flow",
"tests/golden/analysis-v2/control-flow.json",
Some(tmp.to_str().unwrap()),
Some("tests/golden/trace-v2/control-flow.trace.json"),
);
let (_, page) = run_and_get_page(&server);
assert!(page.contains("&lt;script&gt;alert(1)&lt;/script&gt;"));
assert!(!page.contains("<script>alert(1)"));
assert!(!page.contains("onerror=\""));
assert!(!page.contains("<img src=x"));
let _ = std::fs::remove_file(&tmp);
}
#[test]
fn cli_verify_output_contract_still_holds_for_installed_style_invocation() {
// Regression guard: `view verify` must remain a pure static check.