Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
01fb689
feat(desktop): support native macOS credentials and diagnostics
happy-v587 Oct 18, 2026
3eedd39
feat(desktop): package macOS app and disk image previews
happy-v587 Oct 18, 2026
317e228
test(desktop): issue fixture certificates for strict TLS verification
happy-v587 Oct 18, 2026
e0e5ae3
style(desktop): format macOS bundle configuration
happy-v587 Oct 18, 2026
cdb361c
fix(desktop): qualify current Server memory workflows
happy-v587 Oct 18, 2026
ad19b65
test(desktop): distinguish product and mock navigation origins
happy-v587 Oct 18, 2026
88482a6
docs(desktop): record macOS installed workflow verification
happy-v587 Oct 18, 2026
95a2ff7
fix(desktop): install pnpm through npm on Intel macOS
happy-v587 Oct 19, 2026
e7e939f
fix(docs): use website-safe desktop reference links
happy-v587 Oct 19, 2026
c10d95a
fix(desktop): override inherited pnpm backend
happy-v587 Oct 19, 2026
173f729
fix(ci): share the pnpm npm backend across tool scopes
happy-v587 Oct 19, 2026
b834f82
fix(desktop): preserve Windows installer Cargo arguments
happy-v587 Oct 19, 2026
1acdaf5
fix(desktop): qualify the updated Server contract
happy-v587 Oct 19, 2026
9112c5b
fix(desktop): bound diagnostic shutdown and sync macOS docs
happy-v587 Oct 19, 2026
270019e
fix(desktop): qualify the v1.4.0 bundled contract
happy-v587 Oct 19, 2026
cd4af11
docs(zh): point macOS preview guide to the cab054db qualification
happy-v587 Oct 19, 2026
d432f37
fix(ci): render Kimi scope script and await macOS fixture readiness
happy-v587 Oct 19, 2026
63b451a
fix(desktop): finish native diagnostics before application exit
happy-v587 Oct 20, 2026
86f4eb5
fix(desktop): serialize diagnostic lifecycle transitions
happy-v587 Oct 21, 2026
a200d60
chore(ci): rerun PR checks
happy-v587 Oct 21, 2026
17754f8
merge: sync master into macOS Desktop preview
hidb4ai Oct 22, 2026
281551b
fix(desktop): preserve process identity until group cleanup
happy-v587 Oct 23, 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
44 changes: 43 additions & 1 deletion .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
working-directory: .
run: uv run --no-sync python desktop/tests/real_cli.py
- name: Build fixture-qualified unsigned internal Windows installer
run: pnpm tauri build --bundles nsis --ci --features ci-fixtures -- --locked
run: pnpm desktop:build:windows:ci
- name: Prepare matching WebView2 driver
run: ./scripts/prepare-webdriver.ps1
- name: Smoke test installed package
Expand Down Expand Up @@ -143,6 +143,48 @@ jobs:
# Still reject missing artifacts when every preceding step succeeded.
if-no-files-found: ${{ job.status == 'success' && 'error' || 'warn' }}

macos:
if: ${{ github.event_name != 'workflow_dispatch' || inputs.installer_run == '' }}
strategy:
fail-fast: false
matrix:
runner: [macos-15, macos-15-intel]
runs-on: ${{ matrix.runner }}
timeout-minutes: 40
defaults:
run:
working-directory: desktop
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: jdx/mise-action@2d8d4cafcbd33be2ea37d2b6f5ad595363d1f1ca # v5.1.1
with:
working_directory: desktop
- run: rustup toolchain install 1.95.0 --profile minimal --component rustfmt --component clippy
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
workspaces: desktop/src-tauri -> target
key: macos-${{ matrix.runner }}
cache-bin: false
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm test
- run: pnpm build
- run: cargo fmt --manifest-path src-tauri/Cargo.toml --check
- run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
- run: cargo test --locked --manifest-path src-tauri/Cargo.toml
- run: pnpm ipc:check
- name: Verify native Keychain across processes
run: cargo run --locked --manifest-path src-tauri/Cargo.toml --example credential_probe
- name: Build unsigned macOS app and DMG
run: pnpm desktop:build
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: desktop-macos-${{ matrix.runner }}-internal-unsigned
path: desktop/src-tauri/target/release/bundle/dmg/*.dmg
if-no-files-found: error

installed-package:
if: ${{ github.event_name == 'workflow_dispatch' && inputs.installer_run != '' }}
runs-on: windows-2025
Expand Down
4 changes: 4 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

[tool_alias]
# Keep the same pnpm layout for root and desktop tools on every supported host.
pnpm = "npm:pnpm"

[tools]
node = "22.19.0"
pnpm = "11.13.1"
39 changes: 37 additions & 2 deletions desktop/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PowerContext Desktop preview

Internal Windows preview for [#1654](https://github.com/oceanbase/powercontext/issues/1654), following RFC #1455. It provides a packaged Tauri 2 shell with Home, Connections, My memories, Chinese/English settings, semantic light/dark/system themes and honest disconnected states. Connection profiles, explicit activation, identity/readiness checks, exact Scope selection and local diagnostics are implemented. Shared note saving, bounded FTS search and exact-version reading are implemented; native workflow qualification remains open.
Internal Windows and macOS preview for [#1654](https://github.com/oceanbase/powercontext/issues/1654), following RFC #1455. It provides a packaged Tauri 2 shell with Home, Connections, My memories, Chinese/English settings, semantic light/dark/system themes and honest disconnected states. Connection profiles, explicit activation, identity/readiness checks, exact Scope selection and local diagnostics are implemented. Shared note saving, bounded FTS search and exact-version reading are implemented; release qualification remains open.

See [中文说明](README.zh.md), [security boundary](SECURITY.md), and [validation guide](VALIDATION.md). This is not a supported or signed release, and does not close #1654 or #1428.

Expand Down Expand Up @@ -117,4 +117,39 @@ Installed boundary checks exercise an 8192-byte Unicode note, reject over-budget

After upgrading from an earlier preview, open Connections and select your saved connection. Profiles matching the bundled API contract appear under “Available for this Desktop build”; compare their tested Server builds with your deployment before selecting one, saving, checking and explicitly using the connection again. New connections start with no compatibility selection.

Historical profiles appear as disabled records. A saved incompatible or unavailable selection remains visible with an explanation until explicitly replaced; it is never silently upgraded. This build currently has no product qualification record matching its bundled contract, so business operations remain unavailable in ordinary builds. The independently qualified `ci-fixtures` build is for disposable acceptance tests. Historical qualification evidence and remaining requirements are documented in the [validation guide](VALIDATION.md).
Historical profiles appear as disabled records. A saved incompatible or unavailable selection remains visible with an explanation until explicitly replaced; it is never silently upgraded. For the qualified current Server sources, explicitly choose `sqlite-atomic-cab054db-v1` and check the connection before selecting a Scope; that record's contract digest matches this build's bundled contract, while `sqlite-atomic-caf2a35a-v1` and `sqlite-atomic-683e2db0-v1` qualify their corresponding Server source deployments and do not match it. The recorded Server source and wheel identities must match the deployment you intend to use. The independently qualified `ci-fixtures` build is for disposable acceptance tests. Historical qualification evidence and remaining requirements are documented in the [validation guide](VALIDATION.md).

## Build on macOS
Comment thread
happy-v587 marked this conversation as resolved.
Resolved

Use macOS 12 or later, Xcode Command Line Tools (`xcode-select --install`), Node **24.14.1**,
Comment thread
happy-v587 marked this conversation as resolved.
Resolved
pnpm **11.13.1**, and Rust **1.95.0**. Build on the target architecture (Apple Silicon or Intel).

```sh
cd desktop
pnpm install --frozen-lockfile
pnpm desktop:dev
# Or build the app bundle and disk image:
pnpm desktop:build
```

The app is in `src-tauri/target/release/bundle/macos/`; the installer is in
`src-tauri/target/release/bundle/dmg/`. Open the DMG and drag the app to Applications.
Launch **PowerContext Desktop Preview**. An independent Server is required for memory operations.
Persistent Bearer credentials use macOS Keychain; session-only storage remains an explicit option.
Removing the app does not remove Server data or Keychain credentials. Remove saved connection profiles
in the app first if their credentials must also be deleted.

Builds are unsigned internal previews. Developer ID signing, notarization, clean-machine Gatekeeper,
accessibility, actual IME input and installed-app Keychain prompts require separate qualification.
The macOS CI jobs test Apple Silicon and Intel builds; their existence is not evidence of a passed run.

macOS local diagnostics read `diagnostic-cli.json` under
`~/Library/Application Support/com.powercontext.desktop.preview/`. Register an absolute executable
named `powercontext`, its SHA-256 digest, and `source: "explicit_local_installation"`, using the same
JSON contract as Windows. A renderer cannot supply the executable or arguments. The native adapter
executes a private read-only copy of the verified launcher. Use a self-contained executable or a
launcher with an absolute interpreter path; launchers that locate dependencies relative to themselves
are unsuitable. The CLI must not depend on a shell profile or an interactive terminal.
Diagnostics keep the existing output limits and deadlines and terminate their private process group
on completion, timeout and cancellation. Before normal application exit, Desktop rejects new diagnostics,
cancels active work and waits for process-group cleanup and launcher reaping. The app does not install or manage a LaunchAgent.
22 changes: 20 additions & 2 deletions desktop/README.zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PowerContext Desktop 预览版

这是 #1654 的内部工程预览。已建立 Tauri 2、React、TypeScript 和 Vite 独立工程,提供首页、连接、我的记忆、双语设置及浅色/深色/系统主题。无连接时保存和搜索不可用,不展示示例业务数据。
这是 #1654 的 Windows 和 macOS 内部工程预览。已建立 Tauri 2、React、TypeScript 和 Vite 独立工程,提供首页、连接、我的记忆、双语设置及浅色/深色/系统主题。无连接时保存和搜索不可用,不展示示例业务数据。

已实现连接配置、显式激活、身份与就绪检查、精确范围选择和本地诊断。已实现共享笔记表单、FTS 搜索和精确版本阅读;原生交互闭环仍待完整验收。当前不是已签名的正式发行版。

Expand Down Expand Up @@ -99,4 +99,22 @@ Windows GitHub Actions 会构建未签名安装包,安装到临时中文路径

从早期预览版升级后,请打开「连接」并选中已保存的连接。与当前 API 契约匹配的配置显示在「此 Desktop 构建可用」中;先核对已测试的 Server 构建与实际部署,再明确选择、保存、检查并使用该连接。新连接默认不选择兼容配置。

历史配置显示为不可选择的记录。已保存的不匹配或不可用配置仍会显示并说明原因,须明确替换,不会静默升级。当前构建尚无匹配打包契约的产品资格记录,因此普通构建暂不开放业务操作。独立验证的 `ci-fixtures` 构建仅用于临时验收测试。历史资格证据和剩余要求见[验证说明](VALIDATION.md)。
历史配置显示为不可选择的记录。已保存的不匹配或不可用配置仍会显示并说明原因,须明确替换,不会静默升级。对于已资格化的当前 Server 源码,明确选择 `sqlite-atomic-cab054db-v1` 并在选取范围前检查连接;该记录的契约摘要与本构建的打包契约匹配,而 `sqlite-atomic-caf2a35a-v1` 与 `sqlite-atomic-683e2db0-v1` 只资格化各自对应 Server 源码的部署,并不匹配打包契约。已记录的 Server 源码和 wheel 身份必须与实际部署一致。独立验证的 `ci-fixtures` 构建仅用于临时验收测试。历史资格证据和剩余要求见[验证说明](VALIDATION.md)。

## 在 macOS 上构建

使用 macOS 12 或更高版本、Xcode 命令行工具(`xcode-select --install`)、Node **24.14.1**、pnpm **11.13.1** 和 Rust **1.95.0**。请在目标架构(Apple Silicon 或 Intel)上构建。

```sh
cd desktop
pnpm install --frozen-lockfile
pnpm desktop:dev
# 或直接构建应用包与磁盘镜像:
pnpm desktop:build
```

应用位于 `src-tauri/target/release/bundle/macos/`,安装镜像位于 `src-tauri/target/release/bundle/dmg/`。打开 DMG 并把应用拖入「应用程序」后启动 **PowerContext Desktop Preview**。记忆操作需要已有独立 Server。Bearer 凭据可持久保存到 macOS 钥匙串,也可显式选择仅本次会话。移除应用不会删除 Server 数据或钥匙串凭据;如需一并删除凭据,请先在应用内移除已保存的连接配置。

构建产物是未签名的内部预览。Developer ID 签名、公证、干净机器上的 Gatekeeper、辅助功能权限、真实输入法输入以及安装版钥匙串弹窗仍需单独验收。macOS CI 任务会测试 Apple Silicon 和 Intel 构建,但任务本身的存在不代表运行已通过。

macOS 本机诊断读取 `~/Library/Application Support/com.powercontext.desktop.preview/diagnostic-cli.json`。登记与 Windows 使用相同的 JSON 契约:绝对路径的 `powercontext` 可执行文件、经核对的 SHA-256 摘要和 `source: "explicit_local_installation"`。渲染进程无法提供可执行文件或参数。原生适配器只执行经过核验的 launcher 的私有只读副本。请使用自包含可执行文件,或解释器路径为绝对路径的 launcher;以自身位置查找依赖的 launcher 不适用。CLI 不能依赖 shell 配置或交互式终端。诊断沿用既有的输出上限与超时,并在完成、超时和取消时终止自己的私有进程组。应用正常退出前会拒绝新诊断、取消当前诊断,并等待进程组清理和 launcher 回收完成。应用不会安装或管理 LaunchAgent。
4 changes: 2 additions & 2 deletions desktop/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Production CSP allows packaged scripts/styles/images and Tauri IPC only, with no

## Secrets and transport

The vault namespace is `com.powercontext.desktop.preview`. A native credential ID is an opaque bounded identifier; it is not an endpoint or a user-controlled vault path. Windows credentials use the OS store only. Unavailable storage returns a stable error; session-only storage is an explicit separate choice. Secret values have zeroizing storage and cannot be serialized or debug formatted. The renderer has no secret readback operation. The synthetic opt-in probe only touches its unique test entry.
The vault namespace is `com.powercontext.desktop.preview`. A native credential ID is an opaque bounded identifier; it is not an endpoint or a user-controlled vault path. Windows credentials use Credential Manager; macOS credentials use Keychain. Unavailable storage returns a stable error; session-only storage is an explicit separate choice. Secret values have zeroizing storage and cannot be serialized or debug formatted. The renderer has no secret readback operation. The synthetic opt-in probe only touches its unique test entry.

The Rust-derived write protocol accepts only `secret` and an explicit `storage` choice (`persistent` or `session_only`). Its input cannot be serialized; the success receipt contains only the storage choice. Missing modes, unknown modes and extra fields are rejected. The native caller supplies the credential ID; the renderer cannot choose a vault address. A failed persistent write produces no success receipt or automatic fallback.

Expand All @@ -30,7 +30,7 @@ Typed adapters separate liveness, readiness, identity and capabilities. Native c
| Response body | 1 MiB, checked both by declared size and streamed bytes |
| Concurrent reads per client | 4; excess fails as busy |

Error responses are enum codes. Transport exception text, endpoint URLs, bodies and credentials are never returned or logged. No product logging, telemetry, crash uploader or persistent business cache is configured. The app does not read databases, start a Server or inspect process environments. Explicit local diagnostics verify a pinned absolute executable and digest, then run one of two native-defined diagnostic commands. Registration requires no version, and legacy version fields are ignored. Diagnostic responses must match the supported output schema. A subsequent fixed `--version` query collects bounded display metadata; failure, unsupported output or an unavailable version does not reject an otherwise valid diagnostic result. Each invocation has a combined 256 KiB output budget and a deadline. Windows helpers enter an owned kill-on-close Job before resuming; raw output is projected to allowlisted status fields and discarded. A local CLI pin does not authenticate its publisher or freeze its Python dependencies; the configured installation must be trusted.
Error responses are enum codes. Transport exception text, endpoint URLs, bodies and credentials are never returned or logged. No product logging, telemetry, crash uploader or persistent business cache is configured. The app does not read databases, start a Server or inspect process environments. Explicit local diagnostics verify a pinned absolute executable and digest, then run one of two native-defined diagnostic commands. Registration requires no version, and legacy version fields are ignored. Diagnostic responses must match the supported output schema. A subsequent fixed `--version` query collects bounded display metadata; failure, unsupported output or an unavailable version does not reject an otherwise valid diagnostic result. Each invocation has a combined 256 KiB output budget and a deadline. Windows helpers enter an owned kill-on-close Job before resuming. macOS runs a read-only snapshot of the digest-verified launcher in a private process group, which is terminated after completion, cancellation or timeout; raw output is projected to allowlisted status fields and discarded. Normal application exit closes diagnostic admission and waits for active worker process cleanup before Tauri exits. A local CLI pin does not authenticate its publisher or freeze its Python dependencies; the configured installation must be trusted.

Tests cover actual TLS fixtures and adversarial HTTP responses, shared loopback policy, mocked Tauri permission resolution with the real capability configuration, navigation rejection, unavailable vault behavior and the explicit session path. The opt-in Windows vault probe separately verifies persistence across processes. See the [validation guide](VALIDATION.md) for packaged checks, CI artifacts and remaining platform qualification.

Expand Down
Loading
Loading