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
1 change: 1 addition & 0 deletions docs/CLI_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6798,6 +6798,7 @@ devops roadmap intake [OPTIONS]
| `--source` | `string` | - | Link the new candidate came from, such as the item it splits or the review that found it; the filed body ends with it. Intake never names the issue that this link names, or a sub-issue of that issue, as a possible duplicate of the candidate. |
| `--filed-by` | `choice (agent|person)` | `agent` | Who files the new candidate: an agent's is labeled source/agent; a person's is not. |
| `--limit` | `integer` | - | Decide at most this many candidates, the oldest first, and leave the rest for a later run. Without it, intake decides every candidate. It keeps no record of what it decided; the intake that devops roadmap run and the Service run keeps one, so a candidate it left undecided waits behind the fresh ones. |
| `--full` | `boolean` | - | Read the whole issue listing and replace the snapshot of it under the data directory. Without it, a run reads only the issues changed since the snapshot. |
| `--dry-run` | `boolean` | - | Make no request, to GitHub or a model: print the requests a run makes, in order, with placeholders for values a read gives. |
| `--plan` | `boolean` | - | Read GitHub and call the model, print each planned change and what the run spent, and write nothing. Intake without a mode flag does this. |
| `--confirm` | `boolean` | - | Plan as --plan does, then make the writes on GitHub. |
Expand Down
1 change: 1 addition & 0 deletions docs/MCP_TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,7 @@ Turn each open issue with no priority label into a roadmap item, or file a new c
| `source` | `string` | No | - | Link the new candidate came from, such as the item it splits or the review that found it; the filed body ends with it. Intake never names the issue that this link names, or a sub-issue of that issue, as a possible duplicate of the candidate. |
| `filed_by` | `string (agent, person)` | No | `agent` | Who files the new candidate: an agent's is labeled source/agent; a person's is not. |
| `limit` | `integer` | No | - | Decide at most this many candidates, the oldest first, and leave the rest for a later run. Without it, intake decides every candidate. It keeps no record of what it decided; the intake that devops roadmap run and the Service run keeps one, so a candidate it left undecided waits behind the fresh ones. |
| `full` | `boolean` | No | `False` | Read the whole issue listing and replace the snapshot of it under the data directory. Without it, a run reads only the issues changed since the snapshot. |
| `dry_run` | `boolean` | No | `False` | Make no request, to GitHub or a model: print the requests a run makes, in order, with placeholders for values a read gives. |
| `plan_only` | `boolean` | No | `False` | Read GitHub and call the model, print each planned change and what the run spent, and write nothing. Intake without a mode flag does this. |
| `confirm` | `boolean` | No | `False` | Plan as --plan does, then make the writes on GitHub. |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ devops roadmap intake [OPTIONS]
| `--source` | `string` | - | Link the new candidate came from, such as the item it splits or the review that found it; the filed body ends with it. Intake never names the issue that this link names, or a sub-issue of that issue, as a possible duplicate of the candidate. |
| `--filed-by` | `choice (agent|person)` | `agent` | Who files the new candidate: an agent's is labeled source/agent; a person's is not. |
| `--limit` | `integer` | - | Decide at most this many candidates, the oldest first, and leave the rest for a later run. Without it, intake decides every candidate. It keeps no record of what it decided; the intake that devops roadmap run and the Service run keeps one, so a candidate it left undecided waits behind the fresh ones. |
| `--full` | `boolean` | - | Read the whole issue listing and replace the snapshot of it under the data directory. Without it, a run reads only the issues changed since the snapshot. |
| `--dry-run` | `boolean` | - | Make no request, to GitHub or a model: print the requests a run makes, in order, with placeholders for values a read gives. |
| `--plan` | `boolean` | - | Read GitHub and call the model, print each planned change and what the run spent, and write nothing. Intake without a mode flag does this. |
| `--confirm` | `boolean` | - | Plan as --plan does, then make the writes on GitHub. |
Expand Down
13 changes: 13 additions & 0 deletions docs/roadmap/intake.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ devops roadmap eval jev --from-shadow

The command reads every issue of the repository (GitHub reads, no model request, no write). For each field it prints how often Jev and the `triage` model agree, how often each equals the label the issue holds now, how often only one of them does, and how often Jev is right in each band of its probability (below 60%, 60 to 75%, 75 to 90%, 90% and above). For the duplicate it counts the flags of each model against the issues that GitHub shows closed as a duplicate. The final label is a weak truth: intake writes the `triage` label, and a label that no person changed counts as final. Read the columns "only Jev" and "only triage" first.

## The issue listing

Intake compares each candidate with every item and with every issue closed as not planned, so each run needs every issue of the repository. `devops roadmap intake` keeps a snapshot of the issue listing in `roadmap/listing/<owner>/<name>.json` under the data directory. The snapshot holds the parsed record of each issue and pull request, the version of devops-cli that wrote it, the time of its last full read and a watermark.

- A run reads only the issues and pull requests that changed since the watermark: `state=all`, `sort=updated`, `direction=desc` and `since=<watermark>`. Each changed issue replaces its record, so intake parses only the bodies of the changed issues. When 100 or fewer issues changed, the read is one request.
- The new watermark is the earlier of the start of the read and the newest `updated_at` that GitHub gave, less 60 seconds. Thus a local clock ahead of GitHub's clock skips no change.
- GitHub does not move the `updated_at` of a parent when a sub-issue joins or leaves it. A changed issue that joined or left a parent moves the sub-issue count of that parent by one.
- A run reads the whole listing and writes a new snapshot when no snapshot is kept, when the snapshot cannot be read, when another version wrote it, when its last full read is 24 hours old or older, and on `--full`. The full read removes an issue that left the repository.
- The snapshot is a copy of GitHub, which stays the source of truth. A snapshot that intake cannot read or write gives a warning. A failed write keeps the earlier file, because intake writes a temporary file and renames it.

The Service does not use the snapshot: its poll reads the whole listing. `SnapshotStore` in `src/devops_cli/roadmap/stores/listing_snapshot.py` is the seam for a store that the Service can share.

## A failed write

A write of GitHub can fail for one candidate, for example with a status 502. Intake skips that candidate, places the others, and then the run fails and names it.
Expand Down Expand Up @@ -110,6 +122,7 @@ The Service keeps the failure in its intake record, beside `schedule.json`, and
| Duplicate verdict, report lines, no close, retry of a stopped run, the source of a part | [roadmap-intake-duplicates](../../openspec/specs/roadmap-intake-duplicates/spec.md) |
| Type and scope labels from the title | [roadmap-intake-title-labels](../../openspec/specs/roadmap-intake-title-labels/spec.md) |
| The reply of the model | [roadmap-intake-reply-schema](../../openspec/specs/roadmap-intake-reply-schema/spec.md) |
| The snapshot of the issue listing and the read of the changed issues | [roadmap-intake-listing](../../openspec/specs/roadmap-intake-listing/spec.md) |
| Intake of one issue on an `issues` event of GitHub | [roadmap-scoped-updates](../../openspec/specs/roadmap-scoped-updates/spec.md) |
| Jev for the proposal fields, and the comparison with the `triage` model | [roadmap-intake-jev](../../openspec/specs/roadmap-intake-jev/spec.md) |
| The evaluation of the duplicate verdict | `devops roadmap eval intake`, in [roadmap-intake-duplicates](../../openspec/specs/roadmap-intake-duplicates/spec.md) |
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,20 @@
# Design

## Decisions

- **Snapshot and `since`.** The CLI keeps one JSON file for each repository under the data directory, `roadmap/listing/<owner>/<name>.json`. A run reads the issues changed since the watermark and merges them into the snapshot. A file for each repository keeps a write for one repository away from the record of another.
- **Order of the changed read.** `sort=updated&direction=desc`. The listing is paged by offset, and an issue that changes during the read moves to the first page, which the read has. No issue that did not change moves out of a page that the read has not reached.
- **Watermark.** The earlier of the start of the read and the newest `updated_at` that GitHub gave, less 60 seconds. The start of the read covers a change during the read. GitHub's own time covers a local clock that is ahead of GitHub's, as a WSL2 clock can be after a sleep. The overlap costs at most a few issues on the first page.
- **Version and age.** The snapshot holds the version of devops-cli that parsed the records. Another version reads the whole listing, because the parse of a body or the known keys of a job record can change between versions. A snapshot whose last full read is 24 hours old or older is read in full, so an issue that was deleted or transferred, or a change that moved no `updated_at`, stays at most one day.
- **Sub-issue count.** GitHub does not move the `updated_at` of a parent when a sub-issue joins or leaves it (#4517 timeline, 2026-11-11). When a changed issue joined or left a parent that the read did not return, the merge moves the count of that parent by one. Intake leaves an issue with sub-issues out of the comparison set (#1985), so a stale count of zero would let a tracker in.
- **Failures.** A snapshot that cannot be read gives a warning and a full read. A failed write gives a warning, and the rename keeps the earlier file whole; the listing that the run read is complete, so the run goes on.
- **Seam.** `SnapshotStore` (`load`, `save`) is the place that keeps the snapshots. `FileSnapshotStore` is the CLI's. A shared store for the Service (#4517) implements the same two methods. `IncrementalListing` holds the policy, and `GitHubRoadmapStore` takes it as `listing`; `get_roadmap_store` passes it to an installed factory too.
- **Scope.** Only `devops roadmap intake` passes a listing. The Service poll and `devops roadmap run` keep the full read (ADR 0017: the poll reconciles).

## Rejected alternatives

- **gidgethub `cache=` on disk, or hishel.** The default listing order is by creation, newest first, so each new issue moves every page and changes each ETag; on 2026-11-11, 47 issues changed in one hour. The 45 pages pass through the rate limiter, which paces a 304 too, and neither cache keeps a parsed record, so the parse of every body stays.
- **`direction=asc`, as the refine section proposed.** An issue that changes during a read of more than one page moves to the end, the later pages move back by one, and one issue that did not change is skipped. Its `updated_at` is before the next watermark, so no later run reads it until the next full read.
- **The end time of the read, or only the newest `updated_at`, as the watermark.** The end time misses an issue that changed during the read. The newest `updated_at` alone misses an issue that changed during a full read on a page that the read had read.
- **A snapshot in the session cache only.** It does not survive the process, which is the cause of the item.
- **Start empty when no snapshot is kept.** Each issue would look new, and intake would compare a candidate with nothing.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Proposal: #4448

## Why

#4448: each `devops roadmap intake` run reads the full `state=all` issue listing of the repository again. The GitHub session keeps the ETag of each page only in memory (#1692), and a CLI run is a new process. On 2026-11-11, the listing phase of one `--plan` call took 67.0 s and 46 requests (46 pages, about 4,500 issues and pull requests), of a 346.6 s call. The #4404 timing table shows a median of 163 s for this phase, the body parse included.

## What Changes

- `devops roadmap intake` keeps a snapshot of the issue listing in `roadmap/listing/<owner>/<name>.json` under the data directory. The snapshot holds the parsed record of each issue and pull request, the version of devops-cli that wrote it, the time of the last full read and a watermark.
- A run reads only the issues changed since the watermark (`state=all&sort=updated&direction=desc&since=<watermark>`), and each changed issue replaces its record. So intake parses only the bodies of the changed issues.
- The new watermark is the earlier of the start of the read and the newest `updated_at` that GitHub gave, less 60 seconds.
- A changed issue that joined or left a parent moves the sub-issue count of that parent by one, because GitHub does not move the `updated_at` of the parent.
- A run reads the whole listing and replaces the snapshot when no snapshot is kept, when it cannot be read, when another version wrote it, when its last full read is 24 hours old or older, and on the new `--full` option.
- The snapshot is written through a temporary file and a rename. A snapshot that cannot be read or written gives a warning that names the file.
- `--dry-run` lists the read of the changed issues and the full read, each with its condition.
- `SnapshotStore` is the seam of the place that keeps the snapshots. The CLI uses a file. The shared store of the Service (#4517) can plug in later. The Service and `devops roadmap run` keep the full read.
- A command option, its output and its requests change, so the change has a spec delta: the new capability `roadmap-intake-listing`.
- The change fits one pull request.

## Capabilities

### New Capabilities

- `roadmap-intake-listing`: the snapshot of the issue listing and the read of the changed issues.

### Modified Capabilities

None.

## Impact

- `src/devops_cli/roadmap/stores/listing_snapshot.py` (new), `src/devops_cli/roadmap/stores/github_store.py`, `src/devops_cli/roadmap/stores/store.py`, `src/devops_cli/roadmap/request_plan.py`
- `src/devops_cli/commands/roadmap.py`, `src/devops_cli/roadmap/intake/intake.py`, `src/devops_cli/roadmap/intake/intake_requests.py`
- `src/devops_cli/config/defaults.py`, `src/devops_cli/lang/en/help.py`, `src/devops_cli/lang/en/messages.py`
- `docs/roadmap/intake.md`, `docs/commands/roadmap.md`
- A new file under the data directory of each workstation that runs intake: about 5 MB for each 1,000 issues and pull requests, because it holds each body (22.8 MB for this repository on 2026-11-11).

## Feasibility

- GitHub REST documentation, "List repository issues": `since` shows only the issues and pull requests updated at or after the time; `sort` takes `updated`; `direction` takes `asc` or `desc`. A probe on 2026-11-11 (`devops gh api "repos/<repo>/issues?state=all&sort=updated&direction=desc&since=<1 hour ago>&per_page=100"`, devops-cli 0.111.0) gave 47 entries on one page, the newest first.
- The listing is paged by offset. With `direction=desc`, an issue that changes during the read moves to the first page, which the read has; so no unchanged issue moves out of a page that the read has not reached. With `asc`, a change during a read of more than one page moves the later pages back by one, and one issue that did not change is skipped and not read again. So the plan uses `desc`, not the `asc` of the refine section.
- Sub-issues, 2026-11-11: the timeline of #4517 shows `sub_issue_added` at 06:34:19, 06:51:36 and 06:56:48, but its `updated_at` stays 06:31:21. So a parent's count needs the adjustment from its changed sub-issues.
- gidgethub 6.0.0 `cache=` takes any mutable mapping, so a disk store could keep the conditional answers. But the default listing order is by creation, newest first, so each new issue moves every page and changes its ETag. A run then gets no 304 after any new issue, and the 45 pages still pass through the rate limiter, which paces a 304 too (`session_transport.py`).
- The new tests fail on the base: the module and the `--full` option do not exist.

## Existing Tool Considered

- The REST `since` parameter is the open tool that covers the incremental read. The change uses it.
- gidgethub's `cache` mapping, kept on disk: rejected, see Feasibility. It keeps no parsed record either, so the parse of about 4,500 bodies stays.
- hishel, an HTTP cache for httpx: rejected for the same reasons. It still walks every page and keeps no parsed record.
- The snapshot store is built: about 180 lines of source and 300 lines of tests; about 150,000 tokens and 3 hours to build, and about 10,000 tokens a month to keep and fix. The JSON file and the atomic write use the existing `write_bytes_file`, and the records use the existing pydantic `IssueRecord`.
- The change deletes no internal code.
Loading