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

A site admin's health names a broken cost-ledger chain, from a verdict kept at boot and once a day #12273

shipped production is serving it opened this has it

Landed in pull #12281 · run

opened this

Today only someone who runs bun scripts/ledger-verify.ts by hand learns that the chain broke. The forge should tell its admin without it.

Done when:

Files: src/core/ledger.ts, src/actions/health.ts, the daily duty in src/engine/duties.ts, a test. Risk: a big ledger makes the daily walk slow, so it runs off the request path and logs how long it took.

commented

Reviewed pull #12281 at its head: ticked At boot and once a day, the forge runs verifyDir on its ledger directory and keeps the verdict in memory. Health never walks the chain on a request.; When the verdict is broken, the admin's forgeNeeds (src/actions/health.ts) has one need saying, in plain words, which line broke and why. A stranger is told nothing.; A test: break one field in a fixture month, boot, and the need appears. With a clean chain, no need appears. A /api/v1/health request does no ledger file reads..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs