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
We have network access. Let's try to install node.
Assistant
Node installed. Now let's check pnpm and workspace setup for installing dependencies.
Assistant
Now let's check the existing "defineOptions" case and generic cases to craft new test cases matching the format.
Assistant
This normalization already exists too. So maybe most of the infra is already in place but the actual fixture cases for defineOptions/generic haven't been added yet in the amount the task wants. Let's check git blame/log for that normalize function and see when it was added, and check the actual full diff needed - maybe just add cases to script-setup.toml and generate expected.
Assistant
Good, matches existing expected. Let's check current expected snap for this to confirm.
Assistant
Good, both are normalized. Now let's check vize's actual SFC compiler output for these new cases to see if it matches (before adding to fixtures officially). Let's check how to run vize compiler directly.
Assistant
Now let's test it against the current script-setup.toml (without modifications) to confirm it reproduces the exact same expected.snap already checked in (sanity check of our reimplementation).
Assistant
Now let's add the generic + defineOptions case near the generic section.
Assistant
Now let's verify the toml is still valid and check total case count.
Assistant
Good, 73 cases now (69+4). Now let's generate expected output for just these new cases using node, and manually insert corresponding
===blocks into the .snap file in matching positions (after "defineOptions" block, and after "generic component with default type" block).Assistant
Now let's split the output into the 3 defineOptions blocks and 1 generic block, then insert them at the right spots.
Assistant
Now insert these into the actual snap file at the right lines (generic first at line 1334, then defineOptions at line 515, in that order to preserve earlier line numbers).
Assistant
This looks correct. Let's verify only these additions were made (no unintended changes) and validate file parses correctly with our snap loader.
Assistant
Now let's build and run the coverage tool to see the results.
Assistant
Now let's check what happens with
has_default_exportcombined with is_ts, to see the existing pattern for TS + default export (to mirror correct spread logic there too if needed, though that's out of scope). Let's check that too for consistency and confirm expected format matches Vue'sdefcombining both defaultExport and definedOptions.Assistant
Now let's rerun the coverage tool.
Assistant
All 689/689 pass. Now let's update the MIN_* thresholds in coverage.rs to reflect the new totals.
Assistant
Now let's run the whole test suite for the vize_test_runner and vize_atelier_sfc crates to make sure nothing else broke due to the component_output.rs change.
Assistant
Let's accept these new/updated snapshots.
Assistant
Now let's rerun the full test suite for vize_atelier_sfc to confirm everything passes cleanly.
Assistant
All pass. Now let's run the full workspace test suite to check for broader regressions.
Assistant
Confirmed this failure is pre-existing/environmental (caused by installing Node 18, unrelated to our changes). Let's restore our stash.
Assistant
Only the pre-existing unrelated env test fails. Let's continue checking the rest of the workspace (there may be more crates after this failure since cargo stops? Let's check with
--no-fail-fast).Assistant
Confirmed — these failures are pre-existing environmental issues (missing
pklbinary / node lacking TS loader) unrelated to my changes. Good, no regressions introduced by my fix.Now let's double check the full diff, and clean up temp files.
Assistant
Good, formatting is clean. Now let's do a final full verification run of the coverage tool and targeted crate tests.
Assistant
Let's also run cargo test for the coverage crate's own test to ensure known-failure tracking test passes with our updated thresholds/known list.
Assistant
All good. Let's clean up the temporary node install scratch directory (not part of repo, but let's remove to be tidy) and review the final diff.
Assistant
Now rebuild and rerun tests to confirm nothing broke with this cleanup.
Assistant
Let's run clippy to check code style compliance since repo likely enforces it in CI.
Assistant
No clippy warnings. Now let's check formatting with
cargo fmt --check.Assistant
Formatting is clean now. Let's rebuild and re-verify tests one final time.
Assistant
Everything is passing. Let's review the final full diff for submission.
Assistant
This all looks good. Let's go through the checklist now.
Assistant
This matches the expected structure. Now let's do a final sanity check by re-running the full coverage and diffing test one more time before finalizing.
Assistant
Excellent. Let's go through the checklist explicitly:
Checklist review:
- If an error was reported in the issue description, I have successfully reproduced it. — The issue didn't describe a runtime error but a coverage-parity gap. I reproduced the gap by adding the new Script Setup TypeScript fixture cases (
defineOptionswithinheritAttrs, name, custom options, and<script setup generic>+defineOptions) and running them against the real@vue/compiler-sfc@3.6.0-beta.10oracle, which revealed vize's SFC compiler usedObject.assign()even in TypeScript mode instead of Vue's_defineComponent({ ...options })spread pattern — confirmed viacargo run -p vize_test_runner --bin coverage -- -vv.
- If an error was reported in the issue description, I have successfully reproduced it. — The issue didn't describe a runtime error but a coverage-parity gap. I reproduced the gap by adding the new Script Setup TypeScript fixture cases (
Assistant
-
If an error was reported in the issue description, I have confirmed that my fix resolves the error. — Yes: after the fix, all 4 new
sfc/script-setupcases (includinggeneric component with defineOptions) pass, and total coverage went from a would-be 688/689 to 689/689, matching the real Vue compiler oracle exactly (verified above with-vvshowing zero mismatches). -
I have thought about edge cases and made sure my fix handles them as well.
-
Assistant
All checklist items are satisfied. Summary of the changes made:
-
tests/fixtures/sfc/script-setup.toml— Added 4 new Script Setup TypeScript differential cases:defineOptions with inheritAttrs only,defineOptions with name only,defineOptions with custom options, andgeneric component with defineOptions(covering<script setup generic>type parameters combined with ).
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.