fix(portable): preserve schema in current-state exports - #149
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 8:37 AM ET / 12:37 UTC. ClawSweeper reviewWhat this changesThe PR preserves empty SQLite table schemas in current-state portable exports while clearing their excluded rows, so read-only clients can report status. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open for normal merge review: it fixes a current-main portable-export defect, resolves the prior changelog finding, and now includes strong read-only real-behavior proof. Priority: P2 Review scores
Verification
How this fits togetherPortable export turns a live Gitcrawl SQLite archive into a compact, shareable current-state database. The resulting database is later opened by read-only Gitcrawl clients, including the status command. flowchart LR
A[Live archive database] --> B[Portable exporter]
B --> C[Current-state profile]
C --> D[Clear excluded history rows]
D --> E[Validated compact export]
E --> F[Read-only status command]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the schema-preserving export repair and regenerate affected current-state portable artifacts. Do we have a high-confidence way to reproduce the issue? Yes: current main drops cluster_groups, while read-only status unconditionally counts it; the branch’s focused regression test reproduces that exact path. Is this the best way to solve the issue? Yes: retaining the established schema while deleting excluded rows preserves the compact-data policy without requiring read-only clients to migrate the export. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning high; reviewed against ff6b2b41861d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
cd8f1d0 to
28d2aed
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Landed via squash onto main.
|
Problem
The exporter deleted empty tables to save space, but
gitcrawl statusstill queries one of those tables. Read-only clients cannot recreate it, so status failed withno such table: cluster_groups.Fix
Regression proof
The new read-only status test fails on
origin/main:The same test passes on this branch.
Real behavior proof
Built the current client from
28d2aed1e73e, then generated a fresh current-state export from a 55,808-thread archive. Export validation reportedquick_check: ok,integrity_check: ok, zero foreign-key violations, and 93,102,080 bytes against the 99,999,999-byte budget.The artifact was made filesystem read-only before either status command. Paths are redacted; JSON is narrowed to status fields.
The unchanged hash proves both clients opened the fresh export without migration.
Validation
GOWORK=off go test ./internal/portable ./internal/store -count=1GOWORK=off go vet ./internal/portablegit diff --checkThe full suite reaches two pre-existing stale-index-lock failures; both reproduce on untouched
origin/main.