From 5ae250a5b9b2fbcf707612c4c6ca3f0bff9656cb Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 14:54:41 +0000 Subject: [PATCH 1/8] fix(ci): nineteen components ran no tests; they run them now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stack-tectonic 0.20.0's `turbo-package` profiles, read from the published artifact rather than inferred: quick-check setup-node, setup-pnpm, install, verify-structure verify the same, plus pre-build, build and typecheck Every suite here keeps its tests in `preBuildCommand`, which is pre-build. So on `quick-check` they skipped not only the tests but the build and the typecheck — and the lane was still titled "· Verify" and went green, which is why it lasted. lumen#123's own CI showed it: db-tests ran four steps and reported "4 passed, 0 failed, 0 skipped" with no test among them. NINETEEN, not sixteen. The seventeen tests/* suites — an earlier count of sixteen was the overviews that read `None`, and platform-limits-tests is a seventeenth with a real one — plus packages/cli and packages/sdk, which carry their own tests in preBuildCommand too. All nineteen now say `verify` on `dev`, the environment the suites subscribe to and the one a pull request plans. cli and sdk keep `quick-check` on stage and prod: a package does not deploy, so those rows are its seat in each environment's graph, not a reason to run the same tests three times. That is how lumen's workers already subscribe. RUN BEFORE FLIPPED. All nineteen were run locally exactly as verify's pre-build runs them. Fifteen passed. Four did not, and each time the test was right about what it guards and its harness had drifted from the code beneath it: api-edge-tests 12 tests read apps/api-edge/wrangler.jsonc, which no longer exists: each worker commits wrangler.template.jsonc and render.mjs produces the deployable file (BF6). The template carries exactly the bindings asserted. membership-worker-tests the same file, read at describe time, so the whole suite failed to load db-tests tsconfig enumerates thirteen @saas/db/* subpaths and not `integrations`; jest resolved it through its (.*) catch-all and ts-jest's type-check did not integrations-worker-tests tsconfig maps @saas/db/*, which does not match bare @saas/db The suites that failed to LOAD were hiding more than their failure counts: membership-worker-tests 85 → 269 tests, db-tests 552 → 578, integrations-worker-tests 70 → 77. About 2,900 tests now run that did not. The repointed binding tests were checked by breaking what they guard: pointing stage's IDENTITY_WORKER at lumen-identity-worker-prod fails exactly the two tests written for it. A cross-environment binding would route stage traffic into prod's workers, and that check had been dead. Not every wrangler.jsonc reference was rot: config-worker-tests renders the template itself, platform-limits-tests tries the template first, and policy-worker binds nothing so its wrangler.jsonc is real. None of those passes was vacuous. LEFT ON quick-check: the seven packages with no preBuildCommand. Their tests are the matching tests/* suite, which now builds and typechecks them. WHAT IT COSTS A BUILD, stated rather than guessed: the 18 measured minutes predate this. The suites now run inside the merge convergences of 02-foundation (6), 04-workers (11), 05-edge (2) and 06-console (1). Each is its own lane, so the cost should land near the slowest suite rather than the sum; the next measured build is the answer, and docs/phases/TIMINGS.md says so. The sixteen overview notes reading "This suite does not run in CI today" are removed, since this makes them false. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BfmHkwWeA1oPJGBNF3QSQH --- docs/components/REVIEW.md | 82 ++++++++++++++++--- docs/phases/TIMINGS.md | 7 ++ packages/cli/component.yaml | 2 +- packages/sdk/component.yaml | 2 +- tests/admin-worker/component.yaml | 2 +- tests/admin-worker/docs/overview.md | 6 -- tests/api-edge/component.yaml | 2 +- tests/api-edge/docs/overview.md | 6 -- tests/api-edge/src/auth-facade.test.ts | 12 +-- tests/api-edge/src/org-facade.test.ts | 12 +-- tests/api-edge/src/project-facade.test.ts | 12 +-- tests/billing-worker/component.yaml | 2 +- tests/billing-worker/docs/overview.md | 6 -- tests/config-worker/component.yaml | 2 +- tests/config-worker/docs/overview.md | 6 -- tests/contracts/component.yaml | 2 +- tests/contracts/docs/overview.md | 6 -- tests/db/component.yaml | 2 +- tests/db/docs/overview.md | 6 -- tests/db/tsconfig.json | 1 + tests/identity-worker/component.yaml | 2 +- tests/identity-worker/docs/overview.md | 6 -- tests/integrations-worker/component.yaml | 2 +- tests/integrations-worker/docs/overview.md | 6 -- tests/integrations-worker/tsconfig.json | 1 + tests/membership-worker/component.yaml | 2 +- tests/membership-worker/docs/overview.md | 6 -- .../src/membership-worker.test.ts | 2 +- tests/metering-worker/component.yaml | 2 +- tests/metering-worker/docs/overview.md | 6 -- tests/notifications-client/component.yaml | 2 +- tests/notifications-client/docs/overview.md | 6 -- tests/notifications-worker/component.yaml | 2 +- tests/notifications-worker/docs/overview.md | 6 -- tests/platform-limits/component.yaml | 2 +- tests/policy-engine/component.yaml | 2 +- tests/policy-engine/docs/overview.md | 6 -- tests/policy-worker/component.yaml | 2 +- tests/policy-worker/docs/overview.md | 6 -- tests/projects-worker/component.yaml | 2 +- tests/projects-worker/docs/overview.md | 6 -- tests/web-console-next/component.yaml | 2 +- tests/web-console-next/docs/overview.md | 6 -- 43 files changed, 117 insertions(+), 146 deletions(-) diff --git a/docs/components/REVIEW.md b/docs/components/REVIEW.md index 975bff4..f226d00 100644 --- a/docs/components/REVIEW.md +++ b/docs/components/REVIEW.md @@ -85,9 +85,9 @@ Distribution: **5/5**: 6 · **4/5**: 30 · **3/5**: 9. consumed by the components below at build time"), which is true of all seven and says nothing about any. Each now opens with what it actually is. -## The finding that is not a documentation problem +## The finding that was not a documentation problem -**26 components subscribe with `profile: quick-check`, and that profile runs no +**26 components subscribed with `profile: quick-check`, and that profile runs no tests.** **Observed directly**, on the pull request that added this page — lumen's own CI, not an inherited note. The `db-tests · dev · Verify` lane ([run 40296065423](https://github.com/sourceplane/lumen/actions/runs/40296065423)) @@ -117,17 +117,75 @@ This repository had already written the finding down, in > setup, install and a package-structure check — and no tests (observed live > on cirrus: `4 passed, 0 failed`, none of them a test). -Sixteen of the 26 are test suites whose tests live in `preBuildCommand`, which -`quick-check` skips. +**What the two profiles actually are**, read from stack-tectonic 0.20.0's own +`turbo-package` definitions rather than inferred: -The fix is one word per component — `profile: verify` — and it is **not in this -change on purpose**: flipping it turns on sixteen suites that have never run in -CI, and the right place to absorb that is a change that can watch what it -turns on, not one that is also moving the build's timings. orun-cloud hit the -identical hole and recorded it as the `packages/db` lesson (#1536); its test -components now say `verify` for exactly this reason. - -Components on `quick-check`: `admin-worker-tests`, `api-edge-tests`, `billing-worker-tests`, `cli`, `config-worker-tests`, `contracts`, `contracts-tests`, `db`, `db-tests`, `identity-worker-tests`, `integrations-worker-tests`, `membership-worker-tests`, `metering-worker-tests`, `notifications-client`, `notifications-client-tests`, `notifications-worker-tests`, `platform-limits-tests`, `policy-engine`, `policy-engine-tests`, `policy-worker-tests`, `projects-worker-tests`, `sdk`, `shared`, `testing`, `web-console-next-tests`, `webhook-verifier`. +| capability | `quick-check` | `verify` | +|---|---|---| +| setup-node, setup-pnpm, install | ✓ | ✓ | +| verify-structure | ✓ | ✓ | +| **pre-build** — where every suite here keeps its tests | — | ✓ | +| **build** | — | ✓ | +| **typecheck** | — | ✓ | + +So `quick-check` skipped not only the tests but the build and typecheck as well. + +### Fixed + +Nineteen components carry tests in `preBuildCommand`: the **seventeen** +`tests/*` suites and two packages with their own, `cli` and `sdk`. An earlier +draft of this page said sixteen; it was counting the overviews that read +`None`, and `platform-limits-tests` is a seventeenth suite with a real overview. + +All nineteen now say `profile: verify` on `dev`, the only environment the +suites subscribe to and the one a pull request plans. `cli` and `sdk` keep +`quick-check` on `stage` and `prod`: a package does not deploy, so those rows +are its seat in each environment's graph, and running identical tests three +times would buy nothing. That matches how lumen's workers already subscribe — +plain `verify` on `dev`, with no rule skipping it on main. + +**Before flipping anything, all nineteen were run locally exactly as `verify`'s +pre-build step runs them** (`pnpm exec turbo run test --filter=./` in each +component). Fifteen passed. Four did not, and in every case the test was right +about what it guards and its harness had drifted from the code underneath it: + +| suite | what it hit | the fix | +|---|---|---| +| `api-edge-tests` | 12 tests read `apps/api-edge/wrangler.jsonc`, which no longer exists — each worker commits `wrangler.template.jsonc` and `tooling/wire/render.mjs` renders the deployable file (BF6) | read the template, which carries exactly the bindings asserted | +| `membership-worker-tests` | the same file, read at `describe` time, so the whole suite failed to load | the same | +| `db-tests` | `tsconfig.json` enumerates thirteen `@saas/db/*` subpaths and not `integrations`; jest resolved it through its `(.*)` catch-all, ts-jest's type-check did not | add the path | +| `integrations-worker-tests` | `tsconfig.json` maps `@saas/db/*`, which does not match bare `@saas/db` | add the path | + +The suites that failed *to load* were hiding more than their failure counts +showed: `membership-worker-tests` went from 85 tests to **269**, `db-tests` from +552 to **578**, `integrations-worker-tests` from 70 to **77**. + +**The repointed binding tests guard something real**, which was checked by +breaking it: pointing stage's `IDENTITY_WORKER` at `lumen-identity-worker-prod` +fails exactly the two tests written for it ("has stage service binding to +lumen-identity-worker-stage", "stage does not bind to prod identity worker"). +A cross-environment binding would route stage traffic into prod's workers. + +Not every `wrangler.jsonc` reference was rot. `config-worker-tests` renders the +template itself into a temporary file, `platform-limits-tests` tries the +template first, and `policy-worker` binds nothing, so it never moved to a +template and its `wrangler.jsonc` is real. None of those passes was vacuous. + +### Left on `quick-check`, by design + +`contracts`, `db`, `notifications-client`, `policy-engine`, `shared`, +`testing`, `webhook-verifier`. None has a `preBuildCommand`: their tests live +in the matching `tests/*` suite, which now builds and typechecks them on every +plan that includes it. Moving them to `verify` would add their own build and +typecheck lanes — defensible, but a different change from making tests run. + +### What this costs a build + +The 18 measured minutes in `docs/phases/TIMINGS.md` were taken **with these +suites not running.** They now run in the merge convergence of four phases — +`02-foundation` (6), `04-workers` (11), `05-edge` (2), `06-console` (1). Each +is its own lane, so the cost should sit near the slowest suite rather than the +sum, but that is a prediction; the next measured build is what will say. ## Declared product URLs diff --git a/docs/phases/TIMINGS.md b/docs/phases/TIMINGS.md index d7db482..cd19caf 100644 --- a/docs/phases/TIMINGS.md +++ b/docs/phases/TIMINGS.md @@ -55,6 +55,13 @@ slow case rather than the fast one. What could still make a build slower than one condition on `06-console` below. A second measured run belongs on this page beside the first rather than replacing it. +**The run predates the test suites running.** Nineteen components were on the +`quick-check` profile, which runs no tests, no build and no typecheck; they are +on `verify` now and execute inside the merge convergences of `02-foundation`, +`04-workers`, `05-edge` and `06-console` (`docs/components/REVIEW.md`). Each is +its own lane, so the cost should land near the slowest suite rather than the +sum — but that is a prediction, and the next measured build is the answer. + **One condition on `06-console`'s 2.** The console is fetched only when the baseline tag being built from has a published artifact for exactly these sources — `.github/workflows/tag.yml` publishes one as part of cutting a tag. diff --git a/packages/cli/component.yaml b/packages/cli/component.yaml index 5e1ddec..2e66359 100644 --- a/packages/cli/component.yaml +++ b/packages/cli/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify - name: stage profile: quick-check - name: prod diff --git a/packages/sdk/component.yaml b/packages/sdk/component.yaml index e86069e..b52154f 100644 --- a/packages/sdk/component.yaml +++ b/packages/sdk/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify - name: stage profile: quick-check - name: prod diff --git a/tests/admin-worker/component.yaml b/tests/admin-worker/component.yaml index 8fccd10..343ff5a 100644 --- a/tests/admin-worker/component.yaml +++ b/tests/admin-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/admin-worker/docs/overview.md b/tests/admin-worker/docs/overview.md index 7a80367..4586573 100644 --- a/tests/admin-worker/docs/overview.md +++ b/tests/admin-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `admin-worker` on ever plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/api-edge/component.yaml b/tests/api-edge/component.yaml index 590f5d0..e05a288 100644 --- a/tests/api-edge/component.yaml +++ b/tests/api-edge/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/api-edge/docs/overview.md b/tests/api-edge/docs/overview.md index 4cfa79d..0e42f9f 100644 --- a/tests/api-edge/docs/overview.md +++ b/tests/api-edge/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `api-edge` on every plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/api-edge/src/auth-facade.test.ts b/tests/api-edge/src/auth-facade.test.ts index dc7db18..ed85503 100644 --- a/tests/api-edge/src/auth-facade.test.ts +++ b/tests/api-edge/src/auth-facade.test.ts @@ -576,8 +576,8 @@ describe("api-edge auth facade", () => { }); describe("config verification", () => { - it("wrangler.jsonc has stage service binding to lumen-identity-worker-stage", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has stage service binding to lumen-identity-worker-stage", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -588,8 +588,8 @@ describe("api-edge auth facade", () => { expect(identity.service).toBe("lumen-identity-worker-stage"); }); - it("wrangler.jsonc has prod service binding to lumen-identity-worker-prod", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has prod service binding to lumen-identity-worker-prod", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -601,7 +601,7 @@ describe("api-edge auth facade", () => { }); it("stage does not bind to prod identity worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -612,7 +612,7 @@ describe("api-edge auth facade", () => { }); it("prod does not bind to stage identity worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); diff --git a/tests/api-edge/src/org-facade.test.ts b/tests/api-edge/src/org-facade.test.ts index 86be609..882a3c6 100644 --- a/tests/api-edge/src/org-facade.test.ts +++ b/tests/api-edge/src/org-facade.test.ts @@ -433,8 +433,8 @@ describe("api-edge org facade", () => { }); describe("binding verification config", () => { - it("wrangler.jsonc has stage MEMBERSHIP_WORKER binding to lumen-membership-worker-stage", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has stage MEMBERSHIP_WORKER binding to lumen-membership-worker-stage", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -445,8 +445,8 @@ describe("api-edge org facade", () => { expect(membership.service).toBe("lumen-membership-worker-stage"); }); - it("wrangler.jsonc has prod MEMBERSHIP_WORKER binding to lumen-membership-worker-prod", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has prod MEMBERSHIP_WORKER binding to lumen-membership-worker-prod", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -458,7 +458,7 @@ describe("api-edge org facade", () => { }); it("stage does not bind to prod membership worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -470,7 +470,7 @@ describe("api-edge org facade", () => { }); it("prod does not bind to stage membership worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); diff --git a/tests/api-edge/src/project-facade.test.ts b/tests/api-edge/src/project-facade.test.ts index 26ef2dd..b3a4b80 100644 --- a/tests/api-edge/src/project-facade.test.ts +++ b/tests/api-edge/src/project-facade.test.ts @@ -836,8 +836,8 @@ describe("api-edge project facade", () => { }); describe("binding verification config", () => { - it("wrangler.jsonc has stage PROJECTS_WORKER binding to lumen-projects-worker-stage", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has stage PROJECTS_WORKER binding to lumen-projects-worker-stage", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -848,8 +848,8 @@ describe("api-edge project facade", () => { expect(projects.service).toBe("lumen-projects-worker-stage"); }); - it("wrangler.jsonc has prod PROJECTS_WORKER binding to lumen-projects-worker-prod", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has prod PROJECTS_WORKER binding to lumen-projects-worker-prod", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -861,7 +861,7 @@ describe("api-edge project facade", () => { }); it("stage does not bind to prod projects worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -873,7 +873,7 @@ describe("api-edge project facade", () => { }); it("prod does not bind to stage projects worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); diff --git a/tests/billing-worker/component.yaml b/tests/billing-worker/component.yaml index e5e5ec1..d372f13 100644 --- a/tests/billing-worker/component.yaml +++ b/tests/billing-worker/component.yaml @@ -17,7 +17,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/billing-worker/docs/overview.md b/tests/billing-worker/docs/overview.md index a55069b..c75b082 100644 --- a/tests/billing-worker/docs/overview.md +++ b/tests/billing-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `billing-worker` on ev plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/config-worker/component.yaml b/tests/config-worker/component.yaml index 4f4a020..915136e 100644 --- a/tests/config-worker/component.yaml +++ b/tests/config-worker/component.yaml @@ -17,7 +17,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/config-worker/docs/overview.md b/tests/config-worker/docs/overview.md index f33c02b..3850bab 100644 --- a/tests/config-worker/docs/overview.md +++ b/tests/config-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `config-worker` on eve plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/contracts/component.yaml b/tests/contracts/component.yaml index 7731681..3e1dc0c 100644 --- a/tests/contracts/component.yaml +++ b/tests/contracts/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "20" pnpmVersion: "10.12.1" diff --git a/tests/contracts/docs/overview.md b/tests/contracts/docs/overview.md index 2dc539f..3e3af32 100644 --- a/tests/contracts/docs/overview.md +++ b/tests/contracts/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `contracts` on every plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/db/component.yaml b/tests/db/component.yaml index 0df8b5d..6c2911e 100644 --- a/tests/db/component.yaml +++ b/tests/db/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "20" pnpmVersion: "10.12.1" diff --git a/tests/db/docs/overview.md b/tests/db/docs/overview.md index 365270d..f3d312d 100644 --- a/tests/db/docs/overview.md +++ b/tests/db/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `db` on every plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/db/tsconfig.json b/tests/db/tsconfig.json index 648a251..fa7d6ba 100644 --- a/tests/db/tsconfig.json +++ b/tests/db/tsconfig.json @@ -9,6 +9,7 @@ "declarationMap": false, "baseUrl": ".", "paths": { + "@saas/db/integrations": ["../../packages/db/src/integrations/index.ts"], "@saas/db": ["../../packages/db/src/index.ts"], "@saas/db/hyperdrive": ["../../packages/db/src/hyperdrive/index.ts"], "@saas/db/identity": ["../../packages/db/src/identity/index.ts"], diff --git a/tests/identity-worker/component.yaml b/tests/identity-worker/component.yaml index cb87793..76f24e8 100644 --- a/tests/identity-worker/component.yaml +++ b/tests/identity-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/identity-worker/docs/overview.md b/tests/identity-worker/docs/overview.md index a2a0d72..2ff27de 100644 --- a/tests/identity-worker/docs/overview.md +++ b/tests/identity-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `identity-worker` on e plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/integrations-worker/component.yaml b/tests/integrations-worker/component.yaml index 712dc24..36b73c6 100644 --- a/tests/integrations-worker/component.yaml +++ b/tests/integrations-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/integrations-worker/docs/overview.md b/tests/integrations-worker/docs/overview.md index 3590fb7..16c9a96 100644 --- a/tests/integrations-worker/docs/overview.md +++ b/tests/integrations-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `integrations-worker` plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/integrations-worker/tsconfig.json b/tests/integrations-worker/tsconfig.json index 3a0e0d5..2743d29 100644 --- a/tests/integrations-worker/tsconfig.json +++ b/tests/integrations-worker/tsconfig.json @@ -13,6 +13,7 @@ "declarationMap": false, "baseUrl": ".", "paths": { + "@saas/db": ["../../packages/db/src/index.ts"], "@saas/contracts": [ "../../packages/contracts/src/index.ts" ], diff --git a/tests/membership-worker/component.yaml b/tests/membership-worker/component.yaml index 5ea23b2..53cf33b 100644 --- a/tests/membership-worker/component.yaml +++ b/tests/membership-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/membership-worker/docs/overview.md b/tests/membership-worker/docs/overview.md index 501a2ca..7bc0833 100644 --- a/tests/membership-worker/docs/overview.md +++ b/tests/membership-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `membership-worker` on plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/membership-worker/src/membership-worker.test.ts b/tests/membership-worker/src/membership-worker.test.ts index ec882e7..7a3effb 100644 --- a/tests/membership-worker/src/membership-worker.test.ts +++ b/tests/membership-worker/src/membership-worker.test.ts @@ -1182,7 +1182,7 @@ describe("pagination", () => { describe("wrangler config", () => { const __dirname = path.dirname(fileURLToPath(import.meta.url)); - const raw = fs.readFileSync(path.resolve(__dirname, "../../../apps/membership-worker/wrangler.jsonc"), "utf8"); + const raw = fs.readFileSync(path.resolve(__dirname, "../../../apps/membership-worker/wrangler.template.jsonc"), "utf8"); // Strip single-line comments for JSONC parsing const config = JSON.parse(raw.replace(/^\s*\/\/.*$/gm, "")); diff --git a/tests/metering-worker/component.yaml b/tests/metering-worker/component.yaml index 949fa2b..080fc7f 100644 --- a/tests/metering-worker/component.yaml +++ b/tests/metering-worker/component.yaml @@ -17,7 +17,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/metering-worker/docs/overview.md b/tests/metering-worker/docs/overview.md index e4824d2..a7a2571 100644 --- a/tests/metering-worker/docs/overview.md +++ b/tests/metering-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `metering-worker` on e plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/notifications-client/component.yaml b/tests/notifications-client/component.yaml index 890f1d9..a7e74ee 100644 --- a/tests/notifications-client/component.yaml +++ b/tests/notifications-client/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/notifications-client/docs/overview.md b/tests/notifications-client/docs/overview.md index cb8065e..0a348e0 100644 --- a/tests/notifications-client/docs/overview.md +++ b/tests/notifications-client/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `notifications-client` plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/notifications-worker/component.yaml b/tests/notifications-worker/component.yaml index b71e77a..56a2f6f 100644 --- a/tests/notifications-worker/component.yaml +++ b/tests/notifications-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/notifications-worker/docs/overview.md b/tests/notifications-worker/docs/overview.md index 99b84a3..a9397f3 100644 --- a/tests/notifications-worker/docs/overview.md +++ b/tests/notifications-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `notifications-worker` plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/platform-limits/component.yaml b/tests/platform-limits/component.yaml index 6060a43..8f401f2 100644 --- a/tests/platform-limits/component.yaml +++ b/tests/platform-limits/component.yaml @@ -17,7 +17,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/policy-engine/component.yaml b/tests/policy-engine/component.yaml index e4a704a..c7c67c9 100644 --- a/tests/policy-engine/component.yaml +++ b/tests/policy-engine/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/policy-engine/docs/overview.md b/tests/policy-engine/docs/overview.md index 00a7308..e4c6cc2 100644 --- a/tests/policy-engine/docs/overview.md +++ b/tests/policy-engine/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `policy-engine` on eve plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/policy-worker/component.yaml b/tests/policy-worker/component.yaml index 463c1ac..5e71eb9 100644 --- a/tests/policy-worker/component.yaml +++ b/tests/policy-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/policy-worker/docs/overview.md b/tests/policy-worker/docs/overview.md index 042242f..2ea1114 100644 --- a/tests/policy-worker/docs/overview.md +++ b/tests/policy-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `policy-worker` on eve plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/projects-worker/component.yaml b/tests/projects-worker/component.yaml index 80481b6..e5ae58f 100644 --- a/tests/projects-worker/component.yaml +++ b/tests/projects-worker/component.yaml @@ -17,7 +17,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/projects-worker/docs/overview.md b/tests/projects-worker/docs/overview.md index 0143f0b..190bf43 100644 --- a/tests/projects-worker/docs/overview.md +++ b/tests/projects-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `projects-worker` on e plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/web-console-next/component.yaml b/tests/web-console-next/component.yaml index d740088..c0b1404 100644 --- a/tests/web-console-next/component.yaml +++ b/tests/web-console-next/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "20" pnpmVersion: "10.12.1" diff --git a/tests/web-console-next/docs/overview.md b/tests/web-console-next/docs/overview.md index 27e4156..8ce2a3c 100644 --- a/tests/web-console-next/docs/overview.md +++ b/tests/web-console-next/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `web-console-next` on plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build From a6f400aaf5d3645e5021ad5553a412a0f8bb8581 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 15:02:55 +0000 Subject: [PATCH 2/8] docs(review): the tests still do not run, and the reason is upstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit said nineteen components "run them now". They do not. Its own CI went green and the db-tests lane reported seven steps instead of four, and neither of those is evidence a test ran. The log is: ✓ 04 pre-build 0.0s · Skipping pre-build. ✓ 06 build-package 3.8s ✓ 07 typecheck-package 2.3s stack-tectonic 0.20.0's turbo-package verify job guards pre-build with `{{if .preBuildCommand}}` — a top-level key nothing sets — while the command it would run reads `.parameters.preBuildCommand`. The guard is always false, so pre-build always skips. `buildCommand` and `typecheckCommand` carry the same mistake and only appear to work, because their `else` defaults are the commands every component here declares. So the profile flip is real and necessary, and it bought build and typecheck for nineteen components that ran neither; the suites themselves wait on a three-token fix in sourceplane/stack-tectonic, a release, and this repository moving its pin. orun-cloud's in-tree copy already reads `.parameters.*`, which is why its suites run — and stack-tectonic's own main is still 0.20.0 with the broken guards. REVIEW.md and TIMINGS.md now say what is true. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BfmHkwWeA1oPJGBNF3QSQH --- docs/components/REVIEW.md | 63 ++++++++++++++++++++++++++++++++++----- docs/phases/TIMINGS.md | 14 +++++---- 2 files changed, 63 insertions(+), 14 deletions(-) diff --git a/docs/components/REVIEW.md b/docs/components/REVIEW.md index f226d00..622334e 100644 --- a/docs/components/REVIEW.md +++ b/docs/components/REVIEW.md @@ -130,7 +130,52 @@ This repository had already written the finding down, in So `quick-check` skipped not only the tests but the build and typecheck as well. -### Fixed +### Half fixed: build and typecheck run now, the tests still do not + +Read this first, because the rest of the section is easy to over-read. Flipping +the profile was necessary and is done, and it brought **build and typecheck** to +nineteen components that ran neither. **The tests themselves still do not +execute in CI**, and the reason is not in this repository. + +The pull request that flipped the profile went green, and its `db-tests` lane +reported seven steps where it used to report four — exactly `verify`'s count. +Neither of those is evidence that a test ran, so the log was read: + +``` +✓ 04 pre-build 0.0s · Skipping pre-build. +✓ 06 build-package 3.8s +✓ 07 typecheck-package 2.3s +``` + +Pre-build skips itself, for every component, whatever it declares. The guard in +stack-tectonic 0.20.0's `turbo-package` verify job reads the wrong key: + +``` +{{if .preBuildCommand}} ← a top-level key nothing sets +{{.parameters.preBuildCommand}} ← where the value actually is +{{else}} +echo "Skipping pre-build." +``` + +`buildCommand` and `typecheckCommand` have the same mistake and only appear to +work: their guards are equally always-false, and their `else` defaults happen to +be the commands every component here declares. Pre-build has no default, so it is +the one that visibly breaks. + +**The fix is upstream**, in `sourceplane/stack-tectonic` — three guards, each +`.` → `.parameters.` — released as a new version, and then this +repository's `compositions.sources` pin moved to it. orun-cloud carries an +in-tree copy of the composition that already reads `.parameters.*`, which is +both why its suites run and the proof that the corrected guard works: its +`agents-worker-tests` pre-build ran for 29.9s and failed on real assertions. +stack-tectonic's own `main` is still `0.20.0` with the broken guards; the fix +never went back upstream. + +Every consumer pins an exact version, so a release changes nobody until they +move their pin. When lumen does, these nineteen start running — and all nineteen +have been run locally and pass (below). + +### The profile, and the suites made ready to run Nineteen components carry tests in `preBuildCommand`: the **seventeen** `tests/*` suites and two packages with their own, `cli` and `sdk`. An earlier @@ -175,17 +220,19 @@ template and its `wrangler.jsonc` is real. None of those passes was vacuous. `contracts`, `db`, `notifications-client`, `policy-engine`, `shared`, `testing`, `webhook-verifier`. None has a `preBuildCommand`: their tests live -in the matching `tests/*` suite, which now builds and typechecks them on every -plan that includes it. Moving them to `verify` would add their own build and +in the matching `tests/*` suite, which builds and typechecks them on every plan +that includes it. Moving them to `verify` would add their own build and typecheck lanes — defensible, but a different change from making tests run. ### What this costs a build -The 18 measured minutes in `docs/phases/TIMINGS.md` were taken **with these -suites not running.** They now run in the merge convergence of four phases — -`02-foundation` (6), `04-workers` (11), `05-edge` (2), `06-console` (1). Each -is its own lane, so the cost should sit near the slowest suite rather than the -sum, but that is a prediction; the next measured build is what will say. +The 18 measured minutes in `docs/phases/TIMINGS.md` were taken under +`quick-check`. On `verify` the nineteen add a **build and a typecheck** to the +merge convergences of four phases — `02-foundation` (6), `04-workers` (11), +`05-edge` (2), `06-console` (1) — and, once the composition is fixed, the +suites themselves. Each is its own lane, so the cost should sit near the slowest +one rather than the sum, but that is a prediction; the next measured build is +what will say. ## Declared product URLs diff --git a/docs/phases/TIMINGS.md b/docs/phases/TIMINGS.md index cd19caf..08e2aff 100644 --- a/docs/phases/TIMINGS.md +++ b/docs/phases/TIMINGS.md @@ -55,12 +55,14 @@ slow case rather than the fast one. What could still make a build slower than one condition on `06-console` below. A second measured run belongs on this page beside the first rather than replacing it. -**The run predates the test suites running.** Nineteen components were on the -`quick-check` profile, which runs no tests, no build and no typecheck; they are -on `verify` now and execute inside the merge convergences of `02-foundation`, -`04-workers`, `05-edge` and `06-console` (`docs/components/REVIEW.md`). Each is -its own lane, so the cost should land near the slowest suite rather than the -sum — but that is a prediction, and the next measured build is the answer. +**The run predates two changes to what CI does.** Nineteen components were on +the `quick-check` profile, which runs no tests, no build and no typecheck. They +are on `verify` now, which adds a build and a typecheck inside the merge +convergences of `02-foundation`, `04-workers`, `05-edge` and `06-console` — and +will add the suites themselves once stack-tectonic's pre-build guard is fixed +upstream; until then pre-build skips itself (`docs/components/REVIEW.md`). Each +is its own lane, so the cost should land near the slowest rather than the sum — +but that is a prediction, and the next measured build is the answer. **One condition on `06-console`'s 2.** The console is fetched only when the baseline tag being built from has a published artifact for exactly these From b23e69de3df7e65b0e1486a81da5e25ca286fe05 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 15:14:43 +0000 Subject: [PATCH 3/8] =?UTF-8?q?fix(ci):=20the=20test=20suites'=20tests=20r?= =?UTF-8?q?un=20=E2=80=94=20turbo-package's=20guard=20is=20fixed=20in-tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stack-tectonic 0.20.0's turbo-package guards pre-build on `{{if .preBuildCommand}}`, a key orun's template context never has (it has .orun, .parameters and .env), so pre-build skipped itself on every component and no suite's tests ran even on `verify`. build and typecheck carry the same mistake and only worked because their defaults match. The fix belongs upstream and could not be released from here, so stack-tectonic-fixes/ carries 0.20.0's turbo-package with the three guards reading `.parameters.*` and nothing else, and intent.yaml binds that one type to it. Every other composition is still the OCI artifact. - testing/composition-fixes.test.sh undoes the fixes and requires the published hashes, fails on any pin but 0.20.0 while the copy exists, and requires the module to land with intent.yaml (01-scaffold) - orun plan --all-envs before/after: 92 jobs, 610 steps, exactly the 19 pre-build steps differ, now `pnpm exec turbo run test --filter=./` - a placed, branded product receives the copy byte for byte and plans the same command Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BfmHkwWeA1oPJGBNF3QSQH --- .github/workflows/baseline.yml | 4 +- README.md | 5 + ai/context/decisions.md | 8 + docs/components/REVIEW.md | 60 ++++--- docs/phases/TIMINGS.md | 12 +- intent.yaml | 11 ++ repo-blueprint.yaml | 15 +- specs/core/repo.md | 5 +- stack-tectonic-fixes/README.md | 52 ++++++ .../compositions/turbo-package/README.md | 39 +++++ .../turbo-package/composition.yaml | 26 +++ .../jobs/turbo-package-verify.yaml | 76 +++++++++ .../profiles/turbo-package-quick-check.yaml | 14 ++ .../profiles/turbo-package-verify.yaml | 17 ++ .../compositions/turbo-package/schema.yaml | 38 +++++ stack-tectonic-fixes/stack.yaml | 17 ++ stack-tectonic-fixes/upstream-0.20.0.sha256 | 6 + testing/composition-fixes.test.sh | 160 ++++++++++++++++++ testing/phases.test.sh | 6 +- 19 files changed, 535 insertions(+), 36 deletions(-) create mode 100644 stack-tectonic-fixes/README.md create mode 100644 stack-tectonic-fixes/compositions/turbo-package/README.md create mode 100644 stack-tectonic-fixes/compositions/turbo-package/composition.yaml create mode 100644 stack-tectonic-fixes/compositions/turbo-package/jobs/turbo-package-verify.yaml create mode 100644 stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-quick-check.yaml create mode 100644 stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-verify.yaml create mode 100644 stack-tectonic-fixes/compositions/turbo-package/schema.yaml create mode 100644 stack-tectonic-fixes/stack.yaml create mode 100644 stack-tectonic-fixes/upstream-0.20.0.sha256 create mode 100644 testing/composition-fixes.test.sh diff --git a/.github/workflows/baseline.yml b/.github/workflows/baseline.yml index 98b4901..c0d2016 100644 --- a/.github/workflows/baseline.yml +++ b/.github/workflows/baseline.yml @@ -51,11 +51,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - name: Contract tests (manifest, phases, coverage, rebrand, retouch, bootstrap-defer, fleet-stubs, pen-reset, console-artifact) + - name: Contract tests (manifest, phases, coverage, rebrand, retouch, bootstrap-defer, fleet-stubs, pen-reset, console-artifact, composition-fixes) run: | set -euo pipefail python3 -c 'import yaml' 2>/dev/null || pip install --quiet pyyaml - for t in manifest phases coverage rebrand retouch bootstrap-defer fleet-stubs pen-reset console-artifact; do + for t in manifest phases coverage rebrand retouch bootstrap-defer fleet-stubs pen-reset console-artifact composition-fixes; do echo "── $t" bash "testing/$t.test.sh" done diff --git a/README.md b/README.md index de2dc1e..dbe8fbf 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,11 @@ consumed from the published catalog at [sourceplane/stack-tectonic](https://github.com/sourceplane/stack-tectonic), released there, and adopted here by bumping the pinned tag. +One composition is the temporary exception: `stack-tectonic-fixes/` carries +0.20.0's `turbo-package` with its step guards fixed, because the published one +skips every test suite's tests. Its README says what changed and how to delete +it once a release carries the fix. + ## CI CI is powered by [Orun](https://github.com/sourceplane/orun) with the local Stack Tectonic diff --git a/ai/context/decisions.md b/ai/context/decisions.md index 2f5c1f9..6a5914e 100644 --- a/ai/context/decisions.md +++ b/ai/context/decisions.md @@ -49,6 +49,14 @@ Last updated: 2026-05-26 was already producing drift against `orun-cloud`. The tag is pinned, never `latest`, so a catalog release cannot change this repo's execution contracts without a commit here. +- One exception, temporary (2026-10-26): `turbo-package` is bound to the + in-tree `stack-tectonic-fixes/`, which is 0.20.0's copy with its pre-build, + build and typecheck guards reading `.parameters.*`. The published guards read + keys orun never sets, so pre-build skipped every test suite's tests, and the + fix could not be released upstream from the change that found it. + `testing/composition-fixes.test.sh` holds the copy to the published files + plus those three tokens and fails on any other pin; delete the copy when a + release carries the fix. - All component types use `spec.parameters` instead of `spec.inputs` on the current Orun runtime. - Cloudflare/Supabase human-provided resources discovered in Task 0002 remain diff --git a/docs/components/REVIEW.md b/docs/components/REVIEW.md index 622334e..9436b40 100644 --- a/docs/components/REVIEW.md +++ b/docs/components/REVIEW.md @@ -130,16 +130,12 @@ This repository had already written the finding down, in So `quick-check` skipped not only the tests but the build and typecheck as well. -### Half fixed: build and typecheck run now, the tests still do not +### Two fixes, not one: the profile, and a guard in the composition -Read this first, because the rest of the section is easy to over-read. Flipping -the profile was necessary and is done, and it brought **build and typecheck** to -nineteen components that ran neither. **The tests themselves still do not -execute in CI**, and the reason is not in this repository. - -The pull request that flipped the profile went green, and its `db-tests` lane -reported seven steps where it used to report four — exactly `verify`'s count. -Neither of those is evidence that a test ran, so the log was read: +Flipping the profile was necessary and not sufficient. The pull request that +flipped it went green, and its `db-tests` lane reported seven steps where it +used to report four — exactly `verify`'s count. Neither of those is evidence +that a test ran, so the log was read: ``` ✓ 04 pre-build 0.0s · Skipping pre-build. @@ -147,11 +143,12 @@ Neither of those is evidence that a test ran, so the log was read: ✓ 07 typecheck-package 2.3s ``` -Pre-build skips itself, for every component, whatever it declares. The guard in -stack-tectonic 0.20.0's `turbo-package` verify job reads the wrong key: +Pre-build skipped itself, for every component, whatever it declared. The guard +in stack-tectonic 0.20.0's `turbo-package` verify job reads a key orun never +sets: ``` -{{if .preBuildCommand}} ← a top-level key nothing sets +{{if .preBuildCommand}} ← orun's context has .orun, .parameters, .env {{.parameters.preBuildCommand}} ← where the value actually is {{else}} echo "Skipping pre-build." @@ -162,18 +159,33 @@ work: their guards are equally always-false, and their `else` defaults happen to be the commands every component here declares. Pre-build has no default, so it is the one that visibly breaks. -**The fix is upstream**, in `sourceplane/stack-tectonic` — three guards, each -`.` → `.parameters.` — released as a new version, and then this -repository's `compositions.sources` pin moved to it. orun-cloud carries an -in-tree copy of the composition that already reads `.parameters.*`, which is -both why its suites run and the proof that the corrected guard works: its +**The fix belongs upstream** — three guards in `sourceplane/stack-tectonic`, +each `.` → `.parameters.` — and could not be made there from this +change. stack-tectonic's own `main` is still `0.20.0` with the broken guards. +orun-cloud carries an in-tree copy that already reads `.parameters.*`, which is +why its suites run, and the proof the corrected guard works: its `agents-worker-tests` pre-build ran for 29.9s and failed on real assertions. -stack-tectonic's own `main` is still `0.20.0` with the broken guards; the fix -never went back upstream. -Every consumer pins an exact version, so a release changes nobody until they -move their pin. When lumen does, these nineteen start running — and all nineteen -have been run locally and pass (below). +**So the fix lives here until it ships there.** `stack-tectonic-fixes/` is +0.20.0's `turbo-package` with those three guards corrected and nothing else, and +`intent.yaml` binds that one composition type to it; every other composition is +still the pinned OCI artifact. It breaks this repository's rule that +compositions are not vendored, and it is fenced accordingly: + +- `testing/composition-fixes.test.sh` undoes the three fixes and requires every + file to hash to what 0.20.0 published, so the copy cannot become the place a + step gets changed; +- the same gate fails on any stack-tectonic pin other than 0.20.0 while the + directory exists, so moving the pin is when somebody decides whether the copy + is still needed; +- the directory ships to products in `01-scaffold`, the phase that ships the + `intent.yaml` naming it — a product's first plan needs both. + +**Checked by rendering, not by reading.** `orun plan --all-envs` before and +after: 92 jobs and 610 steps either way, and exactly 19 steps differ — the +pre-build of the nineteen components below, from `echo "Skipping pre-build."` to +`pnpm exec turbo run test --filter=./`. A product placed and branded from the +blueprint receives the directory byte for byte and plans the same command. ### The profile, and the suites made ready to run @@ -229,8 +241,8 @@ typecheck lanes — defensible, but a different change from making tests run. The 18 measured minutes in `docs/phases/TIMINGS.md` were taken under `quick-check`. On `verify` the nineteen add a **build and a typecheck** to the merge convergences of four phases — `02-foundation` (6), `04-workers` (11), -`05-edge` (2), `06-console` (1) — and, once the composition is fixed, the -suites themselves. Each is its own lane, so the cost should sit near the slowest +`05-edge` (2), `06-console` (1) — and the suites +themselves. Each is its own lane, so the cost should sit near the slowest one rather than the sum, but that is a prediction; the next measured build is what will say. diff --git a/docs/phases/TIMINGS.md b/docs/phases/TIMINGS.md index 08e2aff..04dd2f0 100644 --- a/docs/phases/TIMINGS.md +++ b/docs/phases/TIMINGS.md @@ -57,12 +57,12 @@ page beside the first rather than replacing it. **The run predates two changes to what CI does.** Nineteen components were on the `quick-check` profile, which runs no tests, no build and no typecheck. They -are on `verify` now, which adds a build and a typecheck inside the merge -convergences of `02-foundation`, `04-workers`, `05-edge` and `06-console` — and -will add the suites themselves once stack-tectonic's pre-build guard is fixed -upstream; until then pre-build skips itself (`docs/components/REVIEW.md`). Each -is its own lane, so the cost should land near the slowest rather than the sum — -but that is a prediction, and the next measured build is the answer. +are on `verify` now, and `turbo-package`'s pre-build guard, which skipped +every suite's tests, is fixed in-tree (`docs/components/REVIEW.md`). Together +they add the suites, a build and a typecheck inside the merge convergences of +`02-foundation`, `04-workers`, `05-edge` and `06-console`. Each is its own +lane, so the cost should land near the slowest rather than the sum — but that +is a prediction, and the next measured build is the answer. **One condition on `06-console`'s 2.** The console is fetched only when the baseline tag being built from has a published artifact for exactly these diff --git a/intent.yaml b/intent.yaml index 719641d..d1bc552 100644 --- a/intent.yaml +++ b/intent.yaml @@ -51,6 +51,16 @@ compositions: - name: stack-tectonic kind: oci ref: oci://ghcr.io/sourceplane/stack-tectonic:0.20.0 + # ONE composition patched in-tree, until stack-tectonic releases the fix. + # 0.20.0's turbo-package guards its pre-build, build and typecheck steps on + # `.preBuildCommand` where the value is `.parameters.preBuildCommand`, so + # pre-build skips itself on every component — and pre-build is where every + # test suite here keeps its tests. The binding below takes `turbo-package` + # alone from this copy; everything else is still the OCI artifact. + # stack-tectonic-fixes/README.md says how to delete it. + - name: stack-tectonic-fixes + kind: dir + path: stack-tectonic-fixes resolution: precedence: - stack-tectonic @@ -58,6 +68,7 @@ compositions: terraform: stack-tectonic cloudflare-domain: stack-tectonic db-migrate: stack-tectonic + turbo-package: stack-tectonic-fixes discovery: roots: diff --git a/repo-blueprint.yaml b/repo-blueprint.yaml index b22df68..289cc7f 100644 --- a/repo-blueprint.yaml +++ b/repo-blueprint.yaml @@ -527,6 +527,19 @@ modules: # are made in sourceplane/stack-tectonic, released there, and adopted by # bumping the pinned tag — in the fork exactly as in the baseline. # + # ONE EXCEPTION, AND IT IS TEMPORARY. 0.20.0's `turbo-package` guards its + # pre-build step on a key orun never sets, so every test suite's tests skip + # themselves. `stack-tectonic-fixes/` is that one composition with the guard + # fixed, and `intent.yaml` binds `turbo-package` to it — so a product's + # intent names the directory and has to receive it, in the same phase as + # the intent. `testing/composition-fixes.test.sh` holds it to the published + # files plus the fix and nothing else; its README says how to delete it. + - name: stack-tectonic-fixes + mode: copy + source: baseline + from: stack-tectonic-fixes + to: stack-tectonic-fixes + # # Only the tooling a PRODUCT runs: shared TS/ESLint config and the # deploy-time wrangler renderer. This was `from: tooling`, the whole # directory, and every product shipped the factory with it — the rebrand @@ -961,7 +974,7 @@ phases: start: 'Creating the repository and its foundations.' done: '{{ .inputs.githuborg }}/{{ .inputs.reponame }} has its foundations on main, branded as {{ .inputs.productname }}, in {{ .meta.elapsed }}.' failed: 'The repository did not get off the ground; the failing step says why.' - modules: [ai-deployment, ai-operations, discovery-roots, github-workflows, rebrand-values, root-agents, root-gitignore, root-intent, root-package-json, root-pnpm-lock, root-pnpm-workspace, root-readme, root-turbo, tooling-deploy, tooling-eslint, tooling-tsconfig, tooling-wire] + modules: [ai-deployment, ai-operations, discovery-roots, github-workflows, rebrand-values, root-agents, root-gitignore, root-intent, root-package-json, root-pnpm-lock, root-pnpm-workspace, root-readme, root-turbo, stack-tectonic-fixes, tooling-deploy, tooling-eslint, tooling-tsconfig, tooling-wire] # 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 diff --git a/specs/core/repo.md b/specs/core/repo.md index ccd1ed0..21229ea 100644 --- a/specs/core/repo.md +++ b/specs/core/repo.md @@ -230,7 +230,10 @@ for Terraform, S3 backend, and environment structure. - **The composition stack** is owned by `sourceplane/stack-tectonic` and consumed as a pinned OCI artifact. It is not vendored in this repo; composition changes are made, verified and released there, then adopted here by bumping the pinned - version in `intent.yaml`. + version in `intent.yaml`. The one temporary exception is + `stack-tectonic-fixes/` — 0.20.0's `turbo-package` with its step guards + fixed, bound alone in `intent.yaml`, held to the published files by + `testing/composition-fixes.test.sh` and deleted once a release carries the fix. - **`intent.yaml`** records discovery roots, composition sources and bindings, trigger bindings, and `dev` -> `stage` -> `prod` environment promotion. It uses `parameterDefaults.terraform` and `env.AWS_REGION` like `aws-admin`. diff --git a/stack-tectonic-fixes/README.md b/stack-tectonic-fixes/README.md new file mode 100644 index 0000000..c609150 --- /dev/null +++ b/stack-tectonic-fixes/README.md @@ -0,0 +1,52 @@ +# stack-tectonic-fixes — one composition, patched until upstream ships the fix + +This directory exists to be deleted. It holds a single composition, +`turbo-package`, copied from the published stack-tectonic **0.20.0** with a +three-token fix, and `intent.yaml` binds that one composition type to it. Every +other composition still comes from the pinned OCI artifact. + +## What is wrong upstream + +0.20.0's `jobs/turbo-package-verify.yaml` guards each optional step on a key +the job's template context does not have: + +``` +{{if .preBuildCommand}} ← orun's context has no top-level parameters +{{.parameters.preBuildCommand}} ← the value is here +{{else}} +echo "Skipping pre-build." +``` + +orun gives a job template three namespaces — `.orun`, `.parameters` and +`.env` — so `.preBuildCommand` is always empty, and **pre-build skips itself +on every component, whatever the component declares**. In this repository +that is every test suite: their tests are their `preBuildCommand`. `build` and +`typecheck` have the same mistake and only appear to work, because their +`else` defaults are the commands every component here declares anyway. + +The fix is `.` → `.parameters.` in those three guards, and nothing +else. `upstream-0.20.0.sha256` records the published files. The baseline this +repository was built from has a contract test that reverses the three fixes +and requires the result to hash to exactly those files, so the copy a product +receives is the published one plus the fix. To check it here: + +``` +sed -e 's/if \.parameters\.\(preBuildCommand\|buildCommand\|typecheckCommand\)}}/if .\1}}/' \ + compositions/turbo-package/jobs/turbo-package-verify.yaml | sha256sum +``` + +prints the `jobs/turbo-package-verify.yaml` line of `upstream-0.20.0.sha256`, +and every other file hashes as recorded. + +## Deleting it + +When a stack-tectonic release reads `.parameters.*` in those guards: + +1. bump the pin in `intent.yaml` (`compositions.sources`, `stack-tectonic`); +2. delete the `stack-tectonic-fixes` source and the `turbo-package` binding + beside it; +3. delete this directory — and, in the baseline, its module in + `repo-blueprint.yaml`. + +The baseline's contract test fails on any pin other than 0.20.0 while this +directory exists, so moving the pin is the moment somebody has to decide. diff --git a/stack-tectonic-fixes/compositions/turbo-package/README.md b/stack-tectonic-fixes/compositions/turbo-package/README.md new file mode 100644 index 0000000..e12cf0d --- /dev/null +++ b/stack-tectonic-fixes/compositions/turbo-package/README.md @@ -0,0 +1,39 @@ +# turbo-package + +`turbo-package` is an exported Orun composition in the Stack Tectonic catalog. + +## Purpose + +Verify a shared package in a pnpm + Turborepo monorepo: install the workspace +with a frozen lockfile, run an optional pre-build, check the package has a +`package.json`, then build and typecheck it. Build and typecheck default to +`pnpm exec turbo run --filter=./` when no command is given. + +This composition only verifies — it publishes and deploys nothing. + +## Contract + +- **Type:** `turbo-package` +- **Path:** `compositions/turbo-package` +- **Composition:** `composition.yaml` +- **Schema:** `schema.yaml` — the authoritative parameter contract +- **Job:** `verify` (default) — `jobs/turbo-package-verify.yaml` +- **Default profile:** `verify` +- **Required parameters:** `nodeVersion`, `pnpmVersion` +- **Optional parameters:** `preBuildCommand`, `buildCommand`, `typecheckCommand` + +## Profiles + +Each file in `profiles/` selects steps from the job by capability. + +| Profile | Steps | +| ------------------ | ----- | +| `quick-check` | setup-node → setup-pnpm → install → verify-structure | +| `verify` (default) | setup-node → setup-pnpm → install → pre-build → verify-structure → build → typecheck | + +## Verification + +`./scripts/verify.sh` is the catalog's only gate. It asserts that this +directory's `composition.yaml` has a `metadata.name` and `spec.type` matching +the directory, that `schema.yaml` and `jobs/` exist beside it, then packs the +catalog and confirms `turbo-package` exports from the packed artifact. diff --git a/stack-tectonic-fixes/compositions/turbo-package/composition.yaml b/stack-tectonic-fixes/compositions/turbo-package/composition.yaml new file mode 100644 index 0000000..62a24ab --- /dev/null +++ b/stack-tectonic-fixes/compositions/turbo-package/composition.yaml @@ -0,0 +1,26 @@ +apiVersion: sourceplane.io/v1alpha1 +kind: Composition +metadata: + name: turbo-package +spec: + type: turbo-package + description: Turborepo package verification jobs + + schemaRef: + name: turbo-package-component + + defaultJob: verify + defaultProfile: verify + + jobs: + - name: verify + templateRef: + name: turbo-package-verify + + profiles: + - name: quick-check + profileRef: + name: turbo-package-quick-check + - name: verify + profileRef: + name: turbo-package-verify diff --git a/stack-tectonic-fixes/compositions/turbo-package/jobs/turbo-package-verify.yaml b/stack-tectonic-fixes/compositions/turbo-package/jobs/turbo-package-verify.yaml new file mode 100644 index 0000000..f0f6090 --- /dev/null +++ b/stack-tectonic-fixes/compositions/turbo-package/jobs/turbo-package-verify.yaml @@ -0,0 +1,76 @@ +apiVersion: sourceplane.io/v1alpha1 +kind: JobTemplate +metadata: + name: turbo-package-verify +spec: + description: Install the workspace and validate a shared package + runsOn: ubuntu-22.04 + timeout: 25m + retries: 0 + + labels: + scope: verify + + capabilities: + - turbo-package.setup-node + - turbo-package.setup-pnpm + - turbo-package.install + - turbo-package.pre-build + - turbo-package.verify-structure + - turbo-package.build + - turbo-package.typecheck + + steps: + # setup-pnpm runs before setup-node so setup-node can warm and persist the + # pnpm store cache (keyed on the workspace lockfile). + - id: setup-pnpm + name: setup-pnpm + capability: turbo-package.setup-pnpm + use: pnpm/action-setup@v4 + with: + version: "{{.parameters.pnpmVersion}}" + + - id: setup-node + name: setup-node + capability: turbo-package.setup-node + use: actions/setup-node@v6 + with: + node-version: "{{.parameters.nodeVersion}}" + cache: pnpm + cache-dependency-path: "**/pnpm-lock.yaml" + + - id: install-workspace-dependencies + name: install-workspace-dependencies + capability: turbo-package.install + run: pnpm install --frozen-lockfile + onFailure: stop + + - id: pre-build + name: pre-build + capability: turbo-package.pre-build + shell: bash + run: | + {{if .parameters.preBuildCommand}} + {{.parameters.preBuildCommand}} + {{else}} + echo "Skipping pre-build." + {{end}} + onFailure: stop + + - id: verify-package-structure + name: verify-package-structure + capability: turbo-package.verify-structure + run: test -f package.json + onFailure: stop + + - id: build-package + name: build-package + capability: turbo-package.build + run: "{{if .parameters.buildCommand}}{{.parameters.buildCommand}}{{else}}pnpm exec turbo run build --filter=./{{end}}" + onFailure: stop + + - id: typecheck-package + name: typecheck-package + capability: turbo-package.typecheck + run: "{{if .parameters.typecheckCommand}}{{.parameters.typecheckCommand}}{{else}}pnpm exec turbo run typecheck --filter=./{{end}}" + onFailure: stop diff --git a/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-quick-check.yaml b/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-quick-check.yaml new file mode 100644 index 0000000..8ec1d31 --- /dev/null +++ b/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-quick-check.yaml @@ -0,0 +1,14 @@ +apiVersion: sourceplane.io/v1alpha1 +kind: ExecutionProfile +metadata: + name: turbo-package-quick-check +spec: + description: Quick check with setup and structure verification only + + jobs: + verify: + includeCapabilities: + - turbo-package.setup-node + - turbo-package.setup-pnpm + - turbo-package.install + - turbo-package.verify-structure diff --git a/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-verify.yaml b/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-verify.yaml new file mode 100644 index 0000000..8297fb6 --- /dev/null +++ b/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-verify.yaml @@ -0,0 +1,17 @@ +apiVersion: sourceplane.io/v1alpha1 +kind: ExecutionProfile +metadata: + name: turbo-package-verify +spec: + description: Full verification with build and typecheck + + jobs: + verify: + includeCapabilities: + - turbo-package.setup-node + - turbo-package.setup-pnpm + - turbo-package.install + - turbo-package.pre-build + - turbo-package.verify-structure + - turbo-package.build + - turbo-package.typecheck diff --git a/stack-tectonic-fixes/compositions/turbo-package/schema.yaml b/stack-tectonic-fixes/compositions/turbo-package/schema.yaml new file mode 100644 index 0000000..c2e7d74 --- /dev/null +++ b/stack-tectonic-fixes/compositions/turbo-package/schema.yaml @@ -0,0 +1,38 @@ +apiVersion: sourceplane.io/v1alpha1 +kind: ComponentSchema +metadata: + name: turbo-package-component +spec: + type: turbo-package + schema: + $schema: http://json-schema.org/draft-07/schema# + title: Turbo Package Component + type: object + required: + - name + - type + - parameters + properties: + name: + type: string + type: + type: string + const: turbo-package + parameters: + type: object + required: + - nodeVersion + - pnpmVersion + properties: + nodeVersion: + type: string + pnpmVersion: + type: string + preBuildCommand: + type: string + buildCommand: + type: string + typecheckCommand: + type: string + additionalProperties: false + additionalProperties: true diff --git a/stack-tectonic-fixes/stack.yaml b/stack-tectonic-fixes/stack.yaml new file mode 100644 index 0000000..ee87c7b --- /dev/null +++ b/stack-tectonic-fixes/stack.yaml @@ -0,0 +1,17 @@ +apiVersion: orun.io/v1 +kind: Stack +metadata: + name: stack-tectonic-fixes + title: Stack Tectonic 0.20.0, with turbo-package's step guards fixed + # 0.20.0 plus this repository's patch. Not a release of stack-tectonic and + # not to be published: delete this directory once a stack-tectonic release + # carries the fix (README.md says how). + version: 0.20.0-guards.1 + description: turbo-package from stack-tectonic 0.20.0 with its pre-build, build and typecheck guards reading the parameters they test. + owner: sourceplane + tags: + - turbo + - monorepo +spec: + compositions: + - path: compositions/turbo-package/composition.yaml diff --git a/stack-tectonic-fixes/upstream-0.20.0.sha256 b/stack-tectonic-fixes/upstream-0.20.0.sha256 new file mode 100644 index 0000000..6d29118 --- /dev/null +++ b/stack-tectonic-fixes/upstream-0.20.0.sha256 @@ -0,0 +1,6 @@ +53765117e50624669e2e7215e7c0602e6ef78181b0703069fdc332e89dbe0760 compositions/turbo-package/README.md +1cfc47b31227ab96a293279d2fd7c9b8690a09c8515342aae30a73fb1bd54b0d compositions/turbo-package/composition.yaml +ec388b1ba62e2a6da2107eab56e33d91ff32c1c60deca53bd35f736eb5767b0c compositions/turbo-package/jobs/turbo-package-verify.yaml +cb77d979dd3cd58a15bccab632dbb0760bda1e70e1e1e0ba65d50e5786b26fdc compositions/turbo-package/profiles/turbo-package-quick-check.yaml +acbad9fbad74c8afbcdd4ee3ebb9d39770e85cf70861cbae17c45c5c7201e7ec compositions/turbo-package/profiles/turbo-package-verify.yaml +b91897cd1bb5d26bd7ea84595ec07fc2e507e8d7bf849478efccb7add07390e3 compositions/turbo-package/schema.yaml diff --git a/testing/composition-fixes.test.sh b/testing/composition-fixes.test.sh new file mode 100644 index 0000000..65f863b --- /dev/null +++ b/testing/composition-fixes.test.sh @@ -0,0 +1,160 @@ +#!/usr/bin/env bash +# THE IN-TREE COMPOSITION IS THE PUBLISHED ONE PLUS ITS FIX, AND NOTHING ELSE. +# +# `stack-tectonic-fixes/` holds stack-tectonic 0.20.0's `turbo-package` with +# three guards corrected (`{{if .preBuildCommand}}` → `{{if +# .parameters.preBuildCommand}}`, and the same for build and typecheck), and +# `intent.yaml` binds that one composition type to it. A vendored copy is how +# execution contracts drift: somebody edits it to fix a product, and the +# product now runs something no release of stack-tectonic contains. This gate +# keeps the copy to exactly the published files plus that fix: +# +# 1. undo the three fixes and every file must hash to what 0.20.0 published +# (`upstream-.sha256`, recorded from the OCI artifact); +# 2. the pin in `intent.yaml` must still be that version, so moving the pin +# is when somebody has to decide whether the copy is still needed; +# 3. the binding, the source and the blueprint module must all be present, +# and the module must land in the phase that lands `intent.yaml`, since +# that file names the directory; +# 4. once the directory is deleted, nothing may still name it. +# +# bash + python3 + PyYAML. No network, no orun, no credential. +set -euo pipefail +here="$(cd "$(dirname "$0")" && pwd)" +root="$(cd "$here/.." && pwd)" + +echo "── the in-tree turbo-package against the release it patches" +python3 - "$root" <<'PY' +import hashlib, pathlib, re, sys + +try: + import yaml +except ImportError: + sys.exit("PyYAML is required for this gate (pip install pyyaml)") + +root = pathlib.Path(sys.argv[1]) +fixes = root / "stack-tectonic-fixes" +NAME = "stack-tectonic-fixes" +problems = [] +def bad(m): problems.append(m) + +intent = yaml.safe_load((root / "intent.yaml").read_text()) +comp = intent.get("compositions") or {} +sources = {s["name"]: s for s in comp.get("sources") or []} +bindings = (comp.get("resolution") or {}).get("bindings") or {} +bp = yaml.safe_load((root / "repo-blueprint.yaml").read_text()) +modules = {m["name"]: m for m in bp.get("modules") or []} +phase_of = {n: ph["name"] for ph in bp.get("phases") or [] for n in ph.get("modules") or []} + +if not fixes.is_dir(): + # Deleted, as its README asks once upstream ships the fix. Then nothing + # may still point at it: a product's intent naming a directory it never + # received fails its first plan. + if NAME in sources: + bad(f"intent.yaml still declares the {NAME} source, and the directory is gone") + stale = sorted(t for t, s in bindings.items() if s == NAME) + if stale: + bad(f"intent.yaml still binds {stale} to {NAME}, and the directory is gone") + if NAME in modules: + bad(f"repo-blueprint.yaml still has a {NAME} module, and the directory is gone") + if problems: + print("\n".join(f"FAIL: {p}" for p in problems), file=sys.stderr) + sys.exit(1) + print(" no in-tree compositions, and nothing names one") + sys.exit(0) + +# ── which release it patches ─────────────────────────────────────────────── +records = sorted(fixes.glob("upstream-*.sha256")) +if len(records) != 1: + sys.exit(f"FAIL: want exactly one upstream-.sha256 in {NAME}/, found {len(records)}") +version = records[0].name[len("upstream-"):-len(".sha256")] +recorded = {} +for line in records[0].read_text().splitlines(): + if line.strip(): + digest, path = line.split(None, 1) + recorded[path.strip()] = digest +if not recorded: + sys.exit(f"FAIL: {records[0].name} records no files — this check has gone blind") + +upstream = sources.get("stack-tectonic") or {} +ref = upstream.get("ref", "") +if not ref.endswith(f":{version}"): + bad(f"intent.yaml pins stack-tectonic at {ref!r}, but {NAME}/ patches {version}. " + f"Moving the pin is the moment to decide: if the new release reads " + f".parameters.* in turbo-package's guards, delete {NAME}/ as its README " + f"says; if not, copy turbo-package from the new release, reapply the " + f"three fixes and record its hashes as upstream-.sha256") + +# ── wired: the source, the binding, the module, the phase ────────────────── +src = sources.get(NAME) +if not src: + bad(f"intent.yaml does not declare the {NAME} source, so the copy is dead") +elif src.get("kind") != "dir" or src.get("path") != NAME: + bad(f"the {NAME} source must be kind: dir, path: {NAME} (is {src.get('kind')!r}, {src.get('path')!r})") +if bindings.get("turbo-package") != NAME: + bad(f"intent.yaml does not bind turbo-package to {NAME}, so the published " + f"composition still wins and pre-build still skips itself") + +stack = yaml.safe_load((fixes / "stack.yaml").read_text()) +exported = sorted(pathlib.PurePosixPath(e["path"]).parent.name + for e in (stack.get("spec") or {}).get("compositions") or []) +if exported != ["turbo-package"]: + bad(f"{NAME}/stack.yaml exports {exported}; it is for turbo-package alone — " + f"any other fix belongs upstream, or in an argued diff to this gate") +others = sorted(t for t, s in bindings.items() if s == NAME and t != "turbo-package") +if others: + bad(f"intent.yaml binds {others} to {NAME}, which exports only turbo-package") + +mod = modules.get(NAME) +if not mod: + bad(f"no blueprint module places {NAME}/ — every product's intent names it, " + f"so every product's first plan would fail") +else: + if (mod.get("from"), mod.get("to")) != (NAME, NAME): + bad(f"module {NAME} copies {mod.get('from')!r} → {mod.get('to')!r}, not {NAME} → {NAME}") + if phase_of.get(NAME) != phase_of.get("root-intent"): + bad(f"module {NAME} lands in {phase_of.get(NAME)}, but intent.yaml (which " + f"names it) lands in {phase_of.get('root-intent')}; between the two, " + f"the product cannot plan") + +# ── the files: the published ones, plus the three fixes, plus nothing ────── +FIXES = [(f"{{{{if .{k}}}}}", f"{{{{if .parameters.{k}}}}}") + for k in ("preBuildCommand", "buildCommand", "typecheckCommand")] +JOB = "compositions/turbo-package/jobs/turbo-package-verify.yaml" +present = sorted(p.relative_to(fixes).as_posix() for p in fixes.rglob("*") + if p.is_file() and p.relative_to(fixes).parts[0] == "compositions") +for extra in sorted(set(present) - set(recorded)): + bad(f"{NAME}/{extra} is not a file {version} published") +for missing in sorted(set(recorded) - set(present)): + bad(f"{NAME}/{missing} is missing — {version} published it") + +for rel in sorted(set(present) & set(recorded)): + text = (fixes / rel).read_text() + if rel == JOB: + for broken, fixed in FIXES: + n = text.count(fixed) + if n != 1: + bad(f"{rel} carries {fixed!r} {n} time(s), want exactly 1") + text = text.replace(fixed, broken) + if hashlib.sha256(text.encode()).hexdigest() != recorded[rel]: + bad(f"{NAME}/{rel} differs from {version} by more than the three guard " + f"fixes. The copy is not a place to change what a step does: make the " + f"change in sourceplane/stack-tectonic") + +# Every guard in the job reads a namespace orun's template context has. This +# is the bug itself, stated as a rule, so a re-copy from a later release that +# still has it fails here rather than in a lane that quietly skips its tests. +NAMESPACES = {"orun", "parameters", "env"} +job = (fixes / JOB).read_text() +for key in re.findall(r"\{\{-?\s*if\s+\.([A-Za-z_]\w*)", job): + if key not in NAMESPACES: + bad(f"{JOB} guards on .{key}, which orun's template context does not " + f"have (it has .orun, .parameters and .env) — that step always takes " + f"its else branch") + +if problems: + print("\n".join(f"FAIL: {p}" for p in problems), file=sys.stderr) + sys.exit(1) +print(f" turbo-package is {version} plus its three guard fixes, bound, and " + f"placed with the intent ({phase_of.get(NAME)})") +PY diff --git a/testing/phases.test.sh b/testing/phases.test.sh index 9bc9b26..bddef78 100755 --- a/testing/phases.test.sh +++ b/testing/phases.test.sh @@ -90,8 +90,10 @@ WAS = { # `platform-limits-tests` is likewise new here: a component the baseline grew # after the slices were cut, which no slice placed (the coverage gate found it). # `root-agents` is the product's AGENTS.md (saas-build-panel BV4): the page an -# agent handed the product reads first. -ADDED = {"01-scaffold": ["discovery-roots", "root-agents"], "05-edge": ["platform-limits-tests"]} +# agent handed the product reads first. `stack-tectonic-fixes` is the one +# composition patched in-tree until stack-tectonic releases the fix; it lands +# with the intent that names it, and goes when the intent stops naming it. +ADDED = {"01-scaffold": ["discovery-roots", "root-agents", "stack-tectonic-fixes"], "05-edge": ["platform-limits-tests"]} HOOK_ONLY = {"08-docs"} by_name = {p["name"]: p for p in phases} From a9104de5154f5a0a8d66572816e4688f03dc99bd Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 15:23:32 +0000 Subject: [PATCH 4/8] fix(tests): web-console-next-tests resolves @saas/sdk without a cache The console's sources import `@saas/sdk`, and the suite compiles them, but its tsconfig and jest mapper named only `@saas/contracts`. ts-jest then could not resolve the package and four suites failed to load in CI (`TS2307: Cannot find module '@saas/sdk'`, plus knock-on errors). Locally they passed only from jest's transform cache. Map it to the sdk's source, as contracts already is. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BfmHkwWeA1oPJGBNF3QSQH --- tests/web-console-next/package.json | 1 + tests/web-console-next/tsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/web-console-next/package.json b/tests/web-console-next/package.json index ff3d750..7542858 100644 --- a/tests/web-console-next/package.json +++ b/tests/web-console-next/package.json @@ -30,6 +30,7 @@ "^(\\.{1,2}/.*)\\.js$": "$1", "^@saas/contracts$": "/../../packages/contracts/src/index.ts", "^@saas/contracts/(.*)$": "/../../packages/contracts/src/$1.ts", + "^@saas/sdk$": "/../../packages/sdk/src/index.ts", "^@/(.*)$": "/../../apps/web-console-next/src/$1", "^@web-console-next/(.*)$": "/../../apps/web-console-next/src/$1" }, diff --git a/tests/web-console-next/tsconfig.json b/tests/web-console-next/tsconfig.json index f19b18c..bfc59f1 100644 --- a/tests/web-console-next/tsconfig.json +++ b/tests/web-console-next/tsconfig.json @@ -11,7 +11,8 @@ "@/*": ["../../apps/web-console-next/src/*"], "@web-console-next/*": ["../../apps/web-console-next/src/*"], "@saas/contracts": ["../../packages/contracts/src/index.ts"], - "@saas/contracts/*": ["../../packages/contracts/src/*.ts"] + "@saas/contracts/*": ["../../packages/contracts/src/*.ts"], + "@saas/sdk": ["../../packages/sdk/src/index.ts"] } }, "include": [ From 8747a3721a4e0f8e0fca6b762431da9e2a21d93f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 15:27:21 +0000 Subject: [PATCH 5/8] docs(review): a fifth harness fix, which CI found and the local run hid web-console-next-tests passed locally only from jest's transform cache; its first lane could not load four files. Recorded with the other four, and the local re-run is now uncached in an orun-style staged tree. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BfmHkwWeA1oPJGBNF3QSQH --- docs/components/REVIEW.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/components/REVIEW.md b/docs/components/REVIEW.md index 9436b40..179cfa3 100644 --- a/docs/components/REVIEW.md +++ b/docs/components/REVIEW.md @@ -203,8 +203,12 @@ plain `verify` on `dev`, with no rule skipping it on main. **Before flipping anything, all nineteen were run locally exactly as `verify`'s pre-build step runs them** (`pnpm exec turbo run test --filter=./` in each -component). Fifteen passed. Four did not, and in every case the test was right -about what it guards and its harness had drifted from the code underneath it: +component). Fourteen passed. Five did not, and in every case the test was right +about what it guards and its harness had drifted from the code underneath it. +The fifth was found by CI rather than locally: `web-console-next-tests` passed +here only from jest's transform cache, and its first real run, in a lane, could +not load four of its files. Every suite has since been re-run with no turbo +cache and an empty jest cache, in a tree staged the way orun stages a job. | suite | what it hit | the fix | |---|---|---| @@ -212,10 +216,13 @@ about what it guards and its harness had drifted from the code underneath it: | `membership-worker-tests` | the same file, read at `describe` time, so the whole suite failed to load | the same | | `db-tests` | `tsconfig.json` enumerates thirteen `@saas/db/*` subpaths and not `integrations`; jest resolved it through its `(.*)` catch-all, ts-jest's type-check did not | add the path | | `integrations-worker-tests` | `tsconfig.json` maps `@saas/db/*`, which does not match bare `@saas/db` | add the path | +| `web-console-next-tests` | the console's sources import `@saas/sdk`; the suite's tsconfig and jest mapper named only `@saas/contracts`, so ts-jest could not resolve it and four files failed to load | map `@saas/sdk` to the sdk's source | The suites that failed *to load* were hiding more than their failure counts showed: `membership-worker-tests` went from 85 tests to **269**, `db-tests` from -552 to **578**, `integrations-worker-tests` from 70 to **77**. +552 to **578**, `integrations-worker-tests` from 70 to **77**, +`web-console-next-tests` from 215 to **258**. **3,088 tests across the +nineteen**, every one passing on the finished tree. **The repointed binding tests guard something real**, which was checked by breaking it: pointing stage's `IDENTITY_WORKER` at `lumen-identity-worker-prod` From b27202132a57734fb2520b258848fe07fb7189b1 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 15:37:16 +0000 Subject: [PATCH 6/8] fix(tests): fake databases refuse at once instead of resolving "fake" Eighteen test files faked PLATFORM_DB as `postgres://fake`. The list handlers start the database read alongside the membership call and wait for both, so each such request did a real DNS lookup of `fake`: a few ms locally, but up to glibc's 5s resolver timeout on a runner, which is jest's 5s test timeout. config-worker-tests failed that way in CI after passing on the previous run. Use `postgres://fake@127.0.0.1:1/fake`, a closed loopback port the kernel refuses with no lookup. With every non-localhost lookup delayed 6s, the old URL times out 17 config-worker tests; with this change all 19 suites (and webhooks/events) pass with none. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BfmHkwWeA1oPJGBNF3QSQH --- docs/components/REVIEW.md | 12 ++++++++++++ .../src/list-entitlement-decisions.test.ts | 3 ++- tests/admin-worker/src/list-support-actions.test.ts | 3 ++- tests/admin-worker/src/lookup-support.test.ts | 3 ++- tests/admin-worker/src/record-support-action.test.ts | 3 ++- tests/billing-worker/src/billing-worker.test.ts | 3 ++- tests/config-worker/src/config-worker.test.ts | 3 ++- tests/integrations-worker/src/connect-flow.test.ts | 3 ++- tests/integrations-worker/src/deliveries-api.test.ts | 3 ++- tests/integrations-worker/src/free-tier.test.ts | 3 ++- .../integrations-worker/src/inbound-pipeline.test.ts | 3 ++- tests/integrations-worker/src/repo-links.test.ts | 3 ++- tests/integrations-worker/src/router.test.ts | 3 ++- tests/integrations-worker/src/token-broker.test.ts | 3 ++- .../src/authorization-context.test.ts | 3 ++- .../src/service-principal-bindings.test.ts | 3 ++- tests/metering-worker/src/metering-worker.test.ts | 3 ++- tests/projects-worker/src/projects-worker.test.ts | 3 ++- tests/webhooks-worker/src/webhooks-worker.test.ts | 3 ++- 19 files changed, 48 insertions(+), 18 deletions(-) diff --git a/docs/components/REVIEW.md b/docs/components/REVIEW.md index 179cfa3..288272f 100644 --- a/docs/components/REVIEW.md +++ b/docs/components/REVIEW.md @@ -218,6 +218,18 @@ cache and an empty jest cache, in a tree staged the way orun stages a job. | `integrations-worker-tests` | `tsconfig.json` maps `@saas/db/*`, which does not match bare `@saas/db` | add the path | | `web-console-next-tests` | the console's sources import `@saas/sdk`; the suite's tsconfig and jest mapper named only `@saas/contracts`, so ts-jest could not resolve it and four files failed to load | map `@saas/sdk` to the sdk's source | +**And one that only a CI runner shows.** Eighteen test files across the worker +suites faked the database as `postgres://fake`. The list handlers read the +database concurrently with the membership call (PERF12) and wait for both, so +every such request made a real DNS lookup of the hostname `fake`. That fails in +milliseconds on a workstation; on a runner whose resolver does not answer it +waits out glibc's 5-second timeout, which is exactly jest's, and +`config-worker-tests` failed that way on its second CI run having passed its +first. Each now reads `postgres://fake@127.0.0.1:1/fake`, a closed loopback port +the kernel refuses at once with no lookup. Checked by delaying every lookup but +`localhost` by six seconds: the old URL times out seventeen tests in +config-worker alone, and with the change all nineteen suites pass with none. + The suites that failed *to load* were hiding more than their failure counts showed: `membership-worker-tests` went from 85 tests to **269**, `db-tests` from 552 to **578**, `integrations-worker-tests` from 70 to **77**, diff --git a/tests/admin-worker/src/list-entitlement-decisions.test.ts b/tests/admin-worker/src/list-entitlement-decisions.test.ts index 71dc2b3..470d9f0 100644 --- a/tests/admin-worker/src/list-entitlement-decisions.test.ts +++ b/tests/admin-worker/src/list-entitlement-decisions.test.ts @@ -11,7 +11,8 @@ import type { function createFakeEnv(): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, }; } diff --git a/tests/admin-worker/src/list-support-actions.test.ts b/tests/admin-worker/src/list-support-actions.test.ts index 1944ed3..edf0c06 100644 --- a/tests/admin-worker/src/list-support-actions.test.ts +++ b/tests/admin-worker/src/list-support-actions.test.ts @@ -13,7 +13,8 @@ import type { function createFakeEnv(): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, }; } diff --git a/tests/admin-worker/src/lookup-support.test.ts b/tests/admin-worker/src/lookup-support.test.ts index ade7fcf..a84beb9 100644 --- a/tests/admin-worker/src/lookup-support.test.ts +++ b/tests/admin-worker/src/lookup-support.test.ts @@ -14,7 +14,8 @@ import type { function createFakeEnv(): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, }; } diff --git a/tests/admin-worker/src/record-support-action.test.ts b/tests/admin-worker/src/record-support-action.test.ts index d6cb89f..328500c 100644 --- a/tests/admin-worker/src/record-support-action.test.ts +++ b/tests/admin-worker/src/record-support-action.test.ts @@ -10,7 +10,8 @@ import type { function createFakeEnv(overrides: Partial = {}): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, ...overrides, }; } diff --git a/tests/billing-worker/src/billing-worker.test.ts b/tests/billing-worker/src/billing-worker.test.ts index fd1660f..78841f3 100644 --- a/tests/billing-worker/src/billing-worker.test.ts +++ b/tests/billing-worker/src/billing-worker.test.ts @@ -49,7 +49,8 @@ function createMockFetcher( function createFakeEnv(overrides?: Record): Env { const base: Record = { - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: createMockFetcher({ data: { memberships: [ diff --git a/tests/config-worker/src/config-worker.test.ts b/tests/config-worker/src/config-worker.test.ts index 1517a49..9d7332e 100644 --- a/tests/config-worker/src/config-worker.test.ts +++ b/tests/config-worker/src/config-worker.test.ts @@ -56,7 +56,8 @@ function createMockFetcherThatThrows(): Fetcher { function createFakeEnv(overrides?: Record): Env { const base: Record = { - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: createMockFetcher({ data: { memberships: [{ kind: "role_assignment", role: "admin", scope: { kind: "organization", orgId: TEST_ORG_UUID } }] } }), POLICY_WORKER: createMockFetcher({ data: { allow: true, reason: "org_admin", policyVersion: 1, derivedScope: { orgId: TEST_ORG_UUID } } }), ENVIRONMENT: "test", diff --git a/tests/integrations-worker/src/connect-flow.test.ts b/tests/integrations-worker/src/connect-flow.test.ts index 04f0dba..3d1758e 100644 --- a/tests/integrations-worker/src/connect-flow.test.ts +++ b/tests/integrations-worker/src/connect-flow.test.ts @@ -72,7 +72,8 @@ function billingFetcher(allowed: boolean, reason?: string): Fetcher { function createEnv(overrides?: Partial>): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: membershipFetcher(), POLICY_WORKER: policyFetcher(true), BILLING_WORKER: billingFetcher(true), diff --git a/tests/integrations-worker/src/deliveries-api.test.ts b/tests/integrations-worker/src/deliveries-api.test.ts index 405473c..2d9dceb 100644 --- a/tests/integrations-worker/src/deliveries-api.test.ts +++ b/tests/integrations-worker/src/deliveries-api.test.ts @@ -41,7 +41,8 @@ function jsonFetcher(body: unknown): Fetcher { function createEnv(): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: jsonFetcher({ data: { memberships: [ diff --git a/tests/integrations-worker/src/free-tier.test.ts b/tests/integrations-worker/src/free-tier.test.ts index 677f4e0..00e7326 100644 --- a/tests/integrations-worker/src/free-tier.test.ts +++ b/tests/integrations-worker/src/free-tier.test.ts @@ -21,7 +21,8 @@ import type { SqlExecutor, SqlExecutorResult, SqlRow } from "@saas/db/hyperdrive function createEnv(overrides?: Partial>): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, ...overrides, } as unknown as Env; } diff --git a/tests/integrations-worker/src/inbound-pipeline.test.ts b/tests/integrations-worker/src/inbound-pipeline.test.ts index f0761c6..e0365a5 100644 --- a/tests/integrations-worker/src/inbound-pipeline.test.ts +++ b/tests/integrations-worker/src/inbound-pipeline.test.ts @@ -35,7 +35,8 @@ function fakeExecutor(respond: SqlResponder): { executor: SqlExecutor; queries: function createEnv(overrides?: Partial>): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, GITHUB_APP_ID: "4242", GITHUB_APP_SLUG: "sourceplane-test", GITHUB_APP_PRIVATE_KEY: "-----BEGIN PRIVATE KEY-----\nirrelevant\n-----END PRIVATE KEY-----", diff --git a/tests/integrations-worker/src/repo-links.test.ts b/tests/integrations-worker/src/repo-links.test.ts index 4922e76..f59cc24 100644 --- a/tests/integrations-worker/src/repo-links.test.ts +++ b/tests/integrations-worker/src/repo-links.test.ts @@ -45,7 +45,8 @@ function jsonFetcher(body: unknown): Fetcher { function createEnv(overrides?: Partial>): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: jsonFetcher({ data: { memberships: [ diff --git a/tests/integrations-worker/src/router.test.ts b/tests/integrations-worker/src/router.test.ts index ca6b71e..b4b04d9 100644 --- a/tests/integrations-worker/src/router.test.ts +++ b/tests/integrations-worker/src/router.test.ts @@ -4,7 +4,8 @@ import type { Env } from "@integrations-worker/env"; function createFakeEnv(overrides?: Partial>): Env { const base: Record = { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, }; return { ...base, ...overrides } as unknown as Env; } diff --git a/tests/integrations-worker/src/token-broker.test.ts b/tests/integrations-worker/src/token-broker.test.ts index 43d51a7..3a56d14 100644 --- a/tests/integrations-worker/src/token-broker.test.ts +++ b/tests/integrations-worker/src/token-broker.test.ts @@ -59,7 +59,8 @@ beforeAll(async () => { function createEnv(overrides?: Partial>): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: jsonFetcher({ data: { memberships: [ diff --git a/tests/membership-worker/src/authorization-context.test.ts b/tests/membership-worker/src/authorization-context.test.ts index db2d4ec..ea0e55a 100644 --- a/tests/membership-worker/src/authorization-context.test.ts +++ b/tests/membership-worker/src/authorization-context.test.ts @@ -6,7 +6,8 @@ import type { Env } from "@membership-worker/env"; function createFakeEnv(overrides: Partial = {}): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, ...overrides, }; } diff --git a/tests/membership-worker/src/service-principal-bindings.test.ts b/tests/membership-worker/src/service-principal-bindings.test.ts index 4f4e5e8..11988e4 100644 --- a/tests/membership-worker/src/service-principal-bindings.test.ts +++ b/tests/membership-worker/src/service-principal-bindings.test.ts @@ -17,7 +17,8 @@ const SP_SUBJECT_ID = servicePrincipalSubjectId(SP_UUID); // sp_aaaaaaaabbbbcccc function createFakeEnv(overrides: Partial = {}): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, ...overrides, }; } diff --git a/tests/metering-worker/src/metering-worker.test.ts b/tests/metering-worker/src/metering-worker.test.ts index 6d3a36f..7f8ff5d 100644 --- a/tests/metering-worker/src/metering-worker.test.ts +++ b/tests/metering-worker/src/metering-worker.test.ts @@ -34,7 +34,8 @@ function createMockFetcher(responseBody: unknown, status = 200): Fetcher & { fet function createFakeEnv(overrides?: Record): Env { const base: Record = { - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: createMockFetcher({ data: { memberships: [{ kind: "role_assignment", role: "admin", scope: { kind: "organization", orgId: TEST_ORG_UUID } }] } }), POLICY_WORKER: createMockFetcher({ data: { allow: true, reason: "org_admin", policyVersion: 1, derivedScope: { orgId: TEST_ORG_UUID } } }), ENVIRONMENT: "test", diff --git a/tests/projects-worker/src/projects-worker.test.ts b/tests/projects-worker/src/projects-worker.test.ts index 636e91c..2f486af 100644 --- a/tests/projects-worker/src/projects-worker.test.ts +++ b/tests/projects-worker/src/projects-worker.test.ts @@ -58,7 +58,8 @@ function createMockFetcherThatThrows(): Fetcher { function createFakeEnv(overrides?: Record): Env { const base: Record = { - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: createMockFetcher({ data: { memberships: [{ kind: "role_assignment", role: "admin", scope: { kind: "organization", orgId: TEST_ORG_UUID } }] } }), POLICY_WORKER: createMockFetcher({ data: { allow: true, reason: "org_admin", policyVersion: 1, derivedScope: { orgId: TEST_ORG_UUID } } }), // Default: billing-worker returns an allowed `limit.projects` decision with diff --git a/tests/webhooks-worker/src/webhooks-worker.test.ts b/tests/webhooks-worker/src/webhooks-worker.test.ts index 83da1e2..94e1008 100644 --- a/tests/webhooks-worker/src/webhooks-worker.test.ts +++ b/tests/webhooks-worker/src/webhooks-worker.test.ts @@ -55,7 +55,8 @@ function createMockFetcher(responseBody: unknown, status = 200): Fetcher & { fet function createFakeEnv(overrides?: Record): Env { const base: Record = { - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: createMockFetcher({ data: { memberships: [{ kind: "role_assignment", role: "admin", scope: { kind: "organization", orgId: TEST_ORG_UUID } }] } }), POLICY_WORKER: createMockFetcher({ data: { allow: true, reason: "org_admin", policyVersion: 1, derivedScope: { orgId: TEST_ORG_UUID } } }), ENVIRONMENT: "test", From 04ea4b089e19156042ccda06fe40f6ed3ad4e4e5 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 27 Oct 2026 05:47:38 +0000 Subject: [PATCH 7/8] docs: the test suites cost a bootstrap nothing TIMINGS.md and REVIEW.md said the nineteen suites would add a build, a typecheck and the tests to four phases' merge convergences. They do not: the suites verify on dev only, a landing's PR runs `plan` alone, and 01-scaffold defers dev's push-to-main trigger until 08-docs restores it (tooling/bootstrap/dev-lanes.mjs). The 18 minutes stand. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BfmHkwWeA1oPJGBNF3QSQH --- docs/components/REVIEW.md | 18 +++++++++++------- docs/phases/TIMINGS.md | 17 +++++++++-------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/docs/components/REVIEW.md b/docs/components/REVIEW.md index 288272f..0b82f17 100644 --- a/docs/components/REVIEW.md +++ b/docs/components/REVIEW.md @@ -257,13 +257,17 @@ typecheck lanes — defensible, but a different change from making tests run. ### What this costs a build -The 18 measured minutes in `docs/phases/TIMINGS.md` were taken under -`quick-check`. On `verify` the nineteen add a **build and a typecheck** to the -merge convergences of four phases — `02-foundation` (6), `04-workers` (11), -`05-edge` (2), `06-console` (1) — and the suites -themselves. Each is its own lane, so the cost should sit near the slowest -one rather than the sum, but that is a prediction; the next measured build is -what will say. +Nothing, during a bootstrap. The nineteen verify on `dev` only, and a +bootstrap runs no `dev` lane: a landing's pull request is checked by `plan` +alone (`ci.yml` skips lanes on `orun/BASE-*`), and `01-scaffold` defers `dev`'s +push-to-main trigger until `08-docs` restores it +(`tooling/bootstrap/dev-lanes.mjs`). So the 18 measured minutes in +`docs/phases/TIMINGS.md` stand. An earlier draft of this section predicted the +suites would add to four phases' merge convergences; it had missed the defer. + +After the bootstrap they run on every pull request and every merge to main, a +lane per suite beside the deploys. On this pull request's CI each suite's +pre-build took 3 to 13 seconds. ## Declared product URLs diff --git a/docs/phases/TIMINGS.md b/docs/phases/TIMINGS.md index 04dd2f0..ecaa055 100644 --- a/docs/phases/TIMINGS.md +++ b/docs/phases/TIMINGS.md @@ -55,14 +55,15 @@ slow case rather than the fast one. What could still make a build slower than one condition on `06-console` below. A second measured run belongs on this page beside the first rather than replacing it. -**The run predates two changes to what CI does.** Nineteen components were on -the `quick-check` profile, which runs no tests, no build and no typecheck. They -are on `verify` now, and `turbo-package`'s pre-build guard, which skipped -every suite's tests, is fixed in-tree (`docs/components/REVIEW.md`). Together -they add the suites, a build and a typecheck inside the merge convergences of -`02-foundation`, `04-workers`, `05-edge` and `06-console`. Each is its own -lane, so the cost should land near the slowest rather than the sum — but that -is a prediction, and the next measured build is the answer. +**The test suites cost a bootstrap nothing.** Nineteen components moved from +`quick-check` to `verify`, and `turbo-package`'s pre-build guard, which skipped +every suite's tests, is fixed in-tree (`docs/components/REVIEW.md`). All +nineteen verify on `dev` only, and a bootstrap runs no `dev` lane: each +landing's pull request is checked by `plan` alone (`ci.yml` skips lanes on +`orun/BASE-*`), and `01-scaffold` defers `dev`'s push-to-main trigger until +`08-docs` restores it (`tooling/bootstrap/dev-lanes.mjs`). The 18 minutes +stand. The suites run from the product's first pull request on, and on every +merge to main after `08-docs`, each in its own lane beside the deploys. **One condition on `06-console`'s 2.** The console is fetched only when the baseline tag being built from has a published artifact for exactly these From f7abecb67baba12d0aad2275e5abce6a99a88130 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 27 Oct 2026 07:05:28 +0000 Subject: [PATCH 8/8] fix(ci): pin stack-tectonic 0.20.1; the in-tree turbo-package copy goes stack-tectonic 0.20.1 (sourceplane/stack-tectonic#20) carries the fix this branch had been patching in-tree: turbo-package's pre-build, build and typecheck guards read .parameters.*, so a component's preBuildCommand runs. The pin moves 0.20.0 -> 0.20.1, and the in-tree copy goes with everything that existed to fence it: the stack-tectonic-fixes source and binding, its blueprint module, its contract test and the doc lines that called it an exception. intent.yaml now differs from main by the pin alone. orun plan --all-envs on the published 0.20.1 against the in-tree copy CI already ran green: 92 jobs and 610 steps either way, no step differs, and the 19 pre-builds run their tests. All eleven contract suites (leak and placement included) and orun validate pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BfmHkwWeA1oPJGBNF3QSQH --- .github/workflows/baseline.yml | 4 +- README.md | 5 - ai/context/decisions.md | 14 +- docs/components/REVIEW.md | 44 ++--- docs/phases/TIMINGS.md | 2 +- intent.yaml | 13 +- repo-blueprint.yaml | 15 +- specs/core/repo.md | 5 +- stack-tectonic-fixes/README.md | 52 ------ .../compositions/turbo-package/README.md | 39 ----- .../turbo-package/composition.yaml | 26 --- .../jobs/turbo-package-verify.yaml | 76 --------- .../profiles/turbo-package-quick-check.yaml | 14 -- .../profiles/turbo-package-verify.yaml | 17 -- .../compositions/turbo-package/schema.yaml | 38 ----- stack-tectonic-fixes/stack.yaml | 17 -- stack-tectonic-fixes/upstream-0.20.0.sha256 | 6 - testing/composition-fixes.test.sh | 160 ------------------ testing/phases.test.sh | 6 +- 19 files changed, 32 insertions(+), 521 deletions(-) delete mode 100644 stack-tectonic-fixes/README.md delete mode 100644 stack-tectonic-fixes/compositions/turbo-package/README.md delete mode 100644 stack-tectonic-fixes/compositions/turbo-package/composition.yaml delete mode 100644 stack-tectonic-fixes/compositions/turbo-package/jobs/turbo-package-verify.yaml delete mode 100644 stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-quick-check.yaml delete mode 100644 stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-verify.yaml delete mode 100644 stack-tectonic-fixes/compositions/turbo-package/schema.yaml delete mode 100644 stack-tectonic-fixes/stack.yaml delete mode 100644 stack-tectonic-fixes/upstream-0.20.0.sha256 delete mode 100644 testing/composition-fixes.test.sh diff --git a/.github/workflows/baseline.yml b/.github/workflows/baseline.yml index c0d2016..98b4901 100644 --- a/.github/workflows/baseline.yml +++ b/.github/workflows/baseline.yml @@ -51,11 +51,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - name: Contract tests (manifest, phases, coverage, rebrand, retouch, bootstrap-defer, fleet-stubs, pen-reset, console-artifact, composition-fixes) + - name: Contract tests (manifest, phases, coverage, rebrand, retouch, bootstrap-defer, fleet-stubs, pen-reset, console-artifact) run: | set -euo pipefail python3 -c 'import yaml' 2>/dev/null || pip install --quiet pyyaml - for t in manifest phases coverage rebrand retouch bootstrap-defer fleet-stubs pen-reset console-artifact composition-fixes; do + for t in manifest phases coverage rebrand retouch bootstrap-defer fleet-stubs pen-reset console-artifact; do echo "── $t" bash "testing/$t.test.sh" done diff --git a/README.md b/README.md index dbe8fbf..de2dc1e 100644 --- a/README.md +++ b/README.md @@ -119,11 +119,6 @@ consumed from the published catalog at [sourceplane/stack-tectonic](https://github.com/sourceplane/stack-tectonic), released there, and adopted here by bumping the pinned tag. -One composition is the temporary exception: `stack-tectonic-fixes/` carries -0.20.0's `turbo-package` with its step guards fixed, because the published one -skips every test suite's tests. Its README says what changed and how to delete -it once a release carries the fix. - ## CI CI is powered by [Orun](https://github.com/sourceplane/orun) with the local Stack Tectonic diff --git a/ai/context/decisions.md b/ai/context/decisions.md index 6a5914e..ea030a9 100644 --- a/ai/context/decisions.md +++ b/ai/context/decisions.md @@ -49,14 +49,12 @@ Last updated: 2026-05-26 was already producing drift against `orun-cloud`. The tag is pinned, never `latest`, so a catalog release cannot change this repo's execution contracts without a commit here. -- One exception, temporary (2026-10-26): `turbo-package` is bound to the - in-tree `stack-tectonic-fixes/`, which is 0.20.0's copy with its pre-build, - build and typecheck guards reading `.parameters.*`. The published guards read - keys orun never sets, so pre-build skipped every test suite's tests, and the - fix could not be released upstream from the change that found it. - `testing/composition-fixes.test.sh` holds the copy to the published files - plus those three tokens and fails on any other pin; delete the copy when a - release carries the fix. +- The pin is stack-tectonic 0.20.1 (2026-10-27), the first release whose + `turbo-package` runs a component's `preBuildCommand`: 0.18.1 through 0.20.0 + guarded pre-build, build and typecheck on keys orun never sets, so every + suite's tests skipped themselves (sourceplane/stack-tectonic#20). The fix + went upstream rather than into an in-tree copy, which this repo carried for a + day before the release. - All component types use `spec.parameters` instead of `spec.inputs` on the current Orun runtime. - Cloudflare/Supabase human-provided resources discovered in Task 0002 remain diff --git a/docs/components/REVIEW.md b/docs/components/REVIEW.md index 0b82f17..2c64f71 100644 --- a/docs/components/REVIEW.md +++ b/docs/components/REVIEW.md @@ -159,33 +159,25 @@ work: their guards are equally always-false, and their `else` defaults happen to be the commands every component here declares. Pre-build has no default, so it is the one that visibly breaks. -**The fix belongs upstream** — three guards in `sourceplane/stack-tectonic`, -each `.` → `.parameters.` — and could not be made there from this -change. stack-tectonic's own `main` is still `0.20.0` with the broken guards. -orun-cloud carries an in-tree copy that already reads `.parameters.*`, which is -why its suites run, and the proof the corrected guard works: its -`agents-worker-tests` pre-build ran for 29.9s and failed on real assertions. - -**So the fix lives here until it ships there.** `stack-tectonic-fixes/` is -0.20.0's `turbo-package` with those three guards corrected and nothing else, and -`intent.yaml` binds that one composition type to it; every other composition is -still the pinned OCI artifact. It breaks this repository's rule that -compositions are not vendored, and it is fenced accordingly: - -- `testing/composition-fixes.test.sh` undoes the three fixes and requires every - file to hash to what 0.20.0 published, so the copy cannot become the place a - step gets changed; -- the same gate fails on any stack-tectonic pin other than 0.20.0 while the - directory exists, so moving the pin is when somebody decides whether the copy - is still needed; -- the directory ships to products in `01-scaffold`, the phase that ships the - `intent.yaml` naming it — a product's first plan needs both. - -**Checked by rendering, not by reading.** `orun plan --all-envs` before and -after: 92 jobs and 610 steps either way, and exactly 19 steps differ — the +**The fix is upstream, in stack-tectonic 0.20.1** +([sourceplane/stack-tectonic#20](https://github.com/sourceplane/stack-tectonic/pull/20)): +the three guards read `.parameters.*`, and that repository's `verify.sh` now +refuses a guard on any key outside `.orun`, `.parameters` and `.env` and renders +`turbo-package` through the packed artifact to check its commands come out. Every +release from 0.18.1 to 0.20.0 carried the bug, and every structural check passed +them. This repository pins 0.20.1; for a day it carried an in-tree copy of the +fixed composition instead, and that copy is gone. + +**No other baseline changes with it.** Each of the other 25 baselines on +stack-tectonic was planned with its own pin, as published and with only the three +guards patched: 181 `turbo-package` jobs across the 22 that have any, all on +`quick-check`, which plans none of the three steps, and not one step differs. No +consumer declares a custom `buildCommand` or `typecheckCommand`. + +**Checked by rendering, not by reading.** `orun plan --all-envs` on 0.20.0 and +on 0.20.1: 92 jobs and 610 steps either way, and exactly 19 steps differ — the pre-build of the nineteen components below, from `echo "Skipping pre-build."` to -`pnpm exec turbo run test --filter=./`. A product placed and branded from the -blueprint receives the directory byte for byte and plans the same command. +`pnpm exec turbo run test --filter=./`. ### The profile, and the suites made ready to run diff --git a/docs/phases/TIMINGS.md b/docs/phases/TIMINGS.md index ecaa055..73a59d2 100644 --- a/docs/phases/TIMINGS.md +++ b/docs/phases/TIMINGS.md @@ -57,7 +57,7 @@ page beside the first rather than replacing it. **The test suites cost a bootstrap nothing.** Nineteen components moved from `quick-check` to `verify`, and `turbo-package`'s pre-build guard, which skipped -every suite's tests, is fixed in-tree (`docs/components/REVIEW.md`). All +every suite's tests, is fixed in stack-tectonic 0.20.1 (`docs/components/REVIEW.md`). All nineteen verify on `dev` only, and a bootstrap runs no `dev` lane: each landing's pull request is checked by `plan` alone (`ci.yml` skips lanes on `orun/BASE-*`), and `01-scaffold` defers `dev`'s push-to-main trigger until diff --git a/intent.yaml b/intent.yaml index d1bc552..f065ced 100644 --- a/intent.yaml +++ b/intent.yaml @@ -50,17 +50,7 @@ compositions: # a commit here. Bumping the tag is the deliberate upgrade step. - name: stack-tectonic kind: oci - ref: oci://ghcr.io/sourceplane/stack-tectonic:0.20.0 - # ONE composition patched in-tree, until stack-tectonic releases the fix. - # 0.20.0's turbo-package guards its pre-build, build and typecheck steps on - # `.preBuildCommand` where the value is `.parameters.preBuildCommand`, so - # pre-build skips itself on every component — and pre-build is where every - # test suite here keeps its tests. The binding below takes `turbo-package` - # alone from this copy; everything else is still the OCI artifact. - # stack-tectonic-fixes/README.md says how to delete it. - - name: stack-tectonic-fixes - kind: dir - path: stack-tectonic-fixes + ref: oci://ghcr.io/sourceplane/stack-tectonic:0.20.1 resolution: precedence: - stack-tectonic @@ -68,7 +58,6 @@ compositions: terraform: stack-tectonic cloudflare-domain: stack-tectonic db-migrate: stack-tectonic - turbo-package: stack-tectonic-fixes discovery: roots: diff --git a/repo-blueprint.yaml b/repo-blueprint.yaml index 289cc7f..b22df68 100644 --- a/repo-blueprint.yaml +++ b/repo-blueprint.yaml @@ -527,19 +527,6 @@ modules: # are made in sourceplane/stack-tectonic, released there, and adopted by # bumping the pinned tag — in the fork exactly as in the baseline. # - # ONE EXCEPTION, AND IT IS TEMPORARY. 0.20.0's `turbo-package` guards its - # pre-build step on a key orun never sets, so every test suite's tests skip - # themselves. `stack-tectonic-fixes/` is that one composition with the guard - # fixed, and `intent.yaml` binds `turbo-package` to it — so a product's - # intent names the directory and has to receive it, in the same phase as - # the intent. `testing/composition-fixes.test.sh` holds it to the published - # files plus the fix and nothing else; its README says how to delete it. - - name: stack-tectonic-fixes - mode: copy - source: baseline - from: stack-tectonic-fixes - to: stack-tectonic-fixes - # # Only the tooling a PRODUCT runs: shared TS/ESLint config and the # deploy-time wrangler renderer. This was `from: tooling`, the whole # directory, and every product shipped the factory with it — the rebrand @@ -974,7 +961,7 @@ phases: start: 'Creating the repository and its foundations.' done: '{{ .inputs.githuborg }}/{{ .inputs.reponame }} has its foundations on main, branded as {{ .inputs.productname }}, in {{ .meta.elapsed }}.' failed: 'The repository did not get off the ground; the failing step says why.' - modules: [ai-deployment, ai-operations, discovery-roots, github-workflows, rebrand-values, root-agents, root-gitignore, root-intent, root-package-json, root-pnpm-lock, root-pnpm-workspace, root-readme, root-turbo, stack-tectonic-fixes, tooling-deploy, tooling-eslint, tooling-tsconfig, tooling-wire] + modules: [ai-deployment, ai-operations, discovery-roots, github-workflows, rebrand-values, root-agents, root-gitignore, root-intent, root-package-json, root-pnpm-lock, root-pnpm-workspace, root-readme, root-turbo, tooling-deploy, tooling-eslint, tooling-tsconfig, tooling-wire] # 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 diff --git a/specs/core/repo.md b/specs/core/repo.md index 21229ea..ccd1ed0 100644 --- a/specs/core/repo.md +++ b/specs/core/repo.md @@ -230,10 +230,7 @@ for Terraform, S3 backend, and environment structure. - **The composition stack** is owned by `sourceplane/stack-tectonic` and consumed as a pinned OCI artifact. It is not vendored in this repo; composition changes are made, verified and released there, then adopted here by bumping the pinned - version in `intent.yaml`. The one temporary exception is - `stack-tectonic-fixes/` — 0.20.0's `turbo-package` with its step guards - fixed, bound alone in `intent.yaml`, held to the published files by - `testing/composition-fixes.test.sh` and deleted once a release carries the fix. + version in `intent.yaml`. - **`intent.yaml`** records discovery roots, composition sources and bindings, trigger bindings, and `dev` -> `stage` -> `prod` environment promotion. It uses `parameterDefaults.terraform` and `env.AWS_REGION` like `aws-admin`. diff --git a/stack-tectonic-fixes/README.md b/stack-tectonic-fixes/README.md deleted file mode 100644 index c609150..0000000 --- a/stack-tectonic-fixes/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# stack-tectonic-fixes — one composition, patched until upstream ships the fix - -This directory exists to be deleted. It holds a single composition, -`turbo-package`, copied from the published stack-tectonic **0.20.0** with a -three-token fix, and `intent.yaml` binds that one composition type to it. Every -other composition still comes from the pinned OCI artifact. - -## What is wrong upstream - -0.20.0's `jobs/turbo-package-verify.yaml` guards each optional step on a key -the job's template context does not have: - -``` -{{if .preBuildCommand}} ← orun's context has no top-level parameters -{{.parameters.preBuildCommand}} ← the value is here -{{else}} -echo "Skipping pre-build." -``` - -orun gives a job template three namespaces — `.orun`, `.parameters` and -`.env` — so `.preBuildCommand` is always empty, and **pre-build skips itself -on every component, whatever the component declares**. In this repository -that is every test suite: their tests are their `preBuildCommand`. `build` and -`typecheck` have the same mistake and only appear to work, because their -`else` defaults are the commands every component here declares anyway. - -The fix is `.` → `.parameters.` in those three guards, and nothing -else. `upstream-0.20.0.sha256` records the published files. The baseline this -repository was built from has a contract test that reverses the three fixes -and requires the result to hash to exactly those files, so the copy a product -receives is the published one plus the fix. To check it here: - -``` -sed -e 's/if \.parameters\.\(preBuildCommand\|buildCommand\|typecheckCommand\)}}/if .\1}}/' \ - compositions/turbo-package/jobs/turbo-package-verify.yaml | sha256sum -``` - -prints the `jobs/turbo-package-verify.yaml` line of `upstream-0.20.0.sha256`, -and every other file hashes as recorded. - -## Deleting it - -When a stack-tectonic release reads `.parameters.*` in those guards: - -1. bump the pin in `intent.yaml` (`compositions.sources`, `stack-tectonic`); -2. delete the `stack-tectonic-fixes` source and the `turbo-package` binding - beside it; -3. delete this directory — and, in the baseline, its module in - `repo-blueprint.yaml`. - -The baseline's contract test fails on any pin other than 0.20.0 while this -directory exists, so moving the pin is the moment somebody has to decide. diff --git a/stack-tectonic-fixes/compositions/turbo-package/README.md b/stack-tectonic-fixes/compositions/turbo-package/README.md deleted file mode 100644 index e12cf0d..0000000 --- a/stack-tectonic-fixes/compositions/turbo-package/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# turbo-package - -`turbo-package` is an exported Orun composition in the Stack Tectonic catalog. - -## Purpose - -Verify a shared package in a pnpm + Turborepo monorepo: install the workspace -with a frozen lockfile, run an optional pre-build, check the package has a -`package.json`, then build and typecheck it. Build and typecheck default to -`pnpm exec turbo run --filter=./` when no command is given. - -This composition only verifies — it publishes and deploys nothing. - -## Contract - -- **Type:** `turbo-package` -- **Path:** `compositions/turbo-package` -- **Composition:** `composition.yaml` -- **Schema:** `schema.yaml` — the authoritative parameter contract -- **Job:** `verify` (default) — `jobs/turbo-package-verify.yaml` -- **Default profile:** `verify` -- **Required parameters:** `nodeVersion`, `pnpmVersion` -- **Optional parameters:** `preBuildCommand`, `buildCommand`, `typecheckCommand` - -## Profiles - -Each file in `profiles/` selects steps from the job by capability. - -| Profile | Steps | -| ------------------ | ----- | -| `quick-check` | setup-node → setup-pnpm → install → verify-structure | -| `verify` (default) | setup-node → setup-pnpm → install → pre-build → verify-structure → build → typecheck | - -## Verification - -`./scripts/verify.sh` is the catalog's only gate. It asserts that this -directory's `composition.yaml` has a `metadata.name` and `spec.type` matching -the directory, that `schema.yaml` and `jobs/` exist beside it, then packs the -catalog and confirms `turbo-package` exports from the packed artifact. diff --git a/stack-tectonic-fixes/compositions/turbo-package/composition.yaml b/stack-tectonic-fixes/compositions/turbo-package/composition.yaml deleted file mode 100644 index 62a24ab..0000000 --- a/stack-tectonic-fixes/compositions/turbo-package/composition.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: sourceplane.io/v1alpha1 -kind: Composition -metadata: - name: turbo-package -spec: - type: turbo-package - description: Turborepo package verification jobs - - schemaRef: - name: turbo-package-component - - defaultJob: verify - defaultProfile: verify - - jobs: - - name: verify - templateRef: - name: turbo-package-verify - - profiles: - - name: quick-check - profileRef: - name: turbo-package-quick-check - - name: verify - profileRef: - name: turbo-package-verify diff --git a/stack-tectonic-fixes/compositions/turbo-package/jobs/turbo-package-verify.yaml b/stack-tectonic-fixes/compositions/turbo-package/jobs/turbo-package-verify.yaml deleted file mode 100644 index f0f6090..0000000 --- a/stack-tectonic-fixes/compositions/turbo-package/jobs/turbo-package-verify.yaml +++ /dev/null @@ -1,76 +0,0 @@ -apiVersion: sourceplane.io/v1alpha1 -kind: JobTemplate -metadata: - name: turbo-package-verify -spec: - description: Install the workspace and validate a shared package - runsOn: ubuntu-22.04 - timeout: 25m - retries: 0 - - labels: - scope: verify - - capabilities: - - turbo-package.setup-node - - turbo-package.setup-pnpm - - turbo-package.install - - turbo-package.pre-build - - turbo-package.verify-structure - - turbo-package.build - - turbo-package.typecheck - - steps: - # setup-pnpm runs before setup-node so setup-node can warm and persist the - # pnpm store cache (keyed on the workspace lockfile). - - id: setup-pnpm - name: setup-pnpm - capability: turbo-package.setup-pnpm - use: pnpm/action-setup@v4 - with: - version: "{{.parameters.pnpmVersion}}" - - - id: setup-node - name: setup-node - capability: turbo-package.setup-node - use: actions/setup-node@v6 - with: - node-version: "{{.parameters.nodeVersion}}" - cache: pnpm - cache-dependency-path: "**/pnpm-lock.yaml" - - - id: install-workspace-dependencies - name: install-workspace-dependencies - capability: turbo-package.install - run: pnpm install --frozen-lockfile - onFailure: stop - - - id: pre-build - name: pre-build - capability: turbo-package.pre-build - shell: bash - run: | - {{if .parameters.preBuildCommand}} - {{.parameters.preBuildCommand}} - {{else}} - echo "Skipping pre-build." - {{end}} - onFailure: stop - - - id: verify-package-structure - name: verify-package-structure - capability: turbo-package.verify-structure - run: test -f package.json - onFailure: stop - - - id: build-package - name: build-package - capability: turbo-package.build - run: "{{if .parameters.buildCommand}}{{.parameters.buildCommand}}{{else}}pnpm exec turbo run build --filter=./{{end}}" - onFailure: stop - - - id: typecheck-package - name: typecheck-package - capability: turbo-package.typecheck - run: "{{if .parameters.typecheckCommand}}{{.parameters.typecheckCommand}}{{else}}pnpm exec turbo run typecheck --filter=./{{end}}" - onFailure: stop diff --git a/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-quick-check.yaml b/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-quick-check.yaml deleted file mode 100644 index 8ec1d31..0000000 --- a/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-quick-check.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: sourceplane.io/v1alpha1 -kind: ExecutionProfile -metadata: - name: turbo-package-quick-check -spec: - description: Quick check with setup and structure verification only - - jobs: - verify: - includeCapabilities: - - turbo-package.setup-node - - turbo-package.setup-pnpm - - turbo-package.install - - turbo-package.verify-structure diff --git a/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-verify.yaml b/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-verify.yaml deleted file mode 100644 index 8297fb6..0000000 --- a/stack-tectonic-fixes/compositions/turbo-package/profiles/turbo-package-verify.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: sourceplane.io/v1alpha1 -kind: ExecutionProfile -metadata: - name: turbo-package-verify -spec: - description: Full verification with build and typecheck - - jobs: - verify: - includeCapabilities: - - turbo-package.setup-node - - turbo-package.setup-pnpm - - turbo-package.install - - turbo-package.pre-build - - turbo-package.verify-structure - - turbo-package.build - - turbo-package.typecheck diff --git a/stack-tectonic-fixes/compositions/turbo-package/schema.yaml b/stack-tectonic-fixes/compositions/turbo-package/schema.yaml deleted file mode 100644 index c2e7d74..0000000 --- a/stack-tectonic-fixes/compositions/turbo-package/schema.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: sourceplane.io/v1alpha1 -kind: ComponentSchema -metadata: - name: turbo-package-component -spec: - type: turbo-package - schema: - $schema: http://json-schema.org/draft-07/schema# - title: Turbo Package Component - type: object - required: - - name - - type - - parameters - properties: - name: - type: string - type: - type: string - const: turbo-package - parameters: - type: object - required: - - nodeVersion - - pnpmVersion - properties: - nodeVersion: - type: string - pnpmVersion: - type: string - preBuildCommand: - type: string - buildCommand: - type: string - typecheckCommand: - type: string - additionalProperties: false - additionalProperties: true diff --git a/stack-tectonic-fixes/stack.yaml b/stack-tectonic-fixes/stack.yaml deleted file mode 100644 index ee87c7b..0000000 --- a/stack-tectonic-fixes/stack.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: orun.io/v1 -kind: Stack -metadata: - name: stack-tectonic-fixes - title: Stack Tectonic 0.20.0, with turbo-package's step guards fixed - # 0.20.0 plus this repository's patch. Not a release of stack-tectonic and - # not to be published: delete this directory once a stack-tectonic release - # carries the fix (README.md says how). - version: 0.20.0-guards.1 - description: turbo-package from stack-tectonic 0.20.0 with its pre-build, build and typecheck guards reading the parameters they test. - owner: sourceplane - tags: - - turbo - - monorepo -spec: - compositions: - - path: compositions/turbo-package/composition.yaml diff --git a/stack-tectonic-fixes/upstream-0.20.0.sha256 b/stack-tectonic-fixes/upstream-0.20.0.sha256 deleted file mode 100644 index 6d29118..0000000 --- a/stack-tectonic-fixes/upstream-0.20.0.sha256 +++ /dev/null @@ -1,6 +0,0 @@ -53765117e50624669e2e7215e7c0602e6ef78181b0703069fdc332e89dbe0760 compositions/turbo-package/README.md -1cfc47b31227ab96a293279d2fd7c9b8690a09c8515342aae30a73fb1bd54b0d compositions/turbo-package/composition.yaml -ec388b1ba62e2a6da2107eab56e33d91ff32c1c60deca53bd35f736eb5767b0c compositions/turbo-package/jobs/turbo-package-verify.yaml -cb77d979dd3cd58a15bccab632dbb0760bda1e70e1e1e0ba65d50e5786b26fdc compositions/turbo-package/profiles/turbo-package-quick-check.yaml -acbad9fbad74c8afbcdd4ee3ebb9d39770e85cf70861cbae17c45c5c7201e7ec compositions/turbo-package/profiles/turbo-package-verify.yaml -b91897cd1bb5d26bd7ea84595ec07fc2e507e8d7bf849478efccb7add07390e3 compositions/turbo-package/schema.yaml diff --git a/testing/composition-fixes.test.sh b/testing/composition-fixes.test.sh deleted file mode 100644 index 65f863b..0000000 --- a/testing/composition-fixes.test.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash -# THE IN-TREE COMPOSITION IS THE PUBLISHED ONE PLUS ITS FIX, AND NOTHING ELSE. -# -# `stack-tectonic-fixes/` holds stack-tectonic 0.20.0's `turbo-package` with -# three guards corrected (`{{if .preBuildCommand}}` → `{{if -# .parameters.preBuildCommand}}`, and the same for build and typecheck), and -# `intent.yaml` binds that one composition type to it. A vendored copy is how -# execution contracts drift: somebody edits it to fix a product, and the -# product now runs something no release of stack-tectonic contains. This gate -# keeps the copy to exactly the published files plus that fix: -# -# 1. undo the three fixes and every file must hash to what 0.20.0 published -# (`upstream-.sha256`, recorded from the OCI artifact); -# 2. the pin in `intent.yaml` must still be that version, so moving the pin -# is when somebody has to decide whether the copy is still needed; -# 3. the binding, the source and the blueprint module must all be present, -# and the module must land in the phase that lands `intent.yaml`, since -# that file names the directory; -# 4. once the directory is deleted, nothing may still name it. -# -# bash + python3 + PyYAML. No network, no orun, no credential. -set -euo pipefail -here="$(cd "$(dirname "$0")" && pwd)" -root="$(cd "$here/.." && pwd)" - -echo "── the in-tree turbo-package against the release it patches" -python3 - "$root" <<'PY' -import hashlib, pathlib, re, sys - -try: - import yaml -except ImportError: - sys.exit("PyYAML is required for this gate (pip install pyyaml)") - -root = pathlib.Path(sys.argv[1]) -fixes = root / "stack-tectonic-fixes" -NAME = "stack-tectonic-fixes" -problems = [] -def bad(m): problems.append(m) - -intent = yaml.safe_load((root / "intent.yaml").read_text()) -comp = intent.get("compositions") or {} -sources = {s["name"]: s for s in comp.get("sources") or []} -bindings = (comp.get("resolution") or {}).get("bindings") or {} -bp = yaml.safe_load((root / "repo-blueprint.yaml").read_text()) -modules = {m["name"]: m for m in bp.get("modules") or []} -phase_of = {n: ph["name"] for ph in bp.get("phases") or [] for n in ph.get("modules") or []} - -if not fixes.is_dir(): - # Deleted, as its README asks once upstream ships the fix. Then nothing - # may still point at it: a product's intent naming a directory it never - # received fails its first plan. - if NAME in sources: - bad(f"intent.yaml still declares the {NAME} source, and the directory is gone") - stale = sorted(t for t, s in bindings.items() if s == NAME) - if stale: - bad(f"intent.yaml still binds {stale} to {NAME}, and the directory is gone") - if NAME in modules: - bad(f"repo-blueprint.yaml still has a {NAME} module, and the directory is gone") - if problems: - print("\n".join(f"FAIL: {p}" for p in problems), file=sys.stderr) - sys.exit(1) - print(" no in-tree compositions, and nothing names one") - sys.exit(0) - -# ── which release it patches ─────────────────────────────────────────────── -records = sorted(fixes.glob("upstream-*.sha256")) -if len(records) != 1: - sys.exit(f"FAIL: want exactly one upstream-.sha256 in {NAME}/, found {len(records)}") -version = records[0].name[len("upstream-"):-len(".sha256")] -recorded = {} -for line in records[0].read_text().splitlines(): - if line.strip(): - digest, path = line.split(None, 1) - recorded[path.strip()] = digest -if not recorded: - sys.exit(f"FAIL: {records[0].name} records no files — this check has gone blind") - -upstream = sources.get("stack-tectonic") or {} -ref = upstream.get("ref", "") -if not ref.endswith(f":{version}"): - bad(f"intent.yaml pins stack-tectonic at {ref!r}, but {NAME}/ patches {version}. " - f"Moving the pin is the moment to decide: if the new release reads " - f".parameters.* in turbo-package's guards, delete {NAME}/ as its README " - f"says; if not, copy turbo-package from the new release, reapply the " - f"three fixes and record its hashes as upstream-.sha256") - -# ── wired: the source, the binding, the module, the phase ────────────────── -src = sources.get(NAME) -if not src: - bad(f"intent.yaml does not declare the {NAME} source, so the copy is dead") -elif src.get("kind") != "dir" or src.get("path") != NAME: - bad(f"the {NAME} source must be kind: dir, path: {NAME} (is {src.get('kind')!r}, {src.get('path')!r})") -if bindings.get("turbo-package") != NAME: - bad(f"intent.yaml does not bind turbo-package to {NAME}, so the published " - f"composition still wins and pre-build still skips itself") - -stack = yaml.safe_load((fixes / "stack.yaml").read_text()) -exported = sorted(pathlib.PurePosixPath(e["path"]).parent.name - for e in (stack.get("spec") or {}).get("compositions") or []) -if exported != ["turbo-package"]: - bad(f"{NAME}/stack.yaml exports {exported}; it is for turbo-package alone — " - f"any other fix belongs upstream, or in an argued diff to this gate") -others = sorted(t for t, s in bindings.items() if s == NAME and t != "turbo-package") -if others: - bad(f"intent.yaml binds {others} to {NAME}, which exports only turbo-package") - -mod = modules.get(NAME) -if not mod: - bad(f"no blueprint module places {NAME}/ — every product's intent names it, " - f"so every product's first plan would fail") -else: - if (mod.get("from"), mod.get("to")) != (NAME, NAME): - bad(f"module {NAME} copies {mod.get('from')!r} → {mod.get('to')!r}, not {NAME} → {NAME}") - if phase_of.get(NAME) != phase_of.get("root-intent"): - bad(f"module {NAME} lands in {phase_of.get(NAME)}, but intent.yaml (which " - f"names it) lands in {phase_of.get('root-intent')}; between the two, " - f"the product cannot plan") - -# ── the files: the published ones, plus the three fixes, plus nothing ────── -FIXES = [(f"{{{{if .{k}}}}}", f"{{{{if .parameters.{k}}}}}") - for k in ("preBuildCommand", "buildCommand", "typecheckCommand")] -JOB = "compositions/turbo-package/jobs/turbo-package-verify.yaml" -present = sorted(p.relative_to(fixes).as_posix() for p in fixes.rglob("*") - if p.is_file() and p.relative_to(fixes).parts[0] == "compositions") -for extra in sorted(set(present) - set(recorded)): - bad(f"{NAME}/{extra} is not a file {version} published") -for missing in sorted(set(recorded) - set(present)): - bad(f"{NAME}/{missing} is missing — {version} published it") - -for rel in sorted(set(present) & set(recorded)): - text = (fixes / rel).read_text() - if rel == JOB: - for broken, fixed in FIXES: - n = text.count(fixed) - if n != 1: - bad(f"{rel} carries {fixed!r} {n} time(s), want exactly 1") - text = text.replace(fixed, broken) - if hashlib.sha256(text.encode()).hexdigest() != recorded[rel]: - bad(f"{NAME}/{rel} differs from {version} by more than the three guard " - f"fixes. The copy is not a place to change what a step does: make the " - f"change in sourceplane/stack-tectonic") - -# Every guard in the job reads a namespace orun's template context has. This -# is the bug itself, stated as a rule, so a re-copy from a later release that -# still has it fails here rather than in a lane that quietly skips its tests. -NAMESPACES = {"orun", "parameters", "env"} -job = (fixes / JOB).read_text() -for key in re.findall(r"\{\{-?\s*if\s+\.([A-Za-z_]\w*)", job): - if key not in NAMESPACES: - bad(f"{JOB} guards on .{key}, which orun's template context does not " - f"have (it has .orun, .parameters and .env) — that step always takes " - f"its else branch") - -if problems: - print("\n".join(f"FAIL: {p}" for p in problems), file=sys.stderr) - sys.exit(1) -print(f" turbo-package is {version} plus its three guard fixes, bound, and " - f"placed with the intent ({phase_of.get(NAME)})") -PY diff --git a/testing/phases.test.sh b/testing/phases.test.sh index bddef78..9bc9b26 100755 --- a/testing/phases.test.sh +++ b/testing/phases.test.sh @@ -90,10 +90,8 @@ WAS = { # `platform-limits-tests` is likewise new here: a component the baseline grew # after the slices were cut, which no slice placed (the coverage gate found it). # `root-agents` is the product's AGENTS.md (saas-build-panel BV4): the page an -# agent handed the product reads first. `stack-tectonic-fixes` is the one -# composition patched in-tree until stack-tectonic releases the fix; it lands -# with the intent that names it, and goes when the intent stops naming it. -ADDED = {"01-scaffold": ["discovery-roots", "root-agents", "stack-tectonic-fixes"], "05-edge": ["platform-limits-tests"]} +# agent handed the product reads first. +ADDED = {"01-scaffold": ["discovery-roots", "root-agents"], "05-edge": ["platform-limits-tests"]} HOOK_ONLY = {"08-docs"} by_name = {p["name"]: p for p in phases}