Repository navigation
Description
Problem Statement
Split out of #741 (feat(k8s): deploy the roadmap service to the homelab). #741 had two halves that share no code: a Python scheduler with its own tests, and a set of manifests, release tooling and a setup guide. The owner's decision (Q2) kept the homelab deployment in #741 and made the scheduler this item, the last merge of v0.2.26; on 2026-10-03 #741 became the in-cluster runtime and the deployment moved to #1083. The Deployment (#1083) lands first against #752's log-only job function and is proven on the cluster before any job exists; this item needs the jobs' rows (#740 from v0.2.25; #742, #743 and #744 from v0.2.26), so it lands after all of them.
The roadmap jobs change issues and the board with no person present. They have to run when they are due:
- reprioritization (feat(github): current release admission, cap, descoping and stall rules (
devops roadmap reprioritize) #740) on every change to the current release; - intake (feat(github): single-entry item intake with duplicate detection and placement (
devops roadmap intake) #742) at least hourly; - closure (feat(release): item closure summaries, generated changelog and automatic release cut (
devops roadmap close) #743) when a PR merges; - refinement (feat(ai): item refinement to ready with proposed decisions (
devops roadmap refine) #744) after reprioritization.
Run by hand, they run only when someone remembers, and that is how the current release kept growing (#739). Nothing runs them today. The devops roadmap group exists at HEAD with migrate and render only (src/devops_cli/commands/roadmap.py:69, :103, landed by #739 in 6948e1c); there is no run. devops serve (src/devops_cli/commands/serve.py:35-57, src/devops_cli/server/app.py:118-122) mounts health, status, workspace, telemetry and stream routers, but no webhook route and no queue; #752 adds those.
What the items this one builds on define (checked at HEAD of release/v0.2.25, 9c879ae, and in their refined bodies):
- feat(cli): service mode for
devops servewith github webhooks, a polling tick and per-repo job queues #752 (service mode).create_service_app(job=...)takes the job function. Its contract isCallable[[str, TriggerBatch], None]: the repo asowner/nameand a frozenTriggerBatchexported fromserver/service.pyholdingrepo,counts: dict[tuple[str, str, str], int]keyed by(source, event, action)(sourceiswebhookorpoll;eventandactionare empty strings forpoll),first_atandlast_at. The function runs synchronously on the repo's thread; a job that raises is logged and counted indevops_cli_service_jobs_total{repo,result="error"}, and the queue goes on. Triggers that arrive during a run merge into one pending batch. The polling tick queues apolltrigger for every managed repo at startup and everyservice.poll_interval_seconds(default 300) and reads nothing from GitHub. Webhook events sent byservice.machine_account(compared withsender.login) are dropped at the route. Until this item lands,devops serve --servicepasses a function that logs the batch and changes nothing. - refactor(github): one github session per identity owning token, quota and transport #767 (one GitHub session). A process has one identity:
gh auth tokenruns once,GH_TOKENis pinned on everyghandgitsubprocess, andsession.loginis read lazily. In the service, feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741'sdevops-cliSecret supplies the machine account's token asGH_TOKEN; in a terminal, the session is the logged-in person's. - feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083 (deployment, on feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741's runtime in namespace
devops). The service runs as one replica with--workers 1,HOME=/home/devopson the PVC,DEVOPS_CLI_DATA_DIR=/home/devops/.data, a read-only root filesystem, and/tmpas an emptyDir (feat(release): production service image for scheduled jobs and webhook handlers #753). Its guide's last step tells a person to usedevops roadmap run --dry-runfrom a terminal while the service runs. - refactor(github): roadmap store that reads and writes items, releases and board fields behind one interface #768 (the store, landed in bf746de).
changes_since(since)(src/devops_cli/roadmap/store.py:485; GitHub adapter src/devops_cli/roadmap/github_store.py:531-548; in-memory src/devops_cli/roadmap/memory_store.py:339) takes the cutoff as an argument and reads the repository's issue events, newest first, stopping at the cutoff. AChange(store.py:169-179) carrieskind,number,actor,at,releaseandlabel.ChangeKind(store.py:72-80) has six values, mapped from the eventsmilestoned,demilestoned,labeled,unlabeled,closedandreopened(CONST_GH_ISSUE_EVENT_CHANGE_KINDS, src/devops_cli/config/constants.py:717-724); events on pull requests give no change (github_store.py:169-173). So the store reports no "issue opened", no "pull request merged" and no board-field change. Job records live in each card'sJob recordfield (CONST_GH_PROJECT_JOB_RECORD_FIELD, constants.py:716); the GitHub adapter writes no local file (grep -n 'write_text\|open(\|cursor' src/devops_cli/roadmap/github_store.pyprints nothing).InMemoryRoadmapStore(memory_store.py:94) takes aclockand anactor, andas_actor(:131) gives the same roadmap written by a person. - Paths. Config and data paths come from
DEVOPS_CLI_CONFIGandDEVOPS_CLI_DATA_DIR(src/devops_cli/config/env.py:11, :88). The data directory defaults to.datarelative to the working directory (DEFAULT_DATA_DIR, src/devops_cli/config/defaults.py:30).CONST_FORBIDDEN_SYSTEM_DIRS(constants.py:185-193) lists/etc,/usr,/bin,/sbin,/var,/sysand/proc, andclone_repo(src/devops_cli/git/operations.py:195) refuses a destination under them (_validate_clone_dest, :170-185).fetch_all(:202) swallows a failed fetch, so the clone step needs a fetch that reports failure. - The group's conventions.
RepoOption(--repo/-R, roadmap.py:43) and_open_roadmap(:57) resolve the checkout's origin and fail with "pass --repo owner/name" (:61).migratetakes--confirmand--dry-run(:73-74) and writes only whenconfirmis set and neither--dry-runnor the global dry run is (:87). Help strings live inRoadmapCommandHelp(src/devops_cli/lang/en/help.py:857-882). The MCP mirrorsroadmap_render(src/devops_cli/ai/mcp/server.py:628) androadmap_migrate(:643-648, which always passes--dry-run) sit in theroadmaplazy domain (src/devops_cli/ai/mcp/dispatcher.py:60) and are pinned by tests/test_fastmcp_contracts.py:1342 (test_the_roadmap_tools_build_the_commands_argv) and tests/test_docs_mcp_argv_collector.py:129 (test_every_mcp_server_argv_resolves). - ADR 0003. Polling is how the service sees changes; a webhook only makes a job due sooner, and a missed one only delays a job until the next tick. ADR 0002. Every job acts as the machine account, and a job never reverts a person's change. CONTEXT.md:121 names the Service as the deployment that runs the jobs when they are due, as found by webhook or by polling.
Proposed Solution
devops roadmap run is the one place that decides what is due. It holds a due table as data, runs the due jobs in a fixed order, passes each job's changes as triggers to the jobs after it, keeps each job's last successful run time per repo in the data directory, and keeps one clone per managed repo for the jobs that need code. #752's per-repo worker calls the same function with the batch it queued; a terminal run runs it with a poll batch. Both read what changed through the store (changes_since) and act as the session's identity (#767). The MCP mirror roadmap_run only reports the due list.
The work lives in a new module src/devops_cli/roadmap/run.py (the table, the state file, the clone step and run_due_jobs), a run subcommand in src/devops_cli/commands/roadmap.py, a service_job adapter that devops serve --service passes to create_service_app(job=...) in place of #752's log-only function, and the MCP mirror in src/devops_cli/ai/mcp/server.py.
Scope
-
Command.
runjoinsmigrateandrenderin src/devops_cli/commands/roadmap.py. It reuses the group'sRepoOption(--repo/-R, :43, defaulting to the checkout's origin and failing with "pass --repo owner/name" at :61) and_open_roadmap(:57), and takes--dry-runand--confirmas feat(github): github-sourced roadmap, migration and generated roadmap view (devops roadmap migrate,render) #739 defined them (:73-74, :87): without--confirm, or with--dry-run, it prints the due list and runs nothing; with--confirmit runs the due jobs. Help strings go inRoadmapCommandHelp(src/devops_cli/lang/en/help.py:857-882); the generated reference docs (docs/commands/roadmap.md, docs/CLI_REFERENCE.md, docs/MCP_TOOLS.md) are regenerated. -
Inputs of one run. The clock; the repo's state file; the batch (
TriggerBatch.countskeys, or{("poll", "", ""): 1}for a terminal run); and, when any row needs them, the store'sChanges since the oldest last-success time among the rows, read once per run and filtered per row. Changes whoseactoris the session's login (refactor(github): one github session per identity owning token, quota and transport #767) are dropped before any row is evaluated: feat(cli): service mode fordevops servewith github webhooks, a polling tick and per-repo job queues #752 drops the machine account's webhook events at the route, and this is the poll-side twin, so a job's own writes never make it due again on the next tick (feat(github): current release admission, cap, descoping and stall rules (devops roadmap reprioritize) #740's rule, for both paths). -
Due table. One table, held as data in
run.py, with one row per job: its name, the interval after which it is due again (or none), the batch keys that make it due, the change kinds that make it due and for which items, and the jobs earlier in the same run whose outcome makes it due:- intake (feat(github): single-entry item intake with duplicate detection and placement (
devops roadmap intake) #742): no recorded run; 60 minutes since its last successful run (DEFAULT_ROADMAP_INTAKE_INTERVAL_MINUTES = 60in src/devops_cli/config/defaults.py next toDEFAULT_ROADMAP_*, :739-746); a batch key("webhook", "issues", "opened")or("webhook", "issues", "reopened"); or aREOPENEDchange. An issue opened while a webhook was missed is found by the hourly run, because intake lists the open issues not yet on the board itself. - closure (feat(release): item closure summaries, generated changelog and automatic release cut (
devops roadmap close) #743): a batch key("webhook", "pull_request", "closed"), or 60 minutes since its last successful run (the same default), because the store reports no merge and feat(release): item closure summaries, generated changelog and automatic release cut (devops roadmap close) #743 reads the merged PRs itself. A missed webhook therefore delays a closure by at most an hour. - reprioritization (feat(github): current release admission, cap, descoping and stall rules (
devops roadmap reprioritize) #740): feat(github): current release admission, cap, descoping and stall rules (devops roadmap reprioritize) #740's triggers as the store reports them: aJOINED_RELEASE,LEFT_RELEASE,LABELED,UNLABELED,CLOSEDorREOPENEDchange whose item is in the current release, or whosereleaseis the current release; a batch key for themilestonesevent (a release starts, is cut or ships), or for("webhook", "pull_request", "closed")(a release PR merged); and, within one run, a closure outcome that closed a current-release item. - refinement (feat(ai): item refinement to ready with proposed decisions (
devops roadmap refine) #744): reprioritization ran in this run, or intake's outcome in this run placed a critical fix or a P0 feature.
Rows exist only for jobs that have landed when this item merges. As the last merge of v0.2.26, that is expected to be all four (feat(github): current release admission, cap, descoping and stall rules (
devops roadmap reprioritize) #740 ships in v0.2.25; feat(github): single-entry item intake with duplicate detection and placement (devops roadmap intake) #742, feat(release): item closure summaries, generated changelog and automatic release cut (devops roadmap close) #743 and feat(ai): item refinement to ready with proposed decisions (devops roadmap refine) #744 land earlier in v0.2.26). If a job has not landed by then, its row is left out, the matching due-table test is left out, and that job adds its own row in its own PR, sorunnever calls a job that does not exist. A job landing later (feat(ai): roadmap discovery from advisories, alerts, repo signals and web research (devops roadmap discover) #745) adds its own row. - intake (feat(github): single-entry item intake with duplicate detection and placement (
-
Order. Within one run the order is intake, closure, reprioritization, refinement. Each job's outcome (the
Changes it made, and for intake the items it placed as a critical fix or P0 feature) is passed as triggers to the rows after it in the same run. A job is never triggered again by its own changes (feat(github): current release admission, cap, descoping and stall rules (devops roadmap reprioritize) #740): rows before it in the run never see them, and the actor filter drops them from the next poll. -
Job adapters. Each row holds one adapter, written in
run.py, that calls the job's function with the store, the triggers and (for closure and refinement) the clone path, which feat(release): item closure summaries, generated changelog and automatic release cut (devops roadmap close) #743 takes as--rootand feat(ai): item refinement to ready with proposed decisions (devops roadmap refine) #744 as--source, and returns aJobOutcome(the changes made, the items placed for refinement). The jobs keep their own signatures; the adapters are this item's code. -
State. One file per repo,
<data dir>/roadmap/<owner>/<name>/schedule.json, holds the time of each job's last successful run. That time is also the cutoff for the changes the job sees next, so there is no separate poll cursor. A job with no recorded run other than intake takes the run's start time as its cutoff; it does not replay history. If a job fails, its time is unchanged, so it is due again on the next tick and sees the same changes again. The other jobs still run. When any job failed,run_due_jobsraisesRoadmapRunErrornaming the failed jobs after every row ran: the CLI prints it and exits 1, and in the service feat(cli): service mode fordevops servewith github webhooks, a polling tick and per-repo job queues #752 logs and counts it indevops_cli_service_jobs_total{result="error"}. -
Checkouts. The clone of each repo lives at
<data dir>/roadmap/<owner>/<name>/clone, so in the service it sits under/home/devops/.dataon the PVC, underHOMEand never under/var(feat(release): production service image for scheduled jobs and webhook handlers #753,CONST_FORBIDDEN_SYSTEM_DIRS). Before closure or refinement runs,runclones the repo if the directory is missing, fetchesoriginand resets the clone hard toorigin/release/vX.Y.Zfor the current release, and sets the clone'suser.nametosession.loginanduser.emailto<login>@users.noreply.github.com(refactor(github): one github session per identity owning token, quota and transport #767; in the service, the machine account). feat(release): item closure summaries, generated changelog and automatic release cut (devops roadmap close) #743 commits and cuts from this clone, and feat(ai): item refinement to ready with proposed decisions (devops roadmap refine) #744 reads code from it. A failed clone or fetch fails only the jobs that need the clone; intake and reprioritization still run. The fetch is agit fetchsubprocess whose non-zero exit is an error, notfetch_all(operations.py:202), which swallows it. -
No changes or prompts of its own.
runchanges nothing on GitHub itself: every change, and the reason comment for it, comes from a job.--dry-runlists the due jobs with the reason each is due and runs nothing. The service calls the function, not the CLI, so no job waits on a flag or a prompt. -
Callers.
service_job(repo: str, batch: TriggerBatch) -> Noneinrun.pyopens the store forrepoand callsrun_due_jobswith the batch's keys;devops serve --servicepasses it tocreate_service_app(job=...)(feat(cli): service mode fordevops servewith github webhooks, a polling tick and per-repo job queues #752) in place of the log-only function. From a terminal,run --confirmcallsrun_due_jobswith apollbatch; both paths read changes throughchanges_sinceand act as the session's identity. -
MCP mirror.
roadmap_run(repo: str | None = None)in src/devops_cli/ai/mcp/server.py, next toroadmap_render(:628) androadmap_migrate(:643-648), always passes--dry-run, returns the due list and runs nothing. It joins theroadmaplazy domain (src/devops_cli/ai/mcp/dispatcher.py:60) and the argv tests feat(github): github-sourced roadmap, migration and generated roadmap view (devops roadmap migrate,render) #739 added (tests/test_fastmcp_contracts.py:1342, tests/test_docs_mcp_argv_collector.py:129). -
Changelog fragment
changelog.d/981.md; task filedocs/agent/tasks/task-#981-roadmap-run.md. CHANGELOG.md and docs/ROADMAP.md are not edited.
Key Questions
- What makes each job due, and who adds the rows? Answered: one table held as data, as listed above. This item adds the rows for every job that has landed when it merges; being the last merge of v0.2.26, that is expected to be all four. A job that lands later adds its own row, so
runnever calls a job that does not exist. - How does one job's change reach another? Answered: by passing outcomes inside one run, in the fixed order. feat(cli): service mode for
devops servewith github webhooks, a polling tick and per-repo job queues #752 drops the machine account's own webhook events, and every job acts as the machine account, so without this reprioritization would never see an item that closure closed. - What does a poll see, given that
changes_sincereads issue events only? Answered: the sixChangeKinds (store.py:72-80), which cover milestone, label, close and reopen changes. The store reports no "issue opened", no "pull request merged" and no board-field change, so the table gives intake and closure an hourly interval, and the webhook keys cut the latency. A board Status or Priority change makes nothing due by poll with the store at HEAD; ADR 0003 names that feed, and it belongs to the job whose triggers need it (feat(github): current release admission, cap, descoping and stall rules (devops roadmap reprioritize) #740 lists status and priority changes), not to this item. The person check for a missed webhook therefore uses a milestone change, which the store does report. - Where is the poll cursor? Answered: it is each job's last-success time in
schedule.json. One timestamp per job per repo gives a failed job the same changes again and a successful one only new changes, with no second cursor to keep in step.runreadschanges_sinceonce per run, from the oldest cutoff among the rows that need changes. - How are a job's own changes kept from making it due again on the next tick? Answered: changes whose
actoris the session's login are dropped before the rows are evaluated, mirroring feat(cli): service mode fordevops servewith github webhooks, a polling tick and per-repo job queues #752's webhook rule. In a terminal the dropped actor is the person's, so a terminal run never reacts to the person's own changes; the service is what runs the jobs. - Does
runtake--repothe waymigrateandrenderdo? Answered: yes. The group already definesRepoOption(roadmap.py:43) and_open_roadmap(:57, :61).runreuses both; the service always passes the repo explicitly, so the default only affects terminal use. - What do
--dry-runand--confirmdo? Answered: what they do formigrate(:87). Without--confirm, or with--dry-runor the global dry run,runprints the due list and runs nothing; with--confirmit runs the due jobs. This is also what makes a terminal run safe beside the service: a person who forgets a flag changes nothing. - What does a terminal run do while the service runs? Answered: use
--dry-run. A terminal run acts as the logged-in person (refactor(github): one github session per identity owning token, quota and transport #767), so under ADR 0002 its changes count as that person's and stand. Two runs at once would also change the same repo concurrently. - Where do the clones live, and whose name is on them? Answered: under the data directory,
<data dir>/roadmap/<owner>/<name>/clone, so one setting (DEVOPS_CLI_DATA_DIR) places the state file and the clone for both callers, and in the service both sit on the PVC underHOME. The clone'suser.nameanduser.emailcome fromsession.login, which in the service is the machine account. - How does a failed job reach feat(cli): service mode for
devops servewith github webhooks, a polling tick and per-repo job queues #752's metrics? Answered:run_due_jobsruns every row, then raisesRoadmapRunErrornaming the failed jobs. feat(cli): service mode fordevops servewith github webhooks, a polling tick and per-repo job queues #752 logs the exception and adds 1 tojobs_total{result="error"}; the CLI exits 1. Nothing is lost: the failed job's cutoff did not move. - Can the MCP mirror run jobs? Answered: no; it only reports the due list. An agent running jobs would act as the person's identity and race the service.
- Why is this the last merge of v0.2.26? Answered: every row's job has then landed, so this item adds all four rows with their tests and no job adds a row later in the release; and the deployment (feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083) is already running the log-only function, so the person checks below run on the deployed service.
Acceptance Criteria
In the gate. These tests touch no network (tests/conftest.py:99 prevent_external_network_calls) and no cluster. They use InMemoryRoadmapStore (memory_store.py:94) with a fixed clock, stub jobs in place of the adapters, isolate_data_dir (conftest.py:271) for the state file, and structural tuple assertions. Together they add under 1 s to uv run devops ci, checked with uv run pytest tests/test_roadmap_run.py --durations=0.
- Due table. tests/test_roadmap_run.py asserts the ordered tuple of jobs that ran: no batch keys, intake last ran 59 minutes ago:
(); 61 minutes ago:("intake",); no recorded run:("intake",); a batch key("webhook", "issues", "opened"), and aREOPENEDchange:("intake",)each; aCLOSEDchange on a current-release item, intake not due:("reprioritize",); aLABELEDchange on an item outside the current release, intake not due:(); aCLOSEDchange whoseactoris the store's actor:(); a batch key("webhook", "pull_request", "closed"):("close", "reprioritize")when the stub closure closes a current-release item,("close",)when it closes nothing; one case per row of refinement:("reprioritize", "refine")and("intake", "refine")when the stub intake places a critical fix. Rows for jobs that have not landed are left out of the table and the test. - Webhook or poll. A
REOPENEDchange gives("intake",)whether the batch is{("webhook", "issues", "reopened"): 1}or{("poll", "", ""): 1}, and the store sees onechanges_sincecall in each case, with the oldest cutoff among the rows. Test: tests/test_roadmap_run.py. - Order and cross-job triggers. With a stub table of four jobs: all four due gives
("intake", "close", "reprioritize", "refine"); a stub closure that closes a current-release item makes reprioritization run in the same call; a stub intake that places a critical fix makes refinement run in the same call; a stub reprioritization that changes an item does not run again in that call, and a second call whose store reports that change with the store's actor gives(). Test: tests/test_roadmap_run.py. - Failure. When a stub job raises: the jobs after it still run;
run_due_jobsraisesRoadmapRunErrornaming that job; its last-run time inschedule.jsonis unchanged, and a second call runs it again with the same changes;devops roadmap run --confirmunderCliRunnerexits 1 and prints the job's name. Test: tests/test_roadmap_run.py. - State file. After a run,
<data dir>/roadmap/<owner>/<name>/schedule.jsonholds the clock's time for each job that succeeded and nothing for one that failed; a run that follows reads it back, so intake is not due 30 minutes later. Test: tests/test_roadmap_run.py. - Checkouts. A unit test with a temporary bare remote under
tmp_pathchecks that the clone is created at<data dir>/roadmap/<owner>/<name>/clone, ends at the tip oforigin/release/vX.Y.Zafter the remote moved, and has the session's login asuser.nameand<login>@users.noreply.github.comasuser.email; with the remote path removed, the closure and refinement stubs are not called, intake and reprioritization are, and the run raisesRoadmapRunErrornaming the two. Test: tests/test_roadmap_run.py. - Idle. A call with no batch keys and intake not due records zero store calls. A
pollbatch with intake not due and no changes records exactly onechanges_sincecall. Test: tests/test_roadmap_run.py. - No prompt. Every stub job is called without a confirmation argument, checked on the arguments each stub records.
devops roadmap rununderCliRunnerwith no input prints the due list and calls no stub;--confirmcalls the due stubs;--dry-run --confirmcalls none. Test: tests/test_roadmap_run.py. - Service wiring.
create_service_appreceivesservice_jobwhendevops serve --servicestarts (patcheduvicorn.run, the pattern of tests/test_server.py:227);service_job("owner/name", batch)opens the store for that repo (theroadmap_storefixture, conftest.py:325, records it) and passes the batch's keys torun_due_jobs. Test: tests/test_roadmap_run.py. - MCP mirror.
roadmap_runreturns the due tuple, no stub job records a call, and the in-memory store'sitems(),cards()andcomments_on()are the same before and after; its argv carries--dry-runand no--confirm. Tests: tests/test_roadmap_run.py, tests/test_fastmcp_contracts.py (test_the_roadmap_tools_build_the_commands_argv) and tests/test_docs_mcp_argv_collector.py (test_every_mcp_server_argv_resolves). - Help.
uv run devops roadmap --helplistsrun, and tests/test_all_commands_help_dryrun.py:89 (test_all_registered_subcommands_have_help) covers it;uv run devops docs checkpasses with the regenerated docs. - Shared files untouched. The PR adds
changelog.d/981.mdand does not change CHANGELOG.md or docs/ROADMAP.md:devops pr check-readinesspasses. -
uv run devops cipasses within its 5-minute budget.
Checks a person runs on the homelab (context homelab-k3s), on the service #1083 deployed in namespace devops, after pointing it at this item's branch image (kubectl -n devops set image deploy/roadmap-service service=ghcr.io/dan-petty/devops-cli/service:pr-981) or at the v0.2.26 tag. In the task file these are Pending a person: bullets with the exact commands.
- Pending a person, Identity: open a test issue in a managed repo. Within 5 minutes,
gh issue view <n> -R <owner>/<repo> --json comments --jq '.comments[-1].author.login'prints the machine account's login, and the item's Value and Effort are set on the board (intake estimates them with the gateway models, feat(github): single-entry item intake with duplicate detection and placement (devops roadmap intake) #742, so this shows the gateway works through devops-cli's own client). Then close the issue as not planned. - Pending a person, Missed webhook: in the repo's webhook settings, clear "Active". Add a test issue to a milestone, which the store reports as
joined_release. Within 10 minutes,kubectl -n devops logs deploy/roadmap-service --since=10mshows a poll for that repo that reports the change and the job it made due. Then set the webhook active again. - Pending a person, Restart: note the last intake time in the logs, then run
kubectl -n devops rollout restart deploy/roadmap-service. After the pod is Ready,kubectl -n devops exec deploy/roadmap-service -- cat /home/devops/.data/roadmap/<owner>/<repo>/schedule.jsonshows that time, and intake does not run again within an hour of it. That one copy runs at a time during the restart is feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083's Rollout check. - Pending a person, Rate budget: after a quiet hour, run in the pod, so the token never leaves the cluster:
kubectl -n devops exec deploy/roadmap-service -- python -c 'import json, os, urllib.request as u; r = u.Request("https://api.github.com/rate_limit", headers={"Authorization": "Bearer " + os.environ["GH_TOKEN"]}); d = json.load(u.urlopen(r, timeout=10))["resources"]; print(d["core"]["used"], d["graphql"]["used"])'. It prints two numbers under 2,500, half of a classic token's 5,000 per hour.
Constraints
runmakes no change to GitHub itself; every change comes from a job.- A missed webhook only delays a job until the next tick (ADR 0003): intake and closure by at most an hour, reprioritization by at most one poll interval.
- A job's own changes never make it due again, by webhook or by poll.
- In steady state, the service uses less than half of the token's hourly REST and GraphQL limits.
- The state file and the clones live under the data directory, never under
CONST_FORBIDDEN_SYSTEM_DIRS. - New in-gate tests cost under 1 s together.
Out of Scope
- The jobs themselves: feat(github): current release admission, cap, descoping and stall rules (
devops roadmap reprioritize) #740, feat(github): single-entry item intake with duplicate detection and placement (devops roadmap intake) #742, feat(release): item closure summaries, generated changelog and automatic release cut (devops roadmap close) #743, feat(ai): item refinement to ready with proposed decisions (devops roadmap refine) #744.runcalls them and adds nothing to them. - Rows for jobs that have not landed when this item merges; each later job adds its own row (feat(ai): roadmap discovery from advisories, alerts, repo signals and web research (
devops roadmap discover) #745, and any of the four descoped past this item). - A store feed for board-field changes (Status, Priority);
changes_sincereads issue events only, and the job whose triggers need it adds it (feat(github): current release admission, cap, descoping and stall rules (devops roadmap reprioritize) #740). - The homelab deployment: manifests, monitoring policy, release-tag bump, setup guide, and the rollout, exposure, egress and scrape checks (feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083); the namespace, Secret and config (feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741).
- The webhook route, queues, probes and metrics (feat(cli): service mode for
devops servewith github webhooks, a polling tick and per-repo job queues #752); the image (feat(release): production service image for scheduled jobs and webhook handlers #753); the GitHub session and theGH_TOKENpin (refactor(github): one github session per identity owning token, quota and transport #767). - The Tavily key and setting (feat(ai): item refinement to ready with proposed decisions (
devops roadmap refine) #744) and Prometheus egress for discovery (feat(ai): roadmap discovery from advisories, alerts, repo signals and web research (devops roadmap discover) #745). - Turning the rate check into a metric (feat(github): github api request and throttle counters for the devops-cli dashboard #814).
- Any GitHub workflow that holds the machine account's token (fix(ci): only collaborators can trigger pr updates with
/updateor/synccomments #754 must land first). - Edits to CHANGELOG.md and docs/ROADMAP.md (changelog fragment instead).
Dependencies
- Landed at HEAD: feat(github): github-sourced roadmap, migration and generated roadmap view (
devops roadmap migrate,render) #739 (devops roadmapgroup,RepoOption,--dry-run/--confirm,.github/roadmap.toml; 6948e1c) and refactor(github): roadmap store that reads and writes items, releases and board fields behind one interface #768 (the store,InMemoryRoadmapStore,changes_since; bf746de). - Depends on: feat(github): current release admission, cap, descoping and stall rules (
devops roadmap reprioritize) #740 (v0.2.25; reprioritization's triggers and the no-self-trigger rule) and feat(github): single-entry item intake with duplicate detection and placement (devops roadmap intake) #742 (v0.2.26 since 2026-10-03, starts first; intake). docs/ROADMAP.md:1075 and :1079 are unchecked andgit log --oneline | grep -E '#(740|742)\b'prints nothing at 9c879ae. Their rows are the table's minimum. They are outside the v0.2.26 and v0.2.27 set the planning run holds, so they are named here and not in the structured dependency list, as feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741's verdict did. - Depends on, v0.2.26: feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083 (the deployment this item's function runs in, and the service the person checks run against), feat(cli): service mode for
devops servewith github webhooks, a polling tick and per-repo job queues #752 (create_service_app(job=...),TriggerBatch, the tick and the queues), refactor(github): one github session per identity owning token, quota and transport #767 (session.login, theGH_TOKENpin onghandgit). None has commits at HEAD. - Sequenced before this item in v0.2.26, not dependencies: feat(release): item closure summaries, generated changelog and automatic release cut (
devops roadmap close) #743 (its row and the clone it cuts from) and feat(ai): item refinement to ready with proposed decisions (devops roadmap refine) #744 (its row and the clone it reads). This item is the last merge of v0.2.26 and adds both rows if they have landed; either that has not adds its own row in its own PR. - Related: feat(ai): roadmap discovery from advisories, alerts, repo signals and web research (
devops roadmap discover) #745 (discovery row), feat(mcp): mcp tools declare ToolAnnotations, and mutating tools require approval in devops-cli's own agent loop #857 and fix(mcp): mcp tools refuse coerced arguments before they run, with prescriptive errors that never echo values #862 (annotations and argument checks forroadmap_run), fix(mcp): mcp tools and resources call commands and options that exist #836 (MCP tools call commands that exist), feat(github): github api request and throttle counters for the devops-cli dashboard #814 (rate check as a metric), fix(ci): only collaborators can trigger pr updates with/updateor/synccomments #754 (v0.2.27, must land before any workflow holds the token). - Design: CONTEXT.md:121 (Service), ADR 0001, ADR 0002, ADR 0003.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 3, 2026
The service now runs in namespace
devops(#1083, split from #741 on 2026-10-03), and the person checks usekubectl -n devops. This item depends on #1083 instead of #741; #742 is now a v0.2.26 item.feat(roadmap): job scheduling, due table evaluation, and checkout man…
feat(roadmap): job scheduling, due table evaluation, and checkout man…
dan-petty commentedon Oct 4, 2026
What changed
#1173, merged into
release/v0.2.26as bfd5b6c.20 file(s) changed.
How it was verified
Check runs at f7174fb:
Acceptance Criteria of
docs/agent/tasks/task-981-roadmap-run.md:tests/test_roadmap_run.py::test_due_table_scenariosasserts the ordered tuple of jobs that ran across intervals (59m idle, 61m due), first-run without schedule, batch keys, issue reopen events, issue closure on current release, unlabeled/outside-release events, store actor changes, closure item outcomes, and refinement triggers.tests/test_roadmap_run.py::test_webhook_or_poll_identical_and_oldest_cutoffverifies that both webhook and poll trigger batches identify the sameREOPENEDtrigger with exactly onechanges_sincecall using the oldest cutoff among rows.tests/test_roadmap_run.py::test_order_and_cross_job_triggersverifies 4-job stub table execution order (intake,close,reprioritize,refine), cross-job triggering from closure to reprioritize and intake to refine, and self-trigger prevention on second call.tests/test_roadmap_run.py::test_failure_isolation_and_cli_exitverifies that a failed stub job does not prevent subsequent due jobs from executing, leaves the failed job's cutoff time unchanged inschedule.json, raisesRoadmapRunErrornaming the failed jobs, and causes CLI underCliRunnerto exit 1 and report the failed job.tests/test_roadmap_run.py::test_state_file_persistenceverifies persistence inschedule.jsonand ensures a subsequent run 30m later sees intake not due.tests/test_roadmap_run.py::test_checkouts_git_managementverifies bare remote cloning to<data dir>/roadmap/<owner>/<name>/clone, tip tracking oforigin/release/vX.Y.Z, author identity configuration, and clone failure isolation where intake and reprioritize succeed while clone-dependent jobs fail and are reported inRoadmapRunError.tests/test_roadmap_run.py::test_idle_records_zero_or_one_store_callsverifies that an empty batch records zero store calls, and an empty poll batch with no changes records exactly onechanges_sincecall.tests/test_roadmap_run.py::test_no_prompt_and_cli_modesverifies that stub runners receive no confirm argument, anddevops roadmap runwithout--confirmor with--dry-runpreviews due jobs while--confirmexecutes them.tests/test_roadmap_run.py::test_service_wiringverifiesdevops serve --servicepassesservice_jobtocreate_service_appandservice_jobopens the store and invokesrun_due_jobs.tests/test_roadmap_run.py::test_mcp_mirror_roadmap_runverifies that FastMCP toolroadmap_runexecutes in dry-run mode, returns due job tuple, and mutates zero store state.tests/test_fastmcp_contracts.pyandtests/test_docs_mcp_argv_collector.pyverify tool registration and argv contracts.tests/test_all_commands_help_dryrun.pyverifies help registration;devops docs checkconfirms all generated reference documentation is up to date.CHANGELOG.mdanddocs/ROADMAP.mdremain untouched; changelog fragment added atchangelog.d/981.md.uv run devops cicompletes with all quality checks passing.gh issue view <n> -R <owner>/<repo> --json comments --jq '.comments[-1].author.login'prints the machine account's login, and the item's Value and Effort are set on the board (intake estimates them with the gateway models, feat(github): single-entry item intake with duplicate detection and placement (devops roadmap intake) #742, so this shows the gateway works through devops-cli's own client). Then close the issue as not planned.joined_release. Within 10 minutes,kubectl -n devops logs deploy/roadmap-service --since=10mshows a poll for that repo that reports the change and the job it made due. Then set the webhook active again.kubectl -n devops rollout restart deploy/roadmap-service. After the pod is Ready,kubectl -n devops exec deploy/roadmap-service -- cat /home/devops/.data/roadmap/<owner>/<repo>/schedule.jsonshows that time, and intake does not run again within an hour of it. That one copy runs at a time during the restart is feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083's Rollout check.kubectl -n devops exec deploy/roadmap-service -- python -c 'import json, os, urllib.request as u; r = u.Request("https://api.github.com/rate_limit", headers={"Authorization": "Bearer " + os.environ["GH_TOKEN"]}); d = json.load(u.urlopen(r, timeout=10))["resources"]; print(d["core"]["used"], d["graphql"]["used"])'. It prints two numbers under 2,500, half of a classic token's 5,000 per hour.feat(release): v0.2.26 (#1178)