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.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /vize, current file: none) bash-$
Assistant
Now let's look at the whole file for context.
Assistant
Now let's look at the fixtures directory for sfc/script-setup, and how TypeScript-related script setup fixtures live. Let's check fixtures and expected directories.
Assistant
Let's try building and running the coverage tool to see current status.
Assistant
Node and npm installed. Let's check version and try to install the actual @vue/compiler-sfc version matching the repo's catalog.
Assistant
Excellent, we have internet access and can install the exact compiler version. Now let's check the existing
.snapfile format for defineOptions to understand the expected pattern already used.Assistant
Let's just symlink our node_modules into the tests directory (or set NODE_PATH won't work for ESM resolution easily). Simplest: create node_modules symlink in /vize/tests pointing to /tmp/vueoracle/node_modules.
Assistant
Now let's check for diffs against existing snapshot (should be none if nothing changed).
Assistant
Good — matched by name, order doesn't matter. Now let's append the fixture cases and expected snapshot entries.
Assistant
Now append matching expected output blocks to script-setup.snap in the same format used by the tool.
Assistant
Now let's write a python script to append properly-formatted blocks using our computed outputs from out.json.
Assistant
Now let's build and run coverage to see if these pass.
Assistant
All 3 new cases fail. Let's inspect diffs with -vv to see actual vs expected.
Assistant
Let's fix formatting properly by editing the file directly with
open/edittool, rewriting cleanly.Assistant
Now this looks correct. Let's build.
Assistant
Now let's rerun the coverage tool.
Assistant
All 3 new cases now pass, and everything else remains at 100%. Let's update MIN_* thresholds in coverage.rs to reflect new totals (688 total, 162 SFC), and run the full test suite for the crate/workspace to check for regressions.
Assistant
Exit code 0, no regressions. Now let's run the full test suite for vize_test_runner and the affected crate to catch any unit test regressions from the component_output.rs change.
Assistant
Now let's run the full crate test suite for vize_atelier_sfc to make sure the component_output.rs change doesn't break other tests.
Assistant
No cargo-insta installed; let's just manually replace the snapshot content with the
.newfile's content, then remove the.new.Assistant
Now let's run full crate tests again to check for any remaining failures.
Assistant
Let's verify against real Vue oracle for this exact input to be sure.
Assistant
All match expectations (compare with our oracle outputs, matches exactly modulo
required: truenormalization). Let's promote all pending snapshots.Assistant
Now let's rerun the crate test suite to confirm everything passes cleanly.
Assistant
All passing. Now let's run the broader workspace test suite to check for other regressions (e.g., other crates depending on this codegen, editor/canon crates, etc.)
Assistant
All passing. Now let's also run the full workspace test suite to be thorough.
Assistant
These are unrelated stray files from a missing
pklbinary in this environment. Let's remove them since they're not part of our fix.Assistant
Let's check the diff for
script_setup__script_setup_before_script.snap.Assistant
Good, consistent with the other fix. Now let's rerun the full crate test again to make sure it's clean, and also rerun
vize_cartontests are unaffected by our change (should be untouched failures, pre-existing).Assistant
All green. Now let's verify the
git diffforcomponent_output.rslooks clean and correct.Assistant
No warnings. Now let's check
cargo clippyfor this crate quickly since repo likely enforces clippy.Assistant
No warnings referencing that file. Now let's double-check the final content of the modified fixtures and expected snap file, and clean up temp artifacts.
Assistant
Good. Now let's clean up temporary artifacts (tests/node_modules symlink) and verify final
git status.Assistant
Good, no diff there since we reverted it. Now let's rebuild and rerun the coverage tool one final time, plus the full test-runner and sfc crate tests, to confirm everything's consistent.
Assistant
Let's also double-check
cargo test -p vize_test_runnerfor the coverage budget unit test.Assistant
Now let's check the docs/vue-parity-matrix.md, which mentions "compiler fixture coverage is 625/625" — that number seems outdated already (current total is 688). Let's check if that number should be updated for consistency.
Assistant
Confirmed pre-existing and unrelated to my change. Let's restore the stash.
Assistant
All restored. Let's run final full build and test for the affected crates once more to be safe.
Assistant
Full workspace builds clean. Let's do a final review of the diff.
Assistant
Now all new files show up in
git diff. Let's verify git status is clean of other untracked leftovers.Assistant
Clean. Let's do one more full verification run of the exact test commands mentioned in the release gate docs, plus the coverage binary, to be thorough.
Assistant
All green. Now let's review the final diff of the coverage.rs file and the toml file for correctness one more time.
Assistant
This looks correct and complete. Let's view the final new fixture toml diff once more for correctness.
Assistant
This all looks correct. Let's clean up temporary tools we installed that aren't part of the repo (they're outside repo in /tmp, so no issue), and do a final sanity check of the whole repo state.
Assistant
Everything checks out. Now let's go through the checklist.
Checklist review
-
If an error was reported in the issue description, I have successfully reproduced it. The issue wasn't a crash/error report but a coverage-gap task. I reproduced the "gap" by adding the described Script Setup TypeScript differential cases (
defineOptionswithinheritAttrs,defineOptionswithname/custom options, and<script setup generic>combined withdefineOptions) to the fixture corpus and confirmed withcargo run -p vize_test_runner --bin coverage -- -vvthat Vize's actual output diverged from the real@vue/compiler-sfc@3.6.0-beta.10oracle output (Vize always emittedObject.assign(...)even in TypeScript mode, while real Vue spreadsdefineOptions()/normal-script default-export options into_defineComponent({...})for TS files). -
If an error was reported in the issue description, I have confirmed that my fix resolves the error. After patching
component_output.rsto match@vue/compiler-sfc's TS codegen (spread merge with_defineComponent/_defineVaporComponentinstead of runtimeObject.assign), all 3 new fixtures pass, andsfc/script-setupplus overall SFC/TOTAL coverage are back to 100% (162/162, 688/688). The known-failure budget (KNOWN_FAILURES) remains empty and accurate, andMIN_SFC_PASSED/MIN_TOTAL_PASSEDwere bumped to the new totals so regressions would be caught.
-
Assistant
- I have thought about edge cases and made sure my fix handles them as well.
I traced the actual
@vue/compiler-sfccodegen source (ctx.isTSbranch incompileScript) to cover: (1)defineOptions()alone in TS, (2) normal<script>default export merged with<script setup lang="ts">(previously ignored entirely forhas_default_export && has_optionscombos in the non-TSObject.assignpath — fixed that too), (3)is_vapor && is_tscombo now correctly uses_defineVaporComponentwith spread, (4) bare TS case with neither options nor default export still produces the original plain_defineComponent({...}). I verified via the crate's ownsnapshot_tests(which force-compile everysfc/script-setup.tomlandsfc/basic.toml/patches.tomlcase in TS mode) that two additional pre-existing fixtures (defineOptionsshorthand, andscript before script setup) were also fixed by this change, confirming the fix is general and not overfit to just the 3 new cases.
- I have thought about edge cases and made sure my fix handles them as well.
I traced the actual
Assistant
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.
Ran
cargo test -p vize_atelier_sfc(405 passed),cargo test -p vize_test_runner(coverage budget test + normalize_code test),cargo test -p vize_canon -p vize_glyph -p vize_maestro -p vize_musea -p vize_patina -p vize -p vize_vitrine(all green), and a fullcargo test --workspace --no-fail-fast. The only failures were pre-existing, environment-only issues unrelated to this change (vize_carton's.pkl-config tests requiring apklbinary not installed in this sandbox, and a.ts-config-loader test requiring Node's native TypeScript stripping) — confirmed by stashing my change and re-running the same tests, which failed identically before my change.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.
Ran
Assistant
Everything is verified and consistent. Let's do a final
git statuscheck before submitting.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →