Repository navigation
docs(skills): count the shapes of real inputs in the reach line - #303
schiller-manuel wants to merge 1 commit into
Conversation
A grammar drafted by hand can miss shapes that the package's own inputs have, and the oracle and the gap check stay green. The design skill's step 5 gives the recipe with today's API: a labelling function from an input to its shapes, the real inputs' labels as measured states, and `reached` labelling each history's input, so a 0 in a generated unit's reach line names a shape no generated history had. The explore skill's step 4 lists the real inputs' shapes beside the callers' operations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
commit: |
A downstream project's code transform had laws that said "every module". No history generated JSX, a nested block, or a transform that rebuilds a node, although the package's own benchmark corpus is
.tsxmodules. The oracle and the gap check were green, and the ORC-004 range control was a sentence inlimitsthat nothing checked against those inputs.This PR is docs only. It gives the recipe with today's API: label each real input with a function the author writes, declare the labels as measured states, and label each history in
reached. Each unit's reach line then shows a 0 for every shape of a real input that no generated history had. A probe below shows that the recipe works with no framework change, so no new option is proposed for approval.Stacked on #270 (
docs/explore-grammar-from-callers), because both PRs edit the same ORC-004 reconstruction line and the same list in explore step 4.What changed
Design skill, step 5: the ORC-004 reconstruction control also covers "each shape that the package's real inputs have". A new bullet after it, Count the shapes of real inputs, gives three steps:
measured.reached, label the history's input and keep the labels that a real input has, together with the driver's ownreachvalues, whichreachedreplaces.It ends with what to do about a 0: widen the grammar, or state the shape in
limits. A shape that a law depends on goes instates, where the property fails to load until a constructed history (one the arbitrary can generate) enters it.Explore skill, step 4: below docs(skills): draft the history grammar from what real callers do #270's "What its callers do between calls", a bullet What shapes its real inputs have. It covers the corpus, benchmark inputs, and the inputs of ordinary tests. Label them, compare the labels with the drafted grammar, and make each missing shape a history dimension or a stated limit. It points to the design bullet.
The probe (on origin/main, 0175017)
The scratch package is
oracle-gaps/.scratch-shapes(ignored, deleted afterwards), run with the real CLI and Vitest.Production uses the TypeScript parser, with a generic walk:
const x = eorf(e, e). An expression is a name, a digit, a property reada.b, ore + e. The model states the rule: a name is read where it stands as an expression, as a callee, or as the object of a property read. Law: "For every module, referencedNames returns each name the module reads, once, sorted." One calibration drops a read name.corpus/route.tsx, a route module with a component function, anifblock, and two JSX elements with attributes;corpus/loader.ts, two statements.1. Green, and nothing names the missing shapes. The oracle passes 8 of 8 tests. The gap check (
node index.mjs --package .scratch-shapes --source src/names.ts --config vitest.config.mjs --seed 42) reports21 mutants, 21 killed, 0 gaps. The walk is generic, so flat modules reach every line. Meanwhile production is wrong on the corpus:componentandpathare object keys, anditemsandreasonare JSX attribute names. None of them is read.2. The recipe with today's API (the labeller lists
ts.SyntaxKindnames, and the corpus is read withreaddirSyncwhen the file loads):It prints (random unit; the fixed-seed unit has the same zeros):
The corpus has 24 shapes, and 12 of them (50%) were never generated:
Block,EqualsEqualsEqualsToken,FunctionDeclaration,IfStatement,JsxAttribute,JsxAttributes,JsxExpression,JsxSelfClosingElement,NoSubstitutionTemplateLiteral,ObjectLiteralExpression,PropertyAssignment,ReturnStatement. The gap check with the recipe in place still says21 mutants, 21 killed, 0 gaps. The line goes to itstest-output.log, and the driver's own state (an empty module) is kept.3. The gate. With
states: ['shape JsxAttribute'](taken out ofmeasured), the file fails to load:The
Historytype has no JSX, so no constructed history can enter that state until the grammar writes JSX.4. Widening the grammar finds the bug. Add
<T attr={e} />as an expression, and owe the tag and the value's reads but not the attribute name. The oracle then fails 2 of 8 tests (both campaign units), and shrinks to:Why docs, and not a framework option
The suggested hint was: parse the package's own inputs, list their node types, and report the ones no history produced. What exists already covers each part:
measuredtakes any list of names, and it can be computed when the file loads.reached(plan, trace, expected)receives every judged history. A history arbitrary sampled in a separate test (the arbitrary is the author's own value, so that is possible) would be a separate draw, and an oracle file cannot hold such a test (oracle/no-unit-test).reachedsees exactly the histories that each unit judged.statesneeds a constructed history that the arbitrary takes back.So the framework stays domain-neutral, and the cost is about ten lines in the oracle file.
Evidence
Docs only, so no RED/GREEN and no changeset (a docs-only skill PR):
oracle-gaps: done completed, 0 gaps.npx -y pnpm@11.1.0 run build,lint:check,format:checkandtypecheckpass at the root. No test is added, so the shard checks are unchanged.Overlap
law.rangesproposed): that PR deals with survivors past a bound the grammar sets on purpose. This one deals with shapes of real inputs that the grammar misses without saying so. A shape stated inlimitsunder this recipe is the kind of range docs(skills): tie a survivor past a stated range to that range in the evidence #294 ties survivors to. No shared lines.countedprobes): it counts production's decisions per history. This recipe counts shapes of the input, from the plan, with no probe. feat(oracles): counted probes report how often each history entered them #263's bullet sits next to "Read the reach counts", in other lines.git merge-treeis clean against every open PR that touches either skill file: docs(skills): give each clause of a law statement its own check #301, feat(oracle-gaps): --only accepts a mutant's stable key beside its id #299, docs(skills): tie a survivor past a stated range to that range in the evidence #294, docs(skills): split an oracle file that a reviewer can no longer hold, over one shared module #287, docs(skills): give each parallel reviewer its own lens, and merge their findings in one ledger #286, docs(oracle-gaps): say what --diff-base marks and that it does not shorten a run #285, docs(skills): remove code on gap evidence only when owned laws decide every entry point's value #280, feat(oracles): notAllowed states the freedom an allowed set rests on #277, docs(oracle-gaps): say that the gap check's random units are fixed #276, fix(oracle-gaps): call code dead last, and only with its evidence #274, docs(skills): own the source of truth for vendored or generated code #272, docs(skills): ask an open law question with a caller scenario and real outputs #271, docs(skills): draft the history grammar from what real callers do #270, docs(skills): a change that makes production match the model needs a second formulation #269, docs(skills): scope the fix history and install the package in a monorepo #268, feat(oracle-gaps): --compare prints a refactor's evidence by mutant key #267, docs(skills): trigger the independent review where work ends #265, docs(skills): run the random campaign several times before a production change is done #264, feat(oracles): counted probes report how often each history entered them #263, feat(oracle-gaps): mark a gap that an ordinary test kills #262, docs(skills): run the gap check once over every source file of the package #257, feat(oracle-gaps): a gap says in how many histories its code ran #256, fix(oracles): a history the arbitrary cannot take back fails its property, not its file #255, docs(skills): validate a fast-path removal before proposing it #253, fix(oracle-gaps): name the step that avoids a native crash in the done error line #252, docs(skills): say how a probe loads packages and runs TypeScript, before the first probe #251, docs(oracles): add an API quick reference with one complete oracle file #250, docs(skills): one rule for an older Vitest, raised during the look-around #249, docs(skills): removing or replacing a whole algorithm needs sign-off #248, docs(skills): say what an explore run does with no developer in the loop #247, feat(oracle-gaps): run the package's authored-mutants directory by default #241, docs(skills): keep authored mutants in the package's authored-mutants/ directory #239, fix(oracle-gaps): --only refuses a selection that judges nothing #236, fix(oracle-gaps): direct a finite rewrite of a production loop before the timeout shortfall #235, fix(oracle-gaps): name dead code in the not-distinguished directive of a value made undefined #234, fix(oracle-gaps): class a work rise no bound judges as clocked-work, not not-observed #231, feat(oracle-gaps): a baseline-only run goes on past an owns entry that names nothing #230, docs(skills): a model is synchronous; compare an awaited reference in the check #227, feat(oracle-gaps): note each owns entry that no mutant tests #226, fix(oracle-gaps): let an owns entry name a class #222, feat(oracle-gaps): --baseline-only runs every test file's baseline and judges no mutant #221, docs(skills): ignore the gap check's session directory in setup #220, fix(oracle-gaps): name a dead store in the not-observed directive #217, fix(oracle-gaps): direct a setup-error to a driver's dynamic import #215, fix(oracle-gaps): say that extra-work can be a difference no history reaches #214, fix(oracle-gaps): tell the three causes of a timeout gap apart #213, docs(skills): say that a driver runs each history several times in one module instance #212, docs(oracles): write owns inline as literals; TypeScript probes on newer Node #70.Limits
generatedunits.For approval
realInputs: { inputs, labels }and print one more line per passing unit,<id> <unit> shapes not generated: …. It would add no states, and it would be the recipe in one option. I recommend waiting until a real oracle finds the reach line too hard to read.🤖 Generated with Claude Code