Skip to content

feat(provider-review): add reconciled GitLab review actions - #5748

Closed
iscekic wants to merge 8 commits into
mobile-provider-parity-1d93-s10from
mobile-provider-parity-1d93-s11
Closed

feat(provider-review): add reconciled GitLab review actions#5748
iscekic wants to merge 8 commits into
mobile-provider-parity-1d93-s10from
mobile-provider-parity-1d93-s11

Conversation

@iscekic

@iscekic iscekic commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

No new behavior — the new GitLab review actions are not yet available in the app.


Summary

ReviewOperationRequest binds each non-GitHub action to the caller, organization, actor, resource, revision, and fingerprint; reviewEffectOperationKey gives child effects stable identities.
runReviewOperation preserves ReviewEffectResult receipts through failed persistence or reconciliation, so a reused key cannot repeat an uncertain write.
assertReviewTermsAccepted retains content-write consent, and PR_OPERATION_SETTLED_EVENT records individual effects without changing GitHub callers or existing fingerprint bytes.

Files
  • apps/web/src/lib/provider-review/operation.ts — A (added source), 286 lines (+286/-0). Reuses admission, acceptance, settlement, and the analytics outbox in the pr domain with 60-second reconcile-first leases. Requires ownerIntegration, validates stored ownership and action bindings, and rejects mismatched operation keys. Derives child keys with uuidv5 and resource keys from the existing intent fingerprint plus the effect identity. Checks current Terms acceptance before content writes and returns PRECONDITION_FAILED with terms_required when absent. Persists dispatching before execution. Concurrent duplicates cannot dispatch again; settled duplicates return terminal receipts. Retries with the same key only after a stored safe rejection, which it clears before dispatch. Status-only calls require an admitted operation and cannot issue provider writes. Keeps accepted evidence when reconciliation reads fail and keeps confirmations when settlement fails. Stores compact results and provider references below MAX_CANONICAL_RESULT_BYTES; failed persistence leaves reconciliation required. Uses existing analytics intents for completed, failed, and ambiguous effects; aggregate rows and reversible actions emit no extra events.
  • apps/web/src/lib/provider-review/operation.test.ts — A (added test), 526 lines (+526/-0). Adds the focused ledger suite, including persistence and accepted-result recovery checks.

runGitLabReviewOperation requires fresh GitLabReviewAuthorization; statusOnly reads outcomes without dispatch, and ReviewMutationResult reports incomplete batches as partial.
Comments, discussions, reactions, approvals, mergeRequestRequestChanges, merges, deletion, rebases, and auto-merge use separate effects; target, rebase, and deletion lack atomic revision protection.
Auto-merge selects autoMerge or legacy mergeWhenPipelineSucceeds; no public route or mobile control calls this adapter yet.

Files
  • apps/web/src/lib/provider-review/gitlab-write.ts — A (added source), 1,123 lines (+1,123/-0). Implements comments, inline discussions, replies, resolution/reopening, reactions, approval/unapproval, and request-changes state without licensed merge blocking. Checks live grants, capabilities, review identity, revisions, action-specific fields, thread permissions, and reaction ownership. Validates selected paths and exact single-line/range positions; keeps image/file discussions replyable. Publishes up to 100 unique comments or matching owned drafts, then a summary and decision, as separate effects. Stops at unconfirmed effects, returns unfinished-only retries, and preserves original positions. Rejects native drafts with unbound discussion or resolution effects; draft disappearance never proves publication. Applies merge-method and squash policy, uses project squash defaults, and passes supplied commit titles/messages. Guards approval and merge with the source commit; rechecks revision and policy before dispatch. Deletes a source branch only after confirmed merge, using an explicit repository/branch/head binding and excluding default or protected branches. Uses the authorized instance version: autoMerge from 17.11, otherwise mergeWhenPipelineSucceeds. Documents legacy removal only after old instances, clients, records, and the 30-day ledger window no longer need it. Reconciles auto-merge enable/cancel and recognizes a completed merge at the admitted source commit after a lost response. Retains accepted rebases across unavailable status reads, then confirms completion or reports failure without repeating the rebase. Checks provider receipts and state after writes; ambiguous responses require reconciliation, not blind retries.
  • apps/web/src/lib/provider-review/gitlab-write.test.ts — A (added test), 1,295 lines (+1,295/-0). Adds the GitLab write suite, including accepted-rebase recovery, lost auto-merge responses, and unbound native drafts.

Tests: 2 files added — operation.test.ts and gitlab-write.test.ts; 1,821 added lines and 0 removed lines.
Generated: 0 files changed.


Visual Changes

Visual Changes: N/A

Verification

Manual runtime verification has not run. The dispatcher will verify the cumulative stack before marking it human-ready.

Reviewer Notes

Human steps

  • No human step is required before merge or after merge.
  • This level adds no required environment value, secret, migration, flag, deployment order, build submission, or cache reset.

Automated evidence

  • The supplied evidence records 125 passing tests across two suites.
  • All five scoped checks passed: formatting, focused Jest, lint, format validation, and whitespace.
  • These scoped results do not establish final continuous integration (CI), live provider writes, or the completion gate.

Scope and inventory

  • Repository: Kilo-Org/cloud.
  • Worktree: /Users/igor/Projects/.worktrees/mobile-provider-parity-1d93; branch: mobile-provider-parity-1d93.
  • Review range: mobile-provider-parity-1d93-s10...mobile-provider-parity-1d93-s11.
  • Inventory: 4 added files; 2 source files, 2 test files, and 0 generated files; 3,230 added lines and 0 removed lines.

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.

  1. mobile-provider-parity-1d93-s1feat(provider-review): add shared identity and stack checks #5663
  2. mobile-provider-parity-1d93-s2feat(provider-review): define review contracts and vocabulary #5665
  3. mobile-provider-parity-1d93-s3feat(provider-review): add safe provider SDK boundaries #5689
  4. mobile-provider-parity-1d93-s4feat(git-token): authorize exact provider review resources #5692
  5. mobile-provider-parity-1d93-s5feat(cloud-agent): preserve provider identity through checkout #5700
  6. mobile-provider-parity-1d93-s6feat(provider-review): expose exact repositories and branches #5705
  7. mobile-provider-parity-1d93-s7feat(mobile): preserve provider launch and recent identity #5711
  8. mobile-provider-parity-1d93-s8feat(mobile): select exact provider repositories and branches #5729
  9. mobile-provider-parity-1d93-s9feat(provider-review): add authorized GitLab review reads #5738
  10. mobile-provider-parity-1d93-s10feat(provider-review): add authorized Bitbucket review reads #5745
  11. mobile-provider-parity-1d93-s11feat(provider-review): add reconciled GitLab review actions #5748 ← this PR
  12. mobile-provider-parity-1d93-s12feat(provider-review): add Bitbucket review actions and recovery #5756
  13. mobile-provider-parity-1d93-s13feat(provider-review): expose the neutral review facade #5763 (tip)

if (current.review.rebase_in_progress === false && current.review.merge_error === null)
return confirmedReviewEffect(ref);
}
if (input.action !== 'inlineComment') sameRevision(intent.revision, current.revision);

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.

WARNING: Merged-MR revision drift blocks delete-branch 404 confirmation

merge/enableAutoMerge confirm a completed merge at the admitted source SHA before sameRevision (lines 796–801), and the lost auto-merge test mutates base_sha after merge. deleteBranch only confirms via 404 after this sameRevision call. After merge, drifted or omitted diff_refs make sameRevision throw, and the catch returns reconciliation_unavailable — so a lost delete of an already-gone branch never confirms.

Skip sameRevision for deleteBranch the same way merge completion is handled, or move the 404 confirmation above this line.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/lib/provider-review/gitlab-write.ts 817 sameRevision before delete-branch 404 confirm can stick a lost delete after merge
Files Reviewed (4 files)
  • apps/web/src/lib/provider-review/operation.ts - 0 issues
  • apps/web/src/lib/provider-review/gitlab-write.ts - 1 issue
  • apps/web/src/lib/provider-review/operation.test.ts - 0 issues
  • apps/web/src/lib/provider-review/gitlab-write.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous Review Summary (commit 6a73012)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 6a73012)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/lib/provider-review/gitlab-write.ts 817 sameRevision before delete-branch 404 confirm can stick a lost delete after merge
Files Reviewed (4 files)
  • apps/web/src/lib/provider-review/operation.ts - 0 issues
  • apps/web/src/lib/provider-review/gitlab-write.ts - 1 issue
  • apps/web/src/lib/provider-review/operation.test.ts - 0 issues
  • apps/web/src/lib/provider-review/gitlab-write.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 113K · Output: 10.7K · Cached: 355.5K

Review guidance: REVIEW.md from base branch mobile-provider-parity-1d93-s10

@iscekic

iscekic commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Closing: the owner stopped this workflow section. The branch is retained.

@iscekic iscekic closed this Aug 31, 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