Commit ab0fdfa
committed
feat(store): add ExtendedStore interface with health check, metrics and distributed lock
## Blocking fixes
- Add ensureInitialized() check to all PostgresStore public methods
- Replace connectionConfig: any with typed PostgresConfig interface
- Add connection pool default config and error listener
## New features (ExtendedStore interface)
- healthCheck(): database and filesystem health status
- checkConsistency(): verify data consistency between DB and filesystem
- getMetrics(): operation counts, latency stats, storage stats
- acquireAgentLock(): distributed lock (PostgreSQL advisory lock / memory lock)
- batchFork(): optimized bulk agent forking
## Other changes
- Add createStore() and createExtendedStore() factory functions
- Fix agentId format in docs and tests (agt: → agt-)
- Add comprehensive tests for new features1 parent 8c1e258 commit ab0fdfa
8 files changed
Lines changed: 1246 additions & 69 deletions
File tree
- docs
- src/infra
- db
- postgres
- sqlite
- store
- tests/unit/infra/db
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
| 493 | + | |
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
| |||
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
911 | | - | |
| 911 | + | |
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
| |||
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
963 | | - | |
| 963 | + | |
964 | 964 | | |
965 | 965 | | |
966 | 966 | | |
| |||
0 commit comments