Recovering an interrupted change
In AEL, the Agent Engineering Language, adding, installing, updating and removing packages are atomic and safe to roll back. If a change is interrupted, by a power cut, a stopped process or a full disk, ael pack repair brings the scope back to a complete state and checks it.
Usage
ael pack repair
ael pack repair --scope src/api
ael pack repair --json
| Option | Meaning |
|---|---|
--scope <folder> | Repair that folder's scope. Without it, the scope that covers the folder you are in. |
--json | A machine-readable report of every action taken. |
How package changes stay recoverable
Before a package command replaces anything, it records its plan beside the scope's manifest: which files it replaces, in which order, and what the scope looked like before. It removes that record only when the change is complete.
That record makes recovery possible. A scope is always either as it was before the change or as it is after it, never a mix of the two.
What it does
- Recovery. If an interrupted change left its record behind,
ael pack repairfinishes the change or undoes it, whichever brings the scope to a complete state, and reports every action. - An integrity check. It then checks the scope: that
pack.lockmatchespack.aeland the project'smetadata.ael, and that every installed file matches the fingerprint the lock file records.
You rarely need to run it yourself: every package command that changes a scope first runs the same recovery there, and reports what it did. Run ael pack repair on its own after a crash, or to check a scope without changing any package.
What it never does
- It never deletes a file it cannot restore, and never removes the previous state before its replacement is in place.
- It follows a recorded plan only when that plan describes the scope as it is. When it cannot tell what happened, it reports that and changes nothing.
- It uses no network and runs no package code.
- It acts on one scope only: other folders' manifests and packages are left untouched.
If the integrity check finds a mismatch that recovery cannot explain, the report names the file. ael pack install --locked reinstalls the scope from its lock file.
Related
- Package commands: how every package change stays atomic.
- Verifying packages: checking installed packages at any time.