Skip to content

release path: k8s-client stranded at 0.32.0, peer ranges not bumped on single-lexicon release, and release commits bypass CI #1255

Closed

Description

@lex00

Three defects in the release path, found while shipping fly 0.33.1. They are independent; two are fixable in this repo, one needs an action on npmjs.com.

1. @intentius/chant-k8s-client is stranded at 0.32.0 on npm

Everything else is at 0.33.0. The client is not.

@intentius/chant-k8s-client   0.32.0    ← npm
@intentius/chant              0.33.0
packages/k8s-client (local)   0.33.0

Its publish step fails and has been failing. From run 30411782660 (and 30409489666 before it):

npm error code ENEEDAUTH
npm error need auth This command requires you to be logged in to https://registry.npmjs.org/

Step-level result for that run — one failure, twelve successes:

success  Publish @intentius/chant
failure  Publish @intentius/chant-k8s-client
success  Publish @intentius/chant-lexicon-gitlab
...      (every remaining lexicon: success)

ENEEDAUTH on the OIDC path means npm found no credentials and performed no trusted-publisher exchange — i.e. there is no trusted publisher record for @intentius/chant-k8s-client, while every other package has one. This is exactly the failure mode c3dcbc7c anticipated when it made each package publish independently; that change is why one missing record no longer strands the packages after it, but the client itself is still stranded.

It matters beyond tidiness: the k8s lexicon declares the client as an optional dependency, and publish.yml's own comment says publishing it first is "what keeps chant lifecycle diff --live working for a registry install rather than silently degrading to holes."

Fix (not code): add a trusted publisher record on npmjs.com for @intentius/chant-k8s-client → repo INTENTIUS/chant, workflow .github/workflows/publish.yml. Then re-run publish, or let the next release carry it.

