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.

    Tools

    Packages, locks and targets

    Describe a package in topaz.toml, bind its inputs in topaz.lock, and select the artifact that build produces.

    Package root and entry

    Link

    A package root contains topaz.toml. Package-mode commands load that file from the selected root, which defaults to the current directory. The manifest is read before the package entry source.

    Package loading source

    [package] declares the package name, version, language mode, and entry path. The entry is relative to the package root. License metadata is optional. Unknown top-level sections and unknown fields in supported sections are rejected.

    Manifest sections source · Package fields source

    topaz init --root app creates a native package with a complete entry program. It refuses to overwrite an existing manifest or entry. Use that scaffold as the starting point for the configuration below.

    Scaffold source

    Configuration example

    Link

    Complete native package configuration

    Link
    topaz.tomlComplete native package configurationOpen in Playground
    1. [package]
    2. name = "reference_app"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "src/main.tpz"
    6. [build]
    7. target = "native"
    8. deterministic = true
    9. [dependencies]
    10. std = { version = "5.21" }
    src/main.tpzComplete native package configurationOpen in Playground
    1. import std.io
    2. export function main(args: Array<string>, stdin: string) -> Result<int, string> {
    3. io.writeLine("Hello from Topaz")
    4. Ok(0)
    5. }
    target product 5.21.3
    Expected result

    Expected result

    Configuration example. The command references own executable check, initialization, and lock examples.

    Place both files under the same package root. Run package-mode commands from that root, or select it with --root.

    Source evidence

    Dependency identity

    Link

    Each dependency declaration uses a table. A version dependency has version and may have hash. A path dependency has path and requires hash. The table chooses exactly one of version and path. A bare version string is rejected when the package manifest is loaded.

    Dependency declaration source

    Registry dependency compilation requires --locked and matching content under vendor/<name>/<version>. The dependency package name and version must agree with the declaration. A local dependency's manifest name must also agree with its declared name.

    Package dependency loading source

    [exports].module selects the module a dependency exposes as its root. Without that section, its package entry supplies the root. A dependency name that collides with a root module path is rejected. These configuration relationships do not redefine source import syntax.

    What topaz.lock binds

    Link

    topaz.lock records the root package identity and a manifest_hash derived from the manifest text. It also binds declared dependency identities and content hashes. Changing a locked input requires a corresponding lock update.

    Lock verification source · Manifest digest source

    --locked verifies the existing lock before the applicable package operation continues. Missing, stale, duplicate, or undeclared lock entries are rejected. topaz lock writes the lock for the current manifest. It does not waive a mismatched local dependency hash.

    Lock verification also checks declared extern artifacts and replay inputs, plus embedded Lispex source, limits, quotas, and prepared artifacts when present. A matching root manifest hash does not replace those checks.

    Select the build artifact

    Link

    [build].target selects native, web, or web-worker. An omitted build target selects native. Ordinary package loading requires deterministic builds. The separate usage-profile validation path does not enable an unrestricted nondeterministic build.

    Build configuration source

    For package builds, an explicit command target takes precedence over the manifest target. Without a command target, build uses the manifest. Entry-file builds use their command target or the native default. Web targets cannot be combined with automatic execution through --run.

    Package build selection source

    The target describes the resulting artifact. It does not select SELF or the reference compiler. emit has a separate Rust-source target and does not produce a final native or web binary.

    Embedded Lispex configuration

    Link

    [lispex] selects a package-owned evaluator profile and declares at least one [[lispex.rule]]. Each rule has a unique name and distinct project-relative source and limits paths. A package containing this section requires locked compilation.

    Lispex configuration source · Locked package requirement

    An application identifier and its application_quotas file appear together. The application and evaluator profile must be a supported pair. In the current language mode, application configuration also requires the exact standard-library version for that mode.

    Application binding source

    The Lispex admission contract defines package admission and component identities. The factory contract defines generated calls from the verified lock. Installed profile availability requires distribution evidence.

    Lispex lock verification follows the package admission and generated factory contracts. Changing a locked input requires a matching lock update.

    Additional package inputs

    Link

    [capabilities.fs] declares project-relative read and write roots. [extern] declares externally implemented modules and their associated inputs. An extern module cannot occupy a root path already used by a local module or dependency.

    Capability and export declarations · Extern module collision source

    The complete external ABI and host sandbox behavior belong to their own reference contracts. This page records their effect on package identity and lock verification.

    Pending contracts

    Link

    One registry materialization command

    Link
    Ruletopaz.tools.registry-command.rule

    One registry materialization command

    Use topaz vendor --from <registry> for registry dependency materialization. topaz fetch is rejected during command validation.

    The vendor command without --from checks existing vendored content and updates the lock. Supplying --from also copies the selected registry content.

    Why

    Both reviewed command names materialize the same dependencies in the vendor directory and write the same lock. They express the same dependency materialization intent. The vendor name identifies the destination.

    Source evidence

    One registry materialization command rejection

    Family
    topaz-cli
    Phase
    command
    Operation
    argument-validation
    Category
    registry-command

    Cause and conditions

    Use topaz vendor --from <registry> for registry dependency materialization. topaz fetch is rejected during command validation.

    Response

    Use topaz vendor --from <registry> to materialize registry dependencies.

    Source evidence

    One registry materialization command examples

    Link

    Reject the fetch command alias

    Link
    main.tpzReject the fetch command aliasOpen in Playground
    1. let value = 1
    Expected outputexit 1
    No stdout.
    $ topaz fetch --root . --from registry · target product 5.21.3
    topaz.tomlReject the fetch command aliasOpen in Playground
    1. [package]
    2. name = "tools_registry_example"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    6. [build]
    7. target = "native"
    8. deterministic = true
    9. [dependencies]
    10. sample = { version = "1.0.0" }
    registry/sample/1.0.0/topaz.tomlReject the fetch command aliasOpen in Playground
    1. [package]
    2. name = "sample"
    3. version = "1.0.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    registry/sample/1.0.0/main.tpzReject the fetch command aliasOpen in Playground
    1. export let value = 1
    Expected result

    Expected result

    Rejection during command. Exit code 1.

    Source evidence

    Materialize a registry dependency with vendor

    Link
    main.tpzMaterialize a registry dependency with vendorOpen in Playground
    1. let value = 1
    Expected outputexit 0
    No stdout.
    $ topaz vendor --root . --from registry · target product 5.21.3
    topaz.tomlMaterialize a registry dependency with vendorOpen in Playground
    1. [package]
    2. name = "tools_registry_example"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    6. [build]
    7. target = "native"
    8. deterministic = true
    9. [dependencies]
    10. sample = { version = "1.0.0" }
    registry/sample/1.0.0/topaz.tomlMaterialize a registry dependency with vendorOpen in Playground
    1. [package]
    2. name = "sample"
    3. version = "1.0.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    registry/sample/1.0.0/main.tpzMaterialize a registry dependency with vendorOpen in Playground
    1. export let value = 1
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Source evidence

    Dependency declarations use tables

    Link
    Ruletopaz.tools.dependency-table.rule

    Dependency declarations use tables

    Each entry in [dependencies] is a table. A bare version string is rejected while the package manifest is loaded.

    A version dependency uses version and may include hash. A path dependency uses path and requires hash. Each table chooses exactly one of version and path.

    Why

    A version string and a table containing that version select the same dependency. The table preserves this intent and carries version, path, and content hash fields through one declaration structure.

    Source evidence

    Dependency declarations use tables rejection

    Family
    topaz-cli
    Phase
    package
    Operation
    manifest-admission
    Category
    dependency-table

    Cause and conditions

    Each entry in [dependencies] is a table. A bare version string is rejected while the package manifest is loaded.

    Response

    Use a table such as std = { version = "5.21" } in [dependencies].

    Source evidence

    Dependency declarations use tables examples

    Link

    Reject a version string dependency

    Link
    topaz.tomlReject a version string dependencyOpen in Playground
    1. [package]
    2. name = "tools_dependency_table"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    6. [dependencies]
    7. std = "5.21"
    main.tpzReject a version string dependencyOpen in Playground
    1. let value = 1
    Expected outputexit 1
    No stdout.
    $ topaz lock --root . · target product 5.21.3
    Expected result

    Expected result

    Rejection during package. Exit code 1.

    Source evidence

    Lock a table dependency

    Link
    topaz.tomlLock a table dependencyOpen in Playground
    1. [package]
    2. name = "tools_dependency_table"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    6. [dependencies]
    7. std = { version = "5.21" }
    main.tpzLock a table dependencyOpen in Playground
    1. let value = 1
    Expected outputexit 0
    No stdout.
    $ topaz lock --root . · target product 5.21.3
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Source evidence

    Related commands and selection

    Link

    Compiler selection

    init

    lock

    build

    check

    Menu

    Download