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

Function is_path_shaped

atomic-cli/src/commands/intent/validate.rs:112–114  ·  view source on GitHub ↗

Is the argument *shaped* like a filesystem path (rather than an intent ID)? True when it ends in `.md` or contains a path separator. We decide path-vs-ID on shape, not existence, so a mistyped `./plan.md` is reported as a missing file (FileNotFound) instead of misleadingly falling through to "invalid ID". Intent IDs are `PREFIX-N` / `N` — no `.md` suffix, no separator.

(arg: &str)

Source from the content-addressed store, hash-verified

110/// file (FileNotFound) instead of misleadingly falling through to "invalid ID".
111/// Intent IDs are `PREFIX-N` / `N` — no `.md` suffix, no separator.
112fn is_path_shaped(arg: &str) -> bool {
113 arg.ends_with(".md") || arg.contains('/') || arg.contains(std::path::MAIN_SEPARATOR)
114}
115
116/// Resolve `urn:atomic:change:<hash>` evidence URNs against the change store at
117/// `repo_root`. One violation per URN that does not resolve. With no repository

Callers 1

runMethod · 0.70

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected