Commit Graph
18 Commits
Author SHA1 Message Date
Roger a734e777a8 refactor(app): export one function per command (#712)
* refactor(app): export one function per command

Step 2 of #710. A command's logic was split between cmd and stage-shaped app calls; cmd now parses flags, calls one function and prints what it returns. An error means the command never ran, and a run that ended early says so in Summary.Err.

* fix(app): check dumpkeys and archive -o up front

A missing output directory was reported only after the keys were retrieved or the files copied.

* docs(rfcs): move restore's input out of the command layer

Restore now discovers its directories in an archive itself, so the command layer no longer holds the data it reads.
2026-11-22 14:45:39 +08:00
Roger 6ddfe48493 refactor: pin CLI output and rename path fields (#711)
Step 1 of #710. Goldens pin what a run prints before the entry code moves, and the renames follow two naming rules added to RFC-001. No behavior change.
2026-11-21 19:18:07 +08:00
Roger c733ac9d6d feat(storage): add --max-storage-value flag (#703)
Each browser capped storage values at its own byte limit, or not at all; one flag now caps decoded characters for every browser (default 2048, 0 = unlimited).
2026-11-19 16:47:37 +08:00
Roger b5eddf799b refactor(app): typed per-command options, render in cmd (#693)
Validate now returns only what each command reads, with -b resolved to browsers or vaults, so no
stage compares against "all"; printing moves to cmd, which already printed the list tables.
2026-11-10 17:00:44 +08:00
Roger a7741eaab2 refactor: name dirs by what they hold, trim exports (#692)
Bare dir now always means a user data dir, so the snapshot root, the export listing, and the
keys.json kind get their own words; names used only inside their package are no longer exported.
2026-11-10 17:00:43 +08:00
Roger 7e6f325508 refactor(app): per-stage inputs and per-dir planning (#689)
* refactor(app): per-command flags and per-stage inputs

One Options bag fed every stage and cmd patched restore's keys into it after validation; each stage now takes what it
reads, dir-level failures are their own type, and cmd prints what a run exported.

* refactor(app): group the plan by dir and profile

Execute now walks the plan's own shape instead of filtering a flat list and looking profiles up by name.

* refactor(app): file code by command and stage

Pure moves: each command's flags and validation sit beside its stage, and execute.go keeps only the runner.

* refactor: read the keychain password in cmd

Prompting and reading stdin are terminal work, so app now receives the password func; cobra already rejects both flags.

* refactor(app): plan each user data dir right before it runs

A run-wide Plan had to drop its extractors and rebuild them with the keychain; per-dir planning keeps one extractor.
2026-11-09 17:25:36 +08:00
Roger 9e9d1c531d refactor: rename identifiers and expand the browser table (#685)
Names say what each thing is: no package stutter, one word per concept, spelled out, none that differ only in case.
The browser table puts one field per line. Wire names (flags, output fields, keys.json) are unchanged.
2026-11-09 17:25:35 +08:00
Roger fce4f288df refactor: drop the archive manifest (#678)
Restore must read v1.1.0's manifest-less archives from the layout, and that path reads every new archive too,
so the manifest only described the layout a second time.
2026-11-02 11:11:55 +08:00
Roger 3e9150249c refactor: rename core types and spell out every name (#677)
Def, Request, DirID, and Source said too little, and short variables and doc comments that skip their name hid intent.
varnamelen and staticcheck ST1020-22 now keep both from coming back.
2026-11-02 11:06:05 +08:00
Roger 0ed920f846 docs: trim code comments to the why (#676)
Comments that restated names or narrated the code are gone, and multi-line ones are cut to a line of why.
Only comments change: each edited Go file has the same token stream as before. winapi and abe come later.
2026-11-02 00:03:03 +08:00
Roger 4e98ba7884 fix: report unreadable sources and tidy the pipeline (#675)
A Stat error other than not-exist was reported as absent, and the --zip archive was readable by other users.
The rest is review follow-up: export no longer prints, one runner type, shared name helpers, a trimmed log API.
2026-11-01 23:42:13 +08:00
Roger c0a03769f1 fix: stop cleanly on Ctrl-C, SIGTERM, and SIGHUP (#668)
A signal killed the process mid-run and left the snapshot's copies of browser files in the temp dir.
The run now stops at its next step, removes them, and ends by the same signal, so the exit status and
calling scripts see what they did before. RFC-012 also keeps the list goldens in cmd.
2026-10-29 15:12:30 +08:00
Roger bbd353f314 refactor: run every command on the pipeline (#665)
dump, dumpkeys, archive, restore, and list now run on the app stages, so cmd's old path goes away.
archive writes manifest.json and restore reads it, falling back to today's layout for older archives.
Windows and macOS smoke matched today's output apart from the planned changes.
2026-10-29 14:15:59 +08:00
Roger 0b8cc23216 refactor: introduce internal/snapshot for copy and zip (#653)
One copier and one zip transport serve archive, restore, and every profile copy, so locked-file handling has one home.
Dropping otiai10/copy takes x/sync out of every binary and testing out of the Windows exe.
2026-10-27 14:54:54 +08:00
Roger 49747bf0ce refactor: move crypto and key retrieval under internal/ (#652)
Crypto stays free of OS calls, so every secret-store read sits behind one masterkey contract.
The macOS v10 retriever reads one run-scoped login keychain handle that Safari will share.
2026-10-27 13:19:45 +08:00
Roger 9937dbf9fb refactor: move leaf utilities under internal/ (#650)
Phase 1: the packages with no project dependencies move first, so every
later phase builds on finished leaves; the goldens pin the behavior.
2026-10-26 16:41:52 +08:00
Roger bf96ba8c80 feat(restore): cross-platform restore via dump engine rebuild (#606) (#611)
* feat(restore): cross-platform restore via dump engine rebuild (#606)

Restore previously required the dump's origin OS, overlaying keys onto locally-discovered browsers. It now rebuilds Chromium engines from the dump's vaults (v2 adds engine kind), so copied data or an archive zip decrypts on any OS.

* fix(restore): polish help text, drop dead check, dedup dump kinds

pflag treats backticked words in flag usage as the value placeholder,
so --data-zip rendered as "--data-zip archive" in help output.
2026-06-12 20:53:00 +08:00
Roger 8936c42d10 refactor(cli): flatten keys export/import into dumpkeys/restore (#608)
* refactor(cli): flatten keys export/import into dumpkeys/restore

The keys noun-group clashed with the flat dump/list verbs; unify on flat verbs and drop the keys parent. Pure rename, no behavior change.

* docs(rfc): add RFC-013 CLI redesign & cross-host restore

The accepted design doc for the flat-verb CLI redesign and cross-platform restore.
2026-06-06 14:34:40 +08:00