Skip to content

fix(repair): merge concurrent router ledgers - #681

Merged
hxy91819 merged 1 commit into
mainfrom
feature/comment-router-ledger-merge
Jul 18, 2026
Merged

hxy91819 merged 1 commit into
mainfrom
feature/comment-router-ledger-merge

Conversation

@hxy91819

Copy link
Copy Markdown
Member

Summary

  • semantically union concurrent comment-router.json command records after state push races
  • preserve terminal command progress and bound the durable ledger to the latest 1000 entries
  • add real two-clone push-race tests plus an automerge resume-intent E2E regression

Root cause

Comment-router workflows publish one shared durable JSON ledger from independent snapshots. When two runs raced, the later rebase/push could overwrite a command already published by the other run. Both workflows then reported success while one automerge command disappeared from durable state.

Validation

  • pnpm run check
  • pnpm e2e:automerge:container -- --scenario resume-intent-persistence --fixture tiny --base-image clawsweeper-automerge-e2e-base:local
  • focused repair build and tests for ledger merge and Git publish races
  • branch autoreview: 0 findings, patch correct
  • diff-scoped gitleaks: no leaks found

Safety

This does not widen filesystem, network, capability, Git alternates, or repository-write boundaries. Semantic merging is limited to the canonical comment-router ledger path selected for publication.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 7:44 PM ET / 23:44 UTC.

Summary
The branch adds semantic merging of concurrent comment-router.json command ledgers in the repair-state Git publish path, plus two-clone race and automerge resume-intent regression coverage.

Reproducibility: yes. from source and the added regression design: two independent clones can publish disjoint snapshots of the same router ledger and a stale later publish can overwrite a remote command. The supplied material does not include an inspectable live run artifact, so confidence is medium rather than high.

Review metrics: 2 noteworthy metrics.

  • Changed surface: 6 files affected; 434 added, 2 removed. The implementation is concentrated in repair publication and its regression harnesses rather than broad workflow churn.
  • Regression coverage: 1 merge-helper test file, 1 two-clone publish-race test, 1 automerge E2E scenario. The PR exercises both the local merge rule and the race path it is intended to protect.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Confirm the pending pnpm check and production automerge-flow results before merge.

Risk before merge

  • [P1] This changes conflict recovery for the shared durable command ledger; maintainers should confirm the semantic merge preserves established command identity and terminal-state ordering under real concurrent publication before merge.

Maintainer options:

  1. Confirm conflict semantics before merge (recommended)
    Review the command-key and terminal-progress ordering against the existing router ledger contract, then merge once the pending automation checks are green.
  2. Pause for a narrower design check
    Hold the PR if maintainers want a different durable-command identity or retention policy before changing rebase conflict recovery.

Next step before merge

  • [P2] This repository-MEMBER automation repair needs maintainer review of the durable-ledger merge contract and pending checks, not an automated replacement or cleanup action.

Security
Cleared: The supplied diff summary changes internal TypeScript repair logic and tests without adding dependencies, permissions, secret access, artifact execution, or widened filesystem/network boundaries.

Review details

Best possible solution:

Retain the narrow canonical-ledger merge, land it only after the pending checks and a maintainer review confirm that concurrent command records remain idempotent and terminal progress cannot regress.

Do we have a high-confidence way to reproduce the issue?

Yes, from source and the added regression design: two independent clones can publish disjoint snapshots of the same router ledger and a stale later publish can overwrite a remote command. The supplied material does not include an inspectable live run artifact, so confidence is medium rather than high.

Is this the best way to solve the issue?

Yes, provisionally: merging only the canonical durable ledger at the existing Git publication conflict boundary is narrower than adding a new store or changing workflow permissions. Maintainer review should still confirm the command identity and terminal-state precedence rules.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3f2bcaaa5e0d.

Label changes

Label changes:

  • add P2: The PR addresses a bounded but meaningful automation-state loss risk in concurrent repair workflows.
  • add merge-risk: 🚨 automation: The patch changes rebase/conflict recovery for durable comment-router state, which can affect automerge command persistence after concurrent workflow runs.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR author is a repository MEMBER, so the external-contributor real-behavior-proof gate does not apply; the PR body nonetheless describes focused two-clone and container-E2E validation.

Label justifications:

  • P2: The PR addresses a bounded but meaningful automation-state loss risk in concurrent repair workflows.
  • merge-risk: 🚨 automation: The patch changes rebase/conflict recovery for durable comment-router state, which can affect automerge command persistence after concurrent workflow runs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR author is a repository MEMBER, so the external-contributor real-behavior-proof gate does not apply; the PR body nonetheless describes focused two-clone and container-E2E validation.
Evidence reviewed

What I checked:

  • Focused automation-state repair: The PR changes six files (+434/-2), introducing a dedicated ledger merge helper, wiring it into publish/rebase conflict recovery, and adding unit, two-clone publication-race, and automerge E2E coverage. (src/repair/git-publish.ts:980, 497a66ebfe12)
  • Member-authored item remains open: The supplied GitHub metadata identifies the author association as MEMBER; repository review policy requires maintainer-authored items to remain open for explicit maintainer judgment. (497a66ebfe12)
  • Current verification state: The supplied checks show focused repair smoke and several integration checks passing, while pnpm check and the production automerge flow were still in progress at review time. (497a66ebfe12)

Likely related people:

  • hxy91819: Authored the focused repair commit and is a repository MEMBER; current-main feature-history ownership could not be confirmed from the available read-only inspection result. (role: current repair-path contributor; confidence: low; commits: 497a66ebfe12; files: src/repair/git-publish.ts, src/repair/comment-router-ledger-merge.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@hxy91819
hxy91819 merged commit 3e090f0 into main Jul 18, 2026
13 checks passed
@hxy91819
hxy91819 deleted the feature/comment-router-ledger-merge branch July 18, 2026 23:53
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant