Staff is the is_staff column, and production is one app on Hetzner. The agent brief, the auth doc, and the generated API page still said otherwise, so the next session kept reopening closed work. lint:claims fails the build if those sentences come back.
evig-cron@timecard-reminders.service went red on 2026-09-10 and stayed red.
Nothing was broken.
The box booted at 08:01:48 UTC. `Persistent=true` makes systemd fire every
schedule missed while the box was off the moment it comes back, so the 08:00
run caught up at 08:01:58 — the same second evig-app.service started. Next
bound :4004 at 08:02:00. curl got connection-refused in between, `set -e`
turned curl's exit 7 into run-cron.sh's exit status, and because this is a
*daily* timer the unit then sat `failed` until the next morning: an incident
page for a two-second race, and one day of reminders silently skipped.
`After=evig-app.service` cannot fix this — it orders the timer after the app
unit's *start*, never its readiness. So run-cron.sh now waits for the app it is
supposed to call: retry ONLY curl's exit 7 (10 attempts, 6s apart, bounded well
inside TimeoutStartSec=180), and log each wait so it is not a silent hang. A
real HTTP status still fails on the first response — a broken endpoint stays
exactly as loud as it was.
Two smaller things in the same file: `set -e` would have killed the run before
curl if CRON_SECRET were ever unset (the `[ -n ... ] && hdr=(...)` one-liner is
the script's exit status when the test is false), and a connection failure used
to produce no journal line at all.
The Never-Twice half: scripts/ci/test-run-cron.sh drives the script against a
fake app that binds late, one that answers 500, and one that never comes up,
and asserts the retry is spent on exactly one of them. Wired into `verify` as
`test:ops`, so CI runs it. Verified it fails against the pre-fix script.
Editing this file changes nothing on the box — the deploy only rsyncs the
standalone build — so the README's install block is now flagged as the only
channel that ships it, and it must be re-run.
Claude-Session: https://claude.ai/code/session_014FMEgKPDG3iMFExEvdJzWy
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore: pnpm — the fleet has one package manager
- packageManager pnpm@11.25.0; lockfile via pnpm import, package-lock.json gone
- npm overrides moved to pnpm-workspace.yaml overrides (pnpm ignores
package.json overrides); allowBuilds for @parcel/watcher, @sentry/cli,
@swc/core, esbuild, puppeteer, unrs-resolver, and the ai-forms git dep
(pnpm requires the exact resolved URL for git-dep prepare builds)
- @tiptap/core added as a direct dependency: RichTextEditor.tsx augments
'module @tiptap/core' and tiptap-markdown's Storage augmentation rides on
it — a phantom dependency npm's hoisting hid and pnpm's isolation exposed
- all workflows: pnpm/action-setup@v6 before setup-node, cache: pnpm,
store-dir pinned, pnpm install --frozen-lockfile; Next cache key now
hashes pnpm-lock.yaml
- scripts/ci/dependency-audit.sh: pnpm audit --prod (parses both npm-v2
'vulnerabilities' and pnpm's v1 'advisories' shapes)
- selfhost-deploy-evig.sh, ship.sh, start-all.sh, e2e-inventory-prod.sh,
husky pre-commit, Dockerfile.prod (node 24 + corepack) converted
- engines: node >=22.13
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
* fix(deps): declare espree — eslint.config.mjs imports it directly
npm's hoisting provided it as a phantom; pnpm's isolated node_modules
exposed ERR_MODULE_NOT_FOUND in CI. Verified in a true clean room
(parent node_modules masked): full verify green, 7783 tests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
* fix(deps): declare tsx — npx fetched it on demand, pnpm exec does not
e2e:seed (and the hirn:*/setup-admins scripts) ran 'npx tsx', which
silently downloaded tsx because it was never in devDependencies. pnpm
exec only resolves installed bins, so CI's Seed E2E step died with
'Command tsx not found'. Declare it.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
* fix(ci): drop '--' separators — pnpm run forwards them verbatim
npm strips the first '--' before handing args to the script; pnpm 11
passes it through, so 'pnpm run start -- -p 3001' executed
'next start -- -p 3001' and next read '-p' as a project directory.
pnpm forwards everything after the script name anyway, so the
separator is dead weight: remove it in ci.yml (start, e2e journeys,
e2e guards) and ship.sh.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
`revampit-cron@timecard-reminders.service` failed at 08:01 UTC today with
status=203/EXEC: "Unable to locate executable /opt/revampit/ops/run-cron.sh".
#430 renamed the box directory /opt/revampit -> /opt/evig at 07:44 UTC and
deliberately left the revampit-cron@* and revampit-backup units for a separate
pass. But those units name their program as a literal path — systemd cannot
interpolate a variable into ExecStart — so from 07:44 they all pointed at a
directory that no longer exists. timecard-reminders was simply the first timer
to fire afterwards; wake-recurring-tasks had run at 07:01, before the rename,
which is why only one unit looks broken.
It is not one job:
- all five revampit-cron@* timers are dead from their next fire onward
- revampit-backup.service — the ONLY off-box copy of prod Postgres — dies at
03:32 UTC, and a 203/EXEC failure leaves no dump behind to notice
- revampit-transcription.service still has WorkingDirectory=/opt/revampit and
survives only because it has not been restarted since
and fixing the units alone would not have been enough: run-cron.sh itself
defaults APP_ENV to /opt/revampit/app/.env, so it would have read no
CRON_SECRET and every call would have come back 401.
Repoints every /opt path under scripts/ops/ at /opt/evig. Unit *names* stay
revampit-* — renaming a live schedule is still the separate, deliberate step
#430 called it.
Also here, because the same drift hid them:
- revampit-cron@timecard-reminders.timer existed on the box but not in this
repo, which claims to be the source of truth for scripts/ops/. Added,
byte-identical to the installed copy.
- release-escrow is the reverse: in this repo, never enabled on the box, so
/api/cron/release-escrow has never once run on a schedule. Documented as a
money-side go/no-go rather than switched on by an install loop.
The automation that ends the class: scripts/ci/ops-box-paths.sh compares every
/opt/<name> literal under scripts/ops/ against NAME= in the deploy script — the
one place that decides where the app lives — and fails when they disagree. Wired
into verify as `lint:ops`. Verified it fails on the pre-fix tree. The next box
rename now breaks CI instead of breaking the backups at 03:32 UTC.
.prettierignore gains .venv: a local python virtualenv (services/transcription)
made `npm run verify` fail locally on vendored site-packages while CI, which
never has one, stayed green — the precise local/CI split verify exists to
prevent.
Claude-Session: https://claude.ai/code/session_01LmyE2aLaXKB2V7WA3XQprm
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
CLAUDE.md carried a full 'Layer 2 — tailwind.config.ts' section for a file
Tailwind v4 removed, plus a token table naming --color-bg / --color-surface
/ --color-border (zero occurrences in globals.css; the real names are
--surface-base, --text-primary, --border-default), a dark-mode mechanism
that does not exist (it claimed @layer utilities auto-remaps bg-white —
globals.css contains no 'bg-white'), and a green #f0fdf4..#14532d palette
for a brand that is Ion Lime. Five false claims in sixty lines, in the
file every agent session reads first.
Also corrected: Tailwind 3.4 -> 4 and React 18 -> 19 in the stack tables;
the .claude/CLAUDE.md ADMIN_SECTIONS table (10 rows, wrong paths, ids that
no longer exist — 'products' and 'finances' are gone, and granting
'workshops' grants nothing because the admin section is 'workshops-admin')
replaced by a pointer to sections.ts and the two rules that do not change;
the dev-DB row that said Neon while CLAUDE.md said Docker:5433;
002-simplified-auth.sql -> 002b-; repairer_profiles -> technician_profiles
(renamed by migration 105); and a Revamp-IT street address in
SHARED_CONTEXT that org.ts explicitly forbids publishing.
scripts/ci/docs-paths-exist.sh closes the class: every backticked repo path
in the docs must exist. CLAUDE.md, .claude/CLAUDE.md and README.md are held
at ZERO; the 68 stale references in older reference docs are ratcheted so
they can fall but never rise. Historical plans and audits are excluded —
a June plan naming files that later moved is history, not a defect.
Proven by mutation: a planted bad path in CLAUDE.md exits 1.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Every static-div shell becomes <Card>; non-div elements (Link, li, ul,
form, details, section) and dynamic classNames take the card-shell
class. The two remaining sites are deliberate: HelpRequestCard's
urgency-conditional border and AlternativeCard's border-2 hover shell.
Baseline lowered 99 -> 3 in the same change.
Verified: typecheck, lint (0 errors), 7798 tests, production build,
and before/after headless screenshots (1440px + 390px) of 11 affected
admin/dashboard pages on a locally seeded instance — layouts identical,
corners/borders normalized to the canonical shell.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Every converted site was pixel-identical to card-shell already (bg-surface-base
+ rounded-xl + default 1px border — the v4 shim maps bare `border` to
var(--border-default)), so this is pure dedup: divs become <Card>, Link
elements take the card-shell utility directly. Sites with border-subtle/
strong/border-2 or rounded-lg are visually different and deliberately left
for a later, looked-at pass.
Baseline lowered 120 -> 99 in the same PR, per the ratchet's own rule.
Gate: lint 0 errors, umlauts clean, ratchet 99/99, tsc clean, 7797 tests,
build green.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* ci: call the central auto-merge sweep instead of carrying a copy
auto-merge-sweep.sh was copied into 22 repos and drifted into EIGHT distinct
versions, 245 to 404 lines. Three of them independently grew different fixes for
real outages, and each fix reached only the repo that wrote it:
evig, revampit infra-failure detection + re-run. An Actions incident left
main "failure" with no failed job at all; 11 PRs stranded
for roughly 14 hours.
fleetcrown DEADLOCK naming — a red base with the repairing PR sitting in
the queue was indistinguishable from "nothing to merge".
the other 19 neither.
Nothing could carry a fix across, so every repo waited to hit each outage
itself. This repo now calls the canonical sweep in maonakamoto/dotfiles, and the
local copy is deleted.
The canonical is the union of the three, built on the variant ten repos were
already running rather than on the longest one — the 404-line variant is missing
the step-summary reporting the 296-line one has, so "take the biggest file"
would have silently deleted working behaviour. The merge was 106 insertions and
zero deletions: nothing can be lost by adopting it.
The triggers stay in this file because they genuinely are per-repo: workflow_run
must name the CI workflow exactly, and that name differs across the fleet.
Two details that are silent when wrong, both found by piloting rather than
reasoning:
rearm_workflows is SPACE-separated. The sweep word-splits it; a comma makes
one bogus token, every dispatch fails, and the only symptom is that nothing
deploys — while the sweep still exits 0 and reports a successful merge.
permissions are declared on the CALLER as well. A called workflow's token is
capped by what the caller grants, so relying on the callee's block alone can
hand it a read-only token; the sweep would then merge nothing while exiting 0,
which is indistinguishable from having nothing to merge.
Verified before this rollout: the canonical ran end to end in dotfiles' own CI,
and the reusable-workflow path ran end to end in the pilot repo (s-ink).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* test(ci): the sweep tests moved to dotfiles with the script they test
These two suites drove scripts/ci/auto-merge-sweep.sh directly, so deleting the
local copy of that script left them pointing at nothing — CI failed with
"Test Suites: 1 failed, 533 passed".
They were not dropped. This repo was the ONLY one in the fleet with tests for
the sweep, and centralising the code while discarding the only evidence it
behaves would have been the worst possible trade. They are ported to bash and
now run in maonakamoto/dotfiles CI against the canonical script
(scripts/ci/test-auto-merge-sweep.sh), where they cover every repo that calls
it rather than just this one.
Same six cases, same reasoning: re-run a cancelled or infra-failed base run,
never re-run a genuine failure, stop at the attempt cap, still reach the PR loop
when the base is green. They were also mutation-tested there — disabling the
re-run turns the two dependent cases red — because a suite that has only ever
passed is indistinguishable from one that asserts nothing.
Net effect: the coverage this repo wrote now defends twenty-two repos instead of
one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Three CRITICAL auth advisories sat open against the live site today and
nothing in CI was red. They surfaced only because `git push` happened to
print GitHub's "found 10 vulnerabilities" banner, which is not monitoring.
Cleared the two remaining runtime highs first, both instances of the same
trap that hid the auth critical — a patched copy hoisted while a vulnerable
one survives underneath:
- postcss was declared ^8.5.10 in devDependencies AND in overrides, so it
resolved to 8.5.15, below the 8.5.23 that patches the source-map path
traversal. Raised both to ^8.5.26.
- sharp: the root had a patched ^0.35.3, but next pinned ^0.34.5 and got its
own nested vulnerable copy (libvips CVE-2026-33327 et al). Added the
`"sharp": "$sharp"` override so the nested copy resolves to the root's.
This removes 26 duplicate platform binaries from the lockfile.
npm audit is now clean at every severity, dev included.
The check itself, in scripts/ci/dependency-audit.sh, has two callers:
- ci.yml `security` job — blocks a PR that INTRODUCES a critical.
- security-audit.yml — scheduled daily, files/closes one issue for high+.
The scheduled half is the one that matters: advisories appear with NO code
change, so no push-triggered check has any reason to run. That is exactly
how today's criticals stayed invisible.
Critical blocks, high only reports. Auto-merge refuses a red base, so
failing CI on every new advisory would hand a third party the power to jam
the entire merge train on their release schedule.
Verified: script unit-tested against stubbed audit output across critical /
high-only / clean / malformed-JSON / empty-output / bad-threshold cases —
including that malformed and empty output FAIL rather than read as a pass.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diagnosis, now with the number that was missing before: the sweep logs its own
view at the merge site, and it reads
#278 direct merge refused (MERGEABLE/BLOCKED)
#282 direct merge refused (MERGEABLE/BLOCKED)
while a PAT reads MERGEABLE/CLEAN for the same two PRs at the same moment.
mergeStateStatus is computed per viewer, and `gh pr merge` refuses client-side
on BLOCKED. `--auto` goes through the identical precheck, so it was refused
too — that fallback never fired.
main has branch protection with every option disabled, no rulesets, no
CODEOWNERS, no required checks and no required reviews, so there is no rule
being enforced here. Meanwhile #224, #225 and #226 — all of which modify
.github/workflows/ — merged normally, so this is not the workflows scope.
The REST merge endpoint skips the precheck and enforces the branch's actual
protection instead. If GitHub does refuse, it returns non-2xx and the PR is
left for the next sweep exactly as before; nothing is forced past a real rule.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Three consecutive sweeps read #278 and #282 as MERGEABLE/CLEAN, announced the
merge, and were refused:
X Pull request maonakamoto/evig#278 is not mergeable:
the base branch policy prohibits the merge.
There is no such policy. main has branch protection with every option
disabled, no rulesets, no CODEOWNERS, no required checks and no required
reviews. Throughout the same window the bot merged #225, #226, #279 and #280
without trouble — including #225/#226, which modify .github/workflows/, so
this is not the token's workflows scope either.
The refusal is gh's client-side precheck reading the mergeStateStatus that
GITHUB_TOKEN sees, which is not the one a PAT sees — nothing this script can
inspect its way around. So log both what we saw and delegate: native
auto-merge is GitHub performing the merge itself, and does not go through that
precheck. It is the escape hatch gh names in its own error message.
Still one car per sweep — the fallback is followed by the same `break`, so at
most one PR per sweep is handed over, and the green-base guard is unchanged.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(ci): retry runs that failed before executing any of our code
The sweep retries CANCELLED checks but deliberately leaves genuine failures
alone. A GitHub Actions incident lands in the gap between those two: the run
fails with conclusion=failure, so it is treated as a real verdict — but it
never executed a line of this repo's code.
Consequence: during an incident EVERY open PR is stranded permanently, and
nobody is in the merge loop to notice. Today (2026-08-06, Actions major
outage, webhooks throttled to ~15%) three jobs on PR #278 died with "Failed
to resolve action download info. Error: Service Unavailable" and that PR
cannot become green again without a human running `gh run rerun --failed`.
The discriminator is precise: a job whose ONLY failed step is "Set up job"
never got as far as running our code, so it produced no verdict about it.
A real failure names a real step.
Verified against live runs:
PR #278 outage run -> [Set up job] -> infra
PR #228 (TS 7) -> [Verify (lint + umlauts + typecheck + build)] -> real
PR #265 (ESLint 10) -> [Verify (lint + umlauts + typecheck + build)] -> real
nonexistent run -> no data -> refuses to guess
Conservative by construction: retries only when EVERY failed job in the run
failed at set-up. One real step failure anywhere and the PR is left alone.
Capped at MAX_RUN_ATTEMPTS (default 3) — an incident can last hours, and an
uncapped retry would re-run the same doomed run every sweep forever.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(ci): self-heal a base branch whose CI ended without a verdict
The sweep already knew that a cancelled/infra-failed run is noise rather than
a judgement — but only for PR checks. The base branch kept the original
"refuse and exit" behaviour, which deadlocks: the only thing that produces a
new CI run on main is a merge, and merges are exactly what the guard blocks.
Observed here on 2026-08-07. An Actions incident left main's run `failure`
with no failed job at all (Migration Drift cancelled, everything else green).
Eleven PRs sat for ~14h while every sweep exited 0 and looked healthy.
So: extract the "is this a verdict about the code?" test and apply it to the
base run too. A genuine failure still blocks — that IS a verdict. Retries are
capped by the run's own attempt counter, which is why this re-runs rather than
dispatching fresh (a new dispatch resets to attempt 1 and could churn forever).
Also drops `--failed` from the PR-side retry. A partial re-run flips SKIPPED
jobs to CANCELLED, so the PR ends up non-green for a brand new reason and needs
yet another retry — seen on #278 today.
Tested by running the real script against a fake `gh` on PATH, so this covers
shipped control flow rather than a re-description of it. Mutation-checked:
disabling the self-heal turns 3 of the 6 tests red.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
`gh pr list` returns newest-first, and the sweep merges the first eligible PR
then stops. So the newest green PR wins every sweep, and an older one can wait
indefinitely.
Observed in maonakamoto/fleetcrown on 2026-08-06: two consecutive sweeps merged
the two newest PRs while three older green ones sat untouched and were never
even evaluated. With several agent sessions opening PRs continuously that is
starvation — and it starves the worst candidate, since the longest-waiting PR
is the one whose checks were proven against the most now-stale base.
PR numbers increase monotonically with creation, so sorting ascending is FIFO.
The ordering was never a decision, just whatever gh happened to return.
Fixed upstream first (fleetcrown #182) and verified in production there: the
sweep immediately after it landed correctly took the oldest open PR rather than
the newest. This is that one-line change, applied to the fleet.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
#272 added the alarm on `workflow_run`. That covers pushes to main — but
every merge in this repo is an auto-merge made with GITHUB_TOKEN, which
fires no push event. The sweep therefore re-arms ci.yml by dispatch, and
GitHub emits no `workflow_run` for a dispatched run. The alarm was blind on
the path producing almost every main CI run.
Proven within the hour: main went red on 0c14621d (a transient puppeteer
403 fetching chrome-headless-shell), the sweep started refusing merges
again, and no issue was filed.
Now dual-path, one policy:
- scripts/ci/main-red-alert.sh holds the verdict logic, so the two callers
cannot drift.
- main-red-alert.yml keeps the push path and calls the script.
- ci.yml gains a post-main job, gated to dispatched runs on main, which
resolves its own verdict from the job results and calls the same script.
`skipped` counts as success (jobs here are conditional on event type);
failure outranks cancelled.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* ci: add the auto-merge sweep policy
* ci: green PRs merge and deploy themselves
* ci: allow CI to be dispatched so auto-merge can re-arm it
* ci: allow deploy to be dispatched so an automated merge still ships