docs: make the current contracts describe the binary that exists
- spec/security.md: replace the retired --json/EffectTrace/--trace-file sections with the current strict output contract (text or one snapshot from the verified child, live/file destinations refused) and Observation effect events; drop the deleted trace.rs implementation row. - spec/package-format.md, spec/value-wire.md, spec/evaluation.md, spec/resource-provider-v2.md, spec/foreign.md: describe the current --output/--observation-file and Observation events instead of run/call --json and Execution Events. - spec/analysis.md: a load failure removes the previous artifact, not only a compile error. - COMPATIBILITY.md and docs/developers/*: current axes are Analysis v3, Observation v1 and CLI Tool revision 1; Rust 1.89; rc.3 candidate status. - Fix the Analysis v2 / Trace v2 / trace-file references in README, architecture overview, contributor guide, tool example, source comments and AGENTS.md. - Add a docs-consistency gate that fails when spec/ or the current developer guides document a retired interface or a deleted spec path.
This commit is contained in:
1 parent
682eae82b6
commit
d11b261aca
19 files changed
+196
-117
No files matched your search
@@ -238,7 +238,7 @@ fn function_json(function: &Function) -> Value {
|
||||
|
||||
/// Project an assignment place. Local targets keep the v1 string form; the new
|
||||
/// index target is an additive object so existing consumers that compare the
|
||||
/// local `target` string are unaffected (Analysis v2, ADR-0022).
|
||||
/// local `target` string are unaffected (Analysis v3, ADR-0022).
|
||||
fn place_json(place: &PlaceTarget) -> Value {
|
||||
match place {
|
||||
PlaceTarget::Local { name, .. } => Value::String(name.clone()),
|
||||
|
||||
@@ -231,3 +231,72 @@ fn ci_configuration_uses_only_current_protocols() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The current contract documents must describe the interface that exists.
|
||||
/// A retired option or a path to a deleted spec in `spec/` or the current
|
||||
/// developer guides is a release-record defect: consumers would implement a
|
||||
/// contract the binary does not accept. Historical ADRs, evidence and
|
||||
/// `docs/history/` keep their original text and are intentionally excluded.
|
||||
#[test]
|
||||
fn current_contract_documents_do_not_reference_retired_interfaces() {
|
||||
let root = repo_root();
|
||||
let mut files = vec![
|
||||
"COMPATIBILITY.md".to_string(),
|
||||
"README.md".to_string(),
|
||||
"docs/ci.md".to_string(),
|
||||
"docs/architecture/CURRENT.md".to_string(),
|
||||
];
|
||||
for directory in ["spec", "docs/developers", "examples"] {
|
||||
let base = root.join(directory);
|
||||
let mut stack = vec![base];
|
||||
while let Some(path) = stack.pop() {
|
||||
for entry in std::fs::read_dir(&path).expect("read contract docs") {
|
||||
let path = entry.unwrap().path();
|
||||
if path.is_dir() {
|
||||
stack.push(path);
|
||||
} else if path.extension().and_then(|ext| ext.to_str()) == Some("md") {
|
||||
files.push(
|
||||
path.strip_prefix(&root)
|
||||
.unwrap()
|
||||
.to_string_lossy()
|
||||
.to_string(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let retired = [
|
||||
"--trace-file",
|
||||
"--event-stream",
|
||||
"EffectTrace",
|
||||
"crates/marqdo-host/src/trace.rs",
|
||||
"spec/trace-v1.md",
|
||||
"spec/trace-v2.md",
|
||||
"spec/execution-events-v1.md",
|
||||
"spec/analysis-v1.md",
|
||||
"spec/analysis-v2.md",
|
||||
"spec/tool-v1.md",
|
||||
"worker_frame_invalid for an over-limit",
|
||||
];
|
||||
for relative in files {
|
||||
let text = read(&root.join(&relative));
|
||||
for (number, line) in text.lines().enumerate() {
|
||||
for token in retired {
|
||||
if !line.contains(token) {
|
||||
continue;
|
||||
}
|
||||
// A sentence that explicitly marks the interface as retired or
|
||||
// removed is documentation of the migration, not a claim that
|
||||
// it is available.
|
||||
let explained = line.contains("retired")
|
||||
|| line.contains("removed")
|
||||
|| line.contains("no longer");
|
||||
assert!(
|
||||
explained,
|
||||
"{relative}:{} still documents retired `{token}`",
|
||||
number + 1
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user