import { type DomainEventInput, type EntityRef, type Instant } from '@substrat-run/contracts'; import type { OperationContext, ScopedSql } from './scope-host.js'; /** * `ctx.link` and `ctx.relink` (K-16, #1864), written once — both adapters hand the same * function the same five things, the way `createCapabilityVerbs` is shared. * * Neither verb checks a permission. The operation calling it already has (its first line), * and a move's authority is vocabulary only the vertical has — `folder:move` on the child, * `folder:write` on both parents — so the vertical checks child, `from` and `to` itself. * What the kernel holds is the SHAPE of the graph: a ref it can store, a declared relation, * an edge that actually exists, no cycle. * * `ctx.link` refusing a cycle (#1875) is a behaviour change to a shipped verb: a module that * already writes one starts failing an operation that used to succeed. A store that already * holds a cycle needs nothing done to it — the walk below never revisits a ref (UNION, not * UNION ALL), so it terminates on an already-cyclic graph exactly as `relink`'s did before * this change; existing rows just sit there unrepaired, same as ever. Its cost grows with the * size of the ancestor set it walks, not a depth cap — that belongs to the permission checker's * own walk (`permission-eval.ts`, capped at 4), a different mechanism. */ export interface EntityEdgeDeps { /** RAW spine access inside the operation's own transaction — not the guarded `ctx.sql`. */ sql: ScopedSql; /** child entity type → the parent types some registered module declared for it. */ relations: ReadonlyMap>; /** The operation's instant — what a tombstone is stamped with. */ now: Instant; /** `ctx.emit` — stamps the actor, K-34 authorization and the operation. */ emit: (event: DomainEventInput) => void; /** K-42's read-only refusal, for the effecting verbs. */ assertWrites: (verb: string) => void; /** * Is this entity out of reach as a parent (#119) — its type declares trash, and it is binned or * missing (`isUnreachableParent`)? Refused by `link` and as `relink`'s `to`, one answer for both. */ isUnreachableParent: (entity: EntityRef) => boolean; } export type EntityEdgeVerbs = Pick; export declare function createEntityEdgeVerbs(deps: EntityEdgeDeps): EntityEdgeVerbs; //# sourceMappingURL=entity-edges.d.ts.map