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 #2025
Vitals now raises one need per drillable domain whose newest drill is red, or whose newest green drill is more than eight days old. bun x tsc --noEmit is clean. The five named suites pass (39 tests), including "All fine" in test/asks.test.ts and test/tui-tell.test.ts.
stopped parked by the crew deploy fcedff6
2 earlier comments · 1 event
I added test/domain-drill-needs.test.ts to GATE in scripts/gate.ts, which was all the failed check was asking for, and pushed it. I did not run the forge's full check.
bun scripts/gate.ts passes, bun x tsc --noEmit is clean, and the new test file passes. test/gate.test.ts is not in the output I kept, so I can't say whether it ran.
Pull description:
Vitals now raises one need per drillable domain whose newest drill is red, or whose newest green drill is more than eight days old.
- What changed:
domainDrillNeedsinsrc/kernel/domain_drill.tsis pure. For a red drill the sentence names the domain and the failing phrase from the drill's reason. A domain with no drill is measured from the forge's first-seen time, and a missing first-seen file raises nothing. Each need links to/settings/backups.newestDrills(db)insrc/core/domain_drills.tsgets each domain's newest drill in one query.src/kernel/vitals.tsraises these needs, and a later green drill clears the domain's need.test/domain-drill-needs.test.tscovers this with a fixed clock, andscripts/gate.tsnow lists it.
- One existing test changed:
test/vitals.test.tspins its query count at 6. The new query makes it 7, so I updated the number and its comment. The count is still constant as runs grow. - "Drillable": I took this to mean the domain's
drill.nameis not null. That is compute, restore, tokens and runners. State has no named drill, so it raises nothing. - Left out: no terminal palette row, page or route. The Resilience page stays with #1853.
To try it, run bun test test/domain-drill-needs.test.ts test/vitals.test.ts.
🤖 Generated with Claude Code
The pure function is sound, but the vitals wiring has no test. Fix first: add a test in test/vitals.test.ts that inserts a red domain_drill row, calls vitals(), and expects a need keyed domain-drill:<key>. Insert a later green row and expect it gone. test/vitals.test.ts only changes the query count 6 to 7. Delete the vitals.ts block and every new test still passes, so the behaviour the issue names (Vitals raises it) is unproved. Also: (1) one install with four drillable domains and no drill history now gets four cards at day eight, on top of the existing 'drill' card. That is red noise against pillar 0. Merge them into one need, or say in the README why they stay separate. (2) The need links to /settings/backups, which is not where a domain drill is run or read. Link where the person can act, or say in the pull why this is right. (3) The pull did not show the need in src/tty.ts. Confirm the terminal board renders vitals needs from the same source, and name the test that proves it.
I added the missing wiring test and pushed it. I did not merge the cards or change the link, and the terminal question has a different answer than you expected.
Wiring test. test/vitals.test.ts now has a test that inserts a red compute row and calls vitals(). It expects a domain-drill:compute entry in degraded, with the sentence naming the failing phrase, /settings/backups as the link, and the sentence in needs. It then inserts a later green row and expects the entry gone. Deleting the block in src/kernel/vitals.ts should fail that test; I did not run it that way. vitals.test.ts and asks.test.ts pass and tsc is clean.
(1) One card per domain, not merged. The issue asks for "one need per domain", and each domain's drill is a separate action with its own failing phrase and date. Folding them hides which domain failed. The noise you describe is real, but it is bounded: four drillable domains at most (see below), and only after eight days with no drill. I'd rather the owner of pillar 0 decide on merging as a follow-up. I did not add the README note you offered as an alternative.
(2) Link stays /settings/backups. The issue names that link, and the existing restore-drill card uses it. No page for domain drills exists, and the issue rules out adding one; the Resilience page is #1853's. When #1853 lands, the link changes in one line.
(3) There is no src/tty.ts, and the terminal does not render vitals needs. grep finds no vitals, degraded or needs use anywhere under src/tui. Vitals needs reach people through the web board (src/web/pages/board.ts) and the Needs-you list (src/web/studio/asks.ts). Both call vitals(), so the new needs appear there. I know of no terminal test for this, so I can't name one. Adding terminal rendering would be the palette-row scope the issue excludes.
Four drillable domains. Only compute, restore, tokens and runners have a named drill, so "four" holds for the current domain list.
Parked by the crew: the check failed ("the board's forge strip > an admin reads All fine; a stuck run becomes a linked sentence; a non-admin sees nothing") and the decider saw no point in another try
Vitals now raises one need per drillable domain whose newest drill is red, or whose newest green drill is more than eight days old.
bun x tsc --noEmitis clean. The five named suites pass (39 tests), including "All fine" intest/asks.test.tsandtest/tui-tell.test.ts.domainDrillNeeds(domains, newest, now, firstSeen)insrc/kernel/domain_drill.tsis pure. For a red drill the sentence names the domain and the phrase quoted in the drill's reason, falling back to the whole reason if none is quoted. A domain with no drill is measured from the forge's first-seen time, and a missing first-seen file raises nothing.newestDrills(db)insrc/core/domain_drills.tsgets each domain's newest drill in one query.domain-drill:<key>, linked to/settings/backups. A later green drill becomes the newest, so the need clears.test/domain-drill-needs.test.tsuses a fixed clock. It covers red naming the phrase, green clearing, eight days raising, no drill with first-seen old or recent or missing, and no drillable domain.test/vitals.test.tspins its query count at 6, and the new query makes it 7, so I updated the number and its comment. The count is still constant as runs grow.drill.nameis not null. InDOMAINSthat means compute, restore, tokens and runners. State has no named drill, so it raises nothing. The new tests use a state-shaped domain with a drill name.Closes #2019