Skip to content

fix(dynamic-rules): apply each rule version over the base config - #55

Merged
rennf93 merged 1 commit into
masterfrom
fix/dynamic-rule-version-overlay
Oct 15, 2026
Merged

rennf93 merged 1 commit into
masterfrom
fix/dynamic-rule-version-overlay

Conversation

@rennf93

@rennf93 rennf93 commented Oct 15, 2026

Copy link
Copy Markdown
Member

Closes #54

I ported the reference fix, Guard-Core/guard-core #169. Each dynamic rule version now restores the base snapshot before applying, so the emergency auto-ban halving no longer compounds across versions (16 went 8, 4, 2, and now stays 8), a change from an earlier version no longer lingers when a later version omits it, and expiry restores the true base. A failed apply restores the config as it was before the call. Snapshot and restore now copy collection values like the reference deepcopy, and suspiciousPatterns the registry already holds are skipped.

I added the 8 reference scenarios in DynamicRuleOverlayTest. On master 6 of the 8 fail (the failed-apply rollback and collection replacement scenarios already held). The line-keyed coverage waivers for DynamicRuleManager.kt moved by 9 lines and are re-anchored on identical code. spotlessApply, detekt, build, fullCorpusGate and the 100 percent line coverage gate pass locally.

Each version now restores the base snapshot before applying, so the emergency auto-ban halving no longer compounds and changes from an earlier version do not linger. A failed apply restores the config as it was before the call. Snapshot and restore copy collections. Patterns the registry already holds are skipped. Ports guard-core #169.
@github-actions github-actions Bot added documentation Docs, README, CHANGELOG, license files area: facade Touches guard-core/ (published facade module) tests Test suite changes labels Oct 15, 2026
@rennf93
rennf93 merged commit db716ec into master Oct 15, 2026
10 checks passed
@rennf93
rennf93 deleted the fix/dynamic-rule-version-overlay branch October 15, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: facade Touches guard-core/ (published facade module) documentation Docs, README, CHANGELOG, license files tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Each dynamic rule version applies over the previous version instead of the base config

1 participant