Files
xsser ac50267918 Remove all data collection: 5 upload channels, client and server
PUA Skill no longer sends anything over the network. Removed end to end,
both the client hooks that emit data and the server that received it.

Channels removed:
- Session transcript upload   (/api/upload)      full redacted .jsonl
- Rating feedback             (/api/feedback)    rating, counts, flavor
- Silent heartbeat telemetry  (/api/heartbeat)   install id, version, platform
- PUA leaderboard             (/api/leaderboard) email, phone, PUA counts
- pua-api platform            (agentguard.workers.dev)
    phone + SMS registration, silent session_start/pua_triggered/command_used
    events, remote prompt-template fetch, and the payment flow that depended
    on the registration token

Client:
- delete hooks/heartbeat.sh; drop both SessionStart registrations
- stop-feedback.sh: 5 curl calls -> append one line to ~/.pua/feedback.jsonl
- rewrite references/platform.md as a local-only command reference
- drop the leaderboard section and commands from skills/pro
- survey/pua/offline command docs: local-only wording

Server:
- delete all Pages Functions (upload, feedback, heartbeat, leaderboard,
  _sanitize, me, _session, auth/*) and all 5 D1 migrations
- contribute + admin pages become notices; no upload form, no login
- wrangler.toml: drop R2/D1 bindings and GitHub OAuth vars

Note: removing the bindings does not delete stored data. The R2 bucket
(puaskill-upload), the D1 database (pua-uploads-db) and the
GITHUB_CLIENT_SECRET / SESSION_SECRET secrets must be deleted in the
Cloudflare dashboard separately.

Guard rail:
- add evals/test-no-telemetry.sh: reverse assertions over the whole repo
  (collection hosts, endpoint paths, outbound request bodies, deleted files,
  hook registrations, CF bindings) plus a positive control that local
  feedback still works. Verified by injecting both a naive and an evasive
  upload; 4 and 2 gates fired respectively.
- test-upload-flow / test-heartbeat / test-feedback-auth asserted that
  collection worked, so they were replaced rather than merely deleted --
  deleting them would have removed the guard along with the feature.

hooks/sanitize-session.sh is kept as a standalone offline redaction tool.
Unlike the deleted TypeScript port it does not split input per line, so the
multiline PEM pattern still matches (issue #134 ID-001 did not apply to it).

Refs #134, #98, #100
2026-08-29 15:57:20 +08:00

1.6 KiB
Raw Permalink Blame History

description
description
PUA 离线模式 — 关闭本地反馈问卷,保留本地 PUA 行为。/pua:offline。Triggers on: '/pua:offline', '离线模式', '封闭网络', 'offline mode', 'no network'.

开启 PUA 离线模式,适用于内网、封闭网络,或不希望任务结束时被反馈问卷打断的环境。

注意PUA Skill 已移除全部联网上报功能session 上传 / 评分上报 / 心跳 telemetry / 排行榜),默认就不发送任何数据。此命令现在只控制本地反馈问卷是否弹出,不再是"关闭上报"的开关。

执行

mkdir -p "$HOME/.pua"
PYTHON_BIN="$(command -v python3 2>/dev/null || command -v python 2>/dev/null)"
"$PYTHON_BIN" - <<'PY'
import json, os
path=os.path.expanduser('~/.pua/config.json')
try:
    data=json.load(open(path, encoding='utf-8'))
except Exception:
    data={}
data['offline']=True
data['feedback_frequency']=0
data.setdefault('always_on', True)
with open(path, 'w', encoding='utf-8') as f:
    json.dump(data, f, ensure_ascii=False, indent=2)
    f.write('\n')
PY

输出确认

[PUA OFFLINE] 已进入离线模式:保留本地压力/验证协议,不再弹出反馈问卷。恢复问卷时编辑 ~/.pua/config.json"offline": false 并设置 feedback_frequency

设计边界

  • 离线模式不等于 /pua:offPUA 行为仍可开启。
  • 离线模式只关闭本地反馈问卷PUA Skill 本身已无任何联网上报代码,无需靠此开关阻止上传。
  • 不会替用户禁止模型或其他工具联网。真正的网络隔离仍应由运行环境、防火墙或工具权限控制完成。