Publish native arity and validate callback contracts before registration
Verify Tessera GUI / verify (push) Failing after 7m44s

This commit is contained in:
2026-10-22 12:03:24 +08:00
parent 50422f801a
commit 25275b515c
17 changed files with 297 additions and 35 deletions
+12
View File
@@ -98,6 +98,10 @@ struct Step {
desktop: ObjectRef,
}
impl NativeCallable for Step {
fn arity(&self) -> Option<endor_core::CallArity> {
Some(endor_core::CallArity::exact(0))
}
fn invoke(&self, cx: &mut NativeContext<'_>, _: &[Value]) -> Result<NativeResult, VmError> {
let mount = cx.store().payload::<Mount>(self.mount, "Mount")?.clone();
let definition = cx
@@ -258,6 +262,10 @@ struct Collect {
desktop: ObjectRef,
}
impl NativeCallable for Collect {
fn arity(&self) -> Option<endor_core::CallArity> {
Some(endor_core::CallArity::exact(1))
}
fn invoke(&self, cx: &mut NativeContext<'_>, args: &[Value]) -> Result<NativeResult, VmError> {
let pending = if matches!(self.phase, Phase::Measure) {
self.plan
@@ -403,6 +411,10 @@ struct Prepare {
desktop: ObjectRef,
}
impl NativeCallable for Prepare {
fn arity(&self) -> Option<endor_core::CallArity> {
Some(endor_core::CallArity::exact(0))
}
fn invoke(&self, cx: &mut NativeContext<'_>, _: &[Value]) -> Result<NativeResult, VmError> {
let mut instructions = Vec::new();
let mut constants = Vec::new();