Skip to content

feat(loops): enforce durable dispatch leases and retry backoff#100

Merged
ncolesummers merged 3 commits into
mainfrom
codex/96-manifest-concurrency
Jul 27, 2026
Merged

feat(loops): enforce durable dispatch leases and retry backoff#100
ncolesummers merged 3 commits into
mainfrom
codex/96-manifest-concurrency

Conversation

@ncolesummers

Copy link
Copy Markdown
Owner

Summary

  • persist durable dispatch ownership and enforce one active run per repository issue across loop types
  • admit development runs through manifest-resolved concurrency groups, defer over-cap work, and drain queued runs after terminal release
  • add bounded fixed/exponential stage retries plus trace-linked retry runs for stalled and timed-out executions
  • centralize dispatch/retry telemetry and document the durable policy in proposed ADR 0017

Why

The manifest already declared concurrency and retry policy, but persistent development-run creation did not enforce either contract. Concurrent deliveries could therefore exceed the configured cap, overlap work for one issue, or lose retry intent across process restarts.

This change moves admission, lease ownership, queue ordering, finalization, and retry eligibility into database-backed transactions so restart behavior follows durable state rather than in-memory or step-status inference.

Operator and developer impact

  • over-cap runs remain inspectable as queued work instead of being dropped
  • terminal runs release their lease once, then best-effort promote the oldest eligible queued work
  • stage failures retain forensic history while bounded retries become eligible at manifest-computed times
  • stalled and timed-out runs remain immutable and link to a new planning run when retry budget remains
  • research runs participate in cross-loop issue exclusivity, while full research lifecycle enforcement remains deliberately deferred

Review focus

  • lock ordering, partial uniqueness, and migration preflight behavior
  • total-attempt accounting across stage retries and linked terminal retries
  • terminal lease release, replay repair, and queue-drain transaction boundaries
  • trace propagation and low-cardinality telemetry attributes
  • the deliberate absence of a hosted supervisor cadence

Validation

  • bun run validate
    • 75 Vitest files, 470 tests
    • Storybook production build
    • 27 Playwright tests, including responsive and accessibility coverage
  • bun run build
  • focused dispatch/retry/reconciliation/migration/observability suite: 11 files, 100 tests
  • git diff --check

No rendered UI changed, so Issue #96-specific browser screenshots were not applicable.

Known verification boundaries

  • PGlite covers the transaction and invariant behavior but cannot prove true multi-session PostgreSQL FOR UPDATE scheduling; ADR 0017 records that native-Postgres concurrency coverage is still needed.
  • The supplied Claude review artifact did not expose the resolved model identifier, so strict Opus 5 verification remains a review-process gap.
  • No hosted polling cadence is added because the manifest does not define one.

Closes #96

Co-authored with OpenAI Codex (GPT-5).

uidaho-nsummers and others added 3 commits July 26, 2026 17:54
Persist typed run and trace ownership on lease rows, enforce one active run per repository issue, and add migration replay coverage.

Co-authored-by: Codex (GPT-5) <codex@openai.com>
Admit development runs through durable capacity guards, drain queued work, release leases on terminal outcomes, and promote bounded stage or linked-run retries with trace-aligned telemetry.

Co-authored-by: Codex (GPT-5) <codex@openai.com>
Document queued deferral, durable lease ownership, linked retry semantics, observability boundaries, and the deliberate development versus research lifecycle split.

Co-authored-by: Codex (GPT-5) <codex@openai.com>
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
loopworks Ready Ready Preview, Comment Jul 27, 2026 12:56am

Request Review

@ncolesummers
ncolesummers marked this pull request as ready for review July 27, 2026 01:37
Copilot AI review requested due to automatic review settings July 27, 2026 01:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ncolesummers
ncolesummers merged commit 9727357 into main Jul 27, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Loopworks Backlog Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Enforce manifest concurrency, dispatch leases, and retry backoff

3 participants