enum Lispex Preparation Error { Source(Lispex Boundary Report), Admission(Lispex Boundary Report), Interrupted(Lispex Operational Fault), Engine Defect(Lispex Boundary Report) }- Модуль
- std.
lispex → - Получатель
- Неприменимо
- Минимальное число аргументов
- 0
- Максимальное число аргументов
- 0
Declaration and parameters
СсылкаДоступность
Включено по умолчанию · Нет
Import std.lispex from an application package with a verified lock. Packages with [lispex] require --locked. Application profile topaz/ uses evaluator profile lispex/. Application profile topaz/ uses evaluator profile lispex/.
The generated-module resolver gate starts at language mode 5.18. Compatibility of this API with earlier released editions remains Pending. Target deployment conditions are native (native-only), web (web-isolated-workers), web- (web-isolated-workers). Runtime payload follows checker-reached rules. An empty reached-rule set includes no runtime payload. Application quotas are required. Lock-only packages do not receive these application modules.
Получатель
Ограничения параметров
LispexSource contains name: string and source: Bytes, corresponding to Lispex ModuleSource. LispexSourceBundle contains modules: Array<LispexSource> and root: string. The encoder supplies format = lispex.source-bundle/2 in canonical SourceBundleBytes. It preserves every submitted source octet. Input values follow collection value semantics.
name and root contain decoded Identifier scalars. Empty names are permitted. Preserve case and Unicode normalization. Bars and source escapes are absent from these string fields. These identifiers are not filesystem paths. Before encoding, the typed caller sorts modules in nondecreasing unsigned UTF-8 byte order by name. It preserves equal names for the existing duplicate module check.
root is required even for one module. A missing root field is a malformed SourceBundle. A present root with no matching supplied module fails the existing missing-module preparation check. The Lispex bundle contract owns the byte representation.
The root module source selects its entry with an entry declaration. The declared identifier must name a public export. Preparation checks the export, its resolved lambda initializer after shorthand normalization, and acceptance of one argument, in that order. Imported and reexported bindings are checked at their original declaration. Dependency entry declarations are validated but not invoked. No export is an implicit entry and the host cannot override the declaration. The Lispex entry rules own these checks.
prepare accepts an admitted package, the complete source snapshot and LispexPreparationLimits. Validate required finite limits before source processing. The Lispex module preparation order governs name-table, duplicate, root membership, fixed library, decode, read, normalize, declaration-name, imports, cycles, resolution and entry failures. Every supplied module participates. Preparation performs no dependency lookup or file access.
Preparation consumes its own work, cumulative allocation, semantic frames, source input, prepared result and diagnostic channels. It never borrows evaluation or profile work limits. A source, normalization, entry or preparation resource failure returns LispexPreparationError.Source with a source bound report.
Missing admitted package or prepared-artifact dependencies and unsupported components return Admission. A missing source import target remains a Source failure under the Lispex preparation rules. Host cancellation, deadline and physical safety interruption return Interrupted. An engine invariant failure returns EngineDefect. The original first failure remains visible and no failed preparation yields a PreparedLispexRule.
A successful PreparedLispexRule seals the verified program, selected entry, dependency identities, semantic contracts and prepared artifact. Reusing it starts each evaluation with a fresh evaluation budget and fresh guest state. Preparation performs no guest computation. Required guest and module initialization belongs to each evaluation.
admitPrepared accepts transported bytes, an admitted package and finite preparation limits. Validate the container, exact integrity, interface, code and dependency identities, supported contracts and declared resource envelope before returning the same rule type. Previously prepared bytes are untrusted at a new boundary.
Transport validation verifies program, artifact and dependency identities from supplied material. Source provenance is optional for a supported source free artifact. inspectRule reports source as None unless exact source bytes and their program binding are verified under the supported format. A claimed source digest or signature alone is not verified provenance.
preparedBytes returns the immutable representation already reserved within the preparation result channel. It performs no new serialization, preparation or guest evaluation. Its size cannot escape the limit used to obtain the rule.
A warm preparation cache may change preparation work and its acceptance under the supplied preparation budget. Reuse still validates the cached contract and complete supplied inputs. It never increases an evaluation budget or changes evaluation charges or outcomes.
A source bound preparation report has no canonical evaluation outcome or evaluation receipt. Preserve source bytes and preparation contract when reproducing preparation. Exact evaluation replay additionally needs the complete evaluation request.
Связанное правило · Prepare closed source and revalidate transported rules →Результат
Эффекты
Ошибки
Result and effects
СсылкаSeparate source preparation failure from admission and host failure.
Why
СсылкаThe preparation contract gives this operation one explicit input boundary and preserves the distinct result and failure cases.
Related entries
СсылкаPrepare closed source and revalidate transported rules
СсылкаPrepare closed source and revalidate transported rules
LispexSource contains name: string and source: Bytes, corresponding to Lispex ModuleSource. LispexSourceBundle contains modules: Array<LispexSource> and root: string. The encoder supplies format = lispex.source-bundle/2 in canonical SourceBundleBytes. It preserves every submitted source octet. Input values follow collection value semantics.
name and root contain decoded Identifier scalars. Empty names are permitted. Preserve case and Unicode normalization. Bars and source escapes are absent from these string fields. These identifiers are not filesystem paths. Before encoding, the typed caller sorts modules in nondecreasing unsigned UTF-8 byte order by name. It preserves equal names for the existing duplicate module check.
root is required even for one module. A missing root field is a malformed SourceBundle. A present root with no matching supplied module fails the existing missing-module preparation check. The Lispex bundle contract owns the byte representation.
The root module source selects its entry with an entry declaration. The declared identifier must name a public export. Preparation checks the export, its resolved lambda initializer after shorthand normalization, and acceptance of one argument, in that order. Imported and reexported bindings are checked at their original declaration. Dependency entry declarations are validated but not invoked. No export is an implicit entry and the host cannot override the declaration. The Lispex entry rules own these checks.
prepare accepts an admitted package, the complete source snapshot and LispexPreparationLimits. Validate required finite limits before source processing. The Lispex module preparation order governs name-table, duplicate, root membership, fixed library, decode, read, normalize, declaration-name, imports, cycles, resolution and entry failures. Every supplied module participates. Preparation performs no dependency lookup or file access.
Preparation consumes its own work, cumulative allocation, semantic frames, source input, prepared result and diagnostic channels. It never borrows evaluation or profile work limits. A source, normalization, entry or preparation resource failure returns LispexPreparationError.Source with a source bound report.
Missing admitted package or prepared-artifact dependencies and unsupported components return Admission. A missing source import target remains a Source failure under the Lispex preparation rules. Host cancellation, deadline and physical safety interruption return Interrupted. An engine invariant failure returns EngineDefect. The original first failure remains visible and no failed preparation yields a PreparedLispexRule.
A successful PreparedLispexRule seals the verified program, selected entry, dependency identities, semantic contracts and prepared artifact. Reusing it starts each evaluation with a fresh evaluation budget and fresh guest state. Preparation performs no guest computation. Required guest and module initialization belongs to each evaluation.
admitPrepared accepts transported bytes, an admitted package and finite preparation limits. Validate the container, exact integrity, interface, code and dependency identities, supported contracts and declared resource envelope before returning the same rule type. Previously prepared bytes are untrusted at a new boundary.
Transport validation verifies program, artifact and dependency identities from supplied material. Source provenance is optional for a supported source free artifact. inspectRule reports source as None unless exact source bytes and their program binding are verified under the supported format. A claimed source digest or signature alone is not verified provenance.
preparedBytes returns the immutable representation already reserved within the preparation result channel. It performs no new serialization, preparation or guest evaluation. Its size cannot escape the limit used to obtain the rule.
A warm preparation cache may change preparation work and its acceptance under the supplied preparation budget. Reuse still validates the cached contract and complete supplied inputs. It never increases an evaluation budget or changes evaluation charges or outcomes.
A source bound preparation report has no canonical evaluation outcome or evaluation receipt. Preserve source bytes and preparation contract when reproducing preparation. Exact evaluation replay additionally needs the complete evaluation request.
Причина
Preparing supplied source and admitting transported code cross different trust boundaries. Both yield the same verified rule type after bounded validation. An explicit root and its source entry declaration fix the program boundary. Immutable rules support repeated reproducible evaluation.
Prepare source and revalidate transported bytes
Ссылкаimport std.bytes { Bytes }import std.lispex {LispexPackage,LispexSourceBundle,LispexPreparationLimits,PreparedLispexRule,LispexPreparationError,prepare,preparedBytes,admitPrepared,}function transport(package: LispexPackage, bundle: LispexSourceBundle, limits: LispexPreparationLimits) -> Result<PreparedLispexRule, LispexPreparationError> {let prepared: Result<PreparedLispexRule, LispexPreparationError> = prepare(package, bundle, limits)let rule: PreparedLispexRule = prepared?let bytes: Bytes = preparedBytes(rule)return admitPrepared(package, bytes, limits)}export function main(args: Array<string>, stdin: string) -> Result<int, string> {return Ok(0)}
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.
Use a verified Lispex application package supplied through TOPAZ_LISPEX_APPLICATION. This example specifies the Lispex 2.0 behavior. The product scope remains the public 5.21.3 observation scope.