Skip to content

feat(review): verified findings about merged code enter the roadmap through intake #883

Closed
3 of 3 issues completed

Description

@dan-petty

Context & Rationale

  • Nothing turns a verified finding into an item. Review sessions write findings to .data/reviews/<session>/findings.json (ai/review/pipeline.py:3600-3601). docs/SELF_IMPROVEMENT.md:337-341 asks agents to file each one by hand, with a priority/p1-high label and a board sync, which bypasses intake (feat(github): single-entry item intake with duplicate detection and placement (devops roadmap intake) #742).
  • A session doesn't record what it reviewed. ReviewSessionPayload (ai/review_schema.py:1125-1134) holds findings, personas and dependencies, but no command, commit or PR. profile.json has a target string but no commit (ai/review/profile.py:101-105). So nothing can tell a finding about merged code from one about a PR's own diff. feat(review): subject-keyed review history with a leave-one-out baseline #607 adds a session subject: the head SHA for PRs and base and head SHAs for branches.
  • Reviews run where the hand-off has to happen. They run from a terminal (commands/review.py:172, :389, :592) or through the MCP tools (ai/mcp/server.py:119, :142, :156). No workflow in .github/workflows/ runs one. The service sees only candidates that reach GitHub, so the hand-off happens where the review ran.
  • Verdicts can change after a session ends. They are UNVERIFIED, VERIFIED, INVALIDATED and MITIGATED (ai/review_schema.py:70), and devops review verify (commands/review.py:1013) can set one after the session.

Scope & Deliverables

  • Deliverable:
    • The session records the review command (path, branch or pr), the head commit and whether the working tree was clean. It reuses feat(review): subject-keyed review history with a leave-one-out baseline #607's subject where that exists.
    • When review path finishes on a clean tree whose head commit is reachable from origin/main, it hands each VERIFIED, non-MITIGATED finding to feat(github): single-entry item intake with duplicate detection and placement (devops roadmap intake) #742's candidate entry point. The MCP review_path tool does the same.
    • review pr and review branch never hand off: a finding about a PR's own diff is fixed in that PR before it merges.
    • When devops review verify sets VERIFIED on a finding from a qualifying session, it hands off that one finding.
    • Each candidate cites the session id, file and line, the evidence and the verification criteria. Intake's duplicate check absorbs the same finding raised again by a later session.
    • Rewrite docs/SELF_IMPROVEMENT.md:337-341 and the sequence step at :324 to say that findings reach the roadmap through intake.
  • Acceptance criteria:
    • With a fake intake, a review path session on a merged commit hands off exactly its VERIFIED, non-MITIGATED findings. Verified by a test.
    • review pr, review branch, a dirty tree and a head commit reachable from neither branch hand off nothing. Verified by a parametrized test.
    • review verify setting VERIFIED hands off one candidate on a qualifying session and none on a review pr session. Verified by a test.
    • review path --dry-run hands off nothing, and the hand-off follows intake's --dry-run/--confirm convention. Verified by a test.
    • rg -n 'priority/p1-high' docs/SELF_IMPROVEMENT.md returns nothing.
    • The new tests run offline and take under 1 s in total.
    • Person-run check, with the gateway reachable, on a clean checkout of origin/main: uv run devops review path src/devops_cli/github/issues.py lists the candidates it handed to intake. Each one is either on the board in the backlog or closed as a duplicate (gh issue list -R dan-petty/devops-cli --state all --search "in:body <session-id>").
  • Key questions:
    • What counts as merged code? (proposed) The head commit is reachable from origin/main (git merge-base --is-ancestor), and the tree is clean. This needs only git, and a review of a topic branch never qualifies.
    • Does finding severity set priority? (proposed) No. Intake decides, and CRITICAL severity alone is not P0 evidence.
    • One candidate per finding, or one per session? (proposed) One per finding, since each becomes its own item. Intake's duplicate check merges repeats.
    • Do UNVERIFIED or INVALIDATED findings ever hand off? (proposed) No.
  • Constraint: the review command never creates issues or items itself. It only hands candidates to intake. Tests never touch the network, a cluster or a real model.

Strategic Alignment

Split off #742 during the v0.2.25/v0.2.26 readiness review (2026-10-01): #742's original scope included the review command handing findings to intake. That needs review sessions to record their target and commit, a merged-code test, hand-off from review path, the MCP review_path tool and review verify, and a docs rewrite. Together with intake itself, that is more than one PR. Intake's core value (one entry point with duplicate checks and placement) doesn't need it, so it becomes its own item that calls #742's candidate entry point.

Update 2026-10-08: refinement

#607's subject has no commit (ai/review/history.py:54-61), so this item records the head commit and clean flag. Per #871's re-scope, the hand-off takes admitted OPEN or CONFIRMED findings (review/state.py:25-31). The priority/p1-high text is gone; drop that criterion.

  • docs/SELF_IMPROVEMENT.md:546 and :567-571 route merged-code findings through devops roadmap intake.

Proposed design

Problem statement

Nothing turns a verified review finding about merged code into a roadmap item. A person files each finding by hand, which bypasses intake. This item creates the path for review findings on merged code to enter the roadmap through the intake entry point. It records what a session reviewed, prevents duplicate filing, and provides an explicit hand-off command.

Acceptance criteria

  • Criterion 1: A session records the head commit and whether the working tree was clean.
    Verification: A test confirms the session payload includes head_commit and tree_clean fields.
  • Criterion 2: A session is on merged code when the target is path, the tree is clean, and the head commit is in origin/main.
    Verification: A test confirms the predicate returns true only when all three conditions hold, and false otherwise.
  • Criterion 3: A filed candidate carries the finding's fingerprint_v2 in a marker in its body.
    Verification: A test confirms the candidate body text includes the fingerprint_v2 value.
  • Criterion 4: Before a hand-off, a finding whose fingerprint an existing open issue already carries is left out.
    Verification: A test confirms a second run does not pass a finding with a matching fingerprint to intake.
  • Criterion 5: devops review intake hands qualifying OPEN or CONFIRMED tool findings to intake_candidate.
    Verification: A test with a fake intake confirms only OPEN or CONFIRMED findings from a qualifying session are passed.
  • Criterion 6: review path prints the count of qualifying findings and the devops review intake command. It calls no model and no GitHub API.
    Verification: A test confirms the printed output and that no network or model calls are made.
  • Criterion 7: review pr and review branch never hand off findings.
    Verification: A parametrized test confirms no candidates are passed for pr and branch target types.
  • Criterion 8: docs/SELF_IMPROVEMENT.md routes merged-code findings through devops review intake.
    Verification: rg -n 'devops review intake' docs/SELF_IMPROVEMENT.md returns at least one match.
  • Criterion 9: The new tests run offline and take under 1 s in total.
    Verification: uv run pytest tests/ -k review_intake --timeout=1 passes with no network access.

Key questions

  • What counts as merged code?: The head commit is reachable from origin/main (git merge-base --is-ancestor), the tree is clean, and the target type is path. (proposed)
  • Does finding severity set priority?: No. Intake decides priority. CRITICAL severity alone is not P0 evidence. (proposed)
  • One candidate per finding, or one per session?: One candidate per finding. Each finding becomes its own item. The fingerprint check merges repeats. (proposed)
  • Do UNVERIFIED or INVALIDATED findings ever hand off?: No. Only OPEN or CONFIRMED tool findings hand off. (proposed)
  • Does the fingerprint check agree with the 2026-10-25 decision that intake never drops a candidate?: Yes. That decision is about model-only duplicate verdicts. A fingerprint_v2 match is the same finding, not a model verdict. (proposed)
  • Does a finding whose issue is closed get filed again?: No for not planned (a person rejected it; a suppression in .devops/review.toml is the fix). Yes for completed (the defect came back). (proposed)
  • Is the hand-off an explicit command or a side effect of every review path run?: An explicit command: devops review intake . It is not a side effect of every review path run. (proposed)

Fit

Needs splitting into 3 items:

  1. Session records what it reviewed: head commit, clean flag, and merged-code predicate
  2. Fingerprint check: filed candidate carries fingerprint_v2; a finding with a matching fingerprint in an existing issue is left out before hand-off
  3. Hand-off command: devops review intake with --dry-run/--plan/--confirm; review path prints count and command; docs rewrite

Suspected block

None.

Dependencies

#877

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

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

    @dan-petty
    OwnerAuthor

    Review redesign (#1137, 2026-10-03): this item is a phase P4 child (P4-3): intake takes OPEN or CONFIRMED tool findings on merged code, read from #871's admitted set.

  3. added this to the v0.2.37 milestone on Oct 17, 2026
  4. dan-petty commented on Oct 17, 2026

    @dan-petty
    OwnerAuthor

    Moved to v0.2.37: v0.2.37 started with fewer than its 16 items and was topped up to 16 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)

  5. removed this from the v0.2.37 milestone on Oct 17, 2026
  6. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    This item cannot be built as written. Its blocker #771 is closed, and its goal stays in the plan of #1137 (P4-3, owner decision D13, 2026-10-17). But one mechanism that it relies on no longer exists, and one part waits on an open item. No code was written.

    Evidence (origin/main bb46660, 2026-10-28)

    1. Intake no longer absorbs a repeat. The item says: "Intake's duplicate check absorbs the same finding raised again by a later session." Since fix(roadmap): intake files and places a candidate that the model judges a duplicate, and names the possible original, instead of dropping or closing it #2223 (owner decision 2026-10-25: intake never drops a candidate), intake files and places every new candidate. A duplicate verdict of the model only names a possible original in the reason comment (_Planner._propose → _place, possible_duplicate, src/devops_cli/roadmap/intake.py). Each candidate must also cite its session id, so two sessions never give the same body, and the resume match on title and body does not apply. Result: each review path run on merged code files every qualifying finding again as a new issue.
    2. A confirmed finding has no writer yet. FindingState.CONFIRMED is defined in src/devops_cli/review/state.py, but no code sets it. devops review verify still writes status VERIFIED, INVALIDATED or MITIGATED into findings.json and candidates.json. feat(review): feedback export counts each review subject once and keeps every human verdict #877 (open) makes a person's valid verdict set CONFIRMED. So the review verify hand-off waits on feat(review): feedback export counts each review subject once and keeps every human verdict #877.
    3. A session records no commit and no clean flag. review_subject (src/devops_cli/ai/review/history.py) holds the target type, the ref and a digest of the pages. ReviewProfile (src/devops_cli/ai/review/profile.py) holds target and the tree commit only inside each tool run record. The 2026-10-08 update already said so.
    4. The volume is not bounded. One candidate per finding means one intake run, with an embedding call and one model call, for each OPEN tool finding. A review of release/v0.2.25 admitted 41 tool candidates per run (feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 baselines). A review path of a directory on main can give more, on each run.

    Proposed re-scope, as three items

    1. The session records what it reviewed. findings.json records the head commit and whether the tree was clean. A session is "on merged code" when its target type is path, its tree was clean, and git merge-base --is-ancestor <head> origin/main passes. Small, no GitHub request.
    2. One finding is filed one time. The filed issue carries the finding's fingerprint_v2 (fix(security): each finding keeps its own fingerprint across unrelated edits, and deduplication and correlation give one result in every input order, in devops scan and in reviews #1141) in a marker. Before a hand-off, the review leaves out a finding whose fingerprint an issue already carries. This is a deterministic match on the same finding, not a model verdict.
    3. The hand-off. devops review intake <session> hands the qualifying OPEN or CONFIRMED tool findings of one session to intake_candidate (src/devops_cli/roadmap/intake.py), with intake's --dry-run, --plan and --confirm modes. review path prints the count and this command, and calls no model and no GitHub API itself. The review verify hand-off of one CONFIRMED finding comes after feat(review): feedback export counts each review subject once and keeps every human verdict #877. docs/SELF_IMPROVEMENT.md routes merged-code findings through this command.

    Questions for a person

    • Does the fingerprint check of item 2 agree with the 2026-10-25 decision? Proposed: yes. That decision is about model-only duplicate verdicts, and a fingerprint v2 match is the same finding.
    • Does a finding whose issue is closed get filed again? Proposed: no for "not planned" (a person rejected it; a suppression in .devops/review.toml is the fix), yes for "completed" (the defect came back).
    • Is the hand-off an explicit command (proposed), or a side effect of every review path run as the item says? A side effect costs one model call for each finding on each run, also in intake's default --plan mode.
  7. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Owner decision, 2026-10-28: the proposed re-scope and the proposed answers above are accepted.

    • The fingerprint check of item 2 agrees with the 2026-10-25 decision. That decision is about model-only duplicate verdicts. A fingerprint_v2 match is the same finding.
    • A finding whose issue is closed as not planned is not filed again. A suppression in .devops/review.toml is the fix for it. A finding whose issue is closed as completed is filed again, because the defect came back.
    • The hand-off is an explicit command, devops review intake <session>. It is not a side effect of every review path run.

    This item becomes a parent with three sub-issues, each with its own change and pull request. Items 1 and 2 change different code and can be built at the same time. Item 3 needs both, and its review verify hand-off also needs #877.

  8. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    The proposal at 73d1807 needs splitting into 3 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.

    1. Session records what it reviewed: head commit, clean flag, and merged-code predicate
    2. Fingerprint check: filed candidate carries fingerprint_v2; a finding with a matching fingerprint in an existing issue is left out before hand-off
    3. Hand-off command: devops review intake with --dry-run/--plan/--confirm; review path prints count and command; docs rewrite
  9. added
    status/new
    value/medium
    effort/medium
    on Oct 28, 2026
  10. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    All three parts of this item are merged:

    The review verify hand-off of one CONFIRMED finding follows #2414, which makes a person's valid verdict set CONFIRMED. openspec/changes/archive/2026-10-28-2420-review-intake-command/ records it under "Workflow follow-up".

  11. removed
    status/new
    on Oct 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/reviewtype/featurevalue/medium

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions