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

+39 -6
View File
@@ -200,13 +200,30 @@ fn build_site(
let mut manifest = serde_json::json!({
"schema": MANIFEST_SCHEMA,
"schema_version": 1,
"view": {"name": "marqdo-view", "version": env!("CARGO_PKG_VERSION")},
"compatibility": {
"view": {
"name": "marqdo-view",
"version": env!("CARGO_PKG_VERSION"),
"binary_sha256": current_view_sha256(),
},
"producers": {
"view": {
"name": "marqdo-view",
"version": env!("CARGO_PKG_VERSION"),
"binary_sha256": current_view_sha256(),
},
"cli": match context.core() {
Some(core) => serde_json::json!({
"version": entry_model.core_version,
"binary_sha256": sha256_file(core.bin()),
}),
None => serde_json::Value::Null,
},
},
"requires": {
"marqdo": crate::protocol::tool_v1::PRODUCT_RANGE,
"tool_protocol": crate::protocol::tool_v1::TOOL_PROTOCOL,
"analysis": crate::protocol::tool_v1::ANALYSIS_PROTOCOL,
"analysis_supported": crate::protocol::tool_v1::ANALYSIS_PROTOCOLS,
"trace": crate::protocol::tool_v1::TRACE_PROTOCOL,
"api_revision": crate::protocol::tool_v1::API_REVISION,
"analysis": crate::protocol::tool_v1::ANALYSIS_REVISION,
"observation": crate::protocol::tool_v1::OBSERVATION_REVISION,
"markdown_profile": "marqdo.md.v1",
},
"core_version": entry_model.core_version,
@@ -240,6 +257,22 @@ fn build_site(
})
}
/// Lowercase hex SHA-256 of the running View executable, used to bind the
/// exported manifest to the exact producer binary. Never a machine path.
fn current_view_sha256() -> String {
let Ok(exe) = std::env::current_exe() else {
return "unavailable".to_string();
};
sha256_file(&exe)
}
fn sha256_file(path: &std::path::Path) -> String {
match std::fs::read(path) {
Ok(bytes) => sha256_hex(&bytes),
Err(_) => "unavailable".to_string(),
}
}
pub struct SnapshotArchive {
pub file: std::fs::File,
pub len: usize,