Repository navigation
refactor(repair): consolidate duplicated helpers - #1114
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 9:22 PM ET / August 11, 2026, 01:22 UTC. ClawSweeper reviewWhat this changesThis PR centralizes duplicated repair-side hook posting, Gitcrawl store resolution, error fingerprinting, and command-acknowledgement selection while retaining their caller-specific formats and limits. Merge readinessKeep open: current main still has the duplicated repair paths, while this PR consolidates them with a verified shared-hook retry adoption and sufficient real-boundary proof. No actionable patch defect was found. Priority: P3 Review scores
Verification
How this fits togetherRepair automation imports Gitcrawl context, processes command acknowledgements, and sends merge notifications through an OpenClaw hook before recording results. The shared helpers here sit beneath those command and notification entry points and determine their delivery, storage-selection, and duplicate-comment behavior. flowchart LR
A[GitHub and Gitcrawl inputs] --> B[Repair commands]
B --> C[Shared repair helpers]
C --> D[Hook notifications]
C --> E[Gitcrawl imports]
C --> F[Command acknowledgements]
D --> G[Repair records]
E --> G
F --> G
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the consolidation with the shared hook retry contract, preserving the stable idempotency key and the existing caller-specific fingerprint and importer contracts. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug report; the PR supplies a high-confidence after-fix real-boundary scenario for the intentional notifier retry behavior and real SQLite importer paths. Is this the best way to solve the issue? Yes. Reusing the already-established hook client and extracting byte-preserving helper contracts is the narrowest maintainable way to remove the identified repair-side duplication. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 765644804756. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review Current head and PR body now contain the requested real-boundary proof: native loopback HTTP 503→200 retry evidence with stable idempotency identity, old one-shot contrast, real SQLite store fixtures through both importer CLIs, and Docker-backed Crabbox provenance. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
Four repair-side behaviors had drift-prone duplicate implementations: merge notifications bypassed the shared OpenClaw hook client, two Gitcrawl importers independently resolved the same store paths, two publication paths independently hashed the same error detail, and three command-ack paths independently parsed and ranked the same markers.
Why This Change Was Made
This makes each behavior have one owner while retaining the caller-specific wire contracts and limits.
notify-mergenow uses the shared OpenClaw hook client already used by the three sibling notifiers. This intentionally changes transient-failure behavior from one-shot delivery to the shared retry policy. Every retry uses the same existing merge idempotency key.gitcrawl-store.ts; their intentionally differentsqliteJsonbuffer limits remain local and unchanged.sha256:-prefixed event contract byte-for-byte.command-ack-convergence.ts, consumed by all three prior owners with byte-identical behavior.No compatibility shim or old duplicate path remains.
CHANGELOG.mdanddashboard/are untouched.User Impact
There is no user-visible behavior change except that the standalone merge notifier now retries transient OpenClaw hook failures using the same idempotency key, matching the existing sibling notifier behavior.
Real Behavior Proof
Claim: each consolidation preserves its prior observable result, except for the explicitly intended merge-notifier retry adoption.
Exercised surface: the old built merge-notifier CLI and current production notifier function over native loopback HTTP, both built Gitcrawl importer CLIs over real on-disk SQLite stores, error-fingerprint wire formatting, and command-ack convergence.
Scenario and observable result:
origin/maintree is built and its productiondist/repair/notify-merge.jsruns with normal hook environment configuration. A real server bound to127.0.0.1:<ephemeral>receives one POST at2026-08-11T01:08:59.863Z, returns HTTP 503, and the old process records one failed delivery and exits 1 under--strict.runMergeNotifierfunction invoked by the CLI runs with the same arguments and normal hook environment configuration. The same real listener receives POST attempt 1 at2026-08-11T01:08:59.881Zand returns 503, then receives attempt 2 at2026-08-11T01:09:00.887Zand returns 200. Both socket requests carrymerge:openclaw/openclaw#123:merge_canonical:abc123in theidempotency-keyheader and JSON body. The notifier report records one sent delivery and the process exits 0.$FIXTURE_ROOT/gitcrawl-store/data/openclaw__openclaw.sync.db; both importers exit 0 and read theportable-storemarker from that real SQLite file.$FIXTURE_ROOT/home/.config/gitcrawl/gitcrawl.db; both importers exit 0 and read thelegacy-fallbackmarker.$FIXTURE_ROOT/override/configured.db; both importers exit 0 and read theenv-overridemarker.Commands:
Local proof on Node 24.19.0 exited
PROOF_RC=0. The full no-build suite reported 3,307 tests: 3,298 passed, 9 skipped, 0 failed.format:checkpassed.Docker-backed proof used Crabbox 0.41.1,
provider=local-container, leasecbx_5b0de8cbba98(silver-barnacle-695f), imagenode:24-bookworm, Docker 29.4.0, and a clean--fresh-pr openclaw/clawsweeper#1114 --no-hydratecheckout ate94c0fbfe043545bebae5c3bf11fb961ef98a72a. Corepack installed pinned pnpm 11.10.0. jq 1.8.1 was checksum-verified before use. All four proof scripts exitedPROOF_RC=0;build:allandformat:checkpassed. The lease stopped automatically. Final head48009d55171e6ebee4c3212a9f55bc1db55189dcadds only the committed README and machine-readable container provenance for that run.Artifacts, source-extraction hashes, real socket timestamps/statuses, normalized resolved paths, real SQLite hashes, importer path traces, and machine-readable Crabbox provenance are committed under
docs/proof/repair-duplication-merges/.Limits: the proof is deterministic and credential-free. The HTTP endpoint is a loopback-only listener with a disposable token. SQLite fixtures are disposable local files queried by the real importer entry points through a
node:sqlite-backed CLI adapter. No live OpenClaw, Discord, GitHub mutation, workflow, queue, or production service is exercised. The current container run did not repeat the full suite because that gate passed locally with zero failures; therefore the three previously known container blob-hydration failures did not need a new baseline run.Validation
build:all: passed locally and in Docker-backed CrabboxPROOF_RC=0locally and in Docker-backed Crabboxtest:no-build: passed locally — 3,307 tests, 3,298 passed, 9 skipped, 0 failedformat:check: passed locally and in Docker-backed CrabboxOpenClaw Bay
No impact. These changes do not alter lifecycle/review publication, queue/workflow ownership, status/telemetry contracts, or dashboard data. Bay remains observer-only and requires no update.