Перейти к содержимому
Топаз6.0 · До релиза
Загрузка →

Поиск в документации

Спецификация 6.0

Выберите результат стрелками и нажмите Enter, чтобы открыть его.

Введите имя API, номер диагностики, правило или тему проекта.

    Инструменты

    compiler preview

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

    Invocation, options and results

    Ссылка

    topaz compiler preview

    Форма вызова
    1. topaz compiler preview [entry]

    Ввод

    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.

    Параметры и конфликты

    ПараметрЗначение по умолчаниюКонтрактКонфликты
    --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.

    Не перечислены
    --out-dir <dir>Не указано

    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

    Не перечислены
    --terminal ast|typed|rust-sourcetyped

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

    Не перечислены
    --producer stage1|stage2Не указано

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

    Не перечислены
    --language-version <5.21>5.21

    language version selector

    Не перечислены

    Каналы вывода

    stdout

    stderr

    Статус завершения

    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.

    Эффекты

    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

    Ссылка

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

    Option conditions

    Ссылка

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

    Ссылка
    Правилоtools-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.

    Причина

    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.

    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

    Ссылка
    Правилоtools-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.

    Причина

    The terminal selects which compiler representation an observation contains. Rejecting an unknown terminal prevents the command from silently choosing a different representation.

    Example

    Ссылка

    Argument-rejection example

    Ссылка
    main.tpzArgument-rejection exampleОткрыть песочницу →
    1. function identity<T>(value: T) -> T {
    2. value
    3. }
    Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    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.

    Verification scope

    Ссылка

    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

    Ссылка

    Compiler selection →

    Packages, locks and targets →

    Меню

    Загрузка →