Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

docs(readme): 同步 TapDB 统计开关与隐私说明 (#7272)

Dash38d0c3a7640c
diff --git a/README.md b/README.md
index 8af0739d87..4693f97ae5 100644
--- a/README.md
+++ b/README.md
@@ -160,21 +160,56 @@ privately rather than opening a public issue.
## Privacy & telemetry
**Official distribution builds** include [TapDB](https://www.taptap.io/tapdb)
-usage analytics for product-level aggregate statistics (device / OS / app-version
-metadata; associated with your account ID after sign-in). It does **not** collect
-chat content, file content, or working-directory data. In addition, while signed
-in to a cloud account the client sends an online heartbeat to Cindy services
-(account ID, platform, and version only). Crash dumps stay on the local machine
-and are never uploaded automatically.
+usage analytics for product-level aggregate statistics, including device identifiers,
+OS / app version, startup and activity events. Events are associated with your account
+ID after sign-in, so this is not fully anonymous. TapDB does **not** collect chat
+content, file content, or working-directory data.
+
+**You can disable usage analytics without editing code**: on Desktop, use
+Settings → About → Usage statistics; on Mobile, use Usage statistics in Settings.
+The SDK checks the stored privacy-consent state and the statistics preference,
+which defaults to on. Accepting the Privacy Policy records consent; a one-time
+migration also records consent for eligible existing signed-in users.
+
+**Known Mobile exception:** enterprise SSO skips the policy-acceptance step. If no
+analytics consent record exists and that sign-in is restored after restarting the
+app, the current migration can mark even a new installation as consented. With
+TapDB configured and statistics enabled, reporting can then start without explicit
+policy acceptance. See [Mobile sign-in restoration](apps/mobile/src/auth/AuthContext.tsx)
+and the [consent migration](apps/mobile/src/analytics/analyticsConsentStore.ts).
+Turning off Usage statistics prevents reporting from being enabled by this migration.
+
+- Desktop stops subsequent analytics reporting immediately when disabled. Local
+ mode (Skip sign-in) does not report to TapDB.
+- Mobile immediately unlinks the account and stops reports explicitly triggered
+ by Cindy. An already initialized native SDK cannot be uninitialized; fully quit
+ and relaunch the app to keep the SDK uninitialized.
+
+Implementation: [Desktop consent and settings](apps/desktop/src/main/analyticsSettingsService.ts),
+[Desktop SDK](apps/desktop/src/renderer/analytics/tapdbClient.ts),
+[Mobile consent](apps/mobile/src/analytics/analyticsConsentStore.ts), and
+[Mobile SDK](apps/mobile/src/analytics/mobileTapdb.ts).
+
+Online heartbeats and diagnostic logs are separate mechanisms, unaffected by the
+usage statistics switch. Desktop sends heartbeats to Cindy services only during a
+verified cloud sign-in (account ID, platform, and version); local mode sends none.
+Desktop native crash dumps stay local and are never uploaded automatically.
+Diagnostic logs can be uploaded manually; a separate, default-off automatic crash
+log upload option is also available. Log uploads require privacy consent. See the
+[heartbeat implementation](apps/desktop/src/main/heartbeatService.ts) and
+[log upload rules](docs/dev-rules/log-upload-and-redaction.md).
**Building from source?** You are not required to keep analytics:
-- Mobile is off by default — without TapDB credentials (`clientId` /
- `clientToken`) injected at build time, `apps/mobile/src/analytics/mobileTapdb.ts`
- is a no-op;
-- Desktop can be fully stripped by removing the `initTapdb()` call in
- `apps/desktop/src/renderer/index.tsx` (implementation lives in
- `apps/desktop/src/renderer/analytics/`).
+- Desktop development builds do not initialize TapDB by default. Explicitly setting
+ `XDT_TAPDB_DEV=1` lifts the build gate but still requires consent and the statistics
+ preference. Self-packaged Desktop builds use the same analytics gates as official
+ builds; you can disable analytics in Settings.
+- Mobile does not initialize the SDK without injected TapDB configuration
+ (`clientId` / `clientToken`). This does not mean all source builds default to off:
+ the self-hosted release pipeline requires nonempty configuration, while local
+ development permits empty values. See the
+ [Mobile build guide](apps/mobile/docs/simulator-debugging.md).
## License / 许可证
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 4f1caabe7f..f47b9b5d8f 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -139,17 +139,45 @@ agent;进入后应用内的账号状态显示为「未登录」。依赖服务
## 隐私与遥测
**官方分发的安装包**包含 [TapDB](https://www.taptap.cn/tapdb) 使用统计,用于
-产品层面的匿名量级分析(设备 / 系统 / 应用版本等元数据;登录后关联账号 ID)。
-它**不采集**聊天内容、文件内容或工作目录数据。此外,登录云端账号时客户端会向
-Cindy 服务发送在线心跳(仅账号 ID、平台与版本号)。崩溃转储只保留在本地,
-不会自动上传。
+产品层面的汇总分析,包括设备标识、系统 / 应用版本、启动与活跃事件;登录后会
+关联账号 ID,因此不应理解为完全匿名。TapDB **不采集**聊天内容、文件内容或
+工作目录数据。
+
+**无需修改代码即可关闭使用统计**:桌面端在「设置 → 关于 → 使用统计」,移动端在
+设置页的「使用统计」关闭。SDK 检查本地记录的隐私同意状态和统计开关,统计开关
+默认开启。同意《隐私政策》会记录同意状态;符合条件的存量已登录用户也会通过一次性
+迁移记录为已同意。
+
+**移动端已知例外**:企业 SSO 跳过协议勾选。如果本机尚无统计同意记录,并在重启应用后
+恢复该登录态,当前迁移逻辑可能把新装用户也标记为已同意。在已配置 TapDB 且统计开启时,
+即使用户未明确接受隐私政策,也可能开始上报。实现见
+[移动端登录恢复](apps/mobile/src/auth/AuthContext.tsx)与
+[同意状态迁移](apps/mobile/src/analytics/analyticsConsentStore.ts)。
+关闭「使用统计」可避免该迁移放行统计上报。
+
+- 桌面端关闭后立即停止后续统计上报;「跳过登录」的本地模式不上报 TapDB。
+- 移动端关闭后立即解绑账号并停止 Cindy 主动触发的上报;已初始化的原生 SDK
+ 不支持反初始化,需彻底退出并重新启动应用,才会保持 SDK 未初始化。
+
+实现依据:[桌面端同意与开关](apps/desktop/src/main/analyticsSettingsService.ts)、
+[桌面端 SDK](apps/desktop/src/renderer/analytics/tapdbClient.ts)、
+[移动端同意状态](apps/mobile/src/analytics/analyticsConsentStore.ts)、
+[移动端 SDK](apps/mobile/src/analytics/mobileTapdb.ts)。
+
+在线心跳与诊断日志是独立机制,不受「使用统计」开关控制。桌面端仅在已验证的云端
+登录态下向 Cindy 服务发送在线心跳(账号 ID、平台与版本号),本地模式不发送。
+桌面端原生崩溃转储只保留在本地,不会自动上传;诊断日志可手动上传,另外有默认关闭的
+「崩溃时自动上传」选项,上传均须通过隐私同意门槛。详见
+[心跳实现](apps/desktop/src/main/heartbeatService.ts)与
+[日志上报规则](docs/dev-rules/log-upload-and-redaction.md)。
**从源码自行构建**时不必保留统计:
-- 移动端默认即关闭 —— 未在构建时注入 TapDB 凭据(`clientId` / `clientToken`)
- 时,`apps/mobile/src/analytics/mobileTapdb.ts` 自动空转;
-- 桌面端可移除 `apps/desktop/src/renderer/index.tsx` 中的 `initTapdb()` 调用
- (实现见 `apps/desktop/src/renderer/analytics/`),即可完全剥离。
+- 桌面端开发构建默认不初始化 TapDB;仅显式设置 `XDT_TAPDB_DEV=1` 才放开构建闸,
+ 仍须满足同意与开关条件。自行打包的桌面版与官方包使用相同统计门槛,可在设置中关闭;
+- 移动端未注入 TapDB 配置(`clientId` / `clientToken`)时不会初始化 SDK。
+ 这不等于所有源码构建都默认关闭:自建正式发布流程要求配置非空,本地开发允许留空,
+ 见[移动端构建说明](apps/mobile/docs/simulator-debugging.md)。
## 许可证 / License