Bolt-on capabilities — worked graph designs
These designs describe intended system behavior and qualification requirements. Inspect the system atlas for named ports and relation participants.
Navigation: nested containers, deep links and modal return
How does a route cross a nested feature boundary?
Inspect this design · Definition JSON · revision ee9f93df80a6
Diagram legend. Frames are named graph regions. Left/right pins show required/offered participation, not a universal schedule. Filled pins are connected; hollow pins are unbound. A junction card preserves one relation's role slots.
| Marker | Meaning in this diagram |
|---|---|
| ↪ N12 | Route / navigation |
| ⌘ N10 | Function / blueprint region |
| ▤ N11 | Surface / view component |
| ⊂ N33 | Policy / principal boundary |
| ▷ P11 | Execution / continuation |
| ⊕ P19 | Capability descriptor |
| ◎ P24 | Inspection / evidence |
| ⊂ P20 | Authorization request / grant |
| ↪ H36 | Navigation / interaction route |
| ⇥ H30 | Boundary export / alias |
| ⊂ H23 | Scoped authorization |
| ⊏ H19 | Ownership / containment |
Logic and ownership
Kotlin parses the incoming URL into a typed payload, resolves the container path and computes the return continuation.
Failure and qualification
- A modal return carries a typed result to an existing activation; it does not recreate arbitrary caller state.
- Missing or unauthorized routes yield an explicit outcome before activating children.
- A region boundary exports selected endpoints; it does not expose the entire child graph.
Hyperedge roles
| Relation | Pattern | Participants, preserving role positions |
|---|---|---|
| entry | H36 — Navigation / interaction route {#h36--navigation--interaction-route} | provider[0]: entry.destination; consumer[0]: container.destination |
| export | H30 — Boundary export / alias {#h30--boundary-export--alias} | provider[0]: route.export; consumer[0]: container.child |
| screen | H36 — Navigation / interaction route {#h36--navigation--interaction-route} | provider[0]: route.destination; consumer[0]: screen.route |
| modal | H36 — Navigation / interaction route {#h36--navigation--interaction-route} | provider[0]: screen.approve; consumer[0]: modal.route |
| grant | H23 — Scoped authorization {#h23--scoped-authorization} | provider[0]: gate.grant; consumer[0]: route.authority |
| ownership | H19 — Ownership / containment {#h19--ownership--containment} | parent[0]: container.owner; child[1]: route.owned; return[2]: modal.continuation |
Kotlin common declaration
Import dev.shibasis.reaktor.portgraph.definition.* for this structural declaration. Behavior stays in ordinary Kotlin and binds through qualified runtime ports and adapters. Declaring a graph does not activate a system.
graphDefinition("capability-navigation", "ee9f93df80a63c5664c50a0c50bed123a359307443855aae9c8a61084173672e") {
region("app", "App")
region("feature", "Account feature", "app")
region("modal", "Approval modal", "feature")
node("entry", "Deep-link resolver", "N12", "app", ports = listOf(
PortDefinition("destination", "P11", "RouteAddressV1", PortPolarity.Offer)
))
node("container", "Feature container", "N10", "app", ports = listOf(
PortDefinition("destination", "P11", "RouteAddressV1", PortPolarity.Require),
PortDefinition("child", "P19", "AccountRouteV1", PortPolarity.Require),
PortDefinition("owner", "P24", "OwnerRefV1", PortPolarity.Neutral)
))
node("route", "Account route", "N12", "feature", ports = listOf(
PortDefinition("export", "P19", "AccountRouteV1", PortPolarity.Offer),
PortDefinition("destination", "P11", "AccountRouteV1", PortPolarity.Offer),
PortDefinition("authority", "P20", "RouteGrantV1", PortPolarity.Require),
PortDefinition("owned", "P24", "DefinitionRefV1", PortPolarity.Neutral)
))
node("screen", "Account Surface", "N11", "feature", ports = listOf(
PortDefinition("route", "P11", "AccountRouteV1", PortPolarity.Require),
PortDefinition("approve", "P11", "ApprovalRouteV1", PortPolarity.Offer)
))
node("modal", "Approval Surface", "N11", "modal", ports = listOf(
PortDefinition("route", "P11", "ApprovalRouteV1", PortPolarity.Require),
PortDefinition("continuation", "P24", "ContinuationRefV1", PortPolarity.Neutral)
))
node("gate", "Route policy", "N33", "app", ports = listOf(
PortDefinition("grant", "P20", "RouteGrantV1", PortPolarity.Offer)
))
relation("entry", "H36",
Incidence("entry", "destination", "provider", 0),
Incidence("container", "destination", "consumer", 0)
)
relation("export", "H30",
Incidence("route", "export", "provider", 0),
Incidence("container", "child", "consumer", 0)
)
relation("screen", "H36",
Incidence("route", "destination", "provider", 0),
Incidence("screen", "route", "consumer", 0)
)
relation("modal", "H36",
Incidence("screen", "approve", "provider", 0),
Incidence("modal", "route", "consumer", 0)
)
relation("grant", "H23",
Incidence("gate", "grant", "provider", 0),
Incidence("route", "authority", "consumer", 0)
)
relation("ownership", "H19",
Incidence("container", "owner", "parent", 0),
Incidence("route", "owned", "child", 1),
Incidence("modal", "continuation", "return", 2)
)
}
Authorization: delegation, expiry and effect admission
Can a delegated agent execute the same operation a human proposed?
Inspect this design · Definition JSON · revision da11babd2039
Diagram legend. Frames are named graph regions. Left/right pins show required/offered participation, not a universal schedule. Filled pins are connected; hollow pins are unbound. A junction card preserves one relation's role slots.
| Marker | Meaning in this diagram |
|---|---|
| ⊂ N33 | Policy / principal boundary |
| ✧ N39 | Agent / change proposer |
| ↗ N19 | Tool / external API adapter |
| ⊢ N37 | Claim / evidence record |
| ◎ P24 | Inspection / evidence |
| ○ P01 | Value / immutable snapshot |
| ⊂ P20 | Authorization request / grant |
| ⇆ P02 | Request / response |
| → H02 | Value flow |
| ⊂ H23 | Scoped authorization |
| ⇆ H05 | Request / reply binding |
| ⊢ H27 | Derivation / provenance |
Logic and ownership
Normal Kotlin policy code evaluates principal, resource, operation, revision and time, then produces a bounded decision for the current request.
Failure and qualification
- A capability descriptor states what can be done; a grant identifies who may do it within which scope.
- Approval expires and is bound to a plan fingerprint; changed effects need reevaluation.
- A recorded grant is not ambient access to hidden graph facets or data.
Hyperedge roles
| Relation | Pattern | Participants, preserving role positions |
|---|---|---|
| proposal | H02 — Value flow {#h02--value-flow} | provider[0]: agent.proposal; consumer[0]: gate.proposal |
| decision | H23 — Scoped authorization {#h23--scoped-authorization} | provider[0]: policy.decision; consumer[0]: gate.policy |
| execute | H05 — Request / reply binding {#h05--request--reply-binding} | provider[0]: service.operation; consumer[0]: gate.effect |
| receipt | H27 — Derivation / provenance {#h27--derivation--provenance} | provider[0]: gate.receipt; consumer[0]: receipt.effect |
| delegation | H23 — Scoped authorization {#h23--scoped-authorization} | delegator[0]: human.delegation; delegate[1]: agent.identity; resource[2]: service.resource; admission[3]: gate.admission |
Kotlin common declaration
Import dev.shibasis.reaktor.portgraph.definition.* for this structural declaration. Behavior stays in ordinary Kotlin and binds through qualified runtime ports and adapters. Declaring a graph does not activate a system.
graphDefinition("capability-auth", "da11babd2039ade15e3cdeceec7954abf8f1c9e1ceac913c8ff7ff12ec3ac849") {
region("control", "Control plane")
region("data", "Data plane")
node("human", "Human principal", "N33", "control", ports = listOf(
PortDefinition("delegation", "P24", "PrincipalRefV1", PortPolarity.Neutral)
))
node("agent", "Agent proposer", "N39", "control", ports = listOf(
PortDefinition("proposal", "P01", "EffectProposalV1", PortPolarity.Offer),
PortDefinition("identity", "P24", "PrincipalRefV1", PortPolarity.Neutral)
))
node("policy", "Policy evaluator", "N33", "control", ports = listOf(
PortDefinition("decision", "P20", "PolicyDecisionV1", PortPolarity.Offer)
))
node("gate", "Effect admission", "N33", "control", ports = listOf(
PortDefinition("proposal", "P01", "EffectProposalV1", PortPolarity.Require),
PortDefinition("policy", "P20", "PolicyDecisionV1", PortPolarity.Require),
PortDefinition("effect", "P02", "PrivilegedOperationV1", PortPolarity.Require),
PortDefinition("receipt", "P24", "EffectReceiptV1", PortPolarity.Offer),
PortDefinition("admission", "P24", "AuthorityRefV1", PortPolarity.Neutral)
))
node("service", "Privileged service", "N19", "data", ports = listOf(
PortDefinition("operation", "P02", "PrivilegedOperationV1", PortPolarity.Offer),
PortDefinition("resource", "P24", "ResourceRefV1", PortPolarity.Neutral)
))
node("receipt", "Audit receipt", "N37", "control", ports = listOf(
PortDefinition("effect", "P24", "EffectReceiptV1", PortPolarity.Require)
))
relation("proposal", "H02",
Incidence("agent", "proposal", "provider", 0),
Incidence("gate", "proposal", "consumer", 0)
)
relation("decision", "H23",
Incidence("policy", "decision", "provider", 0),
Incidence("gate", "policy", "consumer", 0)
)
relation("execute", "H05",
Incidence("service", "operation", "provider", 0),
Incidence("gate", "effect", "consumer", 0)
)
relation("receipt", "H27",
Incidence("gate", "receipt", "provider", 0),
Incidence("receipt", "effect", "consumer", 0)
)
relation("delegation", "H23",
Incidence("human", "delegation", "delegator", 0),
Incidence("agent", "identity", "delegate", 1),
Incidence("service", "resource", "resource", 2),
Incidence("gate", "admission", "admission", 3)
)
}
Telemetry: graph attribution, sampling and privacy
How can a span identify a graph operation without leaking its payload?
Inspect this design · Definition JSON · revision 82bc1eb404f2
Diagram legend. Frames are named graph regions. Left/right pins show required/offered participation, not a universal schedule. Filled pins are connected; hollow pins are unbound. A junction card preserves one relation's role slots.
| Marker | Meaning in this diagram |
|---|---|
| ↯ N02 | Effectful operation |
| ◎ N38 | Observer / query / visitor |
| ⊂ N33 | Policy / principal boundary |
| ƒ N01 | Pure computation |
| ↗ N19 | Tool / external API adapter |
| ⊟ N30 | External system boundary |
| ◎ P24 | Inspection / evidence |
| ⊂ P20 | Authorization request / grant |
| ○ P01 | Value / immutable snapshot |
| ↦ P04 | Push event |
| ⇆ P02 | Request / response |
| ↦ H04 | Event subscription |
| ⊂ H23 | Scoped authorization |
| → H02 | Value flow |
| ⇆ H05 | Request / reply binding |
| ⊢ H27 | Derivation / provenance |
Logic and ownership
A Kotlin sampler uses deterministic operation identity and declared budget. The interceptor emits approved metadata before any exporter runs.
Failure and qualification
- Observed traffic is a sampled, time-bounded claim rather than proof that all paths are healthy.
- Read access and capture are sensitive effects with separate grants and redaction policies.
- Trace continuity across retries and hosts requires explicit context propagation.
Hyperedge roles
| Relation | Pattern | Participants, preserving role positions |
|---|---|---|
| span | H04 — Event subscription {#h04--event-subscription} | provider[0]: app.span; consumer[0]: interceptor.span |
| policy | H23 — Scoped authorization {#h23--scoped-authorization} | provider[0]: policy.grant; consumer[0]: interceptor.capture |
| sample | H02 — Value flow {#h02--value-flow} | provider[0]: interceptor.envelope; consumer[0]: sampler.input |
| export | H02 — Value flow {#h02--value-flow} | provider[0]: sampler.selected; consumer[0]: exporter.input |
| backend | H05 — Request / reply binding {#h05--request--reply-binding} | provider[0]: collector.ingest; consumer[0]: exporter.backend |
| attribution | H27 — Derivation / provenance {#h27--derivation--provenance} | definition[0]: app.definition; activation[1]: interceptor.activation; observation[2]: collector.observation |
Kotlin common declaration
Import dev.shibasis.reaktor.portgraph.definition.* for this structural declaration. Behavior stays in ordinary Kotlin and binds through qualified runtime ports and adapters. Declaring a graph does not activate a system.
graphDefinition("capability-telemetry", "82bc1eb404f21646e7ba228dfa6fe2a6b235da41c3b9a8dac6fc6f75905a1444") {
region("control", "Control plane")
region("data", "Data plane")
node("app", "Application operation", "N02", "data", ports = listOf(
PortDefinition("span", "P24", "SpanEnvelopeV1", PortPolarity.Offer),
PortDefinition("definition", "P24", "DefinitionRefV1", PortPolarity.Neutral)
))
node("interceptor", "Port interceptor", "N38", "data", ports = listOf(
PortDefinition("span", "P24", "SpanEnvelopeV1", PortPolarity.Require),
PortDefinition("capture", "P20", "CaptureGrantV1", PortPolarity.Require),
PortDefinition("envelope", "P01", "RedactedSpanV1", PortPolarity.Offer),
PortDefinition("activation", "P24", "ActivationRefV1", PortPolarity.Neutral)
))
node("policy", "Capture / privacy policy", "N33", "control", ports = listOf(
PortDefinition("grant", "P20", "CaptureGrantV1", PortPolarity.Offer)
))
node("sampler", "Sampling logic", "N01", "data", ports = listOf(
PortDefinition("input", "P01", "RedactedSpanV1", PortPolarity.Require),
PortDefinition("selected", "P04", "RedactedSpanV1", PortPolarity.Offer)
))
node("exporter", "OTel exporter", "N19", "data", ports = listOf(
PortDefinition("input", "P04", "RedactedSpanV1", PortPolarity.Require),
PortDefinition("backend", "P02", "TelemetryBatchV1", PortPolarity.Require)
))
node("collector", "Observability backend", "N30", "control", ports = listOf(
PortDefinition("ingest", "P02", "TelemetryBatchV1", PortPolarity.Offer),
PortDefinition("observation", "P24", "ObservationRefV1", PortPolarity.Neutral)
))
relation("span", "H04",
Incidence("app", "span", "provider", 0),
Incidence("interceptor", "span", "consumer", 0)
)
relation("policy", "H23",
Incidence("policy", "grant", "provider", 0),
Incidence("interceptor", "capture", "consumer", 0)
)
relation("sample", "H02",
Incidence("interceptor", "envelope", "provider", 0),
Incidence("sampler", "input", "consumer", 0)
)
relation("export", "H02",
Incidence("sampler", "selected", "provider", 0),
Incidence("exporter", "input", "consumer", 0)
)
relation("backend", "H05",
Incidence("collector", "ingest", "provider", 0),
Incidence("exporter", "backend", "consumer", 0)
)
relation("attribution", "H27",
Incidence("app", "definition", "definition", 0),
Incidence("interceptor", "activation", "activation", 1),
Incidence("collector", "observation", "observation", 2)
)
}
Service composition: retry, fallback and contract evolution
When is a fallback semantically compatible with the primary service?
Inspect this design · Definition JSON · revision b4bd5132161b
Diagram legend. Frames are named graph regions. Left/right pins show required/offered participation, not a universal schedule. Filled pins are connected; hollow pins are unbound. A junction card preserves one relation's role slots.
| Marker | Meaning in this diagram |
|---|---|
| ↯ N02 | Effectful operation |
| ↗ N19 | Tool / external API adapter |
| ▣ N05 | Actor / statechart |
| ⊂ N33 | Policy / principal boundary |
| ≡ N31 | Schema / contract definition |
| ⇆ P02 | Request / response |
| ◉ P08 | Signal / reactive state |
| ⊂ P20 | Authorization request / grant |
| ◎ P24 | Inspection / evidence |
| ⇆ H05 | Request / reply binding |
| → H02 | Value flow |
| ⊂ H23 | Scoped authorization |
| ⋁ H33 | Fallback / preference set |
| λ H25 | Implements / source ownership |
Logic and ownership
Ordinary Kotlin evaluates error class, deadline and fallback freshness. Typed request/response DTOs remain shared KMP code.
Failure and qualification
- A matching payload type is insufficient if authority, consistency or error behavior differs.
- Retries consume the caller deadline and preserve idempotency identity.
- Circuit state is owned per declared scope; it is not an accidental global singleton.
Hyperedge roles
| Relation | Pattern | Participants, preserving role positions |
|---|---|---|
| primary | H05 — Request / reply binding {#h05--request--reply-binding} | provider[0]: primary.api; consumer[0]: client.primary |
| fallback | H05 — Request / reply binding {#h05--request--reply-binding} | provider[0]: fallback.api; consumer[0]: client.fallback |
| budget | H02 — Value flow {#h02--value-flow} | provider[0]: breaker.budget; consumer[0]: client.budget |
| grant | H23 — Scoped authorization {#h23--scoped-authorization} | provider[0]: policy.grant; consumer[0]: client.authority |
| preference | H33 — Fallback / preference set {#h33--fallback--preference-set} | preferred[0]: primary.profile; fallback[1]: fallback.profile; selector[2]: client.selector |
| contract | H25 — Implements / source ownership {#h25--implements--source-ownership} | contract[0]: schema.contract; implementation[1]: primary.implementation; implementation[2]: fallback.implementation |
Kotlin common declaration
Import dev.shibasis.reaktor.portgraph.definition.* for this structural declaration. Behavior stays in ordinary Kotlin and binds through qualified runtime ports and adapters. Declaring a graph does not activate a system.
graphDefinition("capability-services", "b4bd5132161b90f0191449ba3e53c883ddb5a7230646a82d03be964451d9ca6b") {
region("control", "Control plane")
region("data", "Data plane")
node("client", "Typed client logic", "N02", "control", ports = listOf(
PortDefinition("primary", "P02", "SearchV1", PortPolarity.Require),
PortDefinition("fallback", "P02", "SearchV1", PortPolarity.Require),
PortDefinition("budget", "P08", "CallBudgetV1", PortPolarity.Require),
PortDefinition("authority", "P20", "ServiceGrantV1", PortPolarity.Require),
PortDefinition("selector", "P24", "SelectorRefV1", PortPolarity.Neutral)
))
node("primary", "Primary service", "N19", "data", ports = listOf(
PortDefinition("api", "P02", "SearchV1", PortPolarity.Offer),
PortDefinition("profile", "P24", "ServiceProfileV1", PortPolarity.Neutral),
PortDefinition("implementation", "P24", "ImplementationRefV1", PortPolarity.Neutral)
))
node("fallback", "Qualified fallback", "N19", "data", ports = listOf(
PortDefinition("api", "P02", "SearchV1", PortPolarity.Offer),
PortDefinition("profile", "P24", "ServiceProfileV1", PortPolarity.Neutral),
PortDefinition("implementation", "P24", "ImplementationRefV1", PortPolarity.Neutral)
))
node("breaker", "Circuit / budget state", "N05", "control", ports = listOf(
PortDefinition("budget", "P08", "CallBudgetV1", PortPolarity.Offer)
))
node("policy", "Invocation policy", "N33", "control", ports = listOf(
PortDefinition("grant", "P20", "ServiceGrantV1", PortPolarity.Offer)
))
node("schema", "Versioned service contract", "N31", "control", ports = listOf(
PortDefinition("contract", "P24", "ContractRefV1", PortPolarity.Neutral)
))
relation("primary", "H05",
Incidence("primary", "api", "provider", 0),
Incidence("client", "primary", "consumer", 0)
)
relation("fallback", "H05",
Incidence("fallback", "api", "provider", 0),
Incidence("client", "fallback", "consumer", 0)
)
relation("budget", "H02",
Incidence("breaker", "budget", "provider", 0),
Incidence("client", "budget", "consumer", 0)
)
relation("grant", "H23",
Incidence("policy", "grant", "provider", 0),
Incidence("client", "authority", "consumer", 0)
)
relation("preference", "H33",
Incidence("primary", "profile", "preferred", 0),
Incidence("fallback", "profile", "fallback", 1),
Incidence("client", "selector", "selector", 2)
)
relation("contract", "H25",
Incidence("schema", "contract", "contract", 0),
Incidence("primary", "implementation", "implementation", 1),
Incidence("fallback", "implementation", "implementation", 2)
)
}
Partitioning: graph cut with exported contracts and fences
Which semantics must be preserved when a region moves to another host?
Inspect this design · Definition JSON · revision 53f07b6718ea
Diagram legend. Frames are named graph regions. Left/right pins show required/offered participation, not a universal schedule. Filled pins are connected; hollow pins are unbound. A junction card preserves one relation's role slots.
| Marker | Meaning in this diagram |
|---|---|
| ⊞ N28 | Placement / resource pool |
| ▸ N27 | Runtime host / executor |
| ↗ N19 | Tool / external API adapter |
| ◆ N16 | Native resource / engine |
| ▰ N21 | Database / state authority |
| ◎ P24 | Inspection / evidence |
| ⇆ P02 | Request / response |
| ⇆ H05 | Request / reply binding |
| ⌖ H21 | Placement |
| ⇥ H30 | Boundary export / alias |
Logic and ownership
A common Kotlin cost function ranks legal placements after policy and target capability checks; it cannot override failed legality checks.
Failure and qualification
- Cutting a local pointer or borrowed resource is illegal without a qualified transfer adapter.
- Authority, clock, failure, latency and cancellation contracts survive the cut.
- Migrating an activation requires an epoch and state handoff; moving a diagram card does not move computation.
Hyperedge roles
| Relation | Pattern | Participants, preserving role positions |
|---|---|---|
| call | H05 — Request / reply binding {#h05--request--reply-binding} | provider[0]: kernel.compute; consumer[0]: service.compute |
| state | H05 — Request / reply binding {#h05--request--reply-binding} | provider[0]: state.conditional; consumer[0]: kernel.storage |
| placement | H21 — Placement {#h21--placement} | planner[0]: planner.plan; edge[1]: edge.profile; native[2]: native.profile |
| boundary | H30 — Boundary export / alias {#h30--boundary-export--alias} | export[0]: service.export; implementation[1]: kernel.implementation; authority[2]: state.fence |
Kotlin common declaration
Import dev.shibasis.reaktor.portgraph.definition.* for this structural declaration. Behavior stays in ordinary Kotlin and binds through qualified runtime ports and adapters. Declaring a graph does not activate a system.
graphDefinition("capability-partitioning", "53f07b6718ea84a95590b67dfd3164965b70738f10ef7d536d2aef6470bd4210") {
region("system", "System")
region("edge", "Edge partition", "system")
region("native", "Native partition", "system")
node("planner", "Placement planner", "N28", "system", ports = listOf(
PortDefinition("plan", "P24", "PlacementPlanV1", PortPolarity.Neutral)
))
node("edge", "Edge host", "N27", "edge", ports = listOf(
PortDefinition("profile", "P24", "HostProfileV1", PortPolarity.Neutral)
))
node("service", "Service export", "N19", "edge", ports = listOf(
PortDefinition("compute", "P02", "ComputeV1", PortPolarity.Require),
PortDefinition("export", "P24", "ContractRefV1", PortPolarity.Neutral)
))
node("native", "Native host", "N27", "native", ports = listOf(
PortDefinition("profile", "P24", "HostProfileV1", PortPolarity.Neutral)
))
node("kernel", "Native algorithm", "N16", "native", ports = listOf(
PortDefinition("compute", "P02", "ComputeV1", PortPolarity.Offer),
PortDefinition("storage", "P02", "ConditionalStateV1", PortPolarity.Require),
PortDefinition("implementation", "P24", "ImplementationRefV1", PortPolarity.Neutral)
))
node("state", "State authority", "N21", "native", ports = listOf(
PortDefinition("conditional", "P02", "ConditionalStateV1", PortPolarity.Offer),
PortDefinition("fence", "P24", "FenceRefV1", PortPolarity.Neutral)
))
relation("call", "H05",
Incidence("kernel", "compute", "provider", 0),
Incidence("service", "compute", "consumer", 0)
)
relation("state", "H05",
Incidence("state", "conditional", "provider", 0),
Incidence("kernel", "storage", "consumer", 0)
)
relation("placement", "H21",
Incidence("planner", "plan", "planner", 0),
Incidence("edge", "profile", "edge", 1),
Incidence("native", "profile", "native", 2)
)
relation("boundary", "H30",
Incidence("service", "export", "export", 0),
Incidence("kernel", "implementation", "implementation", 1),
Incidence("state", "fence", "authority", 2)
)
}
FFI: typed call, owned bytes and target admission
Who releases a buffer after a foreign call fails?
Inspect this design · Definition JSON · revision 724164211963
Diagram legend. Frames are named graph regions. Left/right pins show required/offered participation, not a universal schedule. Filled pins are connected; hollow pins are unbound. A junction card preserves one relation's role slots.
| Marker | Meaning in this diagram |
|---|---|
| ƒ N01 | Pure computation |
| ⚙ N15 | Device / platform adapter |
| ◆ N16 | Native resource / engine |
| ▱ N26 | Blob / buffer / asset store |
| ⊂ N33 | Policy / principal boundary |
| ⇆ P02 | Request / response |
| ⊂ P20 | Authorization request / grant |
| ↦ P04 | Push event |
| ◎ P24 | Inspection / evidence |
| ◇̸ P17 | Borrowed buffer / view |
| ⇆ H05 | Request / reply binding |
| — H01 | Exclusive binding |
| ⊂ H23 | Scoped authorization |
| → H02 | Value flow |
| ⊏ H19 | Ownership / containment |
Logic and ownership
Kotlin prepares a typed request and invokes the admitted bridge. The adapter maps serialization, error values and resource cleanup onto the target ABI.
Failure and qualification
- Kotlin/JS compilation proves no foreign-runtime parity. Each ABI and embedding host needs its own tests.
- Raw addresses and borrowed views remain local to a compatible memory domain.
- Cancellation is cooperative unless the target adapter explicitly supports interruption.
Hyperedge roles
| Relation | Pattern | Participants, preserving role positions |
|---|---|---|
| invoke | H05 — Request / reply binding {#h05--request--reply-binding} | provider[0]: bridge.call; consumer[0]: logic.call |
| native | H05 — Request / reply binding {#h05--request--reply-binding} | provider[0]: native.compute; consumer[0]: bridge.native |
| buffer | H01 — Exclusive binding {#h01--exclusive-binding} | provider[0]: pool.lease; consumer[0]: native.buffer |
| grant | H23 — Scoped authorization {#h23--scoped-authorization} | provider[0]: policy.grant; consumer[0]: bridge.admission |
| error | H02 — Value flow {#h02--value-flow} | provider[0]: bridge.failure; consumer[0]: error.failure |
| ownership | H19 — Ownership / containment {#h19--ownership--containment} | allocator[0]: pool.allocator; borrower[1]: native.borrow; adapter[2]: bridge.release |
Kotlin common declaration
Import dev.shibasis.reaktor.portgraph.definition.* for this structural declaration. Behavior stays in ordinary Kotlin and binds through qualified runtime ports and adapters. Declaring a graph does not activate a system.
graphDefinition("capability-ffi", "724164211963e316ddea9b20c178c39615ad06a08b19db8f21156cb876ca768e") {
region("js", "Kotlin/JS host")
region("native", "Native target adapter")
node("logic", "Common Kotlin logic", "N01", "js", ports = listOf(
PortDefinition("call", "P02", "NativeComputeV1", PortPolarity.Require)
))
node("bridge", "FFI transport adapter", "N15", "js", ports = listOf(
PortDefinition("call", "P02", "NativeComputeV1", PortPolarity.Offer),
PortDefinition("native", "P02", "NativeComputeV1", PortPolarity.Require),
PortDefinition("admission", "P20", "HostGrantV1", PortPolarity.Require),
PortDefinition("failure", "P04", "ForeignFailureV1", PortPolarity.Offer),
PortDefinition("release", "P24", "ReleaseProtocolV1", PortPolarity.Neutral)
))
node("native", "Foreign function library", "N16", "native", ports = listOf(
PortDefinition("compute", "P02", "NativeComputeV1", PortPolarity.Offer),
PortDefinition("buffer", "P17", "BufferLeaseV1", PortPolarity.Require),
PortDefinition("borrow", "P24", "BorrowRefV1", PortPolarity.Neutral)
))
node("pool", "Native buffer owner", "N26", "native", ports = listOf(
PortDefinition("lease", "P17", "BufferLeaseV1", PortPolarity.Offer),
PortDefinition("allocator", "P24", "AllocatorRefV1", PortPolarity.Neutral)
))
node("policy", "Host capability gate", "N33", "js", ports = listOf(
PortDefinition("grant", "P20", "HostGrantV1", PortPolarity.Offer)
))
node("error", "Error / cancellation adapter", "N15", "js", ports = listOf(
PortDefinition("failure", "P04", "ForeignFailureV1", PortPolarity.Require)
))
relation("invoke", "H05",
Incidence("bridge", "call", "provider", 0),
Incidence("logic", "call", "consumer", 0)
)
relation("native", "H05",
Incidence("native", "compute", "provider", 0),
Incidence("bridge", "native", "consumer", 0)
)
relation("buffer", "H01",
Incidence("pool", "lease", "provider", 0),
Incidence("native", "buffer", "consumer", 0)
)
relation("grant", "H23",
Incidence("policy", "grant", "provider", 0),
Incidence("bridge", "admission", "consumer", 0)
)
relation("error", "H02",
Incidence("bridge", "failure", "provider", 0),
Incidence("error", "failure", "consumer", 0)
)
relation("ownership", "H19",
Incidence("pool", "allocator", "allocator", 0),
Incidence("native", "borrow", "borrower", 1),
Incidence("bridge", "release", "adapter", 2)
)
}
Subgraph code push: state migration and old-call draining
How does a replacement preserve both callers and mutable state?
Inspect this design · Definition JSON · revision 782330082316
Diagram legend. Frames are named graph regions. Left/right pins show required/offered participation, not a universal schedule. Filled pins are connected; hollow pins are unbound. A junction card preserves one relation's role slots.
| Marker | Meaning in this diagram |
|---|---|
| ⌘ N10 | Function / blueprint region |
| λ N34 | Build / compiler pass |
| ⧉ N36 | Test / Shadow scenario |
| ⊂ N33 | Policy / principal boundary |
| ▸ N27 | Runtime host / executor |
| ▰ N21 | Database / state authority |
| ▧ P23 | Artifact / schema reference |
| ◎ P24 | Inspection / evidence |
| ⊂ P20 | Authorization request / grant |
| ⇆ P02 | Request / response |
| ▧ H26 | Artifact dependency |
| ✓ H28 | Evidence supports claim |
| ⊂ H23 | Scoped authorization |
| ⇆ H05 | Request / reply binding |
| ⇧ H35 | State migration |
| ⏻ H29 | Activation cohort |
Logic and ownership
The migration is an ordinary Kotlin function with declared preconditions. The host publishes a candidate epoch only after state and exported-contract checks.
Failure and qualification
- Generation pinning preserves code/routing identity; it does not by itself provide a consistent shared-state snapshot.
- Old invocations need bounded draining, explicit cancellation or a documented coexistence policy.
- Rollback to an older code image may be unsafe after a noninvertible data migration.
Hyperedge roles
| Relation | Pattern | Participants, preserving role positions |
|---|---|---|
| build | H26 — Artifact dependency {#h26--artifact-dependency} | provider[0]: candidate.source; consumer[0]: build.source |
| test | H26 — Artifact dependency {#h26--artifact-dependency} | provider[0]: build.bundle; consumer[0]: check.bundle |
| evidence | H28 — Evidence supports claim {#h28--evidence-supports-claim} | provider[0]: check.evidence; consumer[0]: policy.evidence |
| publish | H23 — Scoped authorization {#h23--scoped-authorization} | provider[0]: policy.decision; consumer[0]: host.admission |
| state | H05 — Request / reply binding {#h05--request--reply-binding} | provider[0]: state.conditional; consumer[0]: host.state |
| migration | H35 — State migration {#h35--state-migration} | old[0]: old.stateSchema; new[1]: candidate.stateSchema; authority[2]: state.version |
| activation | H29 — Activation cohort {#h29--activation-cohort} | old[0]: old.epoch; new[1]: candidate.definition; publisher[2]: host.publisher |
Kotlin common declaration
Import dev.shibasis.reaktor.portgraph.definition.* for this structural declaration. Behavior stays in ordinary Kotlin and binds through qualified runtime ports and adapters. Declaring a graph does not activate a system.
graphDefinition("capability-code-push", "7823300823163d4e5ac905949bc0725e0934fc8f6ac1ce9794b4ab1c875c65fc") {
region("control", "Control plane")
region("data", "Data plane")
node("candidate", "Replacement region", "N10", "control", ports = listOf(
PortDefinition("source", "P23", "SourceRevisionV1", PortPolarity.Offer),
PortDefinition("stateSchema", "P24", "SchemaRefV1", PortPolarity.Neutral),
PortDefinition("definition", "P24", "DefinitionRefV1", PortPolarity.Neutral)
))
node("build", "Kotlin/JS packager", "N34", "control", ports = listOf(
PortDefinition("source", "P23", "SourceRevisionV1", PortPolarity.Require),
PortDefinition("bundle", "P23", "BundleRefV1", PortPolarity.Offer)
))
node("check", "Compatibility / Shadow checks", "N36", "control", ports = listOf(
PortDefinition("bundle", "P23", "BundleRefV1", PortPolarity.Require),
PortDefinition("evidence", "P24", "EvidenceSetV1", PortPolarity.Offer)
))
node("policy", "Publication authority", "N33", "control", ports = listOf(
PortDefinition("evidence", "P24", "EvidenceSetV1", PortPolarity.Require),
PortDefinition("decision", "P20", "PublishDecisionV1", PortPolarity.Offer)
))
node("host", "Target host loader", "N27", "data", ports = listOf(
PortDefinition("admission", "P20", "PublishDecisionV1", PortPolarity.Require),
PortDefinition("state", "P02", "MigrationCommitV1", PortPolarity.Require),
PortDefinition("publisher", "P24", "HostRefV1", PortPolarity.Neutral)
))
node("old", "Old activation epoch", "N10", "data", ports = listOf(
PortDefinition("stateSchema", "P24", "SchemaRefV1", PortPolarity.Neutral),
PortDefinition("epoch", "P24", "ActivationRefV1", PortPolarity.Neutral)
))
node("state", "State authority", "N21", "data", ports = listOf(
PortDefinition("conditional", "P02", "MigrationCommitV1", PortPolarity.Offer),
PortDefinition("version", "P24", "StateVersionV1", PortPolarity.Neutral)
))
relation("build", "H26",
Incidence("candidate", "source", "provider", 0),
Incidence("build", "source", "consumer", 0)
)
relation("test", "H26",
Incidence("build", "bundle", "provider", 0),
Incidence("check", "bundle", "consumer", 0)
)
relation("evidence", "H28",
Incidence("check", "evidence", "provider", 0),
Incidence("policy", "evidence", "consumer", 0)
)
relation("publish", "H23",
Incidence("policy", "decision", "provider", 0),
Incidence("host", "admission", "consumer", 0)
)
relation("state", "H05",
Incidence("state", "conditional", "provider", 0),
Incidence("host", "state", "consumer", 0)
)
relation("migration", "H35",
Incidence("old", "stateSchema", "old", 0),
Incidence("candidate", "stateSchema", "new", 1),
Incidence("state", "version", "authority", 2)
)
relation("activation", "H29",
Incidence("old", "epoch", "old", 0),
Incidence("candidate", "definition", "new", 1),
Incidence("host", "publisher", "publisher", 2)
)
}