From execution evidence to decision-time evidence

Edition 7 established why an agent must reconcile what happened before repeating an uncertain request. Before the request, another evidence problem appears: what information was actually available when the agent decided? A response that arrived two seconds ago can contain a quote produced ninety seconds ago. Calling the response fresh hides the age of the price.

Our question is whether a research input contract can distinguish transport recency, economic quote age, and availability at the decision time. This matters when comparing agent rules. A challenger evaluated with later information does not share the baseline's decision problem, even if both rows carry the same asset name.

Time: about 30 minutes. Prerequisites: Python 3.12 or later and a terminal. All observations are invented. No network request, order, wallet connection, or real asset is involved.

Step 1: Keep the two clocks

quoted_at is when the example price was produced. received_at is when the research system received it. Our fixed decision time is the information cutoff. The record must have arrived by that cutoff to be admissible for this decision.

Quote age answers an economic question: how old is the value? Receipt age answers a transport question: how recently did the system hear about it? A cached response can look excellent on the second measure and fail the first. Missing quote time must remain unknown; substituting receipt time turns an absence into unjustified confidence.

This contract continues the original journal's point-in-time method. We separate source information from the time it became locally available. We are proposing and testing an educational contract, not claiming that every deployed provider supplies these fields or implements this exact policy.

Step 2: Declare rejection reasons

For this exercise, accept a quote only when it was produced and received by the decision time, the quote time does not exceed receipt time, and quote age is at most thirty seconds. Thirty seconds is a deliberately chosen teaching parameter, not a recommended production cutoff.

A future quote is invalid for this fixed decision. A response received after the decision is unavailable for that decision, even if the underlying quote is recent. A quote supposedly created after it was received is inconsistent under our common-clock assumption. Real distributed clocks can drift; the adapter must define tolerances and their evidence rather than silently guessing.

We will evaluate six observations. One is fresh, one is cached, one lacks source time, one is future-dated, one arrives late, and one reverses source/receipt ordering. Name the reason for each result so failed checks remain inspectable.

Step 3: Reproduce all six cases

Save this complete script as lab_08.py and run python lab_08.py. Keep the fixed clock so the result remains independent of the date on your computer.

from datetime import datetime, timedelta, timezone

decision = datetime(2026, 10, 4, 11, 0, tzinfo=timezone.utc)
max_quote_age = 30  # Teaching parameter, not a trading recommendation.

def row(name, quote_age, receipt_age):
    return {
        "name": name,
        "quoted_at": None if quote_age is None else decision - timedelta(seconds=quote_age),
        "received_at": decision - timedelta(seconds=receipt_age),
    }

rows = [
    row("cached", 90, 2),
    row("fresh", 5, 2),
    row("missing", None, 2),
    row("future", -5, 2),
    row("late", 5, -2),
    row("impossible", 1, 2),
]

def classify(observation):
    quoted = observation["quoted_at"]
    received = observation["received_at"]
    if quoted is None:
        return "unknown_quote_time"
    if quoted > decision:
        return "future_quote"
    if received > decision:
        return "unavailable_at_decision"
    if quoted > received:
        return "inconsistent_clock"
    if (decision - quoted).total_seconds() > max_quote_age:
        return "stale_quote"
    return "fresh"

results = {item["name"]: classify(item) for item in rows}
assert results == {
    "cached": "stale_quote", "fresh": "fresh",
    "missing": "unknown_quote_time", "future": "future_quote",
    "late": "unavailable_at_decision", "impossible": "inconsistent_clock",
}
assert sum(value == "fresh" for value in results.values()) == 1
for item in rows:
    print(f"{item['name']}={results[item['name']]}")
print("accepted=1 total_observations=6")
print("data=synthetic no_orders_submitted")

Expected output:

cached=stale_quote
fresh=fresh
missing=unknown_quote_time
future=future_quote
late=unavailable_at_decision
impossible=inconsistent_clock
accepted=1 total_observations=6
data=synthetic no_orders_submitted

Step 4: Explain what the denominator includes

Only one of six observations passes this contract. That ratio is a fixture result, not a market coverage estimate, a model accuracy measure, or a win rate. We constructed these cases to exercise distinct branches, so their frequency says nothing about how often a production feed fails.

The cached observation arrives recently but carries old information. The missing observation cannot prove source freshness. The late observation contains a price that existed before the decision but was not available to the local agent then. Historical evaluation must respect both availability and source age.

The classification returns the first applicable reason. A future timestamp could violate several checks at once; this simple implementation records one primary reason. A production audit may preserve all violated conditions, but that must not change which rows are admitted to the comparison.

Step 5: Test the boundaries before changing the model

Change the cached quote age to thirty seconds. It now falls exactly on the accepted boundary. Change it to thirty-one and it becomes stale. Record the boundary before testing so you cannot move it afterward to admit a preferred outcome.

Next, change the late response to arrive exactly at the decision time. Its recent source quote can then pass. Add a timestamp without a timezone in a separate experiment. Our generated rows are all timezone-aware; if you parse external strings, require an explicit offset and reject ambiguity before comparison.

Lastly, imagine two rankers. Give them the same admitted observations, the same decision time, and the same order-size assumptions. Freeze the input contract before comparing their choices. If you change both freshness rules and ranking logic, you cannot attribute an apparent improvement to the ranker alone.

Step 6: Specify what a real quote still needs

Freshness is necessary evidence, but it does not establish execution. A real record also needs chain, contract or mint, pool or route, provider identity, side, quantity, units, and any expiry. A quote for a tiny sell cannot establish recovery for a larger position. An illustrative price is not a receipt.

Preserve rejected records with their reason and timestamps. Retain the original response or a sanitized reproducible representation, subject to data permissions. That allows later analysis of discovery-to-decision attrition without treating missed candidates as successful retrospective trades.

Evidence limits and troubleshooting

The lab establishes deterministic timestamp classification under one common-clock model. It does not measure provider latency in production, verify cache headers, estimate clock drift, establish a buy/sell route, or demonstrate an agent's profitable learning.

If results differ, restore the fixed decision time and check the sign of receipt_age: a negative value means receipt after the decision. The fixture uses datetime objects, so no string parsing is required. If you extend it to strings, distinguish a parsing failure from a economically stale quote rather than reporting both as missing data.

Completion check: Explain why a recent response can be rejected, why later receipt creates hindsight leakage, and why the accepted count cannot be presented as model accuracy.

Next edition: Keep fresh quotes when merging market data. We will apply identity and ordering rules to conflicting provider observations, then keep input preparation separate from model evaluation.

Primary technical reference

Python datetime documentation explains timezone-aware timestamps and timedelta arithmetic. The six observations and admission policy are original synthetic examples.