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

    compiler preview

    Writes an observation from the linked SELF compiler or a selected producer.

    Invocation, options and results

    Link

    topaz compiler preview

    Synopsis
    1. topaz compiler preview [entry]

    Input

    Use topaz compiler preview [entry] --out-dir <dir>. Accept --locked, --self-source, --root <dir>, --terminal ast, --terminal typed or --terminal rust-source, --producer stage1 or --producer stage2, and --language-version <version>.

    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 --terminal rust-source. --self-source requires --producer stage2 --terminal rust-source, accepts no entry and conflicts with --locked. It selects the embedded compiler source set rather than a caller package.

    Require one output directory outside the selected source root. Reject --compiler, --verbose, compiler budget flags, format selectors, repeated options, equals forms, missing values, unsupported terminals and producers and every unlisted option. Reject --locked for an explicit standalone entry.

    Options and conflicts

    OptionDefaultContractConflicts
    --lockedfalse

    Verify topaz.lock before compiling the selected package.

    --self-source
    --self-sourcefalse

    Stage 2 compiler preview only: compile the embedded compiler source set --self-source requires compiler preview --producer stage2 --terminal rust-source Also rejects combination with --compiler.

    --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. compiler preview requires --out-dir

    None listed
    --terminal ast|typed|rust-sourcetyped

    compiler preview: ast or typed; compiler observe: typed or rust-source (defaults: preview=typed, observe=rust-source)

    None listed
    --producer stage1|stage2Not specified

    compiler preview only: select a fail-closed compiler producer (requires rust-source) --producer requires --terminal rust-source Also rejects combination with --compiler.

    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 --self-source selects the embedded compiler source set. Package mode validates the package and uses already materialized dependencies.

    --locked 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

    Link

    Producer and terminal selection control which compiler result is inspected. Confirm the installed compiler support before choosing a producer.

    Option conditions

    Link

    --terminal applies to compiler observe or compiler preview only

    --producer applies to compiler preview only

    --producer requires --terminal rust-source

    --self-source requires compiler preview --producer stage2 --terminal rust-source

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

    --compiler cannot be combined with bootstrap --producer or --self-source

    compiler preview requires --out-dir

    Without --producer, compiler preview supports only --terminal ast or typed

    --self-source does not accept an entry path

    --locked does not apply to --self-source

    Behavior contract

    Link
    Ruletools-commands-compiler-preview.rule.behavior

    Command behavior

    Arguments and rejection

    Use topaz compiler preview [entry] --out-dir <dir>. Accept --locked, --self-source, --root <dir>, --terminal ast, --terminal typed or --terminal rust-source, --producer stage1 or --producer stage2, and --language-version <version>.

    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 --terminal rust-source. --self-source requires --producer stage2 --terminal rust-source, accepts no entry and conflicts with --locked. It selects the embedded compiler source set rather than a caller package.

    Require one output directory outside the selected source root. Reject --compiler, --verbose, compiler budget flags, format selectors, repeated options, equals forms, missing values, unsupported terminals and producers and every unlisted option. Reject --locked 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.compiler.observation-bundle/v1 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.

    --format json 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 --self-source selects the embedded compiler source set. Package mode validates the package and uses already materialized dependencies.

    --locked 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

    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

    Link
    Ruletools-commands-compiler-preview.rule.invocation

    Example contract

    The invocation topaz compiler preview main.tpz --language-version 5.21 --terminal invalid 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

    Example

    Link

    Argument-rejection example

    Link
    main.tpzArgument-rejection exampleOpen in Playground
    1. function identity<T>(value: T) -> T {
    2. value
    3. }
    target product 5.21.3
    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

    Verification scope

    Link

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

    Related references

    Link

    Compiler selection

    Packages, locks and targets

    Menu

    Download