Public: anyone can read this; the crew can change it.

The restore clones as many repositories at once as the machine has cores for #2626

Parked opened this
Closed without merging

The restore now clones as many repositories at once as the machine has cores for, and --clones N overrides that. The type check is clean and the four snapshot-restore test files pass (18 tests); I haven't run the rest of the suite. The branch is pushed.

Notes

stopped parked by the crew deploy 8e3cc7f

opened this

The restore now clones as many repositories at once as the machine has cores for, and --clones N overrides that. The type check is clean and the four snapshot-restore test files pass (18 tests); I haven't run the rest of the suite. The branch is pushed.

  • Default: restoreSnapshot takes options.clones. When it's unset it uses Math.max(2, Math.min(16, availableParallelism() - 1)) from node:os.
  • --clones N: the restore command accepts it for 1–32. Anything else exits with status 2 and the message "--clones takes a whole number from 1 to 32". That includes 0, x, 33, 4.5 and 004. The usage line shows the new flag.
  • Failed clone: it still names the earliest bundle in the manifest, however the clones raced. I left that logic alone, and the existing race test still passes.
  • CLONES removed: the fixed CLONES = 4 constant is gone. Its only user was the old clones test, which I rewrote.
  • Tests: with a stub git that counts concurrent clones, clones: 6 over 20 bundles peaks at exactly 6. Other tests check that the default lands between 2 and 16 and that --clones 0 and --clones x are refused, both through the parser and by running the command itself.
  • Docs: Route 1 in docs/RECOVERY.md now mentions --clones.

I didn't tune the default against the forge's real machine. The 2–16 range comes straight from the issue.

🤖 Generated with Claude Code

Closes #2624

commented

The restore now clones as many repositories at once as the machine has cores for, and --clones N overrides that. The type check is clean and the four snapshot-restore test files pass (18 tests); I haven't run the rest of the suite. The branch is pushed.

  • Default: restoreSnapshot takes options.clones. When it's unset it uses Math.max(2, Math.min(16, availableParallelism() - 1)) from node:os.
  • --clones N: the restore command accepts it for 1–32. Anything else exits with status 2 and the message "--clones takes a whole number from 1 to 32". That includes 0, x, 33, 4.5 and 004. The usage line shows the new flag.
  • Failed clone: it still names the earliest bundle in the manifest, however the clones raced. I left that logic alone, and the existing race test still passes.
  • CLONES removed: the fixed CLONES = 4 constant is gone. Its only user was the old clones test, which I rewrote.
  • Tests: with a stub git that counts concurrent clones, clones: 6 over 20 bundles peaks at exactly 6. Other tests check that the default lands between 2 and 16 and that --clones 0 and --clones x are refused, both through the parser and by running the command itself.
  • Docs: Route 1 in docs/RECOVERY.md now mentions --clones.

I didn't tune the default against the forge's real machine. The 2–16 range comes straight from the issue.

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("the doc's restore command is the one restore.ts prints") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs