You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add pluggable persistence backends with storage API (#93)
* ci: add C extension code coverage with lcov
Add gcov/lcov-based coverage for the native C extension. Coverage is
compiled with -O0 --coverage flags and generates HTML reports showing
line and function coverage for vector.c, matrix.c, svd.c, and
classifier_ext.c.
New rake tasks:
- coverage:clean - remove gcov data files
- coverage:compile - build with coverage instrumentation
- coverage:report - generate HTML report via lcov
- coverage:c - full cycle (clean, compile, test, report)
CI uploads coverage reports as artifacts on each run.
* feat: add pluggable persistence backends with storage API
Implement ActiveRecord-style storage abstraction allowing classifiers
to persist to any backend. Users can configure storage at setup time
and use simple save/reload methods without path arguments.
Key additions:
- Storage::Base abstract class defining write/read/delete/exists? protocol
- Storage::Memory for testing and ephemeral use
- Storage::File for file-based persistence
- Dirty tracking with dirty? method on Bayes and LSI
- reload raises UnsavedChangesError, reload! forces discard
- load(storage:) class method sets storage on returned instance
Legacy API preserved:
- save_to_file(path) replaces old save(path)
- load_from_file(path) replaces old load(path)
Closes#90
* fix: add super calls to storage class initializers
* style: fix RuboCop offenses in storage tests
* fix: add auto_rebuild to remove_item and fix Rakefile lint
0 commit comments