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
8 changes: 8 additions & 0 deletions .baseline/identity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"_comment": "THIS TREE'S OWN IDENTITY — the FROM side of every rebrand. tooling/rebrand/rebrand.mjs reads it to know what to rename AWAY from; a product's identity is the --values file, which is the TO side. Change a value here only together with the tree: these strings must be what the tree actually contains, or the rename silently misses and the product ships carrying this baseline's name. `subdomain` is the workers.dev placeholder this tree carries, not a real subdomain: Virga itself has never deployed.",
"slug": "virga",
"pascal": "Virga",
"productName": "Virga",
"domain": "virga.site",
"subdomain": "your-workers-subdomain"
}
5 changes: 3 additions & 2 deletions .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ jobs:
- run: bash testing/retouch.test.sh
# A product's secret refs name the product's workspace, not this one's.
- run: bash testing/tenancy.test.sh
- run: bash testing/tag-gate.test.sh
# The rename engine over one-file trees, against pinned identities.
- run: bash testing/rebrand.test.sh

# THE BUILD DOCUMENT RUNS WITH THE BINARY A BOOTSTRAP ACTUALLY RUNS.
#
Expand All @@ -77,7 +78,7 @@ jobs:
- uses: actions/checkout@v6
- uses: sourceplane/orun-action@v1.2.0
with:
version: v2.60.0
version: v2.76.0
- uses: actions/setup-node@v5
with:
node-version: 22
Expand Down
48 changes: 36 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,21 @@ permissions:
contents: read
packages: write
id-token: write
checks: write

jobs:
plan:
if: ${{ vars.ORUN_CI == 'true' }}
runs-on: ubuntu-latest
outputs:
job-matrix: ${{ steps.matrix.outputs.job-matrix }}
lane-matrix: ${{ steps.matrix.outputs.lane-matrix }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: sourceplane/orun-action@v1.2.0
with:
version: v2.52.6
version: v2.78.0
- env:
# Surface the best-effort catalog auto-sync (execution.state.autopushCatalog).
# A successful push prints "✓ pushed catalog …"; ORUN_VERBOSE also makes
Expand All @@ -55,9 +56,14 @@ jobs:
)

orun plan "${plan_args[@]}"
# LANES (orun >= v2.76.0): one GitHub job per LANE, not per orun job.
# intent.yaml's `execution.lanes` packs the plan; a plan with no `lanes`
# array falls back to one lane per job, which is what this was before.
- id: matrix
run: |
echo "job-matrix=$(jq -c '[.jobs[] | {"job-id": .id, "job-name": .checkName}]' plan.json)" >> "$GITHUB_OUTPUT"
echo "lane-matrix=$(jq -c 'if ((.lanes // []) | length) > 0
then [.lanes[] | {"lane": .id, "name": .name}]
else [.jobs[] | {"lane": .id, "name": .checkName}] end' plan.json)" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v7
with:
name: orun-plan
Expand All @@ -66,18 +72,36 @@ jobs:
run:
needs: plan
runs-on: ubuntu-latest
if: ${{ needs.plan.outputs.job-matrix != '[]' && needs.plan.outputs.job-matrix != '' }}
# A BOOTSTRAP BRANCH IS CHECKED BY `plan` ALONE. Every phase of a bootstrap
# lands as a pull request on an `orun/BASE-…` branch, and its merge runs
# every lane on main a minute later, for real, watched to green before the
# next phase. Running the lanes on the PR too was the same work twice and
# a third of the bootstrap's wall-clock. Any other branch still verifies.
if: >-
${{ needs.plan.outputs.lane-matrix != '[]' && needs.plan.outputs.lane-matrix != ''
&& !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'orun/BASE-')) }}
strategy:
fail-fast: false
# Stagger the fan-out: every lane hits the lease-bound resolve at job
# start, and an unbounded herd saturated it twice. The orun DAG already
# serializes dependents, so capped parallelism costs little wall-clock.
max-parallel: 8
# Lanes already bound the herd (intent.yaml `execution.lanes`): a plan is
# packed into at most six per run, so this cap is rarely the limit.
max-parallel: 16
matrix:
include: ${{ fromJson(needs.plan.outputs.job-matrix) }}
name: ${{ matrix.job-name }}
include: ${{ fromJson(needs.plan.outputs.lane-matrix) }}
name: ${{ matrix.name }}
env:
npm_config_store_dir: /home/runner/.pnpm-store
PNPM_STORE_DIR: /home/runner/.pnpm-store
steps:
- uses: actions/checkout@v6
# One pnpm store shared across every lane of a run, keyed on the
# lockfile: a lane's install is a link, not a download.
- name: pnpm store cache
uses: actions/cache@v4
with:
path: /home/runner/.pnpm-store
key: pnpm-store-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-${{ runner.os }}-
- uses: actions/download-artifact@v8
with:
name: orun-plan
Expand All @@ -89,7 +113,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- uses: sourceplane/orun-action@v1.2.0
with:
version: v2.52.6
version: v2.78.0
# exec-id is the RUN id alone (no attempt suffix): a `gh run rerun
# --failed` then RESUMES the same orun execution — jobs that succeeded in
# a prior attempt stay completed, so re-run lanes' cross-job dependencies
Expand All @@ -108,7 +132,7 @@ jobs:
--plan plan.json \
--runner github-actions \
--remote-state \
--job "${{ matrix.job-id }}" \
--lane "${{ matrix.lane }}" \
--exec-id "${{ github.run_id }}" \
$retry_flag
env:
Expand Down
126 changes: 61 additions & 65 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,31 @@
name: Baseline tag

# NO `baseline-vN` IS CUT FROM AN UNPROVEN TREE.
# A `baseline-vN` TAG IS CUT BY A WORKFLOW, NEVER MOVED.
#
# A baseline tag is what the platform's registry resolves and what every website
# bootstrapped from this repository is built out of. One cut from a commit whose
# rehearsal never ran publishes a bootstrap nobody has watched work, to people
# who find out an hour in.
# A baseline tag is what the platform's registry resolves and what every
# website bootstrapped from this repository is built out of. Two rules, both
# enforced here:
#
# The rule itself lives in `testing/tag-gate.sh`, which is a script rather than
# forty lines of YAML because a rule that cannot be run on a laptop is a rule
# nobody checks before they need it. `testing/tag-gate.test.sh` drives it
# against a fake GitHub API.
# - the version must look like `baseline-v<N>`;
# - the tag must not already exist. A baseline tag is never moved, because
# products resolve it and repointing one changes what a build that already
# shipped was made of. Cut the next number instead.
#
# ─── TWO JOBS, AND WHY BOTH ────────────────────────────────────────────────
# ─── WHAT THIS NO LONGER DOES ─────────────────────────────────────────────
#
# `cut` is the door: it verifies first and creates the tag only if the commit is
# proven. Used as intended, an unproven tag cannot exist.
# Until the 2026-10 sync with cirrus-baseline this workflow refused any commit
# without a green tier-3 rehearsal run, and `testing/tag-gate.sh` carried that
# rule. Virga never had a rehearsal, so the gate answered "cannot be answered"
# for every commit and no tag could ever be cut — and cirrus-baseline removed
# its rehearsal and the gate with it (cirrus-baseline#13). Whether a commit is
# fit to release is decided OUTSIDE this repository: the end-to-end bootstrap
# that proves a published baseline is run from elsewhere, against the tag the
# registry publishes, and the registry row in orun-cloud's
# `infra/baselines-registry/baselines.yaml` moves by pull request.
#
# `verify` is the backstop, on `push: tags`. It cannot un-push a tag — a tag is
# created and THEN the event fires — but it turns a bypass into a red check
# within a minute instead of a discovery a release later.
#
# The backstop deliberately does NOT run after `cut`: GitHub does not trigger
# workflows from events made with the default GITHUB_TOKEN, so a tag this
# workflow creates fires nothing. That is correct rather than a gap — `cut`
# already verified, and `verify` exists for the tags it did not create.
#
# ─── WHAT MAKES THE REFUSAL BINDING ───────────────────────────────────────
#
# One repository setting, which no file in this repo can make: a ruleset on tag
# `baseline-v*` with "Restrict creations", leaving this workflow's token the
# only creator. Without it, `cut` is the paved road and `verify` is the alarm.
#
# ─── WHERE VIRGA ACTUALLY STANDS ──────────────────────────────────────────
#
# Virga has NO `rehearsal.yml` yet — the tier-3 harness (an orun component that
# bootstraps a throwaway product into a dedicated Cloudflare account, asserts it
# came up, and destroys it) is not ported, because writing one that deletes real
# resources without ever running it is worse than not having it.
#
# So this gate answers "the question could not be answered" (exit 3) for every
# commit today, not "unproven" (exit 1). Both refuse; they refuse for different
# reasons and the message says which. That is the truth about this baseline
# rather than a misconfiguration: nothing has been deployed. Add
# `rehearsal.yml` and `testing/rehearsal/`, let one run go green, and the gate
# starts answering about commits instead of about itself.
# No ruleset guards `baseline-v*` any more either: the one that did had no
# bypass actor (GitHub refuses the Actions integration on a bypass list), so
# it refused this workflow as surely as it refused a hand push.

on:
workflow_dispatch:
Expand All @@ -58,50 +39,65 @@ on:
required: false
default: main
type: string
push:
tags:
- "baseline-v*"

concurrency:
group: baseline-tag
cancel-in-progress: false

permissions:
contents: write
actions: read
contents: read

jobs:
cut:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
- id: sha
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: The commit must be proven
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bash testing/tag-gate.sh --repo "${{ github.repository }}" --sha "${{ steps.sha.outputs.sha }}"
- name: Create the tag
- name: the version must look like a baseline tag
run: |
set -euo pipefail
case "${{ inputs.version }}" in
baseline-v[0-9]*) ;;
*) echo "✕ '${{ inputs.version }}' is not a baseline-vN tag" >&2; exit 1 ;;
esac
- name: resolve the commit
id: commit
run: |
set -euo pipefail
sha="$(git rev-parse HEAD)"
echo "sha=$sha" >> "$GITHUB_OUTPUT"
echo "Cutting ${{ inputs.version }} from ${{ inputs.ref }} = $sha"
- name: the tag must not already exist
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
curl -sS -X POST -H "Authorization: Bearer $GH_TOKEN" \
code="$(curl -sS -o /dev/null -w '%{http_code}' \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
"${GITHUB_API_URL}/repos/${{ github.repository }}/git/refs" \
-d "$(printf '{"ref":"refs/tags/%s","sha":"%s"}' "${{ inputs.version }}" "${{ steps.sha.outputs.sha }}")" \
| tee /dev/stderr | grep -q '"ref"'

verify:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: This tag's commit must be proven
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/git/ref/tags/${{ inputs.version }}")"
if [ "$code" = "200" ]; then
echo "✕ ${{ inputs.version }} already exists. A baseline tag is never moved:" >&2
echo " products resolve it, and repointing one changes what a build that" >&2
echo " already shipped was made of. Cut the next number." >&2
exit 1
fi
[ "$code" = "404" ] || { echo "✕ could not check for the tag (HTTP $code)" >&2; exit 1; }
- name: cut the tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bash testing/tag-gate.sh --repo "${{ github.repository }}" --sha "${{ github.sha }}"
run: |
set -euo pipefail
curl -sS -X POST --fail-with-body \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/git/refs" \
-d "$(printf '{"ref":"refs/tags/%s","sha":"%s"}' \
"${{ inputs.version }}" "${{ steps.commit.outputs.sha }}")"
echo ""
echo "✓ ${{ inputs.version }} → ${{ steps.commit.outputs.sha }}"
echo " Next: add or move the registry row in orun-cloud's infra/baselines-registry/baselines.yaml."
23 changes: 12 additions & 11 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ twice: Virga's graph is acyclic, so every phase is a single landing.
## 0. What you need

- GitHub org access (repo creation) and a machine with `git`, `gh`, `node`
(≥ 22.5), `python3`, and the `orun` CLI — **≥ v2.56 for `--phase` and
`--resume`, and ≥ v2.60 for the run-level `hooks.preInstantiate` list that
opens the epic before the first phase places a file.** An older binary
refuses this document outright (`cannot unmarshal !!map into []scaffold.Hook`)
rather than half-running it, which is the failure you want.
(≥ 22.5), `python3`, and the `orun` CLI — **≥ v2.76**: v2.56 brought
`--phase` and `--resume`, v2.60 the run-level `hooks.preInstantiate` list
that opens the epic before the first phase places a file, and v2.76 the
lanes the product's `ci.yml` runs on (`execution.lanes` in `intent.yaml`).
An older binary refuses the document outright (`cannot unmarshal !!map into
[]scaffold.Hook`) rather than half-running it, which is the failure you want.
- A Cloudflare account and its **Account API token**. It is the ONLY provider
credential this baseline needs — and it must be able to mint both the
`workers-deploy` and `d1-edit` scopes, i.e. its permission groups include
Expand Down Expand Up @@ -52,11 +53,11 @@ included:

```yaml
# ~/acme-blog.values.yaml
repoName: acme-blog
productName: Acme Blog
productDomain: acme.blog
githubOrg: sourceplane
workersDevSubdomain: <workers-dev-subdomain>
reponame: acme-blog
productname: Acme Blog
productdomain: acme.blog
githuborg: sourceplane
subdomain: <workers-dev-subdomain>
orunWorkspace: ws_XXXXXXXX # omit to use the workspace the build runs in
repoPrivate: true
domain: false # true also runs 07-domain (needs the zone)
Expand Down Expand Up @@ -129,7 +130,7 @@ are the same files.

| requirement | detail |
|---|---|
| image deps | `git`, `gh`, `node` (≥ 22.5), `python3`, `curl`, `orun` ≥ v2.60 |
| image deps | `git`, `gh`, `node` (≥ 22.5), `python3`, `curl`, `orun` ≥ v2.76 |
| `ORUN_TOKEN` | orun access token, admin role (the secret write in `03-infrastructure` is the floor) |
| `GITHUB_TOKEN` | fine-grained PAT: on the PRODUCT repo **contents write**, **pull-requests write**, **actions read+write**, **checks read**; **repo create** on the org, because `01-scaffold` creates it |
| pinning | the clone's tag pins the blueprint AND every script `{{ .baseline.dir }}` resolves. Use a tag for reproducible bootstraps |
Expand Down
2 changes: 1 addition & 1 deletion ai/context/current.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ green, but nothing has ever been deployed from this tree:
a real workspace and Cloudflare account, and record the real timings in
`docs/phases/TIMINGS.md` — every number there is still an estimate.
2. Let phase 08 write `ai/context/deployment.md` from probed reality.
3. Tag `baseline-v1` and point the platform's blueprint registry at the tag.
3. Tag `baseline-vN` with `.github/workflows/tag.yml` and move the registry row in orun-cloud's `infra/baselines-registry/baselines.yaml` by pull request. (`baseline-v1` was cut on 2026-10-15 without steps 1 and 2 — by owner decision, the way cirrus-baseline cut v14 — so the first registered Virga is unproven end to end.)

Until step 2 has run, no file in this repo may claim a live deployment.
Loading
Loading