Skip to content

@effect/vitest record-form schema properties pass Schema instead of Arbitrary #6413

Closed

Description

@schickling-assistant

it.live.prop supports schemas in both array-form and record-form arbitrary inputs. Array-form schemas are converted with Schema.toArbitrary, but record-form schemas are converted and then immediately overwritten with the original schema object. FastCheck therefore receives a Schema where it expects an Arbitrary.

Reproduction

https://github.com/schickling-repros/2026-07-effect-vitest-record-schema-arbitrary

npm install && npm test

The command first runs [Schema.Int] as a passing control, then runs { value: Schema.Int } to reproduce the failure.

Expected

Both forms derive a FastCheck arbitrary from Schema.Int, and both property tests run successfully.

Actual

The array form passes. The record form fails deterministically during test collection:

Error: Invalid parameter encountered at index 0: expecting an Arbitrary

The reproduction produced the same failure in five consecutive runs.

Source diagnosis

Current main still contains the overwrite in packages/vitest/src/internal/internal.ts: result[key] = Schema.toArbitrary(arb) is followed by the unconditional result[key] = arb.

Versions

  • @effect/vitest: 4.0.0-beta.98
  • effect: 4.0.0-beta.98
  • vitest: 4.1.9
  • Node.js: 24.15.0
  • npm: 11.12.1
  • OS: Linux x86_64
Posted on behalf of @schickling
field value
agent_name 🪷 co2-peony
agent_session_id 77a79816-45b1-4c35-b32d-3377269b2ded
agent_tool Codex CLI
agent_tool_version 0.144.1
agent_runtime Codex CLI 0.144.1
agent_model unknown
runtime_profile /nix/store/qq3avrif77r90ypqbdv3hgd3gvwj5s32-coding-agent-runtime-profile/share/coding-agents/profile.json
skills_manifest /nix/store/pjlb3cwf453ghzmc8jj4v8h29sw6p4dg-agent-skills-corpus/share/agent-skills/manifest.json
worktree 2026-07-effect-vitest-record-schema-arbitrary/main
machine dev3
tooling_profile dotfiles@4b8e1c5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions