Skip to content

perf(store-runtime): coordinate graph publication per project #803

Description

@ScriptedAlchemy

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions