Skip to content

fix(miner): pre-attempt idempotency check against the miner's own open PR for the same issue — stop crash-retry double-opens #8808

Description

@JSONbored

Context (AMS adversarial audit)

claim-conflict-resolver.ts:44-47 documents that a retry-after-crash's stale own PR is never treated as a competing claim; submission-freshness-check.ts:145-149 excludes same-author PRs from staleness; governor-state.ts's own-submission table carries issueNumber (attempt-cli.ts:874-880) but nothing queries it before a new attempt. Kill the process after PR-open but before the finally completes, retry the issue → second PR, no cleanup.

Fix

Before prepareOpenPrSubmission (ideally before a worktree slot is consumed), query listRecentOwnSubmissions({repoFullName}) filtered by issueNumber for a still-open pullRequestNumber; refuse or adopt the existing PR. Also align/document the 6h worktree-lease vs 14d claim-age reclaim windows while in the file. Tests both ways.

99%+ patch coverage, branch-counted.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions