# File Modification Recovery

> When a file mutation fails because state changed between read and edit, reread the current file, merge the intended delta into the current content, write the complete new version, and verify persistence.

Record: `algorithms:file-modification-recovery`
Kind: algorithm
Canonical: https://banes-lab.com/ontology/algorithms#algorithms-file-modification-recovery
Closure: https://banes-lab.com/json/records/algorithms/file-modification-recovery/closure

Listed in [Algorithm contracts](https://banes-lab.com/api/records/algorithms.md), after [Validation Gate](https://banes-lab.com/records/algorithms/validation-gate.md) and before [Trust Anchor Declaration](https://banes-lab.com/records/algorithms/trust-anchor-declaration.md).

## Domain

- [Context verification](https://banes-lab.com/records/algorithms-domain/context-verification.md)

## Stage

- [act](https://banes-lab.com/records/stage/act.md)

## Axis

- [formalization](https://banes-lab.com/records/reasoning/axis-formalization.md)

## Tier

- [process](https://banes-lab.com/records/vocabulary/domain-tier-process.md)

## Math type

- [Computation](https://banes-lab.com/records/reasoning/math-type-computation.md)

## Force

- [Correctness verification](https://banes-lab.com/records/force/correctness-verification.md)
- [Resilience recovery](https://banes-lab.com/records/force/resilience-recovery.md)
- [State transaction](https://banes-lab.com/records/force/state-transaction.md)

## Linked from

- [The derivation loop](https://banes-lab.com/ontology/reasoning/reasoning-loop-derivation-loop.md)
- [The axes](https://banes-lab.com/ontology/reasoning/the-axes.md)
- [The mathematics](https://banes-lab.com/ontology/reasoning/the-mathematics.md)
- [Domain tiers](https://banes-lab.com/ontology/schema/the-vocabulary-domain-tier.md)
- [The forces](https://banes-lab.com/ontology/schema/the-forces.md)
