Skip to content

Parallelize fast CI suite with fail-closed evidence - #1728

Merged
michael-wojcik merged 22 commits into
mainfrom
issue-1725-parallel-fast-ci
Nov 23, 2026
Merged

michael-wojcik merged 22 commits into
mainfrom
issue-1725-parallel-fast-ci

Conversation

@michael-wojcik

@michael-wojcik michael-wojcik commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Run the selected fast test suite with fixed pytest-xdist four-worker loadfile execution while keeping both collection checks serial and independent.
  • Migrate fast evidence artifacts to schema v2 and bind the canary, summary, and full-run record by run identity, commit, manifest, selection, outcomes, and exact duplicate-free node-ID sets.
  • Fail closed on worker loss, collection narrowing, terminal-node loss, incomplete or extra outcome accounting, run-identity drift, and inherited pytest environment contamination; keep selected-file skip-allowlist findings advisory.
  • Preserve schema-v3 full-run records, selector semantics, workflow wrapper commands, and full-suite execution behavior.
  • Update all release surfaces to 4.8.36 with the matching changelog entry in the implementation commit.

Review-driven hardening

Fresh warm, cold, and Bugbot review drove these additional corrections; every finding has a recorded fix or disproof and no review thread remains open:

  • First-match header capture, with the captured header persisted in the run artifact so the verifier independently reconstructs collection evidence and binds the header form to the command shape.
  • Actions-gated head_sha ↔ GITHUB_SHA binding, plus test-environment scrubbing so verifier tests cannot inherit a mismatched Actions identity.
  • Type-first input checks and named refusal controls for malformed artifacts, missing identity fields, selection arithmetic, manifest validity, canary parity, unresolved node-ID bases, and invalid selection arguments.
  • A deterministic real fast-runner/fast-verifier late-worker exit-0 control that requires BAD-FIELD-DESELECTED; the xdist controller-abort arm is not accepted as a substitute for that seam.
  • Verified manifest.path identity and an explicit repository root for manifest loading, so plugin-relative and repository-relative paths resolve correctly for manifests outside the repository.
  • Outcome accounting that admits legal multiple terminal events for one collected node, including pass plus teardown skip, while refusing incomplete or extra non-skip evidence. Exact terminal-node equality remains the per-node completeness proof.
  • Recorder deselected from its own hook accumulation, honest non-exhaustive invariant prose, and the skip advisory printed after the failure line.

Local verification (final head 0cdc72b8)

  • Fast verifier and real-xdist integration modules: 157 passed, 0 failed, 0 errors, 0 skipped. The real-xdist probes executed rather than skipping.
  • Adjacent full-run recorder/verifier, fast selection, collection-scope, workflow-contract, and release-notes modules: 876 passed, 0 failed, 0 errors, 0 skipped.
  • Combined focused total: 1,033 passed in two non-empty pytest runs. These were focused gates, not a local routine full-suite run.
  • scripts/verify-local-lint-gate.sh from the repository root: LINT-GATE-GREEN both legs with Ruff 0.17.3. Import-hygiene lint also passed in each final-head CI attempt.

Final-head CI evidence

Three comparable attempts succeeded at final head 0cdc72b8c8956260395652456703b3590ba2c481 on run 45063656527. Workflow durations use run_started_at through updated_at; job and step durations use their GitHub API start/completion timestamps.

Attempt Canary Test step Verifier Fast-suite job Workflow
1 46s 10m57s 12s 12m28s 12m31s
2 1m22s 19m04s 21s 21m08s 21m13s
3 1m14s 18m44s 21s 20m42s 20m46s
Median 1m14s 18m44s 21s 20m42s 20m46s

The median test step 18m44s is below the fastest serial baseline (27m08s), and the median workflow duration 20m46s is below the serial median (36m52s).

Every attempt selected the same 554 files / 34,109 items, finished with 34,079 passed and 30 skipped, created all 4/4 workers under fixed -n 4 --dist loadfile, and ended with VERIFY-OK expected=554 collected=554 status=ok select_all=selection-machinery. Every attempt hit and restored the same embedding-model cache key; every cache-save step was skipped because the cache already existed.

Cursor Bugbot genuinely executed for 1m59s at this head and reported no issues. The unresolved review-thread count is zero.

Population comparability: The serial baselines were measured at the plan's planning-time commit, before main's test consolidation (#1722, #1726). At this PR's base the discoverable census is 553 test_*.py files; this PR adds exactly one (test_fast_xdist_integration.py) and removes none. The fast run selects the full discoverable corpus through select_all, and the serial independent-collection canary verifies that selection. The roughly 3,200-item reduction from the planning-time baselines is main's consolidation, not selection narrowing by this PR.

Successful pre-F8 diagnostic run 45061833563, at b73131d7a7e442ec821bbf7b26e7652b233a5ab9, is retained as diagnostic evidence but is not one of the three final-head timing samples.

Retained non-successful attempts

All non-successful attempts below are excluded from successful timing samples and retained with their dispositions:

  • Run 44509545024, attempt 1, at superseded head 87f186cfab18e4b47b4a06f57ce7dedb65827206: 2 failed, 33,996 passed, 30 skipped. Both failures inherited PACT_FULL_RUN_RECORD_OWNER in child-runner fixtures and exited before fake pytest. The fix scrubs that variable; the original reproductions and both affected modules passed with it present.
  • Run 44512777822, attempt 1, at superseded head 3ffda1e61ab480e078db2230fd354d0e8e721724: cancelled during the fast-test step when a newer head superseded it. This was not a completed test result.
  • Run 44646676814, attempt 1, at superseded head 818fb0f6202b05cf09c446cec94f4600d1dd1c79: cancelled during the fast-test step when a newer head superseded it. This was not a completed test result.
  • Run 44648444180, attempt 1, at superseded head d60a469b8c709cf2581e656f389007a9fcdaf640: 4 failed, 34,026 passed, 30 skipped. All four failures were verifier tests refusing HEAD-SHA-MISMATCH: the test rig pinned GITHUB_SHA to a base SHA while fabricated artifacts carried post-commit head SHAs. The binding worked as designed; the fix scrubs GITHUB_ACTIONS and GITHUB_SHA from the verifier-invocation helper unless a test supplies them explicitly, with a same-environment red-to-green reproduction and a green run at the next head.
  • Run 44846383401, attempt 1, at superseded head 99e67a5456617088fe3be4b9cd2f904b4ef57aa4: cancelled during the fast-test step when a newer head superseded it. This was not a completed test result.

Closes #1725

@cursor cursor 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.

Stale Bugbot comment from a previous run.

Comment thread scripts/verify_fast_summary.py Resolved

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cdd972d. Configure here.

Comment thread scripts/verify_fast_summary.py Resolved
Wait for every peer worker to go down before failing gw1, then require the real runner's exit-zero record and the verifier's BAD-FIELD-DESELECTED refusal instead of accepting an abort.
Verify both artifact manifest paths as well as their hashes, and pass the selected repository root through every production manifest-loading caller so external manifests resolve repository-relative files correctly. Cover valid, wrong-path, wrong-hash, external, and invalid-manifest controls.
@michael-wojcik
michael-wojcik added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 4607c7a Nov 23, 2026
5 checks passed
@michael-wojcik
michael-wojcik deleted the issue-1725-parallel-fast-ci branch November 23, 2026 10:57
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.

Run every CI test suite under pytest-xdist; the fast PR suite is serial and takes 2.9x the full suite

1 participant