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

Method verified_binding_for

atomic-cli/src/commands/git/parallel.rs:5788–5811  ·  view source on GitHub ↗

Locate a fully verified Git-state binding for one parsed commit (CB-9A: resurrection over synthesis), with the CB-6C checked-cache contract: the resolution either returns a validated immutable binding (the only adoption-authorized result), an explicit unresolved verdict (a stored binding names this commit but failed verification — never synthesized over), or nothing (cold path).

(
        &self,
        repo: &Repository,
        git: &GitRepository,
        parsed: &ParsedCommit,
    )

Source from the content-addressed store, hash-verified

5786 /// (a stored binding names this commit but failed verification — never
5787 /// synthesized over), or nothing (cold path).
5788 fn verified_binding_for(
5789 &self,
5790 repo: &Repository,
5791 git: &GitRepository,
5792 parsed: &ParsedCommit,
5793 ) -> CliResult<Option<atomic_repository::git_binding::GitStateBinding>> {
5794 use atomic_repository::GitShaResolution;
5795 let algorithm = git_algorithm_for_sha(&parsed.git_sha)?;
5796 let commit = git_object_id_for_sha(algorithm, &parsed.git_sha)?;
5797 match repo
5798 .resolve_git_sha(git, &commit)
5799 .map_err(|e| CliError::Internal(e.into()))?
5800 {
5801 atomic_repository::GitShaResolution::VerifiedBinding { binding, .. } => {
5802 Ok(Some(binding))
5803 }
5804 atomic_repository::GitShaResolution::Unresolved { detail } => Err(git_error(format!(
5805 "a stored binding claims commit {} but failed verification; refusing to \
5806 synthesize over a known binding claim (recoverable rejection): {detail}",
5807 parsed.git_sha
5808 ))),
5809 atomic_repository::GitShaResolution::Cold => Ok(None),
5810 }
5811 }
5812
5813 /// Resurrect a verified binding's closure into the target view instead
5814 /// of synthesizing from Git (CB-9A/CB-6C).

Callers 1

phase2_writeMethod · 0.80

Calls 4

git_algorithm_for_shaFunction · 0.85
git_object_id_for_shaFunction · 0.85
resolve_git_shaMethod · 0.80
git_errorFunction · 0.70

Tested by

no test coverage detected