Skip to content

Serialize or allocate repository-global migration namespaces #206

Description

@willwashburn

Problem

Factory dispatches independent schema-changing issues in parallel even when they allocate from a serialized global migration namespace (for example, Drizzle migration numbers). Each branch chooses “the next” number; whichever PR lands first invalidates the others and forces repeated renumber/merge repair.

This is not a dependency-ordering problem. The issues can be logically unrelated and have no declared prerequisite edge; they merely contend for the same exclusive namespace.

Observed cost

Evidence comes from head-of-experiments’ survey of the 2026-07-18/19 Factory run in AgentWorkforce/hoopsheet:

Emoji reactions and @mentions are independent features. Their collision is proof that prerequisite graphs cannot model the shared counter.

Not a duplicate of #133

Factory #133, “Dependency-aware dispatch ordering,” handled declared prerequisite chains: issue B consumes issue A’s output, so they should not dispatch together. It cannot see independent issues contending for a shared migration namespace, and closed on 2026-07-20 without covering resource allocation or schema-merge serialization.

Expected behavior

Factory should prevent parallel work from racing an exclusive, repository-global migration namespace, without requiring fake dependency edges between unrelated issues.

Fix directions

Either:

  1. allocate/reserve migration identifiers centrally at merge time, or
  2. detect schema/migration-touching changes and serialize their merge/rebase queue while allowing implementation to proceed in parallel.

Whichever mechanism is chosen should be reusable for other exclusive repository resources, observable in run reports, and covered by a test with two independent issues that both create the next migration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions