registry__relate_artifact to record a typed relationship.
- Required inputs:
artifact_id,subject_id, andrel_type. - Optional inputs:
attributes,session_id, and Gateway’srationale. - Effect: write; idempotent.
attributes you send merge
into the edge’s stored attributes as an RFC 7396 merge patch, and null
clears them.
An edge also records who asserts it — its provenance — as manual,
agent_inferred, trace_derived, system_derived, or imported. The write
takes provenance from a provenance marker inside attributes when there is
one; without a marker, a restated edge keeps the provenance it has, and a new
edge’s is manual.
The target may be in another workspace of your account. Asserting the edge
takes update on the source and read on the target; everyone who can read
the source sees the edge, and a reader who cannot read the target sees only
that end’s handle and kind, marked is_readable: false. The source kind must
allow the selected relationship type; inspect it with
registry__get_kind_schema. A source kind with the extensible relationship
policy takes any relationship type, not only the ones it declares; an
undeclared edge reads back declared: false, and filter[declared][eq]=false
on GET /registry/v1/artifacts/{artifact_kind}/{artifact_id}/relationships
keeps the undeclared edges, so you can find and clean them up.