Commit Graph
4 Commits
Author SHA1 Message Date
CatoandClaude Opus 5 28fc7de4ae fix(deploy-freshness): cross-check a stale verdict here too, from one definition (#95)
I put the commit-index cross-check in the reconciler only, reasoning that a
wrong STALE there costs a real deploy while this gate merely reports. That was
the wrong call, and it took about an hour to prove: the first audit run after
the aoz rename went RED on evig, whose tip had a successful deploy-selfhost.yml
run sitting in `actions/runs?head_sha=...` the entire time.

A gate that cries wolf gets muted, and this one guards the single mechanism
between "merged" and "live". "It only reports" is not a reason to tolerate a
false positive in it — reporting is the whole job.

So `deployedByShaIndex` and `runsForSha` move OUT of the reconciler and into
this module, and the reconciler imports them. One definition, not two: the
thing that reports a stall and the thing that repairs one already share
deployFreshness, and splitting the confirmation across both files is exactly
the drift those imports exist to prevent. Their eight assertions move with them.

The audit now asks the commit index before calling anything stale, and says
which index answered when they disagree.

Live run after the change: 21 repos, all deployed, exit 0 — evig included.
Worth being precise: evig resolved through the NORMAL path this time, because
the flake is intermittent, so this run did not exercise the new branch. What
covers it is the moved unit tests and the reconciler's own evig incident.

33 + 25 assertions, none lost in the move (was 24 + 34).


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 06:46:45 -07:00
CatoandClaude Opus 5 c241537655 fix(deploy-freshness): the audit reported a clean fleet it had not fully seen (#87)
Caught by checking the gate's own output against a local run: CI surveyed 20
repos and printed "✓ every deploying repo has its main tip live", while the same
command locally surveyed 21. The missing one is `annushka`, which is PRIVATE.
CI's token could not enumerate it, and a repo a token cannot see is absent from
`gh repo list` in exactly the same way as a repo that does not exist.

So the audit built to catch "something I could not see, reported as something
that was not there" committed that exact error about itself, and the symptom was
a green tick.

Two fixes, and the second is the one that matters.

The token now prefers FLEET_PAT, which can read the private repos.

But a token fix only repairs today's instance: any future scope lapse, any new
private repo, silently shrinks the sweep again and still prints a green tick.
A count with nothing to compare against is not coverage. So the deploying repos
are pinned in a committed baseline and coverage becomes a RATCHET, the same
shape as the duplication ratchet in SHARED.md: it may RISE — a repo that starts
deploying is surfaced as an addition, and the baseline is updated — but a
silent FALL is a finding, and --check exits 1 on it, naming the repos rather
than only counting them. A genuinely retired repo leaves the baseline in the
same PR that retires it, where a human sees the decision instead of the gate
quietly getting smaller.

The coverage check runs BEFORE the verdicts are printed, because the point is
that those rows do not describe the whole fleet.

24 assertions (17 → 24), 5 mutants killed: a ratchet that never reports anything
missing, an unreadable baseline, unstripped comments, a baseline missing the
private repo, and coverage that can never legitimately rise.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 04:50:59 -07:00
CatoandClaude Opus 5 9c34c592b8 fix(deploy-freshness): three ways this audit reported a blind spot as a verdict (#83)
Merged an hour ago and already wrong in three places, each the same shape:
something it could not SEE, reported as something that was not THERE. A gate
that cries wolf gets muted, and this one guards the single mechanism standing
between "merged" and "live" for most commits here.

1. A WINDOW is not an absence. It read `actions/runs?per_page=40` and filtered
   by name; on a busy repo that window is all CI and auto-merge, so a healthy
   Deploy from two days ago falls off the end. aoz-housing was flagged with its
   newest Deploy green. Now each deploy workflow is asked for its OWN runs.

2. `main` is not every repo's default branch. aoz-housing and sbb-fundbuero are
   on `master`, so it asked for runs on a branch that does not exist there, got
   none, and called both never-deployed. Branch now comes from the repo.

3. An ERROR is not an empty list. A single `unexpected EOF` was swallowed into
   zero runs, which reads as "no successful Deploy run on record". `gh` now
   retries transport failures only — a 404 is an answer — and a repo that truly
   could not be read says COULD NOT READ (not a verdict), never a clean row.

And the deployer predicate, which I got wrong twice in OPPOSITE directions:
matching the filename alone caught this audit's own deploy-freshness.yml, so
fleet — which deploys nothing — was a deploying repo with no deploy; requiring
the body to name selfhost-deploy.yml or deploy.sh then excluded loki, whose
deploy.yml ships inline, dropping the control plane out of its own audit while
it held seven successful deploys. A false negative is the worse direction, so
the rule is now include-by-name, exclude-only-what-is-proven-not-to-deploy, and
it lives in a pure exported `isDeployerSource` with both directions pinned by
the real files that fooled each version. Three mutants killed.

Fleet-wide result: 21 repos judged, zero unknown, and one true finding it would
otherwise have missed — loki's tip 56m undeployed, every chained Deploy skipped
because both of its CI runs were cancelled by concurrency.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 04:12:48 -07:00
CatoandClaude Opus 5 d849b430d2 feat(fleet): ask whether what is on main is actually live (#80)
Nothing was asking. uptime-sweep.sh probes /api/health and treats 5xx as DOWN —
that proves a process is UP, not that it is running the code we merged.
CLAUDE.md already says a health check is not a feature check; this is the
missing half.

WHY IT MATTERS HERE SPECIFICALLY

A push made with GITHUB_TOKEN triggers no workflows, so an auto-merged PR fires
no Deploy. Measured on bitbaum/loki: SIX of the last fifteen commits on main had
no Deploy run of their own. They shipped anyway, because the auto-merge sweep
reconciles every ten minutes.

So that reconciler is the single thing standing between "merged" and "live" for
most commits in this fleet — and it had no alarm on it. If it stops, CI stays
green, PRs keep merging, /api/health keeps answering 200, and the box quietly
serves last week's code.

WHAT IT FOUND ON ITS FIRST RUN

  ✗ reparaturbonus-zh — main tip is 212m old and no deploy has run since it

A client site, merged and not live for three and a half hours. Its Deploy at
d1431ca is completed/FAILURE, six Auto-merge sweeps have run since without
recovering it, and the commit carries TWO CI runs — one success, one cancelled
— which is the documented shape where the shared Deploy reads the cancelled
duplicate as a failed gate.

Two more repos report UNKNOWN rather than clean: aoz-housing and sbb-fundbuero
have a deploy.yml but no successful Deploy run on record.

WHAT IT ASKS

Per repo with a deploy workflow: is main's tip covered by a successful Deploy?
A run for that exact SHA counts, and so does any successful run that STARTED
after the tip was committed — because most commits here ride a later
reconciler dispatch rather than firing their own. Requiring an exact-SHA run
would have reported nearly the whole fleet stale while everything was live,
which is how a check earns being muted.

Anything uncovered is only a finding once it is older than the reconciler's
window (45m: the sweep's 10 minutes plus room for a build). Inside that it is
PENDING, not a problem.

WHAT IT DELIBERATELY DOES NOT DO

It does not judge whether the deployed code works. And it does not read the
app's own /api/health `commit` field: exactly one of thirteen live apps
publishes one, so a check built on that would cover a single app while looking
fleet-wide.

12 self-test assertions, no network — including both grace boundaries, the
vacuous-pass guard, and that a failed, cancelled or still-running deploy never
counts as shipped.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 02:35:10 -07:00