CB-10B review R9: the DEGRADED namespace (`refs/heads/atomic/bindings/*`) installs through the SAME fail-closed validation as the primary namespace — decode, canonical ref id, cryptography, live Git content, exact immutable carrier — only behind the explicit degraded-reader opt-in.
(
repo: &Repository,
git: &GitRepository,
)
| 166 | /// exact immutable carrier — only behind the explicit degraded-reader |
| 167 | /// opt-in. |
| 168 | pub(crate) fn install_degraded_bindings( |
| 169 | repo: &Repository, |
| 170 | git: &GitRepository, |
| 171 | ) -> CliResult<usize> { |
| 172 | use atomic_repository::git_binding::DEGRADED_HEAD_BINDING_PREFIX; |
| 173 | let mut names = Vec::new(); |
| 174 | for reference in git.references().map_err(|error| CliError::GitError { |
| 175 | message: format!("cannot enumerate refs: {error}"), |
| 176 | })? { |
| 177 | let reference = reference.map_err(|error| CliError::GitError { |
| 178 | message: format!("cannot read ref: {error}"), |
| 179 | })?; |
| 180 | let Ok(name) = reference.name() else { |
| 181 | continue; |
| 182 | }; |
| 183 | if let Some(rest) = name.strip_prefix(DEGRADED_HEAD_BINDING_PREFIX) { |
| 184 | let mut parts = rest.split('/'); |
| 185 | let shard = parts.next().unwrap_or(""); |
| 186 | let id_hex = parts.next().unwrap_or(""); |
| 187 | if parts.next().is_none() && shard.len() == 2 && id_hex.len() == 64 { |
| 188 | names.push(name.to_string()); |
| 189 | } |
| 190 | } |
| 191 | } |
| 192 | names.sort(); |
| 193 | install_binding_refs(repo, git, names) |
| 194 | } |
| 195 | |
| 196 | /// The shared fail-closed binding install over an explicit ref-name list. |
| 197 | fn install_binding_refs( |
no test coverage detected