Repository navigation
feat(desktop): add scoped memory workflow preview - #1663
Conversation
3501e4a to
72fd2c3
Compare
| if (generation.current === original) { | ||
| setOutcome(result); | ||
| if (result.record.status === "succeeded") { | ||
| setText(""); | ||
| onDirty(false); |
There was a problem hiding this comment.
If a save in Scope A finishes after switching to B and typing a new draft, its callback still calls onDirty(false). Leaving the page then silently discards B's draft. Please prevent callbacks from an unmounted form from changing the current draft's dirty state.
There was a problem hiding this comment.
@PsiACE Understood. The issue has been fixed.Save callbacks are now invalidated when their editor unmounts or its context changes, so an old save cannot clear a new draft’s dirty state. Regression tests cover switching Scopes and leaving/reopening the same Scope.
| let mut next = self.document.clone(); | ||
| next.profiles.retain(|p| p.id != id); |
There was a problem hiding this comment.
Each profile repository saves its entire in-memory snapshot. Two independently opened repositories can save Personal and Work successfully, but reopening leaves only Work. Please enforce the RFC's one-instance-per-user/channel rule before opening profile storage. The Tauri single-instance plugin may fit here.
There was a problem hiding this comment.
@PsiACE Thanks for the suggestion, This issue has also been fixed. The Tauri single-instance plugin is now registered before profile storage is opened. Repeated launches restore and focus the existing window. The profile repository also holds an exclusive file lock for its lifetime to prevent concurrent owners during startup races. Regression tests and installed-client checks confirm that profiles and unsaved drafts are preserved.
PsiACE
left a comment
There was a problem hiding this comment.
This review covers architecture and core implementation decisions, including ownership boundaries, connection isolation, transport, compatibility, and persistence. UI presentation and basic functional acceptance require a separate discussion; this review does not sign off on those areas. I support merging this as the explicitly limited unsigned connect-only preview, with the two design notes tracked as follow-ups.
| function rustType(schema) { | ||
| if (schema.$ref) return schema.$ref.split("/").at(-1); | ||
| switch (schema.type) { |
There was a problem hiding this comment.
Design note (non-blocking): Please replace the custom OpenAPI-to-Rust schema mapping with an established generator. Keep the desktop-specific operation allowlist and native transport policies, and limit customization to the required derives and output layout. The current mapping makes Desktop responsible for schema semantics such as optional versus nullable fields, enum handling, and schema composition; regeneration checks only detect output drift. Please also use the generated request models when constructing HTTP payloads, so contract changes are checked by the compiler.
| let compatible = self.compatibility.iter().find(|c| { | ||
| profile.compatibility.as_ref() == Some(&c.id) | ||
| && contract["contractSha256"].as_str() == Some(&c.contract_sha256) |
There was a problem hiding this comment.
Design note (non-blocking): Once #1753 lands, please integrate server-info into connection activation and rechecking. Use the advertised protocol and feature versions to determine compatibility, and retain server_id to detect deployment changes and invalidate the active context before further operations. Keep health, runtime capabilities, and Principal checks separate. An explicitly qualified legacy profile should remain a fallback for a missing discovery endpoint (404), rather than for authentication, authorization, or availability failures. This can follow the current bounded preview.



Problem and result
PowerContext needs a Windows desktop client for connecting to an existing Server and saving, finding and reading scoped memories. This PR adds an unsigned internal preview with Chinese/English UI, connection management, Scope selection, memory workflows and local diagnostics.
Refs #1654, RFC #1455 and #1428. This preview does not close those issues.
Changes
6e237568; the ten-operation allowlist is unchanged. Thesqlite-6e237568-v1compatibility profile records matching Server source, contract and qualification-wheel evidence.User-facing changes
The installed UI launches without a local Server; business operations require a separately available Server and authorized Scope. Older compatibility selections require explicitly choosing the current qualified profile and rechecking the connection. Desktop does not introduce a public backend API, database migration, Server lifecycle management or Agent configuration changes.
Validation
pnpm --dir desktop lint,test(25 tests),typecheck,buildandipc:check.6e237568, with its SHA-256 recorded in the manifest.uv lock --check. Whole-repository hooks pass except pre-existing Windows platform diagnostics in unchanged code-understanding modules. Whole-repository Linux-targetedty checkpasses.Installed acceptance runs in the Desktop workflow's
windowsjob. Theinstalled-packagejob is manual-only and intentionally skipped for normal PR runs. See the current PR checks anddesktop/VALIDATION.mdfor qualification scope and reproducible commands. Local test data, drivers and temporary reports are cleaned up; existing user data is preserved.Remaining qualification
The package is unsigned. Clean standard-user Windows 11 with/without WebView2, actual IME/screen-reader/high-contrast and complete keyboard qualification, notification cold activation, named Agent capture/recall, release ownership and performance budgets remain open. Local and hosted-runner execution do not establish these remaining release gates.
AI usage statement
Implemented with OpenAI Codex under the contributor's direction, including UI changes, lifecycle and single-instance fixes, tests, review, local validation and packaging. Human maintainer review remains required.