Invocation, options and results
Linktopaz compiler observe
topaz compiler observe [entry]
Input
Use topaz compiler observe [entry] -. Accept - or -, -, -, -, - or -, -, - and -.
The default terminal is rust- and the current profile compiler default is self. Memory and time values are positive decimal integers using the shared option and environment precedence. Require one output directory and at most one entry operand.
Reject -, an unknown terminal, bootstrap producer or self source options, repeated options, missing values, equals forms and every unlisted option. Reject - when an explicit standalone entry is supplied.
Without an entry load the package selected by - or the current directory. With an entry use its directory as the default source root. Require the resolved output path to be outside that source root.
Options and conflicts
| Option | Default | Contract | Conflicts |
|---|---|---|---|
--compiler rust|self | self | compiler selector (default self); rust selects the reference compiler Also rejects combination with --producer, --self-source. | None listed |
--locked | false | Verify topaz.lock before compiling the selected package. | None listed |
--verbose | false | Reports the selected compiler and whether it was explicit or the default. For | None listed |
--root <dir> | entry directory; . in package mode | The explicit source root or package root for this invocation. | None listed |
--out-dir <dir> | Not specified | write canonical observations through generated Rust source to --out-dir (no entry = package mode) Required. | None listed |
--terminal typed|rust-source | rust-source | compiler preview: ast or typed; compiler observe: typed or rust-source (defaults: preview=typed, observe=rust-source) | None listed |
--language-version <5.21> | 5.21 | language version selector | None listed |
--compiler-memory-mib <MiB> | 8192 | self compiler worker memory budget (8192); overrides TOPAZ_COMPILER_MEMORY_MIB A positive integer is required. Environment input: TOPAZ_COMPILER_MEMORY_MIB. | None listed |
--compiler-time-ms <ms> | 1800000 | self compilation wall-clock budget (1800000); overrides TOPAZ_COMPILER_TIME_MS A positive integer is required. Environment input: TOPAZ_COMPILER_TIME_MS. | None listed |
Output channels
stdout
stderr
Exit status
0
A complete valid observation of the selected compiler route is published.
1
Arguments, source selection, compiler admission, package state, observation construction or publication fails.
Effects
Read the selected source tree and already materialized package dependencies without editing them. Create output parents as needed only after validating that the destination is outside the source root.
Stage and validate the entire bundle in a sibling directory. An existing output directory may be replaced only when it is already a valid managed observation bundle. Reject unmanaged directories, special files and symlinked bundle members.
Publish the complete bundle and retain the previous managed bundle if installation of its replacement fails. Remove only staging and backup paths owned by the operation. A crash may leave a private recovery directory and must not turn arbitrary sibling files into cleanup targets.
Perform no registry access, dependency fetch or compiler download. Observation ends at compiler data or generated source and does not invoke a native build or run the user program.
Successful runs without host resource failure are repeatable. The same source bytes and logical paths, package graph, dependency bytes, language profile, compiler identity, product release, terminal and budgets produce the same canonical observation content.
Comparing different compilers or producers requires the declared comparison layer. Provenance identifies the producer and is not erased to make distinct compiler routes look identical. Human output paths and resource failures require the same environment for byte equality.
Package mode uses the manifest entry and table dependency declarations. - requires a valid matching topaz. before compilation. Registry dependencies and Lispex package configuration require this explicit option even when a lock already exists.
Without -, a package with neither registry dependencies nor Lispex configuration loads local path dependencies using their declared content hashes. Missing or changed dependency content fails without a fetch. A locked operation also rejects a missing or stale lock without repairing it.
Observation does not create or rewrite a package lock or vendor tree. Standalone entry mode rejects -.
Operation
LinkUse observations to inspect compiler results at a selected terminal. Observation files describe the selected inputs and compiler.
Option conditions
Link- applies to compiler observe or 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 observe requires --out-dir
compiler observe supports only - or rust-
Behavior contract
LinkCommand behavior
Arguments and rejection
Use topaz compiler observe [entry] -. Accept - or -, -, -, -, - or -, -, - and -.
The default terminal is rust- and the current profile compiler default is self. Memory and time values are positive decimal integers using the shared option and environment precedence. Require one output directory and at most one entry operand.
Reject -, an unknown terminal, bootstrap producer or self source options, repeated options, missing values, equals forms and every unlisted option. Reject - when an explicit standalone entry is supplied.
Without an entry load the package selected by - or the current directory. With an entry use its directory as the default source root. Require the resolved output path to be outside that source root.
Output
On success write a human completion line identifying the output directory to standard output. Diagnostics and verbose compiler selection information use standard error. There is no selectable JSON report and - is rejected.
The output directory contains topaz- using topaz., request and response records, source and diagnostic records, phase records through the requested terminal and producer provenance. Every member has the schema and digest required by the bundle manifest.
A typed terminal contains no invented later phase result. A Rust source terminal records generated source rather than a native executable. An observation result may describe compiler diagnostics and must retain their outcome faithfully.
Exit status
Exit 0 only after publishing a complete valid observation of the selected compiler route. A recorded compiler rejection can be a valid observation and must be identified in its response record.
Exit 1 for invalid arguments or source selection, an unsupported explicit compiler route, missing or invalid package state, compiler or resource failure that prevents an observation, invalid bundle construction, unsafe output destination or publication failure.
No failure may trigger an implicit preview producer or substitute compiler.
Filesystem effects
Read the selected source tree and already materialized package dependencies without editing them. Create output parents as needed only after validating that the destination is outside the source root.
Stage and validate the entire bundle in a sibling directory. An existing output directory may be replaced only when it is already a valid managed observation bundle. Reject unmanaged directories, special files and symlinked bundle members.
Publish the complete bundle and retain the previous managed bundle if installation of its replacement fails. Remove only staging and backup paths owned by the operation. A crash may leave a private recovery directory and must not turn arbitrary sibling files into cleanup targets.
Network access
Perform no registry access, dependency fetch or compiler download. Observation ends at compiler data or generated source and does not invoke a native build or run the user program.
Reproducibility
Successful runs without host resource failure are repeatable. The same source bytes and logical paths, package graph, dependency bytes, language profile, compiler identity, product release, terminal and budgets produce the same canonical observation content.
Comparing different compilers or producers requires the declared comparison layer. Provenance identifies the producer and is not erased to make distinct compiler routes look identical. Human output paths and resource failures require the same environment for byte equality.
Packages and locks
Package mode uses the manifest entry and table dependency declarations. - requires a valid matching topaz. before compilation. Registry dependencies and Lispex package configuration require this explicit option even when a lock already exists.
Without -, a package with neither registry dependencies nor Lispex configuration loads local path dependencies using their declared content hashes. Missing or changed dependency content fails without a fetch. A locked operation also rejects a missing or stale lock without repairing it.
Observation does not create or rewrite a package lock or vendor tree. Standalone entry mode rejects -.
Why
An observation records the installed compiler route requested by the caller. A preview instead selects a compiler development producer. Those intentions differ even when both produce the same source representation. Keeping a validated bundle outside the source root prevents observation output from changing its own input.
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 invalid terminal before source or output work. Successful bundle creation and replacement are outside the execution allowlist.
Example contract
LinkExample contract
The invocation topaz compiler observe 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.