Skip to content

feat(review): order-swap probe for verification verdicts #870

Closed as not planned

Description

@dan-petty

Context & Rationale

How verification handles order today:

  • It sends every unresolved finding of a page in one prompt. The findings are numbered in the order the personas found them (unresolved_findings, src/devops_cli/ai/review/verification.py:2039-2048). The prompt is built at verification.py:2053 and sent at verification.py:2065.
  • Each verdict is bound back to its finding by that number (_bind_verdicts_to_findings, verification.py:1852-1874).
  • Nothing checks whether a verdict depends on where its finding sits in the list.

LLM judges show position effects:

  • arXiv 2606.19544 reports position bias above 0.10 in two production judges.
  • CodeJudgeBench (arXiv 2507.10535) finds that changing the order of responses changes pairwise judging accuracy substantially.

This was split from #413. Once #413 compares arms next to their run-to-run spread, an order swap is just one more arm.

Scope & Deliverables

  • Deliverable: devops review benchmark --verification-order reversed reverses the unresolved findings before they are numbered. The default, found, keeps today's order.
    • The choice reaches _validate_segment_findings through a context variable, the same way the profiling stage travels (src/devops_cli/ai/review/profile.py:39-41).
    • Each session's profile records it as verification_order.
    • devops review corpus score (from feat(ai): model-in-the-loop prompt benchmarking #413) treats verification_order as part of an arm. Sessions that differ make it exit 1, and the run's setup records the value.
    • The allowed values live in src/devops_cli/config/constants.py.
  • Acceptance criteria:
    • Unit test. Use a stub client that captures the prompt and answers by finding_id. With three findings verified in reversed order:

      • they appear last-first in the prompt's Findings: JSON;
      • each verdict lands on the finding it names.

      With found order, the prompt stays byte-identical to today's.

    • Profile. The profile of a reversed run carries verification_order == "reversed".

    • Mixed orders. Two sessions with different orders make corpus score --runs 2 exit 1.

    • Gate. The new tests run offline, each in under 1 s, and uv run devops ci passes.

    • Person-run check (needs a live model). Use a corpus from feat(ai): model-in-the-loop prompt benchmarking #413's check:

      uv run devops review benchmark "$CORPUS/files" --all --runs 3
      uv run devops review corpus score "$CORPUS" --runs 3        # arm A
      uv run devops review benchmark "$CORPUS/files" --all --runs 3 --verification-order reversed
      uv run devops review corpus score "$CORPUS" --runs 3        # arm B
      uv run devops ai runs compare <A> <B>
      

      The PR description records whether recall_reported and invalidated_findings read overlaps or apart.

  • Key questions:
    • A per-finding flip rate, or an aggregate? The aggregate, through feat(ai): model-in-the-loop prompt benchmarking #413's arm comparison (proposed). A per-finding flip rate needs the same candidates verified twice, which needs saved pages, and sessions do not keep them.
    • Why is the flag on benchmark only? The probe is a measurement, not a review mode (proposed). review path stays as it is.
    • What if the arms read apart? File a follow-up to verify findings one per call or in a fixed order (proposed). This item only measures.
  • Constraint:
    • No new dependency.
    • Live runs stay on demand and never run in devops ci.
    • Cyclomatic complexity of 10 or less, nesting depth of 5 or less, and tuple assertions (AGENTS.md:13-17).

Strategic Alignment

Split off #413 during the v0.2.25/v0.2.26 readiness review (2026-10-01): Split from #413, whose amendment asked for one order-swap probe. It needs a new switch in the verification stage and a live run of its own. Once #413 compares arms next to their spread, the probe is just one more arm, so it depends on #413 and stays out of #413's PR.

Activity

  1. added
    type/feature
    scope/review
    priority/p3-low
    on Oct 1, 2026
  2. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    Frozen by the evidence-first review redesign (#1137, owner direction of 2026-10-03): patches to the model generator and verifier stop, and tool-layer fixes continue. This item patches code that #1150 deletes (the verifier path in verification.py, the guards and verifier prompts, construct_validator.py, criteria_evidence.py, and the known-false-positive catalog).

    It stays open, labelled status/blocked, and closes as not planned with "Superseded by #1150" when that item lands. Until then, the interim is the tools-only review (--no-persona-review --no-verification). Do not start work on it.

  3. added
    status/blocked
    on Oct 3, 2026
  4. dan-petty commented on Oct 17, 2026

    @dan-petty
    OwnerAuthor

    Closed as not planned in the 2026-10-17 unblocking review: Superseded by #1150. The model verifier and its numbered verdict binding are deleted, and ADR 0005:27 forbids model verdicts, so there is no verification order left to probe.

  5. removed
    status/blocked
    on Oct 17, 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

    priority/p3-lowscope/reviewtype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions