Skip to content

feat(review): a review session records its head commit and clean tree, and says whether it is on merged code - #2434

Merged
dan-petty merged 2 commits into
mainfrom
feat/2415-review-session-head-commit
Oct 28, 2026
Merged

dan-petty merged 2 commits into
mainfrom
feat/2415-review-session-head-commit

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

A review session now records the checkout it read, and a predicate says whether the session is on merged code. This is part 1 of #883, which the owner split into three items on 2026-10-28. The hand-off of merged-code findings to roadmap intake needs it.

  • When a review starts, it reads the checkout that holds its target: the commit of HEAD, and whether git status --porcelain --untracked-files=all shows a change. findings.json and candidates.json record both as checkout: {head, clean}. A target outside any checkout, or in a checkout with no commit, records checkout: null. Git runs with --no-optional-locks, so the read does not write the index of the reviewed checkout.
  • devops_cli.review.checkout.is_on_merged_code(session, repository) decides it: the subject type is path, the tree was clean, and git merge-base --is-ancestor <head> origin/main passes. A pr or branch session, a dirty tree, and a session with no checkout are not on merged code. A commit that the repository does not hold raises GitOperationError, because the repository cannot tell.
  • The checkout is a field apart from the session's subject, so review history keys each subject as before.
  • ReviewCheckout.head must be a full commit name. findings.json is a file on disk and its head goes to git as an argument, so an option or a symbolic name is refused.
  • devops review verify keeps the checkout when it rewrites findings.json.
  • docs/SELF_IMPROVEMENT.md names the new field.

Closes #2415

Change: openspec/changes/archive/2026-10-28-2415-review-session-head-commit/

…, and says whether it is on merged code

When a review starts, it reads the checkout that holds its target. The
commit of HEAD, and whether the working tree had a change, go into
findings.json and candidates.json as `checkout`. A target outside any
checkout, or in a checkout with no commit, records none.

`devops_cli.review.checkout.is_on_merged_code` decides whether a
session is on merged code: a path review of a clean tree at a commit
that `origin/main` holds. A pr or branch review, a dirty tree and a
session with no checkout are not. A commit that the repository does not
hold raises GitOperationError.

The checkout is apart from the session's subject, so review history
keys each subject as before. The recorded head must be a full commit
name, so findings.json cannot give git an option.
@dan-petty

Copy link
Copy Markdown
Owner Author

Test evidence:

  • The new tests in tests/review/test_review_on_merged_code.py failed first: the module devops_cli.review.checkout did not exist. On the branch, 16 tests pass. The end-to-end test runs devops review path <dir> --reporting-only against a real temporary git repository for a clean tree, a changed tracked file and an untracked file. It makes no model call.
  • Neighbouring suites (history, runner, verification, path routing, path, exporter, pipeline, session store, review, console report, symbol delta, tool sandbox, untrusted tree, tests/review/): 224 passed. After the rebase onto 19412fa: 47 passed in the history, verification, exporter and new files.
  • Full uv run devops ci before the push: every gate passed. The gate warned that the tests took 8 m 42 s, over the 5 m budget. Its slowest entries are setups of AST invariant tests and startup-import tests, which perf(ci): the startup-import tests start 56 interpreters and take 204 s of the suite's 2,423 s #2369, perf(ci): each test shard collects only its own test files #2371 and perf(ci): measure coverage and branch cost #2373 cover.
  • git 2.55.0: merge-base --is-ancestor exited 0, 1, and 128 for an unknown commit.

Pending a person: review the diff in tuicr (tuicr -r origin/main..HEAD).

@dan-petty
dan-petty marked this pull request as ready for review October 28, 2026 15:57
@dan-petty
dan-petty merged commit 8b4ed46 into main Oct 28, 2026
16 checks passed
@dan-petty
dan-petty deleted the feat/2415-review-session-head-commit branch October 28, 2026 15:59
dan-petty pushed a commit that referenced this pull request Oct 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.9.0](v0.8.3...v0.9.0)
(2026-10-28)


### Features

* **ai:** observe the Ollama slot wait by priority and chart its p95
([#2404](#2404))
([ffeeda4](ffeeda4))
* **github:** send GitHub request, throttle and GraphQL point metrics,
and show them on the devops-cli dashboard
([#2406](#2406))
([bded64b](bded64b))
* **k8s:** gpu row panels for clock-event reasons, power against the
enforced limit and pcie throughput
([#2409](#2409))
([21f023c](21f023c)),
closes [#821](#821)
* **review:** a review session records its head commit and clean tree,
and says whether it is on merged code
([#2434](#2434))
([8b4ed46](8b4ed46))
* **review:** an issue filed from a review finding carries its
fingerprint, and the review leaves out a finding that an issue already
carries ([#2428](#2428))
([acace03](acace03))
* **review:** the feedback export counts each review subject once and
keeps every human verdict
([#2417](#2417))
([73d1807](73d1807))
* **roadmap:** act as GitHub App devops-roadmap instead of a machine
account ([#2411](#2411))
([d739a47](d739a47)),
closes [#1647](#1647)
* **roadmap:** labels and milestones hold each item's status, priority,
value and effort, and no roadmap job reads or writes the project board
([#2435](#2435))
([84f02a1](84f02a1)),
closes [#2399](#2399)
* **roadmap:** refine investigates open questions with code and web
tools and decides design questions by the best practice
([#2410](#2410))
([890e228](890e228)),
closes [#2398](#2398)
* **telemetry:** count embedding cache lookups and send every metric
through a declared instrument
([#2416](#2416))
([19412fa](19412fa))


### Bug Fixes

* **git:** ignore missing files when measuring directory size during
reclaim ([#2438](#2438))
([4226904](4226904))
* **security:** scan all namespaces with Popeye when no namespace is
given ([#2436](#2436))
([4d5f789](4d5f789))
* **security:** scan_uv_audit runs a uv audit adapter that audits the
lockfile as it is
([#2446](#2446))
([0b2d005](0b2d005)),
closes [#2106](#2106)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(review): a review session records its head commit and clean tree, and says whether it is on merged code

1 participant