Skip to content

vera check --explain-slots: show slot resolution table for each function #445

@aallan

Description

@aallan

Adds --explain-slots flag to vera check. After a successful type-check, prints a slot resolution table per function showing which parameter position each @T.n index refers to.

$ vera check examples/math.vera --explain-slots
OK: examples/math.vera

Slot environments (index 0 = last occurrence in signature):

  fn divide(@Int, @Int -> @Int)
    @Int.0  parameter 2 (last @Int)
    @Int.1  parameter 1 (first @Int)

Motivation: The dominant VeraBench failure mode is De Bruijn slot ordering (9pp gap vs Python). This flag lets agents self-correct via the check → read table → fix loop without any language change. Also useful for human reviewers.

Scope:

  • New --explain-slots flag on vera check (and --json mode extends output with slot_environments array)
  • New vera/slots.py utility module
  • Prescriptive documentation updates to SKILL.md, DE_BRUIJN.md, CLAUDE.md, README.md, and spec ch03

Closes #183 (won't fix — inline annotations are contraindicated; see that issue for the design rationale).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttoolingIssue around tooling built for the language (e.g. package managers, IDE plug-ins)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions