fix: bound portable-store init clone and surface reset errors - #164
fix: bound portable-store init clone and surface reset errors#164SebTardif wants to merge 1 commit into
Conversation
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 31, 2026, 12:01 AM ET / 04:01 UTC. ClawSweeper reviewWhat this changesThis PR bounds the initial portable-store clone, returns a failed hard-reset error directly, and adds focused synchronization tests. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 6 items remain Keep open: current main already bounds portable-store initialization in v0.9.3, but still returns the original dirty-pull error when the subsequent reset fails, so this PR retains a useful correction. Its old implementation no longer merges cleanly, leaves interrupted initial clones non-retryable, and has only test-harness proof. Priority: P2 Review scores
Verification
How this fits togetherPortable stores let flowchart LR
A[gitcrawl init] --> B[Portable store URL and directory]
B --> C[Portable-store synchronization]
C --> D{Existing checkout?}
D -->|No| E[Clone Git store]
D -->|Yes| F[Refresh or repair checkout]
E --> G[Configured local database]
F --> G
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Port the remaining reset-error correction into current main, make a canceled initial clone retryable, and demonstrate the repaired CLI path with redacted runtime evidence. Do we have a high-confidence way to reproduce the issue? No. The supplied output exercises test scaffolding with shell Git wrappers, not a real Is this the best way to solve the issue? No. A 90-second clone wrapper against the older implementation is not the best current-main solution; rebase the narrow reset-error repair onto the v0.9.3 portable-operation model and cover interrupted-clone recovery. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning high; reviewed against 7c3e960344df. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
Maintainer triage: the reset-error correction is valid and is preserved in #167, with a current-main implementation, regression coverage for both reset paths, documentation, and contributor credit. Thanks @SebTardif. I recommend closing this older PR after #167 lands. Its clone timer is already covered by the operation-wide deadline in main, and this fork head conflicts with the newer portable-store implementation. Real CLI proof used a synthetic SQLite archive and real Git on macOS. An upstream file collided with a local untracked file while an immutable The interrupted-clone concern is also reproducible on current main: a real Git HTTP request stalled until the existing deadline fired after 121.18 seconds, but the partial destination remained. Retrying the identical init command after restoring the endpoint failed because the partial checkout had no |
Return the reset error after a dirty merge so operators see the failure that actually prevented recovery. Cover both recovery branches and preserve the portable runner's sanitized error classification. Adapted from the diagnostic correction in #164; the initial clone already has an operation-wide deadline on current main. Co-authored-by: Sebastien Tardif <sebtardif@ncf.ca>
|
Thanks, @SebTardif! Your reset-error correction has landed via #167 in 216b2a2, with your co-author credit and changelog thanks preserved. Closing this PR as superseded. I appreciate the contribution! |
What Problem This Solves
gitcrawl init --portable-storeclones the store with no deadline. A stalled HTTPS remote hangs the command until someone kills the process. Repair and refresh already bound the same git helper to 90s. A dirty checkout that failsgit reset --hardalso reports the original merge-dirty message instead of the reset failure, so operators chase the wrong error.Evidence
terminal output from the patched tree:
Init clone now uses
context.WithTimeout(ctx, portableStoreRepairTimeout). A failed reset after a dirty pull returns the reset error, matching the sibling path in the same function.Real behavior proof
Behavior addressed: portable-store init clone is bounded, and a failed hard reset surfaces the reset error.
Real environment tested: macOS, Go, patched gitcrawl worktree.
Exact steps or command run after this patch: go test ./internal/cli/ -count=1 -run TestSyncPortableStoreDirtyPullSurfacesResetError
Evidence after fix: terminal output copied below.
Observed result after fix: dirty-pull reset failure is the reset error; init clone honors the 90s repair deadline.
What was not tested: a live hung HTTPS remote on the public internet.