GITHUB_TOKEN cannot merge a PR that touches .github/workflows. The sweep tries,
the merge API refuses, it logs "leaving for the next sweep", and repeats — while
still exiting 0. So the failure is invisible: every run reports success and the
PR simply never merges.
That is not hypothetical. ai-kit #11 (bump actions/checkout) sat green, CLEAN
and MERGEABLE for nine days; aoz-housing #122 (bump actions/upload-artifact)
for nine more. Both had to be merged by hand today. Every Dependabot
`github_actions` bump in the fleet is in this class, permanently.
A PAT fixes a second thing that costs more: THROUGHPUT. A dispatch made with
GITHUB_TOKEN emits no workflow_run, so after each merge nothing wakes the sweep
to take the next PR — it waits for the cron, and GitHub throttles scheduled
workflows to roughly hourly regardless of what the cron says. Observed in
fleetcrown: sweeps ~50-65 minutes apart against a */10 schedule. A PAT-created
dispatch does emit workflow_run, so the queue drains at CI speed instead.
The reusable workflow has always supported this — GH_TOKEN is
`secrets.token || github.token`. This just passes it.
SAFE BEFORE THE SECRET EXISTS: an undefined secret resolves to empty, and the
fallback picks github.token. So this changes nothing until FLEET_PAT is created
as an organisation secret, and needs no second pass afterwards.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Publishing is trusted publishing (OIDC) since #9; the NPM_TOKEN secret is
being deleted. Without this, the weekly probe would fail on the missing
secret and open a false "releases are blocked" issue.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Ports ai-forms' publish reconciler: merging a version bump to main is the
whole release. The workflow (on push, hourly, or by hand) asks the registry
whether package.json's version exists and publishes it if not — idempotent,
and immune to the tag-pushed-by-GITHUB_TOKEN trigger gap.
Auth is OIDC via the package's Trusted Publisher (this repo + publish.yml),
so no npm token exists to leak or expire. The bump to 0.1.1 makes the merge
itself prove the tokenless path live.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Mirrors ai-forms#17, where this was not theoretical: that repo's merge to main
started no publish run, because auto-merge merges with GITHUB_TOKEN and a push
with that token starts no workflow. The identical change fired here only
because I merged this repo's PR by hand with a user token.
threadkit has no auto-merge today, which is exactly why the schedule belongs
here now — rather than being added after auto-merge arrives and a release
quietly goes missing.
The question the workflow asks — "is package.json's version on the registry?" —
is idempotent, so asking it hourly costs one `npm view` when there is nothing to
do and repairs a missed release when there is.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Mirrors ai-forms#16 so both libraries release identically.
Cutting a release meant `npm version && git push --tags` by hand. Now merging a
version bump to main ships the package: the workflow asks the registry whether
package.json's version already exists and publishes it if not.
That check rather than a tag trigger, because a tag pushed by GITHUB_TOKEN does
not start another workflow — "push a tag, let publish.yml notice" silently never
runs — and because asking npm what is published is idempotent, so a re-run or a
hand-pushed tag cannot double-publish. The tag is created after a successful
publish, so it never claims a release that did not happen.
NPM_TOKEN expires 2026-11-14. token-health.yml probes `npm whoami` weekly and
opens a single issue when it fails, with the fix in it — rather than letting a
release three months from now be the thing that discovers the expiry, reported
as a 403 that reads like a permissions problem.
Verified: both files parse, and the registry check answers correctly against the
real registry for threadkit@0.1.0 (already published → skip).
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Same fix as ai-forms, before hitting the same failure. Trusted publishing
is configured per package on npmjs.com and cannot be configured for a
package that has never been published, so the token-free workflow fails
on the first release with E404 on the PUT.
Co-authored-by: Mao Nakamoto <georgy.butaev@revamp-it.ch>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The publish workflow added yesterday needed an NPM_TOKEN secret. Trusted
publishing removes that requirement entirely: the workflow exchanges a
short-lived, workflow-scoped OIDC credential with npm at publish time, so
nothing long-lived is stored and there is no secret to leak or rotate.
Two things this workflow would have failed on, from the npm docs:
- Node 22 bundles npm 10.x, but trusted publishing requires npm >= 11.5.1.
Node 24 ships npm 11, so the runtime is bumped rather than adding a
separate npm upgrade step.
- `NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}` passed an empty string with no
secret set. The documented OIDC example sets no token at all — the
`id-token: write` permission already present is what does the work.
Provenance stops needing the flag: npm generates attestations automatically
for a public package published from a public repo via OIDC.
Matches the identical change in ai-forms, so the two libraries keep releasing
the same way.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
threadkit has a CI workflow but no way to ship. The package is publish-ready —
name unclaimed on npm, `files: ["dist"]`, README and LICENSE both in the
tarball, 27 files, builds clean — so the only thing standing between it and a
release was a manual `npm publish` from someone's laptop.
This is the same workflow ai-forms already carries, so the two libraries
release identically rather than each growing its own procedure:
- triggered by a `v*` tag, so every published artifact traces to a commit
- `id-token: write` for npm provenance — the registry can prove the tarball
was built by this workflow from this commit, not uploaded from a laptop
- runs `npm run verify` first: never publish something that would not pass CI
- refuses to publish when the tag and package.json version disagree, instead
of silently shipping the wrong number
Verified locally with the workflow's exact steps: `npm ci --ignore-scripts`
then `npm run verify` — 31 tests pass.
Needs the NPM_TOKEN repo secret once; after that a release is `npm version`
plus a tag push.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Each invariant was verified to fail when broken: forcing the visibility
window open fails 4 targeted tests, and swapping the per-participant read
mark for a shared one fails exactly the test that names that bug.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>