2. just release-lexicon does not keep @intentius/* peer ranges in lockstep

just release bumps .version and rewrites the @intentius/chant / @intentius/chant-lexicon-github peer ranges to match (added in #411, because ranges frozen at ^0.1.0 break clean installs).

release-lexicon only sets .version:

jq --arg v "$next" '.version = $v' lexicons/{{name}}/package.json

Harmless today — fly 0.33.1 still wants core ^0.33.0, which is satisfied — but a single-lexicon patch that needs a newer core silently ships a stale range, reintroducing #411 for that package.

3. Release commits bypass branch protection

Both recipes push the version-bump commit straight to main:

remote: Bypassed rule violations for refs/heads/main:
remote: - 3 of 3 required status checks are expected.

So the commit a release tag points at is one CI never ran. The bump itself is mechanical (a .version edit), but nothing verifies the code being released was green either — release-lexicon will happily tag and publish from a red or unpushed main.

Proposed fix: a pre-flight in both recipes — refuse to tag unless the working tree is clean, HEAD matches origin/main, and the latest CI run for that commit concluded success. An explicit opt-out flag for emergencies.

Scope

  • 1 — trusted publisher record for chant-k8s-client (npmjs.com, needs an owner)
  • 2 — peer-range lockstep in release-lexicon, guarded by a test
  • 3 — pre-flight green/pushed check in both release recipes

Related: d4a269cd fixed a fourth defect in this same path (single-lexicon tags did not trigger the publish workflow at all) and added packages/core/src/codegen/release-wiring.test.ts, which is where 2's guard belongs.

Activity

  1. added
    bug
    on Jul 30, 2026
  2. lex00 commented on Jul 31, 2026

    @lex00
    ContributorAuthor

    Item 1 is done, and 2–3 are up in #1281.

    1 — trusted publisher for @intentius/chant-k8s-client ✅

    Configured on npmjs.com. The package published 0.33.1 over OIDC with a provenance attestation, so it went through trusted publishing rather than a fallback:

    @intentius/chant-k8s-client   0.33.1   slsa.dev/provenance/v1
    

    @intentius/chant-lexicon-fountain had the same defect (added in #1253, never given a record) and was stranded at 0.33.0. Both are now at 0.33.1 and the whole estate is level.

    The record existed but did not match, for a while. The org field was intentius; npm compares it to the GitHub OIDC claim case-sensitively, so INTENTIUS was required. Until it was capitalized, the token exchange returned 404 package not found and npm publish fell through to a bare ENEEDAUTH — indistinguishable from having no credentials at all. Worth knowing before anyone debugs this again.

    Why it was hard to diagnose, and what now prevents a repeat

    npm's OIDC helper is written never to throw: when the exchange fails it logs at verbose level and returns undefined, so the only visible symptom is ENEEDAUTH. That one error covers "no record", "record doesn't match this workflow", and "no credentials".

    #1278 addressed that:

    • scripts/publish-packages.sh replays the exchange and prints the registry's own status and message instead of leaving you to infer from ENEEDAUTH. (A successful exchange answers 201, not 200.)
    • scripts/audit-trusted-publishers.sh runs on every publish as a non-gating audit job and reports coverage across all 14 packages in ~40s, so a package missing its record surfaces immediately rather than at release time. It has to live in publish.yml — npm matches the record against the workflow filename, so probing from any other workflow returns 404 for everything and proves nothing.
    • The 14 copy-pasted publish steps are gone; the script enumerates the workspace, so a new package can no longer ship without a publish path. That was the root cause for both k8s-client (feat(k8s): typed API client — kubectl shell-outs retired (#1074) #1177) and fountain (feat(fountain): the fountain lexicon — observation, rule pack, import, and a closed plugin surface (#1217) #1253).
    • The lexicon-authoring docs never mentioned creating the record at all, which is why it kept being missed. Fixed, plus a Lexicon Onboarding Skill that leads with it.

    2 and 3 — #1281

    • 2 — release-lexicon now rewrites the @intentius/* peer ranges, pinned to the current core version rather than $next (a single-lexicon patch doesn't move core, so ^$next would demand a version that doesn't exist). Also keeps package-lock.json in step, per chore: sync package-lock with the 0.20.0 release bump #1094.
    • 3 — scripts/release-preflight.sh, shared by both recipes, refuses to tag unless the tree is clean, HEAD matches its pushed branch, and the chant run for that commit concluded success. CHANT_RELEASE_SKIP_PREFLIGHT=1 is the opt-out.

    Guards for both are in release-wiring.test.ts, as this issue suggested.

  3. lex00 commented on Aug 4, 2026

    @lex00
    ContributorAuthor

    Closing — all three defects are resolved. Verified each rather than assuming, since they landed separately and none referenced this issue on closing.

    1. @intentius/chant-k8s-client stranded at 0.32.0 — fixed. It is now in lockstep with everything else on npm:

    @intentius/chant              0.39.0
    @intentius/chant-k8s-client   0.39.0
    @intentius/chant-lexicon-k8s  0.39.0
    @intentius/chant-lexicon-fly  0.39.0
    

    That was the non-code half (a trusted-publisher record on npmjs.com), so it left no commit here — worth stating, because nothing in the repo records it happening.

    2. just release-lexicon not keeping peer ranges in lockstep — fixed. The recipe now rewrites them, and gets the subtle part right: a single-lexicon patch does not move core, so the ranges track the CURRENT core / github-lexicon versions rather than the lexicon's new one. Pinning them to $next would demand a core that does not exist.

    core=$(jq -r .version packages/core/package.json)
    github_lexicon=$(jq -r .version lexicons/github/package.json)
    jq --arg v "$next" --arg core "$core" --arg ghl "$github_lexicon" '
      .version = $v
      | if .peerDependencies["@intentius/chant"] then .peerDependencies["@intentius/chant"] = "^" + $core else . end
      | ...
    

    3. Release commits bypassing branch protection — fixed. scripts/release-preflight.sh refuses to tag unless the tree is clean, HEAD matches its remote, and the latest CI run for that commit concluded success, with CHANT_RELEASE_SKIP_PREFLIGHT=1 as the emergency opt-out. Both recipes call it — release with main required, release-lexicon with any branch allowed but still pushed and green.

    Nothing left to do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions