MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / first_forbidden_shadow_path

Function first_forbidden_shadow_path

atomic-cli/src/commands/git/shadow.rs:2187–2192  ·  view source on GitHub ↗

Return the first staged index path that is a git-excluded shadow / provenance path (`.atomic/`, `.vault/`, or `.atomicignore`), or `None` if the candidate is clean. Validator Rule V4 (SPEC §6.4): these paths must never enter a git commit — `.vault` (intents/memories/attestations) and `.atomic` (the change graph) are git-excluded and unbacked; committing or reconciling them risks the provenance lay

(index: &git2::Index)

Source from the content-addressed store, hash-verified

2185/// graph) are git-excluded and unbacked; committing or reconciling them risks
2186/// the provenance layer.
2187fn first_forbidden_shadow_path(index: &git2::Index) -> Option<String> {
2188 index.iter().find_map(|entry| {
2189 let path = String::from_utf8_lossy(&entry.path).into_owned();
2190 is_forbidden_shadow_path(&path).then_some(path)
2191 })
2192}
2193
2194/// Whether `path` (a repo-relative git path) is a git-excluded Atomic shadow /
2195/// provenance path that Rule V4 forbids from any shadow commit.

Callers 1

stage_and_validate_treeFunction · 0.85

Calls 2

is_forbidden_shadow_pathFunction · 0.85
iterMethod · 0.45

Tested by

no test coverage detected