Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ and excessive permissions fail it, and every other finding is shown. |
| | `devops roadmap retitle [OPTIONS]` | Shorten the title summary of open items that is over 60 characters. The job keeps the type and the scope. A Planned item takes the summary of its plan pull request title and needs no model call; another item gets one model call. The job leaves a title that a person changed after the last job comment. An item that the job leaves gets the mark retitle.skipped, and the job does not select it again until its title, body or plan pull request changes. Without --confirm, it prints the new titles and writes nothing. |
| | `devops roadmap consolidate [OPTIONS]` | Propose groups of open items that share a root cause, and write the plan to a local file. A model proposes and then tries to refute each shortlist, code checks the answers, and nothing changes on GitHub. Details: docs/roadmap/consolidate.md. |
| | `devops roadmap stage [OPTIONS]` | Make Ready items Staged: for each item, push a branch with its OpenSpec change in one commit and open a draft plan pull request. The Service marks the draft ready when its checks pass. Details: docs/roadmap/stage.md. |
| | `devops roadmap run [OPTIONS]` | Run the roadmap jobs that are due, in order: metrics, then intake, refine and the alternatives check, and record each one's last success. Intake is due on an issue reopened, and decides at most 5 candidates a run and keeps a record of those it left beside the schedule; refine is due every 17 minutes, on a first run, and after an intake that placed a critical fix or a P0 item; retitle is due every 61 minutes and on a first run; the alternatives check is due every 719 minutes and on a first run, and checks at most roadmap.alternatives.first_pass_limit items while an item has no check, and roadmap.alternatives.limit items after. Without --confirm, or with --dry-run, prints the due list and runs nothing. |
| | `devops roadmap run [OPTIONS]` | Run the roadmap jobs that are due, in order: metrics, then intake, refine and the alternatives check, and record each one's last success. Intake is due on an issue reopened or a new issue, and decides at most 5 candidates a run and keeps a record of those it left beside the schedule; refine is due every 17 minutes, on a first run, and after an intake that placed a critical fix or a P0 item; retitle is due every 61 minutes and on a first run; the alternatives check is due every 719 minutes and on a first run, and checks at most roadmap.alternatives.first_pass_limit items while an item has no check, and roadmap.alternatives.limit items after. Without --confirm, or with --dry-run, prints the due list and runs nothing. |
| | `devops roadmap implement [OPTIONS]` | Implement a Staged or Planned item in bounded steps: with --group, run one task group in a checkout; without it, run the job, which takes items, runs their steps, and marks the pull request ready. Details: docs/roadmap/implement.md. |
| | `devops roadmap plan-check [OPTIONS] <pull_request>` | Check a plan pull request: the stage gates without a model, the token size of each task group, the title, the body, the `Semantic PR title` check and a base spec that moved since the plan. Details: docs/roadmap/plan-check.md. |
| | `devops roadmap plan-recheck [OPTIONS]` | Check each change folder on the default branch again. Each folder gets one result: ok, rewrite, new-plan, delivered or cleanup, and each refusal names its gate. With --branch, list the refusals of each gate for the branch and the default branch, and mark each refusal that the branch adds as a case to review. A folder gets rewrite only when the mechanical rewrite of the plan fixes it. The command reads GitHub and git and calls no model. It writes no file unless you give --confirm. Details: docs/roadmap/plan-recheck.md. |
Expand Down
2 changes: 1 addition & 1 deletion docs/CLI_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6902,7 +6902,7 @@ devops roadmap stage [OPTIONS]

### `devops roadmap run`

**Run the roadmap jobs that are due, in order: metrics, then intake, refine and the alternatives check, and record each one's last success. Intake is due on an issue reopened, and decides at most 5 candidates a run and keeps a record of those it left beside the schedule; refine is due every 17 minutes, on a first run, and after an intake that placed a critical fix or a P0 item; retitle is due every 61 minutes and on a first run; the alternatives check is due every 719 minutes and on a first run, and checks at most roadmap.alternatives.first_pass_limit items while an item has no check, and roadmap.alternatives.limit items after. Without --confirm, or with --dry-run, prints the due list and runs nothing.**
**Run the roadmap jobs that are due, in order: metrics, then intake, refine and the alternatives check, and record each one's last success. Intake is due on an issue reopened or a new issue, and decides at most 5 candidates a run and keeps a record of those it left beside the schedule; refine is due every 17 minutes, on a first run, and after an intake that placed a critical fix or a P0 item; retitle is due every 61 minutes and on a first run; the alternatives check is due every 719 minutes and on a first run, and checks at most roadmap.alternatives.first_pass_limit items while an item has no check, and roadmap.alternatives.limit items after. Without --confirm, or with --dry-run, prints the due list and runs nothing.**

```bash
devops roadmap run [OPTIONS]
Expand Down
4 changes: 2 additions & 2 deletions docs/MCP_TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ The `devops-cli` FastMCP server exposes DevOps automation and AI review capabili
| [`review_stats`](#review-stats) | `true` | Compute and display review accuracy statistics across saved sessions. |
| [`roadmap_intake`](#roadmap-intake) | `false` | Turn each open issue with no priority label into a roadmap item, or file a new candidate: intake sets the labels, adds a reason comment and names a possible duplicate for a person to close. It writes nothing without --confirm. Details: docs/roadmap/intake.md. |
| [`roadmap_refine`](#roadmap-refine) | `false` | Refine roadmap items to Ready: investigate open questions with tools that read the code and the documentation, then write the design, tasks and acceptance criteria to GitHub. Without --confirm, refine prints its plan only. Details: docs/roadmap/refine.md. |
| [`roadmap_run`](#roadmap-run) | `false` | Run the roadmap jobs that are due, in order: metrics, then intake, refine and the alternatives check, and record each one's last success. Intake is due on an issue reopened, and decides at most 5 candidates a run and keeps a record of those it left beside the schedule; refine is due every 17 minutes, on a first run, and after an intake that placed a critical fix or a P0 item; retitle is due every 61 minutes and on a first run; the alternatives check is due every 719 minutes and on a first run, and checks at most roadmap.alternatives.first_pass_limit items while an item has no check, and roadmap.alternatives.limit items after. Without --confirm, or with --dry-run, prints the due list and runs nothing. |
| [`roadmap_run`](#roadmap-run) | `false` | Run the roadmap jobs that are due, in order: metrics, then intake, refine and the alternatives check, and record each one's last success. Intake is due on an issue reopened or a new issue, and decides at most 5 candidates a run and keeps a record of those it left beside the schedule; refine is due every 17 minutes, on a first run, and after an intake that placed a critical fix or a P0 item; retitle is due every 61 minutes and on a first run; the alternatives check is due every 719 minutes and on a first run, and checks at most roadmap.alternatives.first_pass_limit items while an item has no check, and roadmap.alternatives.limit items after. Without --confirm, or with --dry-run, prints the due list and runs nothing. |
| [`sandbox_deploy`](#sandbox-deploy) | `false` | Deploy an isolated background container sandbox with security containment. |
| [`sandbox_exec`](#sandbox-exec) | `false` | Execute a command inside an active sandbox container. |
| [`sandbox_network_policy`](#sandbox-network-policy) | `true` | Generate declarative Kubernetes NetworkPolicy YAML for workload sandbox isolation. |
Expand Down Expand Up @@ -1954,7 +1954,7 @@ Refine roadmap items to Ready: investigate open questions with tools that read t

### `roadmap_run`

Run the roadmap jobs that are due, in order: metrics, then intake, refine and the alternatives check, and record each one's last success. Intake is due on an issue reopened, and decides at most 5 candidates a run and keeps a record of those it left beside the schedule; refine is due every 17 minutes, on a first run, and after an intake that placed a critical fix or a P0 item; retitle is due every 61 minutes and on a first run; the alternatives check is due every 719 minutes and on a first run, and checks at most roadmap.alternatives.first_pass_limit items while an item has no check, and roadmap.alternatives.limit items after. Without --confirm, or with --dry-run, prints the due list and runs nothing.
Run the roadmap jobs that are due, in order: metrics, then intake, refine and the alternatives check, and record each one's last success. Intake is due on an issue reopened or a new issue, and decides at most 5 candidates a run and keeps a record of those it left beside the schedule; refine is due every 17 minutes, on a first run, and after an intake that placed a critical fix or a P0 item; retitle is due every 61 minutes and on a first run; the alternatives check is due every 719 minutes and on a first run, and checks at most roadmap.alternatives.first_pass_limit items while an item has no check, and roadmap.alternatives.limit items after. Without --confirm, or with --dry-run, prints the due list and runs nothing.

**Annotations:** `readOnlyHint: false`

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ devops roadmap stage [OPTIONS]

## `devops roadmap run`

**Run the roadmap jobs that are due, in order: metrics, then intake, refine and the alternatives check, and record each one's last success. Intake is due on an issue reopened, and decides at most 5 candidates a run and keeps a record of those it left beside the schedule; refine is due every 17 minutes, on a first run, and after an intake that placed a critical fix or a P0 item; retitle is due every 61 minutes and on a first run; the alternatives check is due every 719 minutes and on a first run, and checks at most roadmap.alternatives.first_pass_limit items while an item has no check, and roadmap.alternatives.limit items after. Without --confirm, or with --dry-run, prints the due list and runs nothing.**
**Run the roadmap jobs that are due, in order: metrics, then intake, refine and the alternatives check, and record each one's last success. Intake is due on an issue reopened or a new issue, and decides at most 5 candidates a run and keeps a record of those it left beside the schedule; refine is due every 17 minutes, on a first run, and after an intake that placed a critical fix or a P0 item; retitle is due every 61 minutes and on a first run; the alternatives check is due every 719 minutes and on a first run, and checks at most roadmap.alternatives.first_pass_limit items while an item has no check, and roadmap.alternatives.limit items after. Without --confirm, or with --dry-run, prints the due list and runs nothing.**

```bash
devops roadmap run [OPTIONS]
Expand Down
11 changes: 11 additions & 0 deletions docs/roadmap/intake.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ A write of GitHub can fail for one candidate, for example with a status 502. Int

The Service keeps the failure in its intake record, beside `schedule.json`, and not in the job record of the issue. The issue is a candidate, not an item, so it gets no mark. The record holds the step (`place`), the failure class (`ci_infra` for an error of GitHub), the count of failures in a row and the time of the last one. The next rounds leave the candidate out until the wait of the class has passed (`RETRY_AFTER` in `roadmap/failure.py`: 1 hour for `ci_infra`). They make no triage call and no embedding call for it, and the candidate does not make intake due. After the wait, intake decides the candidate again. A candidate that is placed, closed or no candidate any more loses its entry. A change that a person made to the Item while the job worked is no failure and leaves no entry. A webhook update of the issue keeps the wait, and `devops roadmap intake` keeps no record, so it waits for nothing.

## When the Service runs intake

The Service runs intake as the row `intake` of the triage lane. A webhook delivery of `issues` `opened`, `edited` or `reopened` runs intake of its one issue at once (ADR 0017). The poll runs the whole job when one of these is true:

- The last run is 29 minutes old or older.
- An issue reopened since the last run.
- The last run left a fresh candidate.
- The repository has an issue newer than the newest issue that a run saw.

The issue events report no opened issue, so the poll reads the newest issue from the first page of the issue listing, newest first, 10 entries a page. The read is conditional, so a page that did not change costs a 304. A pull request does not count. An issue that 10 or more newer pull requests push off the page waits for the 29-minute interval. The intake record keeps the newest issue that a run saw, as it was when the run started. A scoped update does not change it, so the poll still runs intake when a delivery of an older issue was lost. When a scoped update already decided the new issue, the run does not decide it again and sends no model request for it.

## The three modes

| Flag | What the run does |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
schema: spec-driven
created: 2026-11-11
skip_specs: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Design

## Decisions

- **The issue listing, not the issue events.** The events report no opened issue (proposal, Feasibility). The rule compares the newest issue number with the number that the intake record keeps, so it does not depend on the clock of the pod.
- **The record keeps the newest issue as the round starts.** `_run_intake_adapter` reads the newest issue before `plan_intake` lists the candidates. An issue that opens during the round is newer than the record, so the next poll runs intake again. That round decides nothing that was decided.
- **A scoped update does not move `newest`.** If it did, the scoped update of issue 11 would hide issue 10 when the delivery of issue 10 was lost. So the poll after a scoped update runs intake once. That run finds the new issue decided and sends no model request for it.
- **A lazy read.** The rule reads the newest issue only when no reopened issue and no fresh candidate makes intake due, and only when the record has a newest issue. `run_due_jobs` caches the read for the round, and a round with no trigger makes no read, as before.
- **Pull requests do not count.** The listing holds pull requests too. The store reads one page of 10 entries and takes the first entry that is no pull request. A page of only pull requests gives None, and the store asks for no later page, so a repository with only pull requests never reaches the page cap of the session.
- **No newest issue on the record means no read.** A record from before this change, or one that no intake round wrote, keeps the old rule until the next intake round. The row's interval brings that round within 29 minutes.

