Repository navigation
Qualify pack admission ordering and stabilize failed-step replay fixture - #1262
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
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
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
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
run_startedbatch and paginatedevents.listfallback, with negative tests for unrelated, incomplete, or cross-delivery evidence.Admission qualification
ADMISSION.md; no production behavior changes.Written for commit 80cb219. Summary will update on new commits.