Skip to content

Bind every oracle calibration to the history it corrupts - #217

Merged
KyleAMathews merged 1 commit into
masterfrom
bind-calibrations
Nov 30, 2026
Merged

KyleAMathews merged 1 commit into
masterfrom
bind-calibrations

Conversation

@KyleAMathews

Copy link
Copy Markdown
Owner

Each calibration in the oracle files now names the history that it corrupts. A calibration is a planted wrong answer that proves a law rejects it. Before, 28 of the 33 calibrations named no history. For those, @tanstack/oracles searched the histories for one where the corruption applied. The framework calls that search transitional and will remove it before its first release.

{
  name: 'a default tolerance of 0',
  law: 'defaults',
  history: { constructed: 'hide, then scroll up exactly 5px' },
  corrupt: (trace, plan) => /* show the header on that slow scroll up */,
}

A bound calibration runs on one history. That history must pass clean, and the named law must reject the corruption. So each calibration now tests the same case on every run. The calibrations of the package oracle use the index of an enumerated history, for example { enumerated: 1 } for the bundler entry.

Two corruptions did not test what their names say, so they now target the correct step:

  • "a bounce that showed the header" corrupted the first hidden step, which is the hide. It now corrupts the step past the end of the scroller.
  • "the new parent ignored" corrupted the first shown step, which comes before the parent change. It now corrupts a step after the change.

Verification

  • A control binding fails as it must. With the defaults calibration bound to "hide, then scroll up 6px", the framework reports "selected corruption did not apply".
  • pnpm test passes. The oracles run 832 tests.
  • pnpm test:gaps with seed 1: 342 mutants, 342 killed, 0 gaps.
  • pnpm test:oracles:chrome: 788 tests pass, with no warnings about bindings.

This pull request and its description were written by Isaac.

All 33 calibrations across the three oracle files now name their
history (a constructed history, or an enumerated index), so each one runs
on a history that reaches its case instead of the framework's
transitional search, which goes away before its first release. Two
corruptions now target what their names say: the bounce (a hidden
header's step past either end) and the new parent (a step after the
parent changes).

A control binding that the corruption cannot apply to fails ("selected
corruption did not apply"). Gap check (seed 1): 342 of 342 killed.
Chrome: 788 passed, no binding warnings.

Co-authored-by: Isaac <no-reply@databricks.com>
@KyleAMathews
KyleAMathews merged commit 5423b7b into master Nov 30, 2026
6 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.

1 participant