Skip to content

feat(roadmap): refine runs every hour and readies the new items of every planned release, nearest first, before that release starts #1515

Closed

Description

@dan-petty

Requested by the owner, 2026-10-09 (roadmap Service improvements).

Problem

Checked at release/v0.2.32 (a9d7fd8). The Service's schedule and logs and board 2 were read on 2026-10-09 (read-only).

The owner asked (2026-10-09):

Keep the next milestone that will be worked in a ready state before the release so that there is minimal delay in starting the next release, but we can still utilize our slow, background llm services

Today refine can't do that.

It has no cadence of its own.

  • The refine row (roadmap/run.py:646-651) has no interval. Refine runs only in a round where reprioritize succeeded, or where intake placed a P0 or a critical fix (_refine_cross_job, :387-394).
  • Reprioritize is due on a current-release change, or once a day (is_due, roadmap/reprioritize.py:2441). A change to an item in a planned release does not make it due.
  • In the 24 h to 2026-10-09 18:00Z, reprioritize failed in 4 rounds, and refine was skipped in each of them.

It looks one release ahead, then stops.

  • select_candidates (roadmap/refine.py:705-762) takes the New items of the next planned release only (_find_next_planned_release, :674-680).
  • It then takes New backlog items only while fewer than DEFAULT_ROADMAP_RELEASE_CAP items are Ready across the next planned release and the whole backlog (:756-758).
  • That count is 109 today (10 in the release, 99 in the backlog), so the backlog step never runs.
  • v0.2.33 has no New item. So the last Service refine round selected nothing and made no model call.

What waits as a result. None of these items has a refine section:

Refine looks at them only once v0.2.33 starts, and then 3 per run. A start sends an item that is still New to the backlog ((PLANNED, NEW_AT_START) -> TO_BACKLOG, reprioritize.py:364). v0.2.28's start did that to #857, #861 and #983.

The configured cap is ignored. plan_refine receives the repository's config but never reads release_cap. Refine uses the default constant instead.

Throughput is not the limit. One item takes about 7-12 min on the background model: two calls, research then proposal. At 3 an hour that is about 70 items a day, and releases now ship every 8-24 h (v0.2.29 to v0.2.31).

Proposed remedy

Two changes in two files. No new job, record or setting.

  1. An hourly cadence.
    • The refine row gets interval=timedelta(minutes=DEFAULT_ROADMAP_REFINE_INTERVAL_MINUTES) and first_run_due=True, and keeps its cross-job trigger. The new constant is 60, beside the intake and closure intervals in config/defaults.py.
    • A round with nothing to refine makes no model call, because plan_refine already returns early.
    • A round of 3 items keeps this repository's worker busy for about 20-35 min, as refine after reprioritize does today. Each repository has its own worker.
  2. Selection by place, nearest first. select_candidates takes items in this order, up to the limit of 3, and still skips unchanged items:
    1. New items in the current release: critical fixes and items a person placed there. This step covers what intake's refine hook was for; fix(roadmap): intake keeps the fields a person set on a card added during its planning #1404 deletes that hook.
    2. New items in each open planned release, nearest release first, by priority within each release.
    3. New P0 and P1 items in the backlog, by priority. This step finds none once feat(roadmap): reprioritize places every open p0 and p1 item in an open release, from the backlog and at a release start #882 keeps those items in releases.
    4. Other New backlog items, while fewer than the configured release_cap items are Ready across the next planned release and the backlog. This is today's rule, now with the config value.
  3. Docs:
    • the refine and run help texts (lang/en/help.py);
    • docs/commands/roadmap.md, regenerated;
    • the refine module docstring;
    • a changelog.d fragment.

Related:

Acceptance criteria

  • With no reprioritize run in the round, refine is due 60 min after its last success, and on a first run. devops roadmap run --dry-run names the interval as the reason (stub-table tests).
  • On the in-memory store, when the next planned release is all Ready and a later planned release holds New P1 items, refine selects the later release's items, highest priority first, up to 3.
  • A New critical fix in the current release is selected before any planned-release item.
  • A New P1 backlog item is selected before a New P2 backlog item. P2 and P3 backlog items are selected only while fewer than release_cap items, read from the config, are Ready across the next planned release and the backlog. One test sets release_cap = 3.
  • An item whose body and section are unchanged since its last refine is still skipped. A round that selects nothing makes no model call: the scripted gateway sees zero requests.
  • Tests are offline and each takes under 1 s. uv run devops ci passes.
  • Person check after deploy:
    • the Service's first refine round selects 3 of v0.2.34's New P1 items;
    • within a day, every New item in v0.2.34 and v0.2.35 has either a refine section or a refine comment naming its open question;
    • schedule.json shows refine's last success within the last 2 h.

Proposed design

Problem statement

The roadmap refine job has no cadence of its own: it runs only when reprioritize succeeds or intake places a P0/critical fix, and it selects only New items from the single next planned release. As a result, items in later planned releases and the backlog are never refined until the current release starts, and the configured release_cap is ignored in favour of a hard-coded constant. The owner needs the next milestone kept in a ready state before its release starts so that starting the next release causes minimal delay, while still using the slow background LLM services.

Acceptance criteria

  • Criterion 1: Refine is due on its own 60-minute interval independent of reprioritize, and on first run.
    Verification: Stub-table tests assert that devops roadmap run --dry-run names the 60-minute interval as the reason refine is due when reprioritize did not run in the round, and that a first run is due.
  • Criterion 2: When the next planned release is all Ready and a later planned release holds New P1 items, refine selects the later release's items, highest priority first, up to 3.
    Verification: In-memory store test: set the next planned release to all Ready, place New P1 items in a later planned release; assert select_candidates returns those items in priority order, capped at 3.
  • Criterion 3: A New critical fix in the current release is selected before any planned-release item.
    Verification: In-memory store test: place a New critical fix in the current release and New items in a planned release; assert the critical fix appears first in the candidate list.
  • Criterion 4: A New P1 backlog item is selected before a New P2 backlog item; P2 and P3 backlog items are selected only while fewer than the configured release_cap items are Ready across the next planned release and the backlog.
    Verification: In-memory store test with release_cap set to 3: place New P1 and P2 backlog items; assert P1 is selected first and P2 is selected only when the Ready count is below 3.
  • Criterion 5: An item whose body and section are unchanged since its last refine is still skipped; a round that selects nothing makes no model call.
    Verification: Test with an unchanged item asserts it is absent from the candidate list; test with no candidates asserts the scripted gateway sees zero requests.
  • Criterion 6: Tests are offline and each takes under 1 second; the full CI suite passes.
    Verification: uv run devops ci passes with all tests running offline and each individual test completing in under 1 second.
  • Criterion 7: After deploy, the Service's first refine round selects 3 of v0.2.34's New P1 items; within a day every New item in v0.2.34 and v0.2.35 has a refine section or a refine comment naming its open question; schedule.json shows refine's last success within the last 2 hours.
    Verification: Person inspects the Service logs, the project board, and schedule.json after deployment.

Key questions

None.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.
[end-marker]

Activity

  1. added
    type/feature
    scope/roadmap
    on Oct 9, 2026
  2. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. The owner explicitly requested it to reduce release-start delay, but it is a workflow improvement rather than a correctness or security defect.
    • Value: High. Without it, items in upcoming releases sit unrefined until the release starts, directly delaying every subsequent release.
    • Effort: Medium. Two files change (a new interval constant plus selection reordering), plus docs and a changelog fragment, but no new job, record, or schema is introduced.
  3. added this to the v0.2.33 milestone on Oct 9, 2026
  4. added
    priority/p1-high
    on Oct 9, 2026
  5. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Status set to Ready at 198a273 (see proposed design in issue body).

  6. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Owner finding, 2026-10-09: the Service sat idle while unrefined items looked Ready

    The research items #273-#278 (2 P0, 4 P1) were placed in v0.2.33 on 2026-10-09 with board Status Ready, yet none has ever been refined: no devops-roadmap-refine section, bodies of about 1 KB each. They have sat in the backlog since they lost their v0.3.x milestones on 2026-10-04 (the #739 migration also left their Status at Ready), and the Service was idle the whole time. Their v0.2.33 assessment then had to send them back.

    The owner's expectation: the Service keeps working, in small batches each interval, until every open item is prioritized (intake, delivered), every P0/P1 has an open milestone (#882), and every item in a planned release is ready to be worked before that release becomes current (this item). Two additions to this item's criteria:

    A release start still pulls only Ready items; with the first addition, Ready can no longer mean "never looked at".

  7. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Decisions before the build (2026-10-09)

  8. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1531, merged into release/v0.2.33 as 9acf127.

    Summary

    Refine had no cadence of its own and looked only one release ahead. It now runs every hour and works through every open release, nearest first.

    • Every hour. The refine row in DEFAULT_DUE_TABLE gets interval (new DEFAULT_ROADMAP_REFINE_INTERVAL_MINUTES = 60) and first_run_due=True, and keeps its cross-job trigger. A round with nothing to refine makes no model call.
    • Nearest place first. select_candidates takes up to --limit (default 3) items in this order, each place by priority:
      1. the current release's New items;
      2. each planned release's New items, nearest release first;
      3. the backlog's P0 and P1 items;
      4. the backlog's other New items, while fewer than the configured release_cap items are Ready. plan_refine now passes config.release_cap; before, it used the default constant.
    • Ready means refined (owner's 2026-10-09 decision). Steps 2 and 3 also take Ready items that have no refine record. Refine either confirms such an item Ready with a design, or sets it back to New with a comment that points at the proposed design's Key questions, Fit and Suspected block. The current release's Ready items are never taken.
    • An item refine can't refine takes no place. Selection runs check_person_edits on the body it already reads. An item whose section a person edited, or whose section hash differs from the record, is skipped before it takes a place. Without this, New items that hold a pre-fix(roadmap): refine writes its section's end marker, so a re-refined item keeps one design section instead of two #1470 [end-marker] section (feat(ai): syntopical dialectical synthesis engine (devops ai research syntopical) #273, docs: deduplicate docs, update references to v0.2.7, and expand v0.2.8 roadmap #27…

    13 file(s) changed.

    How it was verified

    Check runs at d9f2d79:

    • Prune PR DevContainer Images: pass
    • bandit: pass
    • devops-cli: pass
    • CodeQL: pass
    • Tests & Coverage: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Changed-Test Independence: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1515-refine-hourly-nearest-release-first.md:

    • With no reprioritize run in the round, refine is due 60 min after its last success, not at 59 min, and on a first run; devops roadmap run --dry-run prints Due: refine (tests/test_roadmap_run.py::test_refine_is_due_an_hour_after_its_last_success_and_on_a_first_run).
    • The dry run naming the interval as the reason is not built here, following the owner's 2026-10-09 decision on the issue: AC1 is proven through the due tuple, because a per-job reason line would reshape _Poll.is_due, the dry-run return and the MCP parse that feat(cli): reachable --dry-run previews for delegated commands #412 is changing.
    • The cross-job trigger is still tested on its own: the schedules of test_due_table_scenarios and test_order_and_cross_job_triggers pin refine's last success at 59 min, with the same expected tuples, and a new case with nothing else due gives (). test_idle_records_zero_or_one_store_calls pins refine at 30 min.
    • With the next planned release all Ready and a later planned release holding New P1 items, refine selects the later release's items, highest priority first, up to 3 (tests/test_roadmap_refine.py::test_a_later_planned_release_is_refined_once_the_next_one_is_ready).
    • A New critical fix in the current release is selected before a planned release's item of the same priority (test_a_critical_fix_in_the_current_release_goes_before_any_planned_item).
    • A New P1 backlog item is refined before a New P2 one, and P2 and P3 only while fewer than release_cap = 3, read from .github/roadmap.toml through plan_refine, are Ready across the next planned release and the backlog (test_backlog_p2_and_p3_wait_for_the_configured_release_cap, with 3 and 1 Ready items).
    • Items a real refine round left New are skipped as unchanged on the next round, which selects nothing and sends the scripted gateway no request (test_a_round_after_refine_left_items_new_skips_them_and_calls_no_model).
    • Ready items with no refine record are taken in a planned release and among the backlog's P0 and P1 items; the current release's, a recorded one and a lower-priority backlog one are not (test_ready_items_refine_never_saw_are_taken_in_planned_releases_and_backlog_p0_p1).
    • Such an item that refine finds not ready goes back to New with the back-to-New comment, and the next round skips it (test_a_ready_item_refine_finds_not_ready_goes_back_to_new_and_is_then_skipped).
    • A New backlog P1 whose section's hash differs from the record (an old [end-marker] section followed by refine's marked one) is skipped at selection with the person-edit reason, and the New item behind it gets the round's one place (test_an_item_refine_would_skip_for_a_person_edit_takes_no_place).
    • The existing selection tests (test_selection_next_release_backlog_priorities_and_cap, the _seed_new_items cases) pass unchanged. The new tests are offline, and each takes under 1 s.
    • uv run devops ci is the pull request's gate.
    • Pending a person: within a day after the Service runs the v0.2.33 image, while v0.2.35 is still a planned release, gh project item-list 2 --owner dan-petty --limit 1000 --format json --jq '.items[] | select(.milestone.title == "v0.2.35" and ((.status == "New" and (.content.body | contains("<!-- devops-roadmap-refine:end -->") | not)) or (.status == "Ready" and ((."job record" // "") | contains("refine.section_hash") | not)))) | .content.number' prints nothing: every New item in v0.2.35 holds a refine section, and every Ready one has a refine record. On 2026-10-09 it printed feat(ai): llm gateway tuning render and apply configuration with rollback #478, feat(cli): oci container image packaging, standardized metadata & ghcr package integration #438, feat(cli): outward-facing capability & upstream maturity survey #425, feat(cli): blind exception handling policy #423, feat(ai): synthetic prompt adversaries for injection resistance #417, feat(cli): structured fuzzing of parsers and schema boundaries #416, feat(cli): output format adoption across the command surface #411 and feat(cli): local-path provisioner volume reclaim failures #410.
    • Pending a person: kubectl -n devops exec deploy/roadmap-service -- cat /home/devops/.data/roadmap/dan-petty/devops-cli/schedule.json shows a refine time less than 2 h old. If it is older, kubectl -n devops logs deploy/roadmap-service -c service --since=2h | grep 'Refine skipped' names the item whose model call keeps failing (the first known limit below).
    • Pending a person: kubectl -n devops logs deploy/roadmap-service -c service --since=3h | grep -E "dan-petty/devops-cli: GraphQL|No repository starts a Service round" prints a spend line for each round and no pause line: the hourly refine rounds do not run the account's GraphQL points out.
  9. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Note (2026-10-09): with this item's hourly cadence, refine keeps the slow background model busy across all 8 repositories, and a repository's close and reprioritize wait behind its refine round (seen live today with the daily cadence: about 40 queued model calls held every repository's round for 40+ minutes). The fix is filed as the two-lane change linked below; it should land before or with this item reaching the Service.

  10. added a commit that references this issue on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/roadmaptype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions