Skip to content

skills: no rule holds an absence assertion to the encoding it searches #1306

Closed

Description

@OmarAlJarrah

Problem

An assertion that a spelling is absent from encoded output cannot fail when the spelling differs from what the encoder writes. morphic-verifying-changes says what a test must reach (references/assertions-and-reach.md, references/tests-that-bite.md), and no rule names this shape:

$ git grep -n NotContains -- .claude/skills/morphic-verifying-changes | wc -l
0

A test written for #1302 asserted that no Constraints held a bound:

assert.NotContains(t, marshalForTest(t, doc), `"minItems": 1`, "no Constraints anywhere holds the bound")

marshalForTest encodes compact JSON, so "minItems":1 is what a document holds and the spaced spelling matched nothing, on any document. It was found by a planted defect that wrote the bound onto a Scalar the census also keeps verbatim:

SURVIVED census alias also reads collection bounds | 0

With the assertion reading the node's field instead, the same plant is killed:

KILLED   census alias also reads collection bounds | TestCollectionBound_ANodeOfAnotherShapeKeepsItVerbatim

The rule's absence is what let the assertion read as a check. It was the only instance: once it was fixed, this finds none on the branch's tree.

git grep -nE 'NotContains\(t, .*`"[A-Za-z:_]+": ' -- '*_test.go'

Direction

A proposal: a rule in references/assertions-and-reach.md. Assert absence on the field that would hold the value, not on an encoding of the document. Where the encoding is the subject, assert the same spelling's presence in a control, so the search is shown to match. The probe is to plant the value and watch the assertion redden.

Out of scope

Presence assertions, which fail on a mismatched spelling and so announce themselves.

Related: #1302

Priority: P4, rule 1 (housekeeping: a skill rule, no change to lowering, IR or emit contract). git grep -n NotContains -- .claude/skills/morphic-verifying-changes | wc -l → 0 (morphic @608a5a46).

Activity

  1. added
    type:featureNew capability or enhancement
    priority:P4Refactors, tests, CI, hostile-input hardening, cosmetic diagnostics, other formats
    on Nov 1, 2026
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

    priority:P4Refactors, tests, CI, hostile-input hardening, cosmetic diagnostics, other formatstype:featureNew capability or enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions