blob: 5054c6f235c177871d507227d3f9ca3c42b957af [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.
-->
# Experimental Incubator (`experimental/`)
> [!NOTE]
> **Experimental incubator — not audited, not shipped.**
> Code under `experimental/` is excluded from the root Cargo workspace,
> repository verification gates, release archives, and release notes. It must
> not be depended upon by any code outside its own slug directory.
`experimental/<slug>/` hosts public-safe spikes, multi-pillar harnesses, solver
prototypes, early frontends, and candidate benchmarks on `main` so they can be
developed and tested locally against `HEAD` without blocking core refactors.
## Required layout
Each experiment lives in `experimental/<slug>/` (lowercase `kebab-case`) with:
- **`EXPERIMENT.toml`:**
```toml
owners = ["@github-handle"]
tracking_issue = "https://github.com/google/anneal/issues/123"
expires_on = "2027-01-15" # at most 45 days after the PR setting it
ci_command = ["./ci.sh"] # declarative local test command run inside the slug
```
- **`README.md`:** Opens with a `[!NOTE]` experimental-incubator banner and
documents scope, graduation target, and local reproduction steps. Place
experiment-specific agent guidance in `README.md`, never in `AGENTS.md` or
`AGENTS.override.md`.
## Isolation rules
Checked in CI by `ci/check_experimental_isolation.py` (best-effort static/regex
scan in `anneal-structure-lint` and `anneal-ci-tests`), `anneal-audit`
(`cargo_boundary`), and `ci/check_pr_hygiene.py`, with Pass 2 containment
review authoritative for any PR touching paths outside `experimental/`:
- **No inbound or sideways edges:** Nothing outside `experimental/<slug>/`
(including sibling experiments) may import, symlink to, or depend on it.
- **Locked Cargo dependencies:** Cargo manifests inside an experiment must set
`publish = false` and may only use intra-slug path dependencies and external
`crates.io` crates pinned in a slug `Cargo.lock` with
`(name, version, source, checksum)` already present in the root `Cargo.lock`
or a registered `tools/`/`crates/` `Cargo.lock` (no `[patch]`/`[replace]`,
`build.rs`, `package.build`, `proc-macro`, git/custom registries, or vendored
third-party source).
- **Forbidden content:** Symlinks, submodules, binaries/media, `.olean` files,
`target/`, `.build/`, `.lake/`, `.cargo`, editor/agent config directories and
files (`AGENTS.md`, `AGENTS.override.md`, `CLAUDE.md`, `GEMINI.md`,
`.agents/`, `.claude/`, `.gemini/`, `.codex/`, `.cursor/`, `.vscode/`,
`.devcontainer/`, `.idea/`, `.zed/`, `.mcp.json`, `.cursorrules`,
`.windsurfrules`, `.clinerules`), `build.rs`, `Makefile`, `GNUmakefile`,
`Justfile`, `lakefile.*`, `lake-manifest.json`, `lean-toolchain`,
`rust-toolchain*`, `.nix`, `.yml`/`.yaml`, `.envrc`, `.gitattributes`, bidi
characters, and missing license headers (matched case-insensitively).
- **Permitted inside experiments:** `TODO` markers and Lean `sorry`.
## Lifecycle, CI, and graduation
- Experiments must set `expires_on` to at most 45 days from the PR setting or
renewing it (enforced by `ci/check_pr_hygiene.py`). Deleting an experiment is
exempt from the experimental PR size cap.
- Core refactors never wait on experiments; `ci-core / gate` runs only static
isolation checks (`anneal-structure-lint`, `anneal-ci-tests`, and
`anneal-audit`) and never executes `ci_command`.
- Dedicated workflows run `ci_command` via `ci/run_experimental_ci.py` in a
hardened, offline `bwrap` sandbox (`--unshare-net`, `--unshare-user`,
`--disable-userns`, `--cap-drop ALL`, `--clearenv`, read-only checkout with
`.git` masked, 300 s cap):
- `.github/workflows/anneal-experimental.yml` runs on pull requests touching
`experimental/<slug>/` (and fast-passes when no experiment changed).
- `.github/workflows/anneal-experimental-sweep.yml` runs on pushes to `main`
and on a daily schedule, uploading `ci_exp_status.v1` JSON without writing
back to the repository.
- Because the CI sandbox runs offline on Ubuntu 24.04 without network access or
host Cargo/rustup/elan homes, experiments whose `ci_command` relies on
crates.io downloads or an unbundled Lean/Cargo toolchain should keep their
CI-invoked `ci_command` self-contained with system tools and document full
local reproduction steps in `experimental/<slug>/README.md`.
- To graduate into production (`-Z <id>` or stable `trusted/`, `theory/`, or
`tools/`), delete the experimental source in the same PR and meet the target
home's full review and hygiene gates.