ISSUE DESCRIPTION Compiler parity: add the current Script Setup TypeScript differential…
- User
ISSUE DESCRIPTION
Compiler parity: add the current Script Setup TypeScript differential cases and keep the known-failure budget accurate
Use the existing Vue differential-parity oracle for the current SFC fixture additions. Add and match the upstream Vue output for Script Setup TypeScript cases covering
defineOptionsoptions such asinheritAttrs, component name/custom options, and<script setup generic>type parameters.Normalization must treat
required: trueas the default representation expected by the fixture comparison. Regenerate the affected expected snapshots from the real Vue compiler and update the tracked known-failure budget so the coverage command reports exactly the remaining known divergences rather than hiding new failures.Evaluation contract
The required differential corpus for this task is the current Script Setup TypeScript snapshot set, including
defineOptionscases and script-setup generic type parameters. Normalizerequired: trueas the default representation expected by the oracle, regenerate those snapshots from the real Vue compiler, and update the tracked known-failure count to exactly the remaining known divergences. Passing a different parity-fixture subset does not satisfy this task.Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
Assistant
Let me start by exploring the repository structure to understand what we're working with.
Assistant
Let me explore further. This is a Rust project (vize) that has Vue SFC compiler parity tests. Let me look at the tests and tools directories.
Assistant
Let me look at the script-setup fixture and the related snapshots. Let me look at the existing fixtures.
Assistant
Let me see the rest of the fixture file and understand the test harness.
Assistant
Now let me understand the test harness, the "known-failure budget" and "coverage command". Let me look at the test runner and tools.
Assistant
Now let me find the actual test that runs the SFC differential-parity oracle. Let me search for relevant tests.
Assistant
Let me find the parity test runner and the "known-failure budget".
Assistant
Now let me look at the lib.rs of the test runner, which has the run_fixture_tests and the normalization logic.
Assistant
Let me see the full
normalize_codefunction (it was truncated).Assistant
Let me check the coverage command and the current state. Let me see how to run it.
Assistant
Currently everything passes. But the issue says we need to add MORE Script Setup TypeScript cases covering
defineOptionsoptions such asinheritAttrs, component name/custom options, and<script setup generic>type parameters.Wait, the issue says "the current SFC fixture additions" - meaning there are fixture additions that have been made but not yet matched/snapshotted. Let me check git status and git diff to see if there are uncommitted changes.
Assistant
The working tree is clean. I need to add new Script Setup TypeScript cases. Let me first check the existing expected snapshot and whether I can run the Vue compiler to generate snapshots.
Assistant
Now let me check the generic component snapshots.
Assistant
Now let me check whether the JS dependencies are installed so I can run the Vue compiler to generate snapshots.
Assistant
node is not available. Let me check for a node version manager or how node is installed. The .node-version says 24.14.0. Let me look for it.
Assistant
Node is available. Let me install the needed JS dependencies to run the Vue compiler.
Assistant
Let me set up a temp node install for the Vue compiler so I can generate real snapshots.
Assistant
Let me create symlinks in the repo root node_modules so the ESM resolver finds the packages.
Assistant
The generate-expected regenerated snapshots. Let me check the git diff to see what changed (be careful — it may have reformatted existing ones).
Assistant
The diff is large. Let me check what actually changed in basic.snap to understand whether the Vue version differs from what was originally used.
Assistant
The regeneration changed existing snapshots (different render export style). This suggests the installed Vue version differs from what originally generated the snapshots. Let me investigate the script-setup.snap diff to see if the format differs meaningfully.
Assistant
The regeneration changed existing snapshots meaningfully (hoisting, cacheHandlers). This suggests the installed Vue version or the generate-expected.ts options differ from what originally generated the snapshots. The lib.rs comment mentions a Moonbit script. Let me investigate.
Assistant
So the snapshots are generated by generate-expected.ts. The differences must come from the Vue version. Let me check the git history of the snapshots and the lockfile for the actual resolved Vue version.
Assistant
I should revert the regeneration to avoid breaking existing passing parity. Let me restore the original snapshots first.
Assistant
A new file
tests/expected/sfc/directives.snapwas created (directives is in vdom mode, not sfc, so it shouldn't be in expected/sfc). Wait, generate-expected --mode sfc processed all .toml in fixtures/sfc/. Let me check — fixtures/sfc has directives.toml which hasmode = "sfc"? Let me check.Actually
tests/fixtures/sfc/directives.toml— let me check its mode. The generate-expected --mode sfc processes all files in fixtures/sfc/. So it created directives.snap in expected/sfc. But the coverage test_files only references sfc/basic, sfc/script-setup, sfc/patches, sfc/define-model, sfc/props-destructure. Not sfc/directives. So this directives.snap is spurious. Let me remove it.Assistant
Interesting - there's a
tests/fixtures/sfc/directives.tomlwith mode="sfc" that's NOT in the coverage test_files list. So the coverage doesn't track it. That's fine, leave it alone.Now, the key question is why my regeneration differs from the original. Let me understand the difference. The difference is hoisting/cacheHandlers in the inline template. Let me check the git log for when the snapshots were last touched and whether generate-expected.ts was recently changed.
Actually, let me reconsider. The original snapshots have NO hoisting and NO cacheHandlers. The vize Rust compiler matches them. My Vue 3.6.0-beta.10 regeneration HAS hoisting and cacheHandlers.
This means: either the Vue version that generated the originals had different inline template defaults, OR generate-expected.ts changed.
Let me check git log of generate-expected.ts.
Assistant
Hmm, the dates seem to be in 2026 (future). This is a synthetic repo. The snapshots were committed at 403e1d77.
Let me check what the original snapshots look like for the cases that changed. The original had NO hoisting. But my Vue 3.6.0-beta.10 generates hoisting.
Wait, maybe the original was generated with a different compile approach. Let me look at how the original "script with interfaces before script setup" snapshot looks, which involves v-if with
{ key: 0 }inline.Actually, let me reconsider the whole thing. The key realization: the generate-expected.ts I'm running uses with . With inline template, Vue compiles the template inline. But the hoisting behavior...
Assistant
So generate-expected.ts (82c90cef, 2026-04-22) is older than the last snapshot commit (403e1d77, 2026-05-23). So the snapshots were generated AFTER generate-expected.ts was last modified. So the same generate-expected.ts was used to generate the current snapshots.
But my regeneration produces different output. The only variable is the Vue version. The pnpm-lock says 3.6.0-beta.10, which is what I installed. But maybe between 2026-04 and 2026-05, npm published a DIFFERENT 3.6.0-beta.10? No, version is pinned.
Wait, unless npm install resolved a different version. Let me check what version I actually installed.
Assistant
The version matches exactly. Let me directly test by compiling a specific existing case with my Vue to understand the hoisting difference.
Assistant
So my Vue 3.6.0-beta.10 hoists
_hoisted_1 = { key: 0 }while the existing snapshot has inline{ key: 0 }. This means the existing snapshots were generated with hoisting DISABLED (or are actually vize outputs). Let me check recent commits to understand the "current SFC fixture additions" and what's expected.Assistant
Let me look at the recently added define-model.snap to see if it was generated with hoisting (real Vue) or vize output style.
Assistant
The committed snapshots appear inconsistent (some have
required: truefrom real Vue, some have vize-style inline{ key: 0 }). Let me check the most recent commit's pattern to understand how these parity tasks are typically done.Assistant
Let me look at the lib.rs diff from f110960b to understand the normalization changes pattern.
Assistant
Let me check the history of KNOWN_FAILURES and MIN counts to understand the workflow pattern.
Assistant
Let me check whether my regeneration of define-model.snap (recently added, real Vue) matches the committed version — this tells me if the committed snapshots are real Vue outputs.
Assistant
The define-model.snap regenerated identically — so it IS real Vue output. But script-setup.snap differs for v-if/union cases. Let me determine whether vize produces hoisted or inline output for a v-if case by temporarily testing against real-Vue output.
Assistant
This confirms vize produces inline
{ key: 0 }(no hoisting) while real Vue hoists to_hoisted_1. So the committed v-if snapshots reflect vize output, not current real Vue. The define-model.snap (recently regenerated) IS real Vue.Let me now measure the full scope of divergence by regenerating script-setup.snap from real Vue and running coverage. First, let me add the new named cases to the fixture, then regenerate the whole snap. Let me view the exact defineOptions and generic sections.
Assistant
Let me regenerate script-setup.snap from real Vue (no new cases yet) and measure the baseline divergence count.
Assistant
Regenerating the whole script-setup.snap exposes 14 divergences (template-level: hoisting, handler caching, union runtime-type, unref import). Let me check docs/CHANGELOG and the budget test for hints about the intended scope and count.
Assistant
Let me check the tests that reference "known failure" budget — they might constrain the count and reveal the intended workflow.
Assistant
Let me check the vue-parity-matrix.md coverage number to understand the expected state.
Assistant
Let me check the toolchain-parity test and any test that asserts on coverage counts or known failures, which would constrain my changes.
Assistant
Let me check if any test references the coverage budget consts or the budget test, which would constrain my changes.
Assistant
Only coverage.rs references the budget. The budget test (
tracks_the_current_known_failure_budget) assertslen == 0and that "generic component with extends" is NOT a known failure — which will need updating since regenerating the generic snapshots from real Vue exposes real divergences.Let me make my decision: regenerate the whole script-setup.snap (the "current Script Setup TypeScript snapshot set") from real Vue, add the named new cases, and track ALL resulting divergences exactly. First, let me add the new cases. Let me view the generic section end.
Assistant
I've decided: regenerate the whole script-setup.snap (the "current Script Setup TypeScript snapshot set") from real Vue, add the named new cases, and track ALL resulting divergences exactly in the budget. This is the most faithful, verifiable interpretation. Let me add the new cases to the fixture first.
Assistant
I need to add a blank line between the last case and the defineSlots section comment.
Assistant
I created a duplicate defineSlots header. Let me fix it.
Assistant
The defineOptions section is fixed. Now let me find and add the new generic cases.
Assistant
The edit introduced a stray
"""and a duplicate header. Let me view and fix the region cleanly.Assistant
Let me fix the stray
"""and the duplicate header.Assistant
Now fix the duplicate
[[cases]]and duplicate header.Assistant
The edit tool keeps creating duplicates. Let me use Python to clean up precisely.
Assistant
The fixture is clean now. Let me validate it parses and regenerate the snapshots from real Vue.
Assistant
One case errored. Let me check which case failed.
Assistant
defineOptions()can't declareemits. Let me fix the custom options case to use allowed custom options.Assistant
Now let me regenerate the snapshots and confirm no compile errors.
Assistant
No compile errors, 74 cases. Now let me run the coverage to see all divergences with the new cases included.
Assistant
All 5 new cases pass; the 14 divergences are the existing ones exposed by regenerating from real Vue. So the budget is: SFC passed = 150, total = 676, with 14 known failures (all in sfc/script-setup). Let me update coverage.rs. Let me view the relevant sections.
Assistant
Now let me update the budget test to reflect the new accurate budget.
Assistant
I created duplicate lines. Let me fix the test block cleanly.
Assistant
Now let me build and run the coverage command to confirm it exits 0.
Assistant
Coverage exits 0 with 14 known failures tracked. Now let me run the test suite for vize_test_runner (the normalize test + budget test).
Assistant
All tests pass. Let me verify the regenerated snapshots actually contain
required: true(real Vue default representation) which the normalization handles, confirming therequired: truerequirement.Assistant
The regenerated snapshots use
required: trueas the default representation, normalized away by the oracle. Let me verify the new defineOptions and generic cases are present with real-Vue output.Assistant
The new "defineOptions with inheritAttrs" case has hoisted static class (real Vue), and it passes — meaning vize matches Vue here. Let me confirm all new cases pass and check the generic ones.
Assistant
The new generic cases use
required: trueand pass. Let me review the full diff summary and verify the directives.snap spurious file is gone.Assistant
Only the 3 intended files changed; node_modules symlinks are gitignored. Let me run coverage verbose once more to confirm zero unexpected failures and exact budget match.
Assistant
No unexpected failures, no budget regressions — the 14 failures exactly match the 14 known failures, exit 0. Let me check for any stray files I created and clean up.
Assistant
Only the 3 intended files are modified; node_modules is gitignored. Let me verify the fixture has no duplicate case names and is well-formed.
Assistant
74 cases, no duplicates, fixtures parse fine (coverage ran successfully). Let me do a final clean coverage run confirming exit 0.
Assistant
Let me check the precedent: when KNOWN_FAILURES was previously non-empty, did the budget test assert the actual count (i.e., was it kept in sync)?
Assistant
The precedent confirms it: at b6d3dc5b the budget test asserted the actual count (92) and was kept in sync. So updating it to 14 follows the canonical repo workflow — not a violation. Let me verify no other test uses the script-setup fixtures (e.g., dump_patches).
Assistant
dump_patchesonly uses patches.toml; other refs are compiler-internal<script setup>parsing, unaffected by my fixture changes. Let me do a final verification: build + test + coverage all green.Assistant
All green. Let me do a final review of the complete diff to ensure it's clean and intentional.
Assistant
The coverage.rs diff is clean and follows the repo's established budget-tracking convention. Let me review the fixture diff briefly.
Assistant
The fixture diff is clean — 5 new cases covering the named scenarios. Let me clean up the temporary node_modules symlinks (gitignored, but tidy) and confirm final git status.
Assistant
Everything is clean and green. Let me run the test suite one final time after cleanup to be 100% sure.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.