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.admitPackage

    Validate supplied package bytes and the supported execution envelope.

    admitPackage(input: LispexPackageInput, limits: LispexHostLimits) -> Result<LispexPackage, LispexBoundaryReport>
    Receiver
    Not applicable
    Minimum arity
    2
    Maximum arity
    2

    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

    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 LispexHostLimits. 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 has its own recorded finite host limits.

    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.

    Result

    The declared result type is Result<LispexPackage, LispexBoundaryReport>.

    Effects

    Failures

    Result and effects

    Link

    Validate supplied package bytes and the supported execution envelope.

    Why

    Link

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

    Related entries

    Link

    std.lispex

    Admit complete packages without ambient authority

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

    Admit complete packages without ambient authority

    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 LispexHostLimits. 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 has its own recorded finite host limits.

    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.

    Source evidence

    Admit supplied package bytes with finite host limits

    Link
    main.tpzAdmit supplied package bytes with finite host limitsOpen in Playground
    1. import std.bytes { Bytes }
    2. import std.lispex {
    3. LispexPackageInput,
    4. LispexPackage,
    5. LispexBoundaryReport,
    6. LispexHostLimits,
    7. admitPackage,
    8. applicationPackage,
    9. }
    10. function admit(input: LispexPackageInput, limits: LispexHostLimits) -> Result<LispexPackage, LispexBoundaryReport> {
    11. return admitPackage(input, limits)
    12. }
    13. function current() -> Result<LispexPackage, LispexBoundaryReport> {
    14. return applicationPackage()
    15. }
    16. export function main(args: Array<string>, stdin: string) -> Result<int, string> {
    17. return Ok(0)
    18. }
    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