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

Function attested_sidecar_candidates

atomic-cli/src/commands/intent/bridge.rs:159–172  ·  view source on GitHub ↗

Candidate legacy-sidecar paths, most-preferred first: the normalized-id path (what the current `attest` writes) and the raw-arg path an M1a-era build wrote (it sanitized the RAW CLI arg, un-normalized). Probing both lets the dual-read fallback find pre-upgrade sidecars regardless of the id form the original `attest` was invoked with. De-dups when the two coincide.

(repo: &Repository, id: &str)

Source from the content-addressed store, hash-verified

157/// dual-read fallback find pre-upgrade sidecars regardless of the id form the
158/// original `attest` was invoked with. De-dups when the two coincide.
159fn attested_sidecar_candidates(repo: &Repository, id: &str) -> CliResult<Vec<PathBuf>> {
160 let normalized = attested_sidecar_path(repo, id)?;
161 let raw = repo
162 .dot_dir()
163 .join("canonical")
164 .join("intents")
165 .join(sanitize_id(id))
166 .join("attested.jsonld");
167 let mut candidates = vec![normalized];
168 if !candidates.contains(&raw) {
169 candidates.push(raw);
170 }
171 Ok(candidates)
172}
173
174/// A hash of the source lift inputs, recorded in the sidecar so a later edit to
175/// the intent can be detected as making the attestation stale. This is a

Callers 1

load_attestationFunction · 0.85

Calls 5

dot_dirMethod · 0.80
attested_sidecar_pathFunction · 0.70
sanitize_idFunction · 0.70
containsMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected