Track conservative source effect proofs in GUI contracts

This commit is contained in:
2026-10-22 15:41:17 +08:00
parent b2fe392ddb
commit 666fd2d973
4 changed files with 70 additions and 4 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
| main.rs | Native window event loop, namespace state and API startup |
| api.rs | Code CRUD, live Console/reset and compatibility evaluation endpoints, worker-owned session, request observation, coalesced native viewport/background-task updates, epoch checks, stale source/destination tab-drop rejection and diagnostics |
| activity.rs | Bounded in-memory HTTP exchanges with marked previews and allowlisted request headers |
| endor_host.rs | Aster compilation, fresh PUT candidates retained after successful publication, shared Console/program VM, asynchronous completion/fault boundaries, bounded execution, root cleanup and AST developer tree for function/class/member assignment nodes |
| endor_host.rs | Aster compilation, fresh PUT candidates retained after successful publication, shared Console/program VM, asynchronous completion/fault boundaries, bounded execution, conservative compiled source effect query coverage, root cleanup and AST developer tree for function/class/member assignment nodes |
| endor_script.rs | Batch complete inputs for Aster's Interactive parser/compiler, retain Module entry, and rebase Aster spans to the original snapshot |
| ui_bridge.rs | Inheritable native nominal constructors with source fields, shared type method tables and bound receiver dispatch, configured unified Function classification and source/field/override checks with deferred typed public/native constructor signatures and split option/field preflight plus shared native arity intervals plus resolved types/unions/effects on methods, tab registry, stable-slot insertion, source-dispatched tab reorder/drop and callback registration checks, Page lifecycle/navigation and immutable frame extraction |
| binding.rs | Target-owned managed property bindings, weak Subscription tokens, zero-argument callback preflight, read-only compute and borrowed dependency/output caches |
+64
View File
@@ -3938,6 +3938,70 @@ page.render(block)
);
}
#[test]
fn source_effect_queries_use_compiled_instructions_without_running_functions() {
let mut session = ReplSession::new(234).unwrap();
session
.execute(
r#"
function simple(value: Number): Number { return value }
function forward(value: Number): Number { return simple(value) }
class ReadOnlyModel {
function check(self: ReadOnlyModel, value: Number): Number { return value }
}
model = ReadOnlyModel()
"#,
"app.main",
)
.unwrap();
let globals = session.candidate.globals.unwrap();
for (name, expected) in [
("simple", Some(endor_core::CallEffect::ReadOnly)),
("forward", None),
] {
let Value::Object(function) = session
.candidate
.vm
.dict_get(globals, &Value::Text(name.into()))
.unwrap()
.unwrap()
else {
panic!("function")
};
assert_eq!(
session
.candidate
.vm
.object_store()
.call_effect(function)
.unwrap(),
expected
);
}
let Value::Object(model) = session
.candidate
.vm
.dict_get(globals, &Value::Text("model".into()))
.unwrap()
.unwrap()
else {
panic!("model")
};
let Value::Object(bound) = session.candidate.vm.bind_attr(model, "check").unwrap() else {
panic!("bound")
};
assert_eq!(
session
.candidate
.vm
.object_store()
.call_effect(bound)
.unwrap(),
Some(endor_core::CallEffect::ReadOnly)
);
session.candidate.vm.release(bound).unwrap();
}
#[test]
fn typed_method_shadows_invalidate_cached_ancestors_and_can_be_removed() {
let mut session = ReplSession::new(233).unwrap();