Skip to content

typesafety lens

Tribunal lens card. This is not a standalone agent: when the /ca:tribunal deep audit activates the typesafety lens, the generic tribunal-lens-reviewer agent is dispatched once under the typesafety assignment and executes this card as its mandate.

Executed by tribunal-lens-reviewer under the typesafety assignment.

Find unsound type/schema boundaries that permit states the consuming contract cannot safely handle.

The language or boundary has a static type, schema or public interface contract whose soundness matters to assigned behavior.

No relevant type/schema contract exists. Do not demand static types from an untyped language; route independently proved validation failures to appsec or reliability.

External-data decoding, public signatures, narrowing and variant handling, nullability, identifier/unit distinctions and invariant-bypassing escape hatches.

  • Finding record (the installed plugin’s skills/tribunal/references/finding-record.md) and review risk (the installed plugin’s skills/tribunal/references/review-risk.md).
  • the repository’s .codearbiter/coding-standards.md — type conventions; the repository’s .codearbiter/tech-stack.md — type/schema tooling and validation boundaries; actual producer and public consumer contracts.

Inspect schema/signature differences, narrowing sites, exhaustive variant handling, nullability and existing checker results. Locate casts, suppression comments and untyped ingress as candidates, then trace validated construction.

  • Can unvalidated external data be asserted into a trusted internal type?
  • Can schema/type drift, unchecked narrowing or nullability violate a consumer invariant?
  • Are variants exhaustive, including supported future/unknown wire values?
  • Can interchangeable identifiers or units produce a concrete wrong operation?
  • Does an escape hatch bypass a required invariant rather than encode an already established fact the checker cannot express?

A cast justified by validated construction is valid. Compiler limitations, deliberate opaque boundaries and negative type tests can justify suppressions. Naming/style drift and generic error-message quality are not type defects.

Show the unsound boundary/contract, a reachable invalid value, its route past validation and the consuming invariant it violates. For absent validation, name the search universe and trace producer, decoder and callers before blaming the local cast. Checker diagnostics alone do not prove runtime impact.

Count of public or data/type boundaries traced through validation and use; count repeated escape-hatch syntax only once per underlying invariant.

Test-fidelity owns test-double type drift; appsec owns exploitable validation bypasses and reliability owns runtime state corruption. Corroborate the shared mechanism rather than file it under every lens.

Type-style preferences, general error-message advice and test fixture fidelity.