Repository navigation
Make branch merge decisions recoverable, replayable, and CI-enforced - #758
Conversation
Persist clone-local merge decision receipts, expose privacy-safe SDK and CLI reporting, and reconcile clean or drifted merges into addressable history events. Pin and audit absolute Git merge drivers with real item paths, enforce workspace-wide history integrity in CI, and add randomized multi-branch convergence coverage plus installed-consumer evidence.\n\nCloses pm-c0wthb, pm-9j2r3b, pm-rh98vo, pm-76dnfg, and pm-pdr8t1.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
Sorry @unbraind, your pull request is larger than the review limit of 150000 diff characters
|
@greptileai please review this broad merge-history and conformance bundle. |
|
@coderabbitai full review |
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 59 minutes. |
📝 WalkthroughWalkthroughThis change adds durable merge-decision receipts, structured conflict reporting, receipt-aware reconciliation, merge-driver configuration audits, CLI reporting, governance diagnostics, stricter CI validation, documentation, tests, and related project-tracking updates. ChangesMerge receipt and reconciliation flow
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant GitMerge
participant MergeDriver
participant ReceiptStore
participant MergeCLI
participant HistoryRepair
GitMerge->>MergeDriver: invoke item merge with %P path
MergeDriver->>ReceiptStore: write merge decision receipt
MergeDriver-->>GitMerge: merged file and receipt summary
MergeCLI->>ReceiptStore: report pending receipts
MergeCLI->>HistoryRepair: reconcile receipt context
HistoryRepair->>ReceiptStore: mark receipts reconciled
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
Merging this PR will regress 1 benchmark
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@gemini-code-assist Acknowledged: this retirement notice means no Gemini finding exists to address on the current head. |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
@coderabbitai Acknowledged the fair-usage status. The run nevertheless started; I am waiting for the exact-head review result before classifying or fixing findings. |
|
@coderabbitai Acknowledged the 37-file review scope and exact commit range. I will respond in each inline thread after the review completes. |
|
@codspeed-hq Acknowledged: all 11 benchmarks are unchanged on exact head 6597510. |
|
@codecov Acknowledged: all modified coverable lines and tests are green; local aggregate coverage is also exactly 100/100/100/100. |
|
@sourcery-ai Acknowledged: the 150,000-character service limit prevented a review, so there is no Sourcery finding to accept or reject. |
|
Tip For best results, initiate chat on the files or code changes.
|
|
Tip For best results, initiate chat on the files or code changes.
|
Install absolute merge drivers before strict storage validation, assert the committed extension-independent fence is reproducible, and keep the CI history scan isolated from developer-global extensions. Record the exact-head failure and focused verification on pm-pdr8t1.
|
@greptileai please re-review exact head 495fb28, including the fresh-clone merge bootstrap fix. |
|
@coderabbitai full review |
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 46 minutes. |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/pm/history/pm-9j2r3b.jsonl:
- Around line 18-23: Before closing pm-9j2r3b, add canonical PM evidence in
.agents/pm/history/pm-9j2r3b.jsonl covering workspace-scope settings, schema,
and relationship artifacts, or explicitly record an accepted deferral; then
synchronize the acceptance and closure metadata in
.agents/pm/tasks/pm-9j2r3b.toon with that canonical decision. Update
.agents/pm/history/pm-9j2r3b.jsonl lines 18-23 and
.agents/pm/tasks/pm-9j2r3b.toon lines 26-50 accordingly, preserving PM history
as the system of record and keeping both records consistent.
In @.agents/pm/history/pm-c0wthb.jsonl:
- Line 32: Update the PM close workflow so canonical resolution and acceptance
metadata are recorded before ownership is released, or explicitly reclaim
ownership before any post-release mutation; do not edit the immutable histories
directly. Apply this to .agents/pm/history/pm-c0wthb.jsonl:32-32 and
.agents/pm/history/pm-rh98vo.jsonl:13-13, using pm and preserving the existing
audit entries.
In `@src/sdk/governance/health.ts`:
- Around line 606-614: The merge diagnostics use inconsistent git workspace root
resolution. In src/sdk/governance/health.ts lines 606-614, retain or refactor
findGitWorkspaceRoot as the canonical shared resolver for
auditMergeDriverConfiguration and listMergeReceipts; in
src/sdk/governance/validate.ts lines 3289-3306, replace the
path.dirname(fenceAudit.path) derivation with that same shared resolution and
preserve the existing null/skip behavior when no root is found. Ensure both
health and strict validation use identical root-resolution conditions.
In `@src/sdk/merge/driver.ts`:
- Around line 243-255: Reorder the merge flow around writeMergeReceipt and the
merged-file write so the output is successfully written before any receipt is
persisted or summarized. Keep the existing receipt parameters and itemPath
guard, but move the writeMergeReceipt call and result.receipt assignment after
the write operation identified by outputPath and merged.
In `@src/sdk/merge/receipts.ts`:
- Around line 90-101: Update resolveReceiptDirectory so it no longer derives
pm-merge-receipts via git rev-parse --git-path. Resolve and return a
repository-level, checkout-independent receipts directory controlled by the
coordinator, ensuring linked worktrees share the same merge-receipt state while
preserving null on resolution failure.
In `@src/sdk/merge/reconcile.ts`:
- Around line 125-149: Update the fulfilled branch of the receipt-only handling
in the receiptOnlyResults loop to derive outcome from settled.value’s actual
changed/audit-entry status, matching the bulk-repair convention used by
runHistoryRepairAll, rather than directly from dryRun. Keep dry_run as the
top-level indicator of whether writes occurred and preserve the existing totals
and history fields.
In `@tests/integration/ci-workflow-contract.spec.ts`:
- Around line 254-283: Create a clean representative item before the existing
drifted item in the test, then corrupt only the second item’s history stream.
Update the fixture setup and identifiers so the CI merge-integrity command
verifies the representative stream while --check-history-drift must scan and
reject the separately corrupted non-representative stream.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d0a95111-74c6-4a70-a759-e06fa2d01114
📒 Files selected for processing (37)
.agents/pm/extensions/.managed-extensions.json.agents/pm/features/pm-feecbs.toon.agents/pm/history/pm-76dnfg.jsonl.agents/pm/history/pm-9j2r3b.jsonl.agents/pm/history/pm-c0wthb.jsonl.agents/pm/history/pm-feecbs.jsonl.agents/pm/history/pm-pdr8t1.jsonl.agents/pm/history/pm-rh98vo.jsonl.agents/pm/issues/pm-c0wthb.toon.agents/pm/issues/pm-rh98vo.toon.agents/pm/tasks/pm-76dnfg.toon.agents/pm/tasks/pm-9j2r3b.toon.agents/pm/tasks/pm-pdr8t1.toon.github/workflows/ci.ymlCHANGELOG.mddocs/MERGE_SAFETY.mdsdk/public-surface.jsonsrc/cli/commands/merge.tssrc/cli/register-mutation.tssrc/sdk/governance/health.tssrc/sdk/governance/validate.tssrc/sdk/history-repair.tssrc/sdk/merge/driver.tssrc/sdk/merge/index.tssrc/sdk/merge/install.tssrc/sdk/merge/receipts.tssrc/sdk/merge/reconcile.tssrc/sdk/merge/three-way.tstests/fuzz/project-boundaries.fuzz.spec.tstests/integration/ci-workflow-contract.spec.tstests/unit/cli/merge-reconcile-registration.spec.tstests/unit/commands/history-repair-command.spec.tstests/unit/commands/merge-reconcile-command.spec.tstests/unit/sdk/merge-receipts.spec.tstests/unit/sdk/merge-reconcile.spec.tstests/unit/sdk/merge-safety.spec.tstests/unit/sdk/tracked-runtime-cache.spec.ts
Persist decision receipts only after output writes succeed, align validate with health workspace discovery, and classify receipt-only reconciliation from the actual repair result. Strengthen CI's negative control so a clean representative smoke cannot mask corruption in another stream. Record the workspace-scope deferral and exact 100% gate evidence in canonical PM history.
|
Exact-head review requested after corrective commit 6ad2718. @coderabbitai full review |
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 16 minutes. |
|
Final bot-surface disposition for exact head
Exact-head GitHub checks are all terminal and green/skipped as designed, including static, 4 coverage shards plus aggregate, Windows/macOS/Linux, CodeQL, Semgrep, Trivy, TruffleHog, ShellCheck, PSScriptAnalyzer, actionlint, CodeFactor, DeepScan, Codecov, docs, compatibility, smokes, and benchmarks. |
|
CodeRabbit follow-up confirmations |
Summary
pm merge report, and reconcile both drifted and already-clean branch merges into addressablemerge_reconcilehistory events%Pitem path, and diagnose missing or drifted driver configurationPM lineage
Closes #754.
Verification
Summary by cubic
Makes branch merge decisions auditable and replayable by storing clone‑local merge receipts, adding
pm merge report, and reconciling merges into addressable history. Pins and audits absolute Git merge drivers with real%Ppaths and enforces repository‑wide history drift in CI; fixes fence‑fails‑open and makes GH‑754’s conflict reports durable. Closes #754.New Features
pm merge reportand auditedpm merge reconcileto write privacy‑safemerge_reconcileevents.%P;validate/healthnow audit driver config and surface pending receipts..gitattributesfence is reproducible, validates all history streams with--check-history-drift, and runs these checks without extensions; adds randomized N‑branch convergence tests.Bug Fixes
merge reconciledistinguishes receipt‑only reconciliation from actual history repair.validatewithhealthworkspace discovery to audit driver configuration and pending receipts consistently.Migration
pm merge installin each clone to refresh driver commands.pm merge reportandpm merge reconcile(or let CI handle it) to capture receipts and reconcile history.Written for commit 6ad2718. Summary will update on new commits.