Repository navigation
Review summary: one schema for claim, points, excerpts, eye items and file notes - #1201
Merged
opencomputer-app[bot] merged 2 commits intoNov 26, 2026
Merged
Conversation
… file notes The summary's shape is a zod schema in the SDK (src/computer/review.ts). Org's review.save validates with its JSON Schema copy, the runner's review_summary tool takes its input schema from the same copy, and the surface parses with the zod schema and renders each part's claim, points, excerpt hunks, eye items and file notes, falling back to first hunks only without excerpts.
opencomputer-app
Bot
requested review from
UtpalJayNadiger,
ZIJ and
motatoes
as code owners
November 26, 2026 03:02
The app's CSP has no script-src, so zod's probe of new Function when a schema is built was reported as a console error in the desktop e2e.
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.
Requested by @igor Zalutski in Slack
Follow-up to #1192. Before this,
review_summarytookpartsasz.record,review.saveonly checked thatpartswas an object, and the contract had no claim, points, excerpts, eye items or per-file notes (spec S9, R40, section 41).One definition
sdks/typescript/src/computer/review.tsis the only definition of the summary: zod schemasReviewSummary→ReviewParts→ReviewPart { title, claim, points?, files: [{ path, note? }], excerpts?: [{ path, side?, start, end, why? }], eye?: [{ text, path?, line? }] }. All objects are strict, with bounded sizes. Every field has a description written for the agent. The SDK now depends on zod.computer (whose release bundle is
computer/only) and managed-agents (whose dist layout breaks if it imports outsidesrc/) can't import the SDK. Each one gets a generated JSON Schema copy instead.npm run schemain sdks/typescript writes these files, andnpm run schema -- --checkchecks them:sdks/typescript/schema/review.v1.jsoncomputer/schema/review.v1.jsonservices/managed-agents/src/org/review.v1.jsonA test in each of the three packages fails if its copy is out of date.
Org
review.savevalidates{ head, parts }against the schema using@cfworker/json-schema, which it already depended on. If the summary doesn't fit, it refuses withinvalid_requestand the path of the failing field.Runner
review_summarybuilds its input withz.fromJSONSchemafrom the copy, so the descriptions reach the agent. The tool description explains what makes a good summary. The handler PUTs the summary unchanged.Surface
Review.tsxchecks the summary withReviewSummary.safeParse. For each part it shows the claim, the points, excerpt cards (only the hunks the lines fall in, with the lines highlighted), eye items (gathered in the top box, each linking to its file in Full diff), and a file list with the agent's notes. It falls back to each file's first hunks only when the summary has no excerpts.SDK fake
review.savechecks with the same schema. The scripted PR turn and the demo seed now save full summaries.How zod is found
resolve.dedupe: ['zod']in both vite configs and apathsentry in tsconfig. Web resolves its own zod from the SDK source even whensdks/typescript/node_modulesis missing. I checked this with the SDK's zod moved aside:tsc -b, vitest andbuild:desktopall pass.npm ciin sdks/typescript, andsdks/typescript/**is added to its paths.Tests
review.saverefusespartsas an object, empty parts, the old note shape,start: 0and an empty head. There is also a copy-equality test.invoke(), refusal before any call, descriptions present injsonSchema, and copy equality.Review.test.tsxrenders the Summary over a real surface and the fake server, and asserts the claim, points, eye item, file note and the marked excerpt hunk.Redeploy: cloud (managed-agents), host bundle (computer), web.