diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 962eaf0f83..1ca39975a6 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -77,7 +77,7 @@ The result kernel contains only score, normalized usage, attributable cost, dura ## Reading paths - Host ownership, admission, observation, Client isolation and lifecycle: [Runtime Host architecture](./docs/architecture/runtime-host-architecture.md). -- Proposed Desktop conversation projection design (Chinese; not yet implemented): [Host-owned conversation lifecycle](./docs/architecture/desktop-conversation-host-projection.zh-CN.md). +- Desktop conversation projection: Host-owned execution facts for the main conversation, Side Chat, and WorkHub (Chinese): [Host-owned conversation lifecycle](./docs/architecture/desktop-conversation-host-projection.zh-CN.md). - Network identity, membership, path selection and stream recovery: [Peer Mesh architecture](./docs/architecture/peer-mesh-architecture.md). - Runtime facts and projections: [Runtime core](./docs/architecture/runtime-core-architecture-draft.md) and [compaction](./docs/architecture/llm-compaction-events-log-projection-draft.md). - Crash recovery and continuation: [Runtime resume](./docs/architecture/runtime-resume-architecture.md). diff --git a/ARCHITECTURE.zh-CN.md b/ARCHITECTURE.zh-CN.md index 7cc86e8ead..247a6ed8ea 100644 --- a/ARCHITECTURE.zh-CN.md +++ b/ARCHITECTURE.zh-CN.md @@ -77,6 +77,7 @@ continuation = Maka subject 内部的 Runtime Host 行为 ## 阅读路径 - Host 权责、准入、观察、Client 隔离与生命周期:[Runtime Host 架构](./docs/architecture/runtime-host-architecture.zh-CN.md)。 +- Desktop 对话投影:主对话、Side Chat、WorkHub 以 Host 执行事实为准:[以 Host 投影为唯一执行依据](./docs/architecture/desktop-conversation-host-projection.zh-CN.md)。 - 网络身份、成员关系、路径选择与 stream 恢复:[Peer Mesh 架构](./docs/architecture/peer-mesh-architecture.zh-CN.md)。 - Runtime 事实与 projection:[Runtime core](./docs/architecture/runtime-core-architecture-draft.zh-CN.md) 与 [compaction](./docs/architecture/llm-compaction-events-log-projection-draft.zh-CN.md)。 - Crash recovery 与 continuation:[Runtime resume](./docs/architecture/runtime-resume-architecture.zh-CN.md)。 diff --git a/SECURITY.md b/SECURITY.md index d5c1c575ca..5e52a3e02f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -208,9 +208,10 @@ privacy commitments: consumer tests own the full enforcement inventory. - **Token boundary.** Cleartext API keys / OAuth tokens / bot tokens NEVER cross the main→renderer IPC boundary. - `apps/desktop/src/main/__tests__/web-search-boundary.test.ts` and - `claude-subscription-ipc-boundary.test.ts` enforce this for Tavily - and Claude subscription credentials. + `apps/desktop/src/main/__tests__/settings-ipc-helpers.test.ts` enforces + this for Tavily and bot credentials, and + `runtime-host-connections-ipc-main.test.ts` for Connection credentials + (including OAuth subscriptions and custom headers). ## 3. Scope of vulnerability reports @@ -262,9 +263,9 @@ Credential-test requests may submit an unsaved cleartext token so the user can verify it before saving. The main process accepts it for that single request and does not echo it in the response. -The static-analysis contract tests for this policy: -- `apps/desktop/src/main/__tests__/web-search-boundary.test.ts` -- `apps/desktop/src/main/__tests__/claude-subscription-ipc-boundary.test.ts` +The contract tests for this policy: +- `apps/desktop/src/main/__tests__/settings-ipc-helpers.test.ts` +- `apps/desktop/src/main/__tests__/runtime-host-connections-ipc-main.test.ts` ## 5. Versioning diff --git a/docs/tui-live-ctx-updates.md b/docs/tui-live-ctx-updates.md index 28653a3f62..bb2ab575a5 100644 --- a/docs/tui-live-ctx-updates.md +++ b/docs/tui-live-ctx-updates.md @@ -19,7 +19,7 @@ # TUI live ctx updates (#4545) -Status: design. Issue: https://github.com/apache/maka/issues/4545 +Status: implemented in [#4550](https://github.com/apache/maka/pull/4550) (`packages/cli/src/tui-context-refresh.ts`). Issue: https://github.com/apache/maka/issues/4545 ## Problem @@ -50,7 +50,7 @@ Every claim below was verified against `main` (`6c632b1339`). | 6 | The Host commits a latest-context snapshot at **every provider request settlement** (each LLM step), carrying `inputTokens` and `contextWindow` | `packages/runtime/src/provider-request-telemetry.ts` `finalize` → `emitModelCallAttempt` → `accounting.record({ attempt, latestContext })` (~L469–640); `packages/runtime/src/latest-context-snapshot.ts` | | 7 | The commit is awaited **before** the `finish` part is enqueued to the consumer, so any UI event that follows the step (e.g. `tool_start`) observes the snapshot already durable — no read race | `packages/runtime/src/provider-request-telemetry.ts` stream `pull` handler ~L368–390 | | 8 | `context.diagnostics.query` is a plain read: header snapshot + run-store projection read; no execution authority, no busy gate | `packages/runtime-host/src/server/context-coordinator.ts` `#queryDiagnostics`; spec `mode: 'query'` in `packages/runtime-host/src/protocol/context.ts` L107–117 | -| 9 | The desktop inspector subscribes to the live session event stream and re-reads the diagnostics on trace-relevant events (`tool_start`, `tool_result`, `token_usage`, `provider_retry`, `error`, `complete`, `abort`), coalesced at 400 ms; a failed re-read leaves the last value standing | `apps/desktop/src/renderer/session-trace-refresh.ts` L21–37; `apps/desktop/src/renderer/features/workbar/tools/inspector/use-session-trace.ts` L59 (`TRACE_REFRESH_DEBOUNCE_MS = 400`), L255–274 | +| 9 | The desktop inspector subscribes to the live session event stream and re-reads the diagnostics on trace-relevant events (`tool_start`, `tool_result`, `token_usage`, `provider_retry`, `error`, `complete`, `abort`), coalesced at 400 ms; a failed re-read leaves the last value standing | `apps/desktop/src/renderer/features/workbar/tools/inspector/session-trace-refresh.ts` L21–37; `apps/desktop/src/renderer/features/workbar/tools/inspector/use-session-trace.ts` L59 (`TRACE_REFRESH_DEBOUNCE_MS = 400`), L255–274 | | 10 | Desktop derives the bar as `used = inputTokens`, `ratio = used / contextWindow`, from the snapshot alone | `session-inspector-overview-model.ts` `contextBudget()` ~L210–241 | | 11 | The TUI driver already exposes the same query; the TUI always talks to the Host | `packages/cli/src/runtime-host-session-driver.ts` L1117 (`getContextDiagnostics`); interface `packages/cli/src/session-driver.ts` L230 (optional) | | 12 | The TUI runner's `onEvent` sees every live event mid-turn | `packages/cli/src/pi-tui-runner.ts` L1455–1483 |