Repository navigation
Re-land the safe draft duplicate path (AGT-4603) on current main: commit ee67382 from goal/61 (PR #964, whose head branc - #974
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.cancelIsolationPlan: .claude/auto-plan.md (local to the run).