PUNK

// evaluation guide

Replay proves history. Shadow tests the present.

An alternative agent route needs more than a plausible output. Replay checks it against recorded execution; shadow compares it with fresh live traffic while the user still receives the live result. Together, they reduce risk without claiming that every task is fully deterministic.

Product-fit boundary

Punk uses replay and shadow evidence to qualify eligible reusable paths. Evaluation quality depends on the traces, checks, task class, tool declarations, and policy available for your workload; it is not a universal correctness guarantee.

// two complementary modes

Keep historical and live evidence distinct.

Replay / past runs

Recreate the decision safely.

Execute a candidate against recorded requests and, where appropriate, recorded tool results or a controlled read environment. Compare structural fields, schemas, semantics, errors, expected cost, and intended side effects.

  • Good for coverage across known examples
  • Finds deterministic mismatch before a candidate sees live traffic
  • Cannot prove behavior against new request shapes or changed external state
Shadow / fresh runs

Compare without serving the candidate.

Run the candidate beside the current live path, record its result, and return the live response to the user. Suppress or dry-run side effects, then evaluate the difference and update confidence.

  • Tests current traffic and drift
  • Preserves the live answer during qualification
  • Needs clear sampling, comparison, and privacy controls

// evaluation design

Choose the checks before the candidate.

Task classUseful checksWhat not to assume
Fully deterministicExact equality, canonical JSON, known error behaviorA string match alone covers freshness or authorization
Schema deterministicSchema validity, required fields, field-level rulesValid JSON means the business answer is correct
Semantically comparableCalibrated similarity, rubrics, sampled human reviewA judge score should be the sole gate for risky work
Tool plan reuseTool sequence, argument constraints, fresh read behaviorRecorded tool output remains current
Side-effecting workDry-run equivalence, policy, approval, idempotencyReplay or shadow may repeat a write

Side effects are sacred. Replay must never duplicate them. Shadow must suppress or dry-run them. High-impact actions may remain live and approval-gated even after a candidate performs well.

// qualification sequence

Make promotion a consequence of evidence.

  1. Capture an evaluable trace

    Record the inputs, output, identity, policy context, relevant tool behavior, and outcome needed to understand what a correct run means.

  2. State the candidate assumptions

    Document scope, required inputs, freshness, output schema, side-effect level, known failure modes, and the checks that will reject it.

  3. Replay representative history

    Use a held-out set where possible. Review structural and high-severity failures rather than reporting only an average score.

  4. Shadow fresh traffic

    Keep the live provider response as the customer-visible result. Compare candidate output, errors, latency, and suppressed intended effects.

  5. Route narrowly, monitor continuously

    Promote only when policy allows and evidence meets the workload’s threshold. Preserve rollback, live fallback, and a route explanation.

Test the next route without gambling on users.

Start observe-only to collect the execution history you need, or request a review for a narrow workload with clear quality and side-effect boundaries.