Skip to content

feat(roadmap): one due_jobs function names the due jobs of an item #5504

Open

Description

@dan-petty

Problem or Motivation

Each roadmap row has its own due rule. Refine writes the stage_due stamp, and open items plan more due keys: roadmap:v1:due:* in #4565, #4567, #4568 and #4574, and fix-checks:<pr> in #5024. A mark can expire, get lost or disagree with the record. The approved pipeline split design (tracker #5482) makes one pure function the only source of what is due.

Proposed Solution & Architectural Design

  • Add src/devops_cli/roadmap/due.py with due_jobs(subject) -> frozenset[Job]. It is a pure function over the labels, the record block, the PR facts and the unit list. It uses phase (feat(roadmap): the phase of each item drives the stuck-item alert #5495).
  • Give it the predicates of the jobs that run today: intake, retitle, alternatives, refine, stage, implement, fix_plan and the status rows. Each new job item adds its own predicate.
  • Skip an item with owner/agent, owner/human, needs-split, a person cause or a running unit.
  • Each research and premise key uses the outside hash (body_hash.py), so a refine write makes neither due.
  • devops roadmap explain <n> prints the phase and the due jobs.
  • Add the pipeline table to docs/ROADMAP_WORKFLOW.md: for each of the 24 jobs, its due predicate, result line, intended result, permission row, mode and issue. A job that is not built names its issue.
  • The rows adopt due_jobs in their own items: feat(roadmap): one watch row for plan and delivery PRs #5024 first, then the sweep (feat(roadmap): run the reconcile sweep on a cluster schedule #4574).

Target Subsystem

Roadmap Service and roadmap jobs (src/devops_cli/roadmap/, docs/ROADMAP_WORKFLOW.md).

Acceptance Criteria

  • Test first: a Hypothesis property test. For each producer write in the phase fixtures, due_jobs of the state after the write gives the next job, and a second run on the same state gives the same set. The test fails on the base.
  • A test: a held, claimed or running item has no due job.
  • A test: a refine write makes no research or premise job due.
  • A test: the Staged rule gives one path for each item, never both.
  • uv run devops docs check passes.
  • Live proof: after the merge and the release, devops roadmap explain runs in a runner Job as the App on the items of the open devops-cli-service[bot] PRs and on 5 items closed in the last 14 days. A comment on this issue gives the phase and the due jobs of each item, and each case where a row acted against due_jobs.

Existing Tool Considered

Hypothesis 6.170.15 (locked) gives the property test. The IssueOps label pattern and the Prow Tide verdict pattern shape the function. No library gives these predicates. Build: 300,000 to 500,000 agent tokens and 1 day.

Related

Tracker #5482, Phase 2. Depends on #5495 and #5502 (the record that permits it). #5024 uses it for PR subjects. #4574 calls it. #5443 (the agentic workflow specification).

Source: #5482

Alternatives check of 2026-11-29: none.
Tool: none found.
Reason: Searches found only generic rule engines, CEL evaluators and label automations. None gives the roadmap predicates over phase, record block, PR facts and units, so the project must build due_jobs. Hypothesis supplies only the property-test harness.

Lacks:

  • Predicates for intake, retitle, alternatives, refine, stage, implement and fix_plan
  • Skip rules for owner labels, needs-split, person cause and running unit
  • One pure frozenset result over labels, record block, PR facts and units

Proposed design

Problem statement

Each roadmap row has its own due rule. A mark can expire, get lost or disagree with the record. The approved pipeline split design (tracker #5482) makes one pure function the only source of what is due. This item adds due_jobs(subject) in src/devops_cli/roadmap/due.py, exposes it in devops roadmap explain, and documents the 24-job pipeline table.

Acceptance criteria

Requirement: Pure due_jobs module

The roadmap code SHALL provide a pure function due_jobs(subject) in src/devops_cli/roadmap/due.py that returns a frozenset of due jobs.

Scenario: Due jobs for a built job state

  • WHEN A test gives due_jobs the labels, record block, PR facts and unit list of one built job state.
  • THEN The function returns a frozenset that holds the due job for that state.

Requirement: Predicates for built jobs

The due_jobs function MUST give a due predicate for each job that runs today: intake, retitle, alternatives, refine, stage, implement, fix_plan and the status rows.

Scenario: Each built job has a predicate

  • WHEN A test gives due_jobs a subject for one built job.
  • THEN The function returns that job when the job is due and leaves it out when the job is not due.

Requirement: Skip conditions

The due_jobs function MUST return an empty set for an item with owner/agent, owner/human, needs-split, a person cause or a running unit.

Scenario: Skip conditions give no due job

  • WHEN The item has one of owner/agent, owner/human, needs-split, a person cause or a running unit.
  • THEN due_jobs returns an empty frozenset.

Requirement: Research and premise keys use the outside hash

The research and premise job keys MUST use the outside body hash from body_hash.py.

Scenario: Refine write does not make research or premise due

  • WHEN A refine write changes the refine section of the item.
  • THEN due_jobs returns no research job and no premise job.

Requirement: Staged rule gives one path

The Staged rule MUST give exactly one Staged path for each item and never both paths.

Scenario: Staged item has one path

  • WHEN due_jobs evaluates an item in the Staged state.
  • THEN The result holds exactly one Staged path.

Requirement: Stable result on a second run

The due_jobs function MUST return the same frozenset on a second run on the same state.

Scenario: Second run on the same state

  • WHEN due_jobs runs twice on the same state.
  • THEN Both runs return equal frozenset values.

Requirement: Property test after a producer write

The Hypothesis property test SHALL check that due_jobs gives the next job after each producer write in the phase fixtures.

Scenario: Next job after a producer write

  • WHEN A phase fixture applies one producer write to a state.
  • THEN due_jobs of the state after the write gives the next job.

Requirement: Property test fails on the base commit

The property test for due_jobs MUST fail on the base commit before the change.

Scenario: Property test on the base commit

  • WHEN The property test runs on the base commit without the due_jobs change.
  • THEN The test fails.

Requirement: Explain prints the phase and the due jobs

The command devops roadmap explain <n> MUST print the phase and the due jobs of the item.

Scenario: Explain shows phase and due jobs

  • WHEN devops roadmap explain <n> runs on an item.
  • THEN The output names the phase and the due jobs.

Requirement: Pipeline table in the workflow page

docs/ROADMAP_WORKFLOW.md MUST hold a pipeline table for each of the 24 jobs with its due predicate, result line, intended result, permission row, mode and issue.

Scenario: Docs check accepts the pipeline table

  • WHEN uv run devops docs check runs on docs/ROADMAP_WORKFLOW.md.
  • THEN The command passes and the page holds one row for each of the 24 jobs, and each job that is not built names its issue.

Requirement: Docs check passes

The documentation change MUST pass the docs check.

Scenario: Docs check on the roadmap workflow page

  • WHEN uv run devops docs check runs.
  • THEN The command passes.

Requirement: Pending a person after the merge

After the merge and the release, a person MUST run devops roadmap explain in a runner Job as the App on the items of the open devops-cli-service[bot] PRs and on 5 items closed in the last 14 days.

Scenario: Live proof of explain after the merge

  • WHEN The merge and the release are done, and a person runs devops roadmap explain in a runner Job as the App on those items.
  • THEN A comment on this issue gives the phase and the due jobs of each item and names each case where a row acted against due_jobs.

Existing Tool Considered

The alternatives check of 2026-11-23 in the issue body gives verdict none and names no tool. It lists what no tool covers; see that block. Hypothesis 6.170.15 supplies only the property-test harness, not the function under test. The plan builds its own code at a written cost of 300,000 to 500,000 agent tokens and 1 day.

Key questions

  • Where does the pure due function live and what is its interface?: Add src/devops_cli/roadmap/due.py with due_jobs(subject) -> frozenset[Job]. It reads the labels, the record block, the PR facts and the unit list, and it uses phase. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/run.py:1661, src/devops_cli/roadmap/fix_checks_row.py]
    • Chosen: New module src/devops_cli/roadmap/due.py. The issue proposes a pure function over the four inputs. A separate module keeps it testable and shared.
    • Rejected: Extend src/devops_cli/roadmap/run.py. run.py already holds stage_due and run state. A pure function there is harder to test.
    • Rejected: Extend src/devops_cli/roadmap/fix_checks_row.py. fix_checks_row.py is one row, not the shared source of due jobs.
  • Which jobs get a due predicate in the first version?: The jobs that run today: intake, retitle, alternatives, refine, stage, implement, fix_plan and the status rows. Each new job item adds its own predicate. (best practice) [sources: docs/ROADMAP_WORKFLOW.md]
    • Chosen: Only the jobs that run today. The issue gives the predicates of the built jobs. A new job adds its predicate with its item.
    • Rejected: All 24 jobs including unbuilt jobs. An unbuilt job has no due rule yet. The pipeline table names its issue instead.
  • How does due_jobs skip an item?: It returns an empty set for an item with owner/agent, owner/human, needs-split, a person cause or a running unit. (best practice) [sources: CONTEXT.md, docs/ROADMAP_WORKFLOW.md]
    • Chosen: Skip on all five conditions. The issue names these conditions. CONTEXT.md defines Claim, Unit of work and Blocked in the same terms.
    • Rejected: Skip only on owner labels. It misses needs-split, a person cause and a running unit.
  • How are the research and premise keys computed?: They use the outside body hash from body_hash.py, so a refine write makes neither due. (best practice) [sources: src/devops_cli/roadmap/body_hash.py, docs/ROADMAP_WORKFLOW.md]
    • Chosen: Outside body hash from body_hash.py. The refine section changes on each refine write. The outside hash does not, so research and premise stay not due.
    • Rejected: Refine section hash. A refine write would make research and premise due, which the issue forbids.
  • How does a person see the due jobs?: Extend devops roadmap explain <n> to print the phase and the due jobs. (best practice) [sources: docs/ROADMAP_WORKFLOW.md]
    • Chosen: Extend devops roadmap explain. The workflow page already defines explain as the command that says why a job takes or leaves an item.
    • Rejected: Add a new devops roadmap due command. It duplicates explain and adds a second place for the same facts.
  • How is the pipeline table documented?: Add the pipeline table to docs/ROADMAP_WORKFLOW.md, with one row for each of the 24 jobs and the issue of each job that is not built. (best practice) [sources: docs/ROADMAP_WORKFLOW.md]
    • Chosen: Add the table to docs/ROADMAP_WORKFLOW.md. The page is the one place that names the steps. A test keeps it in step with the workflow labels.
    • Rejected: Add a separate pipeline document. It splits the job table from the workflow page that readers already use.
  • What is the result type of due_jobs?: frozenset[Job]. The caller needs the set of due jobs, not an order. A set makes the idempotence check direct. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/fix_checks_row.py]
    • Chosen: frozenset[Job]. The caller needs the set, not an order. A set makes the idempotence check direct.
    • Rejected: list[Job]. An order is not defined and a second run could reorder the list.
    • Rejected: dict[str, bool]. It is verbose and needs a key for every job.
  • What does the Staged rule return?: Exactly one Staged path for each item, never both paths. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, CONTEXT.md]
    • Chosen: One Staged path. The issue requires one path. Two paths would let a row act twice on one item.
    • Rejected: Both Staged paths. It breaks the single-path rule and can start two actions for one item.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5495, #5502

Activity

  1. added
    source/agent
    on Nov 13, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/high
    effort/medium
    on Nov 13, 2026
  3. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 13, 2026
  5. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Searches for an open, maintained tool that decides which jobs are due from an item's labels, record block, PR facts and unit list returned only generic rules-engine and unrelated documentation pages, none of which carries the roadmap's own job predicates, phase rules, hold/skip conditions or outside-hash keys. The one tool the issue names, Hypothesis 6.170.15 (already locked in the project), only supplies the property-test harness for the acceptance criteria and covers none of the due_jobs function itself, so this is a build.

    Tool: none found

    Lacks:

    • No library provides the due predicates of the roadmap jobs (intake, retitle, alternatives, refine, stage, implement, fix_plan, status rows).
    • No library computes the skip conditions for owner/agent, owner/human, needs-split, a person cause or a running unit.
    • No library keys the research and premise jobs on the outside body hash so that a refine write makes neither due.
    • No library supplies the single-path Staged rule or the devops roadmap explain phase-and-due-jobs output.
    • Hypothesis covers only the Hypothesis property test for the acceptance criteria, not the function under test.

    Tools considered:

    Searches run:

    • open source tool derive due actions from GitHub issue labels workflow scheduler, results: 5
    • python library compute which jobs are due from issue labels state rule engine, results: 5
    • IssueOps label automation Kubernetes prow tide verdict pattern open source, results: 5
    • python durable rules engine evaluate declarative predicates workflow due determination library, results: 5
    • durable_rules python rules engine github repository, results: 5
    • json-logic python package evaluate rules github, results: 5

    Sources:

    Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.

  6. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at fd00bf1 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  7. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

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

    effort/mediumpriority/p2-mediumscope/roadmapsource/agentstatus/newtype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions