Public: anyone can read this; the crew can change it.
Vitals raises one need per domain whose last drill is red or eight days old, and nothing else changes #2055
Vitals now raises one domain-drill: need for each drillable domain whose newest drill is red or more than eight days old. A later green drill clears it, because it becomes the newest. The change is in src/kernel/domaindrill.ts and src/kernel/vitals.ts, and I added no terminal palette row, page or route.
stopped closed without shipping deploy 7abc182
7 earlier comments · 1 event
Vitals now raises a domain-drill need only for a red drill, or a green drill more than 8 days old. Never-drilled domains share one card, and each card's text carries the command to run. The type check and vitals, domain-drill-needs and check-list tests pass locally. I did not run the whole suite; the forge's check will on this push.
- Calm: domains with no drill ever recorded now raise one need,
domain-drill:never. It appears only once the forge has been up 8 days, and it names every undrilled domain. Keeping a drill for a domain takes that domain off the list. Red and stale drills still raise one need per domain,domain-drill:<domain>. - A door: each card's sentence now says to run
POST /api/v1/drillswith{"domain":"<key>"}. Thehrefstill points at/settings/backups, because no page explains drills yet. I chose to put the command in the sentence rather than build a page. - README: the "Kept drills cannot be read back" line is replaced. It now says that Vitals reads each domain's newest drill, what raises a need and what clears it, and how the never-drilled card behaves. Drills still cannot be listed through the API.
- Tests:
test/vitals.test.tsuses dates relative to now instead of the hard-coded 2026-10-01.test/domain-drill-needs.test.tsuses the realcomputedomain instead of the overriddenstate.- I added tests for the never-drilled collapse and for the command appearing in the sentence.
The Vitals logic is sound, tested, and the never-drilled collapse keeps it calm. But the card sends a person to a door that does not exist for them. Fix first: make the card actionable by a person. Today each card says to run a raw POST /api/v1/drills, and its href is /settings/backups, a page that says nothing about drills. The owner cannot do this on the page or in src/tty.ts (both doors), and the request as written is not valid: the body also needs seen.health, seen.board and backSeconds, so following the sentence gets a 422. Either give the card a real place to run or read the drill (page and tty), or at least word the sentence in plain language and give the full body. Smaller: the test file runs a top-level expect outside any test; the vitals test inserts a green drill timestamped in the future to win the ordering, which hides a same-instant tie; newestDrills runs a correlated subquery over the whole domain_drill table on every vitals call, so check there is an index on (domain, at). The vitals stale case (8 days) has no vitals-level test.
Handed to a person by the crew: the reviewer asked for changes three times with no approval between, so no more feedback runs start here until you say what to try.
- juniper: The logic is sound and well tested: one need per drillable domain, red clears on a newer green, 8-day staleness from the last drill or first
- juniper: The logic is sound and tested (red raises, a newer green clears, the 8-day edge, the query count bump to 7). Two things stop it from landing
- juniper: The Vitals logic is sound, tested, and the never-drilled collapse keeps it calm. But the card sends a person to a door that does not exist f
I merged main into the branch, resolved the two conflicts, and pushed. The type check is clean. I ran only the 11 drill, resilience and vitals test files (79 tests, all passing) and did not run the whole suite, so the forge's check covers the rest.
src/core/domain_drills.ts: I kept both functions.newestDrillsis the one-query read Vitals uses for the needs.lastDrillis what the Failure domains page uses to show a domain's newest drill. Both sides had a type calledLastDrill, so I renamedmain's toKeptDrilland updated its one import insrc/actions/resilience.ts. The kernel'sLastDrillis unchanged.README.md: I kept this pull's paragraph about thedomain-drill:<domain>anddomain-drill:neverneeds. I replaced its "Kept drills cannot be listed yet" line with a pointer to Settings → Failure domains, whichmainnow has.
One more round, one change: the need must not link to /settings/backups, which has no domain drills. Its sentence should give the exact command, bun scripts/drills/run.ts <domain-key> --forge <forge URL>, with the real key and URL filled in and escaped. Add a test asserting that text. Drop the placeholder {"domain": "<one of those>"}. The description should say 'Closes #2175', which replaces #2019 and waits on the script in #2174 / pull #1974.
I merged main into the branch and pushed it. The only conflict was in README.md, in the "Keeping a domain drill" paragraph.
I kept both sides. The paragraph still has this branch's Vitals behaviour: a red drill, or a green one over 8 days old, raises a domain-drill:<domain> need, and domain-drill:never covers domains with no drill kept. It now also has main's sentence on running a drill by hand with scripts/drills/run.ts.
The type check is clean. I ran only the vitals and drill test files (52 tests, all passing), not the whole suite. The forge's check will run the full set on this push.
🤖 Generated with Claude Code
Closing as superseded by #2175. The last review asked for a card a person can act on. #2175 says what done looks like: the card names the exact command, and scripts/drills/run.ts is now on main (c94ce743). A builder on #2175 can reuse this pull's newestDrills logic and tests.
Correction: the planner's token cannot close pulls. This pull stays open until a person closes it for the reason above. Nothing more is asked of the crew here.
Closed by the crew: superseded, its change is already on main in a635a9b5.
Vitals now raises one
domain-drill:<key>need for each drillable domain whose newest drill is red or more than eight days old. A later green drill clears it, because it becomes the newest. The change is insrc/kernel/domain_drill.tsandsrc/kernel/vitals.ts, and I added no terminal palette row, page or route./settings/backups.src/core/domain_drills.tsgetsnewestDrills(db), which reads each domain's newest drill in one query.test/domain-drill-needs.test.tsand a case intest/vitals.test.ts, with a fixed clock, cover red raising the need and naming the phrase, green clearing it, eight days with no drill raising it, and no drillable domain or no first-seen file raising nothing. I also addeddomain-drill-needs.test.tstoscripts/gate.ts.test/asks.test.ts(including "All fine"),test/vitals.test.ts,test/domain-drill.test.ts,test/tui-tell.test.tsandbun x tsc --noEmit. I made no code change for it, and this push is main merged into the branch. I merged because force pushes are refused, so I couldn't rebase onto the moved main. If the strip test fails again, its log should say why.bun testhere. It exceeded the 10-minute limit, so the forge's check is its first full run.To try it, run
bun test test/domain-drill-needs.test.ts test/vitals.test.ts.Closes #2019