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
| Field | Type | Notes |
|---|---|---|
id | string | Required |
directive_type | enum | Required — see below |
name · description | string | |
condition | DirectiveCondition | When the directive applies — see below |
priority | integer 1–100 | Execution order — lower runs first |
enabled | boolean | Default true |
config | object | Directive-type-specific configuration |
on_failure | enum | skip/halt/quarantine/flag (default flag) |
rationale | string | Why this directive exists |
citation | string | Source of authority (e.g. an ACMG guideline DOI) |
Directive types
validate · enrich · route · filter · deduplicate · flag ·
quarantine · require_review · embargo · normalize · merge · split · notifyConditions
A DirectiveCondition is { field, operator, value }, where operator ∈:
eq · neq · gt · lt · gte · lte · in · not_in ·
contains · matches · exists · not_existsExample — 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)