6. Origins and derivedFrom
interface Origin { api?: string; layer: 'api' | 'shared' | 'base' | 'core' | 'workspace' | `pack:${string}`; pointer: string } // api: set on a copy from another apiinterface DerivedFrom { derivation: DerivationId; from: Origin[] }pointeris a JSON Pointer into the merged authoring tree of its layer:/surfaces/app/routes/channels/member/routes/tasks/member/routes/assign,/rights/tasks.update,/conventions/idempotency/header. It names a logical position, never a file, so moving content between files leaves it unchanged (ADR 0002 byte-identity rule).- Every declared element has an
origin. Every inherited setting on an operation carries the origin of the node that set it (FR-2, SCN-003). layeris closed, the one exception to the open enums of ADR 0005 section 3: the compiler derives a layer kind from it, and an unknown layer has no meaning for any reader.workspacelocates a diagnostic onworkspace.yamlonly; no IR element carries it.pack:<name>takes no#, so the side-table key<layer>#<pointer>(section 11) stays unambiguous.coremarks a declaration the compiler supplies itself, read from no file (amendment 2026-10-13, irRevision 2): the default codes of ADR 0006 section 6, the params schemas of those codes,ApiSchemaInvalidIssueandApiEmptyBody(section 13), and the default formatbarewhen no layer declares it. Itspointeris the pointer the declaration would have if the YAML the ADRs give for it were a layer file:/formats/bare(ADR 0002 section 13),/errors/api.rate_limitedfor a default code and/errors/api.rate_limited/paramsfor its params schema,/errors/api.schema_invalid/params/issues/itemsforApiSchemaInvalidIssue(ADR 0006 section 6, written asparamsare),/schemas/ApiEmptyBody(section 13), and a position below one as an authored member is named. Invariantir.origin.corechecks the entry it starts with only:/formats/<id>,/errors/<code>or/schemas/<id>, present in the document unlessapiis set. Acoreorigin has no side-table entry (section 11): a diagnostic about a core element is located at the binding or the use that pulled it in. Neitherworkspacenorcoreis the layer of a raw tree.- An element a relay route copies from another api (ADR 0002 section 7) keeps its origin in that api, with
apinaming it; the location is found through that api’s side table, or the pinned bundle’s sources. - Every derived element carries
derivedFrom: the derivation id from the derivation table (ADR 0006) and the origins of the declarations that caused it, for example{ derivation: 'csrf.cookieWrite', from: [/identities/user, /schemes/sessionCookie] }. A test walks the IR and fails on a derived element without it (SCN-011, CHK-045).