feat(extensions): expose authoritative review snapshots - #833
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR adds extension API v8 with deeply immutable, generation-aware snapshots of authoritative review files and saved notes.
Confidence Score: 4/5The PR appears safe to merge, with only the non-blocking need to colocate the exporter helper unit test with its source module. The generation-bound producer state, capability lease, immutable projection, and stale-work checks prevent the investigated runtime failures; the sole accepted concern is test organization. Files Needing Attention: scripts/review-snapshot-export-extension.test.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant E as Extension command
participant C as Review controls
participant L as Capability lease
participant P as ReviewProducer
participant S as ReviewStore
E->>C: snapshot()
C->>L: isLive()
alt lease expired or generation retired
C-->>E: null
else lease remains live
C->>P: getPositionedReviewState()
P->>S: getSnapshot()
S-->>P: immutable state position
P-->>C: generation + state
C-->>E: frozen public projection
end
Prompt To Fix All With AI### Issue 1
scripts/review-snapshot-export-extension.test.ts:1-6
**Colocate the exporter unit test**
This unit test exercises helpers in `examples/extensions/review-snapshot-export/index.ts` but resides in the separate `scripts/` directory, making the implementation and its coverage easier to overlook or maintain independently. Move the test beside the extension source to follow the repository's unit-test colocation requirement.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(extensions): expose authoritative r..." | Re-trigger Greptile |
| import { describe, expect, test } from "bun:test"; | ||
| import { resolve } from "node:path"; | ||
| import { | ||
| resolveSnapshotExportPath, | ||
| snapshotPositionMatches, | ||
| } from "../examples/extensions/review-snapshot-export"; |
There was a problem hiding this comment.
Colocate the exporter unit test
This unit test exercises helpers in examples/extensions/review-snapshot-export/index.ts but resides in the separate scripts/ directory, making the implementation and its coverage easier to overlook or maintain independently. Move the test beside the extension source to follow the repository's unit-test colocation requirement.
Rule Used: In the modem-dev/hunk repository, the test-colocat... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/review-snapshot-export-extension.test.ts
Line: 1-6
Comment:
**Colocate the exporter unit test**
This unit test exercises helpers in `examples/extensions/review-snapshot-export/index.ts` but resides in the separate `scripts/` directory, making the implementation and its coverage easier to overlook or maintain independently. Move the test beside the extension source to follow the repository's unit-test colocation requirement.
**Rule Used:** In the modem-dev/hunk repository, the test-colocat... ([source](https://app.greptile.com/modem/github/modem-dev/hunk/-/custom-context?memory=5990bfeb-29e6-49e1-9990-e93d64aaf4e1))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Moved the test beside the example implementation as examples/extensions/review-snapshot-export/index.test.ts and updated its relative imports. Targeted tests, typecheck, and lint pass. Fixed in 4c52518.
This comment was generated by Pi using gpt-5.6-sol
Summary
ctx.review.snapshot()for deeply immutable, provider-neutral projections of the activeReviewStoreCompatibility
This is additive. Existing patch, source, selection, event, pane, file-view, and highlighting surfaces remain unchanged. Extensions that require snapshots can declare API v8; extensions targeting earlier API generations continue to load.
Testing
bun run test— 3023 passed, 10 platform skipsbun run test:integration— 121 passedbun run typecheckbun run lintbun run deps:checkbun run check:packbun run check:docsbun run changeset:statusThis PR description was generated by Pi using gpt-5.6-sol