Repository navigation
feat(tracked): add the sidecar, name classification and image walk - #16
Merged
Merged
Conversation
Adds the read-only half of the tracked-folder layer, the primitives a following commit builds the create-time baseline on: * the tracking sidecar (`sidecar.rs`): the `<image>.ext4kit-tracked` JSON that ties an image UUID to a label and the repo-to-target mappings, written atomically (temporary file, sync_all, rename) and validated on read. * git-path name classification (`names.rs`): every name read from the image is agent-controlled bytes, and nothing becomes a git path or gets printed before `validate_component` classifies it — names the kernel cannot produce, git's `verify_path` refusals (`.git` aliases, `git~1`, `.gitmodules` as a symlink) and host-incompatible names. * the image walk (`scan.rs`): an iterative DFS over one mapping target through `ext4::reader::ImageReader`, recording names, kinds, inode numbers, symlink targets and the stability fields but no content. Unreadable or unrepresentable entries become per-path corruption notes instead of aborting the run, and the walk does not descend into nested repositories, `.git` aliases or host-incompatible names. The layer reads the image only through `ImageReader`; no git subprocess is spawned and no CLI surface changes until the following commit. Review focus: the hostile-input handling (agent-controlled names, symlink targets, crafted inodes) and the sidecar's read-side validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the read-only half of the tracked-folder layer, the primitives a following commit builds the create-time baseline on:
sidecar.rs): the<image>.ext4kit-trackedJSON that ties an image UUID to a label and the repo-to-target mappings, written atomically (temporary file, sync_all, rename) and validated on read.names.rs): every name read from the image is agent-controlled bytes, and nothing becomes a git path or gets printed beforevalidate_componentclassifies it — names the kernel cannot produce, git'sverify_pathrefusals (.gitaliases,git~1,.gitmodulesas a symlink) and host-incompatible names.scan.rs): an iterative DFS over one mapping target throughext4::reader::ImageReader, recording names, kinds, inode numbers, symlink targets and the stability fields but no content. Unreadable or unrepresentable entries become per-path corruption notes instead of aborting the run, and the walk does not descend into nested repositories,.gitaliases or host-incompatible names.The layer reads the image only through
ImageReader; no git subprocess is spawned and no CLI surface changes until the following commit. Review focus: the hostile-input handling (agent-controlled names, symlink targets, crafted inodes) and the sidecar's read-side validation.