Entities (Joint record)
The record (entity-first) form resolves a JointEntity for one or more
primary keys — structured columns, Lance evidence and derived attributes in a
single governed call (reachable through the semantic_query MCP tool too).
The form
Section titled “The form”SELECT name, segment, country, recent_meeting_topics, meeting_summaryFROM osl.entities.CustomerWHERE customer_id IN ('9c1e…f04a', 'e4f8…2a91')SELECT * returns all declared exposed_attributes. Keys are required — an
empty key set is refused (no full-scan). Results are ordered by the key list; a
missing key comes back marked missing rather than fabricated.
{ "customer_id": "9c1e…f04a", "name": "Anna Vidal", "segment": "retail-premium", "country": "ES", "recent_meeting_topics": [ { "text": "…", "cite": { "source": "gong://…", "doc_id": "meet-…", "chunk_id": "chk-…" } } ], "meeting_summary": "Anna has asked in recent meetings about […]"}A joint as a relation
Section titled “A joint as a relation”With the engine’s joint-relation flag on (chart jointRelation.enabled,
default off — off, these queries answer E0511 as before), a JointEntity
can also be filtered, ordered and paged on its structured anchor, with the
content legs hydrated only for the keys that selection served. “The five most
recent notices with their emails” is one call:
SELECT notice_id, received_at, emailsFROM osl.entities.ChargebackNoticeORDER BY received_at DESCLIMIT 5
-- continuation: same select list, WHERE and ORDER BY, plus the keyset cursorSELECT notice_id, received_at, emailsFROM JOINT(entity => 'ChargebackNotice', after => 'osl1.…')ORDER BY received_at DESCLIMIT 5It runs in two governed stages: a selection on the anchor model (one governed SQL read — the SQL enforcer alone decides which keys are selected), then hydration of exactly those keys. Rules:
WHERE(literal=,<,>,<=,>=,IN,BETWEEN,ANDonly) and the singleORDER BYname structured anchor attributes. An order or filter column that is not cleartext on every row the subject may see is refused (403 E2101);JOIN,GROUP BY,HAVING,OFFSET,DISTINCT,ORand predicates over content, derived, metric or neighbour attributes areE0511.- The primary key and every content leg’s join key must be cleartext on every
admitted row (
400 E0518, audited), and the primary key must be declared unique on the anchor model (E0512). LIMITis the page size (default 20, engine maximum 100; above it the page is served at the maximum withcappedBy). Paging is by an opaque keyset cursor bound to the subject and the query (E0530/E0531), never byOFFSET. Order and key columns whose type cannot resume a cursor exactly are refused before any read.
The response is shape: "joint_relation" with population.rows_at_start (the
governed count when the listing started) and a served block:
consistency: "keyset", has_more, next, cumulative, legs[] (each
ok, capped or failed) and withheld_keys (selected keys whose anchor row
was no longer admitted at hydration — a count, never the keys). A keyset
listing pins nothing, so served.complete is never true: rows added or
changed while you page may be missed or met once, and only
served.cumulative.rows may be claimed.
Governed by the same model
Section titled “Governed by the same model”Every attribute is subject to the caller’s grants:
un-granted columns come back redacted (⟦redacted⟧), obligated columns masked,
Lance legs served at the required redaction version. A full denial returns a
non-revealing E2101 — the engine never discloses which policy denied.
Related
Section titled “Related”- The query surface (OSL-SQL) — all five forms.
- Access & capabilities — the grants and MEET behind this.