You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1] Add an ownership ledger and orphan reconciliation for worker resources #34
The existing lifecycle helpers clean resources when the caller reaches cleanup. They do not provide one durable record for every process, worktree, temporary directory, and artifact created by all adapters. A crashed orchestrator can leave resources behind.
Deliverable
Add an orchestrator-owned resource ledger outside worker checkouts. Register resources before or at creation, update lifecycle state, and reconcile unfinished records on the next run.
The ledger must cover AGY-created worktrees and resources created by future adapters.
Cleanup must be idempotent and ownership-checked. Retain dirty, unmerged, unknown, or ambiguous resources for review.
Acceptance criteria
Each resource record has assignment identity, parent identity, resource type, absolute path or process identity, owner marker, state, and timestamps.
The ledger survives orchestrator failure and supports a later reconciliation pass.
Normal completion, worker failure, timeout, cancellation, and quota handoff all enter cleanup or retention through the same lifecycle.
Repeating cleanup does not damage retained evidence or report a false success.
Cleanup removes only ledger-owned resources that pass the safety checks.
Unknown, dirty, unmerged, or ambiguous worktrees remain available for review.
A running worker is terminated and awaited before its owned resources are removed.
AGY-native worktrees outside the current helper path are either registered or retained as unknown.
A fake crash leaves records that a later reconciliation test can find and classify.
Tests prove that no cleanup path reaches the caller checkout, a Git root, a reparse point, or an unowned directory.
Activity
anthonyandrei commentedon Sep 4, 2026
Resolved by PR #39 (#39). The merged implementation covers this issue, and the targeted acceptance tests pass. Closing as completed.