Commit b97d8c5
feat: behavioral drift detection (agent-strace drift) (#73)
Adds agent-strace drift — detects when agent behavior shifts across
sessions using Jensen-Shannon divergence across six dimensions:
tool mix, error rate, retry pattern, blast radius, session duration,
and decision depth.
No LLM required. All analysis is structural. Behavioral fingerprints
are compact JSON files (<2KB) that can be committed as baselines.
- drift.py: BehavioralFingerprint, DriftReport, compute_fingerprint(),
compute_drift(), print_report(), cmd_drift()
- cli.py: drift subcommand wired in with --since, --baseline,
--current, --save-baseline, --threshold, --format flags
- 27 new tests covering statistical helpers, fingerprint computation,
drift scoring, serialization, and end-to-end store integration
Closes #70
Co-authored-by: Ona <no-reply@ona.com>1 parent 4060f22 commit b97d8c5
3 files changed
Lines changed: 870 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
654 | 655 | | |
655 | 656 | | |
656 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
657 | 674 | | |
658 | 675 | | |
659 | 676 | | |
| |||
714 | 731 | | |
715 | 732 | | |
716 | 733 | | |
| 734 | + | |
717 | 735 | | |
718 | 736 | | |
719 | 737 | | |
| |||
0 commit comments