Measure chance reach misses in oracle properties

Ouverte
#2,289 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
53/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
typescript
Domaine
devtools, testing

Piste de recherche

Start with packages/db/tests/declared-reach-oracle.property.test.ts and docs/contributing/oracle-coverage.md, then find the other files using createOracleReach or runOracleCampaign. Measure normal-budget reach misses across seeds for states not entered by fixed examples; add fixed examples through the shared seam or document probabilistic states with a maintainer decision. Consider whether a lint rule can identify chance-selected reach prefixes.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Problem

A generated property declares the states its laws depend on, and createOracleReach fails a run in which too few histories entered one (ORC-015). When only random histories enter a declared state, the check can fail by chance at the normal run budget. No law fails, but CI goes red. #2287 was one case: in about 0.3% of 60-run campaigns, source-health.history never chose the one reach prefix that enters two of its states.

The fix for #2287 adds a shared seam for this:

  • oraclePropertyOptions(…, { examples }) runs fixed examples first in every run, on top of the base budget.
  • createOracleReach(…, { fixedHistories }) fails for each declared state that those examples did not enter.

The three source-health properties use the seam, so their reach does not depend on the seed. packages/db/tests/declared-reach-oracle.property.test.ts (oracle.declared-reach) owns these rules.

About 40 other files use createOracleReach or runOracleCampaign. Their chance of a reach miss at the normal budget has not been measured.

Work

  1. For each property with declared reach, list the declared states that no fixed example enters.
  2. Measure how often a normal-budget run misses each of those states. For example, count the misses across many seeds, or sample the generator.
  3. For each state that can miss, add a fixed example through the seam, or record the state as probabilistic in docs/contributing/oracle-coverage.md with a maintainer decision. Raise a run budget only with a maintainer decision, because it adds CI time.
  4. Consider a lint rule that reports a property that chooses a reach prefix by chance (fc.option(fc.constantFrom(...prefixes))) without fixed examples.

The coverage map's "Oracle tooling" section links to this issue as the destination for the gap.

Refs #2234, #2287.

This issue was written by Isaac.

Langage dominant
TypeScript
Étoiles
4k
Forks
277
Merge moyen
1 j 7 h
PR mergées (30 j)
170

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TanStack/db

Toutes les issues de TanStack/db

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.