Skip to content

Directives (Layer D)

Layer D governs how data is processed — validation, routing, enrichment, and governance rules. Directives are part of what makes a packet L3 (along with actions and agent instructions). directive_type is a closed vocabulary — an unrecognized rule is one no runtime can apply, so new values require a minor version bump.

Directive fields

FieldTypeNotes
idstringRequired
directive_typeenumRequired — see below
name · descriptionstring
conditionDirectiveConditionWhen the directive applies — see below
priorityinteger 1–100Execution order — lower runs first
enabledbooleanDefault true
configobjectDirective-type-specific configuration
on_failureenumskip/halt/quarantine/flag (default flag)
rationalestringWhy this directive exists
citationstringSource of authority (e.g. an ACMG guideline DOI)

Directive types

validate · enrich · route · filter · deduplicate · flag ·
quarantine · require_review · embargo · normalize · merge · split · notify

Conditions

A DirectiveCondition is { field, operator, value }, where operator ∈:

eq · neq · gt · lt · gte · lte · in · not_in ·
contains · matches · exists · not_exists

Example — the contested-dosing safety directive

json
{
  "id": "dir-flag-genotype-dosing",
  "directive_type": "flag",
  "condition": { "field": "clinical_status", "operator": "eq", "value": "contested" },
  "rationale": "Genotype-guided dosing (MTHFR/COMT/APOE) is contested per ACMG.",
  "citation": "10.1038/gim.2012.165",
  "on_failure": "halt"
}

This pairs with the registry's contested enforcement: asserting such content as validated is rejected at publish; contested without a flag directive warns.

→ Next: Actions & Agents (Layer E) · Extraction Rules (Layer C)

Released under the MIT License.