The exact managed commit that explains a detached-HEAD refusal at turn end, if there is one (CB-12A follow-up AC-8). The agent library proves the commit is the turn's own work (authenticated commit-time capture, no worktree remainder). This adds the checks only the CLI can make: the verified checkpoint still names the session's Draft view at the commit's parent, and the commit is that parent's si
(
repository: &Repository,
repository_root: &std::path::Path,
session_id: &str,
remediation: &atomic_repository::WorkspaceRemediation,
)
| 608 | /// at the commit's parent, and the commit is that parent's single direct |
| 609 | /// child, so an amend, rebase, merge or foreign commit never qualifies. |
| 610 | fn exact_managed_commit( |
| 611 | repository: &Repository, |
| 612 | repository_root: &std::path::Path, |
| 613 | session_id: &str, |
| 614 | remediation: &atomic_repository::WorkspaceRemediation, |
| 615 | ) -> Option<atomic_agent::record::ExactManagedCommit> { |
| 616 | let atomic_repository::WorkspaceRemediation::Unanchored { |
| 617 | state: atomic_repository::UnanchoredWorkspace::DetachedHead { oid }, |
| 618 | .. |
| 619 | } = remediation |
| 620 | else { |
| 621 | return None; |
| 622 | }; |
| 623 | match exact_managed_commit_at(repository, repository_root, session_id, oid) { |
| 624 | Ok(commit) => Some(commit), |
| 625 | Err(reason) => { |
| 626 | log::info!( |
| 627 | "hooks: detached HEAD {oid} is not absorbed into the turn of session \ |
| 628 | {session_id}: {reason}" |
| 629 | ); |
| 630 | None |
| 631 | } |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | /// [`exact_managed_commit`] with the reason a commit does not qualify. |
| 636 | fn exact_managed_commit_at( |
no test coverage detected