Skip to content

Phase 1 / D6: human-readable error messages (proof/checker failure → "resource X used twice at line N") #126

Description

@hyperpolymath

Deliverable 6 of #49. A translation layer from Idris2 proof failures / verifier rejections to actionable, line-anchored messages. The Idris2 type errors surfaced today are unintelligible to non-proof-language users.

Scope

  • Map each violation class to a human message carrying a .twasm source span:
    • L7–L10 (aliasing / effects / lifetime / linearity) — e.g. "resource X consumed twice (first at L:C, again at L:C)".
    • L2–L6 (region-binding / type-compat / null / bounds / result-type).
    • The verifier's own error variants: MissingDependentRegions, UnboundAccess, AccessSiteRegionMismatch, AccessSiteFieldMismatch, AccessSiteOutOfOrder, … (proposal 0002 §"Error variants").
  • Reuse what already exists: the checker diagnostics in src/parser/Checker.affine and the // E2E: expect-diagnostic <tag> pragmas exercised by tests/e2e/e2e-driver.mjs are the seed for the source-side half.

Acceptance

  • Each example's intentional-violation variant yields a message that names the offending resource/field and a source line.
  • A catalog/snapshot test pins the message set.

Dependencies

  • Source-side half is partially independent (checker diagnostics exist today).
  • Proof/verifier-side half benefits from F + D1 (needs emitted modules to reject).

Deliverable: Phase 1 / deliverable 6 (docs/PRODUCTION-PATH.adoc §Phase 1). Part of #49.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions