feat(code-review): record the reviewed checkout and commit in review output (ISS-9137) - #200
Merged
Merged
Conversation
Collaborator
|
Beginning a code-review. Please allow time for me to finish before merging the PR |
mikeangstadt
approved these changes
Sep 15, 2026
mikeangstadt
left a comment
Collaborator
There was a problem hiding this comment.
Checked the thing that would have made this decorative: resolve-scope really does write review_root, review_root_sha and review_root_tree, so the new envelope fields carry real values instead of always-null. Ran the suite locally, 1396 pass, ruff and pyright clean. One stale doc line inline, not blocking.
shafty023
reviewed
Sep 15, 2026
shafty023
reviewed
Sep 15, 2026
shafty023
reviewed
Sep 15, 2026
shafty023
reviewed
Sep 15, 2026
…ope fields, use resolved helper path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With #191 and #198 merged, the pipeline knows which checkout it reviewed, but nothing a reader sees says so. A review of the wrong tree still looks ordinary.
diff_tipcan't fill the gap, because for a branch review it's the literalHEAD. This PR records the checkout and resolved commit in three places:review_result.jsongainsreview_root,review_root_shaandreview_root_tree(staged reviews only).scope.json, and anything absent or malformed is written asnull.SCHEMA_VERSIONbump (SCHEMA.md §10). The validator rejects any value that is neither a string nornull.footer.jsongainsreviewed_line, whichstart.mdprints under the footer line.**Reviewed:** `<root>` @ `<sha12>`PR #N head @ <sha12> (isolated worktree, removed after review). The same stage deletes that worktree, so it isn't named by path.+ staged index (tree <tree12>).checkout not recorded.render-reviewed-commitsubcommand prints a**Reviewed commit:**line, whichgithub-review.mdembeds right after Status.(PR head)when it matches, or followed by(PR head is <sha12>)when the runner checked out a merge ref.Every value is re-validated before it is printed. A root must be an absolute path free of control characters,
<,>and backticks. A SHA must be hex.The optional
--review-rootoverride from the issue was dropped, becausecampaignalready runs/code-review:deepfrom inside the chunk worktree. ISS-9265 (cwd-relative refs and paths in subagent prompts) stays separate: this change makes that failure visible but does not fix it.Test plan
pytest plugins/code-review: 1396 passed, 3 skippeduv run ruff check .anduv run pyright: clean.git diff --check: cleanreview_rootfrom the enveloperesolve-scope, thenfinalize-result,footerandrender-reviewed-commit:git rev-parse HEADgit write-treescope.json: printsnot recordednullkeys each) and the CLI parser snapshot (1 new parser)Closes ISS-9137.