fix: make RegressionRisk detect changed/skipped critical steps (soundness) - #53
Merged
Merged
Conversation
…ness)
Parity port of the Swift fix. The risk verdict was derived only from
removed/reordered alignment states, but a critical step that was materially
changed or skipped binds to a same-type event (type match alone clears the
matcher threshold), is classified AMBIGUOUS, and so escaped the verdict — a
tampered or skipped critical decision reported RegressionLevel.NONE on the
strict_audit_v1 profile, the exact regressions the engine exists to catch.
The verdict now derives from the equivalence outcome: a critical step that is
removed (0.95), reordered relative to another CRITICAL step (1.0), or bound
with a differing payload scoring below the profile's semantic_threshold
("changed beyond equivalence", 0.9) fires HIGH. Reorder is computed over
critical pairs only, so a benign structural/diagnostic step moving past a
stationary critical no longer fires a false HIGH.
The canonical alignment_verdict vector is regenerated (case 2 -> high/0.9;
states unchanged). test_regression_risk_soundness.py pins the four defects
plus the equivalent-step control. The RegressionGate lenient-mode test is
updated: allow_divergent_steps relaxes the per-step check but not the
severity gate, so a flipped critical decision now (correctly) fails unless
max_regression_level is raised.
Behavior change: runs that previously (incorrectly) reported NONE may now
report HIGH.
Therealdk8890
changed the base branch from
fix/deep-review-confirmed-findings
to
main
July 18, 2026 00:51
Therealdk8890
added a commit
that referenced
this pull request
Jul 18, 2026
The RegressionRisk soundness fix (#53) replaced the AlignmentStateKind.REORDERED lookup with a critical-pairs computation, orphaning the import. Ruff F401.
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.
Parity port of DProvenanceKit (Swift) PR #71. Stacked on #52 (base is
fix/deep-review-confirmed-findings, notmain) because the fix builds on that branch'salignment_engine.py/CHANGELOG/gate-test changes; GitHub will retarget this tomainonce #52 merges. The diff here is only the alignment fix.What & why
An adversarial correctness audit found the
RegressionRiskverdict — the signal a CI gate reads — missed the regressions it exists to catch on thestrict_audit_v1profile. The verdict was derived only fromremoved/reorderedalignment states, but a critical step that was materially changed or skipped binds to a same-type event (type match alone clears the matcher threshold), is classifiedambiguous, and escaped the verdict entirely. A tampered or skipped critical decision reportedRegressionLevel.NONE— even though the equivalence model had already recorded the pair as non-equivalent.Fix
The verdict now derives from the equivalence outcome. A critical step fires HIGH when it is:
semantic_threshold(0.9).Cross-implementation
The canonical
alignment_verdict.jsonvector is regenerated from the fixed engine (case 2 "payload of one step changed" →high/0.9; alignment states unchanged). This is the canonical source the Swift port vendors and itsvector-synccheck enforces, so Swift #71 depends on this landing onmain.Tests
tests/test_regression_risk_soundness.py(5): materially-changed critical, skipped-critical-masked-by-decoy, reordered criticals, benign structural reorder (no false HIGH), and the equivalent-step control.test_regression_gate.py: the lenient-mode test is corrected —allow_divergent_steps=Truerelaxes the per-step check but not the severity gate, so a flipped critical decision now (correctly) fails unlessmax_regression_levelis raised. Split off a genuinely-benign non-critical case to keep the "lenient tolerates benign changes" coverage.Full suite: 480 passed, 3 skipped (venv). Behavior change: runs that previously (incorrectly) reported
NONEmay now reportHIGH.