Skip to content

feat(desktop): add macOS native preview support - #2056

Merged
AlexStocks merged 22 commits into
oceanbase:masterfrom
happy-v587:codex/desktop-macos
Oct 23, 2026
Merged

AlexStocks merged 22 commits into
oceanbase:masterfrom
happy-v587:codex/desktop-macos

Conversation

@happy-v587

@happy-v587 happy-v587 commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Which issue or RFC does this PR close?

Refs #1654; follows RFC #1455. This internal preview does not close the platform or release qualification issues.

Rationale for this change

The Windows-oriented Desktop preview lacked macOS persistent credentials, packaged-page navigation, native diagnostic execution and app/DMG packaging. Ordinary builds also needed an explicitly qualified Server profile matching the bundled API contract.

What changes are included in this PR?

  • Add macOS Keychain and packaged-page navigation while preserving explicit session-only storage and native authorization boundaries.
  • Execute registered diagnostic launchers from digest-verified snapshots, with output limits, cancellation, deadlines and application-exit cleanup. One lifecycle mutex owns admission and completion. On macOS, exit observation retains the child PID until the private process group is terminated:
    waitid(WNOWAIT) -> terminate process group -> wait/reap -> collect bounded output
    
  • Add app/DMG packaging, canonical ICNS resources and Apple Silicon/Intel CI alongside Windows validation. Document JDK 11+ and first-run Maven Central access; pin libc to the locked version.
  • Preserve immutable Server qualification records. The current bundled contract matches sqlite-atomic-d9a78567-v1, identifying Server commit d9a785675dedb72cd72a386b346e590f4c067ac0 and OpenAPI digest a6758fd35296abefb55ab86b152584a369d5f2deedfee7a3f9822e16ad1edc25.

Are there any user-facing changes?

macOS users can build the unsigned native preview, use Keychain or explicit session-only credentials, run constrained local diagnostics, and explicitly select a compatible Server and exact Scope for memory operations. Desktop does not install or manage a Server or LaunchAgent.

The current Server record has protocol-level qualification on Linux x86_64. Native macOS UI acceptance against that record remains unverified. Historical UI acceptance for sqlite-atomic-caf2a35a-v1 is separately identified in desktop/VALIDATION.md; it is not evidence for the current bundled contract. Signing, notarization, clean-machine installation, actual IME composition and accessibility remain release gates.

How was this change tested?

  • The process-identity regression failed with the original try_wait() behavior (ECHILD: the child had already been reaped). It passes with waitid(WNOWAIT), proving the exited child remains waitable until process-group cleanup. Existing tests cover nonzero exit, cancellation, timeouts, descendants and escaped pipe writers.
  • On macOS ARM64, cargo +1.95.0 test --locked --manifest-path desktop/src-tauri/Cargo.toml passed 61 tests. Cargo fmt and Clippy (--all-targets -- -D warnings) passed.
  • UV_NO_SYNC=1 make check and git diff --check passed. The exact libc constraint requires no Cargo.lock change and locked Rust builds pass.
  • Recorded current-contract qualification exercised the isolated SQLite Server wheel in anonymous loopback, Bearer, HTTPS with explicit CA/base path, and enforced-provider modes. All 537 runtime files matched Server commit d9a78567 byte for byte. This ran on Linux x86_64 with Python 3.12.13 and Rust 1.95.0, excluding the Tauri GUI shell; it was not repeated during this fix.
  • Historical macOS UI evidence was recorded in Desktop commit 984e8c60fed262f60e1054c17c8b7d84489af999, whose bundled contract matched sqlite-atomic-caf2a35a-v1. It covered save/search/exact reads, clipboard paste-back, app restart and independent Server survival. The observed app executable digest is recorded in desktop/VALIDATION.md; that record does not identify its exact build source revision. This fix did not repeat that UI acceptance or native Windows/Intel execution. Refer to checks on the current head for remote CI results.

AI usage statement

OpenAI Codex assisted implementation, tests, documentation, native-app operation and PR preparation. The author confirmed the historical manual acceptance; current-contract macOS UI acceptance remains open.

Comment thread desktop/README.md Resolved
Comment thread desktop/README.md Resolved
@happy-v587

Copy link
Copy Markdown
Collaborator Author

已按评审处理:诊断进程组的管道收集与 reader 关闭现受 deadline/cancellation 约束,错误路径立即返回,并补充进程组逃逸回归测试;README/VALIDATION 的资格记录指引已改为 sqlite-atomic-683e2db0-v1(与 bundled contract 匹配),中文 README 已与英文同步(macOS 构建、Keychain、诊断注册路径与未签名边界)。

@happy-v587 happy-v587 closed this Oct 19, 2026
@happy-v587 happy-v587 reopened this Oct 19, 2026
@happy-v587

Copy link
Copy Markdown
Collaborator Author

CI 失败根因:master cab054db(v1.4.0 release)把 bundled contract 换成了 042842ae...,而分支的 regeneration 只资格化了旧契约 dae5feab...;pull_request 事件的 CI 跑合并提交时 bundled_qualification_allows_explicit_scope_browsing 反查不到记录。已合并 master 并按既有验证流程补上新资格记录 sqlite-atomic-cab054db-v1:wheel powercontext-1.3.1.dev114+g9243caa3a(SHA-256 042c28f8...)的 517 个运行时文件与 Server commit cab054db 逐字节一致,real-Server 四模式(匿名 loopback/静态 Bearer/HTTPS+CA/path/injected-provider+enforced)全部通过,契约变化仅为 OpenAPI 版本号 1.4.0。VALIDATION.md 与中英 README 已同步。

@hidb4ai

hidb4ai commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Please resolve the merge conflicts with master and rerun the affected checks before merging.

@hireview001 hireview001 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Resolve merge conflicts with the target branch.

Comment thread desktop/src-tauri/src/diagnostics.rs Resolved

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@happy-v587

Copy link
Copy Markdown
Collaborator Author

@AlexStocks PTAL

Resolve the Kimi installation assertion conflict by preserving master's exact
installed-path and placeholder checks alongside the macOS preview changes.

Qualify the d9a7856 Server contract with a newly built wheel and the product
Rust protocol modules. Preserve historical qualification identities and
update the current selection and protocol evidence in the Desktop docs.

Validation: 108 harness tests, 43 Rust protocol tests, 32 UI tests, 56 API
contract tests, five fixture qualification tests, four real SQLite Server
modes, generated Desktop and Dify contracts, TypeScript, Vite build, Rustfmt,
lint, and remaining type checks passed.

make check reports the unchanged upstream task import in the cross-host
acceptance fixture. Native macOS and Windows packaging and installed UI
acceptance require platform CI.
Comment thread desktop/README.md Resolved
Comment thread desktop/VALIDATION.md Resolved
Comment thread desktop/src-tauri/Cargo.toml Resolved

@AlexStocks AlexStocks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as AlexStocks at the author's explicit request, on reviewed head 17754f89.

  • Scope reviewed: 29 changed files / +1315 −84 (declared 29, fetched 29), full read of the diff; desktop-only surface — macOS native preview path, Windows lifecycle harness, docs and build config.
  • Blocking findings: none. No P0/P1 identified in this head.

Non-blocking P2 items already posted inline; they are suggestions and do not block merge:

  1. desktop/README.md:126 / desktop/README.zh.md / desktop/VALIDATION.md — the new macOS prerequisite list omits a JDK. desktop/package.json chains generate:check into both lint and build, and desktop/scripts/generate.mjs invokes the Java OpenAPI generator unconditionally at top level, so a clean macOS host following the documented steps fails at the first command. CI is green only because macos-15 images ship Temurin preinstalled, which is not reproducible evidence.
  2. desktop/VALIDATION.md:138 — the acceptance narrative cites sqlite-atomic-caf2a35a-v1, while the same file (line 25) declares the current record to be sqlite-atomic-d9a78567-v1, and caf2a35's contractSha256 (e43c7034…) does not match the bundled operations.json (a6758fd3…). Under the compatible predicate in session.rs the described save/search/exact-read run cannot occur against that record; the statement should be re-pointed at the record actually exercised, and the macOS UI gap that this exposes noted.
  3. desktop/src-tauri/src/diagnostic_process_macos.rs:177 — SIGKILL is sent to -pgid via drop(group) after try_wait() has already reaped the child, closing the normal-completion path into a PID-reuse window. waitid(WNOWAIT) + kill + wait() removes it.
  4. desktop/src-tauri/Cargo.toml:55 — libc = "0.2" is the only dependency in the file not exactly pinned (lock resolves 0.2.189), which is inconsistent with the README's Cargo.lock pinning statement.

Verification basis: trusted CI on this head reused (52 checks green), including Desktop validation / macos (macos-15) job 119738990580, whose log contains Running tests/macos_diagnostics.rs with 4 passed plus 9 lib unit tests — confirming the #![cfg(target_os = "macos")] file is exercised rather than skipped. No local build of the fork source was performed.

AI usage statement: this review was AI-assisted (model-driven diff reading plus CI log inspection) and is submitted from my account, for which I take responsibility. Consistent with the repository's AI policy, merge responsibility stays with a human maintainer.

@AlexStocks
AlexStocks merged commit 58ab50f into oceanbase:master Oct 23, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.4.1 v1.4.1 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants