Ship oracle journal values, bytecode/frontend hardening, and replay-policy Lean.
Host exposes oracle journals as language values with refuse/copy gates; bytecode and foreign session paths get modularized; applications and verification replay-policy sources land with Lake builds ignored. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e3d9021bb6
commit
8f1010f967
101 files changed
+17962
-1727
No files matched your search
+20
-4
@@ -128,20 +128,20 @@ fn instance_type_name(v: &Value) -> Option<String> {
|
||||
})
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct ParamContract {
|
||||
pub name: String,
|
||||
pub ty: Ty,
|
||||
pub desc: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct ReturnContract {
|
||||
pub ty: Ty,
|
||||
pub desc: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct FieldContract {
|
||||
pub name: String,
|
||||
pub ty: Ty,
|
||||
@@ -150,7 +150,7 @@ pub struct FieldContract {
|
||||
}
|
||||
|
||||
/// 一份契约(一个契约表块;同单元多表由 [`merge_contract`] 合并)。
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Contract {
|
||||
pub params: Vec<ParamContract>,
|
||||
pub returns: Option<ReturnContract>,
|
||||
@@ -505,6 +505,22 @@ pub fn call_arg_diag(
|
||||
None
|
||||
}
|
||||
|
||||
/// Argument blame belongs to the caller; contract evidence belongs to the
|
||||
/// declaration. Import aliases must not relocate a contract into the caller.
|
||||
pub fn call_arg_diag_in(
|
||||
c: &Contract, unit: &str, bound: &HashMap<String, Value>,
|
||||
call_site: &crate::diagnostics::SourceLocation,
|
||||
declaration: &crate::diagnostics::SourceIdentity,
|
||||
) -> Option<Diagnostic> {
|
||||
let mut diag=call_arg_diag(c,unit,bound,call_site.source.path.as_deref(),call_site.span)?
|
||||
.with_source(&call_site.source);
|
||||
let old=c.anchor(call_site.source.path.as_deref());
|
||||
let new=c.anchor(declaration.path.as_deref());
|
||||
diag.doc_anchor=Some(new.clone());
|
||||
diag.suggestion=diag.suggestion.map(|text|text.replace(&old,&new));
|
||||
Some(diag)
|
||||
}
|
||||
|
||||
/// 边界 2:返回值 vs 返回契约。
|
||||
pub fn return_diag(
|
||||
c: &Contract,
|
||||
|
||||
Reference in new issue
Block a user