Skip to content

Re-land the safe draft duplicate path (AGT-4603) on current main: commit ee67382 from goal/61 (PR #964, whose head branc - #974

Merged
unohee merged 1 commit into
mainfrom
goal/78-re-land-the-safe-draft-duplica
Nov 21, 2026
Merged

unohee merged 1 commit into
mainfrom
goal/78-re-land-the-safe-draft-duplica

Conversation

@unohee

@unohee unohee commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Milestone of an auto-claude run.

Check: (test -d node_modules || npm ci --prefer-offline --no-audit --no-fund) && npm run lint && npm run typecheck && grep -rqF 'posts the duplicate evidence comment before marking the duplicate' src && grep -rqF 'DRAFT_DUPLICATE_CAP_PER_HOUR' src/automation/draftGrooming.ts && npx vitest run src/automation/draftGrooming src/automation/backlogGrooming src/automation/runnerExecution.coverage src/agents/pairPipelineRoleScope src/agents/pairPipeline.cancelIsolation

Plan: .claude/auto-plan.md (local to the run).

…R, capped per hour (AGT-4603)

- applyDraftGates in draftGrooming.ts marks a duplicate only after four
  steps:
  1. Look up open linked PRs (injectable openPrLookup, default
     createGhOpenPrLookup). An open PR, a lookup failure or a missing
     identifier means no comment and no mark, and the worker runs.
  2. Take one slot from DRAFT_DUPLICATE_CAP_PER_HOUR (5) in a rolling hour.
     When the cap is used up, the worker runs.
  3. Post the evidence comment. It is worded as intent and carries a stable
     draft-duplicate:<24 hex> idempotency marker. If the comment fails, the
     slot is given back and nothing is marked.
  4. Call source.markDuplicate.
- resetDraftDuplicateBudget() is exported for tests.
- applyBacklogGrooming refuses any target state other than Done or Backlog,
  even for a decision passed in directly. The refusal is counted as
  protected and gets an evidence comment, with no state move. A parse test
  pins the whitelist that drops 'Canceled'.
- runnerExecution.ts is unchanged. runnerExecution.coverage.test.ts stays at
  1497 lines: one existing mock line now overrides only createGhOpenPrLookup
  through an importOriginal spread, and the duplicate test expects the
  marker.
- Every new test was mutation-checked against the old behaviour.

Assumption: a throw from markDuplicate itself still propagates, as before.
The cap is per process, which is enough for one daemon.
@unohee
unohee merged commit 94a844c into main Nov 21, 2026
9 checks passed
@unohee
unohee deleted the goal/78-re-land-the-safe-draft-duplica branch November 21, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant