Repository navigation
fix(baseline): centralize reconciliation semantics - #64
Merged
Merged
Conversation
Owner
Author
Post-CI final diff reviewReviewed all 6 changed files and all 5 commits against the refreshed
Final evidence: all latest GitHub checks pass, |
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.
Summary
reconcile_baseline()as the sole semantic core for baseline matching, classification, current-finding consumption, and suppression decisions.apply_baseline(),prune_baseline(), andaudit_baseline()projection/compatibility adapters over the same reconciliation result.Why
The previous baseline paths evaluated overlapping matching rules independently. In ambiguous relocation and many-baseline-to-one-current cases, that could suppress or retain findings without a unique assignment, and audit could count one current finding more than once.
Baseline machinery must never make a current finding disappear when the match is uncertain.
Design decision
Baseline Reconciliationis the authoritative domain abstraction. It resolves matching globally in decreasing strength: exact fingerprint, comparable content/location, rule-location, then legacy identity. A current finding can be consumed once. Ambiguous candidates are blocked from weaker matching but remain visible and unmatched.Classification and suppression remain separate.
rule_changedis exposed by audit while remaining suppressible;changed,stale, andambiguousare not suppressible.How to validate
Local results:
repo_sentinel/baseline_matching.pyis packaged.Main risk
The intended compatibility change is stricter handling when multiple baseline entries claim the same current finding. Those entries now classify as
ambiguous; apply keeps the current finding visible, prune does not retain it, and audit exposes each candidate set. This may surface findings that older matching suppressed.Compatibility impact
apply_baseline,prune_baseline, andaudit_baselinesignatures and audit schema remain intact.active,relocated, andrule_changedmatches retain their suppression behavior.Rollback path
Revert the three commits in this PR. No baseline schema migration, persisted-data rewrite, release artifact, or external service change is involved.
Review state
Draft by policy because this changes baseline/security-boundary behavior. Do not merge until CI passes and the required delayed review window has elapsed.