Skip to content

Qualify pack admission ordering and stabilize failed-step replay fixture - #1262

Merged
sidneyswift merged 1 commit into
mainfrom
codex/pack-foundation-admission
Nov 17, 2026
Merged

sidneyswift merged 1 commit into
mainfrom
codex/pack-foundation-admission

Conversation

@sidneyswift

@sidneyswift sidneyswift commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

The scheduler's claim-failure fixture released its paused peer when the claim was logged, before the workflow necessarily observed rejection. That could admit another asset and fail the two-provider assertion. The driver now waits for a completed replay delivery that loaded the correlated failed-step event and for active deliveries to drain. It then checks two provider events, the failed claim at attempt one, the next asset still pending, and no settlement before releasing the peer. The actual scheduler, steps, retry settings and final assertions are unchanged.

The fixture-only observer covers the installed SDK's preloaded run_started events and paginated events.list fallback within a separate async context per delivery. The receipt retains run/event/correlation IDs, event source and successful delivery status. Negative tests reject unrelated/incomplete/outside-delivery evidence, failed handlers and cross-delivery event mixing.

Two additional tests exercise the actual dispatcher and strict foundation admission helper with mocked start/database boundaries: execution before the returned run ID fails closed, successful persistence admits the same run, lost persistence leaves dispatch uncertain, and modeled running approval does not start a second run. ADMISSION.md records the remaining contract. These tests qualify the ordering gap; they do not implement an admission wait or establish SQL atomicity. The original failed CI evidence is retained privately.

Validation: 55 focused tests passed; 14 fixture oracle/lifecycle tests and all four compiled scheduler restart/replay scenarios passed with zero network attempts and one settlement each. Scoped pack types, full lint and changed-file formatting passed. Independent source review passed; exact-head CI tracked separately.

Production remains sequential and the foundation factory unwired. No provider, real SQL/storage, authentication, hosted-workflow or manual deployment actions. No new lease, cap, retry, hold or funding policy. Advances existing app #2268/#2273 without closing them. Root owns merge.


Summary by cubic

Qualifies the pack admission ordering gap and stabilizes the scheduler claim-failure fixture so it no longer admits a second provider before rejection is observed.

Fixture barrier

  • The driver now holds the paused peer until a successful completed delivery loads the correlated failed-step event and all deliveries are idle, then asserts two providers, attempt one, and asset-3 still pending.
  • Adds an event observer covering both the SDK's preloaded run_started batch and paginated events.list fallback, with negative tests for unrelated, incomplete, or cross-delivery evidence.

Admission qualification

  • Adds tests exercising the actual dispatcher and strict foundation admission helper: early reads fail closed, successful persistence admits the same run, lost persistence leaves dispatch uncertain, and repeated approval does not re-dispatch a running job.
  • Records the remaining wait/continuation contract in ADMISSION.md; no production behavior changes.

Written for commit 80cb219. Summary will update on new commits.

View guided diff Turn on auto-fix

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
api Ready Ready Preview Nov 17, 2026 10:47pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T22:49:29.483840Z 80cb219 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant PT as packFirstUse.test.ts
    participant PO as processPackOperation
    participant RPC as Owner/Org RPC
    participant WF as Workflow core
    participant RA as readAdmittedPackSnapshot
    participant DB as Mocked Database

    Note over PT,DB: Admission Ordering Qualification (Test Boundary)

    PT->>PO: generate (approval)
    PO->>RPC: approve job
    RPC-->>PO: approved job (status=running)
    PO->>WF: start(workflow, args)
    WF->>WF: Create run + queue execution
    Note over WF: Before start returns run ID
    WF->>RA: readAdmittedPackSnapshot(actor, jobId, "fixture-workflow")
    RA->>DB: Read job workflow ID
    DB-->>RA: Null workflow_run_id
    alt early read (before ID persisted)
        RA-->>WF: throw already-admitted
        Note over WF,DB: FAIL CLOSED - no dispatch
    else after ID persisted (saved outcome)
        RA->>DB: Read job workflow ID
        DB-->>RA: workflow_run_id = "fixture-workflow"
        RA-->>WF: job snapshot (running)
    else write lost (write-lost outcome)
        Note over DB: run write failed
        DB-->>RA: dispatch_state = uncertain
        RA-->>WF: throw already-admitted
    end
    WF-->>PO: return runId
    PO->>DB: run(jobId, runId)
    DB-->>PO: persisted or lost
    PO-->>PT: response
    
    Note over PT,DB: Repeated approval (after running)
    PT->>PO: generate (same approval)
    PO->>RPC: approve job
    RPC-->>PO: dispatch: false (already running)
    Note over PO: No second workflow start
Loading

Auto-approved: Test/documentation-only change: stabilizes the claim-failure scheduler fixture, adds admission-ordering tests and contract docs, with no production behavior or policy changes. Bounded and clearly beneficial.

View guided diff | Turn on auto-fix | Re-trigger cubic

@sidneyswift
sidneyswift merged commit 5602338 into main Nov 17, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
Preview — 80cb219a Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant