Infrastructure · Data Structures

Trait

Named surface set that implementers must provide

Definition

Mechanism

A marker interface: a named set of surfaces a pattern requires of anything claiming it, so a caller can invoke across implementations without knowing which one it holds. A Trait has no instances of its own — it is claimed by other patterns, which supply the surfaces it names. Distinct from Protocol, which is a Trait whose exchange must hold between two or more parties, and from Contract, which is a signed agreement rather than a type claim.

Invariants

  1. Names the surfaces an implementer must provide, and which of them are mandatory.
  2. Non-instantiable: a Trait is claimed by another pattern and has no standalone instance.
  3. Says nothing about how the surfaces are implemented.

Risks

Failure modes

  1. Claimed without provision

    a pattern declares the Trait and omits a mandatory surface, so callers dispatch to something that cannot answer.

  2. Surface set widened after adoption

    adding a mandatory surface breaks every existing claimant, which is why the set is part of the Trait's identity.

Relationships

Builds on

References

Contract

Binding agreement between parties

Used by

References

Mind

Solver

Abstract five-surface contract: Manifest, Execute, Consult, Verify, Feedback

Reference

Data schema

{
  "type": "object",
  "required": [
    "surfaces",
    "mandatory"
  ],
  "properties": {
    "surfaces": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Surfaces an implementer must be able to answer."
    },
    "mandatory": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The subset without which a claim to this Trait is void. Solver's is Manifest and Execute of five."
    },
    "claimants": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Patterns declaring this Trait, where the library tracks them."
    }
  }
}

Identity

Ref
Trait#e415
Sema ID
sema:Trait#mh:SHA-256:e415fe6619857f831d831228b5532ea64d4a6a222773c828098f30d36f450b20
Ring
0
Tier
1
Updated
2026-11-11
Supersedes
  • sema:Trait#mh:SHA-256:13adbfa9f48babf1c2de572b4eb72454879cbb1d76404fd65aee70400a72e2b7
  • sema:Trait#mh:SHA-256:14c7e4c3545c4dbe5d22a17eba23ce4a4f521cfcc29bd46561149be740b4a808