Sanity Library Reference Docs
    Preparing search index...
    • Advisory producer/consumer check for a deployed definition: every $effects['<name>'].<key> read whose <name> is not a declared effect, or is one whose declared outputs do not list <key>. Returns human-readable warning strings (empty when clean) — deploy surfaces them, it never rejects. (Runtime completion is where declared outputs are ENFORCED; this only warns the author at deploy about a consumer read no producer declares.)

      $effects derives solely from completed effects' outputs — the start seed and spawn handoff live in $context — so every producer IS a declared effect and an unknown name is warnable, not tolerated. An effect that declares no outputs produces nothing (an empty allowlist), so a keyed read of it is flagged like any undeclared key.

      Reads are collected from the primary consumer sites: condition GROQ (conditionSitesOf), effect binding GROQ, and guard reads (the $effects['<name>'].<path> mini-language on match.idRefs / metadata).

      Parameters

      • definition: {
            description?: string;
            fields?: FieldEntry[];
            groups?: Group[];
            initialStage: string;
            lifecycle?: WorkflowLifecycle;
            name: string;
            predicates?: Record<string, string>;
            roleAliases?: RoleAliases;
            semantics?: Semantic[];
            stages: Stage[];
            start?: StartBlock;
            title: string;
        }

      Returns string[]