feat(portable): consume backed-up sources during export - #207
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 real behavior proof before merge. Reviewed September 17, 2026, 9:38 AM ET / 13:38 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds an opt-in Unix export flag that moves a backed-up SQLite database into staging to reduce disk requirements, with safety checks, documentation, and tests. Merge readiness⛔ Blocked before merge - 5 items remain This PR retains distinct value: neither main nor v0.10.0 supports source consumption. No concrete code defect was found; the updated runtime report is useful, but the earlier request for inspectable recovery proof remains incomplete. Priority: P2 Review scores
Verification
How this fits togetherGitcrawl exports its local GitHub archive into compact, validated database artifacts for distribution. This change affects how the source enters staging; shaping, compression, validation, and publication use the existing export pipeline. flowchart TD
A[Configured SQLite archive] --> B{Consume source enabled?}
B -->|No| C[Copy consistent snapshot]
B -->|Yes| D[Check file and lock database]
D --> E[Move source into private staging]
C --> F[Shape and compact archive]
E --> F
F --> G[Validate and publish artifact]
F --> H[On failure discard staging]
Decision needed
Why: This is an intentional destructive capability; implementation checks cannot decide whether that operational contract belongs in the supported CLI. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve copying as the default and admit source consumption only for disposable batch databases under an explicitly accepted, demonstrably recoverable loss contract. Do we have a high-confidence way to reproduce the issue? Not applicable as an existing-behavior bug: this adds a disk-saving mode. The body reports a concrete disk-pressure comparison, but this review did not execute it. Is this the best way to solve the issue? Yes, technically: replacing only initial snapshot acquisition reuses the existing artifact pipeline and preserves defaults; acceptance of the destructive operating contract remains a product choice. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 0bb13412e4c8. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 (1 earlier review cycle)
|
Portable export currently copies the entire source database before removing runtime-only data. For batch jobs with a verified backup, that copy can exhaust the runner disk.
Add explicit
--consume-sourcesupport. It locks and moves an exclusively owned source into private staging on the same filesystem, then uses the existing shaping, validation, compression, and atomic publication path. Ordinary exports preserve their source. Consumption requires rollback journal mode, no sidecars, and a regular file with one link; errors after transfer discard the source, so recovery must already exist.Validation: portable and CLI suites pass, including artifact-identity equivalence, original-file identity through handoff, active reader/writer rejection, aliases, sidecars, cancellation, and recovery after failures during shaping, compaction, and manifest creation. Cross-filesystem refusal is covered on Linux. Vet passes. Hosted checks cover Linux and macOS. No database schema change.
Real CLI proof on a 128 MiB filesystem: an 84,508,672-byte source with 46,538,752 bytes free fails ordinary export with
database or disk is full; consuming export succeeds, producing a validated 233,472-byte database and 9,014-byte gzip archive. An induced post-handoff archive-budget failure preserves the external checkpoint; restoring it and exporting again produces the same artifact identity. An ordinary export with sufficient disk preserves the source and matches that identity. A reader query succeeds, and the CLI rejects a hard-linked source without changing it.The working-space requirement is reduced, not eliminated: a separate fixture containing one 80 MiB row exhausted the constrained filesystem while rewriting that row. Its checkpoint remained available for recovery. Oversized individual records and the final compact database still require free space.