feat: add deterministic evidence-health assessment core - #256
feat: add deterministic evidence-health assessment core#256harshitethic wants to merge 9 commits into
Conversation
|
Validation update: I reproduced the PR head (
Result: 17 tests passed. I also started the full unittest discovery. It exercises many platform-specific tests that are not clean on this Windows host, so I am not treating that run as authoritative full-suite validation. Upstream Actions still shows |
|
@Siddhant-K-code this one is ready for maintainer review. It keeps the scope narrow to the deterministic evidence-health core for #240, and I ran the focused suite on the PR head ( |
Summary
Adds a dependency-free, versioned evidence-health core for captured agent sessions, plus focused tests and user-facing semantics documentation.
This is a scoped foundation for #240 rather than claiming the entire issue is complete. The PR intentionally implements the deterministic calculation layer first; wiring the result into every CLI/API/dashboard surface can build on this without duplicating health rules.
What the core detects
ERRORterminal eventsThe result is versioned and machine-readable with
healthy,partial,unknown, andinvalidstates plus stable reason codes.Trust boundary
A key constraint from #240 is that a clean timeline must not be presented as proof of complete capture. This implementation therefore never guesses provider limitations from absent events. Provider blind spots must be supplied explicitly by the capture adapter / future capture matrix work (#239), and they are kept distinct from observed structural defects.
The empty-evidence path also preserves any observable export failures and declared provider blind spots instead of returning early and discarding those signals; the overall state remains
unknownbecause there is still no event stream to assess.That keeps the core local and dependency-free, matching the repository's architecture constraints.
Tests
tests/test_evidence_health.pycovers the healthy path, empty/active/finalized sessions, malformed boundaries and IDs, timestamp issues, tool and LLM relationship failures, duplicate/out-of-order outcomes, failed calls terminating inERROR, provider blind spots, export failures, and versioned serialization.Documentation
docs/evidence-health.mddocuments statuses, reason semantics, the distinction between observed defects and provider limitations, and what a healthy result does not claim.Scope / follow-ups
This PR does not claim to close #240 yet. Remaining integration work includes exposing the same result through the CLI/replay/API/dashboard and sourcing provider limitations from the capture matrix rather than ad-hoc callers. Keeping those integrations separate avoids inventing provider metadata before #239 defines it and avoids coupling the calculation engine to the dashboard work in #242.
Validation
Fresh-clone focused validation on PR head
91dbcf5dcac074cb8890b76068d6888fea04cbad:PYTHONPATH=src python -m unittest discover -s tests -p 'test_evidence_health.py' -vResult: 17 tests passed.
A full unittest discovery was also started on the available Windows host, but unrelated platform-sensitive tests are not clean there, so I am not claiming full-suite success from that run. Upstream GitHub Actions is still
action_requiredwith zero jobs created, so upstream CI itself has not executed yet.No runtime dependencies or storage-format changes are introduced.