Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.15 KB

File metadata and controls

40 lines (28 loc) · 1.15 KB

segmented wal

Language: Python · Sphere: programming · Category: Persistence

Signature: (wal: WriteAheadLog) → None

What it does

Write-Ahead Log (WAL) implementation for durable transaction logging.

This module provides a complete WAL system with:

  • Append-only writes for durability
  • Checksum verification for data integrity
  • Segment-based log rotation
  • Crash recovery and replay functionality

Guarantee

When it runs, segmented wal guarantees n_recovered == 15; len(wal.segments) >= 3; replayed == transactions (proven by run).

Checkable constraints:

  • len(wal.segments) >= 3
  • replayed == transactions
  • replayed[7] == b'TX-007:' + b'x' * 60
  • n_recovered == 15
  • recovered[:12] == transactions
  • recovered[12:] == [b'crash-1', b'crash-2', b'crash-3']
  • 0 < len(survivors) < 15
  • survivors == transactions[:len(survivors)]

Verification evidence

  • Green-run: ✓ passes (re-run under the extractor's gate)
  • Constraint strength: recovery (truth-pinned)
  • Independent oracle:hard — chaos (validator v1.9)
  • Peer review: unreviewed

△ AURA Pattern Library — © Reality Optimizer