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
I'll start by exploring the repository structure to understand the codebase and locate relevant files. Let's first check what's in the root directory.
- Assistant
Let me explore the repository structure more thoroughly.
- Assistant
This looks like a Rust + TypeScript project (Vue-related). Let me search for "differential" or "parity" or "oracle" related terms to understand the differential-parity testing framework mentioned in the issue.
- Assistant
Let me look at the test files and the existing differential-parity oracle.
- Assistant
Let me look at the test helpers and the parity/oracle-related files.
- Assistant
Let me look at the fixtures and expected snapshots, and then the test helpers.
- Assistant
Let me explore the toolchain-parity and snapshot helpers to understand the differential-parity oracle.
- Assistant
Now let me look at the snapshot helper and expected snapshots to understand the differential-parity oracle better.
- Assistant
Now let me look at the expected snapshots and fixtures to understand the differential-parity oracle better.
- Assistant
Let me look at the SFC expected output directory.
- Assistant
Let me look at the fixtures directory to understand the structure better.
- Assistant
Let me look at the SFC fixtures directory and the snapshots directory.
- Assistant
Let me look at the snapshots directory:
- Assistant
Let me look at the SFC snapshots directory:
- Assistant
Let me see what's in the sfc/ts snapshots directory.
- Assistant
Let me look at the snapshot check file and understand how the parity oracle works.
- Assistant
Now let me look at the SFC test files to understand how the snapshots are generated and tested.
- Assistant
Let me look at the build snapshots and generic.ts file.
- Assistant
Let me look at the SFC fixture file to understand the script-setup cases.
- Assistant
Let me continue reading the script-setup.toml file to understand the defineOptions cases.
- Assistant
Let me look at those specific sections to understand what's being tested.
- Assistant
Now let me look at the generic component cases:
- Assistant
Let me look at the existing expected snapshots to understand the format:
- Assistant
Let me search for defineOptions in the expected snapshot:
- Assistant
Let me look at the defineOptions case in the expected snapshot. result. I need to also look at the normalize function. Let me also check for the known-failure budget. Let me search for that term.Let me search for "known-failure budget" or related terms in the codebase:
- Assistant
Let me make one call at a time.
- Assistant
Now I need to find the "differential-parity oracle" for the Vue compiler. Let me search for it.
- Assistant
Let me look for the vue-parity-matrix.md document and related files:
- Assistant
Let me look at the test package.json for test scripts:
- Assistant
Let me look for how the expected snapshots are generated:
- Assistant
Now let me find the differential parity oracle test:
- Assistant
Let me search for the SFC test runner that uses the expected snapshots:
- Assistant
Let me search for where the expected SFC snapshots are used - the test that compares the Vize compiler output with the Vue compiler output.
- Assistant
Let me look at the _fixtures directory for the SFC compilation testing:
- Assistant
Let me look at the crates directory structure:
- Assistant
Let me explore the SFC crate which likely contains the compiler:
- Assistant
Let me look for the differential parity oracle in the Rust tests. The issue mentions "existing Vue differential-parity oracle" so it's likely a Rust test.
- Assistant
Let me look at the atelier_sfc tests:
- Assistant
Let me look at the script-setup fixture file more carefully and also the existing test runner that compares outputs. I need to understand the complete flow:
- Fixtures are defined in
tests/fixtures/sfc/script-setup.toml - Expected outputs are generated by
tests/tooling/support/generate-expected.tsusing@vue/compiler-sfcand stored intests/expected/sfc/script-setup.snap - There must be a test that compiles these with the Vize compiler and compares against the expected outputs
Let me also look for where the SFC test runner is that compares vize output vs expected output.
- Fixtures are defined in
- Assistant
Let me look at the vize_test_runner which seems to be the test runner:
- Assistant
Let me look at the test runner source code to understand how the differential parity tests work.
- Assistant
Now let me look at the test runner more closely and find the coverage command and known-failure budget:
- Assistant
Now let me look at the coverage.rs file:
- Assistant
Let me look at the normalize_code function more closely:
- Assistant
Now I have a good understanding of the codebase. Let me check what test fixtures already exist and run the existing coverage to see the current state:
- Assistant
Let me check the full generic component cases and other defineOptions related content:
- Assistant
Let me look at the entire
defineOptionssection: - Assistant
Let me first run the existing coverage to see the current state:
- Assistant
Now I can see the current state - all 685 tests pass with 0 known failures. Now I need to understand the issue better. Let me look at what the Vue compiler expects for these Script Setup TypeScript cases:
- Assistant
Let me find node.
- Assistant
Node is not available. Let me check what tools are available.
- Assistant
Let me check if node is installed through a version manager or somewhere else.
- Assistant
Let me check if there's a way to install node
- Assistant
Node doesn't seem to be installed. Let me check if we can install it or find another way.
- Assistant
I need to install node first. Let me check if there's a way to install it.
- Assistant
Let me install a more recent version of node. The .node-version says 24.14.0. Let me install that via nvm or similar.
- Assistant
Let me look at the existing expected snapshot for defineOptions and the generic cases:
- Assistant
Let me look at the generic component cases in the expected snapshot:
- Assistant
Let me look at those generic component expected outputs:
- Assistant
Now I understand the structure. Let me check if there are any fixtures in
script-setup.tomlthat don't have expected output yet, and understand the full picture: - Assistant
The current system shows 685/685 tests passing with 0 known failures. Let me look at what specific defineOptions cases exist and what upstream Vue compiler produces. Let me also check if there are newer fixtures added but not yet matched:
- Assistant
Now let me check the snapshots directory for script-setup:
- Assistant
Let me look at the existing snapshot content to understand the format better and look for what Vue's compiler produces for the defineOptions cases:
- Assistant
Let me look at the snapshot test code in Rust:
- Assistant
Let me look at the snapshot tests in Rust to understand the differential testing approach:
- Assistant
Let me install a proper version of node to be able to run the generate-expected script:
- Assistant
Node.js v22 is installed. Now let me check if pnpm is available.
- Assistant
Good, now I have node v22. Let me check if pnpm is available and install dependencies.
- Assistant
Let me install pnpm and then install dependencies.
- Assistant
Let me check the pnpm catalog and try installing dependencies:
- Assistant
Good, dependencies are installed. Now let me understand the Vue compiler's expected output for
defineOptionscases. Let me first check what Vue's compiler tests cover: - Assistant
Let me check the workspace structure
- Assistant
Let me check where the @vue/compiler-sfc is installed:
- Assistant
Let me find where
@vue/compiler-sfcis installed for the tests workspace: - Assistant
Let me now understand the full picture. Let me count the fixture cases vs expected snapshots:
- Assistant
The fixture count matches the expected snapshot count. Let me check the Vue compiler's test suite to understand what additional defineOptions and generic component cases need to be added:
- Assistant
Now let me understand the full picture. Let me look at the existing coverage constants and what changes are needed. Let me first check the current MIN_SFC_PASSED and known failures, and also look at the normalize_default_required_true function:
- Assistant
Now I have a good understanding of the codebase. Let me create a plan:
- Add new Script Setup TypeScript fixture cases covering:
defineOptionswith justinheritAttrs: falsedefineOptionswith just componentnamedefineOptionswith custom options- More
<script setup generic>type parameter cases (if needed)
- Regenerate the expected snapshots from the real Vue compiler using
generate-expected.ts - Run the coverage to identify new failures
- Update the
KNOWN_FAILURESbudget andMIN_SFC_PASSEDincoverage.rs - Update the insta snapshots for the new cases
Let me start by adding the new fixture cases:
- Add new Script Setup TypeScript fixture cases covering:
- Assistant
Now let me look at the full fixture file to understand the structure better, and look at the expected Vue output for defineOptions:
- Assistant
Now I understand the full picture. The issue requires me to:
- Add new Script Setup TypeScript fixture cases for
defineOptionsvariations and<script setup generic>type parameters - Regenerate expected snapshots from the real Vue compiler
- Run coverage to identify new failures (differential cases)
- Update the known-failure budget in
coverage.rs
Let me start by adding the new fixture cases:
- Add new Script Setup TypeScript fixture cases for
- Assistant
Let me look at the full fixture file to understand what cases already exist:
- Assistant
Now I understand the task. I need to:
- Add more specific
defineOptionscases and<script setup generic>type parameter cases - Regenerate expected snapshots from the Vue compiler
- Update the known-failure budget
Let me add the new fixture cases to the script-setup.toml:
- Add more specific
- Assistant
Let me add the new defineOptions fixture cases with specific options. First, let me look at the Vue compiler's
defineOptionstest patterns to understand what to add: - Assistant
Now I understand the full picture. I need to add new test cases for
defineOptionswith specific options (inheritAttrs only, name only, custom options), and additional<script setup generic>type parameter cases. Then regenerate expected snapshots and update the known-failure budget. Let me start by adding the new fixture cases. - Assistant
Let me verify the new cases were added correctly:
- Assistant
Now I need to regenerate the expected snapshots from the Vue compiler for the new cases. Let me run the generate-expected script:
- Assistant
Good, 74 cases were generated (69 original + 5 new). Let me now verify the new expected output was generated correctly:
- Assistant
Now let me check the other new cases:
- Assistant
Let me look at the generic component with type parameter used in emits:
- Assistant
Good, the expected snapshots have been regenerated. Now let me run the coverage to see what fails:
- Assistant
I see that regenerating the expected snapshots caused 15 failures. Let me look at what changed. First, let me check one of the previously passing tests:
- Assistant
Now I see the issue. The expected snapshots were regenerated from the current Vue compiler (3.6.0-beta.10) which produces different output for some cases - this creates real differential cases. Let me examine the differences more closely:
- Assistant
Now I understand the full picture. The expected snapshots were regenerated from the current Vue compiler (3.6.0-beta.10) and 15 tests now show real differential cases. I need to:
- Add these 15 failing tests to the
KNOWN_FAILURESlist incoverage.rs - Update
MIN_SFC_PASSEDandMIN_TOTAL_PASSEDconstants - Update the budget test assertions
Let me also check if I need to update the insta snapshots for the new test cases:
- Add these 15 failing tests to the
- Assistant
I need to run the Rust snapshot tests to generate the insta snapshots for the new test cases:
- Assistant
The insta snapshots for the new test cases were generated. Now I need to update the known-failure budget in
coverage.rs. Let me first understand the current state: - Assistant
Now I need to update the coverage.rs file with the known failures. Let me make the necessary changes:
- Assistant
Now I'll update the coverage.rs file. I need to:
- Update
MIN_SFC_PASSEDfrom 159 to 149 (since 15 tests are now known failures) - Update
MIN_TOTAL_PASSEDfrom 685 to 675 (since 15 tests are now known failures) - Add the 15 failing tests to
KNOWN_FAILURES - Update the test assertion for
KNOWN_FAILURES.len()
- Update
- Assistant
Now I need to update the KNOWN_FAILURES array to include the 15 failing test cases:
- Assistant
Now I need to update the test assertion at the bottom of the file. Let me look at the test:
- Assistant
Let me open the file and navigate to the test section.
- Assistant
I see the test that needs updating. Let me update the test assertion to reflect the new known failure count:
- Assistant
Good. Now let me verify the coverage passes by running it again:
- Assistant
The coverage tool now shows all failures as tracked known failures. Let me verify the Rust test also passes:
- Assistant
The budget test passes. Now let me verify the snapshot tests still pass:
- Assistant
All tests pass. Let me run the full test suite to make sure nothing else is broken:
- Assistant
Let me also run the lib tests in the test runner:
- Assistant
All tests pass. Let me also run all the SFC snapshot tests to make sure nothing is broken:
- Assistant
I need to use a single filter or run multiple tests separately.
- Assistant
All 6 snapshot tests pass. Let me verify the new snapshot files exist:
- Assistant
Now let me also verify the normalize_code function properly handles
required: truefor the new generic component cases. Let me look at the generic component with extends snapshot to confirm the normalization works: - Assistant
Let me also verify that the Vue parity matrix doc is consistent. Let me check if it needs updating:
- Assistant
Let me verify the fixture counts match and check if the vue-parity-matrix.md needs updating:
- Assistant
Let me check if the release-readiness test validates the vue-parity-matrix.md content:
- Assistant
Let me look at the release-readiness test to understand what it checks about the vue-parity-matrix.md file:
- Assistant
Let me check if the vue-parity-matrix.md has a specific fixture coverage number that needs updating:
- Assistant
The vue-parity-matrix.md has an outdated fixture count of
625/625. Let me update it to reflect the current state: - Assistant
Now let me update the fixture count in the vue-parity-matrix.md file. The current total is690 fixtures with675 passing:
- Assistant
Let me run the release-readiness test to make sure it still passes:
- Assistant
Good, the release-readiness test passes. Let me also run the github-workflows test:
- Assistant
Good, all tests pass. Let me also run the language-engineering-practices test to check for consistency:
- Assistant
All tests pass. Let me run all the snapshot tests to make sure everything is consistent:
- Assistant
Let me now do a final review of all the changes I've made. Let me check the git diff:
- Assistant
Let me also check the new snapshot files that were generated:
- Assistant
Let me run one final check to make sure the coverage passes cleanly and review the full diff:
- Assistant
The coverage passes cleanly. Let me now review the full diff to make sure everything is correct:
- Assistant
Let me review the coverage.rs changes:
- Assistant
Let me also review the fixture changes:
- Assistant
Let me also quickly verify the expected snapshot diff:
- Assistant
Let me also verify the expected snapshot was properly regenerated for the generic component cases:
- Assistant
Let me verify a specific case to make sure the normalization works correctly. Let me look at one of the cases that now fails to understand the differences:
- Assistant
Now I understand the full picture. The Vue compiler 3.6.0-beta.10 now hoists certain static arrays (
_hoisted_1 = ["value"]) while the Vize compiler doesn't do this hoisting. This creates legitimate differentials that need to be tracked as known failures.Let me now run a comprehensive test to make sure everything is consistent:
- Assistant
All tests pass. Let me run the final verification by running the tooling tests:
- Assistant
All tests pass. Let me now verify the new snapshot files are correct:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.