Skip to content

refactor(ci): split release.yml so each workflow carries one design - #119

Merged
theCodeDrift merged 4 commits into
mainfrom
openspec/nightly-1-workflow-split
Aug 21, 2026
Merged

theCodeDrift merged 4 commits into
mainfrom
openspec/nightly-1-workflow-split

Conversation

@theCodeDrift

@theCodeDrift theCodeDrift commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

Stack (root → tip):

PR 1 of 3 for the nightly-cli-builds change. Behavior-preserving apart from one correction, and it exists so PRs 2 and 3 add one flow each to a file that already has one job.

The split

File Job(s) Credential
release-cli-changeset.yml version — opens the Version Packages PR none, keeps concurrency: release-${{ github.ref }}
release-cli.yml check + publish, in one file npm-production, approval
release-vale.yml renamed from vale-binaries.yml unchanged

release.yml is deleted. Each new file carries a header written for its own trust story rather than a copy of the original — release.yml's header is the reason its security properties survived this long, and splitting it without splitting the reasoning would have thrown that away.

check and publish stay together deliberately: the credential-free gate is what keeps an OIDC-capable job from existing on an ordinary push, and separating it from the job it protects is the arrangement most likely to be broken by a later partial edit.

release-cli.yml has no concurrency group, also deliberately, and the header says why — the gate makes a duplicate publish a no-op, and the residual TOCTOU is handled the way the Vale workflow already handles it, treating a publish failure as possibly-already-published.

Verified equivalence

A parsed-config diff of old versus new shows version, check, and publish byte-identical, with the same triggers and the same permissions: {}. All 9 workflow files parse under js-yaml.

Two intentional behavior differences:

  1. check/publish no longer share the release-* concurrency group (D6).
  2. The release now runs as two workflow runs rather than one, so check contexts become Release CLI Version PR / … and Release CLI / … instead of Release / ….
  3. The Vale workflow's display name and concurrency group are renamed (Vale Binaries → Release Vale, vale-binaries → release-vale), so its check context changes too and anything keyed on the old name (badges, notification rules, gh run list --workflow) stops matching.

None of these is a required check. Branch protection on main requires only Validate, from ci.yml — confirmed via the API, so no repo-settings change is needed. pr-check-openspec.yml, require-changeset.yml, stack-breadcrumb.yml, and .github/scripts/*.cjs key on nothing workflow-name-specific.

The renamed Vale workflow is renamed through: name: becomes Release Vale and concurrency: becomes release-vale. A file called release-vale.yml that still announced itself as Vale Binaries would reproduce the naming mismatch this split exists to remove, so task 1.5 calls for both. Its whole header comment is preserved verbatim apart from the release.yml → release-cli.yml reference.

The one behavior-adjacent correction

release.yml's header claimed "No required reviewers (fully automatic once the Version Packages PR merges), by design." That is false: npm-production has required_reviewers (reviewer thecodedrift) plus a protected-branches policy. A release has always waited on an approval the file denied existed. The new header states what is configured, and why.

Three things measurement corrected in the proposal

Task group 0 is verification, and it contradicted the design in three places. All three are fixed in design.md and tasks.md on this branch, since PR 2 codes against them:

  1. changeset status --output returns an object, not an array. It is {changesets: [...], releases: [{name, type, oldVersion, changesets, newVersion}]}. The bump is data.releases.find(r => r.name === "@taskless/cli").newVersion. The proposal described a bare top-level array — so the review finding about not indexing with [0] was right about the hazard and wrong about the shape.
  2. The absolute-path trap was mis-stated. --output=/tmp/x.json resolves against cwd to <cwd>/tmp/x.json and fails loudly with ENOENT and exit 1. It does not silently write nothing. It would write to the wrong place silently only if that directory happened to exist.
  3. npm-autopublish already exists, created 2026-08-18 — but with no protection rules and no deployment branch policy, meaning any branch may deploy to it. Group 2 is half-done and the missing half is the branch restriction. Noted inline on task 2.1 so nobody assumes it is complete. Inert today since no workflow references it; load-bearing the moment PR 3 does.

@taskless/cli-nightly is confirmed unclaimed on npm.

Verification

pnpm lint clean · pnpm typecheck 1/1 · pnpm test 602 passing · openspec validate --all --strict 24/24 · .github/scripts tests 113 passing across 4 files (turbo does not cover these, so they were run directly)

Refs #111

Refs OSS-34

Built on top of #116

Proposal only — no implementation. Artifacts for a nightly build of the CLI published from main as a separate package, plus a split of the release workflows so each carries one design.

What it proposes

  • @taskless/cli-nightly, published from main, version n.m.k-yyyymmddhhmmssx<sha>
  • Two gates: is .changeset/ empty (a directory listing, before any install), and is this SHA already built
  • A new npm-autopublish environment for flows that publish without a human click
  • Four workflow files replacing release.yml and vale-binaries.yml, each with one trust story

The design is argued in #111; design.md records the decisions with their reasoning rather than restating the conclusions.

Built from main, not from PRs

The original framing was "on PR update". That is what the title of #111 said until this proposal was written, and it does not survive contact with release.yml's security model: a PR-triggered publish would route contributor-authored changeset text into a credentialed job, inverting the split that file exists to maintain, and would publish unreviewed code under the @taskless scope.

Tying builds to changeset edits does not work either. Measured on the #71→#106 stack, add-vale-rule-engine had 7 commits after its last changeset edit and agent-command-and-vale-authoring had 11 — a nightly stamped at changeset-edit time would omit all of them while looking current.

Delivery: stacked, merging forward, three PRs

  1. Split the release workflows — behavior-preserving, plus a correction to release.yml's header, which claims "No required reviewers … by design" while npm-production demonstrably has a required reviewer.
  2. The nightly — including creating npm-autopublish and registering trusted publishing.
  3. Move Vale to npm-autopublish — tip, archives the change.

The nightly deliberately precedes the Vale move. npm trusted-publisher bindings can be scoped to a GitHub environment. If the six @taskless/vale-* bindings are, moving Vale first invalidates all of them and the next publish fails the OIDC handshake with no stored token to fall back on — trading a working release path for a convenience. The nightly exercises the same environment, handshake, and binding model on a package where failure is free: nothing resolves @taskless/cli-nightly, so a failed first publish blocks nobody. Stated generally in design.md, because it outlives this change: prove a new credential path on something disposable before migrating something that works onto it.

Two prerequisites no implementer can satisfy

Called out in the proposal body rather than buried in tasks, because they gate merges:

  1. The npm-autopublish environment must be created in repo settings — no required reviewers, branch policy on main.
  2. @taskless/cli-nightly must be published once manually and a trusted-publisher binding registered. Trusted publishing is per-package, and the package does not exist yet.

Both sit as maintainer task groups before the nightly unit. A PR waits rather than merging with a dangling environment reference.

Gaps this surfaced in #111

Writing the design down found four things the discussion had left implicit, all captured as tasks:

  • changeset status returns an array; taking [0] breaks the day a second changesets-managed package appears. Filter by name.
  • npm view … versions lists versions regardless of tag, so a version that published but failed to get tagged reads as already-built and is skipped forever. The Vale workflow handles that case explicitly; nightly's was left implicit.
  • Renaming a workflow renames its check. main requires Validate; any branch-protection or breadcrumb reference to an old name silently stops reporting.
  • Whether Vale's trusted-publisher bindings are environment-scoped is unknown and unasked — the most likely way the Vale PR breaks.

openspec validate --all --strict: 24 passed, 0 failed.

No changeset — a proposal ships nothing.

Refs #111

Refs OSS-34

Loading
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.

2 participants