Repository navigation
Description
Problem or Motivation
The alternatives row runs on items that can wait for weeks (the model-lane row takes 719 min for a pass), so its result is old when stage runs. References (#4672) has no unit. Refine has no barrier, so it can run again after each research result. The approved pipeline split design (tracker #5482) runs one research unit for each item, just in time.
Proposed Solution & Architectural Design
- One research unit for each item, with the semaphore
research1, so research never holds an agent slot. - Due just in time: the items in the next stage window (about 30 items in the stage selection order) and P0 items that have no result for the current outside hash. The 30-day alternatives recheck runs only in the window.
- Steps: 1 alternatives (feat(roadmap): run each alternatives check in its own pod #4573), 2 references (feat(roadmap): link reference implementations in each checked item #4672). Each step writes
research.<step>with itsatand the outside hash, and has its own mode. feat(roadmap): research checks project standards and suggests changes #5514 adds steps 3 and 4. - Refine barrier: refine is due when each research step for the current outside hash has a result or a typed failure, and one is newer than
refine.at. - A token cap for each item, from the measured cost (D9: the owner approves it).
- The unit uses the two-container template of feat(roadmap): the model container of a unit holds no credential #5506.
- Start only when the stage and implement funnel steps reach band 70, and after feat(roadmap): the model container of a unit holds no credential #5506.
Target Subsystem
Roadmap Service and roadmap jobs (src/devops_cli/roadmap/, the research unit).
Acceptance Criteria
- Test first:
due_jobsselects only the window items and P0 items. The test fails on the base. - A test: refine is not due until each step has a result or a typed failure.
- A test: a refine write makes no research step due.
- Live proof: after the merge and the release, the unit runs as the App in mode
planon the next 5 items of the stage window. A comment on this issue gives the result lines withtokensandcost_usd_microsfor each step.
Existing Tool Considered
alternatives.py, stage_references.py, page_fetch.py and SearXNG exist, and Argo semaphores are installed. Build: 300,000 to 600,000 agent tokens and 1 to 1.5 days.
Related
Tracker #5482, Phase 6. Depends on #4573, #4672, #5512, #5506 and #5504. #4676, #4682, #4864, #4960, #5049, #4624, #2951.
Source: #5482
Alternatives check of 2026-11-30: in-use.
The repository already uses this tool.
Tool: Argo Workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-11-29, maintained.
Reason: Argo Workflows, which the project already uses, supplies the semaphore, the step order and the pod template. No tool supplies the stage-window due selection, the outside-hash freshness or the refine barrier.
Covers:
- Semaphore that limits concurrent workflows
- DAG and step dependencies in one workflow
- Pod template for a two-container step
Lacks:
- Selection of stage-window and P0 items only
- Per-step record keyed by the outside hash
- Refine barrier over all research steps
Proposed design
Problem statement
The alternatives row can wait weeks, so its result is old when stage runs. References has no unit. Refine has no barrier, so it can run again after each research result. The change adds one research unit for each item, with just-in-time due rules, per-step result records, and a refine barrier.
Acceptance criteria
Requirement: Research due selection
The roadmap due selector SHALL select only next-stage-window items and P0 items with no current-hash result, and SHALL run the 30-day alternatives recheck only in the window.
Scenario: Window and P0 items are due
- WHEN
due_jobsruns on a fixture with 30 stage-window items, one P0 item with no current-hash result, one P1 item outside the window, and one 30-day recheck item outside the window. - THEN It returns the 30 window items and the P0 item, and no other item.
Requirement: Research step result record
Each research step SHALL write a research.<step> record with its at time and the current outside hash.
Scenario: Alternatives step writes its record
- WHEN The alternatives step completes for an item with outside hash H.
- THEN The
research.alternativesrecord holds the completion time and H.
Requirement: Refine barrier
The refine due check SHALL return true only when every research step for the current hash has a result or typed failure and one result is newer than refine.at.
Scenario: A missing step result blocks refine
- WHEN One research step for the current outside hash has no result and no typed failure.
- THEN The refine due check returns false.
Requirement: Refine write does not trigger research
A refine write SHALL NOT set any research step due mark.
Scenario: Refine write leaves research due marks clear
- WHEN Refine writes its result for an item after all research steps are current.
- THEN No
research.<step>due mark exists for that item.
Requirement: Pending a person after the merge
The released research unit MUST run as the App in mode plan on the next 5 items of the stage window.
Scenario: Live plan-mode run
- WHEN After the merge and the release, a person runs the released unit as the App in mode
planon the next 5 items of the stage window. - THEN The live proof shows one result line for each step with
tokensandcost_usd_micros, and the issue comment holds them.
Existing Tool Considered
The alternatives check in the issue body records in-use for argoproj/argo-workflows (Apache-2.0, maintained). The repository already uses Argo Workflows. The block lists what the tool covers and lacks. The proposal uses Argo Workflows for the covered parts. It adds the per-item due rules, outside-hash freshness, typed failures and refine barrier as roadmap code in src/devops_cli/roadmap/. The token cap is deferred to a separate issue.
Key questions
- Which tool runs the research unit's semaphore, step order and pod template?: Use argoproj/argo-workflows. The alternatives check in the issue body records
in-use. Argo Workflows supplies the covered parts that the block lists. The roadmap code adds the per-item due rules, outside-hash freshness, typed failures and refine barrier. (best practice) [sources: CONTEXT.md, AGENTS.md, src/devops_cli/roadmap/alternatives.py]- Chosen: argoproj/argo-workflows. The repository already uses it. It covers the semaphore, step order and pod template. The alternatives check records in-use.
- Rejected: temporalio/temporal. It adds a durable workflow engine for a small per-item scheduler and does not remove the custom due rules.
- Rejected: custom scheduler. It rebuilds semaphore and step dependencies that Argo Workflows already provides.
- How does
due_jobschoose the research window?: It selects the next stage window, about 30 items in stage selection order, plus P0 items with no result for the current outside hash. The 30-day alternatives recheck runs only in the window. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/fix_checks_row.py:5]- Chosen: Stage window plus P0. It keeps research just in time and still covers critical items.
- Rejected: All items. It runs research on items that can wait for weeks and spends tokens early.
- Rejected: Fixed interval only. It makes the result old when stage runs.
- How does a research step record its result and failure?: Each step writes
research.<step>with itsattime and the current outside hash. A typed failure writes the same key with a failure class and no result. The refine barrier treats the typed failure as complete. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/fix_checks_row.py:5]- Chosen: Valkey
research.<step>record. Valkey already holds the due marks and shared roadmap state. - Rejected: Issue comment. A comment is not machine state and is slow to read.
- Rejected: Separate database table. It adds a store where Valkey already holds the state.
- Chosen: Valkey
- When is refine due after research?: Refine is due when every research step for the current hash has a result or typed failure, and one result is newer than
refine.at. (best practice) [sources: CONTEXT.md]- Chosen: All steps current and one newer than
refine.at. It prevents refine from running before every step is current and still lets it run after new research. - Rejected: Any step newer than
refine.at. It lets refine run before all steps finish. - Rejected: Fixed interval after the last step. It can run on old results or wait after a current result.
- Chosen: All steps current and one newer than
- How does a refine write avoid making research due?: A refine write updates
refine.atonly. It sets noresearch.<step>due mark. (best practice) [sources: CONTEXT.md]- Chosen: Update
refine.atonly. It stops the refine-research loop. - Rejected: Recompute all research due marks. It makes research due after each refine write.
- Chosen: Update
- Which pod template runs the research unit?: Use the two-container template from feat(roadmap): the model container of a unit holds no credential #5506. (best practice) [sources: CONTEXT.md]
- Chosen: The feat(roadmap): the model container of a unit holds no credential #5506 two-container template. It reuses the runner sandbox and the template the issue names.
- Rejected: A new template. It duplicates the runner sandbox and adds maintenance.
Fit
Fits in one pull request.
Suspected block
Stage and implement funnel steps reach band 70.
Dependencies
#4573, #4672, #5512, #5506, #5504
Watched files
A commit on the default branch that changes one of these files starts the next refine round.
src/devops_cli/roadmap/job_funnel.py
Activity
dan-petty commentedon Nov 13, 2026
Both concern how alternatives and refine interact in the roadmap, but #2652 adds a daily alternatives row to the model lane while the candidate designs a per-item research unit with just-in-time due and a refine barrier.devops-cli-service commentedon Nov 17, 2026
Alternatives check: in-use
Reason: Searches found no research-unit tool; Argo Workflows, the project's existing engine and semaphore source, supplies semaphore-limited concurrency and step dependencies, but the per-item due rules, hash freshness and token caps stay custom.
The repository already uses this tool.
Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-11-17, maintained.
Covers:
research1 caps concurrent research unitsLacks:
refine.atSearches (7)
Tools considered:
Searches run:
Sources:
A person decides what this check of 2026-11-17 means for the item.
devops-cli-service commentedon Nov 18, 2026
Refine cannot set this item to Ready at 86358b6 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 27, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.