feat(provider-review): define review contracts and vocabulary - #5665
Open
iscekic wants to merge 3 commits into
Open
feat(provider-review): define review contracts and vocabulary#5665iscekic wants to merge 3 commits into
iscekic wants to merge 3 commits into
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of nullable file/overview line counts found no correctness, security, or contract issues. Files Reviewed (3 files)
Previous Review Summary (commit 1428586)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 1428586)Status: No Issues Found | Recommendation: Merge Files Reviewed (9 files)
Reviewed by grok-4.6 · Input: 163.5K · Output: 10.3K · Cached: 162.7K Review guidance: REVIEW.md from base branch |
This was referenced Aug 29, 2026
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.
No new behavior — This change prepares GitLab and Bitbucket reviews without changing the app's current screens or actions.
Summary
ReviewIdentityandReviewOverviewdefine a shared review contract for GitHub, GitLab, and Bitbucket while leaving existing GitHub callers unchanged.ReviewPositionSchema,ReviewCapabilitiesSchema,ProviderReviewStateSchema, andReviewMutationResultSchemapreserve provider-specific positions, capability checks, approval states, and write outcomes.serializeReviewWriteRequestenforcesREVIEW_WRITE_REQUEST_MAX_BYTESat 256,000 serialized bytes;parseReviewCursorrejects mismatched scopes, while legacy endpoint limits remain unchanged.Files
packages/app-shared/src/provider-review/contracts.ts— source, added (+384 lines); defines opaque references, actor and credential identity, revisions, file/context records, threads, reactions, inbox scopes, checks, and merge options. Strict schemas reject unknown fields and requirehttpsaddresses where URLs are present. Versioned resource keys require GitHub user authorization and reject personal Bitbucket integrations; canonical URLs do not authorize access. Positions require paired start fields, a selected-side path, and GitLab base/start revisions while retaining native coordinates. Capabilities evaluate support, version, license, permission, then restrictions; unsupported actions require an explanation and evidence. Recovery choices and expected-head protection remain explicit. GitLab approvals and merge blocking stay distinct; Bitbucket preserves participant states and asynchronous merge tasks. Cursors bind the resource, surface, query, and revision, and limit tokens to 4,096 characters. File content distinguishes available, binary, truncated, and unavailable data; checks distinguish absent, unavailable, and reported results. Results prescribe no retries for confirmed effects, reconciliation for accepted or unresolved effects, declared retry eligibility for rejection, and unfinished-only retries for partial effects. The write limit counts the serialized request, not the unescaped body or character count.packages/app-shared/src/provider-review/index.ts— source, added (+2 lines); exports the review contracts and intent fingerprints without exporting the fixtures.packages/app-shared/src/provider-review/contracts.test.ts— test, added (+341 lines); adds the shared review contract test suite.providerReviewFixtures,availableCapabilityFixture, andreviewCapabilityFixturessupply test-only ownership and capability cases for GitHub, GitLab, and Bitbucket.The matrix preserves unknown GitHub withdrawal actions, unsupported Bitbucket actions, and different revision protections instead of assuming identical support.
Adapters must obtain actual capabilities from the authorized provider; fixture availability does not grant runtime permissions.
Files
packages/app-shared/src/provider-review/fixtures.ts— test fixture, added (+140 lines); defines personal and organization references, with no personal Bitbucket reference. GitHub leaves unapproval and change-request removal unknown; GitLab supplies supported cases for all actions. Bitbucket excludes reactions, branch updates, and automatic merging, with provider evidence for each exclusion. In the fixtures, GitHub and GitLab merge atomically and attach inline comments to revisions; GitLab also protects approvals, while Bitbucket supplies neither.ReviewIntentInputSchemaandproviderReviewIntentFingerprintbind each write intent to the account, review, actor, revision, and complete payload underprovider-review-intent:v1.Strict parsing fixes field order and rejects unknown fields, so edits to comments, review choices, reactions, merge options, or deletion targets change the fingerprint.
legacyGitHubIntentFingerprintpreserves old bytes and field order; removal requires retiring old clients and records plus waiting through the 30-day ledger window.Files
packages/app-shared/src/provider-review/intent-fingerprint.ts— source, added (+60 lines); validates write actions, comment queues, draft references, reactions, review choices, merge settings, and branch-deletion preconditions. The input excludes read actions and rejects unknown fields recursively. Fingerprints preserve array order and optional-field distinctions; the legacy alias leaves existing GitHub fingerprints unchanged.packages/app-shared/src/provider-review/intent-fingerprint.test.ts— test, added (+299 lines); adds the intent fingerprint test suite.PROVIDER_REVIEW_REQUEST_KEYSselects merge-request wording for GitLab and pull-request wording for GitHub and Bitbucket;PROVIDER_REVIEW_STATE_KEYSkeeps shared states separate.Both expose catalog-checked translation keys, not cached text, so callers use the active translator without coupling wording to capability decisions.
The
providerReviewcatalog adds 97 English keys for identity, access, review states, recovery, and merge outcomes; existing GitHub strings remain unchanged.Files
apps/mobile/src/i18n/provider-review-vocabulary.ts— source, added (+153 lines); maps each provider to typed request keys and exports separate state keys. The types check request vocabulary completeness and catalog key validity.apps/mobile/src/i18n/locales/en.json— source, modified (+127 lines); adds wording for review links, ownership, authorization, inbox paging, file context, checks, saved drafts, uncertain outcomes, merge confirmation, and provider limits. The wording distinguishes acceptance from completion and describes unfinished work, GitLab merge blocking, and Bitbucket limitations.apps/mobile/src/i18n/provider-review-vocabulary.test.ts— test, added (+183 lines); adds the mobile vocabulary test suite.Tests: 4 files added (+963 lines):
contracts.test.ts(+341),intent-fingerprint.test.ts(+299),provider-review-vocabulary.test.ts(+183), andfixtures.ts(+140).Generated: 0 files changed.
Verification
Visual Changes
Visual Changes: N/A
Reviewer Notes
mobile-provider-parity-1d93-s1...mobile-provider-parity-1d93-s2.Kilo-Org/cloud./Users/igor/Projects/.worktrees/mobile-provider-parity-1d93.Human steps
No human steps are required before merge or after merge for this level.
Notes
Runtime verification is pending for the cumulative stack; this level adds no visual surface.
Translation is pending for the 97 new English keys; locale parity remains a completion requirement.
Stacked PRs — merge bottom to top. Each level shows only its own diff.
Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.
mobile-provider-parity-1d93-s1— feat(provider-review): add shared identity and stack checks #5663mobile-provider-parity-1d93-s2— feat(provider-review): define review contracts and vocabulary #5665 ← this PRmobile-provider-parity-1d93-s3— feat(provider-review): add safe provider SDK boundaries #5689mobile-provider-parity-1d93-s4— feat(git-token): authorize exact provider review resources #5692mobile-provider-parity-1d93-s5— feat(cloud-agent): preserve provider identity through checkout #5700mobile-provider-parity-1d93-s6— feat(provider-review): expose exact repositories and branches #5705mobile-provider-parity-1d93-s7— feat(mobile): preserve provider launch and recent identity #5711mobile-provider-parity-1d93-s8— feat(mobile): select exact provider repositories and branches #5729mobile-provider-parity-1d93-s9— feat(provider-review): add authorized GitLab review reads #5738 (tip)