Skip to content

fix(pr): settle a PR-review plan when Publish to PR is verified - #293

Merged
shingonoide merged 4 commits into
mainfrom
fix/pr-review-delivery-state
Nov 1, 2026
Merged

shingonoide merged 4 commits into
mainfrom
fix/pr-review-delivery-state

Conversation

@shingonoide

@shingonoide shingonoide commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Publish to PR pushes the commit that carries an approved PR-review fix, but only Apply and Sync ever cleared the plan's "not yet on the remote" marker (fix_uncommitted). After a verified publication the plan kept reporting the fix as undelivered and Sync replies stayed unavailable until Apply ran again.
  • When a publication is recorded as Published (including one settled by reconciling an earlier pending push), the remote branch it just read now settles the plan with the same per-item rule Apply and Sync use: the fix commit must be in that branch and its recorded effect still in the tip. The marker is cleared in the same board write as the Published record, as a compare-and-set on the item, so a restart finds both or neither.
  • On the reconcile path the plan is settled only when the record names the same branch and pull request as the confirmed request.
  • A publication record answers a request only when its commit, branch and pull request all match the request. A record for another branch is still settled against its own remote, but it neither answers nor publishes the current request, which is refused so the person can confirm it again. The panel applies the same identity to the answer it receives.
  • Refused, pending and unknown outcomes settle nothing. A repeat answered from an existing record reads nothing and settles nothing. No reply is posted and no other plan field changes. The Human Review approval check is unchanged.
  • The per-item delivery rule is split out of settle_delivery so both callers share it. Its behavior is unchanged.

Testing

Run locally with GIT_CONFIG_GLOBAL=/dev/null, against real local Git repositories and a bare remote (only GitHub's answer is the existing test stand-in):

  • cargo test -p slashit-ui --lib commands::pr: 405 passed (the new reconcile and branch-identity tests failed before their changes)
  • cargo test -p slashit-ui --test pr_review_integration: 27 passed
  • cargo test -p slashit-frontend: 296 + 3 passed
  • cargo clippy in the CI form (-D warnings)
  • cargo fmt --check: not run; publication.rs and pr.rs are already hand-formatted differently from rustfmt on main
  • Full workspace tests and trunk build: not run locally; left to hosted CI

Notes

  • Pushes made outside SlashIt (Auto-push on, a manual git push, or a Published record written before this change) are not repaired here; their plans settle on the next Apply or Sync. Whether Sync should also be enabled for items that have a fix commit but are not yet marked delivered is a UI policy question and is not changed here.
  • Settling reads the repository directory, not the Task Checkout. If Git has pruned the fix's trees the verdict is Absent or Unknown and the plan stays undelivered, which is the conservative outcome.
  • After a refused cross-branch request the panel can still show the task's stored record, which is another branch's Published record for the same commit and pull request, next to the refusal. The backend answer is correct; making the panel's status line branch-aware is left out of this change.

Publish to PR pushes the commit that carries a review fix, but only Apply and
Sync replies ever cleared the plan's "not yet on the remote" marker
(fix_uncommitted). After a verified publication the plan kept calling the fix
undelivered and Sync replies stayed unavailable until Apply ran again.

When a publication is recorded as Published, including one settled by
reconciling an earlier pending push, the remote branch it just read now settles
the plan with the same per-item rule Apply and Sync use: the fix's commit must
be in that branch and its recorded effect still in the tip. The marker is
cleared in the same board write as the Published record, so a restart finds
both. Refused, pending and unknown outcomes settle nothing, a repeat answered
from an existing record reads nothing, and no reply is posted.

The per-item delivery rule is split out of settle_delivery so both callers share
it.
… pull request

When a publication request finds an earlier Pending or Unknown record and
settles it against the remote, the remote branch it read is the record's. The
review plan belongs to the Task's own branch and pull request, so the plan is
now settled from that read only when the record names the same branch and pull
request as the confirmed request. For any other record the reconciled record is
written as before and the plan is left alone.
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 64d12c7 and ba5526a.

Files selected for processing: 6
  • src-tauri/src/commands/pr.rs
  • src-tauri/src/commands/pr/publication.rs
  • src-tauri/src/domain/publication.rs
  • src-tauri/src/domain/task.rs
  • src/components/pr_publication.rs
  • src/components/pr_publication_state.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Publication replay and response matching now include branch identity alongside commit and pull-request identity. After a publication is verified, the command checks which completed review fixes are present on the remote branch. It clears the undelivered marker only when the plan item still matches the observed index, comment ID, fix commit, and completed status. Publication records and matching fix updates are written together. Refused, pending, unknown, and replayed outcomes do not settle fixes.

Possibly related issues

  • BarraDev/slashit issue 183: The changes make publication records branch- and pull-request-specific and verify delivery against the remote branch.
  • BarraDev/slashit issue 173: The changes distinguish verified PR delivery from other review-fix states, but do not implement the broader lifecycle contract.

Possibly related PRs

  • BarraDev/slashit#129: Introduced per-fix commit and effect provenance and the fix_uncommitted rule used by this change.
  • BarraDev/slashit#291: Introduced the publication record and flow that this change extends with identity checks and fix settlement.
  • BarraDev/slashit#110: Preserved fix_uncommitted when review-comment changes invalidate completion; this change clears it only when the observed item still matches.

Change: Bug fix

Merge Risk: Minimal · up to ba552

Verified publication can be recorded even when no review fixes qualify for settlement. No identified issue prevents merging after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly describes the primary correctness change: settling a PR-review plan when Publish to PR verification succeeds.
Description check Passed The description directly explains the changes to publication verification, branch and pull-request identity checks, reconciliation, and clearing fix_uncommitted.
Persistent State Integrity Passed PASS. Changed publication writes use lifecycle::record_typed through write_publication_settling. The lifecycle stages changes, saves the board, and updates shared memory only when the save succeed…
Recoverable Resource Lifecycle Passed PASS. The pull request does not change worktree, migration, or cleanup lifecycle implementation. It only clears fix_uncommitted after verified remote delivery, while retaining fix_commit and `fix_…
Platform Boundary Safety Passed The changed production paths use platform-neutral Rust APIs and existing repository abstractions. The added Unix-specific test hook uses std::os::unix::fs::PermissionsExt, a Unix shell hook, and is …
Full details: Persistent State Integrity

Explanation

PASS. Changed publication writes use lifecycle::record_typed through write_publication_settling. The lifecycle stages changes, saves the board, and updates shared memory only when the save succeeded or the file replacement was published; all callers propagate write errors instead of reporting success. The plan settlement uses the current task staged under the write lock and checks the expected publication record plus item identity before clearing fix_uncommitted, so it does not replace a newer task snapshot with the stale read. The changed paths therefore show no explicit persistent-state integrity failure.

Full details: Recoverable Resource Lifecycle

Explanation

PASS. The pull request does not change worktree, migration, or cleanup lifecycle implementation. It only clears fix_uncommitted after verified remote delivery, while retaining fix_commit and fix_effect. The publication record and marker update use one compare-and-set board write. A failed write leaves the prior state unchanged, or reports PublishedNotDurable; the next request reconciles the pending record. Existing tests cover this retry path.

Full details: Platform Boundary Safety

Explanation

The changed production paths use platform-neutral Rust APIs and existing repository abstractions. The added Unix-specific test hook uses std::os::unix::fs::PermissionsExt, a Unix shell hook, and is gated with #[cfg(unix)]; its only test caller is also #[cfg(unix)]. The added Git/filesystem test setup uses portable std::process::Command and std::fs APIs. No changed code introduces an ungated Windows- or Unix-specific API or an evident cross-platform compile failure.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

… branch

A published record answered a repeated request, and a settled earlier record
answered a request that had reconciled it, when only the commit and the pull
request matched. The same commit and pull request published from another branch
was then reported as the branch the person confirmed, and the panel accepted it.

Replay and the post-reconcile answer check now compare the branch as well. A
record for another branch is still settled against its own remote, but it neither
answers nor publishes the current request, which is refused so the person can
confirm it again. The panel applies the same identity to the answer it receives.
The replay and publish documentation still described a record as matching on the
commit and pull request alone. Say that the branch is part of the identity too.
@shingonoide
shingonoide marked this pull request as ready for review November 1, 2026 22:13
@shingonoide
shingonoide merged commit 60dfd1d into main Nov 1, 2026
16 checks passed
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