Repository navigation
test(valtio): add React parity harness - #519
jonkwheeler wants to merge 32 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c0ae1a9 to
1213453
Compare
Follow the hook-form pattern: tag parity lanes with testExecution group react-parity, move differential tests into a dedicated project with globalSetup precompile, and drop per-file beforeAll compile hooks.
Resolve merge conflicts preserving PR intent and the react-parity vitest differential split; refresh lockfile and vitest integrity hashes. Co-authored-by: Cursor <[email protected]>
Regenerate parity lockfile hashes, bindings status, and package inventory. Co-authored-by: Cursor <[email protected]>
Resolve inventory and root scripts while keeping valtio coverage.
Regenerate lockfile hashes and Vitest evidence for valtio.
Upstream adapted suite files are excluded from discovery, so the valtio ledger assertion must match the four remaining classified tests. Co-authored-by: Cursor <[email protected]>
|
Addressed maintainer provenance/ownership feedback, merged origin/main, and fixed the Bugbot classification-count finding. Bugbot is clean on the current head; no unresolved threads; CLEAN vs main. READY FOR REVIEW |
…nejs#519) Move Octane-only binding coverage out of parity ownership and replace the adapted lane with cases that cite pinned [email protected] React hook source. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
|
Addressed maintainer ownership feedback (ordinary binding suite + cited adapted hooks), merged origin/main, and refreshed digests. Bugbot completed successfully on the current head with no unresolved threads; merge state is CLEAN. READY FOR REVIEW |
|
Branch is conflicting with main after recent trunk movement; withdrawing readiness while currency is repaired. REVIEW WITHDRAWN |
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
|
Merged origin/main (digest conflicts resolved + lockfile digests refreshed; then update-branch for subsequent trunk commits). Bugbot completed successfully on the current head with no unresolved threads; merge state is CLEAN. READY FOR REVIEW |
leonidaz
left a comment
There was a problem hiding this comment.
React-parity scope review only; tests were not run.
| "verification": "verified" | ||
| }, | ||
| "upstreamSuites": { | ||
| "runtime": "absent", |
There was a problem hiding this comment.
The pinned canonical tag has an executable runtime suite (test:spec: vitest run) with 20 test files, including React-hook coverage such as tests/useProxy.test.tsx; breadth or React Testing Library coupling does not make that suite absent. Please run the applicable pristine suite unchanged, adapt the React-facing cases one-for-one with exact dispositions/citations, and retain the framework-neutral tests as the baseline for the vanilla core reused here.
There was a problem hiding this comment.
The pinned canonical tag has an executable runtime suite (
test:spec: vitest run) with 20 test files… Please run the applicable pristine suite unchanged, adapt the React-facing cases one-for-one…
Need a scope call before expanding this PR.
Options
(a) Expand to full pristine Vitest + one-for-one adapted React suite (vendor upstream/, ~11 React files, StrictMode/RTL/devtools triage) — matches the parity contract, large port.
(b) Keep the thin repo-authored retrofit and revise the claim language — rejects the review ask.
Lean: (a), but that is a separate multi-commit port with triage decisions (StrictMode double-invoke, devtools.test.tsx, vanilla pristine-vs-adapted boundary). Leaving this open until that work is authorized / landed.
| }, | ||
| "upstreamSuites": { | ||
| "runtime": "absent", | ||
| "types": "insufficient" |
There was a problem hiding this comment.
The pinned repository also has an executable upstream type lane: test:types runs tsc --noEmit over its TS/TSX test graph, which contains the embedded type assertions. The parity rules require that actual suite to run pristine under its original compiler/config and be adapted one-for-one; the two repo-authored public probes may supplement it, but cannot replace it as “insufficient.”
There was a problem hiding this comment.
The pinned repository also has an executable upstream type lane:
test:types… cannot replace it as “insufficient.”
Same scope gate as the runtime suite thread.
Options
(a) Treat types as present: pristine tsc --noEmit on the vendored graph, one-for-one adapted suite, hashed inventories + transformation ledger + negative controls.
(b) Keep repo-authored probes only — rejects the review ask.
Lean: (a) paired with the runtime expansion. Upstream types are embedded in the TSX test graph rather than a __typetest__ tree, so the inventory shape needs an explicit design choice. Leaving open.
| * `[email protected]` React hooks at `valtio/esm/react.mjs` and | ||
| * `valtio/esm/react/utils.mjs` (commit 15c64d4d7a7a9bd55d750fa6a317b440978a2b25). | ||
| * | ||
| * Citations (upstream source; upstream ships no standalone unit suite claimed |
There was a problem hiding this comment.
Implementation-source line references are not a pinned upstream-test oracle. This file is declared repo-authored yet is counted in a required adapted parity lane; each case must either run the same observable scenario against the pinned React binding or cite the exact pinned upstream test it adapts. In particular, the synchronous-subscription case has neither a React side nor an upstream test citation.
There was a problem hiding this comment.
Implementation-source line references are not a pinned upstream-test oracle… the synchronous-subscription case has neither a React side nor an upstream test citation.
Agreed that source-line citations are not enough. Exact upstream oracles for these cases live in tests/basic.test.tsx / tests/useProxy.test.tsx at the pin (including the sync-option cases), but citing them honestly requires vendoring that suite and either adapting those tests one-for-one or adding a React differential side.
That is the same expand-to-upstream-suite decision as the runtime absent thread — parking here rather than papering over with implementation citations.
| { | ||
| "schemaVersion": 1, | ||
| "files": ["packages/valtio/typetests/pristine/public-api.test-d.ts"], | ||
| "assertionGroups": ["useSnapshot readonly inference", "useProxy mutable inference"] |
There was a problem hiding this comment.
These are only assertion-group labels, not an inventory/hash of the assertions. The type-parity contract requires file- and assertion-group-level structural comparison, a narrowly allowed transformation ledger, and negative controls for a skipped file, deleted assertion, and removed @ts-expect-error; whole-file hashes in the manifest do not prove that after an intentional refresh.
There was a problem hiding this comment.
These are only assertion-group labels, not an inventory/hash of the assertions… whole-file hashes in the manifest do not prove that after an intentional refresh.
Correct — the current pristine-types.json / adapted-types.json label lists do not meet the type-parity contract (file + assertion-group hashes, permitted-transformation ledger, skip/delete/@ts-expect-error negative controls).
That machinery only makes sense once types are present with a real pristine/adapted suite (or a properly hashed repo-authored probe pair like livestore). Parking with the types-suite scope decision rather than inventing hashes for the thin probes.
…t roots Discover tests/upstream and typetests when evidence is repo-authored, add adapted/type dispositions, and reject unclassified files in each root. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Assert under sync act so `{ sync: true }` must notify before a microtask;
awaiting nextPaint also passed for non-sync subscriptions.
Co-authored-by: Cursor <[email protected]>
Attach store subscriptions before mutating, then assert under sync act that
`{ sync: true }` updates while a non-sync Counter still reads the old value.
Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 4ffcdb1. Configure here.
Keep react-parity.json integrity pins aligned with the sync-contrast test rewrite. Co-authored-by: Cursor <[email protected]>
|
Thank you for your contribution! This pull request was incorporated into |

Summary
Verification
Provenance
Note
Low Risk
Test, audit, and documentation metadata only; no production hook implementation changes in the diff.
Overview
Adds a React parity harness for
@octanejs/valtiopinned to [email protected], with upstream ledger (UPSTREAM.md),react-parity.jsonlanes, and refreshed binding status/docs (verified→ 2026-08-02).Evidence lanes: repo-authored adapted runtime tests for
useSnapshot/useProxy, a differential suite that compiles shared TSRX fixtures to React and compares Octane vs upstream, paired pristine/adapted typetests, and a test-classifications ledger (including a guard thatuseDebugValueis omitted). Conformance binding tests now useactto assert sync vs async snapshot subscription behavior.Tooling:
verifyPortTestClassificationsis generalized to any binding; the global react-parity check runs it for manifests that shiptest-classifications.json. Vitest gainsvaltio-differentialwith global setup;@octanejs/valtiotests also run the differential project. Lockfile SHA bumps propagate to parity audits and the user-apps-v1 eval manifest (overlay lockfile + grader digests).Reviewed by Cursor Bugbot for commit db4041c. Bugbot is set up for automated code reviews on this repo. Configure here.