resolveShards

internal fun resolveShards(dir: File, shards: List<Shard>, wantEnv: List<String>): ShardPlan

Match shards against what dir already holds.

A changed environment changes what EVERY shard's bytes mean. The delete is housekeeping ONLY — a file another instance holds open survives it on Windows — so correctness rides on envChanged by itself: it forces every lookup to miss, and the rebuild overwrites whatever the delete left behind. Reading the old rows back after a failed delete is exactly how every shard would falsely hit.