Skip to content

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

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 #137

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. suspiciousPatterns the registry already holds are skipped.

I added the 8 reference scenarios in tests/test-handlers/dynamic-rules-overlay.test.ts. On master 6 of the 8 fail (the failed-apply rollback and collection replacement scenarios already held). Build, lint, test, coverage and conformance 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. Patterns the registry already holds are skipped. Ports guard-core #169.
@github-actions github-actions Bot added documentation Docs, README, CHANGELOG, governance files area: handlers Touches packages/core/src/handlers/ package: core Changes inside @guardcore/core tests Test suite changes (vitest) labels Oct 15, 2026
@rennf93
rennf93 merged commit f4d54a0 into master Oct 15, 2026
17 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: handlers Touches packages/core/src/handlers/ documentation Docs, README, CHANGELOG, governance files package: core Changes inside @guardcore/core tests Test suite changes (vitest)

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