analysis: project document and program facts through one typed encoder

Replace the program-only projection with ADR-0069's typed model: exact source
and digest, the public document AST, complete heading scopes with parent/mode
origin/range, anchors, functions, imports, references, calls and resources.
Project identity now carries the entry, captured manifest/lock digests, stdlib
and the static extension identities that participated in preparation. Run and
call bind Observation to the same canonical bytes, inspect reuses the same AST,
unit and reference projectors, and the retired duplicate link resolver is
deleted. Emit refuses to overwrite inputs, directories, symlinks or hard links
and publishes through an owner-only exclusive temporary file.
This commit is contained in:
cflmy committed 2026-11-25 10:12:07 +08:00
1 parent 1b214d48da
commit 99789616a4
12 files changed
+2017 -915

No files matched your search

+3 -2
View File
@@ -663,7 +663,7 @@ fn inspect_outputs_ast_units_signatures_ir_and_refs() {
assert_exit(&refs, 0, "inspect --refs");
let value = json_stdout(&refs);
let edges = value["refs"].as_array().expect("refs array");
assert!(edges.iter().any(|edge| edge["resolved"] == true));
assert!(edges.iter().any(|edge| edge["state"] == "resolved"));
// A broken #anchor is reported as unresolved by `inspect --refs`.
let dir = TempDir::new("refs");
@@ -677,7 +677,8 @@ fn inspect_outputs_ast_units_signatures_ir_and_refs() {
let edges = value["refs"].as_array().expect("refs array");
assert_eq!(edges.len(), 1);
assert_eq!(edges[0]["url"], "#不存在的标题");
assert_eq!(edges[0]["resolved"], false);
assert_eq!(edges[0]["state"], "missing");
assert_eq!(edges[0]["target_unit"], serde_json::Value::Null);
}
#[test]