## Rejected alternatives

- **`ChangeKind.OPENED` from the issue events.** GitHub does not report it in that feed.
- **The creation time of the newest issue against the last success of intake.** It needs no new record field, but a pod clock that runs ahead of GitHub can hide an issue that opened during the round.
- **`per_page=1`, following pages until an issue.** A run of new pull requests costs one request each, and a repository with only pull requests reads up to the page cap and raises.
- **Count every new pull request too.** Agents open many pull requests a day, and each one would cost an intake round that reads every issue.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Proposal: #4540

## Why

Intake is due only on a `REOPENED` change or on a fresh candidate that the last round left. The change feed reads the repository issue events, and these events report no opened issue. So when the scoped update of a new issue is lost (no replica during a rollout, or a lost queue entry), the new issue waits for the intake interval of 29 minutes. Closes #4540.

## What Changes

- `RoadmapStore.newest_issue_number()` gives the number of the newest issue that is no pull request. The GitHub store reads it from the first page of `issues?state=all&sort=created&direction=desc&per_page=10`, which the session sends with the ETag of its last answer.
- The intake record keeps `newest`: the newest issue when the last intake round started.
- The intake due rule reads the newest issue when nothing else makes intake due, and makes intake due when that issue is newer than the record's `newest`.
- A scoped update keeps `newest` as it was, so a lost delivery of an older issue still makes intake due.
- `docs/roadmap/intake.md` tells when the Service runs intake, and the help of `devops roadmap run` names the new issue.

## Capabilities

- `roadmap-scoped-updates`: adds the requirement "A new issue makes intake due at the next poll".

## Impact

- One more GitHub request for each poll of each repository on the triage lane, when the record has a newest issue and nothing else makes intake due: 7 repositories every 300 s is about 84 an hour. Most of them are 304 answers, which GitHub does not count against the primary rate limit.
- One more request at the start of each intake round, which the session also sends with its ETag.
- After the deploy, the record has no `newest` until the next intake round writes it. Until then, the rule makes no read and intake keeps the old rule.
- An issue that 10 or more newer pull requests push off the first page waits for the 29-minute interval, as today.

## Feasibility

- The issue events do not report an opened issue. `devops gh api 'repos/{owner}/{repo}/issues/4540/events?per_page=100' --jq '[.[].event] | unique'` gave `["labeled","parent_issue_added","unlabeled"]` for the issue that opened on 2026-11-11. The repository feed `issues/events?per_page=100` gave no `opened` kind either. So `ChangeKind.OPENED` cannot come from this feed, and the change uses the issue listing.
- The issue listing sorts by creation time: `devops gh api 'repos/{owner}/{repo}/issues?state=all&sort=created&direction=desc&per_page=30'` gave the newest 30 entries, 24 of them issues and 6 pull requests, newest first.
- `GitHubSession.paginate` sends each page that links a next page with `If-None-Match`, and gives back the kept items on a 304 (`src/devops_cli/github/session.py`).

## Existing Tool Considered

The GitHub REST issue listing with `sort=created` and the session's conditional reads cover the need. No new tool or library. Cost: about 50,000 tokens and 2 hours to build, about 2,000 tokens a month to keep, about 5,000 tokens to fix.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## ADDED Requirements

### Requirement: A new issue makes intake due at the next poll
The poll SHALL run intake when the repository has an issue newer than the newest issue that the intake record keeps, also before intake's interval. An intake round SHALL keep the newest issue as the round starts. A scoped update SHALL keep it as it was. A newer pull request SHALL not make intake due.

#### Scenario: The delivery of a new issue is lost
- **WHEN** intake decided candidate 1, candidate 2 opens, no scoped update runs for it, and a poll comes five minutes later
- **THEN** the poll runs intake and the model judges candidate 2

#### Scenario: A new pull request
- **WHEN** a pull request opens after the last intake round, and no issue opens
- **THEN** the next poll runs no intake

#### Scenario: The scoped update decided the new issue
- **WHEN** the scoped update of new candidate 2 decided it, and a poll comes four minutes later
- **THEN** the poll runs intake, the model judges nothing in that round, and the poll after it runs no intake
Loading
Loading