Repository navigation
Description
Refreshed plan (2026-10-17, unblocking review)
This section supersedes any text below that conflicts with it.
Decisions
- Decision D14 (owner, 2026-10-17): "fix(review): a review records its prompt digest when it starts, and a benchmark arm refuses runs whose prompts or code changed #1050 keeps its prompt-digest half, comparing the digest at start and end." refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 never took this half. Its body does not mention the prompt digest or fix(review): a review records its prompt digest when it starts, and a benchmark arm refuses runs whose prompts or code changed #1050, and it touches the profile only to delete the persona fields.
- A digest that differs at
build()sets the existingcode_changed_during_runflag instead of adding a new field. Reason: that flag and its warning already mean "this run's own inputs moved", and an added untracked prompt file is exactly the editown_source_statedoes not see. - An arm refuses every session flagged
code_changed_during_run, whether its code or its prompts moved. Reason: such a run measured neither the setup it started with nor the one it ended with, so it belongs to no arm.
Scope
- This item delivers three things. The profiler records the prompt digest when the run starts.
build()compares that digest with a fresh one.devops review corpus scorerefuses runs that changed while they ran as benchmark arms. - Done elsewhere: the body's second criterion (record the source state at start, check it at the end, warn and set
code_changed_during_run) shipped with feat(review): review tools install from a tools lock with exact versions, binary checksums and hashed Python requirements, and every review records them #1142 in v0.2.30. It lives atsrc/devops_cli/ai/review/profile.py:189,:318-320and:348andsrc/devops_cli/ai/review/runner.py:945-948, and its test is attests/test_review_profile.py:472-505. - Dropped: "the persona and verifier system hashes". The profile has no such hashes. The persona prompts are
.mdfiles underai/personas/(for exampleai/personas/devsecops/prompt.mdandrole.md), which the prompt digest already covers, and refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150 deleted the verifier. The body's account ofexecute_criterion_commandandverification-unavailabledescribes code that refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150 deleted, so it stays only as history. The stale referenceai/review/profile.py:286(at da50329) is now:345. - Unchanged:
devops review scorelists the digests of the sessions it scores (src/devops_cli/commands/review.py:1655-1661) but does not form arms, so it keeps working as it does now.
Delivery
- One PR, size S, "Fixes fix(review): a review records its prompt digest when it starts, and a benchmark arm refuses runs whose prompts or code changed #1050".
Acceptance criteria
-
ReviewProfiler.__init__computesreview_prompt_digest()once, next totools_lock_digest()(profile.py:188), andbuild()records that start value asprompt_digest. A test makes the digest change between start andbuild()and asserts that the recorded digest is the start's. -
build()computes the digest again and setscode_changed_during_run: truewhen it differs from the start's, so the existing warning prints. Withown_source_statestubbed as unchanged, tests cover an edited prompt and an added untracked prompt.md. -
score_corpus_runsraisesValidationErrornaming each session whose profile recordscode_changed_during_run: true.devops review corpus scorethen exits 1 with that message and scores nothing. A new test sits next totest_an_arm_refuses_sessions_that_ran_different_prompts. - Five places state that the digest is the start's, that
code_changed_during_runalso covers a changed prompt digest, and that runs whose code or prompts changed are refused as arms: the field comments atprofile.py:118and:126-127, the warning text atsrc/devops_cli/lang/en/messages.py:44-48, anddocs/SELF_IMPROVEMENT.md:594-595and:722-726. -
uv run devops cipasses.
Current references (verified at 3dd7fa6)
src/devops_cli/ai/review/profile.py:185-189:__init__reads the tools lock digest and the source state when the run starts.:345is where the prompt digest is still computed atbuild().:348records the source-state comparison.src/devops_cli/ai/personas/__init__.py:73-90:review_prompt_digestglobs every.mdfile underai/tasks/andai/personas/, untracked files included.src/devops_cli/core/repo.py:241-264:own_source_statehashesgit diff HEADand ignores untracked files.src/devops_cli/ai/review/defects.py:1623-1640:_shared_prompt_digestalready refuses mixed digests.score_corpus_runsis at:1643-1680and calls it at:1657.src/devops_cli/commands/review.py:2050-2055: corpus score exits 1 onValidationError.tests/test_review_profile.py:138-140: thefixed_prompt_digestfixture stubs the digest that the new start-time call reads.tests/test_review_defects.py:414-423: the existing test that refuses mixed digests.docs/SELF_IMPROVEMENT.md:594-595: the profile docs say whencode_changed_during_runis true.src/devops_cli/review/analysis.py:795: the explanation stage loads its prompt fromai/tasks, so the digest still matters after refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151.
Dependencies and order
- Nothing blocks this item. The 2026-10-03 freeze and feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137's frozen row for fix(review): a review records its prompt digest when it starts, and a benchmark arm refuses runs whose prompts or code changed #1050 both lifted when feat(review): review tools install from a tools lock with exact versions, binary checksums and hashed Python requirements, and every review records them #1142 landed. feat(review): review tools install from a tools lock with exact versions, binary checksums and hashed Python requirements, and every review records them #1142 closed as completed on 2026-10-09 in v0.2.30. feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 (open, no milestone) drops the row in its own refresh. ADR 0005 does not apply, because the profile is measurement, not a patch to the generator or the verifier.
- refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 (open, v0.2.38) also edits
profile.py. It deletes the persona fields at:147-149and:199-201andrecord_persona_replyat:216-238; its body cites these as:199-238, a span that also holds other state at:202-214. It keepsreview_prompt_digest,ai/personasandai/tasks/review.mdand deletes only four review-only prompts fromai/tasks, so no order is needed; whichever PR lands second rebases. - No milestone: a person plans this S-sized P3 item on the board.
status/blockedcomes off with this refresh.
Problem
profile.json records the prompt digest when the run ends (ai/review/profile.py:286, at da50329). Review session 20261003-021501 (S9) ran at da50329 with digest fe6678c8b4bc291f, but its profile records 48254f0be30580d1, the digest of 0ce4736, because the main checkout moved to 0ce4736 at 02:39:03 while the run was going (.data/review-evaluation-20261003-s9.md). devops-cli runs as an editable install and imports some modules lazily (for example devops_cli.sandbox.host inside execute_criterion_command), so the same move made every verification after 02:39 run new code against old modules: 7 findings ended verification-unavailable: AttributeError ('HostSandboxResult' object has no attribute 'timed_out'). Nothing in the session records that the code changed.
Acceptance criteria
- The profile's prompt digest (and the persona and verifier system hashes) are computed when the run starts and stored then. A test changes a prompt file between the start and the end of a profiled run and asserts the recorded digest is the start's.
- A review records the commit and dirty state of its own source tree at start, checks them again at the end, and when they differ prints a warning and records
code_changed_during_run: trueinprofile.json. A test simulates the change with a stub. -
uv run devops cipasses.
Key questions
- Import everything at start instead? (proposed) No. Lazy imports keep the CLI fast; recording and warning is enough, and the measurement docs already say to run reviews from a worktree that stays put.
Depends on: none.
Order: any time.
Related: #1047 (a branch review reads the commit it reviews), #607 (run identity).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Review
Activity
dan-petty commentedon Oct 3, 2026
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. Its "the review's own code changed mid-run" warning moves into #1142 (the tools lock records every input, and a review warns when devops-cli's own source tree changes during the run). The prompt-digest part goes with #1151. This item stays open, labelled
status/blocked, until #1142 lands, then closes as superseded.[-]fix(review): a review records its prompt digest when it starts and warns when its own code changes during the run[/-][+]fix(review): a review records its prompt digest when it starts, and a benchmark arm refuses runs whose prompts or code changed[/+]chore(main): release 0.4.0 (#1960)