Repository navigation
Description
The copy arm's pin has no test that swaps the target after it
nostream-cli migrate pg-to-lmdb now opens its target through a descriptor held by
TargetPin (#1162, PR pending). Two of its three arms have a test that swaps the target
after the pin and fails if the arm opens the bare path:
the_verify_arm_reads_the_store_its_pin_names_rather_than_the_replacement and
the_completed_manifest_arm_reads_the_store_its_pin_names_rather_than_the_replacement
(both in crates/nostream-cli/src/commands/migrate.rs).
The copy arm — the one the issue was filed about — has none. Its wiring
(crates/nostream-cli/src/commands/migrate.rs, run_with's copy arm: create_target →
pin.root() → open_target(&root, …) → pin.verify(&options.target) → migrate_with(…, &root, …))
is guarded by the acceptance criteria's greps and by the compiler (both open_target and
migrate_with take the root), and by nothing else. Reverting that arm to
open_target(&options.target, …) would fail no test.
Why it cannot be written today
run probes the source before it creates the target
(PostgresBackend::probe_master_from_env), so without a reachable Postgres the pin is never
reached; crates/nostream-cli/tests/migration_pg.rs is #[ignore]d and needs a database, and
the factory member that built this has none.
What would close it
Either of:
- give
run_withan injectable source the way it already takes an injectableafter_pin
closure, and driverun_over_a_swap's harness with a stubMigrationSource; or - run
runover the same harness inside the CI job that has Postgres, so the copy arm's pin
and open are exercised under a swap end to end.
The harness (run_over_a_swap, prepared_migration, copy_store) already exists and would
need one more line: a store behind the stub source, and the stub target's migrate_with call.
Evidence
build.md§ Round 1a (job031-held-descriptor): the copy arm's pin is unreachable without
Postgres; recorded as the one arm with no test.- Round-2 code review, Note 10: the gap is bounded by
pin.verifysitting between the open and
the first write, so nothing is wrong today — this is missing coverage, not a known defect.
Activity