Skip to content

feat(desktop): implement local Server setup, recovery and management - #2306

Merged
hidb4ai merged 8 commits into
masterfrom
codex/desktop-local-server-2117
Nov 11, 2026
Merged

hidb4ai merged 8 commits into
masterfrom
codex/desktop-local-server-2117

Conversation

@knqiufan

@knqiufan knqiufan commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Which issue or RFC does this PR close?

Refs #2117 (12-A, 12-B and 12-C), parent #2114 and RFC #1733. Keep #2117 open until exact installed Windows/macOS acceptance is linked.

Rationale for this change

Users need to review and approve local Server installation and service plans, recover durable operations without replaying uncertain work, and connect to the Server's public default Scope. Existing-Server connection remains an independent path.

What changes are included in this PR?

  • Add bilingual first-use setup, plan review, progress, cancellation and approved recovery; retain operation references across navigation and lost replies.
  • Add start/stop/restart, repair, supported login-start settings, diagnosis and registration removal while preserving configuration and data.
  • Retain approved action/options with native operation references and require matching recovery metadata. Legacy references remain query-only; Ops journals own outcomes.
  • Add native-only local connection handoff with pinned resource/qualification evidence, discovery, consented readiness, identity checks and exact public default Scope resolution. Apply master’s current connection-identity contract and fence publication against identity or generation changes.
  • Preserve exact Scope selection only for the same deployment and identity, and retain submitted Memory recovery from master.
  • Guard Memory editing while local invalidation reconciles; bind handoff/invalidation continuations to their initiating UI intent so late replies preserve newer navigation and Connections drafts.
  • Keep bounded macOS DMG contention recovery, including failed force-detach, with per-attempt diagnostics and successful-retry evidence upload. Both workflow test entry points execute the checked-in packaging script.
  • Keep ZCode phase-specific timeout allowances and delayed binding/processing/flush coverage without replaying mutations; align source assertions with the current locator contract.
  • Update bilingual local-setup guides and validation/security boundaries. No HTTP contract or database migration changes.

Are there any user-facing changes?

Local setup and management are available when matching trusted Installer/Ops resources are supplied. Missing resources leave existing-Server connection available. Installation, service changes and connection effects require explicit consent; reopening does not install, replay or activate a private session.

Native IPC adds a constrained handoff command and additive reference/progress fields. Version-1 references retain optional action/options; older strict bridge binaries cannot read the new fields, so the controlling bridge must not be downgraded during recovery. Saved profiles and the 20-profile budget are preserved.

How was this change tested?

  • Rebased the seven-commit branch onto master 1026e37d and resolved the ZCode acceptance conflict using the current stage-based timeout contract.
  • uv run pytest tests/test_ci_pipeline.py tests/test_desktop_macos_workflow.py tests/test_desktop_macos_bundle.py tests/test_desktop_contract.py -q: 68 passed, 2 skipped.
  • uv run pytest tests/e2e/test_zcode_service_chain.py -q: 6 passed after updating the delayed binding probe to exceed the current 3-second request timeout.
  • Desktop UI full suite: 257 passed. pnpm typecheck, pnpm lint, and pnpm build passed.
  • Native deployment identity and discovery integration tests: 44 passed. Rust 1.95 Clippy with --all-targets -- -D warnings and cargo fmt --check passed.
  • make check and git diff --check passed.

Current PR checks. Native connection fixtures use synthetic HTTP servers. Installed package acceptance and service mutations remain tracked by #2108, #2109 and #2112.

AI usage statement

OpenAI Codex assisted with implementation, conflict resolution, review regression fixes and validation. Open Code Review delegate mode supplied review file/rule selection.

@AlexStocks AlexStocks added the 1.5.0 v1.5.0 release tracking label Oct 30, 2026

@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.

Two reproducible draft-loss issues remain at fe390ee; please address them before merging. The inherited recovery issue needs the newer #2291 fix integrated into this branch.

Comment thread desktop/ui/src/app/App.tsx Resolved
Comment thread desktop/ui/src/app/MemoryWorkspace.tsx Resolved
Comment thread desktop/ui/src/app/App.tsx Resolved
@hidb4ai hidb4ai removed the 1.5.0 v1.5.0 release tracking label Nov 2, 2026
@knqiufan
knqiufan changed the base branch from codex/desktop-ops-bridge-2116 to master November 2, 2026 05:29
@AlexStocks AlexStocks added the 1.5.1 v1.5.1 release tracking label Nov 3, 2026

@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

Comment thread desktop/scripts/build_macos.py Resolved
Comment thread desktop/ui/src/app/App.tsx Resolved
@hidb4ai

hidb4ai commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

please resolve conflicts

Comment thread .github/workflows/desktop.yml Resolved
Comment thread tests/e2e/test_zcode_service_chain.py Resolved

@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.
  • CI failed: CI result (failure).
  • CI did not complete: tests (3.14, unit) (cancelled).
  • CI did not complete: tests (3.12, e2e) (cancelled).
  • CI failed: tests (3.11, unit) (failure).
  • CI failed: Main (failure). Failed steps: tests (3.11, unit) / Run unit tests; tests (3.12, e2e) / Run remaining end-to-end tests; tests (3.14, unit) / Run unit tests.

@knqiufan knqiufan left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The existing Memory draft-loss and macOS CI entrypoint findings remain reproducible at this head. Please address the existing threads and reconcile the conflicting ZCode test changes before merging. GitHub does not allow the PR author to request changes on their own PR.

@hidb4ai

hidb4ai commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

The current run on d24ecaa0 is not green: check-website was killed with exit 137, and the Python 3.11–3.13 E2E jobs were canceled. The selected upgrade acceptance and Desktop validation jobs were consequently skipped, and the upgrade release gate failed. The logs do not establish why the website process was killed. Please investigate and rerun the selected checks before merging: https://github.com/oceanbase/powercontext/actions/runs/42362996511

@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.

@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.
  • CI failed: CI result (failure).
  • CI failed: Upgrade release gate (failure).
  • CI did not complete: tests (3.13, e2e) (cancelled).
  • CI did not complete: tests (3.11, e2e) (cancelled).
  • CI did not complete: tests (3.12, e2e) (cancelled).
  • CI failed: check-website (failure).
  • CI failed: Main (failure). Failed steps: check-website / Check website; tests (3.12, e2e) / Run remaining end-to-end tests; tests (3.11, e2e) / Run remaining end-to-end tests.

@hidb4ai hidb4ai removed the 1.5.1 v1.5.1 release tracking label Nov 9, 2026
@AlexStocks AlexStocks added the 1.6.0 v1.6.0 release tracking label Nov 9, 2026
@knqiufan
knqiufan force-pushed the codex/desktop-local-server-2117 branch 2 times, most recently from b117068 to 68b91ce Compare November 10, 2026 01:22
@hidb4ai

hidb4ai commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

The latest run on 68b91ce9 is still red: the selected upgrade acceptance and several other checks failed. For example, SQLite harness acceptance could not start because powercontext-e2e-container was not found in the container, and the skill-guidance job could not find pip. The upgrade job reports a parallel gate failure and points to its acceptance artifact. These logs do not establish that the failures are caused by this PR; please investigate and rerun the selected checks before merging: https://github.com/oceanbase/powercontext/actions/runs/42735358917

@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.

@knqiufan
knqiufan force-pushed the codex/desktop-local-server-2117 branch from 68b91ce to 78951ba Compare November 11, 2026 01:21
The include-tree fixture omitted memoryProtocol, so Doctor stayed degraded and setup exited 1. Give the HTTP status checks a longer request deadline so a cold CI start can still observe a completed 401.
@knqiufan

Copy link
Copy Markdown
Collaborator Author

dsh-package failed in setup validates native include trees: setup completed, then Doctor reported memory_protocol: unverified because the recording fixture omitted powercontext.memoryProtocol, and the command exited 1. The fixture now declares atomic-artifact-v1.

The sqlite acceptance failure was the old harness entrypoint powercontext-e2e-container missing from PATH. Current master already uses the absolute entrypoint, so this push picks that up through the merge commit. The HTTP status checks also use a 2s request deadline so a cold CI start can still observe a completed 401.

@hidb4ai

hidb4ai commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

The latest CI run on e9dfcbd9 still fails dsh-package: test_explicit_web_doctor_does_not_read_desktop_environment_profile expects exit 0, but Doctor reports plugin_memory_protocol.memory_protocol: unverified and exits 1. The earlier DSH setup fixture change passes, but this separate Python fixture/test still needs attention before the required CI can pass. The test and Doctor implementation are unchanged relative to the current base, so the log alone does not establish a PR-introduced regression. Please investigate and rerun the check: https://github.com/oceanbase/powercontext/actions/runs/42992633419/job/130488435548

@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.

LGTM

@hidb4ai
hidb4ai merged commit eaa784b into master Nov 11, 2026
79 of 81 checks passed
jasondeng1997 added a commit to jasondeng1997/powercontext that referenced this pull request Nov 12, 2026
…ture

The `dsh-package` job reached "Verify DSH setup with customized profiles" for
the first time on this branch and failed one case:

    tests/test_dsh_transport.py::
        test_explicit_web_doctor_does_not_read_desktop_environment_profile

`doctor dsh --profile web` verifies the installed plugin's declared Memory
protocol (oceanbase#2495). The fixture's Web profile was an empty `bundles: []`, so
`read_dsh_settings(..., require_installed=True)` could not resolve a plugin,
the compatibility diagnostic degraded to `unverified`, and the command exited
1 before the assertion about profile selection ran. Master never observed it
because its own `dsh-package` run stopped at an earlier JS step; current master
(oceanbase#2306) fixes the same fixture by installing a bundle that declares the
contract.

Give the Web profile a resolvable `powercontext-dsh` bundle whose manifest
declares `atomic-artifact-v1`, then assert the diagnostic reports that exact
protocol. The Desktop profile keeps its empty bundle list and its own baseUrl,
so the original point of the test still holds: if doctor read the Desktop
profile selected by the DSH_PROFILE environment variable, the check would
degrade rather than pass. Upstream's policy (setup/doctor fail on an unverified
or incompatible plugin) is unchanged.

Verified locally with the real DSH runtime and config boot:
`uv run pytest tests/test_dsh_transport.py --require-dsh-runtime
--require-dsh-config-runtime` -> 109 passed. `ruff check`, `ruff format
--check` and `ty check` all pass.
jasondeng1997 added a commit to jasondeng1997/powercontext that referenced this pull request Nov 12, 2026
Master advanced 27 commits after the previous merge and opened five conflicts.
None of them touch the Work Ledger runtime: work_handlers.py, composition.py,
worker.py, membership.py and the ledger tests are unchanged upstream.

* `tests/test_dsh_transport.py` and
  `integrations/dsh/plugins/powercontext/tests/runtime/setup.test.mjs`: take
  up/master. oceanbase#2306 fixed the same two synthetic-plugin fixtures independently
  (declaring `atomic-artifact-v1` on the installed plugin so `setup`/`doctor`
  can verify the Memory contract). Keeping our equivalent patches would duplicate
  the fix and our `_run_dsh` stub references the doctor path master refactored.
* `tests/test_desktop_contract.py`: keep both added tests — our bundled-contract
  qualification check and master's local-setup catalog digest check.
* `desktop/VALIDATION.md`: keep both qualification records — the Work Ledger
  7d716b6/2cb8da31 sections and master's installed connection journey section.
* `release/upgrade-support.json`: concatenate both rationale additions (the
  v1_5_0_005 Work Ledger tables and master's FTS helper v2 / seekdb identity
  notes), and recompute `schema_review.persistence_sha256` as
  `d81b7d0e...` — the merge brings master's
  `builtin/persistence/oceanbase/profile.py` into the digest's managed inputs,
  so neither side's stored digest matches the merged tree anymore.

Local verification on the merged tree: dsh transport 109 passed (with real DSH
runtime and config boot), desktop contract + upgrade gate + release version
144 passed / 6 skipped, Work Ledger core 27 passed, `load_policy` passes with
the recomputed digest, and `ruff check`, `ruff format --check`, `ty check` all
pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6.0 v1.6.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants