Problem
Writing a regression test from a recorded incident today is boilerplate in every test: reset_session() + load_trace() + enable_replay() + run + assert.
Proposal (keep it small)
A thin pytest helper so a committed trace is a one-liner. Pick whichever reads best; do not build a plugin framework:
- a fixture:
def test_fix(chronicle_replay): s = chronicle_replay("fixtures/traces/incident-001", ReplayPlan().stub("agent",1).live("delete_file",1)); run_agent(...); assert s.captured_result("delete_file",1)["blocked"]
- or a decorator wrapping
chronicle.replay_trace(...).
One pytest11 entry point exposing one fixture is enough. Reuse the existing replay_trace().
Acceptance
- Load a trace, run the agent, assert on
captured_result(...) in ~3 lines.
- Works for sync and async agents.
- One test in
tests/ + a short README snippet.
Problem
Writing a regression test from a recorded incident today is boilerplate in every test:
reset_session()+load_trace()+enable_replay()+ run + assert.Proposal (keep it small)
A thin pytest helper so a committed trace is a one-liner. Pick whichever reads best; do not build a plugin framework:
def test_fix(chronicle_replay): s = chronicle_replay("fixtures/traces/incident-001", ReplayPlan().stub("agent",1).live("delete_file",1)); run_agent(...); assert s.captured_result("delete_file",1)["blocked"]chronicle.replay_trace(...).One
pytest11entry point exposing one fixture is enough. Reuse the existingreplay_trace().Acceptance
captured_result(...)in ~3 lines.tests/+ a short README snippet.