Skip to content

RFC-001 — Relation kind enforcement

Status: ratified. Source: atomprd/specs/rfcs/RFC-001-relation-kind-enforcement.md.

Every relation type in AtomPRD is constrained to specific (from kind, to kind) pairs. The validator rejects edges with disallowed pairs.

Most-used pairs:

RelationFromTo
parent_ofmodule / featurefeature / block kinds
verifiescriterionfeature
rendered_byentityui_view
uses_entityfeature / ui_viewentity
uses_rulefeaturerule
transitions_toui_viewui_view
requires_permissionfeature / ui_view(free-text role on metadata)

depends_on, blocks, and mined_from accept any kind pair — they’re cross-cutting and intentionally unconstrained.

  • Pattern C inference relies on kind-typed walks. “Walk verifies reverse from this feature to find criteria” only works if verifies is guaranteed criterion → feature.
  • Validator catches the wrong shape early. A user trying to wire verifies: feature → criterion (reversed) gets a clear error.
  • Codegen lowering is type-safe. lowerCriterion(c) can rely on c.kind === "criterion" for every node walked via a verifies edge.

The cost is some judgment calls have no clean answer:

  • “A risk that depends on a vendor” — depends_on is unconstrained, so this works, but it doesn’t carry kind-specific semantics.
  • Adding a new relation type requires a new RFC + a kind-pair table update.

The benefit is the validator catches broken graphs at authoring time, not at codegen time.