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 what we're working with.
Assistant
Let me explore the repository structure first.
Assistant
This is a Rust project. Let me explore the structure to find the parity oracle and fixtures.
Assistant
Let me look at the Vue parity documentation and the toolchain parity helper.
Assistant
Now let me look for the differential parity oracle and SFC fixtures.
Assistant
Now let me look at the test runner to understand how the parity oracle works and what the known-failure budget is.
Assistant
Let me see the full
normalize_codefunction which was truncated.Assistant
Now let me understand how the known-failure budget is tracked. Let me search for "known" and "failure" and "budget".
Assistant
Let me look at the generate-expected tool and run the current coverage report.
Assistant
Let me check git log for recent context on this area.
Assistant
Let me try to run the coverage report to see the current state.
Assistant
Let me check the Vue compiler version available and look at the current script-setup fixture cases.
Assistant
Node modules aren't installed. Let me check the package manager setup.
Assistant
Let me check if node is available anywhere on the system.
Assistant
Let me check if I can install node.
Assistant
Nodejs is available. Let me install it.
Assistant
Node 18 is installed. Let me look at the full script-setup.toml and the existing snap for defineOptions.
Assistant
Now let me look at the existing generic cases in the snap and the toml.
Assistant
Let me see the full list of cases in the script-setup.toml to understand what cases already exist, especially around defineOptions and generics. Let me get all the case names.
Assistant
Let me look at the git history of the coverage.rs test to understand the budget expectations.
Assistant
I need a newer Node version since
import.meta.dirnamerequires Node 20.11+. Let me download a newer Node binary.Assistant
Now let me check the catalog versions and set up package installation.
Assistant
Let me set up node_modules symlink so generate-expected.ts can resolve the Vue packages.
Assistant
Node needs a TS loader. Let me check how the repo runs this script.
Assistant
The script is run via
vp runwhich uses vite-plus (which supports native TypeScript via@typescript/native-preview). Let me check the root package.json devDependencies - it has@typescript/native-preview: catalog:typescript. That's the native TypeScript support that letsnoderun .ts files directly.Let me check the catalog version for typescript.
Assistant
Let me install
tsxto run the TypeScript script.Assistant
But tsx resolves node_modules from /vize (the symlinked one to /tmp/vuegen/node_modules). But tsx itself is at /tmp/vuegen/node_modules/.bin/tsx. When I run tsx, the modules needed by generate-expected.ts (@vue/compiler-sfc, @iarna/toml) need to be resolved from /vize/tests/tooling/support/. Since I symlinked /vize/node_modules -> /tmp/vuegen/node_modules, they'll be found. Good.
But wait, tsx is in /tmp/vuegen/node_modules/.bin. Let me run it with full path.
Assistant
Let me verify the regenerated snap matches the original.
Assistant
There are differences between the original and freshly-generated snap (hoisting and import order). Let me investigate which case differs and why.
Assistant
Let me check the actual installed Vue version and compare hoisting behavior.
Assistant
The fresh generation hoists but the original snap doesn't. The original must have used
hoistStatic: false. Let me check git history of generate-expected.ts.Assistant
Let me check whether the existing snap uses hoistStatic: false by examining the select/option case in the original.
Assistant
Let me test whether the original snap matches generation with
hoistStatic: false.Assistant
Let me check whether the existing convention uses
hoistStatic: false. First, let me regenerate with the current script and run the coverage to see how many existing cases break.Assistant
The default generation breaks 14 existing cases due to hoisting. Let me check what hoistStatic value Vize's SFC compiler uses by default.
Assistant
Vize sets
hoist_static = truebut the original snap is non-hoisted. Let me check the git history of the Vue beta catalog version to understand when the snap was generated.Assistant
Let me check how commit 403e1d77 modified the snap to understand the generation approach.
Assistant
Let me check how the SFC fixtures are used by the toolchain-parity test.
Assistant
The toolchain-parity apps use project fixtures, not the sfc/.toml fixtures. The sfc/.toml fixtures are only used by the Rust coverage runner. Good. So I only need to worry about the Rust coverage runner and the
assertOfficialCompilerAcceptswhich uses project apps, not these toml files.Wait, but there's also
test:check:fixtureswhich runssnapshots/check/toolchain-parity.ts. Let me check that file to see if it uses the sfc/*.toml fixtures.Assistant
Let me check the tooling tests that might assert on coverage counts and the parity matrix.
Assistant
Let me check whether any test asserts the exact
625/625coverage number in the parity matrix.Assistant
Let me check the release-readiness test that reads the parity matrix to see if it asserts the exact count.
Assistant
Let me check the github-workflows test for coverage budget assertions and the test inventory.
Assistant
Let me check the language-engineering-practices test for any fixture/parity assertions.
Assistant
Let me check the PR budget enforcement and test inventory scripts for any count assertions.
Assistant
Let me restore the original snap and then design the new cases.
Assistant
Let me look at the end of the script-setup.toml file to add new cases.
Assistant
Now let me design and add the new fixture cases. I'll append them to the script-setup.toml file.
Assistant
Now let me write a small Node script to generate expected output for the new cases (with
hoistStatic: falseto match the existing convention) and verify they compile cleanly.Assistant
One case failed: Vue rejects
emitsindefineOptions. Let me fix that case to use allowed custom options.Assistant
All new cases compile cleanly. Let me verify the count and inspect the corrected defineOptions case.
Assistant
Now let me append the new cases to the snap file and run the coverage to see which fail.
Assistant
Let me run the coverage to see which new cases pass and which fail.
Assistant
4 new cases fail (TS
defineOptionsdivergences: Vize usesObject.assignwhile Vue uses_defineComponentspread). The 4 generic cases pass. Let me see the full coverage report.Assistant
Now I'll update the coverage.rs to track the 4 remaining divergences. Let me edit the constants and KNOWN_FAILURES.
Assistant
Now let me update the
tracks_the_current_known_failure_budgettest.Assistant
Now let me build and run the coverage to verify it passes with the budget.
Assistant
The coverage now reports 4 known failures tracked and no unexpected failures. Let me verify the exit code is 0.
Assistant
Now let me run the cargo tests for the test runner (including the budget test and the normalize test).
Assistant
Both tests pass. Now let me verify the regeneration is reproducible. Let me check whether
generate-expected.tswithhoistStatic: falsereproduces the committed snap consistently. First, let me make a modified copy and regenerate to a temp file.Assistant
Let me redo the regeneration carefully, capturing the output before restoring.
Assistant
Let me compare the full regeneration with the committed snap.
Assistant
The full regeneration with
hoistStatic: falsereproduces the original committed snap exactly (lines 1-2702 identical) plus my new cases. This confirms the existing convention useshoistStatic: false. Let me verify the diff is only the new cases.Assistant
The full regeneration is byte-identical to the committed snap for existing cases. Let me verify the other SFC snap files (basic, patches, etc.) are also consistent with
hoistStatic: falsebefore updating the tool.Assistant
All SFC snaps are byte-identical when regenerated with
hoistStatic: false. Let me check if any test references generate-expected.ts content before I update it.Assistant
No test asserts on generate-expected.ts content. I'll update it to set
hoistStatic: falsefor SFC compilation, making regeneration reproducible and consistent with the committed convention. Let me view the relevant sections first.Assistant
Now let me regenerate the script-setup snap using the updated tool and verify it's byte-identical to the committed (original + new cases).
Assistant
The freshly-regenerated snap differs from
/tmp/regen_full.snapin hoisting. Let me compare the two scripts to understand the discrepancy.Assistant
The two scripts are identical. The discrepancy is confusing. Let me check what
/tmp/regen_full.snapactually contains for the v-else-if case.Assistant
Let me re-run the
/tmphoist script now and check its hoisted count to resolve the discrepancy.Assistant
I discovered the issue: the committed snaps are hand-aligned to Vize's specific hoisting behavior (not reproducible by a single
hoistStaticsetting). MyhoistStatic: falsetool change would break existing cases. Let me revert thegenerate-expected.tschange and regenerate the new cases with Vue's default options instead.Assistant
Now let me create a script to generate the new cases with Vue's default options (the real upstream output).
Assistant
All 8 new cases compile cleanly with Vue's default options. Let me append them to the snap and run coverage.
Assistant
Now the divergences are clearly the
defineOptionsmerge shape (plus a caching-vs-hoisting detail in one case). The 4 failures match the budget. Let me run the full coverage to confirm it passes.Assistant
Coverage passes with 4 known failures tracked. Let me run the cargo tests to confirm the budget and normalize tests pass.
Assistant
Both tests pass. Let me verify the
required: trueoccurrences in the new snapshots are handled by the normalization (the generic cases must pass because of it).Assistant
7
required: trueoccurrences in the new cases are normalized away — the generic cases pass because of this normalization. Let me review the complete set of changes.Assistant
Let me remove the temporary
node_modulessymlink I created so it's not part of the submission.Assistant
Now let me review the coverage.rs diff in detail.
Assistant
Let me review the toml additions.
Assistant
The TOML comment is slightly inaccurate (TS cases use
_defineComponentspread, notObject.assign). Let me fix the comment.Assistant
Let me re-run the coverage to confirm everything still works after the comment edit.
Assistant
Let me verify the snap file's new cases section has proper formatting and separators.
Assistant
Everything looks clean. Let me do a final check of git status and run the test suite once more to confirm.
Assistant
Let me verify the snap file ends with a proper trailing newline.
Assistant
The snap file ends properly. Let me do a final verification: confirm the 4 known failures are exactly the divergences and run the full coverage one final time.
Assistant
Everything works correctly. Let me do a final check for any other references to the coverage counts that might need updating.
Assistant
Only
coverage.rsreferences these constants. The docs prose (625/625) was already stale before my change and no test enforces it, so I'll leave it. Let me do a final full diff review.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.