From bd62c814c5ef5d996e67906ae808497a563d3407 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sat, 27 Dec 2025 20:37:34 -0600 Subject: [PATCH] Add Technical_Decomp_Diff --- Technical_Decomp_Diff.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Technical_Decomp_Diff.md diff --git a/Technical_Decomp_Diff.md b/Technical_Decomp_Diff.md new file mode 100644 index 0000000..ebb8989 --- /dev/null +++ b/Technical_Decomp_Diff.md @@ -0,0 +1,30 @@ +## enroll/diff.py + +### BundleRef (dataclass) + +Purpose: represents a prepared harvest bundle that diff can read from. + +#### Fields: + +`dir`: Path: directory containing at least `state.json` and (optionally) artifacts/ + +`tempdir`: Optional[tempfile.TemporaryDirectory]: Set only when the bundle had to be extracted/decrypted into a temporary directory. Lets the caller clean up later + +#### Property: + +`state_path` -> Path: dir / "state.json" + +#### Lifecycle / where it’s used: + +Constructed by _bundle_from_input(path, sops_mode=...) which accepts: + +- bundle directory +- direct state.json path +- .tar.gz/.tgz +- .sops encrypted tarball (or when --sops is enabled) + +`compare_harvests()` uses `ExitStack` to ensure any `tempdir.cleanup()` happens. + +#### Key design detail: + +This class is the bridge between "user supplied something" and “we have a real directory with files”. \ No newline at end of file