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

Function is_path_shaped

atomic-cli/src/commands/intent/validate.rs:186–188  ·  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

184/// file (FileNotFound) instead of misleadingly falling through to "invalid ID".
185/// Intent IDs are `PREFIX-N` / `N` — no `.md` suffix, no separator.
186fn is_path_shaped(arg: &str) -> bool {
187 arg.ends_with(".md") || arg.contains('/') || arg.contains(std::path::MAIN_SEPARATOR)
188}
189
190/// Keep repository and I/O failures distinct; every other evidence refusal is
191/// a user-fixable gate error (exit 2).

Callers 1

runMethod · 0.70

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected