# Ticket: Persist HPT retired segments across reboot

Status: complete
Type: ticket
Updated: 2026-07-23
Next Action: none; retain with Controller A physical evidence
Parent: work/wp/active/wp-triple-mirrored-circular-hpt-log-store.md

## Problem

The triple-circular core originally stored its retirement bitmap only in RAM.
Controller A correctly retired lane segments during the injected-fault
campaign, but a normal reset reopened with retired counts `0/0/0`. A failed
logical segment could therefore be selected again later in the same format
lifetime.

## Expected Behavior

Retirement state is committed redundantly on card before advancing a failed
lane. Reopen restores the newest completely valid bitmap and never selects a
retired segment until explicit destructive reinitialization.

## Acceptance Criteria

- [x] Reserve non-overlapping tail sectors before lane capacity is calculated.
- [x] Implement alternating complete bitmap snapshots with media/snapshot
  generation, per-sector CRCs, and header CRC.
- [x] Commit changed retirement state before advancing the affected lane.
- [x] Load retirement state before scanning/selecting active segments.
- [x] Clean model/invariant and Debug/Release builds pass.
- [x] Controller A single/dual-lane injection passes on the corrected format.
- [x] Normal reset preserves retired counts and logging resumes with mask `0x7`.

## Verification

Run the bounded RAM-commanded lane diagnostic, capture its `2/1/0` retirement
state, issue a normal reset, and confirm reopen reports `2/1/0`, skips those
segments, retains monotonic sequence, and writes the next record to all lanes.
