Files
Native-Router-Vue/packages/core-v2/verify/README.md
T
Claude 329271691c Restructure core-v2 into layered modules
Rewrite the core-v2 internals without changing the public API or runtime
behavior. The four large files (types, scene, motion, gesture) become
layered modules with one responsibility each:

- shared/: geometry and environment helpers
- view/: originView recipes
- choreography/: effect types, presets, and composeEffects compositing
- actions/: forward/back/replace/above/under via one overload resolver
- scene/: SceneGraph storage, transitions (history rules), compositor
  (styles and interactivity), spring (pure stepper + rAF driver), and
  createOriginScene, which only wires them and owns async timing
- composables/: useOrigin and the node-scope injection key
- gesture/: builder, definition->policy normalization, start admission,
  DirectionalTracker, and a GestureRecognizer session state machine
  replacing fifteen loose closure variables
- components/: renderers and gesture hosts, plus their prop types

Verification (packages/core-v2/verify): differential fuzzing drives
main and this branch with identical random operation sequences and
pointer streams and requires identical scene state, styles, contexts,
callbacks, and promise results at every step. It caught every planted
mutation that applied. Benchmarks are at parity.

Also fix a pre-existing test that called the defineProps macro inside a
runtime defineComponent, and correct API.md's description of the flick
commit threshold to match the runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Faarh2Ts6StJPcz2mRiHiR
2026-10-16 01:15:12 +00:00

28 lines
1.4 KiB
Markdown

# Differential verification
Checks a core-v2 implementation against an earlier one (by default `main`)
by driving both with identical randomized inputs and requiring identical
observable results after every step.
From the repository root:
```sh
packages/core-v2/verify/setup-baseline.sh main # extract into verify/.baseline/
npx vitest run --config packages/core-v2/verify/vitest.config.ts
SEEDS=50 npx vitest run --config packages/core-v2/verify/vitest.config.ts # quicker
ONLY=rewrite npx vitest bench --run --config packages/core-v2/verify/vitest.config.ts
ONLY=baseline npx vitest bench --run --config packages/core-v2/verify/vitest.config.ts
```
- `scene.diff.ts` runs random `begin`/`update`/`finish`/`cancel`/animation
frame sequences against both scenes and compares nodes, operations, roots,
every node's composited style, interactivity, contexts, and every promise
result. It also compares action-helper output and the runtime export list.
- `gesture.diff.ts` mounts both packages in Vue apps whose views install the
same gestures (builder definitions, legacy options, `OriginGesture`, and
`OriginGestureSurface`), dispatches identical random pointer streams, and
compares scene state and every navigation, start, and completion callback.
- `scene.bench.ts` measures compositing, push/back cycles, and rendered
frames. Run each implementation in its own process with `ONLY=`; running
both in one process biases whichever runs second.