Lispex Open Limits { work: int, logical Allocation: int, semantic Frames: int, input: int, result: int, diagnostics: int }- Module
- std.
lispex → - Receiver
- Not applicable
- Minimum arity
- 0
- Maximum arity
- 0
- Language mode
- 6.0
- Product
- Not released
Declaration and parameters
Availability
Included by default · no
The package provider supplies std.lispex after verifying the application package. The standalone playground has no application package provider.
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.
Receiver
Parameter constraints
When a target supports host work, admit its finite host preset and units through the independent provider pin for the selected contract. The application startup limits supply the Open operation.
std.lispex is the Topaz 6.0 host module. Importing it does not start a guest or grant guest capabilities. std.lispex.rules additionally requires the verified application lock that determines its generated names.
LispexPackageInput contains the manifest, evaluator artifact, standard library artifact and every declared dependency as immutable bytes. Each LispexPackagePart pairs dependency bytes with an exact logical name declared by the manifest. Admission computes and verifies the identity promised for that name. Arrays and records at call entry follow collection value semantics.
admitPackage requires complete finite LispexOpenLimits. Validate the limit record before parsing artifacts. Reject negative or unrepresentable fields without beginning admission. No package handle is returned on refusal.
Check manifest structure and declared identities before using a component. Verify evaluator interface and exports, standard library, ABI, codec, language semantics, Unicode semantics, selected profile and resource model. Every required component must be supplied exactly once and match its declared identity.
Dependencies resolve from the supplied package closure. Reject missing or duplicate components, identity collisions and incompatible contracts. Do not consult the working directory, environment, network, host registry or another installed evaluator as a substitute.
Evaluator artifacts must expose the selected data only interface. Reject host function imports and any dependency that obtains ambient authority. A callback advertised as pure is still a callback and is rejected. No import can turn a guest value into a host object reference.
The host checks the physical envelope needed to honor the selected semantic limits and supported package contracts. Refuse an unsupported target or insufficient envelope before guest entry. Do not silently lower limits or retry another engine.
Return Ok of an immutable LispexPackage after all checks succeed. The handle records the exact verified contract identities and closure. Refusal returns Err of LispexBoundaryReport. The checks may fail deterministically on supplied data or operationally on the physical host, but neither case is a canonical evaluation outcome.
applicationPackage reads an already admitted handle associated with the current verified application lock. It performs no parsing, preparation, guest execution or discovery. Without such a handle it returns a no-application-package report. Startup admission uses LispexOpenLimits. The application manifest [lispex.host_limits] and the locked limits record the startup Open budget.
The same package bytes, supported contract and finite budget produce the same validation decision unless the physical host cannot supply the declared envelope. Admission success alone proves neither issuer trust nor application permission to act.
The package container, ABI bytes and identity encodings remain Lispex versioned contracts. A supported admitted version is required. This API does not assign 1.21 artifact formats to Lispex 2.0.
The approved provider declares the six finite host axes and their units for the selected target and contract. defaultLimits().host reads that manifest declaration through an independent target pin. Each host operation applies the explicit finite limits supplied by its caller.
LispexLimits contains the six named int fields work, logicalAllocation, semanticFrames, input, result, and diagnostics. LispexPreparationLimits and LispexOpenLimits contain the same six named fields in their independent accounting domains. LispexHostLimits uses work, logicalAllocation, semanticFrames, input, report, and evidence. Every field is required and has no implicit unlimited form.
Each limit is a nonnegative Topaz int within the selected contract's supported representation bounds. Zero is an explicit finite bound and is never replaced by a default. Negative values, overflow, missing required fields, and unknown fields are refused before the affected operation begins.
The work field bounds cumulative normative computation. Native arithmetic, traversal, source processing, decoding, and encoding retain the charges assigned by their selected phase and contract. Host elapsed time and machine instruction counts do not replace work accounting.
The logicalAllocation field bounds cumulative logical allocation, including intermediate values. Sharing, garbage collection, and returning from a call do not refund committed charges. Physical allocation behavior does not change a logical charge.
The semanticFrames field bounds active semantic control state under the selected contract. A guest tail call replaces its current call frame. Nontail calls and active guard control consume their declared frames. Host stack layout does not redefine this budget.
The input, result, and diagnostics fields bound their respective channels in units defined by the selected versioned contract. The field names do not promise byte units. Open and preparation apply the channel meanings declared by their own contracts. Host work uses report for complete conversion output and reporting and evidence for the octets of evidence it processes. A value conversion that reads no evidence incurs no evidence charge. A report limit of zero can refuse conversion output. Refusal produces no evaluation receipt.
defaultLimits() returns LispexLimitPreset with preparation, evaluation, and host records. The preparation and evaluation records use the published common finite preset shared with Lispex 2.0 products. The host record uses the declared finite host work preset. Changing the startup Open budget leaves the selected host preset unchanged. A target without an approved host work declaration or entry point does not support that work. The call performs no guest evaluation or discovery.
A preset selection is resolved before admission and execution. The request records the effective declared evaluation limits. Copying a preset and changing one field creates an explicit new selection. No invalid field is repaired from a preset and no host silently reduces the selection.
Preparation uses its own finite account for the closed source bundle. Evaluation starts a new account for the immutable prepared program and supplied input. Warm caches and reused preparation cannot move work into the evaluation account, increase its allowance, or change its normative charges.
Package admission uses the separate finite Open account. Value conversion, artifact inspection, replay validation, authentication and additional profile checks use the finite host work account assigned to each operation. Transported prepared rule validation uses the explicit preparation account. Their host limits cannot serve as an unlimited fallback for guest work.
Canonical input decoding and canonical result or failure encoding remain evaluation work. Additional profile schema and evidence checks remain host work. A host helper that validates or retains data in advance does not remove the evaluation's declared logical events or charges.
At each atomic host work event, check work, logicalAllocation, semanticFrames, input, report, and evidence in that order. Skip axes the event does not require. Open, preparation and evaluation use their own resource events, with work, logicalAllocation and semanticFrames preceding the applicable input, result or diagnostics channel.
Commit an event's charges and effect only after every required reservation succeeds. If one reservation fails, perform none of that event's effect or charges. Retain charges committed by earlier events. Releasing an active frame does not refund cumulative work or allocation.
A reservation accepts a resulting charge equal to its limit. It rejects a resulting charge above the limit before the effect. Accounting uses checked exact arithmetic and cannot wrap or vary with host word size.
Checks and reservations follow semantic event order. A later charge cannot hide an earlier domain failure. Work needed to reach or perform an earlier check can itself exhaust a budget before that check completes.
Optimizations, inlining, native fast paths, and constant sharing preserve normative events and their first observable failure. They preserve the exhausted axis and canonical site for the same admitted semantic request. Equal aggregate usage totals alone do not establish this requirement.
A result channel failure in Open, preparation or evaluation returns no successful result prefix. Host work returns no successful byte prefix on report exhaustion. Diagnostic production obeys its finite channel budget, and terminal reporting uses the reserved emergency representation defined by the selected contract. Optional tracing cannot change the canonical outcome when its own capacity is exhausted.
The host admits a request only when its physical envelope can support the selected logical limits. It refuses unsupported envelopes without lowering the request budget or choosing another engine. A later physical failure remains operational or defective execution and cannot be relabeled as deterministic guest exhaustion.
Apply Work 0 at each boundary. If input admission exhausts work first, return Err of LispexAttemptError.Admission with the code input.resource and the work axis. The attempt has no evaluation outcome or receipt.
After request admission, deterministic evaluation exhaustion returns LimitExhaustion with the first exhausted axis, canonical site, and evaluation receipt. Preparation and additional profile work report failures in their respective phases.
Host work after a completed evaluation preserves that evaluation when its own budget is exhausted. It can refuse qualification, evidence creation, validation, or authentication without replacing the guest settlement or changing the original evaluation request identity.
Replaying a request uses the same resource model and complete evaluation limit record. A different declared limit record is a request mismatch even when the observed value would be unchanged. Host verification and comparison budgets remain separately identified.
Tariff coefficients, logical allocation units, detailed frame charges, channel units, finite default numbers, emergency capacities, and physical envelope requirements come from their versioned Lispex 2.0 contracts. This binding does not infer them from Lispex 1.x counters or current public product observations.
Missing and unknown named record fields are Topaz checking errors before a call is formed. A negative field or an unsupported representable value in a complete record causes the typed preflight refusal of the called operation. Neither path repairs the record or begins its phase.
Result
Effects
Failures
Result and effects
Bound startup Open and explicit package admission.
Why
Package admission has its own accounting before execution starts.
Admit complete packages without ambient authority
Admit complete packages without ambient authority
When a target supports host work, admit its finite host preset and units through the independent provider pin for the selected contract. The application startup limits supply the Open operation.
std.lispex is the Topaz 6.0 host module. Importing it does not start a guest or grant guest capabilities. std.lispex.rules additionally requires the verified application lock that determines its generated names.
LispexPackageInput contains the manifest, evaluator artifact, standard library artifact and every declared dependency as immutable bytes. Each LispexPackagePart pairs dependency bytes with an exact logical name declared by the manifest. Admission computes and verifies the identity promised for that name. Arrays and records at call entry follow collection value semantics.
admitPackage requires complete finite LispexOpenLimits. Validate the limit record before parsing artifacts. Reject negative or unrepresentable fields without beginning admission. No package handle is returned on refusal.
Check manifest structure and declared identities before using a component. Verify evaluator interface and exports, standard library, ABI, codec, language semantics, Unicode semantics, selected profile and resource model. Every required component must be supplied exactly once and match its declared identity.
Dependencies resolve from the supplied package closure. Reject missing or duplicate components, identity collisions and incompatible contracts. Do not consult the working directory, environment, network, host registry or another installed evaluator as a substitute.
Evaluator artifacts must expose the selected data only interface. Reject host function imports and any dependency that obtains ambient authority. A callback advertised as pure is still a callback and is rejected. No import can turn a guest value into a host object reference.
The host checks the physical envelope needed to honor the selected semantic limits and supported package contracts. Refuse an unsupported target or insufficient envelope before guest entry. Do not silently lower limits or retry another engine.
Return Ok of an immutable LispexPackage after all checks succeed. The handle records the exact verified contract identities and closure. Refusal returns Err of LispexBoundaryReport. The checks may fail deterministically on supplied data or operationally on the physical host, but neither case is a canonical evaluation outcome.
applicationPackage reads an already admitted handle associated with the current verified application lock. It performs no parsing, preparation, guest execution or discovery. Without such a handle it returns a no-application-package report. Startup admission uses LispexOpenLimits. The application manifest [lispex.host_limits] and the locked limits record the startup Open budget.
The same package bytes, supported contract and finite budget produce the same validation decision unless the physical host cannot supply the declared envelope. Admission success alone proves neither issuer trust nor application permission to act.
The package container, ABI bytes and identity encodings remain Lispex versioned contracts. A supported admitted version is required. This API does not assign 1.21 artifact formats to Lispex 2.0.
Why
Supplying the complete closure makes package admission an explicit host decision. A package handle preserves that decision without reopening discovery at every call. Inspecting a current application binding and admitting new bytes are different intentions.
Admit supplied package bytes with finite Open limits
import std.bytes { Bytes }import std.lispex {LispexPackageInput,LispexPackage,LispexBoundaryReport,LispexOpenLimits,admitPackage,applicationPackage,}function admit(input: LispexPackageInput, limits: LispexOpenLimits) -> Result<LispexPackage, LispexBoundaryReport> {return admitPackage(input, limits)}function current() -> Result<LispexPackage, LispexBoundaryReport> {return applicationPackage()}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.
Apply finite budgets in the declared resource order
Apply finite budgets in the declared resource order
The approved provider declares the six finite host axes and their units for the selected target and contract. defaultLimits().host reads that manifest declaration through an independent target pin. Each host operation applies the explicit finite limits supplied by its caller.
LispexLimits contains the six named int fields work, logicalAllocation, semanticFrames, input, result, and diagnostics. LispexPreparationLimits and LispexOpenLimits contain the same six named fields in their independent accounting domains. LispexHostLimits uses work, logicalAllocation, semanticFrames, input, report, and evidence. Every field is required and has no implicit unlimited form.
Each limit is a nonnegative Topaz int within the selected contract's supported representation bounds. Zero is an explicit finite bound and is never replaced by a default. Negative values, overflow, missing required fields, and unknown fields are refused before the affected operation begins.
The work field bounds cumulative normative computation. Native arithmetic, traversal, source processing, decoding, and encoding retain the charges assigned by their selected phase and contract. Host elapsed time and machine instruction counts do not replace work accounting.
The logicalAllocation field bounds cumulative logical allocation, including intermediate values. Sharing, garbage collection, and returning from a call do not refund committed charges. Physical allocation behavior does not change a logical charge.
The semanticFrames field bounds active semantic control state under the selected contract. A guest tail call replaces its current call frame. Nontail calls and active guard control consume their declared frames. Host stack layout does not redefine this budget.
The input, result, and diagnostics fields bound their respective channels in units defined by the selected versioned contract. The field names do not promise byte units. Open and preparation apply the channel meanings declared by their own contracts. Host work uses report for complete conversion output and reporting and evidence for the octets of evidence it processes. A value conversion that reads no evidence incurs no evidence charge. A report limit of zero can refuse conversion output. Refusal produces no evaluation receipt.
defaultLimits() returns LispexLimitPreset with preparation, evaluation, and host records. The preparation and evaluation records use the published common finite preset shared with Lispex 2.0 products. The host record uses the declared finite host work preset. Changing the startup Open budget leaves the selected host preset unchanged. A target without an approved host work declaration or entry point does not support that work. The call performs no guest evaluation or discovery.
A preset selection is resolved before admission and execution. The request records the effective declared evaluation limits. Copying a preset and changing one field creates an explicit new selection. No invalid field is repaired from a preset and no host silently reduces the selection.
Preparation uses its own finite account for the closed source bundle. Evaluation starts a new account for the immutable prepared program and supplied input. Warm caches and reused preparation cannot move work into the evaluation account, increase its allowance, or change its normative charges.
Package admission uses the separate finite Open account. Value conversion, artifact inspection, replay validation, authentication and additional profile checks use the finite host work account assigned to each operation. Transported prepared rule validation uses the explicit preparation account. Their host limits cannot serve as an unlimited fallback for guest work.
Canonical input decoding and canonical result or failure encoding remain evaluation work. Additional profile schema and evidence checks remain host work. A host helper that validates or retains data in advance does not remove the evaluation's declared logical events or charges.
At each atomic host work event, check work, logicalAllocation, semanticFrames, input, report, and evidence in that order. Skip axes the event does not require. Open, preparation and evaluation use their own resource events, with work, logicalAllocation and semanticFrames preceding the applicable input, result or diagnostics channel.
Commit an event's charges and effect only after every required reservation succeeds. If one reservation fails, perform none of that event's effect or charges. Retain charges committed by earlier events. Releasing an active frame does not refund cumulative work or allocation.
A reservation accepts a resulting charge equal to its limit. It rejects a resulting charge above the limit before the effect. Accounting uses checked exact arithmetic and cannot wrap or vary with host word size.
Checks and reservations follow semantic event order. A later charge cannot hide an earlier domain failure. Work needed to reach or perform an earlier check can itself exhaust a budget before that check completes.
Optimizations, inlining, native fast paths, and constant sharing preserve normative events and their first observable failure. They preserve the exhausted axis and canonical site for the same admitted semantic request. Equal aggregate usage totals alone do not establish this requirement.
A result channel failure in Open, preparation or evaluation returns no successful result prefix. Host work returns no successful byte prefix on report exhaustion. Diagnostic production obeys its finite channel budget, and terminal reporting uses the reserved emergency representation defined by the selected contract. Optional tracing cannot change the canonical outcome when its own capacity is exhausted.
The host admits a request only when its physical envelope can support the selected logical limits. It refuses unsupported envelopes without lowering the request budget or choosing another engine. A later physical failure remains operational or defective execution and cannot be relabeled as deterministic guest exhaustion.
Apply Work 0 at each boundary. If input admission exhausts work first, return Err of LispexAttemptError.Admission with the code input.resource and the work axis. The attempt has no evaluation outcome or receipt.
After request admission, deterministic evaluation exhaustion returns LimitExhaustion with the first exhausted axis, canonical site, and evaluation receipt. Preparation and additional profile work report failures in their respective phases.
Host work after a completed evaluation preserves that evaluation when its own budget is exhausted. It can refuse qualification, evidence creation, validation, or authentication without replacing the guest settlement or changing the original evaluation request identity.
Replaying a request uses the same resource model and complete evaluation limit record. A different declared limit record is a request mismatch even when the observed value would be unchanged. Host verification and comparison budgets remain separately identified.
Tariff coefficients, logical allocation units, detailed frame charges, channel units, finite default numbers, emergency capacities, and physical envelope requirements come from their versioned Lispex 2.0 contracts. This binding does not infer them from Lispex 1.x counters or current public product observations.
Missing and unknown named record fields are Topaz checking errors before a call is formed. A negative field or an unsupported representable value in a complete record causes the typed preflight refusal of the called operation. Neither path repairs the record or begins its phase.
Why
Complete named records make a resource request explicit and reproducible. Separate preparation, evaluation, and host budgets prevent cache behavior or extra profile checks from changing guest meaning. Ordered reservations and atomic effects ensure that every conforming product reports the same first semantic stop.
Refuse an input when admission exhausts Work 0
import std.bytes { Bytes }import std.ioimport std.testimport std.lispex {LispexPackage,LispexBoundaryReport,LispexLimitPreset,LispexLimits,LispexSource,LispexSourceBundle,PreparedLispexRule,LispexPreparationError,LispexDatumView,LispexValue,LispexValueError,LispexEvaluation,LispexAttemptError,applicationPackage,defaultLimits,prepare,valueFromDatum,evaluate,}export function main(args: Array<string>, stdin: string) -> Result<int, string> {let packageResult: Result<LispexPackage, LispexBoundaryReport> = applicationPackage()let application: LispexPackage = test.assertOk(packageResult)let preset: LispexLimitPreset = defaultLimits()let source: LispexSource = LispexSource {name: "main",source: "(module main (import) (export rule) (entry rule) (define rule (lambda (input) (let loop () (loop)))))\n".encodeUtf8(),}let bundle: LispexSourceBundle = LispexSourceBundle {modules: [source],root: "main",}let prepared: Result<PreparedLispexRule, LispexPreparationError> = prepare(application, bundle, preset.preparation)let rule: PreparedLispexRule = test.assertOk(prepared)let converted: Result<LispexValue, LispexValueError> = valueFromDatum(application, LispexDatumView.Boolean(true), preset.host)let input: LispexValue = test.assertOk(converted)let zeroWork: LispexLimits = LispexLimits {work: 0,logicalAllocation: preset.evaluation.logicalAllocation,semanticFrames: preset.evaluation.semanticFrames,input: preset.evaluation.input,result: preset.evaluation.result,diagnostics: preset.evaluation.diagnostics,}let attempt: Result<LispexEvaluation, LispexAttemptError> = evaluate(rule, input, zeroWork)let failure: LispexAttemptError = test.assertErr(attempt)match (failure) {case Admission(report) => {io.writeLine(report.phase)io.writeLine(report.code)for field in (report.fields) {if (field.name == "axis") {io.writeLine(field.value)}}}case _ => io.writeLine("unexpected failure")}return Ok(0)}
admission
input.resource
work
Expected result
Expected result
Execution completes. Exit code 0.
admissioninput.resourcework
Run this example in a verified Lispex 2.0 application. The Admission error has a report and no evaluation receipt.