docs: specify contract runtime continuations and failure context

This commit is contained in:
dev committed 2026-10-09 18:27:55 +03:00
1 parent 2db752dba9
commit c633f23952
6 files changed
+454 -1

No files matched your search

@@ -39,6 +39,8 @@ The callback can perform ordinary multi-field updates and use disjoint fields in
Successful callback completion is not yet successful update completion. Predicate false, callback/predicate traps or fuel exhaustion publish no checked result. Failure traps with no rollback of state or external effects. Pending borrow-free results, including linear ones, must be retained and traced until validation finishes. Candidate fuel accounting is one unit for the make/modify operation, then ordinary helper instructions, with no synthetic callback-to-predicate instruction. Callback and predicate use normal call frames, sequentially; the callback frame ends before the predicate starts. Exact dispatch, temporary-view and trap rules still require RFC integration and tests. Checking after a callback must use a legal shared view after its exclusive loan has ended, not privileged access through a frozen ancestor.
The [runtime/context candidate](contract-runtime-and-context.md) now supplies concrete continuation, last-fuel, publication, depth/quantum, GC-root and failure-location rules for this sequence. Its executed evidence is ordinary calls/returns/traps, not checked updates. New callback/predicate transitions, pending linear results and context mapping still require normative adoption and vertical implementation/tests.
Candidate source surface is an explicit API under type.checked: a shared `ref raw = type.checked.view(parent)` binding, `type.checked.make::<R, fn p>`/`type.checked.take`, and `type.checked.modify::<fn update>(parent, args...)` on a named exclusive binding. Callback specialization uses existing static function identity, not a runtime function value. The module/source refinement gives grammar and clause-root rules; diagnostics and any later scoped block form still need integration. A block form must specify captures and effects before adoption.
## Stability is stronger than purity