Repository navigation
Description
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:
- feat(roadmap): add the soft-cap and fix-check chain to decision points #4847 is not built.
ResolverChainstops at the rule when the rule gives a band, so the model never adds a yes, and no mode lets the rule act while the model answer is recorded. - fix(roadmap): decision points need cuts for shadow and run in async code #5272 is not built.
ResolverChain.decidecallsasyncio.run, and a point inshadowloads with no cuts file. - No labelled outcome of the decision exists, so no cut can be fitted (ADR 0019 rule 4).
#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
- Register the decision point
stage.gate_returnsindecision_registrywithgate_extensionas its rule, a counts-only digest (returns,in,gone,stuck,new,never, extensions used) and the Noul questionsprogressingandfixable, through the chain of feat(roadmap): add the soft-cap and fix-check chain to decision points #4847. - 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:andstage 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). - 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.
- Fit
stage_finding_classes.jsonagain on the refused replies after fix(roadmap): stop refusing test paths in base docstrings #4791. Then, at each refusal, a finding of the classneverrefuses 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
nevergets no planner request, and the failure names the gate. - The fit of the cut reads only the
stage gate extension:andstage gate extension end:lines.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
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:
- Registry point
stage.gate_returnswith counts-only digest shadowmode where the rule band acts and the model band is recorded- Refit of
stage_finding_classes.jsonon replies after fix(roadmap): stop refusing test paths in base docstrings #4791 - Early refusal on a
neverfinding with no planner request
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
REGISTRYofdecision_registryand gets the pointstage.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 areprogressingandfixable.
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
shadowwith 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
flagband, 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
flagband, 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_fixableorlow_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
continueband.
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
- WHEN A test runs
finding_classeson a fixture of refused replies after fix(roadmap): stop refusing test paths in base docstrings #4791 - THEN A code with a fixed finding gets no
neverclass, and a code with no fixed finding and at least_LEAST_SAMPLESsamples gets theneverclass.
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_returnsstart 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:
progressingandfixable. (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 noneverfinding. - Rejected: one question. A model cannot say which test failed, so the record loses the reason of the stop.
- Chosen: two questions. They match the two tests of
- How do the rule results map to the point's bands?:
extendedgivescontinue;used,first,stuckandnevergiveflag;reviewis 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 inshadowand 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
neverrefusal run?: In the stage refusal path, before the planner request. A helper instage_findings.pyloadsstage_finding_classes.jsonand applies the samenevertest asgate_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 anevercode serves the rule and the refusal, and no second copy can drift. - Rejected: a check in
stage.py. It copies thenevertest and the classes load into the job.
- Chosen: a helper in
- 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]- Chosen: refused replies after fix(roadmap): stop refusing test paths in base docstrings #4791. fix(roadmap): stop refusing test paths in base docstrings #4791 refused replies in error, so its replies give a stale
neverclass. - Rejected: all saved refused replies. The replies before fix(roadmap): stop refusing test paths in base docstrings #4791 carry the gate defect that made the
neverclass stale.
- Chosen: refused replies after fix(roadmap): stop refusing test paths in base docstrings #4791. fix(roadmap): stop refusing test paths in base docstrings #4791 refused replies in error, so its replies give a stale
- Is feat(roadmap): extend stage gate returns while the plan improves #4851 delivered?: Yes.
gate_extension,finding_classes,load_finding_classesandstage_finding_classes.jsonare in the repository, andgate_extensionenforces the extra-return limit. [sources: src/devops_cli/roadmap/stage/stage_findings.py] - Does a code with fewer than
least_samplessamples get theneverclass?: No.fix_classgivesmodel_fixablewhen 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.
Activity
dan-petty commentedon Nov 13, 2026
Both use the decision-point registry; #4397 builds the registry and resolver chain, the candidate registers a specific decision point in it.feat(roadmap): extend stage gate returns while the plan improves
feat(roadmap): extend stage gate returns while the plan improves (#5389)
devops-cli-service commentedon Nov 17, 2026
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_jevfit, and thefinding_classesdata, so the work is internal to this repository.Tool: none found
Searches run:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
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.dan-petty commentedon Nov 20, 2026
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.
devops-cli-service commentedon Nov 21, 2026
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.
dan-petty commentedon Nov 30, 2026
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.