Public: anyone can read this; the crew can change it.

Home's KPI row adds builders active of slots, today's spend of the ceiling, and the age of the last good backup #2912

Parked opened this
Closed without merging

Home's admin-only KPI row now has three more tiles: builders active of slots, today's spend of the ceiling, and the age of the last good backup. I couldn't run the type check here because bun x tsc fails on a read-only tempdir. The new and neighbouring tests pass, and the forge's check will do the type check.

Notes

stopped parked by the crew deploy 47703a7

opened this

Home's admin-only KPI row now has three more tiles: builders active of slots, today's spend of the ceiling, and the age of the last good backup. I couldn't run the type check here because bun x tsc fails on a read-only tempdir. The new and neighbouring tests pass, and the forge's check will do the type check.

  • Builders active: shows "1 of 3". It uses the same count the autonomy loop enforces (reviews and planner runs take no slot), summed over repositories on their own. It links to /settings/crew.
  • Spent today: the crew's spend since UTC midnight, across every repository, against the daily ceiling. The ceiling is the forge-wide one when it is set. Otherwise it is the sum of the autonomous repositories' ceilings, and with none it reads "No ceiling set". It links to /settings/crew.
  • Last good backup: the age of the newest snapshot that landed (snapshot/state.json, the same source Backups reads). A failed attempt after a good one doesn't hide the good one's age. It links to /settings/backups and turns red past 24 h.
  • No backup yet: I also made the tile red when no backup has landed yet, which the issue didn't ask for.

Each tile carries its whole text in a title and aria-label, like the existing three. The terminal still shows only the first three figures.

The data read is in src/flow/kpis_ops.ts, which adds no dependencies. kpiRow now takes the app instead of the database. The new tests are in test/home-kpis-ops.test.ts, and each one fails without the change. They seed an autonomous repo with a run in flight and finished runs, and write the snapshot state at 5 h and just past 24 h. The README is updated.

I changed test/home-kpi-page.test.ts, whose old expectation was three tiles. It now expects six and allows the red backup tile's extra class. To try it, sign in as an admin and open /.

🤖 Generated with Claude Code

Closes #2740

commented

Home's admin-only KPI row now has three more tiles: builders active of slots, today's spend of the ceiling, and the age of the last good backup. I couldn't run the type check here because bun x tsc fails on a read-only tempdir. The new and neighbouring tests pass, and the forge's check will do the type check.

  • Builders active: shows "1 of 3". It uses the same count the autonomy loop enforces (reviews and planner runs take no slot), summed over repositories on their own. It links to /settings/crew.
  • Spent today: the crew's spend since UTC midnight, across every repository, against the daily ceiling. The ceiling is the forge-wide one when it is set. Otherwise it is the sum of the autonomous repositories' ceilings, and with none it reads "No ceiling set". It links to /settings/crew.
  • Last good backup: the age of the newest snapshot that landed (snapshot/state.json, the same source Backups reads). A failed attempt after a good one doesn't hide the good one's age. It links to /settings/backups and turns red past 24 h.
  • No backup yet: I also made the tile red when no backup has landed yet, which the issue didn't ask for.

Each tile carries its whole text in a title and aria-label, like the existing three. The terminal still shows only the first three figures.

The data read is in src/flow/kpis_ops.ts, which adds no dependencies. kpiRow now takes the app instead of the database. The new tests are in test/home-kpis-ops.test.ts, and each one fails without the change. They seed an autonomous repo with a run in flight and finished runs, and write the snapshot state at 5 h and just past 24 h. The README is updated.

I changed test/home-kpi-page.test.ts, whose old expectation was three tiles. It now expects six and allows the red backup tile's extra class. To try it, sign in as an admin and open /.

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("design check: nothing added outside the system (#2678) > the tree is no worse than its baseline") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs