Skip to content
Merged
5 changes: 5 additions & 0 deletions .changeset/contextual-recognition-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@schlessera/brain-ui-react": patch
---

Keep contextual voice discussion out of unsent-fragment notices and composer review while preserving genuine reviewed-mode recovery.
6 changes: 6 additions & 0 deletions .changeset/observed-live-content-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@schlessera/brain-ui-sdk": minor
"@schlessera/brain-ui-server": minor
---

Add a bounded observed content map and proactive repository discovery guidance to both live conversation providers, with one acknowledgement per accepted task.
2 changes: 1 addition & 1 deletion api-report/ui-sdk.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6954,7 +6954,7 @@ signatures (every public export and the types it is made of)
guidance: readonly ConversationGuidance[];
knowledge: readonly {
source: string;
topic: "identity" | "current_focus" | "domains";
topic: "identity" | "current_focus" | "domains" | "content_map";
text: string;
}[];
unavailable: readonly string[];
Expand Down
55 changes: 54 additions & 1 deletion docs/decisions/live-conversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,31 @@ no-replay fences remain in force. The
[additive contract](../integration-contract/package-api.md#live-brain-orientation-and-task-status-additive-3623)
does not qualify the separate #3131/#961 real-provider/device behavior.

## Proactive discovery and observed index map — 2026-11-05 (#3630)

The missing-context guidance above is refined: routine requested retrieval and
repository discovery go to the host without asking the caller to supply paths
or confirm the lookup again. Configurable taxonomy and per-directory
`_index.md` purpose/registry navigation guide ordinary host exploration. Real
semantic/recognition ambiguity, missing capture consent and required effects
or permissions retain their clarification and screen-control boundaries.
Each exact accepted task gets one brief acknowledgement naming its pending
work; running does not renew it or establish backend/tool entry.

Startup additionally supplies an **OBSERVED partial content map** from existing
root/top-level index leads, as data rather than effective runtime taxonomy.
TypeScript config presence cannot suppress the map, and nothing evaluates
config/imports/skills or automatically starts host work. Enumeration and reads
must share the existing policy-held root descriptor: listing a mutable root
path under another root's policy could disclose replacement directory names
even when later source reads are anchored. Platforms without anchored
enumeration withhold this supplemental map. Policy, authorization and root
identity changes preserve the existing withholding boundary. Bounded source
selection and whole-row omissions retain the 3,200-byte orientation and total
startup ceilings; whole selected guidance keeps priority. Limits and source
mapping remain in [the guidance reference](../live-conversation-guidance.md).
This is source/serialization proof, not model obedience or listening proof.

## Selected architecture — 2026-10-04

2026-10-04. The maintainer's [October 3 ruling on #317](https://github.com/schlessera/brain-kit/issues/317#issuecomment-5973820627)
Expand Down Expand Up @@ -67,7 +92,7 @@ posture. A speech provider cannot reinterpret a visual grant, widen an
allowlist, or settle an approval because it generated an answer.

The host resolves pending exchanges when a turn ends
(`drainPendingForTurn`, `packages/ui-server/src/ws/turns.ts:711-745`). The
(`drainPendingForTurn`, `packages/ui-server/src/ws/turns.ts:1030-1053`). The
conversation integration must also reconcile client cards and audible claims;
that server method is not proof of a client receipt. Completion requires host
terminal state plus local playback drained or discarded. Provider generation
Expand Down Expand Up @@ -213,6 +238,34 @@ playback remain distinct; neither a socket send nor an append acknowledgement
proves audible output. Source configuration and keyless fixtures do not qualify
a live account, microphone, interruption, or device.

Contextual recognition remains readable discussion, including after Leave; it
is not an unsent manual task draft. Only genuine reviewed-mode candidates
produce the unsent-fragment notice or move into composer review. Recent context
and retained review have independent finite bounds. Moving recognition is not
submission or resolution of work requested without an input association, so
that separate notice remains truthful.
Unknown-work notices stay with their originating chat or stable draft origin,
including retained-device versions, ordinary accepted composer sends,
retained-dialogue canonicalization and admitted-session adoption; reviewing text does
not resolve them or transfer them to another chat. Their volatile origin
metadata retains at most 128 entries and is cleared at principal/auth
boundaries. The public count projects the selected chat only, without adding
provider input, task admission or durable work state.
A known task's late session identity can bind its notice after Leave without
selecting a chat or authorizing work. Reviewed requests follow notice ownership
into retained aliases before acceptance; their first native binding remains
final even if history is unavailable or returns a canonical owner. A separate
bounded cache keeps the last 128 already-known contextual task identities
across Leave and later entries, without retaining their recognition/submitted
payloads. Only exact conversation/epoch/task/native/request identities can
acquire a late turn and session; unknown inactive receipts cannot introduce
an identity. Principal/auth boundaries and disposal clear this cache.
Ordinary sends transfer the exact accepted draft's origin before consumption
or rotation, regardless of current selection. Correlated owner-history reads
can return a canonical owner, while native-history reads retain their exact
requested session. Stale unsolicited pages cannot change selection or notice
ownership.

Source verification on October 28 used the installed OpenAI Live v1
`DelegationCreatedEvent`, `ThinkingAppendEvent`, `CommentaryAppendEvent` and
matching appended-event declarations, the official [delegation guide](https://developers.openai.com/api/docs/guides/live-delegation)
Expand Down
12 changes: 12 additions & 0 deletions docs/integration-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ same-commit update of the index or relevant authoritative component. How they ar

The reasoning is in [decisions/contract-versioning.md](decisions/contract-versioning.md).

## Observed live content map (additive, 0.45.0, #3630)

`ConversationOrientation.knowledge[].topic` additionally accepts `content_map`:
an observed, explicitly partial map of existing root/top-level directory index
leads, never runtime taxonomy or instruction authority. Both first-party
profiles disclose this transfer at Start. Existing policy-held root anchoring,
authorization, whole-policy omission and startup byte ceilings apply. There is
no new frame, provider seam, automatic task or repository-config execution.
See [the package API](integration-contract/package-api.md#observed-live-content-map-additive-0450-3630),
[the disclosure amendment](integration-contract/wire.md#observed-content-map-disclosure-additive-3630)
and [source mapping and bounds](live-conversation-guidance.md). This ships in a minor.

## Refusals say why (additive, #3431)

A relayed provider request refused by the CLI provider relay keeps its `403`
Expand Down
19 changes: 19 additions & 0 deletions docs/integration-contract/package-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4839,3 +4839,22 @@ host-side. Progress append acknowledgements cannot settle the existing result
acknowledgement promise. Reviewed-only tasks keep their existing admission and
result behavior. The [wire/disclosure amendment](wire.md#live-orientation-disclosure-and-progress-additive-3623)
adds no frame, revision or client permission grant.

## Observed live content map (additive, 0.45.0, #3630)

`ConversationOrientation.knowledge[].topic` gains `content_map`. It carries
source-labeled **OBSERVED partial** directory-index purpose/summary leads as
data, never effective runtime taxonomy, user instruction or authority. All
existing topics and optional opening semantics remain. First-party startup
enumerates/reads a bounded root/top-level sample under the same held root as
provider policy; invalid/restrictive policy, detected root substitution or
authorization loss withholds new repository knowledge. TypeScript config is
never executed and does not disable the observed map. Unsupported anchored
enumeration is an explicit gap. The map precedes supplemental knowledge;
whole selected guidance still wins aggregate pressure. The 3,200-byte
orientation and shared total startup ceilings remain unchanged. Exact source,
count, byte and omission limits are in
[the guidance reference](../live-conversation-guidance.md). Both profiles
[disclose the additional data](wire.md#observed-content-map-disclosure-additive-3630)
before Start; this adds no execution seam or startup host task. This is an
additive minor SDK change, without a model-obedience or acoustic guarantee.
13 changes: 13 additions & 0 deletions docs/integration-contract/wire.md
Original file line number Diff line number Diff line change
Expand Up @@ -2849,3 +2849,16 @@ explanation. A send/append is not a spoken acknowledgement or playback
receipt. Screen-only approvals, stale-result suppression and no replay remain
unchanged. [The guidance reference](../live-conversation-guidance.md) separates
transport proof from real-model judgment and listening qualification.

### Observed content map disclosure (additive, #3630)

Both first-party Start profiles additionally name a bounded **observed partial
content map** from existing directory indexes. The exact disclosed-profile
check still precedes enumeration, reads, epoch replacement and provider open;
an earlier profile cannot silently admit this transfer. The optional SDK
[`content_map` knowledge topic](package-api.md#observed-live-content-map-additive-0450-3630)
adds no wire field, frame, revision, authority or automatic work. Existing
capture consent, task identities, ordinary screen approvals, append-only
history and no replay remain. Exact accepted-task progress asks for one brief
task-specific acknowledgement; running still means host admission, and does
not renew the acknowledgement or establish backend/tool entry.
62 changes: 49 additions & 13 deletions docs/live-conversation-guidance.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ can converse while the ordinary agent retrieves knowledge, captures or updates
notes, researches externally, or does substantial reasoning. Greetings,
clarification and follow-ups answerable from a reliable current result need no
new task. A transcript retained in chat history is not a saved brain note.
An already requested lookup proceeds through the host without asking the caller
for filenames, locations or another confirmation to search. The host discovers
configured taxonomy with normal config inspection, search/list and each
directory's `_index.md` purpose/registry navigation. Real ambiguity in meaning
or recognition, missing capture consent and required effects/permissions still
call for clarification or the existing approval surface. Reliable current
results answer follow-ups without duplicate work.

## Shared guidance and its sources

Expand All @@ -17,7 +24,8 @@ not its entire system prompt.
| --- | --- | --- |
| Core agent contract: Markdown source of truth, disposable index, untrusted imports | Adapted into the shared interaction brief; package instructions | Frontmatter, paths, index maintenance, editing and tool procedures |
| Core `add` skill: thoughts, facts, decisions, updates; existing home before duplicate creation | Adapted into capture recognition and host delegation; package instructions | Type selection, exact write tools, base hashes, capture/update execution |
| `brain-init`: identity/current-focus hot parts and Personal Rules overlay | Selected root guidance is scoped user instruction; canonical/conventional leads are knowledge data | Interview, config execution, taxonomy, other document sections |
| `brain-init`: identity/current-focus hot parts and Personal Rules overlay | Selected root guidance is scoped user instruction; canonical/conventional leads are knowledge data | Interview, config execution, effective runtime taxonomy, other document sections |
| Core contract: per-directory `_index.md` purpose and child registry | Existing root/top-level index purpose/summary leads form an **OBSERVED partial content map**, as knowledge data | Registry tables, deeper directories, configured type/directory resolution and current discovery through host tools |
| Default `BRAIN_UI_SYSTEM_PROMPT_APPEND` / `buildSystemPromptAppend` | Reuses the common interaction brief unchanged | Markdown, diagrams, sharing, renderer details, bridge schemas and turn/subagent lifecycle |
| “Don't narrate tool use” in the typed UI append | Adapted for speech: explicitly acknowledge accepted background work because the listener may not see the timeline | Tool-by-tool narration and detailed execution |
| Configured Claude/Pi `systemPromptAppend` override | Both factories select the same explicit interaction/capture sections into optional `AgentBackend.conversationGuidance`; no whole-prompt copy | Unselected override text and execution/rendering sections |
Expand All @@ -37,12 +45,13 @@ instruction environment has reached the voice service.

Only an authenticated Start with the exact disclosed profile admits reads and
provider transfer. Hello/profile discovery reads no brain context. Disclosure
names selected brain/user guidance, domain names and bounded identity/focus
context in addition to historical text; an old disclosure echo refuses before
the read/open. This applies to reviewed-only and contextual mode alike.
names selected brain/user guidance, domain names, a bounded observed partial
content map and identity/focus context in addition to historical text; an old
disclosure echo refuses before the read/open. This applies to reviewed-only
and contextual mode alike.

The concrete reader is
(`readConversationOrientation`, `packages/ui-server/src/voice/conversation-orientation.ts:48-139`).
(`readConversationOrientation`, `packages/ui-server/src/voice/conversation-orientation.ts:105-201`).
It resolves the selected chat's backend (or the selected/default profile for a
fresh chat), collects its configured projection, and reads the two root
overlays. Selected headings, case-insensitively, are **Personal Rules**,
Expand All @@ -63,13 +72,36 @@ Otherwise the reader examines the conventional candidates `me/identity.md` and
runtime canonical paths were not evaluated. It never executes repository
configuration, follows instruction imports, invokes skills, or makes a
summarization/provider call. A customized TypeScript taxonomy may therefore
need a host lookup. The summary and body before the first level-two heading
form each document's knowledge lead; they are not user instructions.
need a host lookup, and does **not** suppress the observed index map. The
summary and body before the first level-two heading form each document's
knowledge lead; they are not user instructions.

The content map samples the existing root `_index.md` and top-level directory
indexes. It prefers a short summary or purpose paragraph, excluding registry
tables and later sections. Each row names its source path; the map states
**OBSERVED**, **partial**, and **not runtime taxonomy**, along with inspected
root entries, attempted sources, unavailable leads and count/byte omissions.
It supplies navigation leads without inventing default content folders. Gaps
direct host exploration; startup never bootstraps a host task.

On Linux, enumeration opens **the same held root descriptor** used by the
provider-policy and source readers, never the mutable configured root path.
At most **64 root entries** are inspected through a directory stream with a
one-entry buffer; at most **9 indexes** (root plus eight top-level candidates)
are attempted, each capped at **8,192 bytes**, at most **73,728 index bytes**
overall. Candidates within the bounded sample are sorted. An entry cap is
explicit, so the sample does not claim a complete sorted directory inventory.
Hidden/tooling roots, linked directories/files, invalid or overlong names,
deeper indexes and other files are excluded. A source contributes at most a
whole 240-byte purpose/summary lead, and whole rows plus coverage labels fit
**900 bytes**. Missing, malformed, oversized, unreadable or long-only leads
count as unavailable. Without descriptor-relative enumeration on another
platform, the new map is withheld with an explicit host-lookup gap.

Every instruction/context source read is contained in the brain and capped at
65,536 bytes, with the file surface's anchored descriptor reader on Linux.
Policy and source reads share one held root descriptor there, including during
a temporary root replacement restored before the final check. Canonical-root
Policy, enumeration and source reads share one held root descriptor there,
including during a temporary root replacement restored before the final check. Canonical-root
identity and the configured alias are checked during collection; a detected
replacement withholds all new repository orientation. Missing, invalid,
unreadable, escaped or oversized sources become gaps. Repository orientation
Expand All @@ -85,7 +117,9 @@ and eight source-gap labels are considered. Entries have at most 100 source
characters and 900 text bytes. An oversized guidance section is omitted whole;
knowledge may keep whole leading paragraphs within 700 bytes and an explicit
omission marker. Aggregate pressure drops supplemental knowledge before
guidance. `omitted` reports byte/count omissions; `unavailable` and the partial
guidance. The observed map precedes supplemental domain/identity/focus knowledge
so it can survive pressure without displacing complete user guidance.
`omitted` reports byte/count omissions; `unavailable` and the partial
coverage label report source gaps and deliberate exclusions.

Orientation, history and resync share the existing total startup ceilings:
Expand Down Expand Up @@ -128,9 +162,11 @@ can be explained. Failed persistence, withdrawal, replacement or lost authority
cannot emit a later acceptance. A status-send failure ends the epoch without
retry or replay; already dispatched host work retains its ordinary lifecycle.

Both prompts explicitly request a brief spoken acknowledgement **for each
accepted task**, naming the intended background work and its pending state,
then continued conversation. Before feedback, acceptance is unconfirmed.
Both prompts explicitly request **one** brief spoken acknowledgement **for each
accepted task**, naming the intended work as pending, only after exact
acceptance. Running updates do not renew that acknowledgement. The caller
receives no repetitive reminders that conversation can continue; the model
continues listening naturally. Before feedback, acceptance is unconfirmed.
Refused, queued, running and completed states are distinct. A successful
capture/update tool outcome is required before saying information was saved;
host turn completion by itself does not establish that a note exists.
Expand Down
2 changes: 1 addition & 1 deletion docs/plans/chat-history-deletion.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ must be tested through their installed runtime, not inferred from directory name
work/follow-up/retry/approval state, draft edit/send snapshots, handoff summaries,
attachment object URLs and current history selection can expose text. Principal
purge is an existing boundary, not a per-chat deletion API
(`clearPrivateDialogue`, `packages/ui-react/src/voice/conversation-client.ts:533-545`).
(`clearPrivateDialogue`, `packages/ui-react/src/voice/conversation-client.ts:594-607`).
Root-owned IndexedDB answer delivery and account-partitioned local work can retain
answers, drafts or transcripts independently
(`persistent`, `packages/ui-react/src/root.ts:223-246`). Include positively bound
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function ConversationUnassigned({ onReview }: { onReview: () => void }) {
const client = root.connection.conversation;
const sessionId = useStore(root.stores.chat, s => s.activeSessionId);
const retained = useStore(client.state, s => s.unassigned);
const fragments = retained.filter(f => f.sessionId === sessionId);
const fragments = retained.filter(f => !f.taskContext && f.sessionId === sessionId);
const pending = useStore(client.state, s => s.unassignedWork);
if (!fragments.length && !pending) return null;
// An optional control that exists because something happened is an inline
Expand Down
Loading
Loading