-
Notifications
You must be signed in to change notification settings - Fork 0
fix(rri): scope native_gate build-SHA contract to the canonical release personas #723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| """native_gate build-SHA scoping (RRI 2026-06-09): the release verdict judges the canonical five | ||
| personas + the Mac handoff at ONE SHA. Extra DIAGNOSTIC personas (opus-high / lean variants) may | ||
| run at other SHAs without invalidating the release — they must NOT trip native_gate's build-SHA | ||
| gates. (The Tuesday sweep falsely failed native_gate because 3 variants stamped stale SHAs while | ||
| the 5 release personas were all at the candidate SHA.) | ||
|
|
||
| Stdlib + pytest. Run: | ||
| uv run --directory servers/engine python -m pytest qa/test_release_readiness_scope.py -q -p no:xdist | ||
| """ | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| sys.path.insert(0, str(Path(__file__).resolve().parent)) | ||
| import release_readiness as rr # noqa: E402 | ||
|
|
||
| REL = rr.REQUIRED_RELEASE_PERSONAS # newbie / veteran / adversarial / narrative / optimizer | ||
|
|
||
|
|
||
| def _score(persona, sha): | ||
| return {"persona": persona, "run_build_sha": sha} | ||
|
|
||
|
|
||
| def _kinds(gaps): | ||
| return {g["missing"] for g in gaps} | ||
|
|
||
|
|
||
| def test_extra_variant_at_stale_sha_does_not_fail_native_gate(): | ||
| # The EXACT Tuesday situation: the 5 release personas at the candidate SHA, 3 diagnostic | ||
| # variants stamped at stale SHAs. The variants must be ignored for the build-SHA contract. | ||
| scores = [_score(p, "033e4ba") for p in REL] + [ | ||
| _score("opushi-narr", "8afed3c"), | ||
| _score("opuslean-narr", "f89ce94"), | ||
| _score("opuslean-narr2", "eabf2a3"), | ||
| ] | ||
| gaps = rr.build_sha_evidence_gaps(scores, "033e4ba", REL) | ||
| assert gaps == [], f"diagnostic variants must not trip native_gate build-sha gates: {gaps}" | ||
|
|
||
|
|
||
| def test_clean_release_set_has_no_build_sha_gaps(): | ||
| scores = [_score(p, "033e4ba") for p in REL] | ||
| assert rr.build_sha_evidence_gaps(scores, "033e4ba", REL) == [] | ||
|
|
||
|
|
||
| def test_a_release_persona_at_a_different_sha_still_fails(): | ||
| scores = [_score(p, "033e4ba") for p in REL[:-1]] + [_score(REL[-1], "deadbee")] | ||
| kinds = _kinds(rr.build_sha_evidence_gaps(scores, "033e4ba", REL)) | ||
| assert "same-build persona evidence" in kinds or "single build_sha" in kinds, kinds | ||
|
|
||
|
|
||
| def test_missing_build_sha_on_a_release_persona_flags(): | ||
| scores = [_score(p, "033e4ba") for p in REL[:-1]] + [{"persona": REL[-1], "run_build_sha": ""}] | ||
| assert "per-run build_sha" in _kinds(rr.build_sha_evidence_gaps(scores, "033e4ba", REL)) | ||
|
|
||
|
|
||
| def test_no_build_sha_arg_flags(): | ||
| scores = [_score(p, "033e4ba") for p in REL] | ||
| assert "--build-sha" in _kinds(rr.build_sha_evidence_gaps(scores, "", REL)) | ||
|
|
||
|
|
||
| def test_only_variants_present_yields_no_buildsha_gaps_but_release_set_caught_elsewhere(): | ||
| # If ONLY diagnostic variants ran (no canonical persona), build-sha gaps are empty here — the | ||
| # MISSING canonical personas are caught by the separate missing_release_personas check, not this | ||
| # one. So scoping never hides an absent release persona. | ||
| scores = [_score("opushi-narr", "8afed3c"), _score("opuslean-narr", "f89ce94")] | ||
| assert rr.build_sha_evidence_gaps(scores, "033e4ba", REL) == [] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: electricsheephq/WorldOS
Length of output: 347
🏁 Script executed:
Repository: electricsheephq/WorldOS
Length of output: 108
🏁 Script executed:
Repository: electricsheephq/WorldOS
Length of output: 2710
🏁 Script executed:
Repository: electricsheephq/WorldOS
Length of output: 5857
Fix
build_shasscoping before using it in thesignalsresultbuild_sha_evidence_gaps()correctly scopes the “single build SHA” checks to the canonical release personas and detects missing/mismatched/multiple SHAs within that set.main()referencesbuild_shasat line 851 ("run_build_shas": build_shas,), butbuild_shasis only defined insidebuild_sha_evidence_gaps()(line 484). This will raiseNameErrorat runtime—either computebuild_shasinmain()or change the helper to also return/passbuild_shasback tomain().🤖 Prompt for AI Agents