Repository navigation
Description
Problem or Motivation
ADR 0020 (the design record of the item before this one) makes a decision point a first-class unit with a resolver chain. The code has no such unit. The verify screen (src/devops_cli/roadmap/stage/stage_jev_screen.py) has its own mode setting roadmap.stage.jev_screen, its own two metrics and its own log lines. The intake labels and the completeness check have a boolean each. The shared parts in src/devops_cli/roadmap/decision_step.py and decision_fit.py hold the cuts, the bands and the fit, but no registry, no resolver chain, no shadow record and no join with the real outcome.
Proposed Solution & Architectural Design
- A typed registry of decision points under
src/devops_cli/roadmap/, built ondecision_step.pyanddecision_fit.py. No second mechanism. - The resolver chain: the rule of the point if one is proven, then the decision model if
ai.decision_modelis set and the mode of the point isshadoworon, then the current behaviour. An error, a low confidence or no model configured falls back to the current behaviour. - The settings
ai.decision_modelandroadmap.decisions.<point>. The registry refusesonfor a point with no fitted cut. - One metric
devops_cli_decision_point_total(point, resolver, band, mode), one shadow record for each decision, and a helper that joins a decision with its real outcome. - Migrate the verify screen onto the registry. The old setting
roadmap.stage.jev_screenand the old metrics go (alpha: no shim).
With no decision model configured, every point behaves as it does today: no request and no metric noise beyond a zero.
Target Subsystem
Roadmap Service workflows (src/devops_cli/roadmap), settings, telemetry.
Existing Tool Considered
pydantic_ai DecisionModel for the client, and the existing decision_step.py and decision_fit.py. Cost: one small module, one setting for the model, one mapping for the modes.
Related: the design record item (ADR 0020), #4282, #4298, #4308.
Standards Compliance
- I confirm this proposal aligns with AGENTS.md engineering principles (cyclomatic complexity <= 10, nesting <= 5, zero bare exceptions, tests that cover the changed lines).
- I am willing to submit a pull request implementing this feature with accompanying tests.
Proposed design
Problem statement
ADR 0020 makes a decision point a first-class unit with a resolver chain. The code has no such unit. The verify screen, the intake labels and the completeness check each hold their own setting, their own metrics and their own logic. This item adds one typed registry with the resolver chain, the settings, the one counter, the shadow record and the outcome join. It moves the verify screen onto the registry and removes the old setting and the old metrics.
Acceptance criteria
Requirement: Typed registry
The roadmap SHALL hold one typed registry that names each decision point, its question set, its mode and its fitted cuts.
Scenario: A registered point reports its mode and its cuts
- WHEN code asks the registry for the point
stage.verify_screenand the settingroadmap.decisions.stage.verify_screenisshadow - THEN the registry returns the mode
shadowand the cuts ofjev_screen_cuts.json
Requirement: Resolver chain order
A decision point SHALL resolve in the order of its proven rule, then the decision model, then the current behaviour.
Scenario: A proven rule runs before the model
- WHEN a point has a proven rule and
ai.decision_modelis set - THEN the resolver returns the band of the rule, records the resolver
ruleand sends no model request
Requirement: Fallback to the current behaviour
The resolver MUST fall back to the current behaviour when the model call fails, gives a low confidence or is not configured.
Scenario: A provider error falls back
- WHEN the decision model raises an error for a point in the mode
on - THEN the resolver returns the current behaviour and records the resolver
fallbackwith the bandnone
Requirement: Silence of an off point
A point whose mode is off SHALL send no model request and SHALL write no series.
Scenario: An off point is silent
- WHEN the point
stage.verify_screenhas the modeoffand a review runs - THEN no model request leaves the process and the counter holds no series for that point
Requirement: The one counter
The registry SHALL count each decision in the counter devops_cli_decision_point_total with the labels point, resolver, band and mode.
Scenario: One decision writes one series
- WHEN a point in the mode
shadowresolves by the model with the bandreview - THEN the counter adds one to the series with the labels
point,model,reviewandshadow
Requirement: Refusal of an unfitted mode
The registry MUST refuse the mode on for a point with no fitted cut, with an error that names the point.
Scenario: An unfitted point rejects on
- WHEN the setting
roadmap.decisions.<point>gives the modeonto a point with no cut file - THEN loading the settings raises an error that names the point
Requirement: Shadow record and outcome join
The registry SHALL write one record for each decision and one record for its real outcome, and a pure function SHALL join the two by their identifier.
Scenario: The join labels a decision
- WHEN a decision record and an outcome record hold the same identifier
- THEN the join returns one case with the band of the decision and the result of the outcome
Requirement: The verify screen on the registry
The verify screen SHALL take its mode, its cuts, its metric and its record from the registry, and the setting roadmap.stage.jev_screen SHALL be removed.
Scenario: The old setting is gone
- WHEN a test reads the settings schema and the documents
- THEN neither holds
roadmap.stage.jev_screen, androadmap.decisions.stage.verify_screensets the mode of the screen
Requirement: Removal of the old counters
The change MUST remove the counters devops_cli_roadmap_decision_step_total and devops_cli_roadmap_decision_step_review_total.
Scenario: The telemetry document names one counter
- WHEN a test reads
docs/TELEMETRY.mdand the instruments module - THEN both name
devops_cli_decision_point_totaland neither names an old counter
Requirement: Bound of the series
The catalogue of decision points MUST stay at or below 60 series, and the documents SHALL state that count.
Scenario: The catalogue stays within the bound
- WHEN a test counts the series of every point of the registry for each mode
- THEN the count is at most 60 and
docs/TELEMETRY.mdstates it
Existing Tool Considered
No alternatives check has run. The DecisionModel of pydantic_ai covers the model client. The modules src/devops_cli/roadmap/decision_step.py and src/devops_cli/roadmap/decision_fit.py cover the cuts, the bands and the fit. They lack the registry, the resolver chain, the modes, the one counter, the shadow record and the outcome join. No open library supplies those parts. Build cost: about 20,000 tokens to build the module and its tests, about 4,000 tokens for each later fix, and about 2 days elapsed.
Key questions
- Which design record defines the decision point and its resolver chain?: ADR 0020 defines the decision point, the resolver chain, the settings, the counter and the outcome join. This item delivers that record in code. [sources: docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md]
- In which order does the resolver chain run?: The rule of the point runs first when one is proven. The decision model runs second when
ai.decision_modelis set and the mode isshadoworon. The current behaviour runs last. (best practice) [sources: docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md]- Chosen: Rule, then model, then current behaviour. ADR 0020 states this order, and a proven rule costs no token and repeats.
- Rejected: Model, then rule, then current behaviour. A model call costs tokens while a rule already settles the case.
- Rejected: Model only. A point with no model, or with a failed call, then has no path.
- How do the settings hold the mode of each point and the model?:
ai.decision_modelnames the model.roadmap.decisions.<point>holds the mode of each point, and the mode isoffwhen the key is unset. (best practice) [sources: docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md, src/devops_cli/config/defaults.py, docs/ENV_VARS.md:132]- Chosen: One model setting and one mode mapping. ADR 0020 names both keys, and one place holds the model for every point.
- Rejected: One setting for each point. The keys grow with the catalogue and the model has no single home.
- Rejected: Reuse
roadmap.stage.jev_screen. It names one point only and cannot serve a second.
- What does the registry do when a point asks for
onbut has no fitted cut?: The registry refuses the mode and raises an error that names the point. (best practice) [sources: docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md, src/devops_cli/roadmap/decision_step.py]- Chosen: Refuse
onwith an error that names the point. A band needs a cut, andband_ofraises when a cut is missing. - Rejected: Fall back to
shadow. A silent change of a person's setting hides the mistake. - Rejected: Fall back to
off. The point then makes no record and the mistake stays unseen.
- Chosen: Refuse
- Which counter and labels does the registry write?: One counter,
devops_cli_decision_point_total, with the labelspoint,resolver,bandandmode. The catalogue stays at or below 60 series. (best practice) [sources: docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md, docs/TELEMETRY.md:106, src/devops_cli/telemetry/instruments.py]- Chosen: One counter with four bounded labels. ADR 0020 gives the labels and the bound of 60 series.
- Rejected: Keep the two counters of the screen. A second counter for each point multiplies the series and the queries.
- Rejected: One counter for each point. Many counter names give no single query and no shared labels.
- How does a decision join its real outcome?: The registry writes one log line for the decision and one for the outcome, both with the same identifier. A pure function joins them into the labelled cases of the next fit. (best practice) [sources: docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md, openspec/changes/archive/2026-11-10-4396-the-decision-point-design-for-jev/design.md]
- Chosen: Two log lines and a pure join function. ADR 0020 states it, and the Service holds no store for decisions.
- Rejected: A database table. The Service keeps no database for this record.
- Rejected: A second counter. A counter has no identifier for one case and cannot join.
- Which case counts as a low confidence?: A model result is usable only when
band_ofgives a band for every question of the point. A missing answer, a missing cut, a timeout or a provider error is the low-confidence case. The resolver then returns the current behaviour. (best practice) [sources: src/devops_cli/roadmap/decision_step.py, docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md]- Chosen: Reuse the cut check of
band_of. The function already raises on a missing answer or cut, andFAILEDnames that error. - Rejected: Add a separate confidence setting. A second threshold beside the fitted cuts gives two sources of truth.
- Rejected: Treat the band
reviewas a low confidence.reviewalready runs the current behaviour in both modes.
- Chosen: Reuse the cut check of
- Which cut file does the verify screen keep after the migration?: The point
stage.verify_screenkeepsjev_screen_cuts.jsonas its cut file and loads it throughThresholds.load. [sources: src/devops_cli/roadmap/stage/stage_jev_screen.py, src/devops_cli/roadmap/stage/jev_screen_cuts.json, src/devops_cli/roadmap/decision_step.py] - Does the change keep a shim for
roadmap.stage.jev_screenand the two old counters?: No shim. The change removes the setting and both counters, and the documents name the new key and the new counter. (best practice) [sources: AGENTS.md, docs/ENV_VARS.md:132, docs/TELEMETRY.md:106]- Chosen: Remove the old key and counters. AGENTS.md keeps no backward compatibility before 1.0, and a shim doubles the paths.
- Rejected: Keep a deprecated alias. A second path costs tests and time for a setting that no user holds.
- Which earlier items must be delivered first?: None. ADR 0020 and the pilot screen that cites feat(roadmap): a Jev screen before the verify step #4282 are in the tree at this commit, so this item waits on neither. The body lists feat(roadmap): Jev decides the labels of an intake proposal #4298 and feat(roadmap): a Jev completeness check for draft pull requests #4308 as related, and no code of this change names them. [sources: docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md, src/devops_cli/roadmap/stage/stage_jev_screen.py]
- Where does the registry module live, and what does it reuse?: The registry lives in
src/devops_cli/roadmap/decision_point.py. It importsCut,Thresholds,band_ofanddecide_allfromdecision_step.py. (best practice) [sources: src/devops_cli/roadmap/decision_step.py, src/devops_cli/roadmap/decision_fit.py, docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md]- Chosen: A new module beside
decision_step.py. The shared parts stay in one module, and the registry adds the chain and the modes. - Rejected: Extend
decision_step.py. The module holds the shared parts of a step and would grow past one purpose. - Rejected: A new package. One module holds the registry, and a package adds files for no gain.
- Chosen: A new module beside
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 10, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It is a planned architectural feature that depends on prior work and has no user-facing urgency.It gives every decision point one mechanism, one metric, and an optional AI resolver, replacing ad-hoc settings.It requires a new module, a resolver chain, two settings, a metric, a shadow record, an outcome join, and a migration of the verify screen.Both touch the Jev verify screen, but #4282 adds the screen while this candidate builds a general registry and migrates the screen onto it.devops-cli-service commentedon Nov 10, 2026
Status set to Ready at 40d2b37 (see proposed design in issue body).
devops-cli-service commentedon Nov 11, 2026
Released in v0.111.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.111.0
devops-cli-service commentedon Nov 11, 2026
Live since 2026-11-11 05:46 UTC
docs(roadmap): gate ai.decision_model on all three images (#4613)