feat: migrate View 0.3.0 to marqdo 3.0.0-rc.4 contracts
ci/woodpecker/push/woodpecker Pipeline was successful

Replace the retired rc.2 Analysis v2/Trace v2/Execution Events v1 stack with the
single current contract family:

- Analysis v3 (ADR-0069 public boundary): one check --emit artifact carries the
  exact source, Markdown AST, heading scopes (heading_span + complete span),
  anchors, state-bearing references, calls, resources and diagnostics; the old
  revision-3 shape is rejected with a rebuild hint.
- Observation v1: one run/call --output jsonl stream (+ atomic
  --observation-file snapshot) decoded by one decoder and projected into the
  reader/SSE/export layers; stale/malformed/truncated/incomplete never render
  as success.
- CLI Tool revision 1: requires {api_revision:1, analysis:3, observation:1},
  product range >=3.0.0-rc.3,<4.0.0, only MARQDO_BIN and
  MARQDO_API_REVISION are consumed.
- Remove compatibility branches, retired flags/env vars and duplicate decoders;
  re-record Analysis v3 and Observation v1 fixtures; rewrite contract,
  integration and security tests (173 passing locally).
- Add check-no-legacy/check-docs/check-observation gates, rc.4 pins in the
  CI pipelines, 0.3.0 Tool bundle and evidence manifest support.

See issues #4, #5 and #6; acceptance baseline is CLI source
452e9a32bd9e40dba427d4180691c58bab74449e, archive
9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8.
This commit is contained in:
Marqdo View committed 2026-11-25 22:12:51 +08:00
1 parent 7b34199c96
commit 340ecb035f
108 files changed
+13928 -6461

No files matched your search

+18 -15
View File
@@ -26,21 +26,21 @@ impl Drop for TestServer {
}
/// Start the real `marqdo-view` binary on an OS-chosen loopback port with a
/// scripted fake Core. Golden Analysis must match the project's exact source.
/// scripted fake Core. The Analysis golden must match the project's exact source;
/// the optional Observation v1 goldens are the exact JSONL stream and snapshot of
/// one execution.
pub fn start(
project: &str,
analysis_golden: &str,
run_golden: Option<&str>,
trace_golden: Option<&str>,
observation_golden: Option<(&str, &str)>,
) -> TestServer {
start_with_env(project, analysis_golden, run_golden, trace_golden, &[])
start_with_env(project, analysis_golden, observation_golden, &[])
}
pub fn start_with_env(
project: &str,
analysis_golden: &str,
run_golden: Option<&str>,
trace_golden: Option<&str>,
observation_golden: Option<(&str, &str)>,
envs: &[(&str, &str)],
) -> TestServer {
use std::sync::atomic::{AtomicUsize, Ordering};
@@ -50,11 +50,11 @@ pub fn start_with_env(
let core = FakeCore::new(&format!("http-core-{seq}"));
let golden = std::fs::read(repo_root.join(analysis_golden)).unwrap();
core.set_analysis(std::str::from_utf8(&golden).unwrap());
if let Some(run_golden) = run_golden {
let run = std::fs::read_to_string(repo_root.join(run_golden)).unwrap();
let trace =
trace_golden.map(|trace| std::fs::read_to_string(repo_root.join(trace)).unwrap());
core.set_run(0, &run, trace.as_deref());
if let Some((jsonl_path, snapshot_path)) = observation_golden {
let jsonl = std::fs::read_to_string(repo_root.join(jsonl_path)).unwrap();
let snapshot = std::fs::read_to_string(repo_root.join(snapshot_path)).unwrap();
core.set_check_json(r#"{"command":"check","diagnostics":[],"errors":0,"success":true}"#);
core.set_observation(0, &jsonl, Some(&snapshot));
}
let mut command = Command::new(view_bin());
@@ -63,9 +63,7 @@ pub fn start_with_env(
.args([project, "--port", "0", "--no-open", "--marqdo-bin"])
.arg(&core.script)
.env_remove("MARQDO_BIN")
.env_remove("MARQDO_TOOL_PROTOCOL")
.env_remove("MARQDO_PROTOCOL_ANALYSIS")
.env_remove("MARQDO_PROTOCOL_TRACE")
.env_remove("MARQDO_API_REVISION")
.stdout(Stdio::null())
.stderr(Stdio::piped());
for (key, value) in envs {
@@ -404,7 +402,12 @@ pub fn collect_until_terminal(reader: &mut SseReader) -> Vec<SseFrame> {
.map(|state| {
matches!(
state,
"succeeded" | "failed" | "cancelled" | "timed_out" | "unavailable"
"succeeded"
| "failed"
| "cancelled"
| "timed_out"
| "unavailable"
| "incomplete"
)
})
.unwrap_or(false);