@jimhoyd/urlcode 0.4.0-alpha.3 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/.claude/skills/urlcode-authoring/SKILL.md +10 -0
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/CONTRIBUTING.md +36 -0
  4. package/README.md +20 -15
  5. package/ROADMAP.md +25 -16
  6. package/dist/BUILD-MANIFEST.json +20 -19
  7. package/dist/authoring.js +15 -1
  8. package/dist/capability-query.js +0 -1
  9. package/dist/catalog.js +0 -1
  10. package/dist/cli.js +24 -7
  11. package/dist/config.js +1 -1
  12. package/dist/explain.js +1 -1
  13. package/dist/extensions.js +78 -1
  14. package/dist/http-response.js +1 -1
  15. package/dist/index.js +1 -0
  16. package/dist/init-with.js +36 -11
  17. package/dist/manifest.js +1 -1
  18. package/dist/mcp-authoring.js +2 -2
  19. package/dist/mcp.js +1 -1
  20. package/dist/policies/cache.js +2 -2
  21. package/dist/policy.js +16 -0
  22. package/dist/project-dependencies.js +305 -0
  23. package/dist/readiness.js +5 -1
  24. package/dist/runtime.js +1 -1
  25. package/dist/tooling.js +2 -1
  26. package/dist/trusted-functions.js +4 -5
  27. package/dist/types/authoring.d.ts +9 -1
  28. package/dist/types/capability-query.d.ts +0 -1
  29. package/dist/types/catalog.d.ts +0 -4
  30. package/dist/types/config.d.ts +1 -9
  31. package/dist/types/explain.d.ts +0 -1
  32. package/dist/types/extensions.d.ts +58 -0
  33. package/dist/types/http-response.d.ts +0 -1
  34. package/dist/types/index.d.ts +1 -0
  35. package/dist/types/init-with.d.ts +7 -13
  36. package/dist/types/manifest.d.ts +0 -1
  37. package/dist/types/project-dependencies.d.ts +78 -0
  38. package/dist/types/readiness.d.ts +3 -0
  39. package/dist/types/tooling.d.ts +1 -0
  40. package/dist/types/trusted-functions.d.ts +1 -4
  41. package/docs/AI-AUTHORING.md +10 -5
  42. package/docs/AWS.md +9 -0
  43. package/docs/CI-FOLLOWUP-2026-09-19.md +1 -1
  44. package/docs/CODEBASE-AUDIT-2026-09-20.md +6 -0
  45. package/docs/COMPOSING-A-SITE.md +287 -0
  46. package/docs/CONTAINER-PROMOTION.md +74 -0
  47. package/docs/DEVELOPMENT-PIPELINE.md +242 -119
  48. package/docs/EXTENSIONS.md +88 -93
  49. package/docs/FRAMEWORK.md +45 -30
  50. package/docs/FUNCTION-SECURITY.md +5 -8
  51. package/docs/INSTALL.md +13 -8
  52. package/docs/MIDDLEWARE.md +10 -4
  53. package/docs/OPEN-DECISIONS.md +64 -99
  54. package/docs/READINESS.md +8 -4
  55. package/docs/README.md +18 -13
  56. package/docs/RELEASE-0.4.1.md +73 -0
  57. package/docs/RELEASE-0.4.2.md +30 -0
  58. package/docs/RELEASE-READINESS.md +40 -11
  59. package/docs/RELEASE-SECURITY.md +33 -14
  60. package/docs/SPECIFICATION.md +5 -1
  61. package/docs/SPIKE-CORE-LAYERING.md +1 -1
  62. package/docs/SPIKE-DEFAULT-TRUST-MODEL.md +9 -13
  63. package/docs/STARTERS.md +17 -5
  64. package/docs/TOOLING.md +7 -5
  65. package/docs/VERCEL.md +10 -2
  66. package/docs/VERSION-ALIGNMENT.md +50 -8
  67. package/docs/archive/2026-09-19/ROADMAP.md +1 -0
  68. package/docs/archive/2026-09-19/SPIKE-EXTENSION-MODEL.md +1 -0
  69. package/docs/{SPIKE-LAMBDA-COMPILE.md → archive/2026-09-19/SPIKE-LAMBDA-COMPILE.md} +168 -12
  70. package/docs/archive/2026-09-19/SPIKE-MONOREPO.md +2 -0
  71. package/docs/archive/2026-09-20/OPEN-DECISIONS-COMPLETED.md +116 -0
  72. package/docs/archive/README.md +2 -0
  73. package/docs/yaml/functions.md +10 -2
  74. package/docs/yaml/middleware.md +5 -3
  75. package/examples/cookbook/middleware/envelope.mjs +4 -2
  76. package/llms-full.txt +458 -143
  77. package/llms.txt +2 -1
  78. package/package.json +8 -5
  79. package/packaging/claude-plugin/.claude-plugin/plugin.json +1 -1
  80. package/packaging/claude-plugin/skills/urlcode-authoring/SKILL.md +10 -0
  81. package/recipes/middleware/middleware/envelope.mjs +4 -2
  82. package/skills/urlcode/SKILL.md +8 -1
@@ -0,0 +1,74 @@
1
+ # Container image promotion (design, issue #233)
2
+
3
+ Status: design plus an inert helper. Nothing described under "Proposed" is
4
+ implemented, and no workflow was changed. This does not authorize enabling
5
+ `PUBLISH_CONTAINER`, publishing, or changing any existing tag. The point is
6
+ supply-chain integrity (tested bytes are shipped bytes), not speed: the sampled
7
+ CI image build took about 12 seconds, so build caching is deliberately out of scope.
8
+
9
+ ## Current behavior (read from the workflows at 67a6996)
10
+
11
+ - `ci.yml` job `container` (a required check) runs `docker build -t urlcode:test .`
12
+ and smoke-tests it. That image is discarded; no digest is recorded.
13
+ - `candidate.yml` builds and signs the npm archives, SBOM and manifests. It builds no
14
+ image. `manifest.json` and the exact-file-set check in `validateCandidate` know nothing
15
+ about images.
16
+ - `release.yml`, only when `vars.PUBLISH_CONTAINER == 'true'`, runs a fresh
17
+ `docker build` of the tagged commit with `revision`/`version` labels and pushes
18
+ `:VERSION` and the channel tag.
19
+ - On retry, if `:VERSION` already exists it is accepted after checking only the
20
+ `revision` label. A label is asserted by whoever built the image, so a differently
21
+ built image with the same label passes. Bytes are not compared.
22
+ - Channel monotonicity is enforced by reading the `version` label of the existing
23
+ channel tag (semver `gte`). That guard is sound and should be kept.
24
+ - A rebuild is not byte-reproducible (it runs `npm ci`, embeds timestamps), so the image
25
+ the release publishes is never the image CI tested, even for the same commit.
26
+
27
+ Not verified: live GHCR contents, package visibility/permissions, whether
28
+ `PUBLISH_CONTAINER` is set, and whether any image was ever pushed.
29
+
30
+ ## Proposed path (not implemented)
31
+
32
+ 1. Candidate build. In `candidate.yml`, build the image once from the exact commit
33
+ (`docker buildx build --output type=oci,dest=candidate/image.oci.tar` with the
34
+ revision/version labels), run the same three smoke tests as `ci.yml` against that
35
+ archive, and record `image: { digest, sourceCommit, version }` in `manifest.json`.
36
+ Add `image.oci.tar` to the attested subjects so the existing `attestation verify` and
37
+ the manifest SHA-256 pinned in the annotated tag cover the image as well.
38
+ 2. Manifest schema. Add the archive to the expected file set in `validateCandidate`
39
+ and validate the record with `candidateImage()` from `scripts/release-image.ts`.
40
+ Because the tag pins the manifest hash, the digest is immutable once tagged.
41
+ 3. Promotion. `release.yml` verifies the bundle (already done by `restore`), then copies
42
+ the archive to the registry preserving the manifest digest (`skopeo copy` or
43
+ `crane push` of the OCI layout; not `docker load` then `docker push`, which can
44
+ change digests under some storage drivers) and pushes `:VERSION` and the channel tag
45
+ as pointers to that digest. It never runs `docker build`.
46
+ 4. Retry identity. If `:VERSION` exists, resolve its digest with
47
+ `docker buildx imagetools inspect` and require `assertPromotedImage()` to pass. A
48
+ rebuilt image with matching labels but different bytes is refused. Channel tags keep
49
+ the existing `assertChannel` check via `assertImageChannel()`.
50
+ 5. Attestation. Optionally attest the image digest with `actions/attest` using
51
+ `push-to-registry`; this needs `packages: write` and its GHCR behavior is unverified.
52
+ 6. Self-hosting. The `Dockerfile` and `docker build` remain the documented way to build
53
+ from source. CI's `container` check stays as is to preserve the required check name.
54
+
55
+ ## What the inert helper proves
56
+
57
+ `scripts/release-image.ts` and `test/release-image.test.ts` are pure functions and unit
58
+ tests. They pin the invariant (promoted digest equals tested digest; labels match;
59
+ channel never regresses; a same-label different-bytes image is rejected). No workflow
60
+ imports them, so the release path is unchanged.
61
+
62
+ ## Could not establish
63
+
64
+ - Whether GHCR preserves the OCI digest through `skopeo`/`crane` from the runner, and
65
+ whether the org's package settings permit it.
66
+ - Behavior of image attestation and OIDC for GHCR.
67
+ - Whether a candidate-built OCI archive fits comfortably within the artifact size and
68
+ 90-day retention model; recovery from GitHub release assets would need the archive
69
+ attached there too.
70
+ - Any real run: none was dispatched.
71
+
72
+ A first implementation should be a separate reviewed PR that lands the candidate-side
73
+ build behind an operator-controlled input, and leaves the publisher change until one
74
+ candidate has been produced and inspected.
@@ -5,24 +5,51 @@ for UI, auth and admin. Core remains at the repository root and is explicitly
5
5
  included in the shared release inventory. Moving it is not required to use the
6
6
  same release checks and coordinator.
7
7
 
8
- ## Pull requests
8
+ ## Pull requests and main pushes
9
9
 
10
- Every PR starts `verify`. A complete Git diff selects one of two lanes:
10
+ Every PR and every push to main starts `verify`. A complete Git diff selects one
11
+ of two lanes:
11
12
 
12
- - **Prose:** root project Markdown, `docs/**/*.md`, `llms.txt` and
13
- `llms-full.txt` changes run guidance/generated-resource checks, runtime audit,
14
- and the required container job. CodeQL retains its repository policy.
15
- - **Full:** all other changes, mixed changes, empty/unavailable diffs and main
16
- pushes run static checks once and core and workspace suites separately. Both
17
- suites retain Linux on Node 22/24/26. Main adds Windows/macOS on Node 24.
18
- PRs add those platform legs for runtime, CLI, SQLite, fixture, dependency,
19
- workflow and unknown changes; known UI presentation-only changes omit them. Package, action,
20
- cookbook, reproducibility and operational checks retain their coverage.
13
+ - **Prose:** root project Markdown, `docs/**/*.md`, `llms.txt`, `llms-full.txt`,
14
+ `benchmarks/agent/README.md`, `benchmarks/results/README.md` and each
15
+ package's `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md` and `GOVERNANCE.md` run
16
+ guidance/generated-resource checks, runtime audit, and the required container
17
+ job. CodeQL retains its repository policy.
18
+ - **Full:** all other changes, mixed changes, and empty, unclassifiable or
19
+ unavailable diffs run static checks once and core and workspace suites
20
+ separately. Both suites retain Linux on Node 22/24/26. Main adds
21
+ Windows/macOS on Node 24. PRs add those platform legs for runtime, CLI,
22
+ SQLite, fixture, dependency, workflow and unknown changes; known UI
23
+ presentation-only changes omit them. Package, action, cookbook,
24
+ reproducibility and operational checks retain their coverage.
21
25
 
22
- The prose allowlist is deliberately narrow. Package documentation, skills,
23
- starters, examples, schemas, manifests and workflow changes select full checks.
24
- A rename from source into docs also selects full checks. No required workflow
25
- uses `paths-ignore`.
26
+ A pull request is classified against its merge base; a push to main is
27
+ classified tip to tip from the event's `before`/`after` SHAs, so a force-push or
28
+ rewritten history is measured by what actually moved. Classification fails
29
+ closed: a missing, malformed or all-zero SHA (branch creation or deletion), and
30
+ history this checkout cannot read, select full verification. Scheduled and
31
+ manually dispatched runs are never classified from paths at all, so exact-SHA
32
+ release coverage cannot silently become a docs-only run.
33
+
34
+ The prose allowlist is deliberately narrow, and it is a list of reviewed,
35
+ non-executable contributor prose rather than "every Markdown file". Skills,
36
+ starters, recipes, examples, schemas, manifests, workflows, benchmark prompts,
37
+ tasks, answers and acceptance notes, and any package document that ships inside
38
+ a published tarball or is read by an agent surface (`README.md`, `SECURITY.md`,
39
+ `CONTRACT.md`, `THREAT-MODEL.md`, `IMPLEMENTATION-STATUS.md`, `AGENTS.md`,
40
+ `CHANGELOG.md`) select full checks. Anything feeding a generator stays in the
41
+ code lane. A rename from source into docs also selects full checks, because the
42
+ diff is read without rename detection and shows both paths. Every prose path is
43
+ still covered by the always-run `docs` job, which walks all authored Markdown.
44
+ No required workflow uses `paths-ignore`.
45
+
46
+ The always-run `docs` job runs `npm run check:docs`; in the full lane the
47
+ `static` job runs `npm run check:code`, which is the rest of `npm run check`.
48
+ The two together are exactly `npm run check`, which stays complete for local
49
+ use. This removes a duplicated dependency install plus seven repeated checks on
50
+ the same commit, not meaningful wall time: the sampled documentation checking
51
+ was about two seconds. Job names, lane selection and `verify-complete`
52
+ dependencies are unchanged.
26
53
 
27
54
  `verify-complete` accepts only the results specified by the successful plan.
28
55
  Failed, canceled, missing or unexpectedly skipped work fails the gate. Required
@@ -32,7 +59,8 @@ release publication separately requires verification of the exact main commit.
32
59
 
33
60
  ```sh
34
61
  npm run check:docs # prose checks without the runtime suite
35
- npm run ci:plan -- BASE_SHA HEAD_SHA
62
+ npm run check:code # everything in `check` except the prose checks
63
+ npm run ci:plan -- BASE_SHA HEAD_SHA # previews as a pull request outside Actions
36
64
  npm run ci:report -- RUN_ID # read GitHub job/step durations
37
65
  npm run ci:history -- 100 2026-09-19 # group historical timing samples
38
66
  npm run verify # full local validation remains available
@@ -43,123 +71,218 @@ CI uses `test:package:built` only after building in that same job. Core tests an
43
71
  workspace tests run in separate jobs to shorten their serial critical path;
44
72
  this increases job setup overhead and needs monitoring for runner queue pressure.
45
73
  After building all three extensions, the workspace job also runs the real
46
- `init --with auth,admin,ui` scaffold integration. Missing workspace outputs fail
74
+ `init --with ui,auth,admin` scaffold integration. Missing workspace outputs fail
47
75
  instead of silently skipping an absent external checkout.
48
76
  The [audit](CI-RELEASE-AUDIT-2026-09-19.md) records the previous timings.
49
- The [follow-up measurements](CI-FOLLOWUP-2026-09-19.md) record the first compact
50
- main result and explain why the new lanes still need 20 organic runs each.
51
-
52
- ## Version and release ownership
53
-
54
- A feature PR records release intent in a Changeset for a changed workspace
55
- package. Review dependency/peer changes explicitly. Keep pre-mode enabled until
56
- an explicit decision to leave alpha. Do not force all packages to one version.
57
- Core version bumps remain explicit in the release PR, including its CLI banner.
58
- `release:check` verifies every manifest against its lockfile entry and checks the
59
- alpha-mode policy. Existing CLI tests catch core banner/version disagreement.
60
-
61
- A release PR collects version/changelog and lockfile changes together. Ordinary
62
- unreleased development does not move existing version tags or npm versions.
63
- Use the exact release commit after its full platform checks have passed. Routine
64
- main builds use five OS/Node combinations per suite (ten jobs total), rather
65
- than the full nine per suite (eighteen). Nightly runs at 07:17 UTC and manual
66
- runs retain all three operating systems on all three Node versions. Before a
67
- release, run `gh workflow run ci.yml --ref main` and wait for that exact commit's
68
- full run to succeed. A successful compact main run alone cannot authorize a
69
- release. Main pushes do not cancel scheduled/manual verification.
70
-
71
- Inspect release state:
77
+ The [follow-up measurements](CI-FOLLOWUP-2026-09-19.md) record early compact-main observations; issue #185 contains the later decision
78
+ and current sample sizes.
79
+
80
+ ## Version preparation and release ownership
81
+
82
+ Core remains at the repository root. Independent extension versions remain
83
+ supported; a coordinated version is an explicit maintainer choice, not a
84
+ permanent fixed-version policy. An explicitly selected stable version exits
85
+ Changesets alpha pre-mode when no package remains on alpha; subsequent stable
86
+ patches stay out of pre-mode. Feature PRs record workspace release intent in
87
+ Changesets; core release notes remain an explicit maintainer responsibility.
88
+
89
+ `release:check` checks manifest/lock versions and peer ranges, CLI and MCP
90
+ versions, generated plugin metadata, local peer compatibility, and channel policy.
91
+ The preparation helper updates these together, adds release notes and extension
92
+ changelogs, and records the version decision. Pending Changesets must be
93
+ explicitly consumed; they are archived under `.changeset/pre/` and their summaries
94
+ included in the release notes. Review the resulting diff and peer minimums.
72
95
 
73
96
  ```sh
74
- npm run release:status # registry channels, peer compatibility, remote tag SHAs
75
- npm run release:plan # read-only JSON inventory, including root core
76
- npm run release:run # read-only ordered proposal at HEAD
97
+ # Example only: choose the next intended version before executing.
98
+ npm run release:prepare -- --version 0.4.1 --consume-changesets
99
+ # Apply local edits on a clean non-main branch; no remote writes or publication:
100
+ npm run release:prepare -- --version 0.4.1 --consume-changesets --execute
77
101
  ```
78
102
 
79
- All three commands require network access; none publish. `release:run` selects
80
- unpublished manifest versions and releases already tagged at HEAD (for resuming
81
- partial completion). Its order is core, UI, auth, admin, skipping other already
82
- published versions. Plan fields come from package manifests, not copied versions
83
- in another config file.
103
+ An optional `--notes PATH` adds reviewed maintainer notes. Dry runs do not change
104
+ files. Preparation rejects downgrades, reused local tags, dirty checkouts and
105
+ stale plans. A stable target removes `.changeset/pre.json` once no package
106
+ remains on alpha, publishes to npm `latest`, and leaves the historical `alpha`
107
+ pointer unchanged. Alpha targets
108
+ require existing alpha mode; the helper never silently re-enters prerelease mode.
109
+ It does not invoke a permanent Changesets fixed-version policy.
110
+
111
+ ## GitHub Actions release buttons
112
+
113
+ The Actions page exposes `release core`, `release UI`, `release auth`, `release
114
+ admin` and `release all packages`. Each manual workflow accepts an exact stable
115
+ or alpha version and whether to consume relevant pending Changesets. The four
116
+ package workflows update and publish only their selected package. `release all
117
+ packages` aligns and publishes the complete train in core → UI → auth → admin
118
+ order. A Changeset spanning selected and unselected packages is rejected; use
119
+ the all-packages workflow or split the change intentionally.
120
+
121
+ All five buttons call the same serialized reusable workflow. It creates a
122
+ release PR, waits for normal required checks, merges without bypass, runs the
123
+ exact-commit full matrix and signed candidate, publishes the selected immutable
124
+ tag, checks registry installability, and verifies the current four-package
125
+ consumer combination. A core release also updates the standalone starter. The
126
+ workflow is resumable: rerun the same button and version after repairing a
127
+ failure. It reuses matching PRs, tags, candidates and successful publishers.
128
+
129
+ Configure `RELEASE_AUTOMATION_TOKEN` as a repository Actions secret. Prefer a
130
+ repository-scoped GitHub App token when available. A fine-grained PAT is also
131
+ supported when it is limited to `urlcode` and `urlcode-template` with Contents,
132
+ Pull requests and Actions read/write. The repositories are public, so the
133
+ coordinator can inspect their check runs without an additional token
134
+ permission. The token owner needs ordinary write access. Do not grant ruleset
135
+ bypass, administration, approval or package-registry credentials; npm
136
+ publishers continue to use their workflow OIDC identities. Dispatch from
137
+ `main`.
138
+
139
+ ## One-command local release and resume
84
140
 
85
- Once the release itself is authorized, from a clean checkout of that exact SHA:
141
+ Inspect without writing:
142
+
143
+ ```sh
144
+ npm run release:status # registry channels, peer compatibility, tag SHAs
145
+ npm run release:plan # manifest-derived inventory
146
+ npm run release:run # ordered states at this checkout: pending/resume/unchanged
147
+ npm run release:run -- --version 0.4.1 --consume-changesets
148
+ npm run release:run -- --version 0.4.2 --package auth --consume-changesets
149
+ ```
150
+
151
+ For an explicitly authorized coordinated release:
152
+
153
+ ```sh
154
+ npm run release:run -- --version 0.4.1 --consume-changesets --execute
155
+ npm run release:run -- --version 0.4.2 --package auth --consume-changesets --execute
156
+ ```
157
+
158
+ `--execute` authorizes the entire sequence: create the release branch/PR, wait
159
+ for checks and merge, run the release gates, create version tags, publish, verify
160
+ an installed consumer, and create/check/merge the starter update. It never
161
+ approves a review or bypasses a required check. A required human review still
162
+ blocks merging. No write or publication occurs without `--execute`.
163
+
164
+ The coordinator works in a temporary clone and prints its location. It prepares
165
+ `codex/release-VERSION`, or resumes the existing PR/branch after checking its
166
+ versions and receipt. It checks out the actual merged SHA and reinstalls that
167
+ commit's locked dependencies. Repeating the command discovers existing PRs,
168
+ gates, tags and workflow state rather than creating another version. Temporary
169
+ release clones are retained for diagnosis and can be removed after completion.
170
+
171
+ For an independently prepared release PR already merged to main, use a clean
172
+ checkout of its exact commit:
86
173
 
87
174
  ```sh
88
175
  npm run release:run -- --execute
89
176
  ```
90
177
 
91
- This opt-in command creates missing tags through GitHub, refuses an existing tag
92
- at a different commit, and waits for each package's tag-triggered release before
93
- starting the next. It stops on failure or missing npm publication. Do not push
94
- all release tags at once: publication workflows share one concurrency group and
95
- GitHub may replace pending runs. The coordinator intentionally starts one at a
96
- time. It never merges a PR, bypasses checks, force-pushes or publishes locally.
97
-
98
- The coordinator needs `gh` authentication with repository Contents write and
99
- Actions read; reading checks also needs Checks read. It is intended for an
100
- authorized maintainer session or a repository-scoped GitHub App. A fine-grained
101
- PAT can serve a short-lived maintainer script with those permissions, but must
102
- have no ruleset bypass. The workflow `GITHUB_TOKEN` should not be used to create
103
- these trigger tags: its push events do not start another ordinary push workflow.
104
- For long-lived automation prefer a GitHub App; do not add a bypass to `main`.
178
+ The coordinator creates `codex/release-validation/SHA` at the already-merged
179
+ commit when gates are missing. An existing validation branch must name that
180
+ exact SHA; it is never moved. This lets main advance without changing the release
181
+ being tested. The branches remain as audit/resume references. It dispatches full
182
+ `ci.yml` and `candidate.yml`, reuses existing successful runs, and waits for
183
+ running ones. A failed gate stops with its run ID; diagnose it and rerun that
184
+ exact run before resuming. Compact PR/main checks cannot replace the full
185
+ OS/Node matrix or CodeQL on the selected commit.
186
+
187
+ Before creating any version tags, it downloads and verifies the candidate bundle.
188
+ A green run with missing artifacts does not authorize tags. New version tags are
189
+ annotated with the source commit, chosen candidate run ID and the SHA256 of its
190
+ signed manifest. The manifest binds every package and supporting asset by hash. Every package in a
191
+ resumed train must select that same candidate. Neither a later candidate of the
192
+ same source nor a newer main commit can silently replace the chosen bytes.
193
+ A successful rerun of the same candidate ID cannot substitute a changed bundle: its
194
+ manifest must still match the immutable checksum in the release tag.
195
+ After tags exist, rerun package publishers rather than the pinned candidate run.
196
+ If a later attempt of that candidate run fails, the coordinator stops even when
197
+ an earlier attempt succeeded; it does not infer which attempt should be trusted.
198
+
199
+ Publication is sequential: core → UI → auth → admin, skipping unchanged published
200
+ versions. Each publisher must succeed and its version must be readable through
201
+ npm's abbreviated install metadata, with a downloadable SHA512-verified tarball,
202
+ before dependents begin. Bounded retries handle propagation, transport failures,
203
+ 429 and server errors; authentication and integrity failures stop immediately.
204
+ Afterward, an external consumer with a fresh npm cache installs the four exact
205
+ registry versions, checks its peer tree and imports, and generates the combined
206
+ extension scaffold in dependency order (`ui,auth,admin`). The candidate archive
207
+ smoke uses the same scaffold check before any package is published.
208
+
209
+ The standalone starter helper updates the exact core pin, lockfile, matching
210
+ schema/docs links and guide from the installed published core package, then runs
211
+ validation/tests/audit/benchmark,
212
+ and opens a resumable PR. The coordinator waits for checks and merges it, checking
213
+ for a newer template pin immediately before merge. `--skip-template` explicitly
214
+ leaves this follow-up to the maintainer. To run only that follow-up:
215
+
216
+ ```sh
217
+ npm run release:template -- --version 0.4.1 --execute
218
+ ```
219
+
220
+ That standalone helper opens a PR but does not merge it. All helpers stop on
221
+ errors; rerun after diagnosis. A failed publisher is retried at most once per
222
+ coordinator invocation and must pass the original-byte recovery checks below.
223
+
224
+ The maintainer identity needs repository Contents, Actions and Pull requests
225
+ write, plus Checks read, on the affected repositories. GitHub App installations
226
+ should be scoped to URLCode and its template. No ruleset bypass or long-lived
227
+ npm token is needed. The workflow `GITHUB_TOKEN` must not create the triggering
228
+ version tags because its push events do not start ordinary push workflows.
105
229
  [GitHub App guidance](https://docs.github.com/en/apps/creating-github-apps/about-creating-github-apps/deciding-when-to-build-a-github-app)
106
230
 
107
- ## Publication and recovery
108
-
109
- The four workflow filenames remain unchanged because npm trusted publishing
110
- names them. They call shared helpers for identity, preflight, peer installation,
111
- retry handling and publication. npm authentication remains OIDC; no npm token
112
- is introduced. Core candidate and release share `prepare-core-release.sh`.
113
- For an authorized release, first dispatch the manual `candidate.yml` workflow on
114
- the selected main commit. It extends the core candidate with UI/auth/admin
115
- archives and verifies all four together in an isolated temporary consumer:
116
- peer compatibility, installed versions, public imports and real scaffold
117
- composition. Its signed `train.json` records the proposed archives and integrity.
118
- A candidate does not publish, validate live providers or prove registry OIDC;
119
- release workflows still prepare and retain their own immutable retry artifacts.
120
- Extensions share `prepare-extension-release.sh` and test published peer floors.
121
- Auth/admin build in the workspace for packaging, then build and run their suites
122
- in a temporary copy outside the monorepo against exact registry peer floors.
123
- This preserves #184’s isolation fix; npm `--prefix` is not an isolation boundary.
124
-
125
- Preflight checks the checkout SHA, main ancestry, a successful exact-SHA full
126
- `ci.yml` nightly or explicit manual run, CodeQL, remote tag SHA, npm
127
- channel monotonicity and published peer floors. When a full run was canceled,
128
- run `verify` manually at the selected tag/ref, then rerun the failed release;
129
- never substitute another commit's passing run or move the tag.
130
-
131
- Prepared artifacts are retained for 90 days before publication. A rerun of the
132
- same workflow run restores those original bytes and skips preparation. npm
133
- versions already present must have identical SHA-512 integrity; existing GitHub
134
- assets must match byte for byte. Different bytes stop the release. An absent or
135
- expired artifact requires reconstruction that still passes these comparisons;
136
- if it cannot, diagnose and create a new version rather than overwrite history.
137
-
138
- GitHub release classification follows the manifest's prerelease status. New
139
- GitHub releases use `--latest=false`; stable latest promotion is a separate
140
- maintainer decision, avoiding accidental promotion by a package-level release.
141
- GHCR updates the derived channel (`alpha` for alphas, `latest` for stable) and
142
- preserves existing version images only when their source label matches. An
143
- existing image/channel without the required labels fails closed and needs a
144
- reviewed migration; this change does not silently relabel old images.
145
-
146
- Partial npm/GitHub/GHCR success is possible; those systems cannot be updated
147
- atomically. Rerun the original failed run, check its summary and then rerun the
148
- coordinator. A changed source commit requires a new version and tag. Failed
149
- OIDC configuration needs correction on npm, not tag deletion. A green dry run
150
- cannot prove registry-side OIDC trust; each package's first authorized publish
151
- must verify it.
152
-
153
- Historical tags, GitHub release flags and npm channels are not retroactively
154
- rewritten by these scripts. Use `release:status` to inspect them. The active [Immutable release tags rule](https://github.com/jimhoyd-com/urlcode/rules/23712319)
155
- prohibits update/deletion of `v*` and `@jimhoyd/urlcode-*@*` tags, permits
156
- creation, and has no bypass actors. Its reviewed configuration is tracked in
157
- `.github/rulesets/release-tags.json`. Main protection is unchanged.
158
-
159
- During the September 19 alignment, GitHub releases `v0.4.0-alpha.1` and
160
- `v0.4.0-alpha.2` were explicitly marked as prereleases and GitHub latest was
161
- restored to `v0.3.0`, matching npm. Their tags and artifact bytes were unchanged.
162
- Further performance and release-train validation is tracked in
231
+ ## Build once, publish verified bytes
232
+
233
+ The four publisher filenames remain unchanged for npm trusted-publisher identity.
234
+ The candidate builds in the digest-pinned environment, runs verification,
235
+ packaging and local operational checks, packs all four packages, and tests an
236
+ isolated combined consumer. The signed bundle contains all four archives,
237
+ SBOM, Homebrew formula, source/build manifest, train identity and checksums.
238
+ The manifest binds it to the candidate run as well as the commit.
239
+
240
+ Publishers verify the selected candidate's workflow provenance, exact source SHA,
241
+ run identity, manifest/package identities and hashes. They publish the selected
242
+ package's existing archive without rebuilding it. Auth/admin still run isolated
243
+ compatibility tests against their actual published peer floors; temporary test
244
+ builds do not replace the promoted archive. This preserves the distinction
245
+ between workspace compatibility and registry compatibility.
246
+
247
+ Each package's GitHub release stores the complete signed bundle for durable
248
+ recovery. Supporting sibling archives are candidate evidence: an independent
249
+ package release does not imply every sibling archive was published to npm.
250
+ Candidate and release Actions artifacts retain 90 days; retention is not an
251
+ archival guarantee. Keep independent last-good copies for deployment rollback.
252
+
253
+ ## Recovery, immutable tags and channels
254
+
255
+ A retry restores the original retained bundle, or recovers the complete verified
256
+ bundle from that package's GitHub release. Missing, incomplete or unverifiable
257
+ originals stop the retry. It never rebuilds archives or substitutes a new
258
+ candidate. If publication stopped before a complete durable release existed and
259
+ the retained artifact is gone, a new version may be required.
260
+
261
+ Existing npm versions must match SHA512 integrity; existing GitHub assets must
262
+ match byte for byte. Partial npm/GitHub/GHCR success is possible and cannot be
263
+ made atomic. Fix registry identity/settings where appropriate and resume the
264
+ original run. A source change requires a new version and tag. Never delete,
265
+ recreate, move or force-push version tags.
266
+
267
+ These recovery changes apply to releases made with the new workflows. They cannot
268
+ change the immutable workflow source at `0.4.0-alpha.3` or repair that historical
269
+ run by rerunning it. The missing-artifact behavior observed there is recorded in
270
+ [issue #223](https://github.com/jimhoyd-com/urlcode/issues/223).
271
+
272
+ npm uses OIDC with pinned npm 11.5.1. Alpha versions use npm/GHCR `alpha`, and
273
+ GitHub prerelease classification with `--latest=false`. Existing `latest`
274
+ pointers are not promoted by this flow. Core GHCR publication remains conditional
275
+ on `PUBLISH_CONTAINER=true`; its existing version/channel identity guards remain.
276
+ Historical GHCR verification is still a separate follow-up. Digest promotion of a
277
+ tested image is design only, in [CONTAINER-PROMOTION.md](CONTAINER-PROMOTION.md);
278
+ the publisher still builds from source.
279
+
280
+ The [Immutable release tags rule](https://github.com/jimhoyd-com/urlcode/rules/23712319)
281
+ blocks updates/deletions of `v*` and `@jimhoyd/urlcode-*@*`, permits creation, and
282
+ has no bypass actors. Main protection is unchanged. Source and artifact checks
283
+ are not an independent security assessment, provider deployment or recovery
284
+ proof. The next explicitly authorized new release must exercise the complete
285
+ new promotion/recovery path. Progress and remaining work are recorded in
163
286
  [issue #185](https://github.com/jimhoyd-com/urlcode/issues/185).
164
287
 
165
288
  ### Windows fixture cleanup