# Repair ordering: validate a destination before changing its contents This is an original in-memory teaching model by Hesela, dated 2026-11-23. It opens no disk image and implements neither SQCK nor e2fsck. ## Run Place model.py, test_model.py and results.json in one directory: python3 -B model.py --check python3 -B test_model.py python3 -B -O test_model.py The model prints JSON without options. --write regenerates only results.json. It requires Python 3.8 or newer and uses only the standard library. No input data is downloaded, no random numbers are used, and no packages are needed. ## Construction and independent checks Eight blocks have fixed, independently trusted roles: header 0, reserved metadata 1, indexes 3 and 5, and data 2, 4, 6 and 7. Index word zero denotes an absent child. Other index words must name data blocks. A single parent pointer can be None, -1, any block 0 through 7, or 8. Those 11 targets and two operation orders produce 22 cases, not probabilities. Both policies detach a parent that does not name an index. The early policy does that before touching children; the late policy first interprets the target's words as child pointers. When the parent incorrectly names block 0, the late policy replaces header words [99, 8] with [0, 0]. Both policies eventually detach the same parent. The final parent value alone conceals the collateral damage. A legitimate index at block 3 starts with [4, 99] and becomes [4, 0] under either policy; a clean index at block 5 remains unchanged. The tests compare all early-policy results with a separate copied-state oracle, exercise legitimate repairs and clean controls, reject ambiguous Python input types, and check complete unique enumeration. They additionally show that late validation can overwrite data as well as metadata. The original block words and exact operation trace are in model.py/results.json. ## Limits that affect interpretation Trusted block roles are an assumption, not information recovered by this model. A real checker must establish its own trustworthy layout before acting. No directory graph, inode allocator, checksums, repair persistence, concurrent writer, torn write, interrupted repair or storage device is modeled. Detaching a wrong pointer avoids the demonstrated overwrite but does not recover its missing original reference. A no-damage check is not a data-recovery success criterion. These cases do not estimate failure rates. ## Reading context Gunawi, Rajimwale, Arpaci-Dusseau and Arpaci-Dusseau, SQCK: A Declarative File System Checker, OSDI 2008, sections 2.3, 3 and 4.3: https://www.usenix.org/legacy/events/osdi08/tech/full_papers/gunawi/gunawi_html/index.html The paper motivates the ordering question. Its historical observations are not findings about current e2fsck. No original paper code, figures, benchmark results or filesystem images are redistributed here. Related persistence boundary: Gatla et al., Towards Robust File System Checkers, FAST 2018: https://www.usenix.org/system/files/conference/fast18/fast18-gatla.pdf Source access: 2026-11-23. This packet is an executable counterexample, not a replication or new measurement. The corpus entry supplies the concise source synthesis; the Observatory explains how to interpret the model.