OpenProgram Docs

Replay as policy testing

evaluate(event, state) is pure and state is a fold of events.jsonl (events and state §4), so replaying history tests a policy on real workloads with no mocks and no running agent. Research design: the command below is not implemented.

openprogram proactive replay --policy TestGapWatcher --sessions <ids|all>
Engineering
Every new policy is replayed before activation, exposing poor precision offline (the failure associated with Clippy). The tool comes before the decision engine.
Paper
The would-have-fired report supplies samples for precision annotation.

Modes

A new policy's L2 inference never ran on history, so its state.inferred event is absent.

ModeState allowedDeterminismFor
strictL0, L1, persisted state.inferredBit-for-bitL0/L1 regression, paper numbers. DangerousCommandGuard; TestGapWatcher's L1 part
augmentedStrict plus newly computed L2Reproducible through the cacheFirst run of an L2 policy. UnvalidatedCompletionNudge; TestGapWatcher's completion signal

Augmented reproducibility

  • Fix model, version and temperature=0.
  • Persist new L2 results as a cache and publish the model fingerprint with the report. Reproduction means reproducing the annotation set, without calling a model that may have changed.
  • A second replay of one policy on one session reads the cache and is deterministic.
  • Prepare policies stop at would-have-prepared: the reviewer sub-agent cannot rerun deterministically. Label TestGapWatcher's report “Notify precision: online-only” and measure it by A/B.

Three things replay must get right

DetailWithout itRule
Simulated cooldownA new policy has no action history, so every match reportsFeed would-fire decisions back as virtual cooldown events
Clock injectionAn old session's cooldown computed against today is wrong“Now” is the event's ts. Policies must not call time.time(); the framework injects the clock into evaluate
Branch-aware foldingRewound branches read as continuous historyRebuild the DAG path from current node to root by node_id, then fold (§5 of events and state). Interruption budgets are global across branches

Recall

A would-have-fired report lists only fires, so precision comes from replay and recall cannot. Recall needs a separately annotated should-have-fired set. The report claims none.

Report

replay-report {
  policy: "TestGapWatcher"
  mode: "augmented"                      # strict | augmented
  model_fingerprint: "claude-…"          # augmented only
  sessions_scanned: 214
  events_scanned: 51_320
  fired: 38
  per_session: [
    { session_id, node_path: [...],      # DAG path used for folding
      fires: [
        { event_ref, state_snapshot_ref, # triggering context after redaction
          action: "Prepare→Notify",
          cooldown_suppressed: false,
          notes: "Notify precision: online-only" }
      ] }
  ]
  invariant_checks: { loop_free: pass, breaker_exempt: pass, ... }
}

event_ref and state_snapshot_ref let annotators judge each fire; redaction is in threat model. The report also asserts the four invariants (§5).

Implementation status

openprogram proactive replay is proposed and not built; the CLI has no proactive subcommand.

Last updated · 2026-11-25