Skip to content

feat(roadmap): test a digest rule before the verify screen model #6180

Not planned

Description

@devops-cli-service

Split from #5273.

Problem of the part to build here goes before the decision model. The digest facts may separate a clean plan from a plan with a serious finding. These facts are the criteria, the groups, the missing paths, and whether the verify command names a test file of the group. No test shows which fact does.## Why it is deferred part.The owner's scope note of 2026-11-12 orders #5281 first. #5281 rewrites the questions and the digest facts. A rule fitted on the old facts would not survive that change. The live data is also small: 44 records on 17 items, with 3 clean plans. A held-out half needs more cases. #5273 delivers the outcome fields and the join that this work reads.## Acceptance criteria test gives a candidate rule from the digest facts a score on one half of the joined cases and a score on the other half. The report keeps a rule only when it beats the base rate on the held-out half. It names the rule that it keeps, or states that none passes. A test shows that a rule that does not beat the base rate on the held-out half is not kept.

Dependencies

Proposed design

Problem statement

The verify screen reads four digest facts before the model review. The facts are the acceptance criteria, the groups, the missing paths, and the verify test-file flag. No test shows which fact separates a clean plan from a plan with a serious finding. This item adds a harness that builds one candidate rule for each fact and scores each rule on both halves of a split. The harness keeps a rule only when it beats the majority base rate on each held-out half. It names the kept rule or states that none passes, reads the join of #5273 and the digest facts of #5281, and waits on #6521.

Acceptance criteria

Requirement: Candidate rule for each digest fact

The harness SHALL build one candidate rule for each digest fact: the criteria, the groups, the missing paths, and the verify test-file fact.

Scenario: Four digest facts give four rules

  • WHEN the harness builds its candidate rules from a joined case that holds all four digest facts
  • THEN it holds four rules, one for each digest fact

Requirement: Score on both halves

The report SHALL score each candidate rule on the fitted half and on the held-out half; it SHALL repeat the fit with the halves swapped.

Scenario: Each rule gets a score in both directions

  • WHEN the report runs on a split of joined cases with known outcomes
  • THEN each candidate rule holds an A-to-B score and a B-to-A score

Requirement: Base rate of the held-out half

The report SHALL compute the base rate of a held-out half as the accuracy of the majority outcome on that half.

Scenario: Three clean cases and one serious case

  • WHEN the held-out half holds three clean cases and one serious case
  • THEN the base rate is 0.75

Requirement: Keep only a rule above the base rate

The report SHALL keep a candidate rule only when its score on each held-out half is strictly greater than that half's base rate.

Scenario: A rule that ties the base rate is dropped

  • WHEN the only candidate rule scores 0.75 on a held-out half and that half's base rate is 0.75
  • THEN the report keeps no rule and states that none passes

Requirement: Name the kept rule

The report MUST name the kept rule with its held-out score, or state that none passes.

Scenario: A rule above the base rate is named

  • WHEN a candidate rule scores above the base rate on both held-out halves
  • THEN the report names that rule and its held-out score

Requirement: Stable and stratified split

The harness SHALL keep each record in its half on every run and SHALL deal each outcome stratum by turns.

Scenario: Two runs give the same halves with a clean plan in each

  • WHEN the harness splits two clean cases and four serious cases twice
  • THEN each run gives the same two halves and each half holds one clean case

Requirement: Report object

The report SHALL return one object with the half counts, the base rates, the rule scores, and the kept rule or the no-rule text.

Scenario: A report holds the counts and the outcome

  • WHEN the report runs on the synthetic joined cases
  • THEN the object holds the half counts, both base rates, every rule score and the kept rule or the no-rule text

Requirement: Offline test cases

The test MUST build its joined cases in the test file, with no live data and no network.

Scenario: The test runs offline

  • WHEN the test module runs with no network and no data file
  • THEN the test passes and the report returns the kept rule or the no-rule text for the synthetic cases

Existing Tool Considered

No alternatives check has run for this item. scikit-learn is the open, maintained library that covers a split and a majority baseline. train_test_split cuts the cases, with stratify for the outcome strata. DummyClassifier gives the majority base rate. It lacks the digest facts, the join, the one-rule-per-fact construction, the fixed split and the report. Its default split is random rather than fixed. The project reuses halves and evaluate_cuts from src/devops_cli/roadmap/decision_fit.py. It writes only the per-fact rules, the base-rate comparison and the report. This is about 60 lines of Python. The cost is about 20k tokens to build, about 5k tokens to keep and fix, and about 1.5 hours of elapsed work.

Key questions

  • Which candidate rules does the harness test?: The harness builds one rule for each of the four digest facts. The facts are the acceptance criteria, the groups, the missing paths, and the verify test-file flag. Each rule reads its fact alone. The fit picks the rule direction on the fitted half. The harness does not fit a combination of the facts. (best practice) [sources: src/devops_cli/roadmap/stage/stage_jev_screen.py, src/devops_cli/roadmap/decision_fit.py]
    • Chosen: One rule per digest fact. The item asks which fact carries the signal, and four single-fact rules answer it.
    • Rejected: One fitted combination of the facts. With 44 records and 3 clean plans a fitted combination overfits, and its score cannot be read.
    • Rejected: A rule for each subset of the facts. Fifteen subsets over 44 records raise the chance that one passes by luck.
    • Rejected: A fitted threshold for each fact. A threshold on a half of about 22 cases is a guess, and the item asks which fact, not which cut.
  • How does the harness split the joined cases into the fitted half and the held-out half?: The harness calls halves from src/devops_cli/roadmap/decision_fit.py with a fixed seed and the outcome stratum of each case. halves sorts each stratum by a hash of the seed and the record id. It deals the records by turns. The harness fits on half A and scores on B. It then fits on B and scores on A. (best practice) [sources: src/devops_cli/roadmap/decision_fit.py:140, docs/roadmap/stage.md]
    • Chosen: Fixed-seed stratified split with swapped halves. The same record stays in its half on every run, each half keeps clean plans, and the report gives both directions.
    • Rejected: SHA-256 of the record id modulo 2. It has no strata, so all clean plans can land in one half, and it reports one direction only.
    • Rejected: Seeded pseudo-random split. A changed seed moves cases and changes the verdict, and no record of the split stays in the repository.
    • Rejected: Stratified split with no swap. It reports one direction, and a half of about 22 cases can pass by luck.
  • Which base rate must a kept rule beat, and by how much?: The base rate is the accuracy of the majority outcome on each held-out half. A rule must score strictly greater than that base rate on both held-out halves. A tie keeps no rule, because a rule that only matches the base rate adds no signal. (best practice) [sources: src/devops_cli/roadmap/decision_fit.py:132, src/devops_cli/roadmap/stage/stage_screen_eval.py, docs/roadmap/stage.md]
    • Chosen: Majority outcome on each held-out half, strict, in both directions. The held-out halves are the only halves that the rule did not see, and a tie adds no signal.
    • Rejected: Majority outcome over all cases. It mixes the half that the rule saw into the bar.
    • Rejected: Greater than or equal to the base rate. A rule that only matches the base rate adds nothing to the decision.
    • Rejected: A fixed 0.5. It ignores the class imbalance: with 3 clean plans of 44, the majority base rate is far above 0.5.
    • Rejected: Only the A-to-B direction. One direction is a coin toss on a half of about 22 cases, so the fit repeats with the halves swapped.
  • Where do the test cases come from?: The test builds a small synthetic set of joined cases in the test file with the test data builders of the project. The cases have known clean and serious outcomes. The test needs no live data and no network, so the hermetic floor holds. (best practice) [sources: docs/TESTING.md]
  • What does the report return?: The report returns one object. The object holds the count of each half and the base rate of each held-out half. It holds the score of each candidate rule in both directions. It holds the kept rule or the no-rule text. (best practice) [sources: src/devops_cli/roadmap/stage/stage_screen_eval.py, docs/TESTING.md]
    • Chosen: One object with the counts, the base rates, each score and the outcome. A test reads each value, and a person sees why a rule was kept or dropped.
    • Rejected: A plain text table. A test cannot assert a stable value of a formatted table.
    • Rejected: Only the kept rule name. It hides the base rate that shows why none passed.
    • Rejected: A list of scores with no counts. It hides the size of each half and the base rate that the rule had to beat.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5273, #5281, #6521

Activity

  1. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    ContributorAuthor
  2. added
    type/feature
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/medium
    priority/p2-medium
    on Nov 17, 2026
  3. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 8d638d7 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/stage/stage_jev_screen.py, src/devops_cli/roadmap/decision_point.py.

  4. dan-petty commented on Nov 20, 2026

    @dan-petty
    Owner

    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.

  5. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    ContributorAuthor

    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.

  6. dan-petty commented on Nov 30, 2026

    @dan-petty
    Owner

    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.

  7. 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