Skip to content

chore(samples): serialize concurrent seed runs per company #93

Description

@Fluory

Problem

Two pnpm seed:samples runs for the same company at the same time can interfere: the second run may reject the first run's sample while it is still in PROCESSING (the leftover rule of #84 sees it as abandoned), because processing does not hold the row lock across the (recorded) AI call. Today this is an operator step run once at a time, documented as an assumption in #92; found in the review of #92.

Acceptance criteria

  • A seed run holds a per-company lock for its whole duration (e.g. a session-level advisory lock like lockDuplicateDetection, or a lock row), so a second run waits or stops with a clear message
  • Tested: two concurrent runs for one company create each sample once and reject nothing of the other run
  • Runbook §6 names the behaviour

Security/Privacy affected?

No – synthetic samples only.

Activity

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

Metadata

Metadata

Assignees

Labels

tech-debtDeliberate debt to pay back

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions