sim_link
Record a typed edge between two stored entities (models, prompts, artifacts, maps, collections, bindings, relations — not witnesses), using a registered predicate. sim_link writes these (subject → object): @type (model → a https://sim.pflow.xyz/ns/models/v1 type name); about (artifact/prompt/map/collection → model/collection/binding/system); broader (model/collection/system → model/collection/system); cites (any entity → any entity); closeMatch (model → model); hasMember (collection → any entity); related (model/collection/system → model/collection/system). from, to and feeds are recorded only by sim_bind, produced only by sim_prompt/sim_reroll, supersededBy only by sim_supersede_model, migratedFrom only by sim_accept_migration; narrower is broader read backwards and is never stored; structural predicates (isomorphicTo, subnetOf, preservesInvariant, refines) are recorded only by sim_prove, together with the witness that proves them. Each is refused here, naming the tool that records it (or the reversed call, for narrower). Subject and object must be stored entities of the kinds the predicate relates, passed by content id (for @type, the object is a /ns/models/v1 type name). Full definitions at https://sim.pflow.xyz/ns/predicates/v1. Distinct from the Lineage a model/prompt/artifact already carries, which is specifically derivation (parent -> prompt -> child). Who may write an edge is its predicate's write rule (writeRule in the registry): hasMember is subject-owner — only the collection's owner (who created it with sim_create_collection) adds members, and a collection created before collections had owners takes no new ones; every other predicate sim_link writes is any-signed-in, an assertion attributed to you. A refusal names the rule. Edges are immutable and are never retracted. Linking the same subject/predicate/object again as the same user — either direction for a symmetric predicate — is idempotent: it returns the existing relation's id (existing: true) rather than recording a duplicate edge. Needs sign-in (opens OAuth the first time); the edge is attributed to you; costs 1 compute token. Writes one Relation, or nothing when it already exists.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object | Yes | content id of the stored entity the edge points to; for @type, a type name from https://sim.pflow.xyz/ns/models/v1 | |
| subject | Yes | content id of the stored entity the edge starts from | |
| predicate | Yes | one of @type, about, broader, cites, closeMatch, hasMember, related |