Problem: Every governor-*.js wrapper (governor-write-rate-limit.js, governor-chokepoint.js, budget/turn/termination caps, convergence/reputation/self-plagiarism throttles) is a pure in/out transform over caller-supplied state — confirmed by reading the code directly, not assumed. governor-chokepoint.js:34-51 and governor-write-rate-limit.js compute and return rateLimitBuckets/backoffAttempts, but nothing writes them to disk anywhere in packages/gittensory-miner/lib/*.js. This means the mutable counters that must gate the next decision reset to zero on every process start. Contrast: governor-ledger.js does have real SQLite persistence (an append-only governor_events audit table, governor-ledger.js:69-96, chmod 0600) reachable via governor list — decisions are durably logged, but the state that should have produced a different decision on attempt N+1 isn't.
Area: AMS / Miner / Safety
Proposal: Add a real persistence layer for the governor's mutable counters (rate-limit buckets, backoff attempts, budget/turn/termination running totals, convergence history, reputation/self-plagiarism throttle state), mirroring governor-ledger.js's existing SQLite pattern — loaded at the start of each attempt, saved at the end, keyed the same way the ledger already keys its own rows.
Deliverables:
- Governor counters that survive across separate CLI invocations, not just within a single process's lifetime.
Acceptance criteria:
Boundaries:
- This is the safety-critical core of this whole gap-fill batch — needs its own dedicated review, not just a passing test.
Part of #5130.
Problem: Every
governor-*.jswrapper (governor-write-rate-limit.js,governor-chokepoint.js, budget/turn/termination caps, convergence/reputation/self-plagiarism throttles) is a pure in/out transform over caller-supplied state — confirmed by reading the code directly, not assumed.governor-chokepoint.js:34-51andgovernor-write-rate-limit.jscompute and returnrateLimitBuckets/backoffAttempts, but nothing writes them to disk anywhere inpackages/gittensory-miner/lib/*.js. This means the mutable counters that must gate the next decision reset to zero on every process start. Contrast:governor-ledger.jsdoes have real SQLite persistence (an append-onlygovernor_eventsaudit table,governor-ledger.js:69-96, chmod 0600) reachable viagovernor list— decisions are durably logged, but the state that should have produced a different decision on attempt N+1 isn't.Area: AMS / Miner / Safety
Proposal: Add a real persistence layer for the governor's mutable counters (rate-limit buckets, backoff attempts, budget/turn/termination running totals, convergence history, reputation/self-plagiarism throttle state), mirroring
governor-ledger.js's existing SQLite pattern — loaded at the start of each attempt, saved at the end, keyed the same way the ledger already keys its own rows.Deliverables:
Acceptance criteria:
governor-ledger.jsaudit trail remains the authoritative history log; this issue adds the decision-input state, not a second history log.evaluateGovernorChokepoint's existing precedence ladder (kill-switch > pause > dry-run > rate-limit > budget/turn/termination > non-convergence > reputation > self-plagiarism > allow) is unchanged — this issue only makes its optional input fields durable, it does not alter the chokepoint's own logic.Boundaries:
Part of #5130.