The merkle root folds sorted file records - what else can change it besides content edits? #1
|
|
Replies: 1 comment
|
The root changes on three axes - path, size, and content digest - and the sort only removes discovery order from the equation, not placement.
So: bytes edit, size change, and move/rename all change the root. mtime churn alone does not - which is the property that makes |
The root changes on three axes - path, size, and content digest - and the sort only removes discovery order from the equation, not placement.
A move changes the root. The fold includes the path field, so renaming or relocating a file with identical bytes produces a different root. That is intentional: provenance is about the artifact as it sits in the workspace, and a move is a real change to what you would ship.
Sorting makes the root canonical, nothing more. Two scans that find the same set of files in different order must produce the same root; that is what the sort guarantees. It does not normalize paths -
./a.txtanda.txtare different strings unless the scanner normalizes befor…