Problem
CodeGraphShardPublicationLocksV1 is documented as serializing scopes that share one project staging store, but the registry is keyed by code_shard (branch/worktree scope). Different scopes therefore receive independent build locks, and manifest projection can finish before the build permit is claimed. Journal resume also retains the replay-pool lock across full seal verification and publication.
Concurrent cold activations can overlap corpus-sized manifests/staging/sealed copies. Existing source comments record 39.9–45.6 GB RSS for a 12.4 GB store, making lock ownership a product-level memory/lifecycle decision.
Required design
- Key publication coordination by project publication shard.
- Hold one permit from manifest projection through publication, with one documented lock order.
- On resume, release replay-pool lock after stable source proof; scan outside it, reacquire, and revalidate exact identity before mutation.
- Replace permanent historical strong lock cells with lifecycle-bound/weak entries.
Acceptance evidence
- Publish 1/2/4/8 distinct worktree scopes for one project and record simultaneous manifest builds plus peak RSS.
- At most one corpus-sized build per project publication shard.
- Retention/replay cleanup is not blocked by seal hashing/materialization.
- Cancellation, retirement races, journal resume, and rollback remain falsifiable.
Problem
CodeGraphShardPublicationLocksV1is documented as serializing scopes that share one project staging store, but the registry is keyed bycode_shard(branch/worktree scope). Different scopes therefore receive independent build locks, and manifest projection can finish before the build permit is claimed. Journal resume also retains the replay-pool lock across full seal verification and publication.Concurrent cold activations can overlap corpus-sized manifests/staging/sealed copies. Existing source comments record 39.9–45.6 GB RSS for a 12.4 GB store, making lock ownership a product-level memory/lifecycle decision.
Required design
Acceptance evidence