origin value. The persisted
field keeps its historical name, but its schema and type are operationSourceSchema
and OperationSource in
@monad/protocol.
OperationSource is provenance and routing context:
surfaceis the coarse, closed product surface.clientis the concrete open identifier, such asmonad-web,monad-cli,telegram,zed, orvscode.clientVersionidentifies the client build when known.instanceIddistinguishes configured instances of one client, such as a channel configuration ID.transportis the server-stamped semantic ingress class. It is not the physical TCP-versus-Unix-socket choice.
SessionOrigin access arrays, environment snapshot, and open extension
bag were removed. Do not add writableBy, branchableBy, env, or ext back to this
contract. Environment data included unnecessary PII; open extension data had no stable
domain meaning; per-session transport arrays incorrectly made provenance look like an
authorization identity.
Stamping boundary
Clients may suggest only bounded identity fields accepted bycreateOperationSourceHintSchema. The transport controller constructs the complete
value with buildOperationSource; callers never choose their own transport.
A branch is stamped from the ingress that creates the branch, rather than copying the
parent’s source. Channel operator guidance is built as turn-local
ambientContext; it
is not persisted in origin.
Authority boundary
The durable contract remains provenance-only. Connection admission, tool approval, and scoped runtime capabilities own authorization. There is currently one explicit containment exception:assertTransportAuthority
uses the server-stamped origin.transport on five session write/branch entry points.
It prevents one semantic transport from mutating another transport’s session until the
trusted-native versus model-child capability boundary is complete. It is intentionally
stricter than the removed arrays, has no client override, and must not grow into a
general identity or RBAC system. Sessions without an origin retain legacy behavior;
automation-origin sessions reject transport writes.
Tests:
session-write-policy.test.ts
and
session-transport-authority.test.ts.