Skip to content

soundness: refinement-type predicates parse but are silently not enforced (TRefined) #558

Closed

Description

@hyperpolymath

TRefined predicates parse and are then silently NOT enforced (CAPABILITY-MATRIX.adoc:138-139 'parse-only'; TECH-DEBT CORE-05 row, no prior issue). A user's refinement annotation today is a false assurance — accepts-wrong-program class. v1 options: (a) enforce via predicate reduction (CORE-05 proper, large), or (b) LOUD-REJECT TRefined at typecheck until enforcement exists (cheap, honest). Recommend (b) now, (a) post-v1. Same silent-vs-loud principle as #555/#556. Part of the v1-readiness T0 tier.

Activity

  1. hyperpolymath commented on Jun 14, 2026

    @hyperpolymath
    OwnerAuthor

    Premise is stale — this is not a live soundness hole.

    Investigation (see #598): TRefined does not exist in the AST, and refinement/dependent types — T where (P) and assume(predicate) — were removed 2026-04-10 (spec.md §711–713, §1849). Refinement syntax parse-errors today; there is no silent-accept / accepts-wrong-program path, so the "parse but silently not enforced" framing no longer applies.

    The genuine residual defects are honesty ones:

    1. ✅ (fix(parser): #558 — honest-reject removed assume(...); fix misnamed fixture #598) assume(...) was a dangling keyword token → cryptic parse error; now honest-rejected with a deliberate, named error (conflict-free — zero new LR conflicts).
    2. ✅ (fix(parser): #558 — honest-reject removed assume(...); fix misnamed fixture #598) refinement_types.affine tested only generic functions (false "refinement" coverage) → renamed generic_functions.affine.
    3. ⚠️ Owner-only: the doc-lies — CAPABILITY-MATRIX.adoc ("TRefined parses"), STATE/TECH-DEBT CORE-05 rows — still claim parse-only enforcement. These need manual SPDX-gated edits (the strict .adoc/.md pre-commit owner-header check blocks automated edits).
    4. ❌ Non-viable: T where (P) honest-rejection would regress trait where-clauses (shared WHERE token → shift/reduce resolved by shifting into the refinement). It still surfaces a generic parse error.

    Recommendation: reframe from "soundness (T0)" to "doc-truthing + hygiene"; close after the doc reconciliation (item 3).

  2. added a commit that references this issue on Jun 14, 2026
  3. hyperpolymath commented on Jun 14, 2026

    @hyperpolymath
    OwnerAuthor

    Closing per owner direction.

    Resolved (#598): assume(...) is now honest-rejected (the dangling-token defect), and the misnamed refinement_types.affine fixture — which actually tested generic functions — was corrected to generic_functions.affine. The original "parse but silently not enforced" premise was stale: refinement/dependent types were removed 2026-04-10, so the syntax parse-errors — there was never a silent-accept / accepts-wrong-program path.

    Remaining (owner-only, outside this issue): the doc rows that still claim parse-only enforcement — CAPABILITY-MATRIX.adoc ("TRefined parses"), STATE/TECH-DEBT CORE-05 — need manual SPDX-gated .adoc edits (the strict pre-commit owner-header check blocks automated changes). T where (P) honest-rejection remains non-viable (would regress trait where-clauses via the shared WHERE token).

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