Skip to content

feat(roadmap): the decision model judges stage gate extensions #5386

Not planned

Description

@dan-petty

Problem or Motivation

#4851 makes the stage gate returns a soft cap with a deterministic rule: at the last return of roadmap.stage.gate_returns, a refused reply gets one more return when no finding of the reply before stays and no finding has the fix class never (gate_extension in src/devops_cli/roadmap/stage/stage_findings.py). The owner direction of 2026-11-11 asks that a decision model (Jev) judge from the same short progress facts, with the rule as the fallback when the model is not available. #4851 could not add the model:

#4851 also left out the fixable check before a return: a refusal at once on a never finding. The seed class never of stage_problem_missing_test_file (0 of 17 fixed) comes from the replies that the gate defect #4791 refused in error, and #4791 is closed. So that check needs the classes fitted again on replies after #4791.

Proposed Solution & Architectural Design

  1. Register the decision point stage.gate_returns in decision_registry with gate_extension as its rule, a counts-only digest (returns, in, gone, stuck, new, never, extensions used) and the Noul questions progressing and fixable, through the chain of feat(roadmap): add the soft-cap and fix-check chain to decision points #4847.
  2. Start the point in the mode in which the rule acts and the model answer is recorded. The model acts only with a cut fitted from the stage gate extension: and stage gate extension end: lines of feat(roadmap): extend stage gate returns while the plan improves #4851 (at least 30 labelled outcomes, at least 10 of each label).
  3. Model error, a timeout or no decision model gives the rule answer. The guards stay first: one extra return for each item and the drain guard of fix(roadmap): bound the stage gate returns and start no return in a drain #4900.
  4. Fit stage_finding_classes.json again on the refused replies after fix(roadmap): stop refusing test paths in base docstrings #4791. Then, at each refusal, a finding of the class never refuses the reply at once with no planner request, and the failure text names the gate.

Target Subsystem

SDLC, Git & PR Governance (roadmap stage, decision points).

Existing Tool Considered

The ResolverChain of ADR 0020 (#4847), decide_with_jev and the fit of decision_fit, and finding_classes of #4846. No new library. Cost to build: about 1,000,000 model tokens and 1 day.

Acceptance Criteria

  • A test with a fake decision model: in the mode in which the rule acts, the rule answer acts and the decision record holds the model answer.
  • A test: a model error or a timeout gives the rule answer, and the guards stop a second extra return with no model request.
  • A test: after the new fit, a reply whose new finding has the class never gets no planner request, and the failure names the gate.
  • The fit of the cut reads only the stage gate extension: and stage gate extension end: lines.

Dependencies

#4851, #4847, #5272.

Source: #4843

Alternatives check of 2026-11-28: none.
Tool: none found.
Reason: Searches returned no decision-point, policy-gate or threshold-fitting tool. The need is an entry in the project's own decision_registry plus its ResolverChain and class refit, and the issue itself adds no new library.

Lacks:

Proposed design

Problem statement

#4851 makes the stage gate returns a soft cap. At the last return, the rule gate_extension gives one more return when no finding of the reply before stays and no finding has the fix class never. The owner asks a decision model to judge the same short progress facts, with the rule as the fallback. The chain cannot reach the model yet: #4847 and #5272 are open, and #6521 holds incremental work on the stage jobs. The never class of stage_problem_missing_test_file is stale, because #4791 refused those replies in error. This item registers the point, runs it in shadow, keeps the rule as the fallback, refits the classes and refuses at once on a never finding.

Acceptance criteria

Requirement: Register the stage gate returns point

The decision registry SHALL hold the point stage.gate_returns with the rule gate_extension, a counts-only digest and the Noul questions progressing and fixable.

Scenario: The registry lists the point

  • WHEN A test reads REGISTRY of decision_registry and gets the point stage.gate_returns
  • THEN The point is present, its rule is gate_extension, its digest holds only the counts of returns, findings in, gone, stuck, new, never and extensions used, and its questions are progressing and fixable.

Requirement: The rule acts and the record holds the model band

In the shadow mode the point SHALL let the rule band act and SHALL write the model band into the decision record.

Scenario: A fake model gives the other band

  • WHEN A test runs the point in shadow with a fake decision model that gives a band other than the rule band
  • THEN The result is the rule band, and the decision record holds the model band and the counts digest.

Requirement: The rule is the fallback

A model error, a timeout or no decision model MUST give the rule band.

Scenario: The model raises and the model times out

  • WHEN A test runs the point with a fake model that raises an error, and with a fake model that times out
  • THEN The point gives the rule band in both runs and writes no model band.

Requirement: The guards run before the model

The extra-return limit of the item MUST stop the reply before any model request.

Scenario: The item used its extra returns

  • WHEN A test runs the point for an item that used the extra returns of roadmap.stage.gate_return_extensions, with a fake model that records each call
  • THEN The point gives the flag band, the fake model got no call, and the item gets no second extra return.

Requirement: A never finding refuses at once

At a refusal, a finding whose code has the fix class never MUST stop the reply with no planner request, and the failure text SHALL name the gate.

Scenario: The refused reply holds a never finding

  • WHEN A test refuses a reply that holds a finding whose code the loaded classes give the class never, with a fake planner that records each request
  • THEN The planner gets no request, the result is the flag band, and the failure text names the gate of that finding.

Requirement: A fixable finding gets the normal return

At the last gate return, a refused reply with no stuck finding and no finding of the class never SHALL get one more return.

Scenario: The refused reply holds only fixable findings

  • WHEN A test refuses a reply whose findings all have the class model_fixable or low_share, and whose findings from the reply before are gone
  • THEN The stage job makes one planner request with the findings, and the result is the continue band.

Requirement: The classes file is refitted

stage_finding_classes.json MUST be rebuilt from the refused replies after the fix of #4791.

Scenario: The refit uses the class rule

Requirement: The fit reads only the extension lines

The fit of the cut MUST read only the stage gate extension: and stage gate extension end: lines.

Scenario: The log holds other lines

  • WHEN A test gives the fit a log text that holds the two extension lines and other result lines
  • THEN The fit makes one case for each extension pair and no case from the other lines.

Requirement: No cut means no model band

The model MUST act only with a cut fitted from at least 30 labelled outcomes, at least 10 of each label.

Scenario: The outcomes are too few

  • WHEN A test fits a cut from 29 outcomes, and from 30 outcomes with 9 of one label
  • THEN No cut is written, and the point writes no model band.

Existing Tool Considered

The alternatives check of 2026-11-22 in the issue body gives the verdict none with Tool: none found; its block lists the lacks. No open, maintained tool or library covers the need. The change builds on the project's ResolverChain (ADR 0020), decide_with_jev, the fit of decision_fit and finding_classes, and it adds no new library. The written cost to build is about 1,000,000 model tokens and 1 day; the body gives no separate keep or fix cost.

Key questions

  • Which mode does the point stage.gate_returns start in?: shadow: the rule band acts as the current behavior, and the decision record holds the model band. (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, CONTEXT.md, src/devops_cli/roadmap/decision_point.py:267]
    • Chosen: shadow. The rule acts, the model answer is recorded, and ADR 0020 makes the shadow log the data of the fit.
    • Rejected: off. No model answer is recorded, so no labelled outcome ever exists.
    • Rejected: on. The model would act with no fitted cut, against ADR 0019 rule 4.
  • What digest does the point send to the model?: A counts-only digest: returns, findings in, gone, stuck, new, never and extensions used. (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/stage/stage_findings.py]
    • Chosen: counts only. ADR 0020 puts counts in the record, and the rule reads only these counts.
    • Rejected: reply text. It costs tokens, and a text digest has no stable label to fit.
  • Which Noul questions does the point ask?: Two yes/no questions: progressing and fixable. (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/stage/stage_findings.py]
    • Chosen: two questions. They match the two tests of gate_extension: no stuck finding and no never finding.
    • Rejected: one question. A model cannot say which test failed, so the record loses the reason of the stop.
  • How do the rule results map to the point's bands?: extended gives continue; used, first, stuck and never give flag; review is unused because no person step exists today. (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, CONTEXT.md, src/devops_cli/roadmap/stage/stage_findings.py]
    • Chosen: two bands. The rule gives a binary answer, and no person step exists today.
    • Rejected: three bands with review. It adds a person step that the issue does not ask for.
  • When may the model band act?: Only with a cut fitted from at least 30 labelled outcomes, at least 10 of each label of ExtensionEnd. Before that, the point stays in shadow and the rule acts. (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_fit.py, src/devops_cli/roadmap/stage/stage_findings.py:338]
    • Chosen: gate on a fitted cut. A cut needs enough cases of each label, and ADR 0019 rule 4 bars a model with no labelled outcome.
    • Rejected: let the model act at once. It acts with no fitted cut, and the rule can no longer be trusted.
  • Where does the early never refusal run?: In the stage refusal path, before the planner request. A helper in stage_findings.py loads stage_finding_classes.json and applies the same never test as gate_extension. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/stage/stage_findings.py]
    • Chosen: a helper in stage_findings.py. One test of a never code serves the rule and the refusal, and no second copy can drift.
    • Rejected: a check in stage.py. It copies the never test and the classes load into the job.
  • Which replies does the refit of the classes read?: The refused replies of the plans after the fix of fix(roadmap): stop refusing test paths in base docstrings #4791, each plan a list of replies, through finding_classes. (best practice) [sources: src/devops_cli/roadmap/stage/stage_findings.py:293, src/devops_cli/roadmap/stage/stage_findings.py]
  • Is feat(roadmap): extend stage gate returns while the plan improves #4851 delivered?: Yes. gate_extension, finding_classes, load_finding_classes and stage_finding_classes.json are in the repository, and gate_extension enforces the extra-return limit. [sources: src/devops_cli/roadmap/stage/stage_findings.py]
  • Does a code with fewer than least_samples samples get the never class?: No. fix_class gives model_fixable when the sample count is below _LEAST_SAMPLES (5), so the early refusal cannot fire on a rare code. [sources: src/devops_cli/roadmap/stage/stage_findings.py:70, src/devops_cli/roadmap/stage/stage_findings.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6521, #4847, #5272

Activity

  1. added
    source/agent
    on Nov 13, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    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: The searches returned only generic packaging/policy-engine and Docker image pages, no open tool or library that registers a decision point, fits a cut from labelled outcomes, runs a model in shadow mode behind a rule and falls back to the rule. The issue itself asks for no new library: it asks to build on the project's own decision registry and ResolverChain (ADR 0020), the decide_with_jev fit, and the finding_classes data, so the work is internal to this repository.

    Tool: none found

    Searches run:

    • fit decision threshold from labelled outcomes cut points library, results: 5
    • open source library LLM decision model with deterministic rule fallback shadow mode, results: 5
    • litellm router fallback model unavailable error, results: 5
    • Open Policy Agent decision point policy rule engine, results: 5
    • python package calibrated decision cutoff from labelled examples with abstain fallback to rule, results: 5

    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 17, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 2620fae 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.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: src/devops_cli/roadmap/decision_point.py.

  7. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

  8. devops-cli-service commented on Nov 21, 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.

  9. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Triage under #6519 (owner instruction of 2026-11-30), before the hold #6521 closes. This item adds or extends a gate, refusal, screen, cap, limit, retry, result line, shell allowlist, tool catalog or plan-shape rule of the stage, implement or fix-checks job. #6519 found that 263 of about 900 issues in four weeks added such rules and none replaced the engine. Stage now runs on stock Coder (grade 60 on 30 graded attempts), where the agent reads the repository, runs the checks in its loop and has a real shell; implement follows (#6527). The code paths that this item names have also moved. If the failure class still shows in graded attempts, file a new item from that evidence. Closed as not planned; a person may reopen it.

  10. removed
    status/new
    on Nov 30, 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

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions