Skip to content

quilt kernel P5-ops: the ledger reports its own health - #5

Closed
SuperInstance wants to merge 1 commit into
quilt-kernel-p4-review-fixesfrom
quilt-kernel-p5-ops
Closed

SuperInstance wants to merge 1 commit into
quilt-kernel-p4-review-fixesfrom
quilt-kernel-p5-ops

Conversation

@SuperInstance

Copy link
Copy Markdown
Owner

Why

Review finding #2 (the code half): every WAL projection failure reduced to a console.warn, and nothing in production reads quilt_wal — the mirror could die at deploy and nobody would know for a week.

What

  • src/quilt/ops.ts: failure counters per kind, rows-committed gauge, and reconcileTick — a cron-ready wrapper around the P3 reconciliation pass that returns a summary and never throws (a failed tick is itself a counted failure)
  • All five silent catch sites now count through recordWalFailure; commit.ts counts lock exhaustion (was a bare warn) and successful rows
  • Alert wiring: failureCounts.reconcile_tick > 0 or mismatchCount > 0; schedule via wrangler [triggers] crons (e.g. every 15 minutes)

Posture unchanged: the user path never sees a mirror exception. Drift is now a number you can alert on, not a rumor.

Verification

  • 5 new ops proofs, including the real deploy-time failure mode: WAL table missing, vote still records, nomination_projection counter increments
  • 398 tests, only the 4 pre-existing artwork/env failures (identical on clean main)
  • tsc --noEmit clean

Merge order: after PR #4. Independent of the tidepool PR (disjoint files).

Refs openclaw#48

Review finding #2 (code half): every WAL projection failure reduced to
a console.warn and nothing in production reads quilt_wal — the mirror
could die at deploy and nobody would know for a week.

- src/quilt/ops.ts: failure counters per kind (recordWalFailure),
  rows-committed gauge (recordWalCommit), getWalFailureCounts /
  getWalRowsCommitted / resetWalOps (test hook), and reconcileTick —
  a cron-ready wrapper around the reconciliation pass that returns a
  summary and never throws (a failed tick is itself a counted failure).
- All five silent catch sites (nominations.ts, lobsterEncounters.ts x4)
  now count through recordWalFailure; commit.ts counts lock exhaustion
  (was a bare warn) and successful rows.
- Posture unchanged: the user path never sees a mirror exception —
  drift is now a NUMBER you can alert on, not a rumor.

Alert wiring: failureCounts.reconcile_tick > 0 or mismatchCount > 0 in
the ReconcileTickSummary; schedule via wrangler [triggers] crons.

Suite: 398 tests (5 new ops proofs incl. the real deploy-time failure
mode — WAL table missing, vote still records, counter increments).
Only the 4 pre-existing artwork/env failures (identical on clean main).

Refs openclaw#48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant