Skip to content

Align monorepo CI lanes and immutable package release flow - #187

Merged
jimhoyd merged 2 commits into
mainfrom
codex/ci-release-audit
Sep 20, 2026
Merged

jimhoyd merged 2 commits into
mainfrom
codex/ci-release-audit

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and change

A prose-only PR changed AGENTS.md and took 9m08s because every PR ran the complete core and extension suites on three Node versions. Releases duplicated shell logic across four workflows, reused version tags across commits, and could publish from a failing main revision.

Add a fail-closed prose lane while preserving the required verify-complete, container, and CodeQL policies. Run static checks once and core/workspace suites independently with existing Node/OS coverage. Restore the real workspace scaffold integration that previously skipped because it referenced old external checkouts.

Centralize release identity, exact-SHA main/CodeQL preflight, published-peer installation, immutable artifact retries and channel checks. Candidate/core release share preparation; extension publishers share preparation and keep their existing npm OIDC workflow names. Add read-only status/plan/timing helpers and an explicit sequential release coordinator. Align all workspace lockfile versions and replace stale release/version documentation with the current runbook and measured audit.

Verification

  • npm run verify passed after merging Run the peer-floor gate outside the workspace #184: 842 passing tests and one existing live-TLS fixture skip, including the real workspace scaffold integration.
  • Preserved Run the peer-floor gate outside the workspace #184 by moving the shared auth/admin peer gate outside the workspace and reading peer manifests directly. Actual isolated registry-floor suites passed: auth 204 tests, admin 65 tests.
  • npm run test:package passed archive installation, starter/cookbook and declaration consumer checks.
  • Final lint/typecheck, docs/resource checks, release consistency checks and 19 focused CI/release regressions passed; all workflow YAML parsed and 73 shell steps passed bash -n.
  • Read-only release:status, release:run, and ci:report exercised against live metadata. No publish or execute command ran.
  • An initial sandboxed test attempt failed because loopback sockets were forbidden; verification passed with local socket access.
  • Hosted CI passed on the original PR commit; checks are rerunning on merge commit 48c3d8c. Publication/OIDC and GHCR recovery remain external validation. See [Request]: Measure CI lanes and complete release-train validation after alignment #185 for measured post-rollout performance, published-tarball train preparation and further coverage work.

Compatibility and security

No runtime YAML/API, licensing or trust-boundary changes. Main protections and supported matrix coverage remain. New release publication fails closed on a non-green source commit, wrong tag SHA, different already-published bytes or channel regression. Older unlabeled GHCR images need reviewed migration; no existing image is silently relabeled. The coordinator is read-only unless --execute is supplied and never merges or bypasses checks.

Separately, the user explicitly approved and enabled immutable release-tag rule 23712319 (no bypass actors); its exact configuration is included. Existing GitHub alpha releases were marked prerelease and latest restored to stable v0.3.0, resolving #186, without moving tags or changing artifacts. No package was published.

  • Changes match the documented portable contract; docs/examples are updated where needed.
  • Relevant tests and package checks pass, or limitations are explained above.
  • No credentials, customer data or private project material are included.
  • Runtime/starter changes remain aligned where applicable.

@jimhoyd

jimhoyd commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator Author

Review from the session that built the release workflows this replaces. Scope
of what I actually read: scripts/release.ts, scripts/prepare-extension-release.sh,
the three release-*.yml, and ci.yml's job shape. I did not read
ci-plan.ts, ci-report.ts, release-run.ts, the ruleset JSON, or the new
tests, so treat this as a partial review.

Blocking: release.ts peers will fail auth and admin exactly as they failed an hour ago

scripts/release.ts lines ~170-175 reimplement the approach that just broke a
real release — run 35477137969,
which failed at that step and published nothing:

run(process.execPath, [npm, 'install', '--no-save', '--ignore-scripts', '--prefix', pkg.directory, ...specs]);
const req = createRequire(resolve(pkg.directory, 'package.json'));
const path = realpathSync(req.resolve(`${name}/package.json`));
assert(path.startsWith(nested), `${name} resolved to a workspace instead of its published peer`);

Two independent faults, both observed rather than predicted:

  1. --prefix does not shadow a workspace-linked sibling. In that run npm
    nested the published @jimhoyd/urlcode but silently reused the root
    symlink for @jimhoyd/urlcode-ui, which points into the working tree. The
    gate exists to prove the published peers satisfy the package; without the
    assertion it would have run against the working tree and logged success.

  2. req.resolve('<name>/package.json') throws for ui.
    ERR_PACKAGE_PATH_NOT_EXPORTED — @jimhoyd/urlcode-ui's exports map does
    not expose ./package.json. Core does, which is why core printed a version
    and ui crashed. So fault 2 masks fault 1.

prepare-extension-release.sh skips release:peers for packages/ui, so this
lands on auth and admin, whose peers include ui.

#184 (now on main as 3f4985b) fixes both by not fighting the workspace:
copy the package to $RUNNER_TEMP, install published peers there, run the
suite there — no repository root above it, so nothing to hoist to. The
assertion reads the manifest from the filesystem instead of asking the
resolver. Verified end to end locally: both peers install at their declared
floors (0.4.0-alpha.2, 0.1.0-alpha.1) and auth's 204 tests pass against
them. Worth adopting that into release.ts peers on rebase.

Where this is better than what it replaces

Splitting verify and workspaces into separate matrix jobs is a better
answer to the Windows timeout than #188's blunt cap raise. All three
windows-latest legs were being killed at exactly 10 minutes — one job now
runs four suites where the cap was set for core's alone — and GitHub reports a
timed-out job as cancelled, which reads like an unrelated interruption.
Splitting the work keeps each job under the existing cap instead of moving it.

Unproven on Windows either way: no Windows leg has completed since the
consolidation, so neither approach has evidence yet. Worth watching the first
push to main after whichever lands.

Mechanical

This now conflicts with 3f4985b on all three release-*.yml, and with
packages/ui/test/package.test.ts, .changeset/README.md and
docs/VERSION-ALIGNMENT.md. Two things to preserve through the rebase:

  • check-release-tags.ts and check-workspace-links.ts stay in check —
    they are still there in this diff, just confirming they survive.
  • .changeset/config.json's onlyUpdatePeerDependentsWhenOutOfRange. Without
    it, changeset version rewrote admin's peer on auth from
    >=0.1.0-alpha.2 <0.2.0 to >=0.1.0-alpha.4 <0.1.0 — narrowing the upper
    bound so admin would refuse auth 0.1.0, and raising the floor above auth's
    latest, which is the failure VERSION-ALIGNMENT's second invariant exists to
    prevent.

jimhoyd added a commit that referenced this pull request Sep 20, 2026
All three windows-latest legs were cut off at exactly 10 minutes. GitHub reports a timed-out job as cancelled rather than failed, so it read like an unrelated interruption. The cap was set when this job ran core's suite alone; it now runs four. Raised to 25 for the matrix job only, since the observed durations are censored. If #187's verify/workspaces split lands, this becomes a cap that is never reached.
@jimhoyd
jimhoyd merged commit d2656ec into main Sep 20, 2026
16 checks passed
@jimhoyd
jimhoyd deleted the codex/ci-release-audit branch September 20, 2026 00:38
jimhoyd added a commit that referenced this pull request Sep 20, 2026
0.1.0-alpha.4 was versioned and tagged but never published. Its tag was created
before the peer-floor gate was fixed, and GitHub runs a workflow from the
commit the tag points at, so re-running that release would have re-executed the
broken gate. Moving a tag onto a later commit is worse than spending a version
number, so the version moves instead; the inert alpha.4 tag stays where it is,
pointing at a commit that never shipped.

No change to the published package. ui 0.1.0-alpha.6 and admin 0.1.0-alpha.4
published normally; this only affects auth.

#187's release:check earned its place here: `changeset version` updates the
manifest but not the root lockfile, and the check refused the commit until
`npm install --package-lock-only` brought them back into agreement. Nothing
else would have caught that before the tag was pushed.

No fix was needed to #187's peers step after all. The revision that merged
already replaces the --prefix approach with an isolated temp copy and reads
each peer's manifest from the filesystem rather than through its exports map --
both points from the review on that PR -- and adds an assertion the earlier
version did not have, that the installed version equals the declared floor
exactly.

Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant