Repository navigation
fix: initialize the local database during setup - #236
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: needs changes before merge. What this changesLocal setup initializes the SQLite database before reporting success while preserving cloud and portable-source handling. Example: Run gitcrawl init --runtime-dir /tmp/gitcrawl-demo, then inspect the archive.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR fixes a source-confirmed initialization bug still present on main, with no concrete introduced defect found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe init command resolves archive paths and writes configuration; local storage creates and migrates SQLite, while portable archives retain their existing source-preservation boundary. flowchart TD
A[Init command] --> B[Resolve paths and save config]
B --> C[Select archive mode]
C --> D[Local SQLite initialization]
C --> E[Preserve portable source]
C --> F[Cloud configuration]
D --> G[Report setup success]
E --> G
F --> G
Technical reviewBest possible solution: Land the focused initialization repair after resolving the disposition of the failed required checks. Do we have a high-confidence way to reproduce the issue? Main visibly omits database creation, and the original test's writable open masks that omission; the author also records the revised test failing on pinned main. No target code was executed during this review. Is this the best way to solve the issue? Reusing store.Open fixes initialization at the existing schema owner without duplicating migration logic, and the portable detector preserves the established source boundary. AGENTS.md: found but not applied because it conflicted with ClawSweeper's review contract. Codex review notes: model internal, reasoning medium; reviewed against 15998d822daf. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 10, 2026, 1:14 AM ET / 05:14 UTC (Revision 2). |
0e33a3c to
79dae7a
Compare
What Problem This Solves
Fixes: a fresh local
gitcrawl initreports success but leaves the configured database missing. Read-only commands fail withstat sqlite db: ... no such file or directoryuntil a write command such as sync creates it.User Impact
Local initialization now creates a database with the current schema before reporting success. Users still sync repositories to populate the archive. Cloud initialization and portable sources are preserved, including existing portable checkouts supplied through
--db.Why This Change Was Made
Use the existing storage initialization and migration owner, and the existing portable-store detector to avoid writable opens of source checkouts. The existing relative-path init test used a writable open that created the missing database and masked the bug; it now opens read-only and reads status immediately after init.
Evidence
15998d822daf41071c80ae947ec7388141c3e5c9: the changed regression fails at the read-only open with the missing-database error.TestInitcases pass, including portable and cloud setup (44.061 seconds package time).go vet ./..., docs tests/build, formatting, andgit diff --checkpass.go test ./...was not green: CLI hit its default 10-minute timeout inTestPortableRefreshRefusalsPreserveLastGoodand reported analytics/portable failures. Other packages passed. That run exposed the initial--dbportable-source regression, which is fixed and covered by the passing focused run above; the full suite was not rerun after the correction.Published-release compatibility proof (October 10, 2026)
PASS against candidate
0e33a3cdda53e0593fe0e794c7fe24fe3737dd04using the actual published v0.15.0 Darwin arm64 binary, not a reconstructed fixture. Verified the release tarball against published checksums and the GitHub asset digest:cf08a564146725993d286b65e436aa6f89fd708c1a17d9aa10ba84ae2c2e13a0.init --runtime-dirin isolated state, then a realsync openclaw/gitcrawl --numbers 97 --include-comments --with pr-detailsto populate the archive.init --runtime-diron that populated database. Compared the complete SQLite schema separately. Snapshots were immutable/read-only with all commands closed and no WAL present.idx_threads_repo_embed_orderwas added by the already-merged embedding index fix, andobservation_schema_convergence.checked_observation_sequenceadvanced from 0 to 1, matching the allocator's existing value. No archive data or schema objects were removed.threads ... --numbers 97 --include-closed --jsonreturned exactly the release's result; local keyword search found the PR. Doctor reported current schema 16 and healthy SQLite; integrity and foreign-key checks passed.This proves preservation for a populated published v0.15.0 archive through the actual init/read/search boundary. It does not claim coverage of every older schema or custom configuration; init retains its existing config-writing behavior. No additional production changes were needed for this proof. The previously recorded full-suite timeout and Go-toolchain vulnerability scan failures remain separate validation gaps.
Rebase after the toolchain repair
The separate Go 1.27.2 PR #237 passed all hosted checks and merged as
cec2fc4e65fa159f620839fee436c12aeca90680. This PR is now rebased onto that main revision, at79dae7ac98fe9422f769438fe99bbb4b2ad7ec0f.git range-diffreports both initialization commits unchanged across the rebase. On the new Go 1.27.2 base, the focused init, portable source-preservation, read/doctor refresh, and unrelated-Git-metadata cases pass together (14.010 seconds package time). The published-release preservation proof above remains prior-head evidence for the identical implementation. The historical Go 1.27.1 scan blocker is resolved by the merged toolchain repair; hosted CI is running for the rebased head.