Skip to content

Large repositories exceed fixed worktree creation and status-probe timeouts #997

Description

@chubes4

Problem

Data Machine Code cannot create or resolve a worktree for the WPCOM repository within its fixed process budgets, even when the primary is fresh and the requested base is a local origin/trunk ref.

Two failures were reproduced:

Worktree creation

studio wp datamachine-code workspace worktree add \
  wpcom fix/dotprod-160-disable-chatgpt-site-builder \
  --from=origin/trunk \
  --skip-bootstrap \
  --skip-context-injection \
  --format=json

Result:

Process command timed out after 30 second(s).

No worktree or branch remained. Native Git then materialized the same 223,451-file worktree successfully in about 40 seconds:

git worktree add -b fix/dotprod-160-disable-chatgpt-site-builder \
  /Users/chubes/Developer/wpcom@fix-dotprod-160-disable-chatgpt-site-builder \
  origin/trunk

Targeted lookup

After native creation and successful DMC refresh-context, exact lookup failed because its status probe has a five-second budget:

worktree_get_status_probe_failed
Targeted worktree lookup status probe failed: Process command timed out after 5 second(s).
cause_code: git_command_timeout

Native git status --short --branch completed and showed a clean branch tracking origin/trunk.

Impact

  • DMC's supported creation path cannot manage a repository of this size.
  • Homeboy's DMC provider cannot resolve the resulting exact handle, blocking Cook before dispatch.
  • The operator had to use native git worktree add and then re-adopt the checkout through refresh-context.
  • Fixed budgets turn repository size into a correctness failure instead of a bounded slow operation with progress.

Expected contract

Worktree lifecycle operations should have operation-appropriate budgets and preserve durable progress for large repositories. Cheap inventory probes can stay short; materialization and exact safety probes need distinct timeout policy.

Acceptance criteria

  • Give worktree materialization a configurable or repository-scaled timeout greater than the current fixed 30 seconds.
  • Emit progress/heartbeat evidence while Git checks out a large worktree.
  • Give exact git status safety probes a configurable budget or a bounded alternate probe suitable for large repositories.
  • Preserve fail-closed cleanliness semantics when status cannot be verified.
  • Return a typed timeout with a resume/retry command and any partial-resource cleanup evidence.
  • Test a synthetic large repository where checkout exceeds 30 seconds and status exceeds five seconds.
  • Prove create, get, refresh-context, Homeboy provider resolution, and cleanup operate without requiring native Git adoption.

AI assistance

  • Model: OpenAI GPT-5.6 Sol
  • Tool: OpenCode
  • Used for: Reproduced the DMC creation and exact-lookup timeouts, compared them with successful native Git behavior, searched existing Data Machine Code issues, and drafted this report. Chris Huber reviewed and owns the issue.

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