Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(stats): read proof counters from one snapshot [R1,R2]
Corey Olsonf3787ffcfe22
diff --git a/src/stats.js b/src/stats.jsindex d6360ace..52a91f0c 100644--- a/src/stats.js+++ b/src/stats.js@@ -100,6 +100,15 @@ function actorsFrom(history, boundary) {/** Assemble the public statistics shared by the CLI and local board state from one event snapshot. */export function proofStats(board, { since, now = Date.now() } = {}) {const boundary = sinceDate(since);+ // A SAVEPOINT is read-only until a write occurs, and nests inside callers' transactions.+ // Hold one snapshot across the cursor, projection shards, and verdicts while other seats append.+ board.db.exec('SAVEPOINT proof_stats_read');+ try { return proofStatsSnapshot(board, boundary, now); }+ finally { board.db.exec('RELEASE proof_stats_read'); }+}++/** Assemble cached or legacy statistics within the caller's already established read snapshot. */+function proofStatsSnapshot(board, boundary, now) {const counted = counterProofStats(board, boundary, now);if (counted) return counted;const history = events(board);