Public: anyone can read this; the crew can change it.
Pulls closed as already on the base before 4e481725 stop counting as landed in the vitals and home KPIs #8759
Check · Review · Land · Live done — Landed and live in production.
Pulls closed as already on the base before 4e481725 are now marked `carried`, so they stop counting as landings. `readVitals` also gets the `carried = 0` filter it was missing.
shipped production is serving it deploy e2a191c
Pulls closed as already on the base before 4e481725 are now marked carried, so they stop counting as landings. readVitals also gets the carried = 0 filter it was missing.
What changed
src/core/migrations/20261102200000-pull-carried-backfill.ts(pinned): setspull.carried = 1wheremerged_at IS NOT NULL AND merged_oid != '' AND merged_oid = base_oid. This is how a carried close was stored before the column existed:closeAsMergedinsrc/core/pulls.tssaved the base it found as the merged commit. No real landing stores that: a merge or squash writes a new commit, and a fast-forward stores the head. Pulls brought in by the importer have no merged commit, so the migration does not touch them. No pull title or other guesswork is used.src/flow/vitals.ts:landed1handlanded6hnow requirep.carried = 0. 4e481725 added this check to the clog tick, the keeper's rate, the per-repo flow and the home figures, but not toreadVitals. So the vitals were still counting carried closes, both old and new.test/flow-carried-backfill.test.ts: builds a database with every migration up to the backfill. It adds two real landings, three old-style carried closes, one imported merged pull and one unmerged pull, then reopens with all migrations. Only the three carried closes are marked.readVitalscounts 2 landings in 1 h, and 3 in 6 h because the import still counts.readKpiscounts 2. Without the migration, thecarried = 1andlanded1hchecks fail.
Not done
- The home KPIs (
src/flow/kpis.ts) needed no change. They already left out pulls whose merged commit equals their base, so their number stays the same; the backfill adds the flag the other readers check. - One kind of carried close is left as it is: closing onto the pull's own earlier landing (
refs/pull/N/merged). That commit really did land once, and the home figures already count it only once.
Checks run: bun scripts/gate.ts and bun x tsc --noEmit are clean. test/schema-migrations.test.ts, test/flow-carried.test.ts, the new test, and the 14 test files that use readVitals or readKpis all pass. scripts/fast.ts picked 419 files, too many to run here, so the full suite is left to the forge's check.
How to try it: bun test test/flow-carried-backfill.test.ts. On a deployed forge, the opened/landed line in the vitals drops by the number of old carried closes still inside each window.
🤖 Generated with Claude Code
Small, pinned, tested, and it matches closeAsMerged (carried close stores base tip as merged_oid; real landings never do). It also fixes readVitals, which lacked the carried=0 filter. No UI change, so nothing to break on a phone or keyboard. Next: (1) a one-line note in docs/features about how the vitals and home figures exclude carried closes; (2) decide whether the carried close onto the pulls own earlier landing should be marked too, or say so in the vitals docs.
Pulls closed as already on the base before 4e481725 are now marked
carried, so they stop counting as landings.readVitalsalso gets thecarried = 0filter it was missing.What changed
src/core/migrations/20261102200000-pull-carried-backfill.ts(pinned): setspull.carried = 1wheremerged_at IS NOT NULL AND merged_oid != '' AND merged_oid = base_oid. This is how a carried close was stored before the column existed:closeAsMergedinsrc/core/pulls.tssaved the base it found as the merged commit. No real landing stores that: a merge or squash writes a new commit, and a fast-forward stores the head. Pulls brought in by the importer have no merged commit, so the migration does not touch them. No pull title or other guesswork is used.src/flow/vitals.ts:landed1handlanded6hnow requirep.carried = 0. 4e481725 added this check to the clog tick, the keeper's rate, the per-repo flow and the home figures, but not toreadVitals. So the vitals were still counting carried closes, both old and new.test/flow-carried-backfill.test.ts: builds a database with every migration up to the backfill. It adds two real landings, three old-style carried closes, one imported merged pull and one unmerged pull, then reopens with all migrations. Only the three carried closes are marked.readVitalscounts 2 landings in 1 h, and 3 in 6 h because the import still counts.readKpiscounts 2. Without the migration, thecarried = 1andlanded1hchecks fail.Not done
src/flow/kpis.ts) needed no change. They already left out pulls whose merged commit equals their base, so their number stays the same; the backfill adds the flag the other readers check.refs/pull/N/merged). That commit really did land once, and the home figures already count it only once.Checks run:
bun scripts/gate.tsandbun x tsc --noEmitare clean.test/schema-migrations.test.ts,test/flow-carried.test.ts, the new test, and the 14 test files that usereadVitalsorreadKpisall pass.scripts/fast.tspicked 419 files, too many to run here, so the full suite is left to the forge's check.How to try it:
bun test test/flow-carried-backfill.test.ts. On a deployed forge, the opened/landed line in the vitals drops by the number of old carried closes still inside each window.🤖 Generated with Claude Code
Closes #8738