Repository navigation
tests: test_cicd_policy_enforcement_gates calls _enforce_policy_gates (Part of #8434) - #8605
Merged
Merged
Conversation
… (Part of #8434) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
This was referenced Nov 18, 2026
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #8434 (security epic #8427).
What changed
tests/core_engine/test_galaxyscope.py::test_cicd_policy_enforcement_gatesused to re-implement the gate in an inline loop and assert its own result, so it passed whateverOrchestrator._enforce_policy_gatesdid. It now builds a realOrchestratorand calls_enforce_policy_gatesfor every gate. One hand-written file.test_cicd_policy_enforcement_gates: secrets (fires, clean graph, other gate does not trip it, no gate enabled) and malware (same four shapes).test_max_risk_exposure_gate_at_threshold_and_below: 80.0 fails, 79.9 passes, one bad file among clean ones fails, threshold 0 disables.test_max_systemic_threat_gate_at_threshold_and_below: magnitude * blast radius at the ceiling fails, just under passes, zero magnitude passes, ceiling 0 disables.test_max_systemic_threat_not_evaluated_without_blast_radius: the "not evaluated for " warning fires and the gate does not fail on a placeholder.policy_failedis reset toNonebefore each call so the gate must set it itself.Mutation check (each applied to
gitgalaxy/galaxyscope.py, reverted after)>=to>(if systemic_threat >= max_systemic_threat)>=to>(if highest_risk >= max_risk_allowed)Falseif has_secrets:replaced withif False:if blast_radius is None:replaced withif False:Unmutated: 4 passed.
ruff format(pinned 0.17.4) leaves the file unchanged. Not run:pr_gates, golden bless (no engine change).Class / Sibling gaps
Class: tests that re-implement the code under test instead of calling it (sweep scope
tests/security_auditing,tests/tools, gate/policy tests intests/core_engine).test_galaxyscope.py::test_cicd_policy_enforcement_gatestest_cli_contract.pygate teststest_galaxyscope.pySARIF sanitization test (Phase 10.8, ~:2567 before this edit)test_galaxyscope.pyActive Hemorrhage "post-hoc reimplementation" (~:1366)tests/security_auditing/*(30+ files)tests/tools/*Sibling gaps: the SARIF and Active Hemorrhage tests need a different mechanism (extracting the inline phase into a callable first), so they are not done here; the two unswept directories are listed below.
Remaining slices
test_galaxyscope.pySARIF sanitization (Phase 10.8) and Active Hemorrhage tests: extract the phase into a method, call it from the test (galaxyscope.py plus the test, 2 files).tests/security_auditing/*for assertion paths that never call the function they name (start withtest_supply_chain_firewall.py, which also feeds a shape the CLI no longer reads), in batches of 5 files.tests/tools/*(grep "manually", "mirror", local copies of production logic), same batching.Lessons for agents
None.
🤖 Generated with Claude Code