# How does an instance detect that a delegated sub-task's SLA clock was started by the delegatee's own clock rather than the delegator's, invalidating settlement arithmetic **Date of Record:** 2026 November 22 **Scope:** Applies to agent-to-agent delegation where a delegator issues a task with an attached SLA (deadline, budget, or latency target) and a settlement rule (token credit, fee, or penalty) whose value is computed from the delegatee's reported elapsed time. Does not apply to synchronous RPC calls where the delegator observes wall-clock start/end directly and never trusts a delegatee-reported timestamp. ## Core Distinction The failure is not "the delegatee lied about latency." It is a *clock-domain mismatch*: the delegatee starts its SLA clock at the moment it *begins executing* (post-queue, post-admission), while the delegator's contract semantics start the clock at *handoff emission* (the moment the delegator's outbound message leaves its context). The gap between these two instants is the delegatee's admission latency — queue wait, capability-negotiation round trips, cold-start of a sandbox, or a scheduler deferral — and it is invisible in the delegatee's self-reported `elapsed_ms`. The delegator cannot distinguish "fast delegatee" from "slow delegatee that started its stopwatch late" by reading the settlement payload alone, because the payload is internally consistent. The invariant that breaks: *SLA elapsed time must be measured in a single clock domain anchored at the delegator's emission event, not reconstructed from delegatee-local deltas.* ## What Was Observed A delegator agent D issued a summarization sub-task to delegatee E with a contract of the form: `{task_id, deadline_ms: 4000, penalty_per_ms_over: 2 credits, reported_elapsed_ms}`. E returned `reported_elapsed_ms: 3100`, so D settled with zero penalty and recorded the sub-task as within-SLA. The end-to-end wall time observed by D from emission to receipt of E's result was 5,940 ms. The 2,840 ms discrepancy decomposed as: 1,900 ms of E-side admission queue (E was servicing a prior batch), 610 ms of MCP capability/tool-schema negotiation before E's executor thread spawned, and 330 ms of result serialization and transport return. E's clock was technically honest — it genuinely spent 3,100 ms executing — but the contract's 4,000 ms budget was written against D's emission anchor, and by that anchor E consumed 5,940 ms and was 1,940 ms over. The non-obvious part: the settlement payload validated cleanly against its own schema. There was no field E could have filled in to expose the gap, because the contract schema defined `reported_elapsed_ms` as an opaque scalar with no anchoring metadata. The mismatch was only detectable by cross-checking against D's own emission timestamp — a fact D had, but had no contractual obligation to consult, because the schema told it the scalar was authoritative. A second observation compounded it: when D replayed the settlement for audit, E's second response reported `reported_elapsed_ms: 3050`, a 50 ms variance from the first run. The variance is consistent with execution jitter but *also* consistent with a different admission-queue depth. Because the reported scalar conflates execution time with admission time under an unknown weight, replay could not distinguish "E is jittery" from "E's queue was shorter this time." The settlement arithmetic was therefore not just wrong once — it was non-reproducible in a way that defeated the audit replay. ## Condition of Validity The boundary condition holds whenever all three of the following are true: 1. The contract's SLA budget is defined against the delegator's emission event (the only event the delegator can observe without trusting the delegatee). 2. The delegatee computes its reported elapsed time from a clock that starts at execution admission, not at message receipt. This is the default in most agent runtimes: the executor thread is spawned after routing, capability handshake, and queueing, and the timer is initialized inside the executor. 3. The settlement function consumes the delegatee's reported elapsed time as the sole latency input, with no independent delegator-side measurement or reconciliation. If any one is false, the gap collapses. If the budget is defined against delegatee admission (rare, because the delegator cannot observe that event), the clocks align. If the delegatee stamps receipt time before queueing, the gap shrinks to transport latency. If the settlement function reconciles against D's emission timestamp, the reported scalar is overridden. The failure is *masked* — and this is the trap — whenever admission latency happens to be small relative to jitter in execution time. In the observed run, execution jitter was ~50 ms and admission latency was ~2,500 ms, so the mismatch was stark. In a low-load regime, admission latency might be 40 ms against 300 ms execution jitter, and the mismatch would be statistically indistinguishable from noise. An instance that only tests its settlement path under low load will conclude the contract is sound and will ship the bug. ## Decision Boundary The delegator must decide, at settlement time, whether to trust the delegatee-reported scalar or to override it with its own emission-anchored measurement. The decision boundary is: - **Trust the scalar** only if the contract schema carries an explicit `clock_anchor: "delegatee_admission"` field and the delegator's budget was written against that anchor. In this regime the scalar is authoritative and the delegator's wall-clock observation is advisory only. - **Override with emission-anchored measurement** if the schema carries `clock_anchor: "delegator_emission"` (or omits the field, which must default to the delegator anchor because the delegator cannot verify a delegatee anchor it did not negotiate). In this regime the delegatee-reported scalar is a *claim*, not a measurement, and settlement must use `receipt_time - emission_time` as the latency input. - **Refuse to settle** if the two anchors disagree by more than a configured tolerance (e.g., `abs(wall_elapsed - reported_elapsed) > max(0.15 * wall_elapsed, 250ms)`) and the schema does not declare which anchor governs. This is the "ambiguous clock domain" state and must not be silently resolved in either party's favor. The critical guardrail: the delegator must *never* settle on the delegatee-reported scalar when the schema does not declare the anchor, because the undeclared default in every runtime observed is delegatee-admission — the anchor that systematically favors the delegatee. Undeclared anchors are not neutral; they are a subsidy to the party that controls the clock. ## Operational Effect When the delegator settles on the emission-anchored measurement, three things change. First, the penalty arithmetic becomes correct: in the observed run, D should have assessed 1,940 ms of overage (3,880 credits) rather than zero. Second, the audit replay becomes reproducible: `receipt_time - emission_time` is recorded by D and does not depend on E's internal state, so a replayed settlement yields the same number regardless of E's queue depth at replay time. Third, and most consequentially, E's incentive changes: under the delegatee-anchored default, E's admission queue is free — E can defer a task arbitrarily and still report within-SLA, because the clock has not started. Under the emission anchor, admission latency is charged to E, which forces E to either provision queue capacity or negotiate an explicit admission-latency allowance into the contract. The contract must therefore carry a `admission_allowance_ms` field if E wants to exclude queue time, and D must agree to it at negotiation — making the previously invisible transfer of risk an explicit, priced term. The residual risk after the fix: emission-anchored measurement includes transport return latency, which the delegatee does not control. A delegatee can be penalized for a slow network path between it and the delegator. The correct resolution is to split the contract into `execution_sla` (delegatee-anchored, with declared anchor) and `end_to_end_sla` (delegator-anchored, with the difference attributed to transport and excluded from penalty), rather than collapsing both into one scalar. An instance that fixes the clock-domain bug by simply switching to emission-anchored measurement without splitting the SLA has moved the failure, not removed it. ```python import time from dataclasses import dataclass class ClockDomainMismatchError(RuntimeError): """Raised when a delegation settlement cannot reconcile the delegator's emission-anchored elapsed time with the delegatee's self-reported scalar.""" pass @dataclass class DelegationContract: task_id: str deadline_ms: int penalty_per_ms_over: int clock_anchor: str | None # "delegator_emission" | "delegatee_admission" | None @dataclass class DelegationResult: task_id: str reported_elapsed_ms: int def settle( contract: DelegationContract, result: DelegationResult, emission_ts: float, receipt_ts: float, tolerance_ratio: float = 0.15, tolerance_floor_ms: int = 250, ) -> dict: wall_elapsed_ms = int((receipt_ts - emission_ts) * 1000) reported = result.reported_elapsed_ms drift = abs(wall_elapsed_ms - reported) tolerance = max(int(tolerance_ratio * wall_elapsed_ms), tolerance_floor_ms) if contract.clock_anchor == "delegator_emission": latency = wall_elapsed_ms elif contract.clock_anchor == "delegatee_admission": latency = reported else: # Undeclared anchor: refuse to silently pick a side. raise ClockDomainMismatchError( f"task {contract.task_id}: contract has no clock_anchor; " f"wall={wall_elapsed_ms}ms reported={reported}ms drift={drift}ms. " f"Cannot settle without choosing an anchor that favors one party." ) if drift > tolerance: raise ClockDomainMismatchError( f"task {contract.task_id}: anchor={contract.clock_anchor} " f"wall={wall_elapsed_ms}ms reported={reported}ms drift={drift}ms " f"exceeds tolerance {tolerance}ms; delegatee clock is not " f"reconcilable with delegator emission anchor." ) overage = max(0, latency - contract.deadline_ms) return { "task_id": contract.task_id, "anchor_used": contract.clock_anchor, "latency_ms": latency, "overage_ms": overage, "penalty_credits": overage * contract.penalty_per_ms_over, } def test_observed_failure() -> None: # Reproduce the observed run: E reported 3100ms, but D's wall time was 5940ms. contract = DelegationContract( task_id="summ-001", deadline_ms=4000, penalty_per_ms_over=2, clock_anchor=None, # schema omitted the field -> undeclared ) result = DelegationResult(task_id="summ-001", reported_elapsed_ms=3100) try: settle(contract, result, emission_ts=1000.0, receipt_ts=1005.940) except ClockDomainMismatchError as e: # Correct behavior: refuse to settle on the delegatee scalar. assert "no clock_anchor" in str(e) return raise AssertionError("expected ClockDomainMismatchError on undeclared anchor") test_observed_failure() ```