@sentropic/cluster-mesh
v0.29.4
Published
Injectable Cluster Mesh control-plane contracts, namespace modules, and single-instance runtime.
Readme
@sentropic/cluster-mesh
Injectable Cluster Mesh control-plane contracts and a functional single-instance runtime.
Compatibility and releases
Sentropic owns this package and its releases in rhanka/sentropic. Starting with
0.11.0, releases follow SemVer: patches fix defects without changing contracts,
minor releases add backward-compatible functionality, and incompatible changes
require a major release. This compatibility commitment also applies during 0.x;
the historical breaking 0.9/0.10 changes predate this policy.
The supported compatibility window is N and N-1: the current and immediately preceding minor release lines within the current major (initially 0.11.x and 0.10.x). Existing N-1 consumer inputs, ports and signed references remain valid on N; new optional features require capability detection. This is an API and contract compatibility promise, not an automatic upgrade or indefinite security maintenance promise. Consumers should pin exact versions and lock integrity; an older peer need not understand new optional features.
Before any major bump or field removal, Sentropic and h2a must pass cross-consumer conformance CI against both supported lines, document migration and deprecation, and coordinate the release. The CI gate is a release requirement; this additive release does not claim to install that cross-repository CI. Deprecated fields remain throughout the supported window and cannot be removed in a minor release.
Reusable public-contract fixtures live in tests/conformance/h2a-contract.json,
with the executable runner tests/conformance/h2a-contract.spec.ts. They cover
the h2a-facing boundaries, capabilities, projections, devices, NHI mapping and
federal gates through public exports. For h2a EX-12, copy both files, redirect the
runner's package import to the pinned release, and run the N/N-1 baseline suite
on both supported lines; run since 0.11 only on 0.11+. JSON fixtures have an
explicit format version and contain no private keys. This supplies Sentropic's
fixtures; cross-repository CI wiring remains a separate release gate.
Upstream bindings in 0.11
LocalDeviceAttachmentPort and LocalProjectionPort accept optional readonly
availability: 'available' | 'gated', including a getter for live binding state.
Omission retains the existing available behavior. mesh.capabilities reads the
current values; local operations reject gated bindings with CapabilityGatedError
before delegation. Federal capabilities remain gated. Hosts must report whether
their concrete bindings are usable; the mesh cannot probe opaque port internals.
Projection ports may provide supportedKinds?: readonly ProjectionKind[]; omission
supports all three kinds and an empty list supports none. Unsupported kinds fail
with CapabilityGatedError('local_projection') before creation or resolution.
mesh.capabilities.localProjectionKinds exposes the current effective kinds
(empty when the whole binding is gated). The field is optional in the public
capability type for older providers; this adapter always supplies it.
createDegenerateClusterMesh accepts nhi?: NhiLifecyclePort. It takes precedence
over nhiRunner; without injection, the runner retains its existing mapping.
At least one is required. Construction checks that an injected port's attest,
offboard and exportBundle methods are functions; malformed ports throw
TypeError, even when a runner is also supplied. An injected port is trusted by
design: the host owns its authorization, input validation and effects. Shape
validation does not establish behavioral equivalence to the command adapter.
attest accepts optional string role and scope,
forwarded as separate --role and --scope arguments before --root; h2a remains
the validation authority and its errors/results pass through unchanged.
The runner adapter rejects empty/whitespace-only or leading-hyphen instance,
role and scope values before building a command, with InvalidNhiArgumentError
(code: 'invalid_nhi_argument', argument identifies the field).
Devices may implement denyDeviceCode(userCode), returning DeviceApprovalResult.
The adapter delegates denial with the port as receiver. Hosts own the state
transition to denied and subsequent poll outcomes. Legacy ports remain valid;
calling denial without a binding throws CapabilityGatedError('device_denial').
The method stays optional on the public domain interface for compatibility.
SignedProjectionReference accepts optional Unix-millisecond expiresAt and
issuedAt. Hosts must sign and verify canonicalProjectionReferenceBytes(ref):
UTF-8 JSON in the fixed order kind, reference, homeNodeId, issuer, keyId,
expiresAt, issuedAt, omitting undefined timestamps and excluding signature.
Both project and resolve validate timestamps after verification and before delegation.
Legacy mode still accepts references without timestamps. createLocalProjectionDomain
accepts requireExpiry: true for strict mode, maxTtlMs to bound expiry minus
issued time (or current time when issued time is absent), and clockSkewMs
(default zero) to tolerate clock differences at expiry and issuance boundaries.
TTL must be positive; skew must be nonnegative; both are safe integer milliseconds.
now?: () => number defaults to Date.now; strict mode rejects non-finite clocks.
With zero skew, expiry equal to now is rejected; issuance after now is rejected.
Expiry is advisory unless strict mode AND an authenticating verifier are used. It bounds the replay window (plus allowed clock skew), but does not prevent replay inside it. Full G3 closure per D13 also requires a server challenge on the h2a side, outside this package. Signing ownership (F5) remains unchanged.
verifyCustodySignature is exported from the package root for standalone Ed25519
verification; it returns false for malformed keys, signatures, or verification
failure. It does not enforce custody authorization, lifetime, or replay policy.
Package checks from the repository root:
make typecheck-cluster-mesh ENV=<slug> and
make test-cluster-mesh ENV=<slug> (use an isolated test environment).
Version 0.9 makes verified custody mandatory and adds action-aware authorization, required instruction-resolution and target-liveness ports, and explicit actuation outcomes to the existing central control-plane contracts. It retains the degenerate topology introduced in 0.1: one Sentropic server, its attached local workstations, local signed projections, and the existing device-code lifecycle. It does not implement server-to-server federation.
Lazy integration surface (0.12+, tuple of 0.14)
Comments and generic storage candidate (0.19)
The 0.19.0 candidate adds /storage (neutral shared kernel),
/storage/postgres (host-injected SQL driver and migration assets), /comments,
/comments/hono, /loaders/comments and /compose/comments. Selecting comments
requires optional peer @sentropic/comments ^0.3.0; the qualified exact peer is
0.3.0. Root/generic storage and disabled comments composition do not evaluate it.
The host owns database connections, migration history, issued scope grants and
domain capability/resolution/decision ports. Startup verifies installed assets;
it never schedules migrations or opens its own connection.
createCommentsPostgresStorage and createCommentsModule expose the unchanged
24-method M1 persistence store, operational content/lifecycle services, and seven
bounded import/export/receipt methods. Transactions use store.transaction().run.
Use issued module.withContext(grant, callback) contexts. Full-runtime Hono
composition uses createCanonicalCommentsNamespaceModule and a host grant resolver;
raw lifecycle append and physical-completion routes are unavailable. Dedicated
review/submission/assignment operational APIs and SQLite parity remain separate.
The archive includes checksum-ordered PostgreSQL SQL assets and the digest-pinned
unchanged M1 conformance oracle under assets/storage/. The repository
host guide
and installed evidence
describe exact calls, fragment/terminal receipt rules and tested bounds. Import
preparation stays private until one canonical root publication; acknowledgements
are progress rather than complete receipts. The host retains exact qualified
archive/lock bytes before any separately approved delivery.
Optional provider leaves
Cluster Mesh is the single integration surface for llm-mesh and llm-gateway. Those
providers stay independent packages and never depend on cluster-mesh. They are
optional peers: a bare install pulls none of them, and the root entry
(@sentropic/cluster-mesh) has no static JS or declaration edge to any of them.
| Entry | Provider | Selected optional peers |
|---|---|---|
| /llm-mesh, /llm-mesh/facade, /llm-mesh/enrollment, /llm-mesh/node, /llm-mesh/transport/cloud-code | matching @sentropic/llm-mesh entry | @sentropic/llm-mesh >=0.22.0 <0.27.0 |
| /gateway | @sentropic/llm-gateway root (neither auth mode) | llm-mesh + @sentropic/llm-gateway >=0.19.0 <0.21.0 |
| /gateway/auth (service mode) | @sentropic/llm-gateway/auth | gateway + @sentropic/mcp-auth >=0.2.1 <0.3.0, jose ^5.10.0 |
| /gateway/auth-hono (session mode) | @sentropic/llm-gateway/auth-hono | gateway + @sentropic/auth-hono ^0.15.0 \|\| ^0.16.0 |
| /loaders/<leaf> | async typed loader (loadLlmMesh, loadGateway, loadGatewayAuth, ...) | as its leaf, resolved on call |
| /compose/llm-mesh, /compose/gateway | createLlmMeshNamespaceModule, createGatewayNamespaceModule | as the loaders they call |
| /mcp/registry, /mcp/stdio | Embedded @sentropic/mcp-platform MCP kernel entries | Platform and SDK installed transitively by mesh |
| /compose/mcp, /loaders/mcp | createMcpNamespaceModule, loadMcpPlatform{Registry,Stdio,Bridge,Entry,Hono} | as its leaf, resolved on call |
| /mcp/artifacts | createArtifactsBuiltin, createArtifactsToolExecutor | @sentropic/artifacts >=0.1.3 <0.2.0; platform embedded in mesh |
| /mcp/memory | createEngramMemoryBuiltin, registerEngramMemoryTools | Qualified optional engram 0.28 peer (>=0.22.0 <0.29.0); explicit PostgreSQL host definition |
The ./mcp/artifacts export provides the sentropic.artifacts builtin factory;
its optional @sentropic/artifacts >=0.1.3 <0.2.0 peer must be installed when
that leaf is imported. loadArtifactsMcp from ./loaders/mcp acquires the same
provider through the module registry. The root entry remains usable without it.
The memory builtin and explicit-host stdio command are described in
Memory MCP. The published @sentropic/engram 0.28.0 peer
is qualified in published peer qualification.
Static provider re-export leaves use export *: same values,
types, overloads and class identity. Importing a leaf selects that provider; a
missing provider fails native ESM linking of the importing module. Loaders take a
registry from createClusterMeshModules({ disabled? }) (one per composition root) and
reject with ClusterMeshModuleUnavailableError (code: 'cluster_mesh_module_unavailable',
reasons disabled | not_installed | incompatible_version | export_unavailable |
load_failed | source_unavailable). Recognize it with isClusterMeshModuleUnavailableError
or by code, never by instanceof (duplicate copies have distinct constructors).
modules.probe() reports metadata-only availability without evaluating providers;
pass modules to createDegenerateClusterMesh to expose capabilities.modules.
Other catalogued capabilities are listed as source_unavailable until a
later minor delivers them.
Workspace store
@sentropic/cluster-mesh/workspace-store exposes the V1 key, receipt and broker
ports for h2a. Probe workspace-store through modules.probe() before selecting
a backend, then call loadWorkspaceStore(modules) from
@sentropic/cluster-mesh/loaders/workspace-store. The normal typed module
refusal applies. The host supplies the WorkspaceStorePortsV1 implementation.
ensure returns a scoped reservation for an immutable tree. lease binds it
to a lane generation and returns a read-only mount. Release follows confirmed
detach. GC can collect after the last lane's PR merges once no pin, lease or
resumable lane protects the generation.
Pass the npm lockfile's package map to planWorkspaceStoreViewV1. The trusted
builder records the plan and exports root dependencies without lane workspace
links or their bin links. The local broker's attachView verifies the lease's
local generation and required rebuilds, recreates workspace links and bins, and
copies workspace-dependent and local tarball packages. The lane owner may supply
the paths of verified lane-local installs. Fall back to private npm for any
required path the lane cannot supply or for links nested under root dependencies.
Both local view methods take the lease ID and lane generation. Supply
LocalWorkspaceStoreHostV1.laneDirectory to resolve the recorded owner and
generation to a directory. Under its exclusive lock, the broker checks the lease
and verifies that the requested directory resolves to the authorized one. Call
materializeView with readers quiesced, then confirm detach and release the lease.
Startup preflight (fail closed before bind). llm-gateway imports its auth peers
only at verification time, so importing an auth leaf proves nothing. Await
loadGatewayAuth(modules) (service) or loadGatewayAuthHono(modules) (session)
before binding any listener; they resolve and evaluate the selected peer graph
from the installed gateway's location. createGatewayNamespaceModule(modules,
{ enabled, authMode: 'service' | 'session' | 'host', createRouter }) does this for
you; host selects no gateway auth peer (host-injected CallerAuthPort).
Topology guard. Every leaf, loader and compose entry first runs the guard, once
per set of evaluated copies: more than one evaluated cluster-mesh copy, an llm-mesh
resolved from cluster-mesh that differs from the gateway's, or (since 0.13.0) an
installed provider outside its accepted range makes the import throw
ClusterMeshTopologyError (code: 'cluster_mesh_topology_invalid', reason
duplicate_instance, divergent_llm_mesh or incompatible_version, message naming
the paths, or the installed version and the required range). llm-mesh entries check
the llm-mesh range; gateway entries check the llm-gateway and llm-mesh ranges. Ranges
are checked on the copies cluster-mesh actually resolves (llm-mesh and llm-gateway from
its own physical location, the gateway's llm-mesh from the gateway's location), release
versions only: a prerelease version never satisfies, and +build metadata is ignored
as npm does (0.26.0+build.1 satisfies >=0.22.0 <0.27.0). An absent
provider is left to the leaf import itself.
Copies are keyed by module URL without ?query/#hash: a copy loaded from another
path (nested install, npm link, a --preserve-symlinks link path) is a duplicate,
while re-evaluating the same file (Vite dev/HMR, vi.resetModules, cache-busting
query imports in test runners) replaces its entry and is not reported.
verifyClusterMeshTopology({ require }) from the root is an optional, earlier check
of both providers' ranges plus the require list. Guard state lives on
globalThis, so it is per thread (each worker_threads worker checks its own
copies); cross-process consistency stays with install/qualification gates. Limits:
under --preserve-symlinks, two llm-mesh instances sharing one realpath are not
detectable without importing both; and the automatic guard also refuses an
llm-mesh-only consumer when a stray gateway with a private llm-mesh copy is installed
next to it (remove that gateway copy or align its llm-mesh).
Consumer rules. Every manifest that declares cluster-mesh and imports a leaf
also declares that leaf's selected peers at the qualified versions; the installed
tree must hold exactly one cluster-mesh and one llm-mesh shared with the gateway.
0.16.0 is qualified with npm only (flat project installs, npm ci from a lockfile,
and a global consumer beside a separately installed runtime); other package managers
are not qualified. The tested bundler is esbuild with @sentropic/cluster-mesh and
@sentropic/cluster-mesh/* (and the peer packages) externalized, which keeps the
resolution anchor at the installed package; bundling the root inline (as the API
build does) embeds no provider code. TypeScript >= 5.7 is required with
skipLibCheck: false (hono's declarations); with skipLibCheck: true, a missing
peer surfaces as TS2305 on the named import. Frozen tuple (committed lockfile):
cluster-mesh 0.18.0, llm-mesh 0.26.1, llm-gateway 0.20.1, mcp-auth 0.2.2,
oauth-verify 0.1.0, jose 5.10.0, hono 4.13.0; session mode with auth-hono 0.16.0
(llm-gateway 0.20.1's declared peer range ^0.15.0 || ^0.16.0); the latest versions inside
every declared range are re-qualified on each release run. The previous tuple
(llm-mesh 0.21.x, llm-gateway 0.18.x) is refused, see "Upgrading to 0.13" below.
The current release target is cluster-mesh 0.18.0, llm-mesh 0.26.1 and llm-gateway 0.20.1 (cluster-mesh 0.18.0 is the unpublished branch candidate; main carries llm-mesh 0.26.1 and llm-gateway 0.20.0 — see the Post-Rebase Gate in BRANCH.md). Final sibling archive qualification and the selected-lock integrity refresh remain release gates; the selected fixture retains the baseline until that final refresh. The widened ranges retain the prior qualified minors.
Release-train runs qualify the unpublished llm-mesh and llm-gateway candidates from
same-PR sibling archives validated by the CI loadSiblings rules (sha256, packed
identity and manifest guard, receipts packed from the current commit, no unlisted
archive) (make -f packages/cluster-mesh/packaging.mk test-lazy-package
SIBLING_ARCHIVES_FILE=tmp/ci-manifest-guard/siblings/cluster-mesh/receipts.json); a
receipt for cluster-mesh itself replaces the local pack as the qualified candidate. The
committed selected lockfile carries their registry URL and the sha512 of those bytes.
Upgrading to 0.16. Gateway 0.20.0 requires llm-mesh ^0.26.0: upgrade both
providers in the same artifact and keep their physical llm-mesh instance shared.
Cluster-mesh 0.16.0 also accepts the prior 0.22.x / 0.19.x tuple. Prereleases
are refused.
Upgrading to 0.13. Bump cluster-mesh 0.13, llm-mesh 0.22 and llm-gateway 0.19 in
the same commit; npm may not error on a partial bump. Measured with npm 11.19: a
consumer keeping its own ^0.21.2/^0.18.0 pins fails with ERESOLVE, while
npm install <candidate> @sentropic/[email protected] @sentropic/[email protected]
exits 0 after "ERESOLVE overriding peer dependency" and silently drops the old pair.
What is automatic: the topology guard runs when a leaf, loader or compose module is
first evaluated, so a skewed tree (for example built with --legacy-peer-deps) fails
there with incompatible_version, naming the installed version and the required
range, before any provider module evaluates; nothing has to be called. The registry
loaders (modules.load('gateway')) refuse with cluster_mesh_module_unavailable /
incompatible_version as well. verifyClusterMeshTopology() is an optional earlier
check for hosts that mount routes before importing any leaf.
Upgrading to 0.16. Cluster-mesh 0.16.0 is a minor with no runtime change from
main's 0.15.0 (the live-storage registration export is inherited): it keeps
the >=0.22.0 <0.27.0 / >=0.19.0 <0.21.0 peer ceilings and qualifies the
llm-mesh 0.26.0 + llm-gateway 0.20.0 train. It supersedes main's 0.15.0 (taken by
PR #664, which merged first) strictly greater than npm (0.15.0) and main (0.15.0).
Namespace remap. createClusterMeshPlugin({ mounts }) mounts each enabled module
once at mounts[namespace] ?? namespace. A standalone gateway host passes
mounts: { '/gw': '/' } and serves exactly /healthz, /readyz, /v1/messages,
/v1/chat/completions and /v1/models (nothing under /gw); the product keeps
/gw under its own prefix.
Available in v1
- A directory containing the local server and its attached workstations.
- Device-code issue, poll, and approve delegation through an injected application port.
- Human identity, agent identity, and memory snapshot projections that remain on their declared home server and are consumed by signed reference.
- Exact local mapping of attest, offboard, and SPIFFE-bundle export to injected
h2a nhicommand execution. - Tenant residence resolved only through an approved-membership port.
- Deterministic workspace references in the form
ws:sha256:<digest>. - One active generation and one selected author per registered namespace.
- Durable registration, capacity-lease, lifecycle, and acted-receipt ports whose concrete storage remains host-owned.
- A reusable Hono plugin plus injectable
/session,/cli,/health, and/workspacesnamespace transports. - One logical MCP supervisor authority per generation, expressed through an injected runtime port rather than a per-session server.
Tenant identity and workspace identity are intentionally distinct. tid is returned by
the authoritative membership resolver; it is never copied from a request workspace id.
An unresolved membership throws TenantBoundaryError.
Central control plane
createClusterMeshPlugin mounts independently constructed namespace modules.
The package owns selection and fail-closed author checks; product domains,
databases, provider credentials, and concrete transports stay behind injected
ports. A host may disable a module without importing its provider implementation.
The public runtime contracts model real terminal actuation and external MCP qualification, but this package does not fabricate those integrations. A host must provide and qualify them before claiming PTY wake/relaunch, LOST detection, or multi-session MCP acceptance.
Production invocation verification uses a dedicated Ed25519 key ring configured
through CLUSTER_MESH_ED25519_PUBLIC_KEYS_JSON. Its JSON shape is
[{"kid":"...","alg":"EdDSA","crv":"Ed25519","publicKeyBase64Url":"..."}],
where publicKeyBase64Url is base64url-encoded SPKI DER. Malformed JSON or keys
abort startup; an absent or empty ring remains fail-closed. The audience defaults
to the local session-control URL, can be set with CLUSTER_MESH_EVIDENCE_AUDIENCE,
and accepts only explicit comma-separated additions from
CLUSTER_MESH_LEGACY_AUDIENCES. Signed evidence has a maximum lifetime of 300
seconds. Shared-secret A1 evidence is restricted to explicit non-production
qualification and is rejected in production.
Gated seams
The public surface already defines the future federal ports. The v1 runtime fails closed for all of them except RFC 8693 token exchange, which is available when a binding plus policy is configured (see below):
- inter-server discovery and member revocation;
- remote signed-projection resolution;
- memory snapshot replication and purge.
Invoking one of these seams throws CapabilityGatedError. The package exposes no broker
HTTP route, trusted-issuer store, inter-server directory, or replication runtime.
RFC 8693 token exchange (configured)
createDegenerateClusterMesh({ tokenExchange }) wires the exchange client when the
binding plus policy passes its local preflight; otherwise capabilities.tokenExchange
stays 'gated'. The production binding (trust/token-exchange-http.ts) performs an
authenticated RFC 8693 form POST with client_secret_basic, validates the returned
token (signature, issuer, exact audience, subject, workload client_id, mandatory
act, scope subset, TTL ceilings), and caches it for at most 60 seconds with an
early-use safety margin. tokenExchange: 'available' proves only this trust/egress
port: it neither delivers the MCP provider registry nor qualifies any module leaf.
Construction
createDegenerateClusterMesh composes the membership, trust, wrap, device, and
tenant-boundary domains. createClusterMeshPlugin composes the central namespace
surface. Every effectful operation is supplied through a typed port, so the
package owns no application persistence or provider transport.
import { createDegenerateClusterMesh } from '@sentropic/cluster-mesh';
const mesh = createDegenerateClusterMesh({
self,
workstations,
memberships,
projections,
nhiRunner,
devices,
});
console.log(mesh.capabilities.mode); // single-nodePublication
Manual publication is forbidden. For the first release, merge the validated package,
run the ci.yml workflow with bootstrap_publish_target=cluster-mesh, then attach the
npm OIDC trusted publisher to rhanka/sentropic and ci.yml. Later releases use the
repository CI publication path.
Stateful MCP wrapping (0.21.0)
createStatefulMcpNamespace from @sentropic/cluster-mesh/compose/mcp-stateful
wraps an existing host through the explicit StatefulMcpHost contract.
Immo installs @sentropic/[email protected] and @sentropic/[email protected].
Mesh declares platform >=0.4.0 <0.5.0 as a regular dependency (qualified at 0.4.0),
so npm installs platform and its SDK automatically. A regular dependency preserves
one shared kernel and normal npm resolution without duplicating bundled code.
The host uses these mesh entries for composition, registry setup and artifacts:
import { createStatefulMcpNamespace } from '@sentropic/cluster-mesh/compose/mcp-stateful';
import { createMcpRegistry, computeManifestDigest } from '@sentropic/cluster-mesh/mcp/registry';
import { createArtifactsBuiltin, createArtifactsToolExecutor } from '@sentropic/cluster-mesh/mcp/artifacts';The host owns authentication, HTTP budgets, server/transport/session objects, ownership and expiry rules, cancellation and close-once cleanup. The composer owns immutable request authority, digest-bound registry/schema preflight and per-call policy followed by live account/domain authorization.
The host's bind must pause new dispatch including initialize, drain old calls
to their existing deadline, register both bridge handlers on every existing
public McpServer.server, clear obsolete bearer state, disable high-level tool
updates, and register all future servers before connect. Drain timeout precedes
mutation; installation failure keeps admission closed with safe 503 responses.
The composer binds once and caches the complete host router. Mount that router
at root to retain /mcp and public protected-resource metadata paths:
const wrapped = await createStatefulMcpNamespace(modules, options);
const plugin = createClusterMeshPlugin({
runtime, namespaces: [wrapped], mounts: { '/mcp': '/' },
});The host alone sees credentials and passes sanitized SDK requests. Domain callbacks receive verified, frozen claims/attributes and combined cancellation; never raw requests, bearer values or an exchange capability. Claim labels must have host-evaluated verified predicates. Protected remote access fails closed until the separately authorized exchange integration. This release does not activate Radar's receiver #865 or its production cutover.
Core qualification uses twelve Immo tools with Mesh 0.21.0 and its transitive
Platform 0.4.0 dependency. The qualified optional variant adds Artifacts 0.1.3,
whose platform peer range is widened to >=0.3.0 <0.5.0, and exposes all 27 tools
through Mesh exports.
The installed consumer lane is
make cluster-mesh-workspace CM_ACTION=stateful-consumer ENV=test-cm-wrap.
Speech configuration (0.23)
resolveClusterMeshConfig accepts optional speechProfiles. The root exports
the schema and resolveSpeechProfiles without loading a provider peer. Import
projectSpeechProfile / rebindSpeechProfile from @sentropic/cluster-mesh/speech
when using the L1 @sentropic/llm-mesh speech contract (0.28). Existing capacity-only
configuration keeps its previous shape.
The speech entry checks >=0.28.0 <0.29.0 and export members through the module
registry before loading the peer; older text-compatible versions receive a typed
cluster_mesh_module_unavailable refusal when speech is requested.
Every profile pins schemaVersion: 1, profile/configuration identity, trusted
tenant/workspace scope, pipeline, coordinator placement, microphone mode and
policy/egress/budget references. Each stage independently selects provider, model,
model revision, adapter/revision, placement, language/voice/region and opaque
account/resource references. There is no provider/model allowlist or default
engine. Credentials belong to gateway custody; account/resource references grant
no admission themselves. The existing agent route still selects the target/model.
import { resolveClusterMeshConfig } from '@sentropic/cluster-mesh';
import { projectSpeechProfile } from '@sentropic/cluster-mesh/speech';
const config = resolveClusterMeshConfig({
capacity: { poolSize: 1 },
speechProfiles: [{
schemaVersion: 1, profileId: 'headset', configRevision: 'revision:1',
tenantId: 'tenant:one', workspaceId: 'workspace:one',
pipeline: 'chained', placement: 'endpoint-native', micMode: 'key',
bindings: {
stt: { providerId: 'local', modelId: 'tiny', modelRevision: 'sha256:PIN_MODEL',
adapterId: 'faster-whisper-ts', adapterRevision: '1.2.1',
placement: 'endpoint-native', language: 'fr', resourceRef: 'resource:endpoint' },
tts: { providerId: 'local', modelId: 'espeak-fr', modelRevision: 'sha256:PIN_VOICE',
adapterId: 'espeak-ng', adapterRevision: 'PIN_ADAPTER',
placement: 'endpoint-native', language: 'fr', resourceRef: 'resource:endpoint' },
},
policyRef: 'policy:voice', egressPolicyRef: 'egress:device', budgetRef: 'budget:voice',
allowedPlacements: ['endpoint-native'], allowedEgress: ['device'],
requiredCapabilities: { stt: ['partialTranscript'] },
inputFormats: [{ codec: 'pcm16-le', sampleRateHz: 16000, channels: 1 }],
outputFormats: [{ codec: 'pcm16-le', sampleRateHz: 16000, channels: 1 }],
maxDurationMs: 60000, maxCostUsd: 0, fallbacks: [],
}],
});
// trustedContext comes from the existing authenticated host, catalogue and route inventory.
const projected = projectSpeechProfile(config.speechProfiles!, {
profileId: 'headset', configRevision: 'revision:1',
contentDigest: config.speechProfiles![0].contentDigest,
}, trustedContext);Replace illustrative artifact pins with qualified immutable identities. These names do not register an engine or certify its license, device, transport or latency. A missing tuple is unavailable; configuration never downloads a model.
chained allows STT-only dictation, TTS-only synthesis or both stages.
native-duplex requires a duplex binding and allows independently selected STT
and TTS alongside it. Every profile has at least one active binding; capability
requirements may refer only to active stages.
Supported placement identifiers are endpoint-native, browser-wasm,
local-companion, cluster-hosted and cloud-relay. Coordinator and individual
stage placements can differ, including cloud STT with local TTS. Key and open-mic
are both selectable; neither configuration nor projection activates the mic.
Web-online, browser-local, h2a-style companion and hosted workers use this same
surface. Remote target attachment remains independent of engine placement.
Projection consumes the existing multi-tuple speech catalogue and negotiates each exact identity, selectors, required capabilities and media. Trusted tenant, workspace, policy, placement, egress and route evidence must agree. An offline local snapshot works without an online app; network-dependent stages are refused offline. Unknown/partial/unsupported required capabilities, ambiguous or absent catalogue entries and unavailable routes return a reason and stage. Projection does not allocate resources, select accounts or replace gateway admission.
Snapshots are cloned and frozen. Unknown fields, credentials/activation fields,
malformed media, duplicate identities, empty stage sets and unpinned latest
revisions are refused. fallbacks is an ordered list of explicit profile/revision
references in the same scope, empty by default. Projection never switches to one
automatically; the client must request it and obtain fresh admission/consent.
Each resolved profile carries a canonical SHA-256 contentDigest. Persist it
with the profile/revision selection and session receipt; projection refuses a
different or missing digest, including after reload. On configuration reload,
pass the host's retained revision history as resolveSpeechProfiles(input,
knownRevisions) to reject changed content under an existing scoped revision.
Retain that history across reloads/restarts; edited content needs a new revision.
Edits apply to new sessions. Explicit rebind requires the current revision,
authoritative quiescence/cancellation/reconciliation/drained-playback evidence
and a new consent revision bound to the selected profile/configuration/digest/egress
policy. A changed profile cannot reuse its old revision. Every successful
projection still reports micEnabled: false and requiresSessionAdmission: true.
It is a configuration receipt, not proof that native work was cancelled.
LLM Mesh Composition with Decision Support
createLlmMeshNamespaceModule supports optional decision hosting via { decision: true }. When decision is omitted or false, decision subpaths are not acquired.
import { Hono } from 'hono';
import { createClusterMeshModules } from '@sentropic/cluster-mesh';
import { createLlmMeshNamespaceModule } from '@sentropic/cluster-mesh/compose/llm-mesh';
const module = await createLlmMeshNamespaceModule(createClusterMeshModules(), {
enabled: true,
decision: true,
createRouter: ({ llmMesh, decisionHost, context, receipts }) => {
const router = new Hono();
// Route handlers use loaded llmMesh and host decision capability (decisionHost) when decision: true
return router;
},
});Correlation & Receipt Neutrality
In test environments (such as lot 1.23 integration tests), the registration gate validates generation policy (generationId). Refusals produce stage verified with decision: 'refused' and code-derived reason: 'generation_mismatch' without emitting an acted stage. Invocation receipts correlate via effectRef convention (receipt:${callId}:metadata), strictly preserving verdict privacy without exposing pass, score, or noul values (production routing and effectRef derivation remain assigned to future host lot 2.08).
