Repository navigation
test: make bug-finding systematic with a claim catalogue, API-surface coverage, seeds and candidates - #54
Merged
Conversation
… coverage, seeds and candidates
The high-yield sweeps in this repository were each written after a bug of their kind had
shipped, and nothing said which promises had no sweep at all. This ports the generated-oracle
idea from CodoMetis.TypeKit the way BLite adopted it: as data and ordinary tests, without the
prober, the ledger or covering arrays.
test/oracles/ holds the system:
- claims.json — 121 claims, one per sentence a consumer-facing document states about behaviour,
quoted verbatim (OracleCatalogueTests fails when the document no longer contains it), with the
oracle kind, the public members a probe calls and the tests that hold it. An empty heldBy is
the worklist; two remain (A02, A03), decidable only by the consumer smoke test.
- ApiSurface + surface-waivers.json — every public member of the four packages, by reflection,
must be named by a claim or waived with a reason (OracleSurfaceCoverageTests).
- oracles.json — 27 registered sweeps; every one ships a seed under seeds/, a patch to src/
that plants a defect it was shown to catch. OracleSeedTests holds the seeds present,
src-only and applicable in CI; `dotnet run tools/oracles.cs seeds` proves locally that each
is caught (all 21 are, through the tool, against a live PostgreSQL where the oracle needs one).
- candidates.json + Candidates.cs — a disagreement an oracle finds is registered against its
issue; it fails labelled until filed, is reported SKIPPED while open, and fails as "candidate
fixed" once the defect is gone. The three small-model sweeps now report through it.
New oracles: DomainParityOracleTests (the small-model sweep over all eleven range types through
an order-preserving embedding), DecorativeElementContractTests, ClientSideOnlyTranslationTests,
ClientSideOnlyProjectionTests, ExclusionConstraintTests, and claim tests in existing classes.
Found by the first catalogue pass and the probing round over the unheld claims (Found-By: OT):
- docs/serialization.md showed CreateUnboundedStart(5) as "(,5]" and
CreateFinite(1, 10, endInclusive: false) as "[1,10)"; both canonicalize ("(,4]", "[1,9]").
Held by RangeParseFormatTests.FormattingExamples_InTheSerializationGuide_PrintExactlyTheirComments.
- The NodaTime README promised an ArgumentOutOfRangeException for a far-future non-ISO date that
no calendar NodaTime ships can reach; the sentence now says the conversion cannot fail.
- docs/efcore.md said ExecuteUpdate to null inside a JSON column fails with 42804; the plugin's
guard refuses it first.
- StringSet<T> writes a decorated wrapper element instead of refusing it (#53, silent): registered
as a candidate, SKIPPED while the issue is open.
docs/oracles.md describes the machinery; CONTRIBUTING gains the oracle rules and the Found-By /
Defect-Class trailers; CLAUDE.md gains the structure entries and workflow rule 6.
Closes #37
Found-By: OT
Defect-Class: LIT
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Oct 17, 2026
…p rows of #53 The unit job's loop ran `dotnet test test/oracles/`, a folder of catalogue data with no project, and failed with MSB1003; it now skips a folder without a csproj. The integration loop matches `*IntegrationTests/` only and was unaffected. #53 widened from the string arity to every wrapper arity: none checks that an element's text form round-trips. Two more rows, measured through the array literal, are registered against it in DecorativeElementContractTests — `Int32Set<OffByOne>` (ToString gives V + 1, Parse gives V) is written as {124} and read back as a different set; `StringSet<Lenient>` (ToString decorates, Parse keeps any text) comes back as {CUST-CUST-123}. Nothing throws in either case. The rows live in their own methods per arity, so a seeded defect in one cannot be read as the other's known failure. That exposed a gap in the registry: "candidate fixed" was judged over every row of the oracle class, so a method with disjoint rows failed on the rows it never produces. A candidate now carries an optional `method`, Candidates.Verdict takes the calling method, and OracleCandidateTests checks the method exists in the class. Found-By: OT Defect-Class: STORE Co-Authored-By: Claude Fable 5.1 <[email protected]>
The labels moved to the BLite scheme: `found-by/oracle`, `package/*`, `area/*`, `severity/*`. The trailer paragraph in CONTRIBUTING and the candidate-filing step in docs/oracles.md named the old ones. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Oct 17, 2026
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.
Closes #37. Part of #36; the probing round it carries is the work of #52.
What this is
Bug-finding in this repository has been one sweep per shipped bug: the shape matrix after
IsAdjacentTo, the small-model oracle afterIsStrictlyLeftOfandExcept, the multirange oracle afterRangeSet.Except, the literal sweeps after the culture defects. Each found more than the bug it was written for, but which sweep to write next was decided by the last bug report, and nothing said which promises had no sweep at all.This PR ports the generated-oracle approach from CodoMetis.TypeKit the way BLite adopted it: as data and ordinary MSTest classes, without the prober, the ledger or covering arrays. Everything lives under
test/oracles/, is held consistent by convention tests, and is described in docs/oracles.md.The machinery
claims.jsonsurfaces) and the tests that hold it (heldBy)OracleCatalogueTests: the quote must still be in the file, the heading must exist, everyheldByis a[TestClass], every surface is a real member, every promise document carries a claimApiSurface+surface-waivers.jsonOracleSurfaceCoverageTests: each is named by a claim or waived with a reason; a waiver whose members are all claimed is staleoracles.jsonOracleSeedTests: every oracle has a seedseeds/*.patchsrc/, naming the oracles it was shown to failOracleSeedTests: src-only, well-formed, still applies to the tree.dotnet run tools/oracles.cs seedsre-proves locally that each is caught (a scratch copy, the patch, each oracle built and run); all 21 arecandidates.json+Candidates.csCandidates.Verdictreplaces the final assert of a sweep: a row fails until its issue is filed, is reportedSKIPPEDwhile it is open, and fails ascandidate fixedonce the defect is goneAn empty
heldByis the worklist. After the probing round two remain (A02, A03), both decidable only bytest/consumer-smoke-test.sh, which gained the A02 case.New oracles
DomainParityOracleTests— the small-model sweep generalized fromInt32Range/DecimalRangeto every discovered range type through an order-preserving embedding (a day, a month, a half hour per grid point). Nine of the eleven types had worked examples only for what each supplies itself. All eleven agree with set theory; 2 s.DecorativeElementContractTests,ClientSideOnlyTranslationTests,ClientSideOnlyProjectionTests,ExclusionConstraintTests, plus claim tests added to existing classes — the probing round over the twelve unheld claims.What it found (
Found-By: OT)docs/serialization.md#formatting.CreateUnboundedStart(5).ToString()is"(,4]", not"(,5]"(exclusive by default, canonicalized);CreateFinite(1, 10, endInclusive: false)is"[1,9]", not"[1,10)". A reader copying either would have taken a value to be in the range that is not. Fixed, held byRangeParseFormatTests.FormattingExamples_InTheSerializationGuide_PrintExactlyTheirComments.ArgumentOutOfRangeExceptionwas unreachable. The sentence now says the conversion cannot fail (CalendarBoundaryTestsholds it).docs/efcore.mdnamed the wrong refusal forExecuteUpdatetonullinside a JSON column: the plugin's guard refuses it before Npgsql's 42804.StringSet<T>writes a decorated wrapper element instead of refusing it — Wrapper set arities don't check that an element's text form round-trips #53, labelledsilentbecause the fix tightens behaviour, so it is not under Epic: 9.1.0 #35. Registered as three candidate rows;DecorativeElementContractTestsreports themSKIPPEDwhile Wrapper set arities don't check that an element's text form round-trips #53 is open.For the reviewer
tools/oracles.cs seedsran all 21 end to end (≈30 min, Docker), every pairCAUGHT. The log is in the commit message's claim, not in the repo; re-run it before the release.TimeSet<T>.FormatValuedoes not reachWrapperArityIntegrationTests: the EF bridge pins the format a second time inSetTypeRegistry, exactly as CLAUDE.md's rule says, so that seed unpins both halves.DomainBoundaryDivergenceTestsis deliberately not a registered oracle: it only queries the server, so no change tosrc/can fail it.Found-By:/Defect-Class:trailers; CLAUDE.md gains the structure entries and workflow rule 6. Both touch sections that chore: track work as labelled issues with release epics #51 also edits; whichever lands second merges them.tools/oracles.csis a file-based app (#:property PublishAot=false, since file-based apps default to AOT analysis and the repo's warnings-as-errors would otherwise refuseJsonSerializer). It is never run in CI.Verification
dotnet teston every non-integration project: green (875 + 95 + 194 + 217 + 81 + 31).dotnet run tools/oracles.cs seeds:every seed is caught.🤖 Generated with Claude Code