⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
packages/loopover-miner/lib/worktree-allocator.ts:328-332's acquire(attemptId, repoFullName) early-return (existing?.status === "active") keys only on attemptId, never checking existing.repo_full_name against the newly-passed repoFullName. A second acquire call for the same attemptId but a different repo silently gets back the first allocation with no error. Only the same-repo re-acquire case is currently tested.
Requirements
Throw a clear error (e.g. attempt_id_repo_mismatch) when existing.repo_full_name !== normalizedRepo on the early-return path, instead of silently returning the mismatched allocation.
Deliverables
All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
packages/loopover-miner/** -- 99%+ patch coverage on both the new error branch and the existing happy path.
Expected Outcome
A programming error that re-acquires the same attempt ID against a different repo fails loudly instead of silently handing back a worktree allocation for the wrong repo.
Links & Resources
packages/loopover-miner/lib/worktree-allocator.ts:328-332
Context
packages/loopover-miner/lib/worktree-allocator.ts:328-332'sacquire(attemptId, repoFullName)early-return (existing?.status === "active") keys only onattemptId, never checkingexisting.repo_full_nameagainst the newly-passedrepoFullName. A secondacquirecall for the sameattemptIdbut a different repo silently gets back the first allocation with no error. Only the same-repo re-acquire case is currently tested.Requirements
Throw a clear error (e.g.
attempt_id_repo_mismatch) whenexisting.repo_full_name !== normalizedRepoon the early-return path, instead of silently returning the mismatched allocation.Deliverables
acquire()throws when an existing active allocation'srepo_full_namediffers from the requested oneattemptIdre-acquired against a differentrepoFullNamethrows the new error, and a second test confirming the existing same-repo re-acquire path is unaffectedAll of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
packages/loopover-miner/**-- 99%+ patch coverage on both the new error branch and the existing happy path.Expected Outcome
A programming error that re-acquires the same attempt ID against a different repo fails loudly instead of silently handing back a worktree allocation for the wrong repo.
Links & Resources
packages/loopover-miner/lib/worktree-allocator.ts:328-332