Files from bitbaum/fleet `templates/package` that this repository does not have yet:
- `.github/workflows/release-notify-tagged.yml`
Only missing files are added — no file this repository already has is changed. `release.yml` is what lets the package owner release a new version from Loki (the package page: "Release vX.Y.Z"), or from the Actions tab.
Opened by bitbaum/fleet `scripts/packages/sync-package-template.mjs` (`.github/workflows/package-repos.yml`). It merges itself when this repository's CI is green.
Co-authored-by: bitbaum-fleet <fleet@bitbaum.invalid>
Owner, 2026-11-06: the fleet's packages belong under the @bitbaum npm
organization; this one was published earlier, unscoped, and never moved
(fleet docs/package-scope-migration-plan.md). Name, imports in tests, examples
and docs change; no API changes. The old name stays installable and is
deprecated once no adopter uses it.
Claude-Session: https://claude.ai/code/session_019MDtmvpWNTLxXNfwUHS7MD
Co-authored-by: Claude <noreply@anthropic.com>
Problem: this repo's @bitbaum package was published to npm with a maintainer token, so nothing proves npm trusts this workflow, and the next release is the first test. Change: the fleet's current publish.yml (bitbaum/fleet#314): the same publish path as before, plus a diagnose_auth input on Run workflow that asks npm whether it trusts this workflow for this package (HTTP 200 linked, 404 not) and publishes nothing.
Problem: the README told a reader to install a Git tag or a raw commit (2 files changed, 15 insertions(+), 1 deletion(-)). The package is on npm and fleet's SHARED.md and registers/packages.json name npm as the install route; a Git pin hides the version and defeats semver updates. Change: the install line is the npm one. Nothing else in the README changed.
Files from bitbaum/fleet `templates/package` that this repository does not have yet:
- `.github/workflows/release-notify.yml`
Only missing files are added — no file this repository already has is changed. `release.yml` is what lets the package owner release a new version from Loki (the package page: "Release vX.Y.Z"), or from the Actions tab.
Opened by bitbaum/fleet `scripts/packages/sync-package-template.mjs` (`.github/workflows/package-repos.yml`). It merges itself when this repository's CI is green.
Co-authored-by: bitbaum-fleet <fleet@bitbaum.invalid>
Files from bitbaum/fleet `templates/package` that this repository does not have yet:
- `AGENTS.md`
- `CLAUDE.md`
Only missing files are added — no file this repository already has is changed. `release.yml` is what lets the package owner release a new version from Loki (the package page: "Release vX.Y.Z"), or from the Actions tab.
Opened by bitbaum/fleet `scripts/packages/sync-package-template.mjs` (`.github/workflows/package-repos.yml`). It merges itself when this repository's CI is green.
Co-authored-by: bitbaum-fleet <fleet@bitbaum.invalid>
Files from bitbaum/fleet `templates/package` that this repository does not have yet:
- `.github/workflows/git-release.yml`
- `.github/workflows/release.yml`
Only missing files are added — no file this repository already has is changed. `release.yml` is what lets the package owner release a new version from Loki (the package page: "Release vX.Y.Z"), or from the Actions tab.
Opened by bitbaum/fleet `scripts/packages/sync-package-template.mjs` (`.github/workflows/package-repos.yml`). It merges itself when this repository's CI is green.
Co-authored-by: bitbaum-fleet <fleet@bitbaum.invalid>
Tag vX.Y.Z publishes via OIDC once NPM_PUBLISHING=on; until then a tag
runs green and says why. No token anywhere.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The product was renamed on 2026-09-14: bitbaum/loki, loki.orangecat.ch,
LOKI_* env keys, loki-* units. This repo referenced the old name in
1 file changed, 1 insertion(+), 1 deletion(-).
Email addresses at the old sending domain stay until the new domain is
verified in Resend.
Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
The comment added a few hours ago says GITHUB_TOKEN cannot merge a PR that
touches .github/workflows. That is contradicted by this fleet's own history:
github-actions[bot] merged datacat#253 and ai-kit#42 today, and both change a
workflow file. I asserted it from the reusable workflow's docstring without
checking, then found the counter-evidence while looking for something else.
Two stalled PRs were offered as proof and neither survives either. ai-kit#11
opened 2026-08-29 and this repo's sweep was not added until 2026-09-04, so for
most of that PR's life nothing was sweeping at all. aoz-housing#122 is still
unexplained — I merged it before diagnosing it, which destroyed the evidence.
The THROUGHPUT reason is unaffected and is why the line stays. A dispatch made
with GITHUB_TOKEN triggers no workflows — the same rule the deploy reconciler
exists for — so after a merge the re-armed CI run's completion fires no
workflow_run and nothing wakes the sweep for the next PR. It waits for the
cron, which GitHub throttles: fleetcrown's sweeps land 50-65 minutes apart
against a */10 schedule. A PAT-created dispatch does emit workflow_run.
The wrong claim is recorded in the file rather than quietly deleted, so the
next reader does not re-derive it from the same docstring I did.
No behaviour change: an undefined secret still resolves to empty and the
reusable workflow still falls back to github.token.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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>
The README install line pointed at the retired handle
(`github:catomean/limitkit`) and the old `v0.1.0` tag; the repo lives under
the `bitbaum` org and is at v0.2.0 (limitkit is not on the npm registry —
unpublished 2026-03 — so the github: form stays). Command switched to pnpm,
the fleet's one package manager.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* chore: add a formatter, matching the style this repo already writes
singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.
Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* style: format with prettier (5 files)
Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* chore: teach git blame to skip the reformat
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Was: >=18.
Eighteen of thirty repos declared no Node version at all, and the twelve
that did used five spellings of the same intent - >=18, >=20, >=20.0.0,
>=22, >=22.19.0. The box runs 20.20.2, so >=22 was a claim nothing could
satisfy and nothing would have caught.
One spelling, matching the machine that runs it, turns an invisible
mismatch into a loud one.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
23 of 30 repos in the fleet had none. The symptom looks like neglect and
is not: aoz-housing had 100 commits in August, features landing daily, and
was still on Next 14 / React 18 / Tailwind 3 — because nothing ever OPENED
the upgrade PR. Version drift here is the absence of a mechanism.
npm directory: /. Minor and patch grouped so the sweep spends one
cycle on them; majors stay separate because they deserve reading.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
clientIp returned the FIRST x-forwarded-for hop, with a comment asserting that
was "what the proxy saw" and a test pinning it. Both were wrong in the same
direction.
A reverse proxy APPENDS to X-Forwarded-For. Caddy and nginx both do. So for a
request through one proxy the header reads `<whatever the client sent>, <what
the proxy actually saw>`, and the only entry a client cannot forge is the LAST.
The effect, in every adopter at once: send a random X-Forwarded-For with each
request and every request lands in a fresh bucket, so no bucket ever fills.
Not "weakened" — bypassed completely. A limiter that cannot be tripped is not a
limiter, and it is worse than none, because the route reads as protected.
Found in orangecat's payments audit (bitbaum/orangecat#563, finding 2), where
the same mistake is copied across three payment routes that each mint a real
Lightning invoice per request.
Now counts from the right. `trustedProxies` (default 1) says how many proxies
of your own sit in front; a CDN in front of Caddy is 2 and moves the answer one
further left. `trustedProxies: 0` means the server is exposed directly, so every
forwarded header is client-written and none is evidence — the result is
"unknown" rather than a number that looks like proof.
Verified against the fleet's actual topology rather than assumed: DNS resolves
straight to the box, no CDN, one Caddy 2.11.4 with no trusted_proxies
configured, so exactly one hop is appended.
BREAKING: the returned identity changes behind a proxy — which is the point.
v0.2.0. Adopters pinning #v0.1.0 keep the bypass until they move.
Claude-Session: https://claude.ai/code/session_018waGt1ieA9TjpscqrbrnGb
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The `uses:` line is already correct. What was stale is the prose next to
it, which told the reader the policy lives in bitbaum/dotfiles and to go
change it THERE. That file no longer exists in dotfiles — the sweep moved
to bitbaum/fleet on 2026-08-28, because a repo holding someone's .bashrc
is not where a fleet's deploy policy belongs.
A comment that misroutes a fix is worse than a missing one: it sends the
next person to edit a repo where the change would reach nobody, which is
the precise failure the shared sweep exists to prevent.
Files: .github/workflows/ci.yml
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Twelve near-identical rate limiters existed across nine repos of this fleet.
orangecat alone carried four, and its ADR-0002 to unify them sat "Proposed" for
seven months while the count doubled — the measured proof that writing a plan
down is not the same as extracting the code.
What actually varied between the twelve was ONE thing: where the counts live
(eleven in process memory, one in Upstash). Everything else — window
arithmetic, refusal shape, headers, client-IP extraction — was the same idea
written twelve slightly different ways, with independently re-invented bugs.
So the algorithm is fixed and the store is the seam:
slidingWindow / fixedWindow pure over store + clock. Both shapes shipped in
the fleet, and they refuse differently; the
choice is now named at the call site instead of
implied by whichever file got copied.
Store / MemoryStore two methods. The default is BOUNDED (LRU past
maxKeys): one replaced implementation kept a
bare Map keyed by stranger IPs with no eviction
— a slow memory leak fed by the public
internet, now impossible by construction.
toHeaders / clientIp the HTTP edges everyone also rewrote. Standard
X-RateLimit-* trio, Retry-After on refusals
only — exactly what orangecat's ADR specified.
Two decisions worth naming:
A REFUSAL COUNTS NOTHING. Several replaced implementations let refused
requests extend the window, so a scripted attacker hammering a key locked
the legitimate user behind the same NAT out indefinitely. Here a hammered
key recovers the moment the attacker stops; there is a test for exactly
this shape.
retryAfterSeconds IS DERIVED, never fabricated — computed from when the
oldest counted hit ages out. "Try again shortly" on a window that opens in
an hour is the same lie ai-ration's 429 classifier exists to prevent, one
layer down.
Deliberately not included, per SHARED.md's extraction rules: no HTTP client,
no middleware, no framework types, no distributed store (the seam is two
methods; your Redis is your ops posture), and NO LIMIT VALUES — how many
attempts a login route allows is app semantics, asserted locally.
Every function takes `now` as an argument, so all of it is testable without
sleeping — which is why this package has 14 tests and the twelve files it
replaces, collectively, had almost none. Tests import the package BY NAME, so
the exports map is exercised on every run, not at the first consumer's
install.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>