← All builds

Crash-resistant state continuity

APEX WAL

A write-ahead logging core designed around strict sequence continuity, framed records, checksums, durable flushes, and safe recovery from a damaged tail.

Status
Production core
Maturity
Verified component
Disclosure
Protected source

THE PROBLEM

Why it was built

An interrupted write can leave state partially persisted. Without framing, sequence rules, and recovery boundaries, the application may silently accept corrupted or missing history.

THE CONCEPT

The architectural move

APEX WAL frames every record with a magic value, payload length, CRC32 checksum, and sequence number. Recovery validates the stream, truncates only an incomplete tail, and rejects structural corruption that cannot be safely repaired.

SIGNIFICANCE

Why it matters

It turns persistence from a best-effort file write into an auditable continuity protocol that can support higher-level AI state and governance ledgers.

SYSTEM FLOW

Architecture at a glance

  1. 01Payload validation
  2. 02Binary framing
  3. 03Append and flush
  4. 04Sequence checkpoint
  5. 05Startup scan
  6. 06Tail repair or rejection
GUIDED DEMO · SANITIZED

SCENARIO

Recover an interrupted append

INPUT

Simulate power loss after half of the final payload reaches disk.

SYSTEM RESPONSE

Recovery validates complete records, identifies the incomplete final frame, truncates to the last durable boundary, and resumes with the next valid sequence.

PROTECTED SNIPPET

Framed persistence contract

header = frame(magic, length, crc32, sequence)
append(header + payload)
flush_and_sync()
recovery.verify_continuity()

Conceptual excerpt. Internal implementation, tests, configuration, and operational logic are withheld.

EVIDENCE STATUS

What supports it

The APX2 implementation defines a fixed binary header, payload-size guard, full-payload CRC32 validation, sequence checks, and automated tail recovery.

LIMITATIONS

What remains bounded

CRC32 detects accidental corruption; it is not a cryptographic authenticity mechanism. Adversarial tampering requires a separate keyed integrity layer.

LICENSING PATH

Use the concept without exposing the source.

Available as a persistence component or as part of a customized state-continuity architecture.

View licensing model