Repository navigation
Description
Problem or Motivation
CONTEXT.md says: "Only a person's valid verdict or a replayed observation confirms" a finding, and the review redesign (#1137, child P2-10, #877) says: "A valid verdict sets CONFIRMED". The code does not do this (origin/main bb46660):
FindingState.CONFIRMEDandFinding.confirmed_byexist (src/devops_cli/review/state.py,src/devops_cli/review/finding.py), but no code sets them.admit()writesconfirmed_by=None(src/devops_cli/review/admission.py:217), andgit grep CONFIRMED srcfinds no other writer.- A session stores no finding state.
findings.sarifholdsbaselineStateand the fingerprints, but not the state (src/devops_cli/security/sarif.py).findings.jsonandcandidates.jsonholdSavedFinding, which has the verdict fields (status,verified_by,verified_at) and no state. devops review verifywrites the verdict withapply_verdict(src/devops_cli/ai/review/verdicts.py) and changes no state.
#877 delivers the other half of P2-10: the feedback export counts each subject once and keys human verdicts by fingerprint v2. This item is the CONFIRMED half, which #877 left out because it needs the design decisions below.
Proposed Solution & Architectural Design
- Decide where a session stores the state of each admitted finding: a SARIF result property (
properties.state,properties.confirmedBy) infindings.sarif, or astatefield onSavedFinding. devops review verify --status VERIFIEDon a finding that has a fingerprint v2 sets its state to CONFIRMED withconfirmed_by="human".- Decide what a later verdict does.
_VALID_TRANSITIONSlets CONFIRMED move only to FIXED, but a person can change VERIFIED to INVALIDATED withdevops review verify. Either the transition table allows CONFIRMED to OPEN for a person's later verdict, or verify refuses the change and names the reason. - Decide whether MITIGATED (the defect is there, but a named guard limits it) also confirms.
- Name the reader of the stored state (for example
review.md,devops review findings, or the feedback export record), so the state is not a field that nothing reads.
Target Subsystem
Code review: src/devops_cli/review/ (state, finding, admission), src/devops_cli/ai/review/verdicts.py, devops review verify, the session files.
Existing Tool Considered
SARIF 2.1.0 has no CONFIRMED state of its own. A result property bag (properties) holds tool-specific data, and suppressions hold suppression state. No tool records a person's verdict as a finding state, so the change uses the SARIF property bag and builds nothing new.
Acceptance criteria
- A person's VERIFIED verdict on an admitted finding sets its stored state to CONFIRMED and records who confirmed it. A test reads the state back from the session files.
- The rule for a later verdict on a CONFIRMED finding is tested.
- A reader of the stored state is named and tested.
Proposed design
Problem statement
A person's VERIFIED verdict on an admitted finding does not set the finding's stored state to CONFIRMED. The Finding model has the state and confirmed_by fields, but no code writes them. The session files hold no state. A person who verifies a finding gets no persisted confirmation record, and no command reads one back.
Acceptance criteria
- Criterion 1: A person's VERIFIED verdict on an admitted finding with a fingerprint v2 sets its stored state to CONFIRMED and records confirmed_by as human.
Verification: Run a test that applies a VERIFIED verdict via apply_verdict, then reads the state and confirmed_by fields back from the SavedFinding in findings.json. - Criterion 2: A person's MITIGATED verdict on an admitted finding with a fingerprint v2 also sets its stored state to CONFIRMED and records confirmed_by as human.
Verification: Run a test that applies a MITIGATED verdict via apply_verdict, then reads the state and confirmed_by fields back from the SavedFinding in findings.json. - Criterion 3: A later verdict that changes a CONFIRMED finding back to UNVERIFIED or INVALIDATED moves its state to OPEN and clears confirmed_by.
Verification: Run a test that sets CONFIRMED, then applies an INVALIDATED verdict, and asserts the state is OPEN and confirmed_by is None. - Criterion 4: The transition table allows CONFIRMED to OPEN for a person's later verdict.
Verification: Call can_transition(FindingState.CONFIRMED, FindingState.OPEN) and assert it returns True. - Criterion 5: A named reader displays the stored state of each finding.
Verification: Run the reader command or function and assert the output includes the state value for a CONFIRMED finding.
Key questions
- Where does a session store the state of each admitted finding?: Add state and confirmed_by fields to SavedFinding. SavedFinding already holds the verdict fields (status, verified_by, verified_at) and is what findings.json and candidates.json persist. The Finding model already has these fields, so the change copies them into the saved form. (proposed) [sources: src/devops_cli/review/finding.py, src/devops_cli/ai/review/verdicts.py]
- What does a later verdict on a CONFIRMED finding do?: Allow CONFIRMED to OPEN. Add FindingState.OPEN to the CONFIRMED row of _VALID_TRANSITIONS. When a person changes the verdict to INVALIDATED or UNVERIFIED, the state moves to OPEN and confirmed_by clears. This matches CONTEXT.md: a person's valid verdict confirms, and a person can change that verdict. (proposed) [sources: src/devops_cli/review/state.py:34, CONTEXT.md]
- Does a MITIGATED verdict also confirm the finding?: Yes. CONTEXT.md defines MITIGATED as the defect being there with a named guard limiting it. Since the defect is there, the finding is confirmed. Both VERIFIED and MITIGATED set state to CONFIRMED. (proposed) [sources: CONTEXT.md, src/devops_cli/ai/review/verdicts.py]
- What is the reader of the stored state?: The devops review findings command displays the state of each finding. The feedback export record from feat(review): feedback export counts each review subject once and keeps every human verdict #877 also includes it. This ensures the state field is read by at least one user-facing output. (proposed) [sources: openspec/changes/archive/2026-10-28-877-feedback-export-per-subject/proposal.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The candidate adds new behaviour: a VERIFIED verdict sets the finding state to CONFIRMED and records the confirmer.It completes a planned review-redesign step but is not a blocking defect or security gap.Users who verify findings gain a persisted CONFIRMED state and a named reader, closing a gap in the review workflow.It needs design decisions on storage location, transition rules, and a reader, plus code changes across state, finding, admission, verdicts, and session files.Both are halves of P2-10; #877 delivers the feedback export half, while this candidate delivers the CONFIRMED-state half that #877 left out.feat(review): the feedback export counts each review subject once and…
dan-petty commentedon Oct 28, 2026
Status set to Ready at 73d1807 (see proposed design in issue body).
feat(review): devops review intake hands the findings of a session on…
chore(main): release 0.23.0 (#2802)