# Legacy Mock Finality Backlog Remediation

## Decision

The legacy Express mock block ledger is not the Besu QBFT candidate ledger. Its
unvalidated backlog must never be bulk-finalized because mock finalization creates
validator rewards and finalized callbacks without an independent validator quorum.

Candidate security mode requires `AISFOR_CHAIN_MOCK_BLOCK_WRITES_ENABLED=0`. This
locks legacy mock mining, validator assignment, voting, and finalization while the
QBFT candidate network continues producing blocks independently.

## Applied disposition

The 2026-07-29 audit covered 940 legacy mock blocks and verified the complete block
hash chain with no continuity or hash errors.

- 5 previously finalized mock blocks were retained unchanged.
- 933 unvalidated blocks with no assignments or votes were marked
  `ARCHIVED_LEGACY_MOCK`.
- blocks 69 and 70 were marked `QUARANTINED_LEGACY_MOCK` because they reference two
  TRX collateral transactions intentionally removed by the 2026-07-04 bad
  collateral-state repair.
- no validator vote, reward, callback, block hash, or block content was created or
  rewritten by the disposition.

The pre-change files are preserved under
`data/backups/finality-backlog-20260729T124828Z`.

## Repeatable controls

- `node scripts/finality-backlog-audit.js --write-report` performs a read-only audit.
- `node scripts/finality-backlog-archive.js` performs a dry-run.
- Applying a disposition requires both `--apply` and
  `--confirm-legacy-archive`, with mock block writes already locked.

Run an apply command only while `aisfor-chain` is stopped. Afterward, compare both
Mongo observation and live-read collections before restarting the service.
