Invocation, options and results
Linktopaz compiler preview
topaz compiler preview [entry]
Input
Use topaz compiler preview [entry] -. Accept -, -, -, -, - or -, - or -, and -.
The default terminal is typed. Without a producer allow only ast or typed and use the linked compiler preview. AST preview requires one entry file. Typed preview allows an entry or package mode.
An explicit producer requires -. - requires -, accepts no entry and conflicts with -. It selects the embedded compiler source set rather than a caller package.
Require one output directory outside the selected source root. Reject -, -, compiler budget flags, format selectors, repeated options, equals forms, missing values, unsupported terminals and producers and every unlisted option. Reject - for an explicit standalone entry.
Options and conflicts
| Option | Default | Contract | Conflicts |
|---|---|---|---|
--locked | false | Verify topaz.lock before compiling the selected package. | --self-source |
--self-source | false | Stage 2 compiler preview only: compile the embedded compiler source set | --locked |
--root <dir> | entry directory; . in package mode | The explicit source root or package root for this invocation. | None listed |
--out-dir <dir> | Not specified | run the linked self compiler and write a typed-terminal observation to --out-dir; add --producer stage1|stage2 --terminal rust-source for an explicit compiler producer; Stage 2 also accepts --self-source to compile the embedded compiler source set Required. | None listed |
--terminal ast|typed|rust-source | typed | compiler preview: ast or typed; compiler observe: typed or rust-source (defaults: preview=typed, observe=rust-source) | None listed |
--producer stage1|stage2 | Not specified | compiler preview only: select a fail-closed compiler producer (requires rust-source) | None listed |
--language-version <5.21> | 5.21 | language version selector | None listed |
Output channels
stdout
stderr
Exit status
0
A complete preview for the requested producer and terminal is published.
1
Arguments, source or language admission, package state, producer execution, bundle construction or publication fails.
Effects
Use the same outside source root check and managed bundle publication rules as compiler observe. Stage complete output and replace only an existing valid managed observation bundle.
Read the selected source tree or embedded self source without modifying it. Retain existing output if replacement cannot be installed. Do not emit or run a native program.
Do not download a producer, compiler or dependency and do not contact a registry. Use only the explicitly admitted installed producer and local input facts.
Successful runs without host resource failure are repeatable. Canonical preview bytes are stable for the same selected producer identity, source set and logical paths, package facts, language profile, terminal and installed product.
Stage 1 and Stage 2 provenance may differ even when their semantic phases agree. Such a difference is meaningful evidence and remains visible to provenance comparison.
Entry omission selects package mode except when - selects the embedded compiler source set. Package mode validates the package and uses already materialized dependencies.
- verifies the existing matching package lock without updating it. Registry dependencies and Lispex package configuration require this explicit option even when a lock already exists. Without it, only packages with neither requirement may load their local path dependencies using declared content hashes.
Missing or changed dependency content fails without materialization. A locked operation also rejects a missing or stale lock. The embedded compiler source set does not acquire a caller package lock or vendor dependency merely from the current directory.
Operation
LinkProducer and terminal selection control which compiler result is inspected. Confirm the installed compiler support before choosing a producer.
Option conditions
Link- applies to compiler observe or compiler preview only
- applies to compiler preview only
- requires -
- requires compiler preview -
--locked applies to package-mode check, run, emit, build, test, doc, bench, compiler observe, compiler preview. Selected-entry test also accepts it when --root contains topaz.toml.
- cannot be combined with bootstrap - or -
compiler preview requires --out-dir
Without --producer, compiler preview supports only - or typed
- does not accept an entry path
- does not apply to -
Behavior contract
LinkCommand behavior
Arguments and rejection
Use topaz compiler preview [entry] -. Accept -, -, -, -, - or -, - or -, and -.
The default terminal is typed. Without a producer allow only ast or typed and use the linked compiler preview. AST preview requires one entry file. Typed preview allows an entry or package mode.
An explicit producer requires -. - requires -, accepts no entry and conflicts with -. It selects the embedded compiler source set rather than a caller package.
Require one output directory outside the selected source root. Reject -, -, compiler budget flags, format selectors, repeated options, equals forms, missing values, unsupported terminals and producers and every unlisted option. Reject - for an explicit standalone entry.
Output
Write a human completion line identifying the output directory to standard output after publishing a valid preview. Write producer failures and recovery guidance to standard error. No human banner is written before validation succeeds.
The output is a topaz. directory with the requested AST, typed or generated source phase, diagnostic records and explicit producer provenance. Stage 1 and Stage 2 products retain the identities required by their own record schemas.
- is rejected because the JSON and JSON Lines members are fixed bundle artifacts. A preview does not offer a separate stdout JSON report.
Exit status
Exit 0 only when a complete preview for the requested route is published.
Exit 1 for invalid arguments, unsupported source or language profile, invalid package state, producer failure, invalid bundle data or unsafe or failed publication.
A producer failure remains a failure. Recovery may recommend a new explicit compiler observe invocation, but this invocation must not execute it or silently downgrade its terminal.
Filesystem effects
Use the same outside source root check and managed bundle publication rules as compiler observe. Stage complete output and replace only an existing valid managed observation bundle.
Read the selected source tree or embedded self source without modifying it. Retain existing output if replacement cannot be installed. Do not emit or run a native program.
Network access
Do not download a producer, compiler or dependency and do not contact a registry. Use only the explicitly admitted installed producer and local input facts.
Reproducibility
Successful runs without host resource failure are repeatable. Canonical preview bytes are stable for the same selected producer identity, source set and logical paths, package facts, language profile, terminal and installed product.
Stage 1 and Stage 2 provenance may differ even when their semantic phases agree. Such a difference is meaningful evidence and remains visible to provenance comparison.
Packages and locks
Entry omission selects package mode except when - selects the embedded compiler source set. Package mode validates the package and uses already materialized dependencies.
- verifies the existing matching package lock without updating it. Registry dependencies and Lispex package configuration require this explicit option even when a lock already exists. Without it, only packages with neither requirement may load their local path dependencies using declared content hashes.
Missing or changed dependency content fails without materialization. A locked operation also rejects a missing or stale lock. The embedded compiler source set does not acquire a caller package lock or vendor dependency merely from the current directory.
Why
Preview requests a particular compiler development route rather than the installed compiler selected by observe. Returning output from another route would conceal a producer failure. A terminal phase and explicit producer make the requested evidence precise.
Source evidence
- compiler/crates/topaz_cli/src/command/flags.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/dispatch.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compile/observation.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/validation.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compiler_support.rs at
b48527d0a174
The linked public CLI recipe checks the exact displayed argument rejection before the requested operation. It does not execute the successful operation or verify its effects.
The reviewed recipe rejects an unknown terminal before preview generation. Successful preview, producer selection and managed bundle replacement require fixtures outside the execution allowlist.
Example contract
LinkExample contract
The invocation topaz compiler preview main. is expected to exit with 1.
Reject an unknown terminal before observation generation or compiler preview execution.
Why
The terminal selects which compiler representation an observation contains. Rejecting an unknown terminal prevents the command from silently choosing a different representation.
Source evidence
- compiler/crates/topaz_cli/src/command/flags.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/dispatch.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compile/observation.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/validation.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compiler_support.rs at
b48527d0a174
Example
LinkArgument-rejection example
Linkfunction identity<T>(value: T) -> T {value}
Expected result
Expected result
Textual rejection details remain Pending in the reference model. The independent Tools example gate expects exit 1.
Reject an unknown terminal before observation generation or compiler preview execution.
Source evidence
- compiler/crates/topaz_cli/src/command/flags.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/dispatch.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compile/observation.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/validation.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compiler_support.rs at
b48527d0a174
Verification scope
LinkObserved with Topaz 5.21.3 on 2026-11-06T08:36:29.642Z. This invocation passed; exit 1. 3 assertions were evaluated against the independent expected result. Execution record. This result covers the displayed invocation.