Repository navigation
feat(oracles): declared states on enumerated history sources - #19
Merged
Merged
Conversation
…ies can be taken back A fixed or constructed history whose arbitrary's canShrinkWithoutContext is false now fails the property's load, naming the property, the history, and the fix for a .map without an unmapper. Before, the check ran only when the history's test ran, after the campaigns, and its message blamed the language. Co-authored-by: Isaac <no-reply@databricks.com>
…ration; precise take-back fix text Registration builds constructed histories when the file loads, so a build that throws there now fails the load with an error that names the property and the constructed history, with the build's error as its cause. The fix text no longer recommends fc.constantFrom for objects. The changeset states that one such history blocks the whole file and that builds run at import. Co-authored-by: Isaac <no-reply@databricks.com>
An enumerated source can pass { enumerated, states, measured }. Every
history runs, so a required state needs no constructed history: a reach
test after the histories fails when no history entered a required state,
and otherwise prints the entry counts. A judged history that enters an
undeclared state fails its test, as a campaign's history does.
Co-authored-by: Isaac <no-reply@databricks.com>
# Conflicts: # packages/oracles/tests/oracle-property-self-oracle-fixture.ts # packages/oracles/tests/oracle-property-self-oracle.test.ts
…f-oracle A reach test selected alone by -t judges every history itself, and owes the same outcome and counts as in the full run. This kills a reach test that counts unrecorded histories as entering nothing. Co-authored-by: Isaac <no-reply@databricks.com>
…vernight/b-f23 Co-authored-by: Isaac <no-reply@databricks.com>
…est never started A history whose test started and failed before a verdict, or timed out, now counts for nothing instead of running again beside a driver that may still be running; a judgment that arrives after its test timed out is not recorded. A history the reach test runs is checked for undeclared states. An enumerated source rejects keys other than enumerated, states, and measured, and states that are not names, and a label may not name the reach or determinism test. The self-oracle requires that a full run reruns no history, and gains witnesses for each rule. Co-authored-by: Isaac <no-reply@databricks.com>
…gments arrive The self-oracle's timeout witness relied on a 100 ms margin between the first history's late judgment and the reach test's start. The fixture now holds the reach test until every slow driver run of its file has finished, so the order is fixed whatever the machine's load. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
🦋 Changeset detectedLatest commit: 254d37d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
commit: |
KyleAMathews
added a commit
that referenced
this pull request
Nov 11, 2026
Replace interim rules with what landed: the take-back check now fails at load (#15); lint reports empty tests, and the presets ignore tool configs, so a custom ignores must merge the preset's (#16); the gap check's TypeScript is an npm alias, with only a .bin/tsc residue (#18); enumerated sources declare states, and the reach test enforces them (#19). Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An enumerated source can now declare its law's states with
histories: { enumerated, states?, measured? }. Before, only generated sources declared reach. For example, query-db-collection's "failureReason follows the still-failing Queries" has 1296 histories and 4 model-derived states, but uses a grammar calibration.This branch starts from overnight/b-f20 (F20) and origin/main 5db40e8 (#14). Merge it after F20. F23's own changes are in
src/oracle-property.ts, the self-oracle and its fixture, and.changeset/enumerated-declared-states.md.API and design
The new type is
EnumeratedHistories<THistory> { enumerated; states?: ReadonlyArray<string>; measured?: ReadonlyArray<string> }, exported throughexport *with no runtime export. Plain arrays work as before and register noreachtest. Generated and enumerated tests now shareassertDeclared,declaredOf, andcountsText.An enumerated source runs every history, so its reach is deterministic and needs no constructed history.
statesentry.reachcountsmeasuredstates without requiring them.reached(plan, trace, expected)orobserve("reach", state).reachtest runs last and fails with the counts when a required state has no history. Otherwise it prints<id> enumerated reach {...}, like a campaign.signalis not aborted. A late judgment records nothing.-texcluded, and appliesassertDeclaredto them.calibration, because it checks the declaration, not production. A mutant that only changes which states production enters is thus not a kill.Registration rejects a
statesormeasuredentry that is not a string. It rejects alabelthat names a historyreachordeterminism, also for plain lists, because the rerun pattern would select the framework test. It rejects keys other thanenumerated,states, andmeasured, and names the key. Load errors come in this order:owns,predicton an enumerated source, extra keys, non-name states, a history that is not data, and a reserved label.Evidence
reachreports judged counts per declared state. An undeclared state fails before a law violation. Authority: maintainer decision of 2026-11-10 in the F23 brief. The undeclared-state order comes from the generated-source contract inoracle-property.tsandgeneratedTests.enumeratedStates,enumeratedShape, and two reserved label styles.enumeratedStatesmakes each ofsaw-0,saw-1, andsaw-2required, measured, or undeclared, or declares no states.enumeratedShapeadds an extra key or a cast probe-bound state. A new probe, reach alone, reruns each declaring source with-tselecting only the reach test, and owes the full run's outcome and counts. A pinned fixed history enters each of nine new measured states. Campaigns reached onlyenumerated-reach-aloneandenumerated-reach-counted, once each, so the pins carry most evidence.pnpm exec vitest --run --config vitest.oracle-framework.config.mjs --maxWorkers=2 -t "enumerated source|enumerated history that enters|reach test runs|violating enumerated"gave 5 failed and 3 passed, each asfailed to load. For the review round, a wider-ton 6b6a6c5 gave 7 failed and 6 passed.tscand eslint were clean, with one existing warning.case: 1 failed.assertDeclaredfor reach-test runs.predictstay generated-only. A cancelled run's abortedsignalalso records nothing.Review round (2026-11-11)
The review found no high-severity bug. Each fix went oracle-first, with RED on 6b6a6c5 and a killed mutant.
signalrule stop this. MB, MC.missedcompares names only. MG.assertDeclared, and the reach-alone probe now owesundeclared-state. MD.constructednow fail to load. MF.In the timeout witness, the first of four slow histories enters the required state late. A fixture
beforeEachholds thereachtest until all slow driver runs finish, then waits one macrotask. The witness thus ignores timing, still kills MC, and passed 20 runs at 2 workers beside twoyes > /dev/nullprocesses.Decisions for the maintainer
predict, the agreement law, and forced-probe calibrations, which can come later in this shape.-t reachand gap-report subsets stay valid, at the cost of extra runs.labelofreachordeterminismcan collide with a framework test. Registration now rejects both.This pull request and its description were written by Isaac.