fresh Replay(rule: Prepared Lispex Rule, input: Lispex Value, limits: Lispex Limits, artifact: Lispex Consumer Artifact, host Limits: Lispex Host Limits) - > Result<Lispex Evaluation, Lispex Replay Error>- Module
- std.
lispex - Receiver
- Not applicable
- Minimum arity
- 5
- Maximum arity
- 5
Declaration and parameters
LinkAvailability
Included by default: no
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.
Source evidence
- compiler/contracts/lispex-application/v1/std.lispex.tpz at
b48527d0a174· 167 - 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
freshReplay(rule, input, limits, artifact, hostLimits) returns Result<LispexEvaluation, LispexReplayError>. The prepared rule, canonical input, and complete evaluation limits supply the request to reproduce. The artifact supplies the retained portable receipt and any attached evidence. hostLimits bounds separate replay validation and comparison work.
Replay first verifies that the required canonical program, selected entry, input, fixed semantics, resource model, and finite limits are available and supported. It reconstructs the candidate request under the recorded identity contract. It compares that request with the recorded request before guest evaluation.
LispexReplayError.MissingRequest(report) identifies required request material that cannot be reconstructed or verified. No guest entry runs and no successful replay is reported. The adapter does not invent missing values, reuse current live facts, or substitute current defaults.
LispexReplayError.RequestMismatch(report) reports a difference between the candidate and recorded semantic requests. Changed canonical input, program, semantics, model, or declared limits cause mismatch even when the program would return the same value. No guest entry runs after that mismatch is established.
After the requests match and admission succeeds, replay performs a fresh evaluation with the supplied declared evaluation limits. It neither prepares a replacement program nor runs a modified request to obtain agreement. Prepared reuse and host cache state preserve the same normative evaluation events and charges.
Replay compares the complete canonical settlements. A successful value must match the recorded value. A semantic failure must match its phase, code, typed parameters, and canonical site. A resource stop must additionally match the exhausted axis.
Ok contains the fresh LispexEvaluation when the complete settlements agree. A reproduced SemanticFailure or LimitExhaustion is a successful replay comparison and remains that failure in the returned settlement. The adapter does not turn a reproduced failure into a Complete value.
LispexReplayError.OutcomeMismatch(report, evaluation) records a completed fresh evaluation whose canonical settlement differs from the retained settlement. The error retains the fresh evaluation as typed data and the report identifies its difference from the recorded binding. Equal diagnostic messages or equal final values from different failure paths cannot suppress this error.
LispexReplayError.AttemptFailed(error) preserves the admission, operational interruption, or engine defect returned by the fresh evaluation attempt. An incomplete attempt cannot be reported as either matching or different completed semantic outcomes.
LispexReplayError.HostWorkRefused(report, observation) reports a host budget refusal during replay validation or comparison. The report records the failed stage. observation is None before a completed fresh evaluation exists and Some of that evaluation after completion. It does not imply that semantic comparison completed and never becomes guest LimitExhaustion.
An admitted alternative engine artifact can replay the same semantic request. Engine bytes, source presentation, cache state, display locale, host paths, and execution timing do not enter canonical outcome comparison.
Replay consumes captured input values. A changed live clock, exchange rate, random source, or host environment cannot alter the retained input. A caller that captures a new value submits a different semantic request.
Replay does not authenticate an issuer, infer a trust policy, fetch keys, or authorize an external action. Attached evidence remains separately inspectable and authenticatable. Successful authentication does not bypass request reconstruction or settlement comparison.
The concrete replay report and receipt encodings follow the selected versioned contracts. Missing or unsupported contract versions produce explicit failure. A historical record is compared only under its original supported meaning and is never silently rewritten into a Lispex 2.0 request.
Related rule: Replay a complete request and compare the whole outcomeResult
The declared result type is Result<Lispex.
Effects
Failures
Result and effects
LinkReplay the complete same request and compare the full canonical outcome.
Why
LinkThe replay contract gives this operation one explicit input boundary and preserves the distinct result and failure cases.
Related entries
LinkReplay a complete request and compare the whole outcome
LinkReplay a complete request and compare the whole outcome
freshReplay(rule, input, limits, artifact, hostLimits) returns Result<LispexEvaluation, LispexReplayError>. The prepared rule, canonical input, and complete evaluation limits supply the request to reproduce. The artifact supplies the retained portable receipt and any attached evidence. hostLimits bounds separate replay validation and comparison work.
Replay first verifies that the required canonical program, selected entry, input, fixed semantics, resource model, and finite limits are available and supported. It reconstructs the candidate request under the recorded identity contract. It compares that request with the recorded request before guest evaluation.
LispexReplayError.MissingRequest(report) identifies required request material that cannot be reconstructed or verified. No guest entry runs and no successful replay is reported. The adapter does not invent missing values, reuse current live facts, or substitute current defaults.
LispexReplayError.RequestMismatch(report) reports a difference between the candidate and recorded semantic requests. Changed canonical input, program, semantics, model, or declared limits cause mismatch even when the program would return the same value. No guest entry runs after that mismatch is established.
After the requests match and admission succeeds, replay performs a fresh evaluation with the supplied declared evaluation limits. It neither prepares a replacement program nor runs a modified request to obtain agreement. Prepared reuse and host cache state preserve the same normative evaluation events and charges.
Replay compares the complete canonical settlements. A successful value must match the recorded value. A semantic failure must match its phase, code, typed parameters, and canonical site. A resource stop must additionally match the exhausted axis.
Ok contains the fresh LispexEvaluation when the complete settlements agree. A reproduced SemanticFailure or LimitExhaustion is a successful replay comparison and remains that failure in the returned settlement. The adapter does not turn a reproduced failure into a Complete value.
LispexReplayError.OutcomeMismatch(report, evaluation) records a completed fresh evaluation whose canonical settlement differs from the retained settlement. The error retains the fresh evaluation as typed data and the report identifies its difference from the recorded binding. Equal diagnostic messages or equal final values from different failure paths cannot suppress this error.
LispexReplayError.AttemptFailed(error) preserves the admission, operational interruption, or engine defect returned by the fresh evaluation attempt. An incomplete attempt cannot be reported as either matching or different completed semantic outcomes.
LispexReplayError.HostWorkRefused(report, observation) reports a host budget refusal during replay validation or comparison. The report records the failed stage. observation is None before a completed fresh evaluation exists and Some of that evaluation after completion. It does not imply that semantic comparison completed and never becomes guest LimitExhaustion.
An admitted alternative engine artifact can replay the same semantic request. Engine bytes, source presentation, cache state, display locale, host paths, and execution timing do not enter canonical outcome comparison.
Replay consumes captured input values. A changed live clock, exchange rate, random source, or host environment cannot alter the retained input. A caller that captures a new value submits a different semantic request.
Replay does not authenticate an issuer, infer a trust policy, fetch keys, or authorize an external action. Attached evidence remains separately inspectable and authenticatable. Successful authentication does not bypass request reconstruction or settlement comparison.
The concrete replay report and receipt encodings follow the selected versioned contracts. Missing or unsupported contract versions produce explicit failure. A historical record is compared only under its original supported meaning and is never silently rewritten into a Lispex 2.0 request.
Why
Replay asks whether a complete recorded request produces the same canonical outcome. Artifact inspection asks whether retained data is structurally valid, and authentication asks who signed it. Keeping these operations distinct preserves their different intents even when all three succeed for one artifact.
Source evidence
- docs/content-next/en/receipt-and-replay.json at
f455ac95ab30· 1 - docs/content-next/en/embedding.json at
f455ac95ab30· 1 - docs/content-next/en/cli-and-diagnostics.json at
f455ac95ab30· 1 -
topaz.stdlib.contract.lispex-replayatworking-tree - topaz.decision.lispex-v2-replay.1 at
topaz.decisi
Replay the same input and declared limits
Linkimport std.bytes { Bytes }import std.lispex {PreparedLispexRule,LispexValue,LispexLimits,LispexHostLimits,LispexConsumerArtifact,LispexEvaluation,LispexReplayError,freshReplay,}function reproduce(rule: PreparedLispexRule, input: LispexValue, limits: LispexLimits, artifact: LispexConsumerArtifact, host: LispexHostLimits) -> Result<LispexEvaluation, LispexReplayError> {return freshReplay(rule, input, limits, artifact, host)}function observation(error: LispexReplayError) -> Option<LispexEvaluation> {return match (error) {case OutcomeMismatch(report, evaluation) => Some(evaluation)case HostWorkRefused(report, observed) => observedcase _ => None()}}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.
Source evidence
- docs/content-next/en/receipt-and-replay.json at
f455ac95ab30· 1 - docs/content-next/en/embedding.json at
f455ac95ab30· 1 - docs/content-next/en/cli-and-diagnostics.json at
f455ac95ab30· 1 -
topaz.stdlib.contract.lispex-replayatworking-tree - topaz.decision.lispex-v2-replay.1 at
topaz.decisi