## Summary
A feature `state` in `docs/manifest/` now applies to a route and all its
descendants, so each state is set once on the highest route it applies
to.
`docsmanifestgen check` rejects a route that repeats an ancestor's
state, and the repeated states on `main` are removed.
## State model
- Put a state on the highest route it applies to.
- Add a state to a descendant only when it is new, such as an early
access page inside a Premium section.
- The sidebar shows a pill on the route that sets the state and on
descendants whose state differs.
- Every page shows its full state, own plus inherited, under the title.
## Changes
- `docsmanifestgen check` (`make lint/docs-manifest`) fails when a route
repeats an ancestor's state, following include files and overlays, or
lists a state twice.
It runs only after the manifest builds cleanly.
Table-driven tests in `scripts/docsmanifestgen/state_test.go`.
- Keep `state: [premium]` on AI Governance and External provisioners
only.
Remove the 27 states their descendants repeat in
`docs/manifest/ai-governance/**` and
`docs/manifest/install/operate/provisioners.yml`, and regenerate
`docs/manifest.json`.
- Document the model in `contributing/documentation.md` (new "Feature
states" section with a YAML example),
`docs/.style/content-guidelines.md`, and the doc-check skill.
> [!IMPORTANT]
> Inherited pills under the page title and the new sidebar behavior need
the matching docs-engine change
([DOCS-1440](https://linear.app/codercom/issue/DOCS-1440)).
> Merge this after that ships, or child pages show no state pill until
it does.
## Testing
- `go test ./scripts/docsmanifestgen/... ./scripts/docgenenv/...`
- `golangci-lint run ./scripts/docsmanifestgen/...`
- `GOOS=windows` and `GOOS=darwin` `go vet ./scripts/docsmanifestgen/`
- `make lint/docs-manifest`, `make lint/markdown`, `make
lint/docs-redirects`
- `make gen/docs-manifest` leaves the tree clean.
<details>
<summary>Decision log: rebase onto main after #31645</summary>
- #31645 (merged 2026-11-04) moved AI Governance to a top-level section
with Agent Firewall and AI Gateway nested under it, and added the
`ai-coder/...` redirects.
That covered this PR's move commits, link and URL updates, and
redirects, which caused the conflicts.
- The branch was rebuilt on `main`: the two move commits were dropped,
and the four state-tooling and guidance commits were cherry-picked.
The manifest cleanup was redone as a new commit against `main`'s layout,
using the new lint's output as the list of repeated states.
- Agent Relay is now top-level with `state: [premium, beta]` and no
child states, so it needs no change.
- Conflicts in `content-guidelines.md` and the doc-check skill were
resolved to keep `main`'s newer text (Vale word-choice updates and
relative redirect syntax) and apply only the feature-states lines.
- The pre-rebase head was `a797f59737`.
</details>
> Generated by Coder Agents on behalf of @nickvigilante.
Supersedes #31481, reopened under a human author for attribution.
---------
Co-authored-by: default <default@example.com>