Repository navigation
Before 4.0.0: an exports map, pin in the oracle model, and the open review items - #216
Merged
Merged
Conversation
- The scroll model predicts pin (L4's frames at mount, on a toggle, on attach and on enabling) and whether each change slides. The callbacks (L3), wrapper state (L10) and transition class (L20) laws now compare with it instead of with other observations; the work law's bounds come from its model. Predictions with pin off are unchanged. - An exports map: types, module for bundlers, default (CommonJS) for Node. The package oracle now uses the tarball by its name from an app with its own package.json (a package with exports resolves its own name to itself), adds Node's native import and a refused deep require, and reports any file loaded from outside the tarball. The type check imports the package by name. - The syntax law parses every JavaScript file the tarball holds. - L20's text states the mount rule; the Chrome limits list what is stood in there. - CI's gap-check job fails on any gap or failing oracle file. Gap check (seed 1): 342 mutants, 342 killed, 0 gaps. Chrome: 766 passed. Co-authored-by: Isaac <no-reply@databricks.com>
Each defect was shown failing in the oracle before its fix. - The model's fork for a frame left pending across a parent change kept the attach's change (state, callback, snap and slide). The callbacks, wrapper and transition-class laws now generate parent changes with a frame pending; a calibration that drops the attach's onUnfix was accepted before the fix and is rejected after it, and a production mutant that makes that unfix silent is killed. - A parent change while disabled changes nothing in the model (it ran pin's frame and owed onPin); a constructed history failed before. - New clause of the speed law (decision 2026-11-30): a slide without movement lasts 200ms with matchScrollSpeed. The speed law's histories now toggle pin; a calibration and a mutant (no zero-movement guard) fail it. - The package oracle reads file URLs with fileURLToPath and judges the bundler's build from every package file in the bundle; L20 records the decision behind its mount rule; one helper runs the frame at the parent's position. Gap check (seed 1): 342 mutants, 342 killed, 0 gaps. Chrome: 788 passed. 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.
Before the 4.0.0 release, this PR closes the items that the review of #215 left open. It also adds an
exportsmap to the package. The production code insrc/does not change.The package now has an
exportsmapBundlers get the ES module build, Node gets the CommonJS build, and TypeScript gets the types. A deep import of another path now fails:
The map has no
importcondition. The ES module build uses imports without file extensions, and Node cannot load them. So Node keeps the CommonJS build, as in 3.2.1. The CHANGELOG lists the refused deep imports as a breaking change.The package oracle now uses the packed tarball by its name, from an app directory with its own
package.json. A package withexportsresolves its own name to itself. Without thatpackage.json, the oracle loaded the repository'sdist/instead of the tarball. The oracle now reports any file that comes from outside the tarball. New histories check Node's nativeimportin a child process, because Vitest resolvesimport()through Vite. Another history checks that a deeprequirefails.Four laws now compare with a model
Four laws took their expected values from other observations. They are the callbacks law (L3), the wrapper state law (L10), the transition class law (L20) and the work law (W). Now each compares with a model. For L3, L10 and L20, the shared scroll model must predict
pin. It now models the frame thatpinasks for at mount, whenpinchanges, on a parent change and whendisableturns off. It also records whether each change slides. Withpinoff, its predictions are the same as before.The review of this branch found two defects in the model. The oracle showed each one failing before its fix:
onUnfixpassed the callbacks law. The three laws now generate parent changes with a pending frame. A calibration and a production mutant show the fix.pinanddisableboth on, a parent change made the model expectonPin. A disabled header does not attach, so nothing happens. A Chrome run on a random seed found this defect.One rule stays a relation between two observations: a step that shows nothing new calls no
setState.A new clause of the speed law
With
matchScrollSpeed, a slide without movement lasts 200 ms. One example is a slide that starts whenpinturns on while the page does not move. Production already does this, and a slide from an instance method also lasts 200 ms. The histories of the speed law now togglepin. A calibration and a production mutant fail the clause. Decision by Kyle Mathews (GitHub KyleAMathews), 2026-11-30.Smaller changes
oracle-gapsexits 0 whatever it finds, so the job reads its output.src/explains.fileURLToPath. It judges the build of the bundler from every package file in the bundle.Verification
pnpm test: the unit tests, the oracles (832 tests), the type check, lint and the format check pass.pnpm test:gapswith seed 1: 342 mutants, 342 killed, 0 gaps.pnpm test:oracles:chrome: 788 tests pass.A follow-up remains: three existing calibrations have no history binding, in the overscroll and calcHeightOnResize laws. The framework warns that their search will go away.
This pull request and its description were written by Isaac.