Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

feat(settings): gate cloud sync behind developer mode

vastsa57ab9acada54
diff --git a/apps/desktop/src/features/settings/SettingsPage.tsx b/apps/desktop/src/features/settings/SettingsPage.tsx
index 2c4257373..606de64a1 100644
--- a/apps/desktop/src/features/settings/SettingsPage.tsx
+++ b/apps/desktop/src/features/settings/SettingsPage.tsx
@@ -70,6 +70,7 @@ type NavItem = {
titleKey: string;
icon: ReactNode;
group: SettingsNavGroupId;
+ experimentalBadgeKey?: string;
/** i18n keys of the rows inside the tab; search matches their translations. */
keywordKeys: string[];
};
@@ -87,8 +88,8 @@ export function SettingsPage() {
const refreshProviders = useAppStore((s) => s.refreshProviders);
const platform = (window.piDesktop?.platform ?? "darwin") as ShortcutPlatform;
- // Developer-only destinations (Remote Hosts) exist only while developer
- // mode is on; the rail, the page, and settings search drop them together.
+ // Developer-only destinations (Cloud sync and Remote Hosts) exist only
+ // while developer mode is on; the rail, page, and search drop them together.
const developerMode = settings?.developerMode === true;
const navEntries = useMemo(() => visibleSettingsNav(developerMode), [developerMode]);
const tabHidden = isSettingsDestinationHidden(tab, developerMode);
@@ -131,8 +132,8 @@ export function SettingsPage() {
}, [activeExtension, extensions, setSettingsTab]);
// A hidden destination must not keep rendering: leave the page the rail no
- // longer offers (for example Remote Hosts once developer mode is switched
- // off) and fall back to General.
+ // longer offers (for example Cloud sync or Remote Hosts after developer mode
+ // is switched off) and fall back to General.
useEffect(() => {
if (!settings || !tabHidden) return;
setSettingsTab("general");
@@ -237,6 +238,7 @@ export function SettingsPage() {
titleKey: entry.titleKey,
icon: iconFor[entry.id],
group: entry.group,
+ experimentalBadgeKey: entry.experimentalBadgeKey,
keywordKeys: entry.keywordKeys,
}));
}, [navEntries]);
@@ -266,8 +268,8 @@ export function SettingsPage() {
return [...groups.entries()].map(([id, items]) => ({ id, items }));
}, [filteredItems]);
- const activeTitleKey =
- navItems.find((item) => item.id === tab)?.titleKey ?? "settings.title";
+ const activeNavItem = navItems.find((item) => item.id === tab);
+ const activeTitleKey = activeNavItem?.titleKey ?? "settings.title";
const tabNeedsSettings = ["general", "ai", "shortcuts", "agent"].includes(tab);
return (
@@ -310,9 +312,9 @@ export function SettingsPage() {
>
<span className="settings-nav-icon">{item.icon}</span>
<span className="settings-nav-label">{t(item.labelKey)}</span>
- {item.id === "remoteHosts" ? (
+ {item.experimentalBadgeKey ? (
<Badge tone="warning" className="settings-nav-experimental">
- {t("settings.remoteHosts.experimental")}
+ {t(item.experimentalBadgeKey)}
</Badge>
) : null}
</button>
@@ -364,8 +366,8 @@ export function SettingsPage() {
<div className="settings-content-enter">
<h1 className="settings-section-title">
<span>{activeExtension?.label ?? t(activeTitleKey)}</span>
- {!activeExtension && tab === "remoteHosts" && !tabHidden ? (
- <Badge tone="warning">{t("settings.remoteHosts.experimental")}</Badge>
+ {!activeExtension && activeNavItem?.experimentalBadgeKey ? (
+ <Badge tone="warning">{t(activeNavItem.experimentalBadgeKey)}</Badge>
) : null}
</h1>
@@ -544,7 +546,7 @@ export function SettingsPage() {
{tab === "projects" && <ProjectsPage />}
- {tab === "sync" && <ConfigSyncPage />}
+ {tab === "sync" && !tabHidden && <ConfigSyncPage />}
{tab === "remoteHosts" && !tabHidden && <RemoteHostsPage />}
diff --git a/apps/desktop/src/lib/settings-search.ts b/apps/desktop/src/lib/settings-search.ts
index 575f24e23..b320ba431 100644
--- a/apps/desktop/src/lib/settings-search.ts
+++ b/apps/desktop/src/lib/settings-search.ts
@@ -48,6 +48,8 @@ export type SettingsNavEntry = {
* rail, the page, and settings search drop it together.
*/
developerOnly?: true;
+ /** Localized Experimental badge shown beside the rail row and page title. */
+ experimentalBadgeKey?: string;
};
export const SETTINGS_NAV: SettingsNavEntry[] = [
@@ -245,6 +247,8 @@ export const SETTINGS_NAV: SettingsNavEntry[] = [
labelKey: "settings.nav.sync",
titleKey: "settings.configSync.title",
group: "system",
+ developerOnly: true,
+ experimentalBadgeKey: "settings.configSync.experimental",
keywordKeys: [
"settings.configSync.connectionTitle",
"settings.configSync.endpoint",
@@ -260,6 +264,7 @@ export const SETTINGS_NAV: SettingsNavEntry[] = [
titleKey: "settings.remoteHosts.title",
group: "system",
developerOnly: true,
+ experimentalBadgeKey: "settings.remoteHosts.experimental",
keywordKeys: [
"settings.remoteHosts.title",
"settings.remoteHosts.addTitle",
diff --git a/apps/desktop/test/config-sync-settings.test.mjs b/apps/desktop/test/config-sync-settings.test.mjs
index 9d39021df..3e8111d76 100644
--- a/apps/desktop/test/config-sync-settings.test.mjs
+++ b/apps/desktop/test/config-sync-settings.test.mjs
@@ -24,9 +24,10 @@ const progressModel = await read(
"../src/features/settings/config-sync-progress.ts",
);
-test("cloud sync is a searchable settings destination", () => {
- assert.match(settingsPage, /tab === "sync" && <ConfigSyncPage \/>/);
+test("cloud sync rendering follows the settings visibility gate", () => {
+ assert.match(settingsPage, /tab === "sync" && !tabHidden && <ConfigSyncPage \/>/);
assert.match(settingsIndex, /id: "sync"/);
+ assert.match(settingsIndex, /experimentalBadgeKey: "settings\.configSync\.experimental"/);
assert.match(settingsIndex, /settings\.configSync\.connectionTitle/);
});
diff --git a/apps/desktop/test/settings-developer-only-destinations.test.mjs b/apps/desktop/test/settings-developer-only-destinations.test.mjs
index 376d832a5..c3bf21b05 100644
--- a/apps/desktop/test/settings-developer-only-destinations.test.mjs
+++ b/apps/desktop/test/settings-developer-only-destinations.test.mjs
@@ -1,9 +1,9 @@
/**
* Developer-only settings destinations contract.
*
- * Remote Hosts is an experimental surface that exists only while developer
- * mode is on. The rail, the page, and settings search must add and drop it
- * together, and a stale selection must fall back to General instead of
+ * Cloud sync and Remote Hosts are experimental surfaces that exist only while
+ * developer mode is on. The rail, page, and settings search must add and drop
+ * them together, and a stale selection must fall back to General instead of
* rendering a page the rail no longer offers.
*/
import assert from "node:assert/strict";
@@ -31,18 +31,38 @@ test("developer mode alone decides which destinations exist", () => {
const off = visibleSettingsNav(false).map((entry) => entry.id);
const on = visibleSettingsNav(true).map((entry) => entry.id);
+ assert.equal(off.includes("sync"), false);
+ assert.equal(on.includes("sync"), true);
assert.equal(off.includes("remoteHosts"), false);
assert.equal(on.includes("remoteHosts"), true);
- assert.deepEqual(off, on.filter((id) => id !== "remoteHosts"));
- // Remote Hosts is the only gated destination today, and it carries the
- // Experimental badge that the rail renders.
+ assert.deepEqual(
+ off,
+ on.filter((id) => id !== "sync" && id !== "remoteHosts"),
+ );
+ // Both gated destinations carry the badge rendered by the rail and title.
assert.deepEqual(
SETTINGS_NAV.filter((entry) => entry.developerOnly === true).map((entry) => entry.id),
- ["remoteHosts"],
+ ["sync", "remoteHosts"],
+ );
+ assert.ok(
+ SETTINGS_NAV.filter((entry) => entry.developerOnly === true)
+ .every((entry) => entry.experimentalBadgeKey),
+ );
+ assert.equal(
+ SETTINGS_NAV.find((entry) => entry.id === "sync")?.experimentalBadgeKey,
+ "settings.configSync.experimental",
);
});
test("settings search mirrors the rail", () => {
+ assert.deepEqual(
+ searchSettings("configSync.connectionTitle", identity, { developerMode: false }),
+ [],
+ );
+ assert.ok(
+ searchSettings("configSync.connectionTitle", identity, { developerMode: true })
+ .some((hit) => hit.tab === "sync"),
+ );
assert.deepEqual(searchSettings("remotehosts", identity, { developerMode: false }), []);
const hits = searchSettings("remotehosts", identity, { developerMode: true });
assert.ok(hits.some((hit) => hit.tab === "remoteHosts"));
@@ -50,6 +70,8 @@ test("settings search mirrors the rail", () => {
});
test("a stale developer-only selection is reported as hidden", () => {
+ assert.equal(isSettingsDestinationHidden("sync", false), true);
+ assert.equal(isSettingsDestinationHidden("sync", true), false);
assert.equal(isSettingsDestinationHidden("remoteHosts", false), true);
assert.equal(isSettingsDestinationHidden("remoteHosts", true), false);
assert.equal(isSettingsDestinationHidden("general", false), false);
@@ -60,6 +82,9 @@ test("the rail, the page, and the search dialog follow developer mode", () => {
assert.match(settingsPage, /visibleSettingsNav\(developerMode\)/);
assert.match(settingsPage, /isSettingsDestinationHidden\(tab, developerMode\)/);
assert.match(settingsPage, /setSettingsTab\("general"\)/);
+ assert.match(settingsPage, /tab === "sync" && !tabHidden && <ConfigSyncPage \/>/);
+ assert.match(settingsPage, /item\.experimentalBadgeKey/);
+ assert.match(settingsPage, /activeNavItem\?\.experimentalBadgeKey/);
assert.match(settingsPage, /tab === "remoteHosts" && !tabHidden && <RemoteHostsPage \/>/);
assert.match(searchDialog, /searchSettings\(query, t, \{ developerMode \}\)/);
});
diff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.md
index 6b5d89e38..3da69ee94 100644
--- a/docs/spec/04-ux/06-settings-ia.md
+++ b/docs/spec/04-ux/06-settings-ia.md
@@ -55,7 +55,7 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (
8. **Subagents / 子智能体** — Lucide `Bot` (built-in and personal parallel agents)
9. **Import / 导入** — Lucide `Download` (bring sessions and model configuration in from other tools)
10. **Projects / 项目** — Lucide `Archive` (durable project index)
- 11. **Cloud sync / 云同步** — Lucide `CloudDownload` (encrypted portable configuration backup and bidirectional sync)
+ 11. **Cloud sync / 云同步** — Lucide `CloudDownload` (encrypted portable configuration backup and bidirectional sync; developer mode only)
12. **Remote Hosts / 远程主机** — Lucide `Globe` (SSH bootstrap and pairing inventory; developer mode only)
13. **Info / 信息** — Lucide `Info` (versions, logs, updates, developer)
Icons are decorative (`aria-hidden` via the SVG default) and stay monochrome
@@ -64,11 +64,18 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (
scanability, the destinations are shown in four titled visual clusters:
`Preferences` / `偏好` (General, AI, Shortcuts), `Agent` / `智能体`
(Instructions, Models, Skills, MCP, Subagents), `Workspace` / `工作区`
- (Import, Projects), and `System` / `系统` (Cloud sync, Remote Hosts, Info). Headings are
+ (Import, Projects), and `System` / `系统` (Cloud sync, Remote Hosts, Info;
+ Cloud sync and Remote Hosts are developer-only). Headings are
muted, non-interactive labels and use whitespace for separation; no divider
lines are rendered. These are visual landmarks only, not a second navigation
level.
When search filters the directory, empty clusters and their headings disappear.
+- **Cloud sync / 云同步** is a developer-only, Experimental destination: its
+ rail row, page, and settings-search hits exist only while
+ `AppSettings.developerMode` is `true`. With developer mode off the row is
+ absent rather than disabled, settings search returns no hit for it, and a
+ rail position left on it falls back to General. The row and page title carry
+ the Experimental badge (`settings.configSync.experimental`)
- **Remote Hosts / 远程主机** is a developer-only, Experimental destination: its
rail row, its page, and its settings-search hits exist only while
`AppSettings.developerMode` is `true`. With developer mode off the row is
@@ -716,7 +723,7 @@ system while preserving their different data ownership:
- the developer mode switch unlocks the Open console button, F12 on every
platform, Ctrl+Shift+I on Windows/Linux, the macOS View-menu developer
tools item, Copy conversation ID / Open session path on the conversation
- overflow menu, and the Remote Hosts destination on the rail
+ overflow menu, and the Cloud sync / Remote Hosts destinations on the rail
- disabling developer mode closes an open console and disables or removes
every entry point; Settings search indexes the card, switch, and console
action
@@ -745,8 +752,8 @@ system while preserving their different data ownership:
- Back to app returns to chat shell from the rail's pinned footer action
- Developer-only destinations join and leave the rail, the page, and settings
search as one unit: while developer mode is off the rail omits the row,
- settings search returns no hit for it, and an open Remote Hosts page returns
- to General
+ settings search returns no hit for it, and an open Cloud sync or Remote Hosts
+ page returns to General
## 4. Acceptance
@@ -755,8 +762,8 @@ system while preserving their different data ownership:
foot on the main sidebar's footer icon line, and exactly General / 常规, AI,
Shortcuts / 快捷键, Instructions / 指令, Models / 模型, Skills / 技能, MCP,
Subagents / 子智能体, Import / 导入, Projects / 项目, Cloud sync / 云同步,
- Remote Hosts / 远程主机, and Info / 信息 in that order, with Remote Hosts /
- 远程主机 present only while developer mode is on. The rows are grouped under Preferences / 偏好,
+ Remote Hosts / 远程主机, and Info / 信息 in that order. Cloud sync / 云同步
+ and Remote Hosts / 远程主机 appear only while developer mode is on. The rows are grouped under Preferences / 偏好,
Agent / 智能体, Workspace / 工作区, and System / 系统. There is no
Usage / 用量 destination.
3. Appearance is part of General and has no standalone rail destination
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index fd9745e7d..6fdcc9d86 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -8162,30 +8162,38 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.
### E2E-CONFIG-SYNC-webdav-portable-configuration
-- **Preconditions:** A built task candidate, isolated host profile, and a local
+- **Preconditions:** A built task candidate, isolated host profile with
+ developer mode initially off, and a local
WebDAV fixture that supports strong ETags and conditional PUT, plus a fixture
variant that ignores conditional headers but supports `PROPFIND` directory
listing. No real WebDAV account, provider, or production desktop.
-- **Steps:** 1) Open Settings → Cloud sync and enter the fixture URL, device
- label, directory, and backup password. 2) Run the capability test and
- confirm it uses temporary objects. 3) Select provider/MCP/skill categories
+- **Steps:** 1) Open Settings with developer mode off; confirm Cloud sync is
+ absent from the rail and settings search returns no Cloud sync result. 2) Open
+ Settings → Info → Developer, enable developer mode, and confirm Cloud sync
+ appears in the rail and settings search. Open it and confirm the Experimental
+ badge appears beside the rail row and page title. 3) Enter the fixture URL,
+ device label, directory, and backup password. 4) Run the capability test and
+ confirm it uses temporary objects. 5) Select provider/MCP/skill categories
while leaving credentials and memory off; enable credentials in a second
- preview and verify only redacted counts are shown. 4) Configure device A,
- create a user provider and MCP definition, and sync. 5) Configure device B
+ preview and verify only redacted counts are shown. 6) Configure device A,
+ create a user provider and MCP definition, and sync. 7) Configure device B
against the same vault, sync, inspect pending activation/mapping, and verify
- no command or task runs before approval. 6) Approve a changed safe entity,
+ no command or task runs before approval. 8) Approve a changed safe entity,
reject one staged entity, edit disjoint settings on both devices, and sync
- again. 7) Exercise a concurrent head writer, wrong password, weak ETag,
+ again. 9) Exercise a concurrent head writer, wrong password, weak ETag,
ciphertext corruption, redirect, archive traversal, and network interruption.
- 8) On the ignored-precondition fixture, select explicit compatibility mode,
+ 10) On the ignored-precondition fixture, select explicit compatibility mode,
confirm the warning, and configure two devices. Verify each device publishes
its own encrypted head under the heads collection, a concurrent update is
merged from both tips, and compatibility mode does not delete immutable
history. Cancel the confirmation once and verify configuration is not saved.
- 9) Use the explicit LAN HTTP acknowledgement with a loopback/private fixture,
+ 11) Use the explicit LAN HTTP acknowledgement with a loopback/private fixture,
verify the setting survives a state refresh, and confirm a public HTTP
endpoint is rejected even when the checkbox is selected.
-- **Expected:** Strict mode refuses unreliable conditional writes. The explicit
+- **Expected:** With developer mode off, Cloud sync is absent from the rail and
+ settings search; enabling developer mode reveals the destination and its
+ Experimental badges without changing sync behavior. Strict mode refuses
+ unreliable conditional writes. The explicit
compatibility mode accepts only a server that proves bounded directory
listing, explains that it is not atomic CAS, and retains per-device tips for
merge/recovery. A server that ignores conditional headers is never accepted
@@ -8199,13 +8207,15 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.
conflicts remain reviewable, explicit deletions use tombstones, category
opt-out is not deletion, and executable imports remain inactive until local
approval and mapping. Recovery never exposes a partial local apply.
-- **Specs:** `03-runtime/22-config-sync.md`, `03-runtime/14-secrets-storage.md`,
- `05-security/01-security.md`, ADR 0300, ADR 0301.
+- **Specs:** `04-ux/06-settings-ia.md`, `03-runtime/22-config-sync.md`,
+ `03-runtime/14-secrets-storage.md`, `05-security/01-security.md`, ADR 0300,
+ ADR 0301.
- **Acceptance:** F (persistence), Security, Quality.
- **Milestone:** M6+.
- **Status:** Draft; merge/crypto and in-process WebDAV conditional-write
- coverage exists. The remaining automation is the full two-device process
- path and checkpoint-level local recovery fault injection.
+ coverage exists. The Settings visibility gate is automated by
+ `pnpm test:e2e:settings-scroll`; the remaining automation is the full
+ two-device process path and checkpoint-level local recovery fault injection.
## 8. Traceability Matrix
@@ -14735,8 +14745,9 @@ the latest destination. These assertions measure work counts, not device FPS.
- Automated coverage: `pnpm test:e2e:settings-scroll` mounts the production
SettingsPage, store, translations, and built CSS in isolated Electron. Only
preload data is stubbed; search navigation uses SearchDialog's public store
- entry points. This covers renderer interaction, not host persistence or the
- full global-search dialog.
+ entry points. It also checks the Cloud sync developer-mode gate, Experimental
+ badges, and fallback to General. This covers renderer interaction, not host
+ persistence or the full global-search dialog.
### E2E-SCHEDULED-dispatch
diff --git a/docs/zh-CN/spec/04-ux/06-settings-ia.md b/docs/zh-CN/spec/04-ux/06-settings-ia.md
index 4535780fd..7913c3fb6 100644
--- a/docs/zh-CN/spec/04-ux/06-settings-ia.md
+++ b/docs/zh-CN/spec/04-ux/06-settings-ia.md
@@ -35,15 +35,20 @@
8. **子智能体** — Lucide `Bot`(内置与自建的并行工作智能体)
9. **导入** — Lucide `Download`(从其他工具引入会话和模型配置)
10. **项目** — Lucide `Archive`(持久项目索引)
- 11. **远程主机** — Lucide `Globe`(SSH 引导与配对清单;仅开发者模式)
- 12. **信息** — Lucide `Info`(版本、日志、更新、开发人员)
+ 11. **云同步** — Lucide `CloudDownload`(加密的可移植配置备份与双向同步;仅开发者模式)
+ 12. **远程主机** — Lucide `Globe`(SSH 引导与配对清单;仅开发者模式)
+ 13. **信息** — Lucide `Info`(版本、日志、更新、开发人员)
图标具有装饰性(通过 SVG 默认设置为 `aria-hidden`)并保持单色
带有导轨标签;不要在此处重复使用 refresh/rotate 字形。
- 目录仍是保持相同顺序的可搜索扁平列表。为便于扫描,目的地分为四个带标题
的视觉分组:“偏好”(常规、AI、快捷键)、“智能体”(指令、模型、技能、
- MCP、子智能体)、“工作区”(导入、项目)和“系统”(远程主机、信息)。标题使用柔和
+ MCP、子智能体)、“工作区”(导入、项目)和“系统”(云同步、远程主机、信息;前两项仅开发者模式可见)。标题使用柔和
的非交互文字,分组之间只使用留白,不绘制分割线;搜索过滤后,空分组及其
标题一并隐藏。
+- **云同步**是仅开发者可用的实验性目的地:其导轨行、页面和设置搜索命中仅在
+ `AppSettings.developerMode` 为 `true` 时存在。开发者模式关闭时该行是缺失而不是
+ 禁用,设置搜索不会返回它的命中,导轨位置停在该项时会回落到常规。该行和页面标题
+ 都带有实验性徽章(`settings.configSync.experimental`)
- **远程主机**是仅开发者可用的实验性目的地:其导轨行、页面和设置搜索命中仅在
`AppSettings.developerMode` 为 `true` 时存在。开发者模式关闭时该行是缺失而不是
禁用,设置搜索不会返回它的命中,导轨位置停在该项时会回落到常规。该行和页面标题
@@ -309,7 +314,7 @@ Token 用量**不是设置目的地**(D335 / ADR 0173)。已完成回合历
`AppSettings.developerMode` 值是 `true`
- 开发者模式开关解锁“打开控制台”按钮,每个按钮上按 F12
平台、Windows/Linux 上的 Ctrl+Shift+I 以及 macOS 查看菜单开发人员
-工具项,以及导轨上的远程主机目的地
+工具项,以及导轨上的云同步和远程主机目的地
- 禁用开发者模式会关闭打开的控制台并禁用或删除
每个入口点;设置搜索索引卡、交换机和控制台
行动
@@ -338,14 +343,14 @@ Token 用量**不是设置目的地**(D335 / ADR 0173)。已完成回合历
- 返回应用程序从导轨固定的底部操作返回聊天外壳
- 仅开发者可用的目的地作为一个整体加入导轨、页面和设置搜索,也同样一起离开:
开发者模式关闭时导轨省略该行,设置搜索不返回它的命中,打开的远程主机页面会
- 返回到常规
+ 返回到常规;打开的云同步页面也会返回到常规
## 4. 验收
1.打开设置隐藏编码应用侧边栏(全页接管)
2. 导轨顶部显示搜索药丸,底部固定返回应用程序操作并与主侧边栏底部图标行同一条线,
并精确显示常规、AI、快捷键、指令、模型、技能、MCP、
- 子智能体、导入、项目和信息(开发者模式开启时,远程主机位于项目与信息之间),
+ 子智能体、导入、项目和信息(开发者模式开启时,云同步与远程主机依次位于项目与信息之间),
并按偏好、智能体、工作区、系统分组。没有
用量设置目的地。
3.外观是常规的一部分,没有独立的导轨目的地
diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index 451c2dfd7..bb10fca3e 100644
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@ -8446,13 +8446,13 @@ the latest destination. These assertions measure work counts, not device FPS.
### E2E-CONFIG-SYNC-webdav-portable-configuration
-- **前提:** 已构建的任务候选版本、隔离的 Host 配置,以及支持 strong ETag 和条件 PUT 的本地 WebDAV fixture。不使用真实 WebDAV 账户、provider 或生产桌面。
-- **步骤:** 1)打开设置 → 云同步,填写 fixture URL、设备标签、目录和备份密码。2)运行能力测试,确认使用临时对象。3)选择 provider/MCP/skill 类别,保持凭据和 memory 未选中;在第二次预览中启用凭据,确认只显示脱敏计数。4)配置设备 A,创建 user provider 和 MCP 定义并同步。5)让设备 B 连接同一 vault,同步后检查待激活/映射,并验证审批前不会运行命令或任务。6)批准一个变更后的安全实体,拒绝一个暂存实体,在两台设备上编辑不相交设置并再次同步。7)测试并发 head writer、错误密码、weak ETag、密文损坏、redirect、归档路径穿越和网络中断。8)使用回环/私有地址的 fixture 勾选“允许在受信任的内网地址使用 HTTP”,确认刷新状态后仍保留;即使勾选,公网 HTTP 地址也必须被拒绝。
-- **预期:** 测试拒绝不可靠的条件写入。HTTP 默认关闭,仅允许 localhost、`.local` 或私有/链路本地地址;公网 HTTP 地址会被拒绝,界面会提示凭据暴露风险。若 fixture 探测到该 endpoint 对不存在对象返回 502,后续只兼容该 endpoint 的这一行为;忽略条件头的服务器仍必须标记为不受支持。WebDAV 只能看到已认证的密文和不透明对象名;原始秘密不会出现在 Renderer 状态或日志中。相同和不相交的编辑会收敛,冲突保持可审查,明确删除使用 tombstone,类别退出不是删除,可执行导入在本地审批和映射前保持不激活。恢复不会暴露部分应用的本地配置。
-- **规格:** `03-runtime/22-config-sync.md`、`03-runtime/14-secrets-storage.md`、`05-security/01-security.md`、ADR 0300。
+- **前提:** 已构建的任务候选版本、默认关闭开发者模式的隔离 Host 配置,以及支持 strong ETag 和条件 PUT 的本地 WebDAV fixture。不使用真实 WebDAV 账户、provider 或生产桌面。
+- **步骤:** 1)开发者模式关闭时打开设置,确认导轨没有“云同步”,搜索也没有云同步结果。2)打开“设置 → 信息 → 开发者”,启用开发者模式,确认“云同步”出现在导轨和设置搜索中;打开该页,确认导轨行和页面标题均显示“实验性”徽章。3)填写 fixture URL、设备标签、目录和备份密码。4)运行能力测试,确认使用临时对象。5)选择 provider/MCP/skill 类别,保持凭据和 memory 未选中;在第二次预览中启用凭据,确认只显示脱敏计数。6)配置设备 A,创建 user provider 和 MCP 定义并同步。7)让设备 B 连接同一 vault,同步后检查待激活/映射,并验证审批前不会运行命令或任务。8)批准一个变更后的安全实体,拒绝一个暂存实体,在两台设备上编辑不相交设置并再次同步。9)测试并发 head writer、错误密码、weak ETag、密文损坏、redirect、归档路径穿越和网络中断。10)使用回环/私有地址的 fixture 勾选“允许在受信任的内网地址使用 HTTP”,确认刷新状态后仍保留;即使勾选,公网 HTTP 地址也必须被拒绝。
+- **预期:** 开发者模式关闭时,云同步页面及其设置搜索结果不可见;启用后入口可见并标记为实验性,云同步行为保持不变。测试拒绝不可靠的条件写入。HTTP 默认关闭,仅允许 localhost、`.local` 或私有/链路本地地址;公网 HTTP 地址会被拒绝,界面会提示凭据暴露风险。若 fixture 探测到该 endpoint 对不存在对象返回 502,后续只兼容该 endpoint 的这一行为;忽略条件头的服务器仍必须标记为不受支持。WebDAV 只能看到已认证的密文和不透明对象名;原始秘密不会出现在 Renderer 状态或日志中。相同和不相交的编辑会收敛,冲突保持可审查,明确删除使用 tombstone,类别退出不是删除,可执行导入在本地审批和映射前保持不激活。恢复不会暴露部分应用的本地配置。
+- **规格:** `04-ux/06-settings-ia.md`、`03-runtime/22-config-sync.md`、`03-runtime/14-secrets-storage.md`、`05-security/01-security.md`、ADR 0300。
- **验收:** F(持久化)、Security、Quality。
- **里程碑:** M6+。
-- **状态:** Draft;合并/密码学和进程内 WebDAV 条件写入覆盖已存在。完整双设备进程路径和逐检查点本地恢复故障注入仍待自动化。
+- **状态:** Draft;合并/密码学和进程内 WebDAV 条件写入覆盖已存在。云同步设置入口的开发者模式门控由 `pnpm test:e2e:settings-scroll` 自动验证;完整双设备进程路径和逐检查点本地恢复故障注入仍待自动化。
### E2E-DIALOG-long-text-boundaries
diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.ts
index cba85168e..9aa50c52f 100644
--- a/packages/i18n/src/locales/de/index.ts
+++ b/packages/i18n/src/locales/de/index.ts
@@ -687,6 +687,7 @@ sklm: {
},
"configSync": {
title: "Cloud sync",
+ experimental: "Experimentell",
connectionTitle: "WebDAV cloud sync",
connectionDescription:
"Synchronize portable configuration through an encrypted WebDAV vault. Conversation history, source files, and runtime state are never included.",
diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.ts
index cac17ebe6..0b741126e 100644
--- a/packages/i18n/src/locales/en/index.ts
+++ b/packages/i18n/src/locales/en/index.ts
@@ -934,6 +934,7 @@ sklm: {
},
configSync: {
title: "Cloud sync",
+ experimental: "Experimental",
connectionTitle: "WebDAV cloud sync",
connectionDescription:
"Synchronize portable configuration through an encrypted WebDAV vault. Conversation history, source files, and runtime state are never included.",
diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.ts
index 75acfe3e0..62befdb84 100644
--- a/packages/i18n/src/locales/es/index.ts
+++ b/packages/i18n/src/locales/es/index.ts
@@ -687,6 +687,7 @@ sklm: {
},
"configSync": {
title: "Cloud sync",
+ experimental: "Experimental",
connectionTitle: "WebDAV cloud sync",
connectionDescription:
"Synchronize portable configuration through an encrypted WebDAV vault. Conversation history, source files, and runtime state are never included.",
diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.ts
index a0b226bea..9a34e4116 100644
--- a/packages/i18n/src/locales/fr/index.ts
+++ b/packages/i18n/src/locales/fr/index.ts
@@ -687,6 +687,7 @@ sklm: {
},
"configSync": {
title: "Cloud sync",
+ experimental: "Expérimental",
connectionTitle: "WebDAV cloud sync",
connectionDescription:
"Synchronize portable configuration through an encrypted WebDAV vault. Conversation history, source files, and runtime state are never included.",
diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.ts
index c5b9849b7..e98bec760 100644
--- a/packages/i18n/src/locales/ko/index.ts
+++ b/packages/i18n/src/locales/ko/index.ts
@@ -695,6 +695,7 @@ sklm: {
},
configSync: {
title: "Cloud sync",
+ experimental: "실험적",
connectionTitle: "WebDAV cloud sync",
connectionDescription:
"Synchronize portable configuration through an encrypted WebDAV vault. Conversation history, source files, and runtime state are never included.",
diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.ts
index 4af2d1984..efe71b931 100644
--- a/packages/i18n/src/locales/tr/index.ts
+++ b/packages/i18n/src/locales/tr/index.ts
@@ -695,6 +695,7 @@ sklm: {
},
configSync: {
title: "Bulut senkronizasyonu",
+ experimental: "Deneysel",
connectionTitle: "WebDAV bulut senkronizasyonu",
connectionDescription: "Şifreli bir WebDAV kasası üzerinden taşınabilir yapılandırmayı senkronize edin.",
errorTitle: "Sync needs attention",
diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.ts
index 4769f1957..07e888332 100644
--- a/packages/i18n/src/locales/zh-CN/index.ts
+++ b/packages/i18n/src/locales/zh-CN/index.ts
@@ -685,6 +685,7 @@ sklm: {
},
configSync: {
title: "云同步",
+ experimental: "实验性",
connectionTitle: "WebDAV 云同步",
connectionDescription: "通过加密的 WebDAV 保管库同步可移植配置。不会包含对话历史、源文件或运行时状态。",
errorTitle: "同步需要处理",
diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.ts
index 11b4b34fb..d1fe4b3a6 100644
--- a/packages/i18n/src/locales/zh-TW/index.ts
+++ b/packages/i18n/src/locales/zh-TW/index.ts
@@ -685,6 +685,7 @@ sklm: {
},
configSync: {
title: "雲端同步",
+ experimental: "實驗性",
connectionTitle: "WebDAV 雲端同步",
connectionDescription: "透過加密的 WebDAV 保管庫同步可攜式設定。不會包含對話記錄、原始碼或執行階段狀態。",
errorTitle: "同步需要處理",
diff --git a/scripts/e2e-settings-scroll.mjs b/scripts/e2e-settings-scroll.mjs
index 2ef3631ff..5c932b4bb 100644
--- a/scripts/e2e-settings-scroll.mjs
+++ b/scripts/e2e-settings-scroll.mjs
@@ -15,7 +15,8 @@ try {
await build({ entryPoints: [join(root, "scripts/e2e/settings-scroll.jsx")],
outfile: join(temp, "renderer.js"), bundle: true, platform: "browser", format: "esm", jsx: "automatic",
define: { "process.env.NODE_ENV": '"production"', "import.meta.env.DEV": "false" },
- alias: { react: join(root, "apps/desktop/node_modules/react"),
+ alias: { "@pi-desktop/i18n": join(root, "packages/i18n/src/index.ts"),
+ react: join(root, "apps/desktop/node_modules/react"),
"react-dom": join(root, "apps/desktop/node_modules/react-dom"),
i18next: join(root, "apps/desktop/node_modules/i18next"),
"react-i18next": join(root, "apps/desktop/node_modules/react-i18next") },
diff --git a/scripts/e2e/settings-scroll.jsx b/scripts/e2e/settings-scroll.jsx
index 0abc181ee..c997e4631 100644
--- a/scripts/e2e/settings-scroll.jsx
+++ b/scripts/e2e/settings-scroll.jsx
@@ -15,7 +15,13 @@ const destinations = ["A", "B"].map((id) => ({
previewUrl: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E", blur: 6,
})),
}));
-let settings = { defaultMode: "agent", theme: "light", language: "en", enterToSend: true };
+let settings = {
+ defaultMode: "agent",
+ theme: "light",
+ language: "en",
+ enterToSend: true,
+ developerMode: false,
+};
window.piDesktop = {
platform: "darwin", on: () => () => {},
async invoke(channel, input) {
@@ -24,6 +30,22 @@ window.piDesktop = {
case IPC.invoke.pluginScenicThemesDestinations: data = destinations; break;
case IPC.invoke.settingsGet: data = settings; break;
case IPC.invoke.settingsSet: settings = input; data = settings; break;
+ case IPC.invoke.configSyncGetState:
+ data = {
+ configured: false,
+ enabled: false,
+ paused: false,
+ locked: false,
+ status: "notConfigured",
+ remoteMode: "strict",
+ categories: {},
+ includeSecrets: false,
+ includeMemory: false,
+ automaticSync: false,
+ pendingApprovals: [],
+ mappings: [],
+ };
+ break;
case IPC.invoke.commandShellList: data = { choices: [], effective: null }; break;
default: throw new Error(`Unexpected fixture IPC: ${channel}`);
}
@@ -39,13 +61,56 @@ const frame = () => new Promise(requestAnimationFrame);
async function settle() { await frame(); await frame(); }
function assert(value, message) { if (!value) throw new Error(message); }
const pane = () => document.querySelector(".settings-content");
+const navButton = (label) => [...document.querySelectorAll(".settings-nav-item")]
+ .find((node) => node.querySelector(".settings-nav-label")?.textContent?.trim() === label);
async function select(label) {
- const button = [...document.querySelectorAll(".settings-nav-item")]
- .find((node) => node.textContent.trim() === label);
+ const button = navButton(label);
assert(button, `Missing destination: ${label}`);
flushSync(() => button.click());
await settle();
}
+async function setSettingsSearch(value) {
+ const input = document.querySelector(".settings-search");
+ assert(input instanceof HTMLInputElement, "Settings search input must be rendered");
+ const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
+ assert(setter, "Settings search input must expose its value setter");
+ setter.call(input, value);
+ input.dispatchEvent(new Event("input", { bubbles: true }));
+ await settle();
+}
+async function checkCloudSyncVisibility() {
+ await setSettingsSearch("Cloud sync");
+ assert(!navButton("Cloud sync"), "Cloud sync must be absent from search without developer mode");
+ await setSettingsSearch("");
+
+ settings = { ...settings, developerMode: true };
+ flushSync(() => useAppStore.setState({ settings }));
+ await settle();
+ await setSettingsSearch("Cloud sync");
+ const syncButton = navButton("Cloud sync");
+ assert(syncButton, "Cloud sync must appear in settings search with developer mode");
+ assert(
+ syncButton.querySelector(".settings-nav-experimental")?.textContent?.trim() === "Experimental",
+ "Cloud sync's rail entry must be marked Experimental",
+ );
+
+ flushSync(() => syncButton.click());
+ await settle();
+ assert(
+ document.querySelector(".settings-section-title")?.textContent?.includes("Experimental"),
+ "Cloud sync's page title must be marked Experimental",
+ );
+
+ settings = { ...settings, developerMode: false };
+ flushSync(() => useAppStore.setState({ settings }));
+ await settle();
+ assert(
+ useAppStore.getState().settingsTab === "general",
+ "A Cloud sync page hidden by developer mode must return to General",
+ );
+ assert(!navButton("Cloud sync"), "Cloud sync must leave the rail when developer mode is off");
+ await setSettingsSearch("");
+}
async function scroll() {
pane().scrollTop = 220;
await settle();
@@ -55,6 +120,7 @@ async function scroll() {
window.settingsScrollProbe = async () => {
await settle();
const checks = [];
+ await checkCloudSyncVisibility();
for (const theme of ["light", "dark"]) {
document.documentElement.dataset.theme = theme;
await select("AI");