feat(memory): auto-process memory pool + rollover on session-start/pre-compact (TDPLAN-0005)

This commit is contained in:
AIOSAI
2026-06-06 20:28:19 -07:00
parent 8efb204486
commit 1ef1e2e89c
41 changed files with 1575 additions and 2430 deletions
+9 -7
View File
@@ -74,7 +74,7 @@ result = report_error(
## Events
14 events registered via `handlers/events/registry.py` on first `Trigger.fire()`. All fire through the event bus.
15 events registered via `handlers/events/registry.py` on first `Trigger.fire()`. All fire through the event bus.
| Event | Handler | Trigger | Action |
|-------|---------|---------|--------|
@@ -92,6 +92,7 @@ result = report_error(
| `cli_header_displayed` | `cli.py` | CLI displays headers | Registration hook |
| `pr_created` | `pr_status_sync.py` | PR opened on GitHub | Runs `drone @prax status sync` (fire-and-forget) |
| `pr_merged` | `pr_status_sync.py` | PR merged on GitHub | Runs `drone @prax status sync` (fire-and-forget) |
| `memory_pool_auto_processed` | `memory_pool.py` | Hook engine runs `auto_process()` | Logs result; on failure fires `error_detected` for Medic dispatch |
## Medic
@@ -147,7 +148,7 @@ trigger/
│ ├── json/
│ │ └── json_handler.py # JSON structure logging
│ ├── events/
│ │ ├── registry.py # Auto-registers all 14 event handlers
│ │ ├── registry.py # Auto-registers all 15 event handlers
│ │ ├── startup.py # Startup catch-up scan
│ │ ├── error_detected.py # 8-gate Medic dispatch
│ │ ├── error_logged.py # Monitor-only (no dispatch)
@@ -158,10 +159,11 @@ trigger/
│ │ ├── memory_template_updated.py
│ │ ├── memory.py # memory_saved placeholder
│ │ ├── cli.py # cli_header_displayed hook
│ │ └── pr_status_sync.py # PR → prax status sync
│ │ ├── pr_status_sync.py # PR → prax status sync
│ │ └── memory_pool.py # Pool auto-process observability
│ └── watchers/
│ └── log_watcher.py # System log watcher (system_logs/ dir)
├── tests/ # 551 tests across 18 modules
├── tests/ # 563 tests across 19 modules
├── trigger_json/ # Runtime state files
│ ├── trigger_config.json # Medic state, muted branches
│ ├── error_registry.json # All tracked errors
@@ -189,13 +191,13 @@ trigger/
## Testing
551 tests across 18 test modules, all passing. Coverage: 76/76 public functions (100%).
575 tests across 19 test modules, all passing. Coverage: 76/76 public functions (100%).
```bash
cd src/aipass/trigger && pytest # Run all tests
```
Test files: `test_core`, `test_errors`, `test_medic`, `test_error_registry`, `test_error_reporter`, `test_medic_state`, `test_log_watcher`, `test_watchers_log_watcher`, `test_branch_log_events`, `test_log_events`, `test_json_handler`, `test_pr_status_sync`, `test_error_detected`, `test_event_handlers`, `test_log_watcher_service`, `test_plan_file_handler`, `test_startup_handler`, `test_trigger_entry`
Test files: `test_core`, `test_errors`, `test_medic`, `test_error_registry`, `test_error_reporter`, `test_medic_state`, `test_log_watcher`, `test_watchers_log_watcher`, `test_branch_log_events`, `test_log_events`, `test_json_handler`, `test_pr_status_sync`, `test_error_detected`, `test_event_handlers`, `test_log_watcher_service`, `test_plan_file_handler`, `test_startup_handler`, `test_trigger_entry`, `test_memory_pool_handler`
## Compliance
@@ -203,7 +205,7 @@ Seedgo: 100% (34/34 standards). Zero type errors. All categories at 100%.
---
*Last Updated: 2026-05-16*
*Last Updated: 2026-06-06*
---
[← Back to AIPass](../../../README.md)