Skip to content

M1b: execute the pending-review delivery lifecycle and cleanup transaction #827

Closed

Description

@EffortlessSteven

Parentage

Builder contract

This is an execution issue, not a request for another plan or acknowledgement. Completion requires a current-main worktree, implementation, discriminating tests, a review-forward PR, independent exact-head review, hosted CI, merge, and parent/tracker reconciliation. A design note, branch, draft PR, or locally green suite is not completion.

Maintain one integrating writer. Read-only agents may inspect the current post path, historical PR #748, fake-GitHub fixtures, API semantics, and failed CI packets. Do not publish a dependent implementation PR before this one is terminal.

Verified current basis

PR #826 added the pure src/delivery_transaction.rs contract:

  • exact-head planned delivery identity;
  • exact planned/observed set reconciliation;
  • review-bound confirmed receipts;
  • transaction/failure/cleanup states;
  • validated serialization and fail-closed transitions.

The production post path still submits one grouped GitHub review and does not prove a pending-review create → comment reconciliation → head recheck → submit transaction. It does not persist the exact comment IDs GitHub created. This issue wires the existing pure contract to the live transport path.

Outcome

final current-head inline plans
→ fetch current PR head
→ create pending review
→ create inline comments
→ list the comments GitHub actually attached to that review
→ reconcile exact planned and observed sets through #765A
→ fetch current PR head again
→ submit only when the head and comment set still match
→ persist transaction, reconciliation, and delivery receipts

Any failure after pending-review creation must attempt deletion and receipt the cleanup outcome. Until the downstream fallback issue lands, the compiler remains conservative: this issue must not make an unconfirmed finding disappear from the summary.

Scope

  • Trace and update the current cmd_post/post-command path, GitHub API helpers, github_validation, delivery_transaction, artifact writers, verifier mirror, tests, and contract documentation.
  • Add a bounded GitHub-delivery adapter rather than embedding another large network transaction in main.rs.
  • Consume only current-head planned inline items in this slice. Reply transport remains downstream.
  • Bind pending-review creation to the expected head/commit where GitHub supports it and independently re-fetch the live PR head before submission.
  • Reconcile returned comments by exact head, claim, action, path, line, side, body digest, review ID, and comment ID.
  • Submit only a complete, canonical reconciliation.
  • Persist the transaction state and delivery/reconciliation receipts atomically enough that a failed receipt write cannot be reported as delivered.
  • On comment mismatch, stale head, submit failure, receipt serialization failure, or receipt persistence failure: attempt pending-review deletion and record cleanup success or failure separately.
  • Preserve the existing single-submit path as a rollback boundary until the full M1: make inline review delivery transactional and fallback-safe #765 umbrella is proven; do not silently fall back to it after a transactional attempt has begun.
  • Classify GitHub transport failure separately from code findings and required artifact-integrity failure.

Acceptance

  • Complete create → list/reconcile → recheck → submit → persist succeeds and produces exact-head delivery receipts.
  • The first head fetch disagrees with the compiled expected head: no pending review is created.
  • The head changes after comment creation but before submission: submission is refused, cleanup is attempted, and no delivery is confirmed.
  • Partial, unexpected, duplicate, malformed, wrong-review, wrong-head, wrong-anchor, or wrong-body returned comment sets fail closed.
  • Comment creation failure after pending-review creation attempts cleanup.
  • Submission failure attempts cleanup.
  • Receipt serialization and receipt persistence failures are distinct terminal stages and attempt cleanup where possible.
  • Cleanup success and cleanup failure are independently receipted.
  • A partial successful API response cannot mark the transaction complete.
  • A GitHub outage or posting error does not fabricate a defect in unrelated user code.
  • No unconfirmed delivery is used to remove a finding from the body in this slice.
  • The old grouped path remains available as an explicit rollback, not an implicit mid-transaction fallback.

Required proof

  • Fake-GitHub fixtures for every acceptance path, including exact request ordering and payload identity.
  • A success fixture that returns stable review/comment IDs and proves the written receipts round-trip through the verifier.
  • Negative fixtures for stale-head-before-create, stale-head-before-submit, partial/malformed/duplicate comment sets, submit failure, receipt failures, cleanup success, and cleanup failure.
  • A regression proving transport failure is not converted into a code finding or pass evidence.
  • Focused delivery/post/validation tests, then the full binary and workspace contract suites.
  • cargo fmt --all -- --check.
  • cargo clippy --workspace --all-targets --locked -- -D warnings.
  • cargo doc --workspace --no-deps --locked.
  • cargo xtask policy-check.
  • Artifact-verifier self-test and generated-packet verification.
  • Full-context exact-diff RIPR under strict zero.
  • git diff --check.
  • Independent exact-head review and hosted ub-review/gate on the final candidate.

For every validation command, record what it proves and what it does not. A timeout remains unverified, not passed.

Non-goals

Rollback

Disable the transactional adapter and retain the existing grouped-review path while preserving all generated failure/cleanup receipts. Never roll back to a state where planned inline delivery alone suppresses the summary.

Stop conditions

Stop and update this issue with exact evidence instead of improvising when:

  • GitHub's API cannot support the required pending-review identity or cleanup semantics;
  • the live post path cannot be separated without changing #765C/M1: degrade noisy review output without failing unrelated code #766 behavior;
  • an external permission or authority boundary blocks the proof;
  • the candidate develops a second independently acceptable product claim and must be split.

Do not select the downstream issue while this issue has an active candidate, unresolved exact-head findings, or a nonterminal hosted gate.

Completion

Close only after the merged production path proves the complete inline pending-review transaction on current main, the parent #765 and #763 are reconciled with the merge SHA and hosted run, and the worktree/branch/scratch state is cleaned up.

Activity

  1. coderabbitai commented on Aug 4, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #758 - feat(review): narrow current-head claims and adaptive proof planning [merged]
    #779 - feat(review): bind thread context to current head [merged]
    #822 - fix(artifacts): receipt final compiler reconciliation [merged]
    #825 - fix(review): reconcile public claim surfaces [merged]
    #826 - feat(review): define transactional delivery contract (#765) [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    epic
    on Aug 4, 2026
  3. EffortlessSteven commented on Aug 4, 2026

    @EffortlessSteven
    MemberAuthor

    Downstream is now explicit: #828 owns replies, retry idempotence, confirmed-delivery omission, and unconfirmed fallback after this inline pending-review transaction merges. Do not absorb those obligations into #827 merely because the insertion points are adjacent.

  4. EffortlessSteven commented on Aug 4, 2026

    @EffortlessSteven
    MemberAuthor

    Implemented and merged through PR #831 as 55221c1b9832a43f30b36470a0266fced516653d.

    Proof boundary:

    • hosted ub-review/gate run 30960210780 passed at exact head 5254115287b57ccb85e47116529bf03abbbb9fb0;
    • generated artifact verification passed;
    • hosted strict-zero RIPR reported new_unsuppressed=0 with 284 exact hosted-form receipts;
    • clean merged-main verification at 55221c1 passed 751 binary tests, fmt, artifact self-test, and diff hygiene.

    The delivered slice owns pending-review inline creation, exact returned-comment reconciliation, current-head revalidation, submission, validated receipts, and cleanup on pre-submission failure. Replies, retry idempotence, confirmed-delivery fallback, and public-output admission remain in #828, #829, and #830.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions