feat(review-story): add reusable review story api#24350
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e8a5b2c7c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ReviewTarget::UncommittedChanges => { | ||
| git_output( | ||
| cwd, | ||
| &["diff", "--no-ext-diff", "--find-renames", "HEAD", "--"], | ||
| ) |
There was a problem hiding this comment.
Include untracked files in review stories
For ReviewTarget::UncommittedChanges, the protocol contract is the whole working tree including staged, unstaged, and untracked files, but this command only reports tracked staged/unstaged changes. When a user's change set includes new untracked files (or only untracked files), the generated story omits them or reports no changes, and the fingerprint won't reflect them; please collect untracked-file evidence as well.
Useful? React with 👍 / 👎.
| let mut parts = header.split_whitespace(); | ||
| let _diff = parts.next()?; | ||
| let _git = parts.next()?; | ||
| let _old = parts.next()?; | ||
| let new = parts.next()?; |
There was a problem hiding this comment.
Parse diff headers without splitting paths on spaces
When a changed filename contains spaces, Git's default header looks like diff --git a/dir with space/file name.txt b/dir with space/file name.txt; splitting on whitespace makes the fourth token just with, so the anchor path, summary, prompt, and review focus point at a bogus file. Please parse the diff --git header in a way that preserves paths with spaces (or collect path metadata separately).
Useful? React with 👍 / 👎.
| @@ -0,0 +1,42 @@ | |||
| (eval):5: parse error near `end' | |||
| # Review Story v1 | |||
There was a problem hiding this comment.
Move the general ADR out of docs/
The repo-level AGENTS.md says not to add general product or user-facing documentation under docs/, except app-server API docs. This ADR is a general Review Story product/design document rather than app-server API documentation, so adding it here violates the documented placement rule; please move it to an allowed location or remove it.
Useful? React with 👍 / 👎.
5e8a5b2 to
a881a98
Compare
Why
Large changes are difficult to review as a flat alphabetical diff. Review Story provides a reusable API that converts a change source into an ordered, model-authored narrative with stable diff anchors, so clients can guide reviewers through coherent logical steps.
What Changed
reviewStory/start,reviewStory/read, andreviewStory/listAPI surface plus snapshot update notifications and generated schemas.How to Test
reviewStory/startfor a non-empty change source and confirm the response contains an ordered completed snapshot with anchored steps.reviewStory/readandreviewStory/listand confirm the persisted snapshot is returned.Targeted tests:
just test -p codex-app-server-protocolpassed.just test -p codex-statepassed.just test -p codex-app-serverpassed outside the nested sandbox: 787 passed, 1 skipped.The Bazel-backed
just argument-comment-lintaggregate is blocked locally by the existing LLVM sanitizer-header glob failure; touched Rust literal callsites were inspected during implementation.Stack