Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6693089
CONTRACT: feat(ui-server): enforce prospective exact-origin trust (#3…
schlessera Nov 20, 2026
69442c1
CONTRACT: fix(safety): fence reviewed origin admissions across public…
schlessera Nov 20, 2026
15b0969
Merge remote-tracking branch 'origin/main' into feat/3609-exact-origi…
schlessera Nov 20, 2026
ca759ce
CONTRACT: fix(safety): bind shared cards to context and preserve trus…
schlessera Nov 20, 2026
071b03c
Merge remote-tracking branch 'origin/main' into feat/3609-exact-origi…
schlessera Nov 20, 2026
a64defe
CONTRACT: fix(ui-react): distinguish mixed source trust and human saf…
schlessera Nov 20, 2026
1bee820
CONTRACT: fix(safety): separate transport approvals and hash verified…
schlessera Nov 20, 2026
7db7c41
test(ui-sdk): type transport approval evidence explicitly
schlessera Nov 20, 2026
9b2bcd7
CONTRACT: fix(safety): enforce IPv6 tunnels and retain last-valid tru…
schlessera Nov 20, 2026
a8d06c2
test(ui-server): preserve selector scheme literal type
schlessera Nov 20, 2026
9ee77b4
CONTRACT: fix(safety): unify live trust observation and cache stable …
schlessera Nov 20, 2026
d97539d
CONTRACT: fix(egress): canonicalize hosts and fence every send indepe…
schlessera Nov 20, 2026
4b63160
fix(egress): reject unmatched brackets in policy host patterns
schlessera Nov 20, 2026
a059103
CONTRACT: docs(api): record independent recipient approval evidence
schlessera Nov 20, 2026
a696ac0
CONTRACT: fix(safety): validate admission evidence and cache only ver…
schlessera Nov 20, 2026
effdbbf
test(ui-react): keep admission fixture discriminants literal
schlessera Nov 20, 2026
9debbdc
CONTRACT: fix(safety): bind unmatched evidence to live snapshot and r…
schlessera Nov 20, 2026
10317b9
test(ui-react): use supported polling assertion options
schlessera Nov 20, 2026
98ddd20
CONTRACT: fix(egress): preserve DNS dial authority and version-one de…
schlessera Nov 20, 2026
7cee719
test(ui-sdk): preserve legacy history fixture literals
schlessera Nov 20, 2026
e9aa817
CONTRACT: fix(egress): cancel queued refresh and discriminate charge …
schlessera Nov 20, 2026
275a7e8
CONTRACT: fix(trust): scope revocation to source rule and validate by…
schlessera Nov 20, 2026
da1ad2b
CONTRACT: fix(trust): retire source instances and unify send decisions
schlessera Nov 20, 2026
556291f
CONTRACT: fix(egress): allow safe completion at exact byte cap
schlessera Nov 20, 2026
0cb7e42
CONTRACT: fix(egress): publish recipient grants only at dispatch
schlessera Nov 20, 2026
697defa
CONTRACT: fix(egress): retain one typed refusal across all callers
schlessera Nov 20, 2026
2407824
CONTRACT: fix(egress): guard the complete operation lifecycle
schlessera Nov 20, 2026
de22a4f
CONTRACT: fix(egress): validate provenance and cancel every dispatch
schlessera Nov 21, 2026
12d9742
CONTRACT: preserve relay failure causes and own terminal cleanup
schlessera Nov 21, 2026
4cc2128
CONTRACT: fence provider sends and preserve cancellation evidence
schlessera Nov 21, 2026
25f5cfd
CONTRACT: preserve upstream status and fence buffered provider responses
schlessera Nov 21, 2026
8a74523
CONTRACT: share relay response accounting and terminal fences
schlessera Nov 21, 2026
33efc12
CONTRACT: publish dispatch facts after transport starts and fence del…
schlessera Nov 21, 2026
c04904a
CONTRACT: fence HTTP connection construction and prove selector retir…
schlessera Nov 21, 2026
2c65093
CONTRACT: preserve route allowance and debit all received overflow
schlessera Nov 21, 2026
feab966
CONTRACT: classify synchronous transport failures before terminal cle…
schlessera Nov 21, 2026
05b59be
CONTRACT: meter received HTTP headers before forwarding filters
schlessera Nov 21, 2026
dd5dc43
CONTRACT: publish egress exposure only after transport construction s…
schlessera Nov 21, 2026
7390bfb
CONTRACT: bind recipient receipts to dispatch and share admission val…
schlessera Nov 21, 2026
992d3cb
CONTRACT: meter relay request heads before filtering
schlessera Nov 21, 2026
8edc030
CONTRACT: preserve legacy egress routes and meter interim HTTP heads
schlessera Nov 21, 2026
11f56e9
CONTRACT: require durable occurrence confirmation before trusted disp…
schlessera Nov 21, 2026
2edb58d
CONTRACT: preserve own-input approvals and classify peer recorder cha…
schlessera Nov 21, 2026
adb2ac2
CONTRACT: retain dispatched session grants and preserve outward callb…
schlessera Nov 21, 2026
7ec9e9d
CONTRACT: preserve shared-card approvals and inference refusal compat…
schlessera Nov 21, 2026
d56683c
test: preserve compatible inference text at relay boundaries
schlessera Nov 21, 2026
b4e2b92
CONTRACT: exclude exact shared-card peer write reservations
schlessera Nov 21, 2026
7ec3df2
Merge remote-tracking branch 'origin/main' into feat/3609-exact-origi…
schlessera Nov 21, 2026
1b58adb
CONTRACT: preserve refusal causes through session binding
schlessera Nov 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .changeset/exact-origin-trust.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
"@schlessera/brain-ui-server": minor
"@schlessera/brain-ui-sdk": minor
"@schlessera/brain-ui-react": minor
---

Enforce prospective exact-origin and explicit-tunnel source trust with separate restricted-recipient permission. This pre-1.0 semantic break lets qualified future inputs avoid unresolved triggers while retaining their historical rule, policy hash and revision. Removing a rule fences active admissions and interrupts trusted input streams; repository trust remains unavailable. Existing triggers, independent controls and provider history are preserved.

Bind pending Network approvals to actual transport identity and record the hash of freshly verified valid policy bytes even when trust rules are unchanged.

Enforce canonical bracketed IPv6 tunnels, retain last-valid live trust on bounded policy read failures, and prove DNS subdomains cannot inherit parent trust.

Classify live trust observations consistently: stable invalid or unreadable policy retains last-valid rules with an error, verification races fence, and unchanged chunks use metadata generation checks instead of full policy reads. Refresh rechecks after its durable write.

Normalize all transport host identities, recheck send authority on every HTTP write/end and tunnel chunk, and retain explicit recipient approvals independently of source trust.

Validate complete trusted admission variants on the wire, avoid absent-approval and unchanged-stream evidence scans with live change counters, and let independent readers recover after projection publication races.

Record unmatched source hash and revision from the same live snapshot used for matching, and display IPv6 provenance with bracketed authorities.

Preserve absolute DNS authorities during resolution/dialing separately from comparison keys, and retain the version-1 detector ID contract while strictly validating admission evidence.

Cancel queued turn-start trust refreshes with the turn signal, and distinguish budget, safety and unavailable charge results across proxy, inference/provider relays and managed reference acquisition.

Revalidate only an active input’s admitted source rule across trust revisions, unify source revocation audit/safety results, and reject invalid byte counts before either charge counter changes.

Retire source-rule instances durably across independent publishers, preserve typed commit/charge failures on managed streams, and classify post-write source revocation identically to notification and send fences.

Allow HTTP and tunnel completion exactly at the byte ceiling while preserving terminal safety checks and refusing bytes beyond it.

Separate preparation byte charging from dispatch notification and contacted-host grants, classify initial recording loss as unavailable, and preserve historical IPv6 session grants through canonical host lookup.

Capture one immutable typed refusal per egress operation before abort, preserve it through every caller and audit record, and fence outward exemptions with the active call-classification generation.

Guard the concrete proxy lifecycle through pending, admitted, dispatched and terminal states; distinguish exhausted new dispatch from exact-cap stream completion, fence closed wait continuations, and release all per-operation admission keys after terminal evidence.

Validate destination provenance through the wire schema before durable writes, cancel every upstream cleanup/request with its operation and deadline, and preserve unavailable classifications through repeated inference admission.

Capture relay error causes before terminal signal cleanup, preserve failed versus cancelled receipts and statuses across every response path, and release caller listeners from every operation termination path.

Preserve provider cancellation reasons, fence sends after preparation observers, and meter Files cleanup response headers.

Keep provider receipt status as upstream evidence and fence buffered response release at EOF.

Share relay response metering and EOF fencing across normal, Files, redirect and cleanup paths.

Separate preparation from actual dispatch facts and fence streaming delivery in the same synchronous handoff.

Fence upstream HTTP request construction and prove in-place selector edits retire source instances.

Require remaining allowance on every governed web/relay route and debit received overflow consistently across proxy and relay traffic.

Preserve ordinary upstream-failure classification for synchronous transport handoff errors.

Meter raw proxy header pairs and all observable Fetch headers before forwarding filters; clarify the conservative HTTP wire bound.

Publish dispatched exposure and contacted-host grants only after the transport constructor or fetch call returns successfully; synchronous construction failures remain upstream failures without granting recipient permission.

Bind recipient receipts to the final dispatch authority and share verified, bounded admission validation between durable ingestion, projection and history, including retained provenance after pruning.

Meter relay worker request headers before filtering and cover upstream credential/header growth with the same shared head meter.

Add remainingBytes as an optional SDK route reader, preserving older operation-only routes with a documented 32 MiB per-request compatibility ceiling; host builders require it internally. Meter informational HTTP response heads before the final response.

Require a confirmed durable occurrence before trusted dispatch; false or failed source writes refuse the affected operation as recording unavailable, including permanently restricted turns and legacy recorder adapters.

Keep an approved connection valid across the occurrence and initial collection writes of every peer admitted under that same Network card. Independent evidence still fences dispatch. Restore safety-changed 403 for peer recorder loss or independent pending input while preserving operation-specific recorder-unavailable 503. Preserve the fixed inference refusal wire message and its stored-history classification, keeping detailed causes in host-only denialReason. Document all optional egress receipt fields.

Preserve a committed explicit session recipient grant across later input without relaxing the first-dispatch fence. Keep outward callback payloads compatible and align peer-loss audit/status assertions and received-header byte-cap expectations with their contract.

Keep shared-card peer admissions usable with the real governance writer: exclude only their exact owned local/durable pending reservations from approval freshness and recording-availability fences. Independent pending input, recorder failures and capacity remain enforced; global safety projections and history remain unchanged.

Preserve typed refusal causes through session-binding settlement: revoked authority answers 403 safety_changed, an aborted wait is cancelled, and genuinely pending/failed/missing binding remains 503 unavailable. Native Pi credential-error assertions follow the existing 502 failed-attempt contract without changing the relay.
89 changes: 89 additions & 0 deletions api-report/ui-sdk.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,10 @@ export "./internal" (./src/internal.ts)
type CompiledWorkerCommandPolicy
DEFAULT_TURN_TEMP_BYTES
EgressAdmissionRefused
type EgressChargeFailure
type EgressChargeResult
type EgressDestinationPolicy
type EgressFailureReason
type EgressRecord
type EgressRefusal
FIRST_PARTY_PROVIDER_RECIPIENTS
Expand Down Expand Up @@ -1491,6 +1494,7 @@ export "./internal" (./src/internal.ts)
assertManagedTurnStartupView
assertScratchMaskAsync
bashCommand
canonicalEgressHost
canonicalModelId
claudeMaskFilename
claudeReportedMaskPath
Expand All @@ -1510,6 +1514,7 @@ export "./internal" (./src/internal.ts)
describeClient
egressAddressRefusal
egressBootstrapEntry
egressChargeRefusal
envMaskedPaths
execWrapperSpawnOptions
handleTurnTemp
Expand Down Expand Up @@ -1586,6 +1591,9 @@ export "./internal" (./src/internal.ts)
runMaintenanceWorker
runMaintenanceWorkerSync
safetyAdmissionRefusal
safetyAdmissionSchema
safetyOccurrenceAdmissionSchema
safetyRecordSchema
sameSafetyAdmission
sessionPromptContext
sessionPromptContextLocation
Expand All @@ -1597,6 +1605,7 @@ export "./internal" (./src/internal.ts)
stripHostContextFromTitle
turnTempLimit
turnTempSpace
validatedEgressProvenance
verifiedWorkerIdentity
webSearchBrief
webSearchKeySource
Expand Down Expand Up @@ -15306,6 +15315,7 @@ signatures (every public export and the types it is made of)
export interface WebModelEgress {
dir: string;
inference(method: string, target: URL, signal: AbortSignal): unknown;
remainingBytes?(): number;
}
WebModelGrant (packages/ui-sdk/src/tool-contracts/web.ts)
export interface WebModelGrant {
Expand Down Expand Up @@ -16271,6 +16281,7 @@ signatures (every public export and the types it is made of)
}>;
}, z.core.$strict>, z.ZodObject<{
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
includeAdmissions: z.ZodOptional<z.ZodLiteral<true>>;
includeEntries: z.ZodOptional<z.ZodLiteral<true>>;
limit: z.ZodOptional<z.ZodNumber>;
requestId: z.ZodString;
Expand Down Expand Up @@ -16437,6 +16448,7 @@ signatures (every public export and the types it is made of)
clientSafetyReadSchema (packages/ui-sdk/src/safety.ts)
const clientSafetyReadSchema: z.ZodObject<{
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
includeAdmissions: z.ZodOptional<z.ZodLiteral<true>>;
includeEntries: z.ZodOptional<z.ZodLiteral<true>>;
limit: z.ZodOptional<z.ZodNumber>;
requestId: z.ZodString;
Expand Down Expand Up @@ -21302,6 +21314,17 @@ signatures (every public export and the types it is made of)
unresolvedCount: z.ZodNumber;
}, z.core.$strict>;
records: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
admission: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
policyHash: z.ZodNullable<z.ZodString>;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<false>;
}, z.core.$strict>, z.ZodObject<{
collectionRevision: z.ZodString;
policyHash: z.ZodString;
ruleId: z.ZodString;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<true>;
}, z.core.$strict>], "trusted">>;
bindingId: z.ZodString;
detailPruned: z.ZodBoolean;
detector: z.ZodNullable<z.ZodString>;
Expand Down Expand Up @@ -21448,6 +21471,17 @@ signatures (every public export and the types it is made of)
}, z.core.$strict>;
safetyRecordSchema (packages/ui-sdk/src/safety.ts)
const safetyRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
admission: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
policyHash: z.ZodNullable<z.ZodString>;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<false>;
}, z.core.$strict>, z.ZodObject<{
collectionRevision: z.ZodString;
policyHash: z.ZodString;
ruleId: z.ZodString;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<true>;
}, z.core.$strict>], "trusted">>;
bindingId: z.ZodString;
detailPruned: z.ZodBoolean;
detector: z.ZodNullable<z.ZodString>;
Expand Down Expand Up @@ -21945,6 +21979,17 @@ signatures (every public export and the types it is made of)
unresolvedCount: z.ZodNumber;
}, z.core.$strict>;
records: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
admission: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
policyHash: z.ZodNullable<z.ZodString>;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<false>;
}, z.core.$strict>, z.ZodObject<{
collectionRevision: z.ZodString;
policyHash: z.ZodString;
ruleId: z.ZodString;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<true>;
}, z.core.$strict>], "trusted">>;
bindingId: z.ZodString;
detailPruned: z.ZodBoolean;
detector: z.ZodNullable<z.ZodString>;
Expand Down Expand Up @@ -26856,6 +26901,17 @@ signatures (every public export and the types it is made of)
unresolvedCount: z.ZodNumber;
}, z.core.$strict>;
records: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
admission: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
policyHash: z.ZodNullable<z.ZodString>;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<false>;
}, z.core.$strict>, z.ZodObject<{
collectionRevision: z.ZodString;
policyHash: z.ZodString;
ruleId: z.ZodString;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<true>;
}, z.core.$strict>], "trusted">>;
bindingId: z.ZodString;
detailPruned: z.ZodBoolean;
detector: z.ZodNullable<z.ZodString>;
Expand Down Expand Up @@ -27014,6 +27070,17 @@ signatures (every public export and the types it is made of)
unresolvedCount: z.ZodNumber;
}, z.core.$strict>;
records: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
admission: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
policyHash: z.ZodNullable<z.ZodString>;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<false>;
}, z.core.$strict>, z.ZodObject<{
collectionRevision: z.ZodString;
policyHash: z.ZodString;
ruleId: z.ZodString;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<true>;
}, z.core.$strict>], "trusted">>;
bindingId: z.ZodString;
detailPruned: z.ZodBoolean;
detector: z.ZodNullable<z.ZodString>;
Expand Down Expand Up @@ -27693,6 +27760,17 @@ signatures (every public export and the types it is made of)
unresolvedCount: z.ZodNumber;
}, z.core.$strict>;
records: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
admission: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
policyHash: z.ZodNullable<z.ZodString>;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<false>;
}, z.core.$strict>, z.ZodObject<{
collectionRevision: z.ZodString;
policyHash: z.ZodString;
ruleId: z.ZodString;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<true>;
}, z.core.$strict>], "trusted">>;
bindingId: z.ZodString;
detailPruned: z.ZodBoolean;
detector: z.ZodNullable<z.ZodString>;
Expand Down Expand Up @@ -27867,6 +27945,17 @@ signatures (every public export and the types it is made of)
unresolvedCount: z.ZodNumber;
}, z.core.$strict>;
records: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
admission: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
policyHash: z.ZodNullable<z.ZodString>;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<false>;
}, z.core.$strict>, z.ZodObject<{
collectionRevision: z.ZodString;
policyHash: z.ZodString;
ruleId: z.ZodString;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<true>;
}, z.core.$strict>], "trusted">>;
bindingId: z.ZodString;
detailPruned: z.ZodBoolean;
detector: z.ZodNullable<z.ZodString>;
Expand Down
30 changes: 27 additions & 3 deletions api-report/ui-server.txt
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,15 @@ signatures (every public export and the types it is made of)
}>;
bytes: z.ZodNumber;
connectionId: z.ZodOptional<z.ZodString>;
dispatched: z.ZodOptional<z.ZodBoolean>;
durationMs: z.ZodNumber;
failureReason: z.ZodOptional<z.ZodEnum<{
budget: "budget";
cancelled: "cancelled";
policy_denied: "policy_denied";
safety_changed: "safety_changed";
unavailable: "unavailable";
}>>;
host: z.ZodString;
inference: z.ZodOptional<z.ZodLiteral<true>>;
managedReference: z.ZodOptional<z.ZodLiteral<true>>;
Expand All @@ -693,6 +701,16 @@ signatures (every public export and the types it is made of)
port: z.ZodNumber;
provider: z.ZodOptional<z.ZodLiteral<true>>;
reason: z.ZodOptional<z.ZodString>;
recipientAdmission: z.ZodOptional<z.ZodObject<{
collectionRevision: z.ZodString;
instance: z.ZodOptional<z.ZodString>;
policyHash: z.ZodString;
ruleId: z.ZodString;
trustRevision: z.ZodString;
}, z.core.$strict>>;
recipientApproved: z.ZodOptional<z.ZodLiteral<true>>;
standingRecipient: z.ZodOptional<z.ZodLiteral<true>>;
trustedSource: z.ZodOptional<z.ZodLiteral<true>>;
}, z.core.$strict>;
version: number;
};
Expand Down Expand Up @@ -1073,11 +1091,17 @@ signatures (every public export and the types it is made of)
payload: z.ZodObject<{
detail: z.ZodNullable<z.ZodString>;
occurrence: z.ZodOptional<z.ZodObject<{
admission: z.ZodOptional<z.ZodObject<{
admission: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
policyHash: z.ZodNullable<z.ZodString>;
trustRevision: z.ZodLiteral<"0">;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<false>;
}, z.core.$strict>>;
}, z.core.$strict>, z.ZodObject<{
collectionRevision: z.ZodString;
policyHash: z.ZodString;
ruleId: z.ZodString;
trustRevision: z.ZodString;
trusted: z.ZodLiteral<true>;
}, z.core.$strict>], "trusted">>;
detector: z.ZodEnum<{
attachment_input: "attachment_input";
compute_input: "compute_input";
Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/async-collaboration.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ costs or a provider-enforced spend ceiling.
Narrower per-request relay accounting is not selected for v1. The current
observer reports method, path, outcome and status, with no trusted token or
cost bound (`InferenceRelayEvent`,
`packages/ui-sdk/src/server/inference-relay.ts:47-55`). Completed-response
`packages/ui-sdk/src/server/inference-relay.ts:55-63`). Completed-response
snapshots cannot bound a pre-header continuation's input, output, cache usage
or hidden requests. A smaller fraction, historical average, guessed zero or
clipping below known spend would invent evidence. Revisit narrower accounting
Expand Down
Loading
Loading