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:387–392  ·  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

385/// graph) are git-excluded and unbacked; committing or reconciling them risks
386/// the provenance layer.
387fn first_forbidden_shadow_path(index: &git2::Index) -> Option<String> {
388 index.iter().find_map(|entry| {
389 let path = String::from_utf8_lossy(&entry.path).into_owned();
390 is_forbidden_shadow_path(&path).then_some(path)
391 })
392}
393
394/// Whether `path` (a repo-relative git path) is a git-excluded Atomic shadow /
395/// 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