blob: 8f031528b9584ea1f5df6eefaa46e2c0c137a95a [file] [view]
<!--
Copyright 2026 The Fuchsia Authors
Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
<LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
This file may not be copied, modified, or distributed except according to
those terms.
-->
# Opt-In Unstable Features (`-Z <id>`)
This directory is the governance registry for production-bound Anneal
capabilities that are not yet ready for default verification.
## Current status vs. planned toolchain plumbing
- **Enforced today:** Registry schema, documentation-page requirements,
bidirectional parity across unstable-feature code sites, and cartridge lock
validation run in CI (`ci/check_unstable_registry.py` and
`ci/check_cartridges_lock.py` under `anneal-ci-tests`), and PR hygiene
enforces the 90-day `review_by` horizon and graduation anti-laundering
(`ci/check_pr_hygiene.py`). CLI flag parsing (`-Z <id>`,
`--anneal-unstable <id>`, and `cargo anneal -Z help`), inline specification
attribute validation (`#[anneal::feature(<id>)]` and
`E_ANNEAL_UNKNOWN_UNSTABLE_FEATURE`), and receipt inspection, diffing, and
audit gating (`observed_anneal_unstable_features[]` and
`--allow-anneal-unstable=<id>`, with `--allow-unmodeled-rust-feature` as the
primary flag for unmodeled target Rust `#![feature(...)]` gates) are also
active. `trusted/locks/cartridges.lock.json` is staged with the single vetted
monolithic `Trusted` cartridge (checked by `ci/check_cartridges_lock.py` and
`ci/check_verdict_locks.py`), and no active unstable features exist on
`main` yet.
- **Planned follow-up PRs (as runtime verdict binding and the first unstable
feature register):** Stage-O / Stage-L emission of
`observed_anneal_unstable_features[]`, runtime verdict-binding of
`trusted/locks/cartridges.lock.json`, and opt-in `Anneal.Unstable.<id>`
proof libraries.
## Verdict-binding facts vs. governance metadata
The architecture separates what affects a verification verdict from what
governs feature lifecycle:
- **Verdict-binding facts (planned)** will live in authenticated verification
artifacts (`trusted/locks/cartridges.lock.json`, per-capture
`capture_unstable_features[]`, and byte-pinned unstable specification
preludes under `Specs.Unstable.<id>`). Once Stage-O / Stage-L emission lands,
verification will derive the set of Anneal unstable features a proof
actually used—including transitively through verified dependencies—and
record them in `receipt.json` under `observed_anneal_unstable_features[]`
(distinct from Receipt v3's existing target-Rust `#![feature(...)]` list at
`unstable_features.observed[]` and its capture mirror
`configuration.observed_unstable_features[]`, which are controlled by
`--allow-unmodeled-rust-feature` or its `--allow-unstable-feature` alias).
Default audits reject any receipt reporting an Anneal unstable feature unless
the auditor explicitly passes `--allow-anneal-unstable=<id>`. Unstable
proof-only libraries (`Anneal.Unstable.<id>`) will be opt-in and cannot enter
proved statements, so they will not taint a stable verdict.
- **Governance metadata (active today)** lives in this directory as one TOML
file and one documentation page per feature (`docs/unstable/<id>.toml` and
`docs/unstable/<id>.md`). Updating owners, documentation, or a 90-day review
date never changes downstream verdict-lock pins.
## Adding an unstable feature
Every unstable feature ID is lowercase `snake_case` and uses the same spelling
across its registry files, CLI flag, specification prelude namespace, proof
library namespace, and candidate cartridge tag. Land the registry entry,
documentation page, gate test, and first code site in the same pull request.
### Registry entry (`docs/unstable/<id>.toml`)
Include the standard `# Copyright 2026 The Fuchsia Authors` license header
(checked by `ci/check_pr_hygiene.py` on new `.toml` files), followed by:
```toml
owners = ["@github-handle"]
tracking_issue = "https://github.com/google/anneal/issues/123"
review_by = "2027-03-01" # at most 90 days after the PR setting it
gate_test = "tests/cargo-anneal/tests/gates/<id>.rs"
```
### Documentation page (`docs/unstable/<id>.md`)
Each page must include the Fuchsia license header and:
1. An `"Experimental opt-in on main"` notice banner.
2. A link to the public tracking issue.
3. An honest limitations section describing what the unstable feature does and
does not cover, phrased as explicitly logged assumptions.
4. A graduation checklist naming correspondence coverage, guard-mutation
coverage, and first-customer `zerocopy` verification targets.
## Review cadence and graduation
- Unstable features carry a 90-day review horizon (`review_by`). Once a
feature passes `review_by`, pull requests touching that feature fail hygiene
checks until an owner renews, graduates, or removes it; unrelated pull
requests are never blocked.
- Graduation to stable requires completing the feature's checklist and full
review of the graduated module closure. After graduation, delete `<id>.toml`
and replace `<id>.md` with a short redirect stub to its `docs/guide/` page.