Skip to content

feat(review-story): add reusable review story api - #24350

Closed
fcoury-oai wants to merge 1 commit into
mainfrom
codex/review-story
Closed

feat(review-story): add reusable review story api#24350
fcoury-oai wants to merge 1 commit into
mainfrom
codex/review-story

Conversation

@fcoury-oai

@fcoury-oai fcoury-oai commented May 24, 2026

Copy link
Copy Markdown
Contributor

Why

As AI-generated changes become larger and faster to produce, reviewer time shifts from reading authored explanations to reconstructing intent from raw diffs. Current review surfaces are primarily file- and line-oriented; they do not provide a conceptual reading order for understanding a change.

Review Story is an incremental step toward a more semantic review workflow: it produces a reusable, persisted explanation artifact that organizes changed evidence into ordered, cohesive steps while preserving complete diff coverage.

This PR is intentionally limited to generation and persistence of completed story snapshots. It does not add interactive review, risk classification, CI integration, or feedback-memory loops.

What Changed

  • Adds the app-server v2 reviewStory/start, reviewStory/read, and reviewStory/list API surface plus snapshot update notifications and generated schemas.
  • Persists review story snapshots and metadata in the state database.
  • Collects stable file-level diff anchors, asks a constrained model task to group them into cohesive steps, validates anchor coverage, and appends fallback steps when output is incomplete.
  • Documents the completed-snapshot v1 API contract and deferred progressive/UI scope.

How to Test

  1. Call reviewStory/start for a non-empty change source and confirm the response contains an ordered completed snapshot with anchored steps.
  2. Call reviewStory/read and reviewStory/list and confirm the persisted snapshot is returned.
  3. Exercise an incomplete model response and confirm missing anchors are retained through fallback coverage.

Targeted tests:

  • just test -p codex-app-server-protocol passed.
  • just test -p codex-state passed.
  • just test -p codex-app-server passed outside the nested sandbox: 787 passed, 1 skipped.

The Bazel-backed just argument-comment-lint aggregate is blocked locally by the existing LLVM sanitizer-header glob failure; touched Rust literal callsites were inspected during implementation.

Stack

  1. feat(review-story): add reusable review story api #24350 Review Story API (this PR)
  2. #24358 Review Story TUI

@fcoury-oai
fcoury-oai requested a review from a team as a code owner May 24, 2026 16:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +222 to +226
ReviewTarget::UncommittedChanges => {
git_output(
cwd,
&["diff", "--no-ext-diff", "--find-renames", "HEAD", "--"],
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +534 to +538
let mut parts = header.split_whitespace();
let _diff = parts.next()?;
let _git = parts.next()?;
let _old = parts.next()?;
let new = parts.next()?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread docs/adr/0001-review-story-v1.md Outdated
@@ -0,0 +1,42 @@
(eval):5: parse error near `end'
# Review Story v1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Jun 9, 2026
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.

1 participant