fix(sync): preserve completed items when another hydration fails - #200
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 13, 2026, 2:44 PM ET / 18:44 UTC (Revision 3). ClawSweeper reviewWhat this changesPreserve completed GitHub issue and PR hydrations through per-item transactions, retain scoped retry failures and checkpoints, and return committed counts alongside partial-sync errors. Merge readiness⛔ Blocked before merge - 2 items remain The change remains necessary: current main still abandons completed acquisitions when another hydration fails. No blocking patch defect was found; the earlier mutex-copy finding is fixed, and the member author explicitly accepted the compatibility changes. Priority: P2 Review scores
Verification
How this fits togetherGitcrawl synchronizes GitHub issues, discussions, and PR details into a local SQLite archive used by search and review tools. Its sync pipeline controls which observations become durable evidence and when successful coverage advances. flowchart TD
A[Selected GitHub items] --> B[Fetch requested details]
B --> C[Consolidate shared workflow observations]
B --> D[Record acquisition failures]
C --> E[Commit each completed item]
E --> F[SQLite archive and evidence]
D --> G[Partial counts and error]
E --> G
E --> H[Advance coverage only on success]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain per-item atomic commits, truthful partial results, and the accepted checkpoint-aware writer contract. Do we have a high-confidence way to reproduce the issue? Yes, from source: let one item finish hydration and make a later comment fetch fail; current main returns before persisting the completed payload. This review did not execute that scenario. Is this the best way to solve the issue? Yes. Per-item transactions preserve useful work while keeping children and derived evidence atomic; scoped failure resolution and checkpoint preservation prevent partial completion from masquerading as successful coverage. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 36b4ec4c4af7. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
What Problem This Solves
Fixes: a failed issue or PR hydration discards completed work for other selected items.
User Impact
User impact: completed items remain available after a partial sync, and failed items appear in the existing failure ledger for targeted retries.
Incomplete
syncandfill-pr-detailsruns return committed counts but exit nonzero, including quota stops. Automation must check the exit status. Older binaries can read the archive, but must not resume writes after a partial sync because they do not honor its retry checkpoint. No schema, configuration, or dependency change is required.Maintainer compatibility decision: accepted. Nonzero quota-stop exits are intentional and approved for this change. Only checkpoint-aware writers may resume partially completed archives.
Why This Change Was Made
Each item now commits atomically with its requested children and derived evidence. Shared-head workflow observations remain consolidated; a failed group cannot discard unrelated completed items. Acquisition stops at the first quota-reserve failure without inventing failures for unattempted requests.
Actual acquisition and rolled-back persistence failures are recorded under the affected operation families. Metadata-only retries cannot clear failed comments or details. A recovered parent clears its prior failure atomically with the retained parent, even if child fetching still fails; stale or rolled-back parents do not. Quota stops retain the stopping request's snapshot without a post-batch credential lookup. Partial batches never certify successful coverage or advance the closed-sweep watermark.
Production code grows by 199 lines net to own per-item persistence, scoped failure resolution, shared-head failure isolation, and a durable retry lower bound using existing storage. Tests grow by 1,418 lines net.
Evidence
Validated at
a6f2fbfdadfafb8b837a8a9a5bc6279851bb79ddwith the existing Go 1.27.1 toolchain:internal/syncertests passed, including sibling ordering, shared-head conflicts and lookup failures, quota request counts, transaction rollback/retry, failure resolution, cancellation, and checkpoint preservation.go vet ./internal/syncer ./internal/clipassed. Initial CI identified a mutex-copy test fixture; each subtest now constructs a fresh client instead.make docs, formatting, andgit diff --checkpassed.Native Linux/macOS/Windows CI and the existing independent review are pending. No deployed binary, live acquisition, or production datastore has been changed.