{rule Name}(limits: Lispex Preparation Limits) - > Result<Prepared Lispex Rule, Lispex Preparation Error>- Module
- std.
lispex. rules - Receiver
- Not applicable
- Minimum arity
- 1
- Maximum arity
- 1
Declaration and parameters
LinkAvailability
Included by default: no
Import std.lispex.rules 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.
Source evidence
- compiler/crates/topaz_lispex_product/src/lib.rs at
b48527d0a174· 202 - compiler/crates/topaz_lispex_product/src/lib.rs at
b48527d0a174· 202 - compiler/crates/topaz_lispex_product/src/lib.rs at
b48527d0a174· 202 - compiler/crates/topaz_resolve/src/lib.rs at
b48527d0a174· 801 - compiler/crates/topaz_cli/src/package/target.rs at
b48527d0a174· 71 - compiler/crates/topaz_value/src/lispex_application.rs at
b48527d0a174· 11 - compiler/crates/topaz_lispex_product/src/lib.rs at
b48527d0a174· 739 - compiler/crates/topaz_lispex_product/src/full_product.rs at
b48527d0a174· 44 - compiler/crates/topaz_lispex_product/src/lib.rs at
b48527d0a174· 634 - compiler/crates/topaz_lispex_product/src/lib.rs at
b48527d0a174· 496 - compiler/crates/topaz_lispex_product/src/full_product.rs at
b48527d0a174· 356
Receiver
Parameter constraints
std.lispex.rules exports one factory for each rule binding declared by the admitted application lock. The spelling is the exact Topaz identifier in that row. The placeholder ruleName is descriptive and is not a literal universal export.
Reject missing, duplicate, invalid or colliding exported identifiers during package admission. Generated names do not depend on directory enumeration, source discovery, a network request or a mutable global registry.
Each factory accepts one complete LispexPreparationLimits record and returns Result of PreparedLispexRule or LispexPreparationError. Validate limits before preparing source or validating transported bytes. The factory has no zero argument or unlimited path.
The lock row fixes the source closure, selected entry, prepared artifact policy, evaluator and standard library identities, ABI, codec, language and Unicode contracts, profile and resource model. An installed mismatch refuses admission. Never silently replace a locked component.
A row containing closed source follows prepare. A row containing a transported prepared representation follows admitPrepared. Both paths must yield the same verified program and selected entry promised by the row and preserve the supplied preparation limits.
Repeated calls may share an immutable rule handle. Sharing and caching preserve the verified canonical program identity and evaluation charges. Preparation reuse may change preparation work and acceptance under its supplied budget. Each later evaluate call starts with its own explicit evaluation limits.
Factory failure preserves the same Source, Admission, Interrupted or EngineDefect case as the underlying operation. It creates no canonical evaluation outcome and no evaluation receipt. An unrelated unreached factory cannot alter a reached rule result.
A returned rule is evaluated through std.lispex.evaluate or evaluateWithEvidence. The factory does not evaluate a hidden input, return a business decision or grant a second host callback path.
A package example supplies a real verified lock through the product test fixture. Concrete generated names are package data. Their inventory is determined by that lock and is not an unresolved language behavior.
Related rule: Resolve generated factories through the admitted lockResult
The declared result type is Result<Prepared.
Effects
Failures
Result and effects
LinkObtain the locked rule through the same bounded preparation or admission contract.
Why
LinkThe factories contract gives this operation one explicit input boundary and preserves the distinct result and failure cases.
Resolved contracts
LinkRelated entries
LinkResolve generated factories through the admitted lock
LinkResolve generated factories through the admitted lock
std.lispex.rules exports one factory for each rule binding declared by the admitted application lock. The spelling is the exact Topaz identifier in that row. The placeholder ruleName is descriptive and is not a literal universal export.
Reject missing, duplicate, invalid or colliding exported identifiers during package admission. Generated names do not depend on directory enumeration, source discovery, a network request or a mutable global registry.
Each factory accepts one complete LispexPreparationLimits record and returns Result of PreparedLispexRule or LispexPreparationError. Validate limits before preparing source or validating transported bytes. The factory has no zero argument or unlimited path.
The lock row fixes the source closure, selected entry, prepared artifact policy, evaluator and standard library identities, ABI, codec, language and Unicode contracts, profile and resource model. An installed mismatch refuses admission. Never silently replace a locked component.
A row containing closed source follows prepare. A row containing a transported prepared representation follows admitPrepared. Both paths must yield the same verified program and selected entry promised by the row and preserve the supplied preparation limits.
Repeated calls may share an immutable rule handle. Sharing and caching preserve the verified canonical program identity and evaluation charges. Preparation reuse may change preparation work and acceptance under its supplied budget. Each later evaluate call starts with its own explicit evaluation limits.
Factory failure preserves the same Source, Admission, Interrupted or EngineDefect case as the underlying operation. It creates no canonical evaluation outcome and no evaluation receipt. An unrelated unreached factory cannot alter a reached rule result.
A returned rule is evaluated through std.lispex.evaluate or evaluateWithEvidence. The factory does not evaluate a hidden input, return a business decision or grant a second host callback path.
A package example supplies a real verified lock through the product test fixture. Concrete generated names are package data. Their inventory is determined by that lock and is not an unresolved language behavior.
Why
A generated factory expresses the intention to select a deployment choice already fixed in a verified lock. prepare expresses the intention to submit a new closed bundle. Their shared result and execution contract preserve both intentions without two evaluator semantics.
Source evidence
- docs/content-next/en/embedding.json at
f455ac95ab30· 1 - docs/content-next/en/resources.json at
f455ac95ab30· 1 - docs/content-next/en/receipt-and-replay.json at
f455ac95ab30· 1 -
topaz.stdlib.contract.lispex-factoriesatworking-tree - topaz.decision.lispex-v2-factories.1 at
topaz.decisi
Use a factory name supplied by a verified lock
Linkimport std.lispex { PreparedLispexRule, LispexPreparationError, LispexPreparationLimits }import std.lispex.rules { identity }function lockedRule(limits: LispexPreparationLimits) -> Result<PreparedLispexRule, LispexPreparationError> {return identity(limits)}export function main(args: Array<string>, stdin: string) -> Result<int, string> {return Ok(0)}
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 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. The supplied fixture lock must declare identity as the exported name of its closed identity rule. That name is fixture data rather than a universal module export.
Source evidence
- docs/content-next/en/embedding.json at
f455ac95ab30· 1 - docs/content-next/en/resources.json at
f455ac95ab30· 1 - docs/content-next/en/receipt-and-replay.json at
f455ac95ab30· 1 -
topaz.stdlib.contract.lispex-factoriesatworking-tree - topaz.decision.lispex-v2-factories.1 at
topaz.decisi