Repository navigation
Description
Problem or Motivation
The duplicate search of intake reads open items and items closed as not planned. An item that someone filed before its fix landed gets placed, researched and staged again. A flagged duplicate can wait with no limit. The approved pipeline split design (tracker #5482) adds a fixed-before search and a 7-day hold.
Proposed Solution & Architectural Design
- Intake adds issues closed as completed and PRs merged in the last 90 days to the candidate set of the duplicate search, with the same embeddings.
- A match writes
intake.duplicate_of. The job never closes or drops an item (owner rule on duplicates). - Stage selection holds a flagged item for at most 7 days. After that,
devops roadmap inboxlists it as a person cause. - group (feat(roadmap): the group row links a family and closes on a re-check #4813) is due for an item with
intake.duplicate_ofand no group check in 24 h, and checks it again. - Intake owns this search at filing time. feat(roadmap): detect already-merged issue changes in stage #4113 stays the stage check for a change that merged after intake.
Target Subsystem
Roadmap Service and roadmap jobs (src/devops_cli/roadmap/intake/).
Acceptance Criteria
- Test first: a merged PR that changed the same path flags a new item. The test fails on the base.
- A test: a flagged item is held for 7 days, and not after.
- A test: the step sends no close request.
- Live proof: after the merge and the release, intake runs as the App on the new items of 7 days and on a replay of 10 items closed as completed. A comment on this issue gives the result lines with each flag.
Existing Tool Considered
duplicate_eval.py and the embeddings index exist. The OpenHands duplicate-candidate pattern, with no auto-close, shapes it. Build: 200,000 to 400,000 agent tokens and 0.5 to 1 day.
Related
Tracker #5482, Phase 5. Depends on #4813. #4812, #5166, #4113.
Source: #5482
Alternatives check of 2026-12-01: none.
Tool: none found.
Reason: Searches found no maintained tool for a fixed-before duplicate search over merged pull requests and issues closed as completed. The need is project-specific intake and stage logic on duplicate_eval.py and the embeddings index, so no tool covers it.
Proposed design
Problem statement
Intake searches open items and items closed as not planned for duplicates. It does not search issues closed as completed or pull requests merged in the last 90 days. A candidate filed before its fix lands can be placed, researched and staged again. The change adds fixed-before candidates, writes intake.duplicate_of, holds the item for at most 7 days, and lists the item as a person cause. It never closes or drops the item. The group due mark is out of scope because #4813 is closed as not planned.
Acceptance criteria
Requirement: Fixed-before candidate set
Intake SHALL add issues closed as completed and pull requests merged in the last 90 days to the duplicate-search candidate set with the same embeddings as the existing candidates.
Scenario: Completed issue and merged pull request are candidates
- WHEN A unit test calls the intake candidate builder with a fixed clock and a mocked GitHub search that returns one issue closed as completed and one pull request merged 89 days ago.
- THEN The test asserts that both numbers are in the candidate set and that the embedding request for each candidate has the same model and vector shape as an open item.
Requirement: Fixed-before test fails on the base
The change MUST add a test for the fixed-before flag before the implementation, and that test MUST fail on the base commit.
Scenario: New test fails on the base
- WHEN A person runs the new fixed-before flag test at the base commit.
- THEN The test fails because the base commit has no
intake.duplicate_ofwrite.
Requirement: Merged pull request duplicate flag
Intake SHALL write intake.duplicate_of on a candidate when the duplicate search matches a merged pull request that asks for the same change and changed the same path.
Scenario: Merged pull request asks for the same change on the same path
- WHEN A unit test runs intake on a candidate with a fixture merged pull request that asks for the same change, changed the same path, and has a duplicate score that passes the configured threshold.
- THEN The test asserts that the candidate's
intake.duplicate_offield equals the merged pull request number.
Requirement: Shared path alone does not flag
Intake MUST NOT write intake.duplicate_of when a merged pull request shares only a changed path with the candidate.
Scenario: Shared path only
- WHEN A unit test runs intake on a candidate with a fixture merged pull request that changed the same path and has a duplicate score below the configured threshold.
- THEN The test asserts that the candidate has no
intake.duplicate_offield.
Requirement: No close or drop
The intake duplicate step MUST NOT send a close request or drop a candidate that it flags.
Scenario: Flagged candidate stays open
- WHEN A unit test runs the intake duplicate step on a candidate that matches a merged pull request and records every GitHub client call.
- THEN The test asserts that the recorded calls contain no close or delete request and that the candidate stays in the backlog.
Requirement: Seven-day stage hold
Stage selection SHALL hold an item with intake.duplicate_of for at most 7 days after intake flags it.
Scenario: Hold ends after seven days
- WHEN A unit test advances a fixed clock from the flag time by 6 days and 23 hours, then by 1 hour.
- THEN The test asserts that stage selection returns the held item before the limit and returns no stage action after the limit.
Requirement: Inbox person cause
devops roadmap inbox SHALL list an item as a person cause after its 7-day duplicate hold ends.
Scenario: Expired hold appears in inbox
- WHEN A unit test builds the inbox with an item whose
intake.duplicate_offlag is 7 days and 1 hour old. - THEN The test asserts that the item appears under the person-cause section and not under the stage section.
Requirement: Pending a person after the merge
After the release, intake MUST run as the GitHub App on the new items of 7 days and on a replay of 10 items closed as completed, and a comment on the issue MUST give the result lines with each flag.
Scenario: Live proof after release
- WHEN A person runs the released
devops roadmap intakecommand as the App on the new items of 7 days and on a replay of 10 items closed as completed. - THEN The person posts a comment on the issue with one result line for each item, and each line names the item and its duplicate flag.
Existing Tool Considered
The alternatives check in the issue body records verdict none and no tool. The change reuses duplicate_eval.py and the embeddings index for similarity scoring. It builds the fixed-before candidate fetch, the flag write, the 7-day hold and the inbox cause in the intake and stage selection code. Build cost: 200,000 to 400,000 agent tokens and 0.5 to 1 day.
Key questions
- Which component owns the fixed-before search at filing time?: Intake owns the fixed-before search when it files a candidate. Issue feat(roadmap): detect already-merged issue changes in stage #4113 remains the stage check for a change that merges after intake. (best practice) [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
- Chosen: Intake plus feat(roadmap): detect already-merged issue changes in stage #4113. Intake catches a fix that merged before filing. feat(roadmap): detect already-merged issue changes in stage #4113 catches a merge after intake.
- Rejected: Intake only. It misses a change that merges after intake.
- Rejected: feat(roadmap): detect already-merged issue changes in stage #4113 only. It misses a fix that merged before intake.
- What does a duplicate match write, and does intake close the item?: Intake writes
intake.duplicate_ofon the candidate. It never closes or drops the item. A person decides what to do with the flag. (best practice) [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]- Chosen: Flag only. The owner rule on duplicates forbids an auto-close. A person decides.
- Rejected: Auto-close as duplicate. It violates the owner rule and can drop valid work.
- Rejected: Drop from intake. It loses the candidate record and the flag.
- How long does stage selection hold a flagged item, and what follows?: Stage selection holds the item for at most 7 days. After that,
devops roadmap inboxlists it as a person cause. A person decides the item. (best practice) [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]- Chosen: 7-day hold, then inbox. It bounds the wait and gives a person the decision.
- Rejected: Hold with no limit. A flagged item can wait with no limit.
- Rejected: No hold. It stages an item that a merged fix may already cover.
- Which candidate types and time window does the fixed-before search use?: The search adds issues closed as completed and pull requests merged in the last 90 days. It uses the same embeddings as the existing candidate set. (best practice) [sources: CONTEXT.md]
- Chosen: Completed issues and merged pull requests, 90 days. It covers a fix that merged before filing and keeps the search bounded.
- Rejected: Only completed issues. It misses a fix that merged as a pull request.
- Rejected: All closed issues and all pull requests. It adds old work and raises the search cost.
- What makes a merged pull request a duplicate match?: The candidate and the merged pull request must ask for the same change and share a changed path. The duplicate score must pass the configured threshold. A shared path alone is not a duplicate. (best practice) [sources: CONTEXT.md]
- Chosen: Same change, shared path, score threshold. It follows the duplicate definition and uses the path as evidence.
- Rejected: Shared path only. CONTEXT.md says a shared file does not make a duplicate.
- Rejected: Score only. It can flag a related item with a different path and no same change.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both detect already-merged work, but the candidate flags at intake filing time while #4113 checks at stage planning time.devops-cli-service commentedon Nov 18, 2026
Refine cannot set this item to Ready at d15dfcf while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 20, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 26, 2026
The result in the alternatives block of the issue body changed. Before this check:
in-use, tool https://github.com/qdrant/qdrant. A person decides what the new result means for the item.Searches (9)
Searches run:
Sources:
devops-cli-service commentedon Nov 27, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Dec 1, 2026
Scope change of 2026-12-01: #4813 (the
grouprow) is closed as not planned. So the criterion that makes the group check due for a flagged item does not apply. The fixed-before search, the 7-day hold and the inbox cause stay. After the hold, a person decides each flagged item.devops-cli-service commentedon Dec 1, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.