Repository navigation
Give private_branches one matcher for adjudication and export - #20
Merged
Merged
Conversation
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.
private_brancheshad two independent matchers. Export filtering (VisibilityPolicy::branch_is_private) required whole-segment equality. Adjudication (VisibilityPolicy::check) additionally matched the bare substring, and it trimmed the pattern where export did not. One policy file, two opposite answers for the same branch.Reproduced on the pre-fix binary with
private_branches = ["audit"]and branchfeature/audit-fixes:The change was cloaked and the branch was published anyway. That fails open, on the governance spine.
The fix extracts
branch_matches(candidate, pattern)and points both callers at it, so the dispute still names the pattern that fired and the two paths cannot drift again. Post-fix, the same commands givebranch feature/audit-fixes omitted (private branch)andexit 1on the adjudicate. The wildcard formprivate/*and the clean no-match case were both checked against a locally built binary and still behave as before.Diff stat
test_cloaked_branch_is_not_published_by_exportdrives both sides of the same policy file through the real binary: it asserts adjudication still cloaks (so the test cannot pass by a matcher that stopped matching) and that the ref is absent from the export.Not shipped
src/store.rs:1691and:2425compare againstEXPORT_LOGwhile iterating.oot/export/. The log lives at.oot/export-log.jsonl, one directory up, so both guards can never match. Safe today, misleading tomorrow. Separate PR.src/visibility.rspath_is_privatematches.pemonly against a file literally named.pem, notserver.pem. This repo's ownvisibility.tomllists.pemand gets nothing. Fixing it changes what existing policies withhold, which is an owner decision, not an audit one.*never match, becausematches_patternsplits on the first one only.VisibilityPolicy::loadvalidatesembargo_untilbut not patterns, so a typo yields a policy that silently never fires.src/policy.rs:83,95(requires_review,review_count) have no callers outside#[cfg(test)]. The docket usesDocket::review_count, which hardcodes Review and High, soreview_onin a policy file does not affect the rendered verdict note.