Lispex Request { identity: Lispex Identity, program: Lispex Identity, entry: string, input: Lispex Value, contract: Lispex Semantic Contract, limits: Lispex Limits }- Module
- std.
lispex - Receiver
- Not applicable
- Minimum arity
- 0
- Maximum arity
- 0
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/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
LispexIdentity is a typed immutable identity in a versioned domain. Its domain identifies the contract under which its value is interpreted. Equality compares the domain and the complete identity value under that contract. Matching display text from different domains does not establish identity equality.
Source identity identifies the exact submitted source bytes under the source contract. A source edit can change that identity while leaving canonical program identity unchanged. Source identity remains available for failures that occur before a canonical program exists.
Program identity identifies the canonical resolved program under its fixed dependencies. Canonicalization identifies one resolved form. It does not establish arbitrary program equivalence from equal values on one or more inputs.
Artifact identity identifies the exact bytes of an engine artifact under its artifact domain. It remains distinct from source and program identity. Two admitted engine artifacts can execute the same semantic request and produce the same canonical outcome.
LispexRequest.identity binds the complete evaluation request. That request fixes the canonical program, selected entry, input Datum, language and library semantics, Unicode semantics, resource model, and finite evaluation limits. Changing any semantic input creates a different request even when the result remains equal.
The request records effective limits after preset selection and before evaluation. Equal final values under different declared limits do not make the requests identical. A host cannot change the limits and preserve the original request identity.
Preparation and evaluation retain their own requests and budgets. Preparation reuse, a warm cache, and source presentation do not change the identity or charges of the admitted evaluation request. A preparation report does not stand in for an evaluation request.
Product, engine, platform, host paths, cache state, source layout, and display settings are outside the identity of an admitted semantic evaluation request. Their observations belong to source provenance or execution evidence as applicable.
Profile work identity binds the submitted request data, versioned profile work contract, and separate finite host budget. The profile work contract identifies the profile, schemas, required evidence, and host check rules. Changing that contract or host budget changes profile work identity without altering the base preparation or evaluation request.
Admission and later qualification or evidence reports retain the profile work identity of their submission. Each report cites only semantic identities already verified at its stage. An early refusal cannot manufacture a canonical input or program identity to complete its report.
Lispex 2.0 records use new identity domains. Historical Lispex 1.x records retain their original domains and meanings. Reading a historical record never promotes its identity or execution observations into Lispex 2.0 evidence.
Canonical Lispex value equality preserves exact mathematical numbers and raw Unicode scalar sequences. Aggregates compare their canonical kinds and ordered elements. Procedures, host references, physical storage identity, and floating point coercion do not participate in canonical value equality.
Canonical settlement equality compares the complete successful value or complete structured failure. It does not compare source formatting, diagnostic wording, engine selection, runtime counters, or evidence issuer. Identity equality and settlement equality answer different questions.
Inspection returns identity data already verified for the inspected object. Reading those fields performs no guest evaluation, fresh replay, network discovery, or authority acquisition. A caller supplied label cannot replace validation of an artifact or package identity.
Identity domain tags, digest algorithms, and serialized inputs follow their selected Lispex 2.0 contracts. The Topaz binding neither derives them from current Lispex 1.x encodings nor assigns hashes to contracts whose encoding remains unresolved.
LispexSemanticContract.standardLibrary names the selected library semantic contract. It is distinct from the standard library artifact bytes checked during package admission. The additional host profile selector belongs to LispexProfileRequest and profile work identity rather than the base semantic request.
LispexRuleIdentity.source is Some of the exact submitted source identity when source provenance was verified and None for a transported rule without verified source provenance. program identifies the canonical resolved code. artifact identifies the prepared artifact bytes returned by preparedBytes. contract names the verified semantic contracts. The evaluator artifact identity remains separate package and execution evidence.
LispexIdentity and LispexCanonicalSite are sealed values. Callers can compare them but cannot construct a verified identity or site from arbitrary text. Record inspections expose detached values and never change the sealed rule, request or artifact.
The opaque identity type exposes equality rather than a constructor from text. Each named field states its identity domain. A dependency submission uses a manifest name and raw bytes so admission can establish its identity without a caller forging a verified value.
Related rule: Identify source, programs, requests, artifacts, and profile workResult
Effects
Failures
Result and effects
LinkPreserve the complete semantic request needed for exact replay.
Why
LinkThe identities contract gives this operation one explicit input boundary and preserves the distinct result and failure cases.
Related entries
LinkIdentify source, programs, requests, artifacts, and profile work
LinkIdentify source, programs, requests, artifacts, and profile work
LispexIdentity is a typed immutable identity in a versioned domain. Its domain identifies the contract under which its value is interpreted. Equality compares the domain and the complete identity value under that contract. Matching display text from different domains does not establish identity equality.
Source identity identifies the exact submitted source bytes under the source contract. A source edit can change that identity while leaving canonical program identity unchanged. Source identity remains available for failures that occur before a canonical program exists.
Program identity identifies the canonical resolved program under its fixed dependencies. Canonicalization identifies one resolved form. It does not establish arbitrary program equivalence from equal values on one or more inputs.
Artifact identity identifies the exact bytes of an engine artifact under its artifact domain. It remains distinct from source and program identity. Two admitted engine artifacts can execute the same semantic request and produce the same canonical outcome.
LispexRequest.identity binds the complete evaluation request. That request fixes the canonical program, selected entry, input Datum, language and library semantics, Unicode semantics, resource model, and finite evaluation limits. Changing any semantic input creates a different request even when the result remains equal.
The request records effective limits after preset selection and before evaluation. Equal final values under different declared limits do not make the requests identical. A host cannot change the limits and preserve the original request identity.
Preparation and evaluation retain their own requests and budgets. Preparation reuse, a warm cache, and source presentation do not change the identity or charges of the admitted evaluation request. A preparation report does not stand in for an evaluation request.
Product, engine, platform, host paths, cache state, source layout, and display settings are outside the identity of an admitted semantic evaluation request. Their observations belong to source provenance or execution evidence as applicable.
Profile work identity binds the submitted request data, versioned profile work contract, and separate finite host budget. The profile work contract identifies the profile, schemas, required evidence, and host check rules. Changing that contract or host budget changes profile work identity without altering the base preparation or evaluation request.
Admission and later qualification or evidence reports retain the profile work identity of their submission. Each report cites only semantic identities already verified at its stage. An early refusal cannot manufacture a canonical input or program identity to complete its report.
Lispex 2.0 records use new identity domains. Historical Lispex 1.x records retain their original domains and meanings. Reading a historical record never promotes its identity or execution observations into Lispex 2.0 evidence.
Canonical Lispex value equality preserves exact mathematical numbers and raw Unicode scalar sequences. Aggregates compare their canonical kinds and ordered elements. Procedures, host references, physical storage identity, and floating point coercion do not participate in canonical value equality.
Canonical settlement equality compares the complete successful value or complete structured failure. It does not compare source formatting, diagnostic wording, engine selection, runtime counters, or evidence issuer. Identity equality and settlement equality answer different questions.
Inspection returns identity data already verified for the inspected object. Reading those fields performs no guest evaluation, fresh replay, network discovery, or authority acquisition. A caller supplied label cannot replace validation of an artifact or package identity.
Identity domain tags, digest algorithms, and serialized inputs follow their selected Lispex 2.0 contracts. The Topaz binding neither derives them from current Lispex 1.x encodings nor assigns hashes to contracts whose encoding remains unresolved.
LispexSemanticContract.standardLibrary names the selected library semantic contract. It is distinct from the standard library artifact bytes checked during package admission. The additional host profile selector belongs to LispexProfileRequest and profile work identity rather than the base semantic request.
LispexRuleIdentity.source is Some of the exact submitted source identity when source provenance was verified and None for a transported rule without verified source provenance. program identifies the canonical resolved code. artifact identifies the prepared artifact bytes returned by preparedBytes. contract names the verified semantic contracts. The evaluator artifact identity remains separate package and execution evidence.
LispexIdentity and LispexCanonicalSite are sealed values. Callers can compare them but cannot construct a verified identity or site from arbitrary text. Record inspections expose detached values and never change the sealed rule, request or artifact.
The opaque identity type exposes equality rather than a constructor from text. Each named field states its identity domain. A dependency submission uses a manifest name and raw bytes so admission can establish its identity without a caller forging a verified value.
Why
Source provenance, program meaning, submitted requests, engine bytes, and profile checks identify different objects. Equal results do not erase those distinct intents. Separate identities let callers change presentation or execution products while retaining the exact semantic request they intend to compare.
Source evidence
- docs/content-next/en/receipt-and-replay.json at
f455ac95ab30· 1 - docs/content-next/en/sandbox-contract.json at
f455ac95ab30· 1 - docs/content-next/en/values.json at
f455ac95ab30· 1 -
topaz.stdlib.contract.lispex-identitiesatworking-tree - topaz.decision.lispex-v2-identities.1 at
topaz.decisi
Repeat the same request and outcome
Linkimport std.bytes { Bytes }import std.ioimport std.testimport std.lispex {LispexPackage,LispexBoundaryReport,LispexLimitPreset,LispexLimits,LispexSource,LispexSourceBundle,PreparedLispexRule,LispexPreparationError,LispexDatumView,LispexValue,LispexValueError,LispexEvaluation,LispexAttemptError,LispexSettlement,LispexRuleIdentity,inspectRule,applicationPackage,defaultLimits,prepare,valueFromDatum,canonicalBytes,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: "source.scm",bytes: "(define rule (lambda (input) input))\n".encodeUtf8(),}let bundle: LispexSourceBundle = LispexSourceBundle {entryModule: "source.scm",entryBinding: "rule",sources: [source],}let prepared: Result<PreparedLispexRule, LispexPreparationError> = prepare(application, bundle, preset.preparation)let rule: PreparedLispexRule = test.assertOk(prepared)let identity: LispexRuleIdentity = inspectRule(rule)let converted: Result<LispexValue, LispexValueError> = valueFromDatum(application, LispexDatumView.Boolean(true), preset.host)let input: LispexValue = test.assertOk(converted)let firstAttempt: Result<LispexEvaluation, LispexAttemptError> = evaluate(rule, input, preset.evaluation)let first: LispexEvaluation = test.assertOk(firstAttempt)let secondAttempt: Result<LispexEvaluation, LispexAttemptError> = evaluate(rule, input, preset.evaluation)let second: LispexEvaluation = test.assertOk(secondAttempt)io.writeLine("{first.request.identity == second.request.identity}")match (first.settlement) {case Complete(left) => {match (second.settlement) {case Complete(right) => {let leftBytes: Bytes = canonicalBytes(left)let rightBytes: Bytes = canonicalBytes(right)io.writeLine("{leftBytes.toHex() == rightBytes.toHex()}")}case _ => io.writeLine("unexpected second outcome")}}case _ => io.writeLine("unexpected first outcome")}io.writeLine("{first.request.program == identity.program}")return Ok(0)}
true true true
Expected result
Expected result
Execution completes. Exit code 0.
truetruetrue
Run this source inside the verified Lispex application supplied through TOPAZ_LISPEX_APPLICATION. The example expects the Lispex 2.0 host contract.
Source evidence
- docs/content-next/en/receipt-and-replay.json at
f455ac95ab30· 1 - docs/content-next/en/sandbox-contract.json at
f455ac95ab30· 1 - docs/content-next/en/values.json at
f455ac95ab30· 1 -
topaz.stdlib.contract.lispex-identitiesatworking-tree - topaz.decision.lispex-v2-identities.1 at
topaz.decisi
Distinguish requests with equal returned values
Linkimport std.bytes { Bytes }import std.ioimport std.testimport std.lispex {LispexPackage,LispexBoundaryReport,LispexLimitPreset,LispexLimits,LispexSource,LispexSourceBundle,PreparedLispexRule,LispexPreparationError,LispexDatumView,LispexValue,LispexValueError,LispexEvaluation,LispexAttemptError,LispexSettlement,applicationPackage,defaultLimits,prepare,valueFromDatum,canonicalBytes,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: "source.scm",bytes: "(define rule (lambda (input) #t))\n".encodeUtf8(),}let bundle: LispexSourceBundle = LispexSourceBundle {entryModule: "source.scm",entryBinding: "rule",sources: [source],}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 otherResult: Result<LispexValue, LispexValueError> = valueFromDatum(application, LispexDatumView.Boolean(false), preset.host)let otherInput: LispexValue = test.assertOk(otherResult)let firstAttempt: Result<LispexEvaluation, LispexAttemptError> = evaluate(rule, input, preset.evaluation)let first: LispexEvaluation = test.assertOk(firstAttempt)let secondAttempt: Result<LispexEvaluation, LispexAttemptError> = evaluate(rule, otherInput, preset.evaluation)let second: LispexEvaluation = test.assertOk(secondAttempt)io.writeLine("{first.request.identity == second.request.identity}")match (first.settlement) {case Complete(left) => {match (second.settlement) {case Complete(right) => {let leftBytes: Bytes = canonicalBytes(left)let rightBytes: Bytes = canonicalBytes(right)io.writeLine("{leftBytes.toHex() == rightBytes.toHex()}")}case _ => io.writeLine("unexpected second outcome")}}case _ => io.writeLine("unexpected first outcome")}return Ok(0)}
false true
Expected result
Expected result
Execution completes. Exit code 0.
falsetrue
Run this source inside the verified Lispex application supplied through TOPAZ_LISPEX_APPLICATION. The example expects the Lispex 2.0 host contract.
Source evidence
- docs/content-next/en/receipt-and-replay.json at
f455ac95ab30· 1 - docs/content-next/en/sandbox-contract.json at
f455ac95ab30· 1 - docs/content-next/en/values.json at
f455ac95ab30· 1 -
topaz.stdlib.contract.lispex-identitiesatworking-tree - topaz.decision.lispex-v2-identities.1 at
topaz.decisi