From ac3777882c1994141df337aa4c5986e30651b1c4 Mon Sep 17 00:00:00 2001 From: cflmy Date: Wed, 18 Nov 2026 12:38:24 +0800 Subject: [PATCH] feat(cli): add marqdo knowledge proof-deps --strict for machine-checkable modular proof obligations --- src/main.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/main.rs b/src/main.rs index c79d362..cb9e7a9 100755 --- a/src/main.rs +++ b/src/main.rs @@ -609,6 +609,12 @@ enum ProveAction { enum KnowledgeAction { /// Compile L0–L4 projections (default) Compile, + /// Inspect verified theorem receipts and inter-module proof obligations. + ProofDeps { + /// Fail if the receipt/contract graph contains unresolved obligations. + #[arg(long)] + strict: bool, + }, /// Inspect stable project symbols by exact URI or display name Inspect { /// Symbol URI (`mq://…`) or declaration name @@ -1769,6 +1775,27 @@ fn try_main(cli: Cli) -> Result { write_knowledge(KnowledgeOptions { path, out_dir: out })?; Ok(0) } + KnowledgeAction::ProofDeps { strict } => { + let semantic_root=if path.is_file() { + path.parent().unwrap_or_else(|| std::path::Path::new(".")).to_path_buf() + } else {path.clone()}; + let compiled=marqdo::sema::ir::compile_project( + &marqdo::sema::ir::CompileOptions { + project_root:semantic_root, + entry:path.is_file().then_some(path), + lock_mode:marqdo::sema::ir::LockMode::Off, + })?; + let receipts=marqdo::knowledge::proof::index_links( + &out.join("prove"),&compiled.semantics); + let report=marqdo::knowledge::modular::analyze( + &compiled.semantics,&receipts); + if json { + println!("{report}"); + } else { + println!("{}",serde_json::to_string_pretty(&report)?); + } + Ok(if strict && report["audit_passes"]!=true {2} else {0}) + } KnowledgeAction::Inspect { symbol } => { // A supplied directory is an explicit compilation scope; // a supplied file inherits the nearest project boundary.