Skip to content

Feature/persistency improvements new#232

Merged
viktorbeck98 merged 18 commits into
developmentfrom
feature/persistency-improvements-new
Jul 21, 2026
Merged

Feature/persistency improvements new#232
viktorbeck98 merged 18 commits into
developmentfrom
feature/persistency-improvements-new

Conversation

@viktorbeck98

Copy link
Copy Markdown
Collaborator

Task

Description

Refactors stateful stability tracking so each detector can plug in its own per-value logic that survives persistence.

  • Replaces the boolean expand_value flag on SingleStabilityTracker/EventStabilityTracker with a pluggable add_value_fn (detector name) + detector_config. The tracker resolves and binds the detector's add_value implementation on init and round-trips it through to_state/from_state.
  • BigramFrequencyDetector: adds a custom add_value that maintains bigram frequency tables and flags low-probability character pairs; now exported from detectors/__init__.py; skip_repetitions now defaults to True; docstring/docs updated.
  • CharsetDetector: custom add_value (unions characters) and matching kwargs on the auto-config persistency.
  • ValueRangeDetector: custom add_value tracking min/max range; numeric casting now goes float→int; replaces exit(1) with sys.exit(1).
  • .gitignore: ignore leaked local /state/ persistency dir.

How Has This Been Tested?

Adapted existing unit tests for the new add_value_fn/detector_config API (stability tracker, charset, bigram) and updated end-to-end anomaly-count assertions for the new skip_repetitions default. Ran the test suite locally.

Checklist

  • This Pull-Request goes to the development branch.
  • I have successfully run prek locally.
  • I have added tests to cover my changes.
  • I have linked the issue-id to the task-description.
  • I have performed a self-review of my own code.

@viktorbeck98
viktorbeck98 merged commit 37ac010 into development Jul 21, 2026
6 checks passed
@viktorbeck98
viktorbeck98 deleted the feature/persistency-improvements-new branch July 21, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants