StateMirror Examples
DATA PLATE
QUESTION
Why was this customer charged, denied, downgraded, expired, or restricted? StateMirror helps answer by preserving the evidence your application submitted when it acted, instead of reconstructing the moment from logs and state stores later.
CAPTURE AT DECISION TIME
// Application-owned evidence example.
// StateMirror preserves the submitted snapshot.
// Your application computes facts and owns actions.
const deny = await denySignal.state({ subject, scope: "global" });
const exp = await expirySignal.state({ subject, scope: "plan" });
const plan = await planSignal.state({ subject, scope: "account" });
const eligible =
deny.signal !== "denial_present" &&
exp.signal !== "expired" &&
plan.status === "active";
const evidencePayload = {
subject,
evidence_type: "billing_access_decision",
evidence_lanes: {
PlanEvidence: plan,
DenialEvidence: deny,
ExpiryEvidence: exp,
},
computed: {
eligible,
plan: plan.plan ?? null,
},
policy_version: "2026-06-REV-A",
correlation_id: req.headers["x-correlation-id"] ?? null,
};
const snapshot = await stateMirror.capture({
evidence_ref: `access:${subject}:${Date.now()}`,
evidence_type: "billing_access_decision",
captured_at: new Date().toISOString(),
state_payload: evidencePayload,
});
if (eligible) return grantAccess();
return denyAccess("Not eligible");LATER LOOKUP
// Support or engineering review.
// Retrieval is reference-driven. No hosted dashboard required.
GET /v1/snapshots/{snapshot_id}
-> returns the payload submitted around the decision moment.
statemirror verify
statemirror inspect
statemirror export
// Verification proves preserved evidence integrity only.
// It does not prove upstream truth, policy correctness, or
// that the application made the correct decision.BOUNDARY
State is queried. Evidence is submitted. Decisions are made. Actions remain application-owned. StateMirror preserves submitted evidence about the decision moment.