Package root and entry
LinkA package root contains topaz.. 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] 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 - 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.
Configuration example
LinkComplete native package configuration
Link[package]name = "reference_app"version = "0.1.0"language = "5.21"entry = "src/main.tpz"[build]target = "native"deterministic = true[dependencies]std = { version = "5.21" }
import std.ioexport function main(args: Array<string>, stdin: string) -> Result<int, string> {io.writeLine("Hello from Topaz")Ok(0)}
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
- init_package at
b48527d0a174· 3-92 - parse_package_section / parse_build_section at
b48527d0a174· 4-68 - compiler/crates/topaz_package/src/manifest/sections.rs at
9b1bbdeceba9· 70-137
Dependency identity
LinkEach 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.
Registry dependency compilation requires - and matching content under vendor/. 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]. 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
Linktopaz. records the root package identity and a manifest_ 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
- 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]. selects native, web, or web-. 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.
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 -.
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.. 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_ 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.
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. 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
LinkOne registry materialization command
LinkOne registry materialization command
Use topaz vendor - for registry dependency materialization. topaz fetch is rejected during command validation.
The vendor command without - checks existing vendored content and updates the lock. Supplying - 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
- compiler/crates/topaz_cli/src/package/vendor.rs at
9b1bbdeceba9· 25-53 - compiler/crates/topaz_cli/src/package/vendor.rs at
9b1bbdeceba9· 67-173 - compiler/crates/topaz_cli/src/command/dispatch.rs at
9b1bbdeceba9· 254-258 - compiler/crates/topaz_cli/src/command/dispatch.rs at
9b1bbdeceba9· 355-358
One registry materialization command rejection
- Family
- topaz-cli
- Phase
- command
- Operation
- argument-validation
- Category
- registry-command
Cause and conditions
Use topaz vendor - for registry dependency materialization. topaz fetch is rejected during command validation.
Response
Use topaz vendor - to materialize registry dependencies.
Source evidence
- compiler/crates/topaz_cli/src/package/vendor.rs at
9b1bbdeceba9· 25-53 - compiler/crates/topaz_cli/src/package/vendor.rs at
9b1bbdeceba9· 67-173 - compiler/crates/topaz_cli/src/command/dispatch.rs at
9b1bbdeceba9· 254-258 - compiler/crates/topaz_cli/src/command/dispatch.rs at
9b1bbdeceba9· 355-358
One registry materialization command examples
LinkReject the fetch command alias
Linklet value = 1
No stdout.
[package]name = "tools_registry_example"version = "0.1.0"language = "5.21"entry = "main.tpz"[build]target = "native"deterministic = true[dependencies]sample = { version = "1.0.0" }
[package]name = "sample"version = "1.0.0"language = "5.21"entry = "main.tpz"
export let value = 1
Expected result
Expected result
Rejection during command. Exit code 1.
One registry materialization command rejectiontools-unknown-command
Source evidence
- compiler/crates/topaz_cli/src/package/vendor.rs at
9b1bbdeceba9· 25-53 - compiler/crates/topaz_cli/src/package/vendor.rs at
9b1bbdeceba9· 67-173 - compiler/crates/topaz_cli/src/command/dispatch.rs at
9b1bbdeceba9· 254-258 - compiler/crates/topaz_cli/src/command/dispatch.rs at
9b1bbdeceba9· 355-358
Materialize a registry dependency with vendor
Linklet value = 1
No stdout.
[package]name = "tools_registry_example"version = "0.1.0"language = "5.21"entry = "main.tpz"[build]target = "native"deterministic = true[dependencies]sample = { version = "1.0.0" }
[package]name = "sample"version = "1.0.0"language = "5.21"entry = "main.tpz"
export let value = 1
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_cli/src/package/vendor.rs at
9b1bbdeceba9· 25-53 - compiler/crates/topaz_cli/src/package/vendor.rs at
9b1bbdeceba9· 67-173 - compiler/crates/topaz_cli/src/command/dispatch.rs at
9b1bbdeceba9· 254-258 - compiler/crates/topaz_cli/src/command/dispatch.rs at
9b1bbdeceba9· 355-358
Dependency declarations use tables
LinkDependency 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
- compiler/crates/topaz_package/src/manifest/sections.rs at
9b1bbdeceba9· 70-137 - compiler/crates/topaz_package/src/manifest/sections.rs at
9b1bbdeceba9· 666-674 - compiler/crates/topaz_package/src/project.rs at
9b1bbdeceba9· 20-33 - compiler/crates/topaz_package/src/model.rs at
9b1bbdeceba9· 232-254 - compiler/crates/topaz_cli/src/package/lock.rs at
9b1bbdeceba9· 3-29 - compiler/crates/topaz_package/src/lock/render.rs at
9b1bbdeceba9· 25-40 - compiler/crates/topaz_cli/src/package/init.rs at
9b1bbdeceba9· 63-64 - compiler/crates/topaz_cli/src/package/dependency.rs at
9b1bbdeceba9· 78-102
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. in [dependencies].
Source evidence
- compiler/crates/topaz_package/src/manifest/sections.rs at
9b1bbdeceba9· 70-137 - compiler/crates/topaz_package/src/manifest/sections.rs at
9b1bbdeceba9· 666-674 - compiler/crates/topaz_package/src/project.rs at
9b1bbdeceba9· 20-33 - compiler/crates/topaz_package/src/model.rs at
9b1bbdeceba9· 232-254 - compiler/crates/topaz_cli/src/package/lock.rs at
9b1bbdeceba9· 3-29 - compiler/crates/topaz_package/src/lock/render.rs at
9b1bbdeceba9· 25-40 - compiler/crates/topaz_cli/src/package/init.rs at
9b1bbdeceba9· 63-64 - compiler/crates/topaz_cli/src/package/dependency.rs at
9b1bbdeceba9· 78-102
Dependency declarations use tables examples
LinkReject a version string dependency
Link[package]name = "tools_dependency_table"version = "0.1.0"language = "5.21"entry = "main.tpz"[dependencies]std = "5.21"
let value = 1
No stdout.
Expected result
Expected result
Rejection during package. Exit code 1.
Dependency declarations use tables rejectiontools-dependency-table-required
Source evidence
- compiler/crates/topaz_package/src/manifest/sections.rs at
9b1bbdeceba9· 70-137 - compiler/crates/topaz_package/src/manifest/sections.rs at
9b1bbdeceba9· 666-674 - compiler/crates/topaz_package/src/project.rs at
9b1bbdeceba9· 20-33 - compiler/crates/topaz_package/src/model.rs at
9b1bbdeceba9· 232-254 - compiler/crates/topaz_cli/src/package/lock.rs at
9b1bbdeceba9· 3-29 - compiler/crates/topaz_package/src/lock/render.rs at
9b1bbdeceba9· 25-40 - compiler/crates/topaz_cli/src/package/init.rs at
9b1bbdeceba9· 63-64 - compiler/crates/topaz_cli/src/package/dependency.rs at
9b1bbdeceba9· 78-102
Lock a table dependency
Link[package]name = "tools_dependency_table"version = "0.1.0"language = "5.21"entry = "main.tpz"[dependencies]std = { version = "5.21" }
let value = 1
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_package/src/manifest/sections.rs at
9b1bbdeceba9· 70-137 - compiler/crates/topaz_package/src/manifest/sections.rs at
9b1bbdeceba9· 666-674 - compiler/crates/topaz_package/src/project.rs at
9b1bbdeceba9· 20-33 - compiler/crates/topaz_package/src/model.rs at
9b1bbdeceba9· 232-254 - compiler/crates/topaz_cli/src/package/lock.rs at
9b1bbdeceba9· 3-29 - compiler/crates/topaz_package/src/lock/render.rs at
9b1bbdeceba9· 25-40 - compiler/crates/topaz_cli/src/package/init.rs at
9b1bbdeceba9· 63-64 - compiler/crates/topaz_cli/src/package/dependency.rs at
9b1bbdeceba9· 78-102