Repository navigation
Review rule conflicts that only appear at generated dimension values - #48
Merged
Merged
Conversation
Fixes #36. Witnesses for allow/deny pairs were searched only in each seed scenario's state, so an override that appeared only at a sampled dimension value (for example a manager allow outranking an amount cap) was labeled without ever reaching review. - Extract `family_variants` from `generate_family`, so the review gate searches exactly the situations a build samples. - Add `conditions_disjoint` to the policy module: a conservative proof that two conditions can never hold together, derived from the interpreter's own predicate semantics. - Queue an allow/deny pair unless its conditions are provably disjoint. Items report `overlap` ("observed" or "possible"), `witness_count`, and up to five witnesses with their dimension values. The example and archived experiment projects produce the same review queue as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 3, 2026
Merged
4 tasks done
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.
Closes #36. Builds on #47 (merged).
Behavior
The bug. For allow/deny rule pairs, the review gate searched for overlap witnesses only in each seed scenario's
state, never in the dimension values a build samples. Example:manager-approves: allowapprovewhenrole == manager, priority 5.cap-large: denyapprovewhenamount > 1000.[200, 5000].The generated
amount = 5000episode was labeledapprovewith both rules matching, and no reviewer was ever asked.The fix.
family_variantsis extracted fromgenerate_family, so the gate searches exactly the situations the build samples. Generation and review cannot drift apart.policy.conditions_disjointproves that two conditions can never hold together, using the interpreter's own predicate semantics: mismatchedeq/in, non-overlapping numeric bounds,exists: falseagainst any predicate that needs a value, ordering againstcontains, andany_ofbranches that are all ruled out.observedwitness_countplus up to fivewitnesses(scenario, candidate, dimension values)possibleThe
overrideandconflictkinds and the shadowed-rule check are unchanged.docs/organization-compiler.mdexplains the three cases.No false-positive flood. The fictional example and both archived experiment projects produce exactly the same review queue as before.
Validation
New
tests/test_review_conflicts.py(8 tests):overrideitem with theamount = 5000witness, and blocks the build until reviewed;possible;any_ofcombination (10,584),conditions_disjointnever claims "disjoint" for conditions that a concrete value satisfies together.Checks:
pytest: 295 passed, 4 skipped.ruff, strictmypy,mkdocs build --strict, andpre-commitpass.Compatibility and data
overlap,witness_count, andwitnessesinstead ofseed_witnesses, so their fingerprints change.🤖 Generated with Claude Code