Skip to content
Merged
5 changes: 5 additions & 0 deletions .changeset/3613-approved-owner-read-resolution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@schlessera/brain-ui-server": patch
---

Bind immutable read identity evidence to independently published Settings owner approval. Record unavailable qualification for missing or mismatched approval, repository transfer/name reuse and replaced policy roots, and recheck inside the write transaction after waits. Bind publication to the qualified native filesystem and live-brain subvolume UUID, preserving ordinary restart while refusing recreated roots and unqualified hosts. Source trust remains disabled.
5 changes: 5 additions & 0 deletions .changeset/egress-upstream-socket-ownership.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@schlessera/brain-ui-sdk": patch
---

Give each cleartext HTTP proxy operation its own non-pooled upstream connection so a stale same-origin socket cannot produce a spurious 502. Preserve cancellation, admission fences and byte accounting without retrying requests.
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.
5 changes: 5 additions & 0 deletions .changeset/full-journal-receipt-recovery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@schlessera/brain-ui-server": patch
---

Keep the host available when a full journal defers startup receipt recovery. Retain unchanged recovery rows, record the cause in journal cleanup status, and retry on the next open with headroom.
5 changes: 5 additions & 0 deletions .changeset/trust-refresh-admission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@schlessera/brain-ui-server": patch
---

Keep turn admission independent of a running index when the verified policy hash already matches the healthy durable trust projection. Changed or unavailable policy still refreshes under the cancellable brain lock.
89 changes: 89 additions & 0 deletions api-report/ui-sdk.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,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 @@ -1504,6 +1507,7 @@ export "./internal" (./src/internal.ts)
assertManagedTurnStartupView
assertScratchMaskAsync
bashCommand
canonicalEgressHost
canonicalModelId
claudeMaskFilename
claudeReportedMaskPath
Expand All @@ -1523,6 +1527,7 @@ export "./internal" (./src/internal.ts)
describeClient
egressAddressRefusal
egressBootstrapEntry
egressChargeRefusal
envMaskedPaths
execWrapperSpawnOptions
handleTurnTemp
Expand Down Expand Up @@ -1600,6 +1605,9 @@ export "./internal" (./src/internal.ts)
runMaintenanceWorker
runMaintenanceWorkerSync
safetyAdmissionRefusal
safetyAdmissionSchema
safetyOccurrenceAdmissionSchema
safetyRecordSchema
sameSafetyAdmission
sessionPromptContext
sessionPromptContextLocation
Expand All @@ -1611,6 +1619,7 @@ export "./internal" (./src/internal.ts)
stripHostContextFromTitle
turnTempLimit
turnTempSpace
validatedEgressProvenance
verifiedWorkerIdentity
webSearchBrief
webSearchKeySource
Expand Down Expand Up @@ -15411,6 +15420,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 @@ -16385,6 +16395,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 @@ -16551,6 +16562,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 @@ -21425,6 +21437,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 @@ -21571,6 +21594,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 @@ -22068,6 +22102,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 @@ -27160,6 +27205,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 @@ -27318,6 +27374,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 @@ -27997,6 +28064,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 @@ -28171,6 +28249,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 @@ -699,7 +699,15 @@ signatures (every public export and the types it is made of)
connectionId: z.ZodOptional<z.ZodString>;
credentialMs: z.ZodOptional<z.ZodNumber>;
dispatchMs: z.ZodOptional<z.ZodNumber>;
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";
}>>;
firstChunkMs: z.ZodOptional<z.ZodNumber>;
headersMs: z.ZodOptional<z.ZodNumber>;
host: z.ZodString;
Expand All @@ -718,6 +726,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 @@ -1100,11 +1118,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
Loading
Loading