Skip to content
Topaz6.0 · Before release
Download

Search documentation

Specification 6.0 · Not released · Tested product 5.21.3

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Library

    std.lispex.freshReplay

    Replay the complete same request and compare the full canonical outcome.

    freshReplay(rule: PreparedLispexRule, input: LispexValue, limits: LispexLimits, artifact: LispexConsumerArtifact, hostLimits: LispexHostLimits) -> Result<LispexEvaluation, LispexReplayError>
    Receiver
    Not applicable
    Minimum arity
    5
    Maximum arity
    5

    Declaration and parameters

    Link

    Availability

    Included by default: no

    Import std.lispex from an application package with a verified lock. Packages with [lispex] require --locked. Application profile topaz/lispex-decision-application/1 uses evaluator profile lispex/r7rs-rule-embedded-core/1. Application profile topaz/lispex-decision-application/2 uses evaluator profile lispex/r7rs-rule-current-profile-bounded/1.

    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-worker (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

    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.

    Result

    The declared result type is Result<LispexEvaluation, LispexReplayError>.

    Effects

    Failures

    Result and effects

    Link

    Replay the complete same request and compare the full canonical outcome.

    Why

    Link

    The replay contract gives this operation one explicit input boundary and preserves the distinct result and failure cases.

    Related entries

    Link

    std.lispex

    Replay a complete request and compare the whole outcome

    Link
    Ruletopaz.stdlib.contract.lispex-replay.rule

    Replay 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

    Replay the same input and declared limits

    Link
    main.tpzReplay the same input and declared limitsOpen in Playground
    1. import std.bytes { Bytes }
    2. import std.lispex {
    3. PreparedLispexRule,
    4. LispexValue,
    5. LispexLimits,
    6. LispexHostLimits,
    7. LispexConsumerArtifact,
    8. LispexEvaluation,
    9. LispexReplayError,
    10. freshReplay,
    11. }
    12. function reproduce(rule: PreparedLispexRule, input: LispexValue, limits: LispexLimits, artifact: LispexConsumerArtifact, host: LispexHostLimits) -> Result<LispexEvaluation, LispexReplayError> {
    13. return freshReplay(rule, input, limits, artifact, host)
    14. }
    15. function observation(error: LispexReplayError) -> Option<LispexEvaluation> {
    16. return match (error) {
    17. case OutcomeMismatch(report, evaluation) => Some(evaluation)
    18. case HostWorkRefused(report, observed) => observed
    19. case _ => None()
    20. }
    21. }
    22. export function main(args: Array<string>, stdin: string) -> Result<int, string> {
    23. return Ok(0)
    24. }
    Expected outputexit 0
    No stdout.
    $ topaz check main.tpz --locked --format json · target product 5.21.3
    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

    Menu

    Download