Skip to content

docs(testing): close the measurement traps in the #1766 soak set before the flip - #2124

Merged
vybe merged 1 commit into
devfrom
docs/1766-soak-measurement-guards
Aug 12, 2026
Merged

vybe merged 1 commit into
devfrom
docs/1766-soak-measurement-guards

Conversation

@obasilakis

Copy link
Copy Markdown
Contributor

Why now

All three defects below are only fixable before the pilot is flipped. Afterwards the evidence needed to catch them no longer exists — schedule_executions does not record what the caller asked for, so the distinction is unrecoverable from the row.

What was wrong

1. M6 over-credits pull, invisibly.
Under push, a caller that gives up kills the turn and the row is written failed with Task execution timed out after N seconds. Under pull that budget no longer governs the row — the lease is execution_timeout_seconds + SLOT_TTL_BUFFER — so the work runs to its natural end and the row lands success, while the caller still got nothing in time. The failure moves off the row rather than going away.

No query over schedule_executions can separate "pull fixed it" from "pull outran the caller." And §9 told the reader to watch for a failed share above baseline — so a lower one reads as a pass.

Adds M9, the caller-side counter-check ([Chat Timeout Recovery], the #914 receipt) — the only observable that survives the flip — plus the divergence table that makes M6 and M9 interpretable together.

2. The baseline was specified as a single percentage.
The classes move independently and only one is about pull:

class meaning treatment
lost_result agent finished, result never landed, watchdog wrote it off the target — drive to zero, surfaces as M5 under pull
caller_timeout caller's budget expired the trap above — disappearance proves nothing
quota subscription limit exogenous — exclude

Collapsed into one number, a treatment window landing in a fresh quota week looks like a win. §9 now carries the breakdown query and what each class means; the abort criterion excludes quota (reverting pull cannot fix a subscription limit).

3. M6's query was a rolling interval '7 days', which straddles the flip and blends control rows into the treatment number. Now bound on :flip_ts, defined as the pilot agent's recreate — the flag only bakes in at create/recreate, so a backend restart alone leaves the agent not pulling.

Also

  • M3/M4 need sampling, not one run at the end. M3 counts concurrent leased rows, so a daily run lands off-peak and never sees the overbooking it exists to catch. M4 is worse: its predicate is status IN ('queued','running'), and cleanup_service's stale sweep eventually fails stranded rows to failed, at which point they leave the predicate — a soak that genuinely lost executions reports zero rows. The set table gains a cadence column.
  • Abort criteria gain the pre-existing-violation rule: a candidate pilot already red on a critical invariant must be resolved or carved out before the flip, or the soak trips its own abort at t=0.

Scope

Docs only — one file, no code, no schema, no behaviour change. The baseline measurements that motivated this are posted on #1766.

Refs #1766, #946, #914, #1871

🤖 Generated with Claude Code

…re the flip

Three defects in §9 would let the soak return a confident wrong answer, and all
three are only fixable BEFORE the pilot is flipped — afterwards the evidence
needed to catch them no longer exists.

1. M6 over-credits pull, invisibly. Under push a caller that gives up writes the
   row `failed` with "Task execution timed out after N seconds". Under pull that
   budget no longer governs the row — the lease is
   execution_timeout_seconds + SLOT_TTL_BUFFER — so the work runs to its natural
   end and the row lands `success` while the caller still got nothing in time.
   The failure moves off the row rather than going away.

   schedule_executions never records the caller's timeout budget, so no query
   over it can separate "pull fixed it" from "pull outran the caller". On a pilot
   whose baseline carries a meaningful caller-timeout share, M6 books a large,
   entirely fake improvement — and §9 told the reader to watch for a failed share
   ABOVE baseline, so a lower one reads as a pass. M9 adds the caller-side
   counter-check ([Chat Timeout Recovery], the #914 receipt), which is the only
   observable that survives the flip, plus the divergence table that makes the
   two counts interpretable together.

2. The baseline was specified as a single percentage. The failure classes move
   independently and only one of them is about pull: subscription-quota rows are
   exogenous, caller-timeout rows are the trap above, and watchdog-recovered rows
   ("completed on agent but status not reported") are the class pull exists to
   remove. Collapsed into one number, a treatment window landing in a fresh quota
   week looks like a win. §9 now specifies the breakdown query and what each class
   means for the comparison, and the abort criterion excludes quota — reverting
   pull cannot fix a subscription limit.

3. M6's query was a rolling `interval '7 days'`, which straddles the flip and
   blends control rows into the treatment number. Now bound on :flip_ts, defined
   as the pilot agent's RECREATE (the flag only bakes in at create/recreate; a
   backend restart alone leaves the agent not pulling).

Also: M3 and M4 need sampling, not one run at the end. M3 counts concurrent
leased rows, so a daily run lands off-peak and never sees the overbooking it
exists to catch. M4 is worse — its predicate is status IN ('queued','running'),
and cleanup_service's stale sweep eventually fails stranded rows to `failed`, at
which point they leave the predicate. A soak that genuinely lost executions
reports zero rows if M4 runs only at the end. The set table now carries a
cadence column.

Abort criteria gain the pre-existing-violation rule: a candidate pilot already
red on a critical invariant has to be resolved or carved out before the flip, or
the soak trips its own abort at t=0.

Docs only — no code, no schema, no behaviour change.

Refs #1766, #946, #914, #1871

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated via /validate-pr: security scans clean, required checks green, scope minimal.

@vybe
vybe merged commit 61c6fb8 into dev Aug 12, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants