Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/blog/introducing-tanstack-oracles.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ The model keeps task records in a plain JavaScript `Map`. After applying each ba
```ts
function expectedTopTasks(tasks: Iterable<Task>) {
return [...tasks]
.filter(task => !task.completed)
.sort((a, b) =>
b.priority - a.priority ||
(a.id < b.id ? -1 : a.id > b.id ? 1 : 0)
.filter((task) => !task.completed)
.sort(
(a, b) =>
b.priority - a.priority || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0),
)
.slice(0, 10)
.map(task => task.id)
.map((task) => task.id)
}
```

Expand Down Expand Up @@ -138,7 +138,7 @@ Neither is automatically authoritative. The law records the behavior I've decide

When they disagree, that difference gives the agent a precise clue about what to investigate. It can replay the history, trace how each side arrived at its answer, and work out what needs to change to reconcile them with the law. If the law itself doesn't settle the question, the agent asks me to make the design decision.

In Oracles, a sequence of actions like this is called a *history*. A **driver** executes those actions against production and records what happens. A **check** compares the observations with the answers calculated by the model.
In Oracles, a sequence of actions like this is called a _history_. A **driver** executes those actions against production and records what happens. A **check** compares the observations with the answers calculated by the model.

The framework brings these pieces together through `oracleProperty`:

Expand Down Expand Up @@ -211,7 +211,7 @@ Constructed histories capture that judgment. I want Oracles to guide agents thro

For that I can add a **calibration**. Take an existing passing history where two equal-priority tasks both fit in the result, so the model expects `[A, B]`. I tell Oracles to feed the checker `[B, A]` instead.

That deliberately wrong observation is called a *corruption*. I'm not changing production code. I'm checking whether the oracle would recognize this particular mistake.
That deliberately wrong observation is called a _corruption_. I'm not changing production code. I'm checking whether the oracle would recognize this particular mistake.

Oracles handles the execution: it runs the original history, substitutes the wrong answer, and requires the ordering law to reject it. If the change doesn't take effect, the wrong law fires, or the test crashes for an unrelated reason, the calibration fails.

Expand Down
Loading