Skip to content

fix(roadmap): keep the alternatives return in reply_fixable shadow mode #6358

Done

Description

@dan-petty

Problem

In mode shadow, the decision point alternatives.reply_fixable changes the job behavior. The spec says that it must not.

  • src/devops_cli/roadmap/alternatives.py:1278, in _OutputChecker.check: if self.returns > 0 or band is Band.CONTINUE: return None. This line runs in shadow and in on. Only the next line checks self.chain.mode is Mode.ON.
  • With the point off, the chain is None. A refusal with the code job_verdict, no_search or skip_only then always gets one return (alternatives.py:1285-1287).
  • In shadow, the rule gives the band continue when the code equals the earlier failed reason of the item. The check then returns None, so the refusal loses its return.
  • A run of the real _OutputChecker with ResolverChain(REPLY_FIXABLE, Mode.SHADOW): code no_search with earlier code no_search gives a return in off and no return in shadow. job_verdict and skip_only give the same result.
  • Spec openspec/specs/roadmap-alternatives/spec.md:807-813: the point "SHALL run in mode shadow and record its band with no change to the job behavior".
  • The test test_mode_shadow_records_band_without_retry uses only no_tool, which gets no return in off. So no test finds this.
  • Measured exposure is small: 0 of 590 alternatives result lines in 7 d had one of these 3 codes. But shadow can remove a retry, and the owner reads the shadow records before turning the point on.

Expected

  • In shadow, _OutputChecker.check records the band and then follows the off path. Only in mode on does the band continue stop the return.
  • Test first: in shadow, a refusal with job_verdict, no_search or skip_only whose earlier code is the same gets its one return, as in off. The record holds the band continue.
  • The tests of mode on stay green.

Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches for shadow-mode decision evaluation found only unrelated DOM and web pages; the need is an internal fix to the project's own _OutputChecker path, which no external tool or library covers.

Proposed design

Problem statement

In mode shadow, alternatives.reply_fixable can remove one retry that mode off gives. The cause is the Band.CONTINUE short-circuit in _OutputChecker.check, which runs before the mode check. The fix makes shadow record the band and follow the off path. Only mode on stops the return.

Acceptance criteria

Requirement: Shadow keeps the off-path return

In mode shadow, _OutputChecker.check SHALL record the band and give the same one return as mode off for a fixable refusal.

Scenario: Shadow with a repeated fixable code

  • WHEN The checker runs with ResolverChain(REPLY_FIXABLE, Mode.SHADOW), the earlier code equals the refusal code, and the code is job_verdict, no_search or skip_only.
  • THEN The test in tests/roadmap/test_roadmap_alternatives_reply_fixable.py asserts one return and the band continue for each code.

Requirement: Mode on stops a continue band

In mode on, the band continue MUST stop the return for a repeated fixable refusal.

Scenario: Mode on with a repeated fixable code

  • WHEN The checker runs with ResolverChain(REPLY_FIXABLE, Mode.ON), the earlier code equals the refusal code, and the code is job_verdict, no_search or skip_only.
  • THEN The test in tests/roadmap/test_roadmap_alternatives_reply_fixable.py asserts zero returns for each code.

Requirement: Mode off stays unchanged

In mode off, a fixable refusal SHALL get one return when the earlier code equals the refusal code.

Scenario: Mode off with a repeated fixable code

  • WHEN The checker runs with a None chain, the earlier code equals the refusal code, and the code is job_verdict, no_search or skip_only.
  • THEN The test in tests/roadmap/test_roadmap_alternatives_reply_fixable.py asserts one return for each code.

Existing Tool Considered

The alternatives block in the issue body records verdict none and names no tool. It searched shadow-mode decision evaluation and found no open, maintained tool. The change fixes the project's own _OutputChecker path. It builds no new tool and keeps no new code. Cost: one guard change and a regression test.

Key questions

  • What does the spec require when alternatives.reply_fixable runs in mode shadow?: It must record the band and must not change the job behavior. [sources: openspec/specs/roadmap-alternatives/spec.md:807-813]
  • Which refusal codes lose a return in shadow mode?: The codes job_verdict, no_search and skip_only lose their one return when the earlier code equals the refusal code. [sources: src/devops_cli/roadmap/alternatives.py:1278, src/devops_cli/roadmap/alternatives.py:1285-1287, tests/roadmap/test_roadmap_alternatives_reply_fixable.py]
  • How should the check gate the continue band?: Add a chain-mode guard to the continue short-circuit. Stop the return only when the chain exists and its mode is on. Shadow and off then reach the existing one-return path. (best practice) [sources: openspec/specs/roadmap-alternatives/spec.md:807-813, src/devops_cli/roadmap/alternatives.py:1278, src/devops_cli/roadmap/alternatives.py:1285-1287]
    • Chosen: Gate continue on mode on. It follows the spec and keeps the off path for shadow.
    • Rejected: Treat shadow as on. It keeps the defect and changes job behavior.
    • Rejected: Remove the continue band. It changes mode on behavior and breaks the spec.
  • How should the regression test cover the three codes?: Add a parametrized case to tests/roadmap/test_roadmap_alternatives_reply_fixable.py. Run each code in shadow, on and off. (best practice) [sources: tests/roadmap/test_roadmap_alternatives_reply_fixable.py, src/devops_cli/roadmap/alternatives.py:1278]
    • Chosen: Parametrized cases in the existing test file. It covers each code and mode with one test body.
    • Rejected: One new test function for each code. It repeats setup and adds no coverage.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 19, 2026
  2. dan-petty commented on Nov 19, 2026

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

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (2)

    Searches run:

    • feature flag shadow mode must not change behavior python library, results: 5
    • library shadow mode decision point resolver chain record band no behavior change, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 19, 2026
  6. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  7. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 25, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 25, 2026
  9. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 17:09 UTC

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/lowpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions