pbm init: ensure PocketBase binary is installed (Bootstrap orchestrator) #3
Labels
No labels
P0
P1
P2
P3
next
project/pb-mirror
ready-for-agent
ready-for-human
review
waiting
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/pb-mirror#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Interface decision from session 2026-08-27:
pbm initshould make the project fully ready, not just write config.Binary#path(lib/pb_mirror/binary.rb:24) already installs on demand, so init auto-install is one message-send away.pbm installstays as the explicit re-download/repair path. Decision memo accepted by the user (option A, init auto-installs,--no-installescape hatch).Tasks
PbMirror::Bootstraporchestrator composing config write, gitignore management, and binary ensure, with injected collaborators and a reporter duckCLI#initbecomes pure dispatch; CLI plays the reporter role (Thorsaymatches the duck); add--installboolean option (default true)--no-installskippbm installremains for re-download/repairAcceptance criteria
pbm init db.sqlitewrites .pbm.yml, updates .gitignore, and downloads the pinned PocketBase binary in one commandpbm init --no-installskips the download and says soProposed approach (advisory — implementation may adjust course)
POODR/99-Bottles design sketched in-session; use or revise as evidence dictates.
New
lib/pb_mirror/bootstrap.rb:CLI#initbecomes:Tests (test/pb_mirror/bootstrap_test.rb) use fakes for all five roles: FakeInit (#call -> ".pbm.yml"), FakeGitignore (warning or nil), FakeBinaryFactory (records received_version and path_requested), FakeReporter (captures [text, color] pairs), lambda config_loader returning a Struct(pocketbase_version, binary_path). Assert outgoing messages, not state. Known trade-off:
install:boolean is a control couple; acceptable at two modes.Origin
pbm initvspbm installafter shipping gitignore management (commit c360dcd)Work started on branch worktree-ticket-3 via os-sdlc pipeline.
Resolution
Done: pbm init now makes the project fully ready in one command: writes .pbm.yml, manages .gitignore, and downloads the pinned PocketBase binary via a new Bootstrap orchestrator (injected collaborators, CLI as reporter duck); --no-install skips the download; pbm install remains the explicit re-download path; README updated.
Evidence: Commit 1bfa1b9 merged to main (fast-forward). Suite: 55 runs, 0 failures, 0 errors, 1 pre-existing skip. Rubocop: 29 files, no offenses. New lib/pb_mirror/bootstrap.rb + test/pb_mirror/bootstrap_test.rb (3 behavior tests via fakes); binary.rb gained rubyzip>=3 extract compat and per-process temp zip name, driven by tests. Pipeline deviations: nested-worktree cleanup; os-sdlc project.yaml was missing (ran setup-project, re-opened); repair-bound exhausted on a test-infra failure (missing minitest/mock require) so final wiring (CLI/README/require placement) was completed manually outside the pipeline after manual verification.
Follow-ups: Ticket-skeptic verdict not run (manual close after pipeline dead-end). Follow-up 1: already captured as #1 (CLI-level integration tests — init→Bootstrap wiring exercised only indirectly). Follow-up 2: file os-sdlc map issue for repair-bound exhaustion on test-infrastructure failures — captured next. No other follow-ups.