Skip to content

fix(pi): separate promotion validation phases - #941

Merged
SUaDtL merged 1 commit into
mainfrom
codex/fix-pi-validation-phases-oct8
Oct 9, 2026
Merged

SUaDtL merged 1 commit into
mainfrom
codex/fix-pi-validation-phases-oct8

Conversation

@SUaDtL

@SUaDtL SUaDtL commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Pi promotion applied support for candidate 1.1.0, then ran live contracts using the reviewed 1.0.2 runtime. Run 37876454844 failed on all three platforms because that runtime correctly refused the prospective policy.

The workflow now runs every existing runtime-bearing contract against the reviewed baseline before apply, then rebuilds and validates the proposed source. The broker shutdown fixture accepts ECONNRESET only when the peer actually closes; unexpected errors and a surviving connection still fail.

This repairs validation phase ordering and the broker reset fixture in the existing Pi promotion group, following #937 and #940. The pending candidate remains uninstalled and unexecuted under ADR-0035. Candidate dependency review and live qualification remain separate.

Validation

  • Targeted regressions failed for the observed ordering/reset causes before repair.
  • 76 promotion tests passed; all 74 prior test methods and all 11 original validation commands are preserved.
  • Full Windows adapter suite passed: 890 tests, one existing POSIX-only skip. Typecheck passed.
  • All 10 prospective workflow commands passed in disposable source with candidate text 1.1.0, including descriptors, parity, generated files, static security and docs.
  • Five fault mutations were caught: three misplaced runtime contracts, an unexpected socket error, and missing broker socket destruction.
  • Independent security and coverage reviews passed without findings. Python syntax, whitespace and staged secret scans passed.

The Python coverage exemption is declared in .codearbiter/tech-stack.md: “There is no coverage tooling for the Python hooks or build tools (core/pysrc/*.py, plugins/*/hooks/*.py, .github/scripts/*.py, tools/*.py).” The TypeScript change is test-only; no new numeric production coverage claim is made. Exact-head hosted checks passed before merge: 32 successful checks and 22 skips on 9286ddbe1998a2ecef272ddc01ae2e9cf829ee31.

Delivery scope

Three files, with no shipped payload change or version bump. Existing permissions, failure receipts, candidate admission and generated-PR staging are preserved.

Commit gate passed for 9286ddbe1998a2ecef272ddc01ae2e9cf829ee31, based on bafe761bac1881438c6deed781668eb8f853ed70. This PR merged by squash as cbb43911de59896db3502307f5d3104f526f3a19 on 2026-10-09.

Postmerge CI 37880413103 passed 50 jobs with 19 skips, including all six native targets and 18 cold-package cells. CodeQL 37880413504 passed all five jobs. Docs deployment was not selected. Automatic release 37883071932 succeeded as a no-op: all four targets were ineligible and nothing was published.

The third live promotion run 37880457662, from that exact merge, passed Linux and macOS validation. Windows failed the unchanged baseline package contract because the shared Git hook invoked cut and tr under deliberately restricted PATH; the draft-PR job was skipped. The bounded hook repair is open in PR942 at 0343a03405abb267584dda6ac60bb44d71637eea, with CI pending at this update. The candidate remains PENDING_REVIEW, uninstalled and unexecuted. Successful automated draft creation and installed-host qualification remain unverified.

Summary by CodeRabbit

  • Tests
    • Expanded automated coverage for release validation stages and broker shutdown behavior during normal connections and peer resets.
  • Chores
    • Updated the release validation workflow to check the reviewed baseline before applying a candidate, then run prospective artifact and static checks.

Run runtime-bearing contracts against the reviewed baseline before applying
candidate support. Rebuild and validate prospective source afterward, without
executing the pending candidate. Keep the broker close proof valid when the
peer reports ECONNRESET while still requiring actual connection closure.

CHANGELOG: Fix Pi promotion validation ordering and shutdown test resets.
Ref: ADR-0035
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Central YAML (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8ce9a04c-50cf-4157-9332-2d5b6686340d
📥 Commits

Reviewing files that changed from the base of the PR and between bafe761 and 9286ddb.

📒 Files selected for processing (3)
  • .github/scripts/test_pi_promotion.py
  • .github/workflows/pi-promotion.yml
  • plugins/ca-pi/tools/test/inference-broker.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The PI promotion workflow now runs baseline runtime checks before candidate application and prospective checks afterward. The inference broker shutdown test now covers both ordinary close and peer reset.

Changes

PI promotion validation

Layer / File(s) Summary
Validate the reviewed baseline
.github/workflows/pi-promotion.yml, .github/scripts/test_pi_promotion.py
Toolchain setup, artifact builds, and runtime contracts run before promotion application. Contract tests check their ordering and execution counts.
Apply and validate the candidate
.github/workflows/pi-promotion.yml, .github/scripts/test_pi_promotion.py
The workflow applies the candidate, rebuilds artifacts, and runs prospective checks. Contract tests check generation and static-check ordering and confirm that host-lock installation is absent.

Inference broker shutdown test

Layer / File(s) Summary
Cover close and peer-reset shutdown
plugins/ca-pi/tools/test/inference-broker.test.ts
The shutdown test covers ordinary close and peer reset. It waits for the socket’s close event and checks that recorded errors have code ECONNRESET.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 9286d

No merge-blocking issue is identified in the supplied changes. Merge remains subject to the required exact-head checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately and concisely describes the main change: separating baseline and prospective Pi promotion validation phases.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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

Comment @coderabbitai help to get the list of available commands.

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