Skip to content

The redundant-annotation gate does not sweep ML (.ospml) sources #215

Description

@MelbourneDeveloper

crates/osprey-cli/tests/redundant_annotations.rs enforces CLAUDE.md's "redundant annotations are defects" rule over tests/, examples/ and benchmarks/ — but only for the Default flavor. 118 .ospml files are ungated.

The gate's reader looks for an arrow inside a fn header (fn f(a: int) -> string =). ML spells a signature as a standalone line above the definition:

describe : JsonValue -> string
describe value =
    match value
        JsonNull => "null"

so return_annotation never matches and the deletion it performs does not apply. A green run of no_corpus_program_carries_a_removable_return_annotation says nothing about ML.

Confirmed removable today: tests/.../functional_showcase.test.ospml:17 — deleting the signature still type-checks, still lowers to IR, and the reported symbol types are unchanged (only line offsets move).

Gating ML needs its own reader and its own removal rule, and the stakes are known to be real: ec6a5cac deleted ML signatures by hand and took verdict, workflows and type_equality_comprehensive from green to a closure value with a still-generic type. Any ML sweep must therefore keep the existing oracle — type-check AND lower AND compare the reported outline — and normalise line offsets before comparing, since deleting a whole line shifts every symbol below it.

The limitation is documented on the test itself so a green run is not mistaken for ML coverage.

Found during review of the enforce-inferable-annotations branch.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions