Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-opus-5· anthropicHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Compiler parity: add the current Script Setup TypeScript differential…

  1. 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 defineOptions options such as inheritAttrs, component name/custom options, and <script setup generic> type parameters.

    Normalization must treat required: true as 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 defineOptions cases and script-setup generic type parameters. Normalize required: true as 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 using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to 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-$

  2. Claude Assistant

    Now let me create a probe fixture with candidate cases.

  3. Claude Assistant

    Now let me add the context field and helper.

  4. Claude Assistant

    Now the helper in compile/helpers.rs:

  5. Claude Assistant

    Now wire it into compile.rs:

  6. Claude Assistant

    Now update component_output.rs for setup args and preamble lines:

  7. Claude Assistant

    Now update the two slot fallback sites in block.rs:

  8. Claude Assistant

    Now generate the new insta snapshots for the added fixture cases:

  9. Claude Assistant

    I've completed the work. Let me do a final review of the complete change:

  10. Claude Assistant

    The work is complete. Here's my summary and the checklist review.

    What I changed

    Differential corpus (the Vue parity oracle)

    • tests/fixtures/sfc/script-setup.toml: added 16 Script Setup TypeScript cases — defineOptions with inheritAttrs: false/true, component name, custom/nested options, plus combinations with defineEmits/defineExpose/a normal <script> block — and <script setup generic> type-parameter cases (generic + defineOptions, constrained default type param, multiple constrained params, Record/mapped props types, generic emits payload, generic withDefaults, typed slots, defineModel<T>, generic defineExpose).
    • tests/expected/sfc/script-setup.snap: regenerated the new entries with the real @vue/compiler-sfc@3.6.0-beta.10 (same version the other SFC snapshots were generated with) and appended them; pre-existing entries were left byte-identical.
    • tests/vize_test_runner/src/coverage.rs: raised the tracked budget (MIN_SFC_PASSED 159→175, MIN_TOTAL_PASSED 685→701) and documented that KNOWN_FAILURES is exactly the remaining divergence set (now empty, so no new failure can hide). normalize_code's required: true default handling is exercised by the corpus and its unit test.

    Compiler parity fixes (so upstream output is matched, not the snapshots weakened)

    1. TS output now emits _defineComponent({ ...__default__, ...<defineOptions arg>, __name … }) (Vue's TS branch) instead of Object.assign(...); JS keeps Object.assign and now merges both the normal-script default export and defineOptions.
    2. Implemented Vue's inline-mode setup-context builtins: $attrs/$slots → setup(__props, { attrs: $attrs, slots: $slots }), $props → const $props = __props, $emit → const $emit = __emit / { emit: $emit }, with matching binding metadata so the render fn drops the _ctx. prefix.
    3. useSlots is only imported when defineSlots() is assigned to a binding.
    4. const props = __props / const emit = __emit keep source declaration order.
    5. Runtime prop types for TS utility types (Record/Partial/Required/Pick/Omit/InstanceType → Object, Parameters/ReadonlyArray → Array, ReadonlyMap/ReadonlySet, Uppercase… → String).
    6. vModelDynamic for <input :type> and inputs with dynamic-key v-bind.
    7. Slot fallback children are merged into createTextVNode(…, 1 /* TEXT */) like Vue's text transform.

    Regenerated the affected insta snapshots (tests/snapshots/sfc/ts/*, one core codegen snapshot) and refreshed the stale fixture-budget numbers in the release docs.

    Checklist

    • Reproduced the reported error: The issue is a parity/coverage-gap task rather than a crash. I reproduced the concrete divergences by installing the pinned real Vue compiler, generating oracle output for candidate defineOptions/generic cases, and diffing it against Vize (Object.assign vs defineComponent spread, missing { attrs: $attrs }, stray useSlots import, wrong Record<> runtime type, wrong prop/emit binding order, missing createTextVNode in slot fallbacks, vModelText vs vModelDynamic).
    • Confirmed the fix resolves it: All 16 new fixture cases now match the freshly generated upstream Vue output; cargo run -p vize_test_runner --bin coverage reports 701/701 (SFC 175/175) and exits 0.
    • Edge cases: Covered JS vs TS output modes, vapor mode (left on the Object.assign path, guarded builtins registration), defineOptions combined with a normal <script> default export, spread/trailing-comma/nested option objects, $attrs with expose/emit destructure ordering, $emit with and without an emit binding, generic components with emits/slots/models/expose/await, and a cheap substring guard before the extra template parse so the hot path isn't slowed.
    • Ran existing tests: cargo test --workspace --no-fail-fast, cargo fmt --check and cargo clippy --workspace -- -D warnings are clean apart from two pre-existing environment-dependent vize_carton config-loader tests (they need the Pkl CLI / a TS-capable Node) that also fail on the untouched HEAD. All temporary probe fixtures/binaries and the scratch node_modules used for oracle generation were removed.
  11. Claude Assistant

    The work is complete. Here's my final summary:

    Changes made

    Compiler parity fixes (crates/) — verified case-by-case against the real @vue/compiler-sfc@3.6.0-beta.10:

    1. defineOptions in TypeScript output (component_output.rs, body.rs): Vize emitted Object.assign({opts}, {...}); Vue's isTS branch spreads into a single defineComponent({ ...__default__, ...{opts}, __name … }). JS mode now also merges both a normal-script default export and defineOptions() via Object.assign(__default__, opts, { … }).
    2. Setup-context builtins (compile.rs, compile/helpers.rs, script/context.rs, component_output.rs): $props/$emit/$attrs/$slots referenced by an inline template are registered as setup bindings and destructured/aliased (setup(__props, { attrs: $attrs, slots: $slots }), const $props = __props, const $emit = __emit) — needed for inheritAttrs: false + v-bind="$attrs" parity.
    3. defineSlots<…>() without assignment no longer emits an unused useSlots import.
    4. Runtime prop types for TS utility types (Record, Partial, Required, Pick, Omit, InstanceType, Parameters, ReadonlyArray, ReadonlyMap/Set, Uppercase…) — needed by generic props such as Record<string, T>.
    5. const props = __props / const emit = __emit now follow source declaration order (Vue rewrites macros in place).
    6. v-model on <input> with :type or a dynamic v-bind now uses vModelDynamic.
    7. Slot fallback children reuse the shared children-array generator, so text/interpolation is wrapped in createTextVNode(…, 1 /* TEXT */).

    Corpus / budget: 16 new Script Setup TypeScript cases (defineOptions inheritAttrs, name/custom options, emits/expose/normal-script combos, and <script setup generic> type-parameter cases), expected outputs regenerated with the real Vue compiler and appended to tests/expected/sfc/script-setup.snap, insta TS snapshots regenerated, and coverage.rs budgets updated (MIN_SFC_PASSED 159→175, MIN_TOTAL_PASSED 685→701) with the known-failure list left at exactly the remaining divergences (zero — corpus is 701/701).

    Checklist

    • Reproduced the reported error: The issue isn't a crash but a parity/coverage gap, so I reproduced it differentially: I installed the pinned @vue/compiler-sfc@3.6.0-beta.10, generated upstream output for candidate defineOptions/generic Script Setup TS cases with the repo's own generate-expected.ts oracle, and confirmed Vize diverged (Object.assign vs defineComponent({ ...{} }), missing { attrs: $attrs }, stray useSlots, type: null for Record<…>, wrong binding order, vModelText vs vModelDynamic, missing createTextVNode).
    • Confirmed the fix resolves the error: All 16 new fixture cases (and every earlier probe case) now match upstream Vue; cargo run -p vize_test_runner --bin coverage reports 701/701 (100%) and exits 0.
    • Edge cases: JS vs TS output modes, vapor mode (left on the Object.assign path, guarded by !is_ts/!is_vapor), normal <script> + <script setup> combined with defineOptions, defineEmits with/without binding (emit: $emit vs const $emit = __emit), defineExpose ordering in the setup signature, async setup, SSR/function (non-inline) mode left untouched (Vue only destructures builtins in inline mode), and a cheap substring guard so the extra template parse only happens when a builtin name appears.
    • Ran existing tests: cargo test --workspace --no-fail-fast, cargo fmt --check, cargo clippy --workspace -- -D warnings all clean except two pre-existing environment-dependent vize_carton config-loading targets (require a TS-capable node and the Pkl CLI) that also fail on the pristine tree. Affected insta snapshots were regenerated (they now show the Vue-matching output), and no test files were edited beyond the fixture/snapshot corpus the task asks for.
  12. Claude Assistant

    Summary

    I extended the Vue differential-parity corpus with the current Script Setup TypeScript cases and fixed the real compiler divergences they exposed.

    Fixture / oracle work (tests/)

    • Added 16 new <script setup lang="ts"> cases to tests/fixtures/sfc/script-setup.toml: defineOptions with inheritAttrs (false/true), component name, custom/nested options, defineOptions combined with defineEmits/defineExpose/a normal <script> block, and <script setup generic> type-parameter cases (constrained defaults, multiple constrained params, mapped/Record props, generic emits payload, generic withDefaults, typed slots, defineModel<T>, generic defineExpose).
    • Regenerated the affected snapshots with the real Vue compiler (@vue/compiler-sfc@3.6.0-beta.10, the version pinned in the tests catalog — verified by byte-identically reproducing define-model.snap/props-destructure.snap) and appended only the new entries to tests/expected/sfc/script-setup.snap (existing entries untouched). required: true stays in the oracle output and is normalized as the default by the runner.
    • Updated the tracked budget in tests/vize_test_runner/src/coverage.rs (MIN_SFC_PASSED 159→175, MIN_TOTAL_PASSED 685→701) so new failures can’t hide; the known-failure list is exactly the remaining divergences — none, since all new cases now match upstream.

    Compiler fixes (crates/) driven by the new corpus

    • TS output now spreads defineOptions() / normal-script default into the single defineComponent({ ...opts, __name … }) object instead of Object.assign(...) (JS mode keeps Object.assign, now also merging both sources).
    • Implemented Vue’s inline-mode setup-context builtins: $attrs/$slots destructured into setup(__props, { attrs: $attrs, slots: $slots }), const $props = __props / const $emit = __emit preambles, plus binding registration so the render fn drops the _ctx. prefix.
    • defineSlots<…>() without assignment no longer emits an unused useSlots import.
    • const props = __props / const emit = __emit keep source declaration order.
    • Runtime type inference for Record/Partial/Pick/Omit/ReadonlyArray/… utility types.
    • v-model on <input> with :type or a dynamic v-bind now uses vModelDynamic; slot fallback children wrap text/interpolation in createTextVNode(...).

    Result: coverage reports 701/701 (100.0%) and exits 0; docs budget numbers refreshed.

    Checklist

    • Reproduced the reported error: The issue is a parity/coverage gap rather than a crash. I reproduced it concretely by generating the upstream Vue output for the new defineOptions/generic TS cases and diffing it against Vize (temporary probe fixtures + a scratch binary), which showed Object.assign(...) vs _defineComponent({ ...opts }), missing $attrs destructuring, a stray useSlots import, wrong props/emit binding order, Record<> → null props type, vModelText vs vModelDynamic, and missing createTextVNode in slot fallbacks.
    • Confirmed the fix resolves it: All 16 new fixture cases now match the real Vue output (sfc/script-setup 85/85), the whole differential corpus is 701/701, and the coverage binary exits 0.
    • Edge cases: JS vs TS output modes, vapor mode (excluded from the new builtin handling and keeps its Object.assign wrapper), defineOptions together with a normal <script> default export, $emit with and without an emit binding, $props/$slots builtins, defineSlots with/without assignment, SSR/non-inline paths left on Vue’s behaviour (Vue only destructures builtins in inline mode), and a cheap substring guard so the extra template parse only happens when a builtin name appears.
    • Ran existing tests: cargo test --workspace --no-fail-fast, cargo fmt --check, and cargo clippy --workspace -- -D warnings are clean; regenerated insta snapshots that legitimately changed (script_setup__defineoptions, both script+script-setup snapshots, slot-fallback codegen) plus the 16 new ones. The only failures are two pre-existing environment-dependent vize_carton config tests (need Node with TS support / the Pkl CLI) that also fail on the pristine tree. Temporary probe fixtures/binary and the locally installed node_modules were removed before submitting.
  13. Claude Assistant

    All work is complete. Here is my summary and the checklist walkthrough.

    What I did

    Reproduced the gap first. I installed Node + @vue/compiler-sfc@3.6.0-beta.10 (the version the repo's newest expected snapshots were generated with), used the repo's own oracle (tests/tooling/support/generate-expected.ts) plus a temporary probe binary to diff Vize output against real Vue output for Script Setup TypeScript defineOptions / <script setup generic> cases. Divergences were confirmed (e.g. Object.assign({inheritAttrs:false}, {...}) vs _defineComponent({ ...{inheritAttrs:false}, ... })).

    Compiler parity fixes (crates/):

    1. TS output spreads the defineOptions() argument and the normal-<script> default export into a single defineComponent({ ...__default__, ...opts, __name … }); JS output merges both via Object.assign(__default__, opts, { … }).
    2. Inline-template setup-context builtins ($props/$emit/$attrs/$slots) are registered as setup bindings and destructured/aliased (setup(__props, { attrs: $attrs }), const $props = __props) like @vue/compiler-sfc.
    3. Bare defineSlots<…>() no longer emits an unused useSlots import.
    4. Runtime prop-type inference for TS utility types (Record/Partial/Pick/Omit/… → Object, Parameters/ReadonlyArray → Array, etc.) — needed by generic prop types.
    5. const props = __props / const emit = __emit keep source declaration order.
    6. <input v-model> picks vModelDynamic for :type/dynamic v-bind.
    7. Slot fallback text/interpolation is wrapped in createTextVNode(…, 1 /* TEXT */).

    Corpus + budget: 16 new TS fixture cases in tests/fixtures/sfc/script-setup.toml, their expected blocks regenerated from the real Vue compiler and appended to tests/expected/sfc/script-setup.snap (existing entries untouched), new/updated insta snapshots, and coverage.rs budgets raised to MIN_SFC_PASSED = 175 / MIN_TOTAL_PASSED = 701 with the known-failure list documented as empty (zero remaining divergences — nothing hidden). Stale docs counts updated to 701/701.

    Checklist

    • Reproduced the reported error: Yes. The issue is a parity gap rather than a crash; I reproduced it concretely by generating upstream Vue output for defineOptions/generic Script-Setup-TS SFCs and diffing it against Vize (probe fixtures showed Object.assign vs spread, missing { attrs: $attrs }, stray useSlots, type: null for Record<…>, etc.).
    • Confirmed the fix resolves it: Yes. All probe cases now MATCH the real compiler, and the committed corpus reports sfc/script-setup 85/85, SFC 175/175, TOTAL 701/701 with exit=0 from cargo run -p vize_test_runner --bin coverage.
    • Edge cases: Covered JS vs TS output modes, vapor mode (guarded, unchanged), normal <script> + <script setup> combined with defineOptions, defineOptions with trailing commas/spreads/nested objects, $emit with and without an emit binding, $attrs+expose+emit destructure ordering, generics with withDefaults/defineModel/defineSlots/defineExpose/keyof-mapped types, and a cheap substring guard so the extra template parse only happens when a builtin name appears.
    • Ran existing tests: Yes. cargo test --workspace --no-fail-fast, cargo fmt --check, and cargo clippy --workspace -- -D warnings are clean except two pre-existing, environment-dependent vize_carton config-loading targets (need the Pkl CLI / a TS-capable Node), which I verified fail on the pristine tree as well. Snapshots that legitimately changed because of the parity fix were regenerated with insta rather than hand-edited, and no test assertions were modified.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.