Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ jobs:
echo "── $t"
bash "testing/$t.test.sh"
done
# Every component's docs/{overview,architecture,runbook}.md is generated
# from what the component declares (its manifest, Worker config,
# Terraform, migrations, package scripts). A pull request that changes
# one of those facts without regenerating the pages fails here.
- name: Component docs match their manifests
run: python3 tooling/catalog/gen-component-docs.py --check

# Tier 1. THE BLUEPRINT, READ AND PLACED BY THE BINARY A BOOTSTRAP RUNS.
#
Expand Down
40 changes: 40 additions & 0 deletions ai/context/current.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# nextra-docs β€” where this repository stands

The entry page for anyone (or any agent) picking this repository up. It is
this repository's own state and does not ship to a site built from it; the
two pages that do are [operations.md](operations.md) and
[deployment.md](deployment.md).

## What it is

Vercel's Nextra Docs Starter Kit β€” five MDX pages, a sidebar, search β€” moved
from Nextra 2 to Nextra 4 and run on Cloudflare Workers + Static Assets
through OpenNext, packaged as an Orun baseline: `orun new --blueprint
repo-blueprint.yaml` builds a new docs site in its own repository and takes
it to live on stage and prod in one landing (`01-product`), then records
what went live (`03-docs`).

## Release

| | |
|---|---|
| Latest tag | `baseline-v1` (ND3: three phases, `01-scaffold`, `02-site`, `03-docs`) |
| On `main` since | ND4 β€” one landing ([#5](https://github.com/sourceplane/nextra-docs/pull/5), ND-5); ND5 β€” the cirrus standard (no kiox, generated component docs, this context pack) |
| Proven live | `baseline-v1`: yes β€” a console bootstrap went live on stage and prod on 2026-10-15 (`nextra-live`, `bst_PW76WBTK`, 8m15s). `main`'s one-landing shape: no β€” proven offline in Baseline CI only, and no tag carries it yet (risk ND-I) |

## Where to read

| Question | Page |
|---|---|
| What shipped, and every departure from upstream | `specs/epics/nextra-docs/IMPLEMENTATION-STATUS.md` |
| Why it is built this way | [decisions.md](decisions.md), then `specs/epics/nextra-docs/design.md` |
| What could still go wrong | [open-risks.md](open-risks.md), then `specs/epics/nextra-docs/risks-and-open-questions.md` |
| How to instantiate it | `BOOTSTRAP.md`, `docs/phases/` |
| What each component is | `apps/web/docs/`, `tests/web/docs/` (generated; `python3 tooling/catalog/gen-component-docs.py`) |

## Next

1. Cut the next `baseline-vN` with `tag.yml`, so a tag carries ND4 and ND5.
2. Bootstrap one site from it from the console, and record its timings
against the 6-minute estimate and baseline-v1's 8m15s (closes ND-I and
ND4's last exit criterion).
20 changes: 20 additions & 0 deletions ai/context/decisions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# nextra-docs β€” decisions

The choices that shape this repository, one line each, with where the full
reasoning lives. Superseded decisions stay listed, marked, so the history
reads in order.

| # | Decision | Why | Source |
|---|---|---|---|
| 1 | OpenNext on Workers + Static Assets, not Pages (and not a static export) | `next-on-pages` is deprecated in favour of OpenNext, and a static export would drop the App Router runtime every other port in the catalog shares | `specs/epics/nextra-docs/README.md` (decisions locked), design.md Β§7 |
| 2 | Nextra 4 on Next 16.3.8, not Nextra 2 on Next 13 | `@opennextjs/cloudflare` cannot build Next 13's pages router (it needs Next β‰₯ 15.5.27); the five pages, the sidebar, the theme settings and the counter carry over | risk ND-A, design.md Β§3 |
| 3 | Every page is pre-rendered; `dynamicParams = false` | Unknown paths are a 404 and the Worker serves pages from the static-assets cache | risk ND-F |
| 4 | Search is Pagefind, indexed between `next build` and the OpenNext bundle, in the job's own tree | The index must ship as static assets the Worker serves | risks ND-E, ND-N |
| 5 | No infra root: the site binds nothing | Nothing to provision; `infra/` and `packages/` stay as empty discovery roots | README (decisions locked), IMPLEMENTATION-STATUS (ND3) |
| 6 | The site's name and repository are one seam, `apps/web/app/site.ts`; the upstream credit is protected from the rename | The rename's slug rule would have rewritten `nextra-docs-template` | risk ND-M |
| 7 | ~~Three phases: `01-scaffold`, `02-site`, `03-docs`~~ (`baseline-v1`) β€” superseded by #8 | β€” | IMPLEMENTATION-STATUS, "One landing (ND4)" |
| 8 | One landing (`01-product`) then the record (`03-docs`); each bootstrap pull request checked by `plan` alone | A landing has a fixed cost; the convergence on main builds, deploys and smoke-tests the site for real (cirrus-baseline baseline-v22, portfolio-starter-kit PK-6) | IMPLEMENTATION-STATUS (ND4) |
| 9 | `ci.yml` plans nothing while `intent.yaml` names `ws_CHANGE_ME`; `checks.yml` runs on pull requests only | A bootstrap cannot set a repository variable; a push to main must start `ci.yml` alone | IMPLEMENTATION-STATUS (ND3), risk ND-L |
| 10 | stack-tectonic 0.19.0, not 0.20.0 | 0.20.0's lane-shared install is refused by Turbopack | risk ND-K |
| 11 | orun is pinned only where it runs (the `orun-action` `version:` in each workflow); no kiox | `kiox.yaml` pinned a version (v2.15.0) nothing ran | IMPLEMENTATION-STATUS (ND5) |
| 12 | Component docs are generated from the manifests and checked in CI | A hand-written copy of the component's facts drifts silently | `tooling/catalog/gen-component-docs.py` |
15 changes: 15 additions & 0 deletions ai/context/open-risks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# nextra-docs β€” open risks

What is not yet proven or not yet decided. The full write-up of every risk,
including the accepted and resolved ones, is
`specs/epics/nextra-docs/risks-and-open-questions.md`; this page lists only
what is still live, so it should be short.

| ID | Risk | State | What closes it |
|---|---|---|---|
| ND-I | The one-landing shape on `main` (ND4) is not yet proven live; `baseline-v1`'s three phases were (2026-10-15, 8m15s) | OPEN | One console bootstrap from the next tag |
| ND-B | OpenNext and Next.js version drift: Next is pinned at 16.3.8 because 16.4.x fails at worker boot on `@opennextjs/cloudflare` 1.20.11 | Mitigated (watch) | An adapter release that admits the next Next, taken in a deliberate PR that re-runs the build and the preview |

Accepted, and worth knowing before you change them: ND-G (no "Last updated"
dates in a staged build), ND-H (Worker size), ND-J (a custom domain is the
owner's step).
16 changes: 16 additions & 0 deletions apps/web/docs/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# web β€” architecture

Built by the turbo pipeline from `apps/web` and deployed with wrangler.

| | |
| ------------------- | ----------------------------------------------- |
| Worker config | `apps/web/wrangler.jsonc` |
| Entry | `.open-next/worker.js` |
| Compatibility date | `2026-10-01` |
| Compatibility flags | `nodejs_compat`, `global_fetch_strictly_public` |

## Bindings

| Binding | Kind | Source |
| -------- | ------------- | ------------------- |
| `ASSETS` | Static assets | `.open-next/assets` |
20 changes: 20 additions & 0 deletions apps/web/docs/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# web

The docs site (Nextra 4 on Next.js, on Cloudflare Workers + Static Assets via @opennextjs/cloudflare, per environment)

A Cloudflare Worker with Static Assets (server rendering plus static files), deployed per environment by its CI lane.

| | |
| ------------ | ------------------------------------------------------------------------------------------------------------------ |
| Type | `cloudflare-workers-assets-turbo` |
| Source | `apps/web` |
| Package | `@app/web` |
| Environments | `dev`: `verify` Β· `stage`: `verify`, `deploy` on a push to `main` Β· `prod`: `verify`, `deploy` on a push to `main` |

## Depends on

- (none)

## Depended on by

- (none)
37 changes: 37 additions & 0 deletions apps/web/docs/runbook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# web β€” runbook

## How it runs

Pull requests verify it; a merge to `main` deploys it to `stage`, `prod`.
CI plans what changed (`orun plan --changed`) and runs each lane with `orun run`;
the plan orders a component after everything it depends on.

## Local commands

```bash
pnpm --filter @app/web dev
pnpm --filter @app/web build
pnpm --filter @app/web typecheck
pnpm --filter @app/web lint
pnpm --filter @app/web preview
```

## Verify

After a deploy the lane runs this smoke against the environment it
deployed (`ORUN_ENVIRONMENT`); `DEPLOYED_URL` overrides the URL:

```bash
html=$(curl -sfL "${DEPLOYED_URL}/") && echo "${html}" | grep -q 'nextra-navbar' && idx=$(curl -sfL "${DEPLOYED_URL}/_pagefind/pagefind-entry.json") && echo "${idx}" | grep -q '"page_count"'
```

## Rollback

Revert the commit on `main`. The next convergence applies the previous desired
state; nothing was changed out of band, so there is nothing else to undo.

## Common failures

- **The smoke fails right after a first deploy**: a new workers.dev route can
answer 4xx for a few seconds and the lane retries. A failure that persists
is a regression in the deployed code.
2 changes: 1 addition & 1 deletion docs/phases/01-product.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 01-product β€” the site, built in one landing

**Places** the whole tree: the root manifests (`intent.yaml`, `package.json`,
the pnpm workspace and lockfile, `turbo.json`, the kiox pin),
the pnpm workspace and lockfile, `turbo.json`),
`.github/workflows` (`ci.yml` and `checks.yml` β€” the baseline's own
`baseline.yml` and `tag.yml` are ignored), the shared TypeScript/ESLint
config and the wrangler renderer, the site's README and its two context
Expand Down
11 changes: 0 additions & 11 deletions kiox.lock

This file was deleted.

6 changes: 0 additions & 6 deletions kiox.yaml

This file was deleted.

12 changes: 1 addition & 11 deletions repo-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,6 @@ modules:
source: baseline
from: turbo.json
to: turbo.json
- name: root-kiox
mode: copy
source: baseline
from: kiox.yaml
to: kiox.yaml
- name: root-kiox-lock
mode: copy
source: baseline
from: kiox.lock
to: kiox.lock
- name: root-gitignore
mode: copy
source: baseline
Expand Down Expand Up @@ -392,7 +382,7 @@ phases:
await: "The site is building and deploying on both environments. The Next.js build is the long pole; nothing is stuck."
done: "{{ .inputs.reponame }} is live on stage and prod β€” {{ .meta.files }} files on main, branded as {{ .inputs.productname }}. That took {{ .meta.elapsed }}."
failed: "The site did not come up. The failing lane above names the step β€” the build, the deploy or the smoke β€” and a provider error is in its log."
modules: [ai-deployment, ai-operations, discovery-roots, github-workflows, rebrand-values, root-gitignore, root-intent, root-kiox, root-kiox-lock, root-package-json, root-pnpm-lock, root-pnpm-workspace, root-readme, root-turbo, tooling-eslint, tooling-tsconfig, tooling-wire, vscode, web, web-tests]
modules: [ai-deployment, ai-operations, discovery-roots, github-workflows, rebrand-values, root-gitignore, root-intent, root-package-json, root-pnpm-lock, root-pnpm-workspace, root-readme, root-turbo, tooling-eslint, tooling-tsconfig, tooling-wire, vscode, web, web-tests]
# THE PLATFORM MUST BE ABLE TO SEE THE REPOSITORY BEFORE IT EXISTS. Every
# phase lands a pull request that files under its task, and the platform
# learns of a PR only through the GitHub App installation on the account
Expand Down
2 changes: 1 addition & 1 deletion specs/epics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace.

| Epic | Cluster | Status | What it is |
|------|---------|--------|------------|
| [`nextra-docs/`](./nextra-docs/) | **ND** | 🟑 ND4 in progress | Vercel's Nextra Docs Starter Kit, equivalent in content and function, running on Cloudflare Workers + Static Assets via OpenNext β€” and an Orun baseline that instantiates it (ND3) |
| [`nextra-docs/`](./nextra-docs/) | **ND** | βœ… Shipped (`baseline-v1`, live 2026-10-15); ND4–ND5 on `main`, untagged | Vercel's Nextra Docs Starter Kit, equivalent in content and function, running on Cloudflare Workers + Static Assets via OpenNext β€” and an Orun baseline that instantiates it (ND3) |

As-built β‰  intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`.
42 changes: 41 additions & 1 deletion specs/epics/nextra-docs/IMPLEMENTATION-STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ the code departed from `design.md` or from the upstream template.
| ND1 β€” the docs on Workers | βœ… Shipped | [#2](https://github.com/sourceplane/nextra-docs/pull/2) |
| ND2 β€” ready to instantiate | βœ… Shipped | [#3](https://github.com/sourceplane/nextra-docs/pull/3) |
| ND3 β€” a baseline | βœ… Shipped | [#4](https://github.com/sourceplane/nextra-docs/pull/4) (ND-4), tagged `baseline-v1`; a console bootstrap of it went live on 2026-10-15 (below) |
| ND4 β€” one landing | 🟑 In progress | this PR (ND-5), to be tagged `baseline-v2` |
| ND4 β€” one landing | βœ… Shipped | [#5](https://github.com/sourceplane/nextra-docs/pull/5) (ND-5) β€” on `main`, not yet tagged; not yet proven live (risk ND-I) |
| ND5 β€” the cirrus standard | βœ… Shipped | ND-6 β€” on `main` after ND4, not yet tagged |

## Departures from the upstream template

Expand Down Expand Up @@ -124,6 +125,42 @@ landing waited 77s on Checks) β€” and the site went live on stage and prod.
The estimate here is 6 minutes (5 + 1), to be replaced by the first
bootstrap from `baseline-v2`.

## The cirrus standard (ND5)

Nothing about the site changed. What changed is the baseline around it:

| What | Before | After | Why |
|---|---|---|---|
| orun pin | `kiox.yaml` (v2.15.0) + `kiox.lock`, shipped to every site; "the kiox pin" in `docs/phases/01-product.md` | gone; orun is pinned where it runs, the `orun-action` `version:` in each workflow | nothing ran the kiox pin, and it disagreed with the lanes (v2.78.4) |
| `root-kiox`, `root-kiox-lock` modules | in `01-product` | removed (`testing/phases.test.sh` and the rebrand's skip list follow) | a site is placed with 61 files: 57 βˆ’ 2 kiox + 6 docs pages |
| component docs | none | `apps/web/docs/` and `tests/web/docs/` β€” `overview.md`, `architecture.md`, `runbook.md` | cirrus-baseline documents every component; the workspace Docs library renders `docs/` beside each `component.yaml` |
| how the docs stay true | β€” | `tooling/catalog/gen-component-docs.py` derives them from the manifest, the Worker config and package scripts; Baseline CI runs it with `--check` | a hand-written copy of a manifest drifts silently |
| context pack | `operations.md`, `deployment.md` | plus `current.md`, `decisions.md`, `open-risks.md` | cirrus-baseline's shape; the three new pages are this repository's own and no module places them (the leak gate still allows exactly two) |
| status | ND4 "in progress / this PR"; ND-I "no live bootstrap yet", citing the removed `02-site` | ND4 shipped, untagged; ND-I: `baseline-v1` went live (2026-10-15), the one-landing shape is not yet proven live β€” still OPEN | the merge and the live run had happened; the documents had not caught up |

## Verified (ND5)

- `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer}.test.sh`
green; `gen-component-docs.py --check` green (2 components, 6 pages).
- `orun new --status` (v2.58.11, the bootstrap floor): `01-product` 61
files, `03-docs` hook-only.
- `testing/leak.test.sh` (v2.58.11): 61 files derived (57 βˆ’ 2 kiox + 6 docs
pages); ai/context still exactly the two declared pages.
- `testing/placement.test.sh` (v2.58.11, as Baseline CI runs it): 61 files
placed, both landings (`01-product`, `03-docs`), branded, re-tenanted,
record rendered; the site's own plan for the 01-product merge deploys
`web` to stage and prod side by side; `--resume` changes nothing.
- `pnpm install --frozen-lockfile`, `wire:fixture`, `typecheck`, `lint`,
`test` (8 tests), `build` green.
- `testing/e2e.test.sh` (v2.78.4): the finished site passes the Checks
sequence; the stage lane's `install-workspace-dependencies`, `build-app`
(Turbopack, Pagefind β€” all 5 pages indexed; the new `docs/` pages are not
site content), `verify-build-output` and `deploy-dry-run` pass in the
staged job tree; under `wrangler dev` the component's own smoke passes,
and `/`, the four other pages, a 404 and the search index are the site's
own.
- `orun task check ND-6` complete.

## Verified (ND3)

- `orun new --status` reads the blueprint at v2.58.11 (the bootstrap floor)
Expand Down Expand Up @@ -155,6 +192,9 @@ bootstrap from `baseline-v2`.
- The repository itself: `pnpm install --frozen-lockfile`, `pnpm typecheck`,
`pnpm lint`, `pnpm test` (8 tests), `pnpm build` green.
- Not verified: a live bootstrap against a workspace (risks ND-I).
- (Note, ND5: on 2026-10-15 a console bootstrap of `baseline-v1` went live
on stage and prod in 8m15s β€” see "One landing (ND4)". ND4's one-landing
shape is the part not yet proven live.)

## Verified (ND1–ND2)

Expand Down
Loading
Loading