dev.idiolect.adapter

A subprocess or HTTP-endpoint wrapper for a framework's tooling, authored by incentive-aligned parties. Adapters are how idiolect glues existing frameworks (Hasura, Prisma, Datomic, FHIR, Coq, Meilisearch, ...) without forking them. The substrate publishes the adapter declaration; the orchestrator runs the adapter under the declared isolation policy.

Source: lexicons/dev/idiolect/adapter.json · Rust: idiolect_records::Adapter · TS: @idiolect-dev/schema/adapter · Fixture: idiolect_records::examples::adapter

Shape

FieldTypeRequiredNotes
frameworkstring (≤128)yesCanonical framework name (e.g. hasura, prisma, coq).
versionRangestringyesSemver range supported.
invocationProtocolobjectyesHow the adapter is invoked.
isolationobjectyesSandboxing requirements the orchestrator must honour.
authordidyesDID of the adapter author.
verificationat-urinoOptional verification record demonstrating conformance.
occurredAtdatetimeyesPublication timestamp.

invocationProtocol

SubfieldTypeRequiredNotes
kindopen enumyessubprocess / http / wasm.
kindVocabvocabRefnoVocab the kind slug resolves against.
entryPointstringnoBinary name (subprocess), URL (http), or WASM module reference.
inputSchemaschemaRefnoSchema of the adapter's input.
outputSchemaschemaRefnoSchema of the adapter's output.

isolation

SubfieldTypeRequiredNotes
kindopen enumyesnone / process / container / vm / wasm-sandbox.
kindVocabvocabRefnoVocab the kind slug resolves against.
networkPolicyopen enumnonone / egress-denylist / egress-allowlist / full.
networkPolicyVocabvocabRefnoVocab the policy slug resolves against.
filesystemPolicyopen enumnoreadonly / scratch / writable-subtree / full.
filesystemPolicyVocabvocabRefnoVocab the policy slug resolves against.
resourceLimits{ maxMemoryBytes?, maxCpuSeconds?, maxWallSeconds? }noHard ceilings the orchestrator enforces.

Field details

Why an adapter is a record

An adapter is a declared contract: the publisher asserts that "this framework, at this version range, can be invoked via this protocol under this isolation policy". The orchestrator running the adapter trusts the contract only as far as it trusts the publisher's signature; verification records can pin specific conformance claims.

The alternative (each orchestrator hand-coding adapter wrappers per framework) does not scale. The adapter record is the declarative replacement: a community with framework expertise publishes the wrapper once; orchestrators pick it up from the network.

invocationProtocol.kind

The transport over which the orchestrator drives the adapter:

SlugWhat it means
subprocessThe orchestrator forks entryPoint as a child process and pipes JSON over stdin/stdout.
httpThe orchestrator POSTs JSON to the URL at entryPoint.
wasmThe orchestrator instantiates the WASM module at entryPoint and calls a designated export.

The slug is open-enum: a community publishing a vocab with an additional kind (e.g. nats-rpc, grpc-stream) extends the transport set without modifying the lexicon.

isolation.kind

The sandboxing posture the orchestrator must honour:

SlugWhat it means
noneRun in the orchestrator's own process. Only safe for fully-trusted code.
processFork into a separate process; OS-level isolation.
containerRun in a container (Docker, Podman, Firecracker microVM).
vmRun in a full VM.
wasm-sandboxRun in a WASM runtime with capability-based access.

The orchestrator's policy is to refuse any adapter whose isolation.kind is weaker than its configured floor. An orchestrator configured for container minimum will not run an adapter declaring process.

Network and filesystem policies

Orthogonal axes layered on top of the kind:

networkPolicyWhat it means
noneNo network access.
egress-denylistNetwork access except to listed denied hosts.
egress-allowlistNetwork access only to listed allowed hosts.
fullUnrestricted.
filesystemPolicyWhat it means
readonlyThe adapter sees a read-only mount.
scratchThe adapter writes to a scratch directory cleaned up after each invocation.
writable-subtreeThe adapter writes to a designated subtree.
fullUnrestricted.

The orchestrator's enforcement is best-effort and depends on the underlying isolation runtime; e.g. wasm-sandbox makes egress-allowlist cheap and exact, process makes it harder.

resourceLimits

Hard ceilings. The orchestrator kills the adapter if it exceeds any of:

FieldUnit
maxMemoryBytesRAM, in bytes.
maxCpuSecondsCPU time, in seconds.
maxWallSecondsWall-clock time, in seconds.

A consumer running an untrusted adapter sets all three.

verification

An optional pointer to a dev.idiolect.verification record demonstrating conformance. A consumer that wants to trust an adapter's claim about its inputSchema / outputSchema looks for a conformance-test verification (see verification).

Example

{
  "$type": "dev.idiolect.adapter",
  "framework": "hasura",
  "versionRange": "^2.30",
  "invocationProtocol": {
    "kind": "http",
    "entryPoint": "https://hasura.example/v1/graphql",
    "inputSchema":  { "uri": "at://did:plc:adapter-author/dev.panproto.schema.schema/hasura-input" },
    "outputSchema": { "uri": "at://did:plc:adapter-author/dev.panproto.schema.schema/hasura-output" }
  },
  "isolation": {
    "kind": "container",
    "networkPolicy": "egress-allowlist",
    "filesystemPolicy": "scratch",
    "resourceLimits": {
      "maxMemoryBytes": 1073741824,
      "maxCpuSeconds": 30,
      "maxWallSeconds": 60
    }
  },
  "author": "did:plc:adapter-author",
  "occurredAt": "2026-04-19T00:00:00.000Z"
}

Concept references