@logicseek/hello-cc 1.1.0-rc.1 → 1.1.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/CHANGELOG.md +229 -108
  2. package/README.md +1 -10
  3. package/README.zh-CN.md +1 -8
  4. package/docs/codex-account.zh-CN.md +38 -0
  5. package/docs/codex-protocol.md +59 -0
  6. package/docs/commands.md +13 -28
  7. package/docs/commands.zh-CN.md +11 -20
  8. package/docs/dsh.md +5 -3
  9. package/docs/dsh.zh-CN.md +6 -4
  10. package/docs/macos-process-identity.md +15 -0
  11. package/docs/native.md +176 -6
  12. package/docs/native.zh-CN.md +138 -3
  13. package/docs/web-handoff.zh-CN.md +107 -5
  14. package/lib/cli/app.mjs +9 -6
  15. package/lib/cli/commands/coordination.mjs +7 -2
  16. package/lib/cli/commands/gc.mjs +14 -12
  17. package/lib/cli/commands/hook.mjs +16 -3
  18. package/lib/cli/commands/install.mjs +37 -9
  19. package/lib/cli/commands/lock.mjs +3 -1
  20. package/lib/cli/commands/misc.mjs +105 -13
  21. package/lib/cli/commands/native.mjs +41 -48
  22. package/lib/cli/commands/peer.mjs +3 -0
  23. package/lib/cli/commands/run.mjs +13 -6
  24. package/lib/cli/commands/tmux.mjs +1 -2
  25. package/lib/cli-runtime.mjs +19 -2
  26. package/lib/core/coordination/gc-plan.mjs +5 -0
  27. package/lib/core/coordination/locks.mjs +3 -1
  28. package/lib/core/peers/evidence.mjs +21 -1
  29. package/lib/core/peers/tmux-safety.mjs +4 -0
  30. package/lib/core/sessions/hook-root-identity.mjs +47 -0
  31. package/lib/core/sessions/launch.mjs +7 -1
  32. package/lib/db/connection.mjs +67 -21
  33. package/lib/diagnostics/codex-protocol.mjs +105 -0
  34. package/lib/guidance.mjs +20 -36
  35. package/lib/integrations/codex-account.mjs +143 -0
  36. package/lib/integrations/dsh-collaboration.mjs +3 -4
  37. package/lib/integrations/dsh.mjs +4 -2
  38. package/lib/integrations/native/claude.mjs +53 -9
  39. package/lib/integrations/native/codex.mjs +75 -15
  40. package/lib/integrations/native/dsh-acp.mjs +77 -24
  41. package/lib/integrations/native/index.mjs +4 -1
  42. package/lib/integrations/native/interactions.mjs +16 -3
  43. package/lib/integrations/native/jsonrpc.mjs +37 -5
  44. package/lib/integrations/native/telemetry.mjs +30 -0
  45. package/lib/process/identity.mjs +67 -28
  46. package/lib/process/pinned-cwd.mjs +302 -0
  47. package/lib/process/pinned-guidance.mjs +138 -0
  48. package/lib/process/pinned-project-state.mjs +105 -0
  49. package/lib/process/selected-cwd-identity.mjs +95 -0
  50. package/lib/runtime/buffer-evidence.mjs +7 -1
  51. package/lib/runtime/client.mjs +18 -1
  52. package/lib/runtime/native/client.mjs +12 -2
  53. package/lib/runtime/native/history.mjs +140 -0
  54. package/lib/runtime/native/launcher.mjs +106 -0
  55. package/lib/runtime/native/service.mjs +346 -52
  56. package/lib/runtime/native/store.mjs +75 -21
  57. package/lib/runtime/project-path.mjs +24 -5
  58. package/lib/runtime/projects.mjs +3 -0
  59. package/lib/runtime/state.mjs +61 -26
  60. package/lib/shared/file-lock.mjs +62 -17
  61. package/lib/shared/redact.mjs +2 -1
  62. package/lib/shared/socket-lock-worker.mjs +15 -6
  63. package/lib/web/agent-defaults.mjs +110 -0
  64. package/lib/web/auto-attach.mjs +3 -2
  65. package/lib/web/browser/contracts.d.ts +10 -0
  66. package/lib/web/browser/core.mjs +2005 -0
  67. package/lib/web/browser/project-data.mjs +158 -0
  68. package/lib/web/browser/session-sync.mjs +82 -0
  69. package/lib/web/browser-assets.mjs +19 -0
  70. package/lib/web/buffer-gc-runtime.mjs +2 -2
  71. package/lib/web/codex-app-server.mjs +104 -33
  72. package/lib/web/codex-sessions.mjs +60 -11
  73. package/lib/web/context-files.mjs +82 -0
  74. package/lib/web/cookie-auth.mjs +51 -3
  75. package/lib/web/external-sessions.mjs +22 -4
  76. package/lib/web/http-routes.mjs +237 -24
  77. package/lib/web/http.mjs +50 -4
  78. package/lib/web/liveness-reaper.mjs +2 -2
  79. package/lib/web/native-sessions.mjs +370 -21
  80. package/lib/web/project-contexts.mjs +235 -42
  81. package/lib/web/project-file-write.mjs +249 -0
  82. package/lib/web/project-files.mjs +268 -0
  83. package/lib/web/pty-sessions.mjs +11 -3
  84. package/lib/web/runtime-main.mjs +134 -82
  85. package/lib/web/session-serialize.mjs +87 -8
  86. package/lib/web/session-state-sync.mjs +98 -0
  87. package/lib/web/shutdown-diagnostics.mjs +38 -0
  88. package/lib/web/shutdown-response.mjs +21 -0
  89. package/lib/web/shutdown-state.mjs +91 -0
  90. package/lib/web/startup.mjs +76 -27
  91. package/lib/web/tmux-client-snapshot.mjs +85 -0
  92. package/lib/web/tmux-sessions.mjs +71 -7
  93. package/lib/web/tmux-stream.mjs +36 -8
  94. package/lib/web/ui-agent-defaults.mjs +149 -0
  95. package/lib/web/ui-agent-start.mjs +330 -0
  96. package/lib/web/ui-codex-account.mjs +81 -0
  97. package/lib/web/ui-codex.mjs +81 -73
  98. package/lib/web/ui-command-palette.mjs +21 -5
  99. package/lib/web/ui-file-writes.mjs +220 -0
  100. package/lib/web/ui-files.mjs +231 -0
  101. package/lib/web/ui-handoff.mjs +10 -2
  102. package/lib/web/ui-history.mjs +175 -105
  103. package/lib/web/ui-i18n.mjs +286 -8
  104. package/lib/web/ui-interactions.mjs +6 -4
  105. package/lib/web/ui-native-timeline.mjs +326 -0
  106. package/lib/web/ui-native.mjs +115 -51
  107. package/lib/web/ui-review.mjs +5 -3
  108. package/lib/web/ui-safe-markdown.mjs +79 -0
  109. package/lib/web/ui-session-tools.mjs +224 -0
  110. package/lib/web/ui-template.mjs +29 -1969
  111. package/lib/web/ui-terminal-find.mjs +5 -3
  112. package/lib/web/ui-workbench.mjs +5 -3
  113. package/lib/web/ui-workspace.mjs +9 -2
  114. package/package.json +8 -2
  115. package/scripts/benchmark-session-sync.mjs +53 -0
  116. package/scripts/codex-protocol.mjs +88 -0
  117. package/scripts/dsh-approval-layers-acceptance.mjs +172 -0
  118. package/scripts/dsh-package-provenance.mjs +118 -0
  119. package/scripts/helpers/gc-clock-observation.mjs +33 -0
  120. package/scripts/native-bounded-live-acceptance.mjs +193 -0
  121. package/scripts/native-fixture-root.mjs +49 -0
  122. package/scripts/native-installed-acceptance.mjs +284 -25
  123. package/scripts/native-stability-checks.mjs +40 -0
  124. package/scripts/regression-cookie-expiry.mjs +70 -0
  125. package/scripts/regression-http-transport.mjs +9 -0
  126. package/scripts/regression-terminal-marker.mjs +95 -0
  127. package/scripts/regression.mjs +655 -188
  128. package/scripts/shim-reentry-probe.mjs +105 -0
  129. package/scripts/web-acceptance-diagnostics.mjs +90 -0
  130. package/scripts/web-codex-account-acceptance.mjs +178 -0
  131. package/scripts/web-file-preview-checks.mjs +302 -0
  132. package/scripts/web-mcp-form-acceptance.mjs +22 -7
  133. package/scripts/web-mcp-form-live-acceptance.mjs +1 -1
  134. package/scripts/web-native-handoff-checks.mjs +128 -0
  135. package/scripts/web-native-interaction-acceptance.mjs +152 -18
  136. package/scripts/web-native-interaction-diagnostics.mjs +80 -0
  137. package/scripts/web-native-model-acceptance.mjs +22 -7
  138. package/scripts/web-native-retry-checks.mjs +177 -0
  139. package/scripts/web-session-tools-checks.mjs +112 -0
  140. package/scripts/web-workbench-acceptance.mjs +438 -0
  141. package/scripts/web-workbench-installed-acceptance.mjs +122 -0
package/docs/dsh.md CHANGED
@@ -8,7 +8,7 @@ The tested runtime is `@deepseek-ai/dsh@0.2.0-rc.2`, with matching plugin versio
8
8
 
9
9
  Supported hosts are Linux and macOS; on Windows use WSL. Native Windows shells are not supported. Device acceptance must be recorded separately from container verification.
10
10
 
11
- The source and real DeepSeek model acceptance are complete locally; no new npm release has been published. Use this checkout's CLI when testing:
11
+ This integration has been included since hello-cc 1.0.2 on the normal npm `latest` channel. With Node.js 24+, install it using `npm install -g @logicseek/hello-cc`. To test a source checkout instead, use:
12
12
 
13
13
  ```bash
14
14
  node /absolute/path/to/hello-cc/bin/hcc.mjs --root /path/to/project dsh setup --mode cordis
@@ -18,6 +18,8 @@ node /absolute/path/to/hello-cc/bin/hcc.mjs --root /path/to/project dsh web -- -
18
18
 
19
19
  Below, `hcc` means a CLI containing these changes. An older global installation may not include them.
20
20
 
21
+ macOS 1.0.5 upgrades use a stable boot-session identity. Follow the [process identity migration notes](macos-process-identity.md) and restart owned runtimes normally.
22
+
21
23
  ## Choose An Entry Point
22
24
 
23
25
  | Entry | Use | Lifecycle owner |
@@ -113,7 +115,7 @@ Project overlays work directly from source. The managed manifest records the Cor
113
115
 
114
116
  ```bash
115
117
  npm pack --ignore-scripts
116
- dsh plugin --profile web add /absolute/path/to/logicseek-hello-cc-1.0.1.tgz
118
+ dsh plugin --profile web add /absolute/path/to/logicseek-hello-cc-1.0.5.tgz
117
119
  ```
118
120
 
119
121
  Harness requires explicit approval for native dependency builds. If add returns `ERR_PNPM_IGNORED_BUILDS`, merge the following into the selected profile's `pnpm-workspace.yaml` and rerun the same add command. The default path is `~/.dsh/profiles/web/pnpm-workspace.yaml`; use the configured DSH_HOME when different. Preserve existing settings and approve only the candidate's pinned native dependency:
@@ -123,7 +125,7 @@ allowBuilds:
123
125
  node-pty@1.2.0-beta.15: true
124
126
  ```
125
127
 
126
- Harness selects bundles through the profile's `dsh.profile.bundles`; do not also load the project Cordis/hooks overlay. Actual npm installation, official add/repeated add/remove, profile resolution and real-model collaboration calls have passed. The actual macOS desktop profile was installed and hot-loaded on 2026-10-02. Its paired ACP worker completed real collaboration calls using the existing DeepSeek route. The initially configured desktop sub2api model returned HTTP 403 because that account only accepts official Codex clients. After the desktop default was observed to have changed to official DeepSeek, a new session completed hcc_state, hcc_message_send and a real completed turn with that existing selection. The original sub2api route restriction remains. npm publication was not performed. Harness manages profile package removal; project-overlay integration is disabled with `setup --mode off`.
128
+ Harness selects bundles through the profile's `dsh.profile.bundles`; do not also load the project Cordis/hooks overlay. Actual npm installation, official add/repeated add/remove, profile resolution and real-model collaboration calls have passed. The actual macOS desktop profile was installed and hot-loaded on 2026-10-02. Its paired ACP worker completed real collaboration calls using the existing DeepSeek route. The initially configured desktop sub2api model returned HTTP 403 because that account only accepts official Codex clients. After the desktop default was observed to have changed to official DeepSeek, a new session completed hcc_state, hcc_message_send and a real completed turn with that existing selection. The original sub2api route restriction remains. Maintenance releases use the normal npm latest channel. Harness manages profile package removal; project-overlay integration is disabled with `setup --mode off`.
127
129
 
128
130
  See Cordis/native acceptance (source checkout: `docs/verification/2026-10-02-dsh-cordis-native.md`), bridge acceptance (source checkout: `docs/verification/2026-10-02-dsh-official-bridge.md`), and the integration plan (source checkout: `docs/plans/2026-10-02-dsh-integration.md`). Real-model checks used temporary projects and owned processes, without replacing existing user sessions. The isolated order fixture passed artifact/evidence/handoff/lock-release/task-completion checks. See the Mac device receipt (source checkout: `docs/verification/2026-10-02-dsh-device-install.md`). Publication, deployment, other-device installation and genuine business acceptance remain separate delivery stages.
129
131
 
package/docs/dsh.zh-CN.md CHANGED
@@ -8,7 +8,7 @@ DeepSeek Harness(`dsh`)可以与 Claude Code、Codex 共用 hello-cc 的项
8
8
 
9
9
  支持 Linux 和 macOS;Windows 使用 WSL,不支持原生 Windows shell。容器验证与实际设备验收分别记录。
10
10
 
11
- 代码已在本地实现并做真实 DeepSeek 模型验收,尚未发布新的 npm 版本。验证源码时,用本仓库的 CLI:
11
+ 此接入自 hello-cc 1.0.2 起提供,沿用 npm 的 latest 标签。在 Node.js 24+ 环境执行 `npm install -g @logicseek/hello-cc` 安装。验证源码时,用本仓库的 CLI:
12
12
 
13
13
  ```bash
14
14
  node /absolute/path/to/hello-cc/bin/hcc.mjs --root /path/to/project dsh setup --mode cordis
@@ -18,6 +18,8 @@ node /absolute/path/to/hello-cc/bin/hcc.mjs --root /path/to/project dsh web -- -
18
18
 
19
19
  下文 `hcc` 指包含这些代码的 CLI。已有的全局 `hcc` 未必包含此接入。
20
20
 
21
+ macOS 从 1.0.5 起使用稳定的启动周期标记。升级时按[进程身份迁移说明](macos-process-identity.md)正常重启所管理的运行时,保留身份无法比较的旧进程。
22
+
21
23
  ## 选择入口
22
24
 
23
25
  | 入口 | 适用场景 | 会话由谁持有 |
@@ -115,7 +117,7 @@ hcc native start --peer dsh-reviewer --provider dsh --binary /absolute/path/to/d
115
117
 
116
118
  ```bash
117
119
  npm pack --ignore-scripts
118
- dsh plugin --profile web add /absolute/path/to/logicseek-hello-cc-1.0.1.tgz
120
+ dsh plugin --profile web add /absolute/path/to/logicseek-hello-cc-1.0.5.tgz
119
121
  ```
120
122
 
121
123
  Harness 的 pnpm 策略要求明确允许原生依赖构建。若首次 add 返回 `ERR_PNPM_IGNORED_BUILDS`,在所选 profile 的 `pnpm-workspace.yaml` 中合并以下配置,然后重跑同一 add 命令;默认位置是 `~/.dsh/profiles/web/pnpm-workspace.yaml`,自定义 DSH_HOME 时以该目录为准。保留文件中已有设置,只批准候选包使用的固定版本:
@@ -125,9 +127,9 @@ allowBuilds:
125
127
  node-pty@1.2.0-beta.15: true
126
128
  ```
127
129
 
128
- 安装后由 Harness profile 的 `dsh.profile.bundles` 选择包;不要再同时加载项目 Cordis/hooks overlay。bundle 已通过实际 npm 安装、官方 add/重复 add/remove、隔离 profile 加载和真实模型工具调用。2026-10-02 已安装到本机真实 desktop profile 并热加载,配套 ACP 使用既有 DeepSeek 路由完成真实工具调用;初次桌面 sub2api 模型返回账户仅允许 Codex 官方客户端的 403;随后桌面默认模型已变为官方 DeepSeek,沿用当时配置的新建会话完成 hcc_state、hcc_message_send 和真实 completed 回合。原 sub2api 路由限制仍存在。npm 尚未发布。profile 插件安装/移除由 Harness 管理,项目 overlay 则使用 `setup --mode off` 关闭。
130
+ 安装后由 Harness profile 的 `dsh.profile.bundles` 选择包;不要再同时加载项目 Cordis/hooks overlay。bundle 已通过实际 npm 安装、官方 add/重复 add/remove、隔离 profile 加载和真实模型工具调用。2026-10-02 已安装到本机真实 desktop profile 并热加载,配套 ACP 使用既有 DeepSeek 路由完成真实工具调用;初次桌面 sub2api 模型返回账户仅允许 Codex 官方客户端的 403;随后桌面默认模型已变为官方 DeepSeek,沿用当时配置的新建会话完成 hcc_state、hcc_message_send 和真实 completed 回合。原 sub2api 路由限制仍存在。后续维护版本沿用 npm latest 标签发布。profile 插件安装/移除由 Harness 管理,项目 overlay 则使用 `setup --mode off` 关闭。
129
131
 
130
- 验证记录见 Cordis/native 验收 (源码目录: `docs/verification/2026-10-02-dsh-cordis-native.md`)、兼容桥记录 (源码目录: `docs/verification/2026-10-02-dsh-official-bridge.md`) 和详细接入计划 (源码目录: `docs/plans/2026-10-02-dsh-integration.md`)。真实模型验收在临时项目和自有进程中完成;既有会话与模型凭据保留;本机实际安装记录见 Mac 接入验收 (源码目录: `docs/verification/2026-10-02-dsh-device-install.md`)。尚未发布/部署,也没有跨设备验收或真实业务签收;隔离订单样例已完成报告、证据、交接、解锁与任务结束验证。
132
+ 验证记录见 Cordis/native 验收 (源码目录: `docs/verification/2026-10-02-dsh-cordis-native.md`)、兼容桥记录 (源码目录: `docs/verification/2026-10-02-dsh-official-bridge.md`) 和详细接入计划 (源码目录: `docs/plans/2026-10-02-dsh-integration.md`)。真实模型验收在临时项目和自有进程中完成;既有会话与模型凭据保留;本机实际安装记录见 Mac 接入验收 (源码目录: `docs/verification/2026-10-02-dsh-device-install.md`)。Linux 容器已验证,实际 WSL/员工设备和真实业务签收尚未完成;隔离订单样例已完成报告、证据、交接、解锁与任务结束验证。
131
133
 
132
134
  可用下面的安装验收脚本重现 npm 安装、官方 `plugin add` / 重复 add / remove,以及安装后的公共 CLI。`--run-live` 会沿用已有 DeepSeek 认证,验证 ACP 权限拒绝和一个隔离订单汇总任务;没有该参数时不调用真实模型。脚本只使用本次创建的 HOME、DSH_HOME、项目和进程。
133
135
 
@@ -0,0 +1,15 @@
1
+ # macOS 进程身份与升级
2
+
3
+ macOS 的 `kern.boottime` 是墙上时钟时间,同一次开机期间也可能因时钟校正改变。以它的秒、微秒字段识别进程,会把仍在运行的进程误判为新实例。
4
+
5
+ Darwin 身份改为 `darwin:<kern.bootsessionuuid>:<UTC/C ps lstart>`。开机 UUID 严格验证并统一小写;缺失、查询失败或格式错误时返回 `unknown`,不会退回 `kern.boottime`。进程开始时间仍前后读取两次,状态中的 zombie 仍视为已退出。PID、进程开始时间和命令摘要的所有权校验没有放宽。
6
+
7
+ 旧版本保存的 `<boot 秒>:<boot 微秒>:<ps lstart>` 无法可靠转换成新标记。对同一存活 PID,旧、新格式之间返回 `unknown`,既不授予所有权,也不证明旧进程已经退出。其 runtime 指针不因超过普通未知状态宽限期而被回收;Cordis 恢复和 native 启动也必须保留仍存活的旧 owner。与真实进程退出或同格式 PID 复用有关的判定保持原有规则。
8
+
9
+ 这种专用 `unknown` 同样保留 peer/binding、过期锁和缓冲文件,阻止过期任务被接管;它不会赋予 `live` 身份、续租或写权限。普通未知状态的超时策略不变。
10
+
11
+ 早期 Web 工作台候选使用过 `mac:<boot UUID>:<ps lstart>` 前缀。它与正式的 `darwin:` 格式交叉比较时同样保留为 `unknown`,不因前缀变化回收仍存活的候选进程;需要由原版本正常关闭后再启动新版本。
12
+
13
+ 升级前,先用原版本正常关闭所属 native worker/runtime,正常退出 Harness Desktop,再安装并启动新版本,使运行中的 owner 重新建立身份。保留账号配置、会话与协作数据库;不要手工改写旧身份、删除仍存活 runtime 的指针,或仅凭 PID 强行接管。若旧进程已经退出,OS 的死亡证据仍允许正常恢复。没有完整身份的其他未知状态继续使用原有策略。
14
+
15
+ 回归覆盖同一次开机期间 `kern.boottime` 漂移、不同 boot UUID、错误和缺失 UUID、PATH 缺失时的固定系统路径、语言环境、PID 复用、exec、真实自有 zombie,以及跨格式 runtime 指针、native 启动和 Cordis 恢复边界。
package/docs/native.md CHANGED
@@ -16,6 +16,41 @@ multiple pending inbox messages into the same turn. ACP resume and session close
16
16
  depend on the extensions the provider advertises. HCC does not claim that an ACP
17
17
  resume replays the original conversation transcript.
18
18
 
19
+ ## Session fork and retries with the original ID
20
+
21
+ `hcc native fork --parent codex-reviewer --peer codex-branch` invokes the provider's
22
+ session fork. Codex uses `thread/fork`; Claude uses the optional SDK's
23
+ `forkSession`. The child receives a distinct session ID, executor, delivery records
24
+ and subsequent history, plus its own MCP scope when the sandbox permits HCC tools.
25
+ The parent keeps its identity. After
26
+ closing the child, `native start --peer codex-branch --provider codex --resume
27
+ last` resumes the child session. Fork inherits the parent's working directory
28
+ and verifies its identity; pending inbox messages and permission grants are not
29
+ copied.
30
+
31
+ Only saved HCC-owned native sessions can fork. The parent must be idle or
32
+ explicitly closed, without an active turn, pending approval, queued message or
33
+ unresolved delivery. Parent send, close and inbox dispatch are fenced while
34
+ forking. Existing TUI/Desktop sessions are outside this scope. A Claude SDK
35
+ without `forkSession` reports unsupported capability. DeepSeek Harness
36
+ 0.2.0-rc.2 ACP does not implement fork; HCC does not replay a transcript to
37
+ simulate native fork.
38
+
39
+ A new message may use a unique `--submission-id` containing 8–100 letters,
40
+ digits, underscores or hyphens. After a lost receipt, inspect `native
41
+ deliveries`, then retry the same worker, sender, task and body with the original
42
+ ID. Matching retries return the original durable receipt; changed payloads or
43
+ targets are rejected. The project database commits the message and submission
44
+ ID together. If the native delivery projection was not yet saved, retry or
45
+ worker recovery repairs the original delivery while retaining local user
46
+ origin. Retrying an existing `uncertain` delivery does not replay execution.
47
+
48
+ Web offers **Retry same submission** for an unconfirmed send. Explicit
49
+ confirmation follows receipt inspection, and the retry must retain the original
50
+ executor and body. Later draft edits are preserved. Executor or project changes
51
+ disable the old retry. Missing durable pending records or expired messages are
52
+ rejected rather than sent as new work.
53
+
19
54
  ## Requirements
20
55
 
21
56
  Use Node.js 24 or later and a provider installed and authenticated in the same
@@ -54,6 +89,49 @@ real Web approval receipt (source checkout: `docs/verification/2026-10-02-native
54
89
  exercises this default project lookup without injecting a query function. It
55
90
  does not verify a published package or an employee installation.
56
91
 
92
+ ## Start from Web
93
+
94
+ Run `hcc web`, select the project, and choose **New Agent**. Codex, Claude and
95
+ DeepSeek Harness default to **Background Agent**, which creates a native worker
96
+ and starts or reuses the project's independent native runtime. You do not need
97
+ to run `hcc native start` first; the provider requirements above still apply.
98
+
99
+ **Settings** can save the project default provider plus a model and an in-project
100
+ working directory for each provider. **New Agent** prefills these values; when no
101
+ directory is configured it uses the project root. The worker continues to share the selected
102
+ project's HCC task and message bus. Select or add another project to work outside
103
+ that root. **Model (optional)** can stay empty to use the provider's configured
104
+ default; any supplied value must be supported by that provider. **Name (optional)**
105
+ can stay empty for a generated peer name.
106
+
107
+ These defaults live in the selected HCC project database and apply only to future
108
+ Web native creations. They do not change running workers, history resume, CLI
109
+ launches or provider account files. Concurrent saves use revision checks; reload
110
+ and review the latest values after a conflict. Clearing the model in the creation
111
+ form explicitly chooses the provider's own default for that one worker.
112
+
113
+ **New Agent** creates a new native session. **History → HCC retained history**
114
+ browses saved native workers and explicitly resumes workers recorded as closed.
115
+ Resume keeps the peer and provider session ID, rechecks ownership, and starts a
116
+ new executor. CLI resume remains available. **Advanced options** keeps the terminal
117
+ CLI and Codex App Server paths, including their existing history controls. Shell
118
+ uses a terminal; DeepSeek Harness uses a background worker.
119
+
120
+ After creation, send prompts and inspect receipts or approvals in the same Web
121
+ session. Creating a worker does not by itself complete a model task. Closing
122
+ the page or stopping Web preserves the independent native runtime and worker;
123
+ explicitly close the worker when it is no longer needed. The dated acceptance
124
+ records below do not establish real-model or release acceptance of this new
125
+ creation or history/resume entries. See the [Web guide](web-handoff.zh-CN.md).
126
+
127
+ The **Files** entry browses saved project files and artifacts without creating a
128
+ worker or sending file contents to a model. It provides bounded text, Markdown,
129
+ image, PDF and static HTML previews. Explicit uploads create new project files
130
+ without replacing existing names (up to 10 MiB); complete UTF-8 text files can be
131
+ edited and saved with a revision check (up to 1 MiB). Conflicts and uncertain write
132
+ results keep the draft for inspection. These actions do not attach files to a model
133
+ conversation. See the [project file guide](web-handoff.zh-CN.md#上传与编辑项目文件).
134
+
57
135
  ## CLI
58
136
 
59
137
  Run commands from the project you want the workers to share, or select it with
@@ -78,12 +156,56 @@ message bus even when `--cwd DIR` selects another working directory. `--model
78
156
  MODEL` selects a provider-supported model. `--binary PATH` overrides the Codex
79
157
  or dsh executable. Claude uses the SDK and rejects `--binary`.
80
158
 
159
+ ### Codex read-only file sandbox
160
+
161
+ ```sh
162
+ hcc native start --peer codex-readonly --provider codex --sandbox read-only
163
+ hcc native close --peer codex-readonly
164
+ hcc native start --peer codex-readonly --provider codex --resume last
165
+ ```
166
+
167
+ Only Codex accepts `--sandbox read-only|workspace-write`. New sessions default to
168
+ the existing `workspace-write` behavior. Resume inherits the stored policy when
169
+ omitted and rejects a different explicit policy; use a new worker for a different
170
+ policy. Legacy saved Codex workers migrate to their original workspace-write mode.
171
+ Retries before a session exists inherit the selected policy unless explicitly changed. Before
172
+ creating/resuming a Codex worker, both CLI and Web require the runtime's sandbox-policy
173
+ protocol version. It refuses an older daemon before sending a create request and
174
+ does not restart it automatically. Creation is bound to the just-verified runtime
175
+ generation; a missing identity or instance replacement rejects the request without
176
+ following the successor or retrying. After existing project work finishes, stop the
177
+ old runtime and start it with this version. Older runtime code cannot enforce the
178
+ new stored policy; downgrade execution is outside this read-only guarantee.
179
+ Web can still inspect or close a legacy worker, but refuses Codex send/respond
180
+ when its fresh snapshot has no sandbox policy. Read-only workers must also report
181
+ provider verification before those actions. Web mutations are bound to the runtime
182
+ generation observed immediately before admission.
183
+
184
+ Read-only fixes approval policy to `never`, requests `readOnly` and disabled
185
+ sandbox network for each new turn, and denies command/file/permission escalation
186
+ and MCP elicitation. Ordinary user questions remain available. Start/resume fail
187
+ closed if the provider does not report the requested policy, or if a resumed
188
+ thread already has an active turn. Forks require the same checks. `sandboxVerified` means matching provider
189
+ readback, not independent proof of operating-system enforcement.
190
+
191
+ HCC does not inject its scoped mutation MCP or command instructions into a
192
+ read-only worker. Its control plane still records messages, replies, delivery
193
+ receipts and audit events. The provider file sandbox does not make every external
194
+ service, user-configured MCP server or hook read-only; strict acceptance still
195
+ needs a private HOME without external tools. This policy is separate from the Web
196
+ viewer/control lease: a controller may still submit a review to a read-only worker.
197
+
198
+ Available since `1.1.0-rc.4`. Native Web snapshots retain `sandbox` and
199
+ `sandboxVerified`. Choose the read-only policy with the CLI. Native forks inherit the saved parent
200
+ policy and cannot override it; the child is independently verified before use.
201
+
81
202
  | Command | Options / behavior |
82
203
  | --- | --- |
83
204
  | `hcc native up` | Start or reuse the project's background runtime |
84
205
  | `hcc native status` | Inspect persisted worker state and runtime identity |
85
- | `hcc native start` | Required `--peer NAME --provider codex\|claude\|dsh`; optional `--cwd DIR --model MODEL --resume last`; `--binary PATH` is available only for Codex and dsh |
86
- | `hcc native send` | Required `--peer NAME --body TEXT`; optional `--from NAME --task ID`; returns a durable message/submission receipt |
206
+ | `hcc native start` | Required `--peer NAME --provider codex\|claude\|dsh`; optional `--cwd DIR --model MODEL --resume last`; `--binary PATH` is available only for Codex and dsh; `--sandbox read-only\|workspace-write` is Codex-only |
207
+ | `hcc native fork` | Required `--parent NAME --peer NEW_NAME`; optional `--model MODEL --binary PATH`; forks an HCC-owned Codex or Claude session into a new worker |
208
+ | `hcc native send` | Required `--peer NAME --body TEXT`; optional `--from NAME --task ID --submission-id ID`; returns a durable message/submission receipt |
87
209
  | `hcc native deliveries` | Optional `--peer NAME`; inspect delivery receipts |
88
210
  | `hcc native events` | Required `--peer NAME`; optional `--after ID`; inspect a bounded event history |
89
211
  | `hcc native requests` | Requires `--peer NAME`; inspect pending requests bound to this executor, session and turn |
@@ -153,6 +275,13 @@ it does not attach to an existing live TUI or desktop instance. HCC cannot prove
153
275
  that an external application has independently opened the same saved session,
154
276
  so do not open the same conversation concurrently outside the owned runtime.
155
277
 
278
+ New saved workers also retain the filesystem identity of their working
279
+ directory. Resume requires that identity to still match, even if the path
280
+ spelling is unchanged. Older workers without that evidence remain readable in
281
+ HCC history but are not automatically resumable; manual review and association
282
+ are not yet implemented. Web history marks these records as unavailable before
283
+ the native service rechecks at admission.
284
+
156
285
  Native workers receive a worker-specific `HCC_ROOT`, `HCC_DB`, `HCC_PEER`, and
157
286
  `HCC_NATIVE_OWNER`. A provider hook must match the peer's native transport owner.
158
287
  Its native hook path only heartbeats that owner and renews its locks. It does
@@ -224,10 +353,14 @@ explicitly. Truncated requests can only be declined or cancelled. Nested schemas
224
353
 
225
354
  - Existing Codex/Claude/dsh terminal sessions remain on their original transport;
226
355
  attaching to or taking over an existing TUI/Desktop session is not implemented.
227
- - Web discovers existing native workers in the same project and exposes messages,
228
- delivery receipts, interruption, and explicit closure. Closing the page or Web
229
- runtime preserves the independent native worker. Human responses are bound to
230
- the current executor and turn. See the [Web handoff guide](web-handoff.zh-CN.md).
356
+ - Web can create Codex, Claude and dsh native workers, and discovers existing
357
+ workers in the same project. It exposes messages, delivery receipts,
358
+ interruption, and explicit closure. History reads retained project events and
359
+ explicitly resumes closed workers; it is not the provider's complete transcript.
360
+ Active workers and workers without confirmed closure cannot resume from this
361
+ entry. Closing the page or Web runtime
362
+ preserves the independent native worker. Human responses are bound to the
363
+ current executor and turn. See the [Web handoff guide](web-handoff.zh-CN.md).
231
364
  - Codex, Claude and dsh native workers receive project- and peer-scoped HCC MCP
232
365
  configuration. Writes still require provider permission and HCC ownership checks.
233
366
  - Provider-internal `SendMessage`, subagent/team discovery, and Codex delegation
@@ -367,3 +500,40 @@ Legacy deliveries retain peer origin during migration. This distinction does
367
500
  not grant tool permissions: writes and other gated tools still require approval.
368
501
  For delegated file work, first authorize the receiving agent's bounded task,
369
502
  then send the peer handoff.
503
+
504
+ ## Bounded stability acceptance
505
+
506
+ Add `--stability` to installed-package acceptance to run sustained work after
507
+ its lifecycle and cross-provider checks:
508
+
509
+ ```sh
510
+ node /absolute/path/to/acceptance-prefix/node_modules/@logicseek/hello-cc/scripts/native-installed-acceptance.mjs \
511
+ --run-live --codex-bin /absolute/path/to/codex --dsh-bin /absolute/path/to/dsh \
512
+ --archive /absolute/path/to/hello-cc.tgz --stability \
513
+ --stability-cycles 6 --stability-burst 2 --stability-idle-ms 30000 \
514
+ --stability-resume-every 2 --output /absolute/path/to/stability-receipt.json
515
+ ```
516
+
517
+ All three providers work concurrently. Each worker receives its whole burst
518
+ before the driver waits. Each reply must recall the original random marker
519
+ and the previous ticket from history, checking FIFO execution and retained
520
+ context. Duplicate submission IDs must yield exactly one reply and ACK.
521
+ Periodic worker close/resume and one normal owned-daemon restart preserve the
522
+ original sessions. Idle observation checks the control endpoint, pending
523
+ requests and identity. The final audit checks persisted deliveries, database
524
+ integrity, bounded event retention and absence of reply loops. Receipts retain
525
+ actual replies, failure state and owned-process memory samples. Failed work is
526
+ not replayed automatically or reclassified as successful after a retry.
527
+
528
+ Defaults are six cycles, two queued messages per worker per cycle, 30 seconds
529
+ of idle observation per cycle, and worker resume every two cycles. Limits are
530
+ 1–24 cycles, 1–4 messages, 0–300000 idle milliseconds and a 1–24 cycle resume
531
+ interval. These options require `--stability`. This is bounded authenticated
532
+ work, not a 24-hour soak, capacity benchmark or proof of no memory leak. A
533
+ successful DSH resume alone does not explain earlier context fluctuations.
534
+
535
+ `--stability-only` requires `--stability`. It bootstraps three real sessions and
536
+ runs stability work while skipping the baseline interruption, command approval
537
+ and model MCP communication scenarios. The receipt records this scope; skipped
538
+ scenarios require separate evidence. On any failure, the driver captures current
539
+ session snapshots, recent deliveries and events before closing owned workers.
@@ -14,6 +14,34 @@ Native 模式运行由 HCC 创建并持有的后台 worker。共享 peer、任
14
14
  不代表 host 会把多条待处理消息塞进同一个 turn。ACP 的 resume 和 session close
15
15
  取决于 provider 声明的扩展;不能把 ACP resume 等同于重放原始会话历史。
16
16
 
17
+ ## 会话 fork 与原 ID 重试
18
+
19
+ `hcc native fork --parent codex-reviewer --peer codex-branch` 使用 provider 自身的
20
+ 会话 fork。Codex 通过 `thread/fork`,Claude 通过可选 SDK 的 `forkSession` 创建
21
+ 新的会话 ID;子 worker 有独立 executor、消息投递记录和后续历史,策略允许 HCC
22
+ 工具时也有独立 MCP scope。
23
+ 父会话仍保留原身份;关闭子 worker 后可用 `native start --peer codex-branch
24
+ --provider codex --resume last` 恢复子会话。fork 继承父会话的工作目录,并复核目录
25
+ 身份,不复制父 worker 的未决 inbox 或权限批准。
26
+
27
+ 只能 fork HCC 持有且保存了会话 ID 的 native worker。父 worker 必须空闲或已明确
28
+ 关闭,无活动 turn、待审批请求、排队或结果不明的投递;fork 期间暂停父 worker
29
+ 的发送、关闭和 inbox 分发。已有 TUI/Desktop 会话不在此范围内。Claude SDK
30
+ 缺少 `forkSession` 时明确报不支持。DeepSeek Harness 0.2.0-rc.2 的 ACP 实现未提供
31
+ fork;HCC 不用 transcript 重放冒充原生 fork。
32
+
33
+ 每条新消息可指定唯一的 `--submission-id`,格式为 8–100 个英文字母、数字、下划线
34
+ 或连字符。遇到回执丢失时先查 `native deliveries`,然后对同一 worker、sender、task
35
+ 和正文沿用原 ID 重试。相同 ID 返回原持久回执,正文或目标变化会被拒绝。项目
36
+ 数据库同时保存消息和 submission ID;若消息已提交而 native 投递记录尚未写入,
37
+ 重试或 worker 恢复会补齐原记录,保留用户请求来源。已有 `uncertain` 投递不会
38
+ 因为重试被自动重放。
39
+
40
+ Web 遇到未确认提交时提供“沿用原提交重试”。此操作需核对持久回执后明确确认,
41
+ 并保持原执行器身份与原正文;之后编辑的草稿会保留。执行器或项目变化时禁用原
42
+ 提交重试。没有匹配的持久 pending 记录、或原消息已被清理时拒绝重试;不会把
43
+ 原 ID 当作新工作发送。
44
+
17
45
  ## 环境准备
18
46
 
19
47
  需要 Node.js 24 或更新版本,并在运行 HCC 的同一环境中安装、登录对应 provider。
@@ -48,6 +76,38 @@ npm install --no-save --package-lock=false @anthropic-ai/claude-agent-sdk@0.3.28
48
76
  已有独立回执 (源码目录: `docs/verification/2026-10-02-native-web-claude-default-sdk.json`),不代表
49
77
  发布包或员工设备已完成安装验收。
50
78
 
79
+ ## 从 Web 新建
80
+
81
+ 运行 `hcc web`,选择项目,再点击“新建 Agent”。Codex、Claude 和 DeepSeek Harness
82
+ 默认使用“后台 Agent”,创建 native worker 并按需启动或复用该项目的独立 native
83
+ runtime。无需先运行 `hcc native start`;上述 provider 安装和认证要求仍然适用。
84
+
85
+ 顶部“设置”可保存项目默认 provider,以及各 provider 的默认模型和项目内工作目录。
86
+ 新建表单会预填这些值;未设置工作目录时使用项目根目录。worker 继续共享所选项目的
87
+ HCC 任务和消息总线。要在根目录之外工作,先选择或添加相应项目。“模型(可选)”
88
+ 留空时使用 provider 当前配置,填写时需使用该 provider 支持的模型值;“名称(可选)”
89
+ 留空时自动生成 peer 名称。
90
+
91
+ 这些默认值只用于后续 Web 新建 native worker,不改变既有 worker、恢复或 CLI 启动。
92
+ 配置由项目数据库保存,跨浏览器读取;并发保存发生冲突时需重新载入核对。详情见
93
+ [项目启动默认值](web-handoff.zh-CN.md#项目-agent-启动默认值)。
94
+
95
+ “新建 Agent”创建新 native 会话;项目栏“历史”中的“HCC 保留历史”可查看已保存的
96
+ worker,并显式恢复已关闭的 worker。恢复保留原 peer 和 provider 会话 ID,重新核对
97
+ 所有权后启动新执行器。CLI resume 继续可用。“高级选项”保留终端 CLI、Codex App
98
+ Server 及各自原有的历史恢复操作。Shell 使用终端,DeepSeek Harness 使用后台 worker。
99
+
100
+ 创建后在同一 Web 会话内发送提示、查看投递回执或处理审批。创建 worker 不代表模型
101
+ 任务已经完成。关闭页面或停止 Web 都保留独立 native runtime 和 worker;不再需要时
102
+ 明确关闭 worker。下方带日期的既有验收记录不代表这个新建入口已通过真实模型或发布
103
+ 验收。详细操作见 [Web 指南](web-handoff.zh-CN.md)。
104
+
105
+ 顶部“文件”可浏览项目文件与生成产物,也可显式上传新文件(最大 10 MiB)或编辑完整
106
+ UTF-8 文本(最大 1 MiB),无需创建 worker。同名上传不覆盖,文本保存会检查版本;
107
+ 冲突或回执不确定时保留草稿。这些操作不会把文件发送给模型。详情见
108
+ [文件与产物预览](web-handoff.zh-CN.md#浏览文件与产物)及
109
+ [上传与编辑](web-handoff.zh-CN.md#上传与编辑项目文件)。
110
+
51
111
  ## CLI 使用
52
112
 
53
113
  在需要共享状态的项目目录中运行,或使用已有全局 `--root`、`--db` 指定项目和数据库。
@@ -71,12 +131,50 @@ hcc msg inbox --peer coordinator
71
131
  `--binary PATH` 覆盖 Codex 或 dsh 可执行文件。Claude 使用 SDK,传入 `--binary`
72
132
  会直接报错。
73
133
 
134
+ ### Codex 文件只读沙箱
135
+
136
+ ```sh
137
+ hcc native start --peer codex-readonly --provider codex --sandbox read-only
138
+ # 关闭后恢复原会话时继承已保存的策略;不要改成 workspace-write。
139
+ hcc native close --peer codex-readonly
140
+ hcc native start --peer codex-readonly --provider codex --resume last
141
+ ```
142
+
143
+ `--sandbox` 仅支持 Codex 的 `read-only` 和 `workspace-write`。新会话未指定时保持
144
+ `workspace-write`;恢复时未指定则继承存储策略,显式不同的策略会被拒绝,需要另建
145
+ worker。旧版本记录迁移为原有 `workspace-write` 行为;无权限推断或自动升级。
146
+ 首次初始化尚未建立会话时,重试默认继承已选择策略,也可显式更改。CLI 与 Web 创建/恢复 Codex worker
147
+ 前检查后台服务的沙箱协议版本;旧服务不支持时在发送创建请求前拒绝,不自动重启。
148
+ 创建请求绑定刚核实的 runtime generation;期间实例被替换或身份缺失时拒绝发送,
149
+ 不会跟随新实例自动重试。
150
+ 应等项目任务结束后由用户停止旧 runtime,再以新版本启动。不要用旧版本 runtime
151
+ 读取新版本只读记录:旧代码不了解该策略,回退执行不属于只读保障。
152
+ Web 仍可查看或关闭旧 worker;其最新快照不含沙箱策略时,拒绝 Codex 发送和回答审批/问题。
153
+ 只读 worker 还必须回报 provider 已校验策略,才能执行这两类操作。Web 写请求绑定准入前
154
+ 刚读取的 runtime generation,不会自动跟随替换实例。
155
+
156
+ 只读模式固定 `approvalPolicy: never`,每个新 turn 显式请求 `readOnly`、关闭沙箱网络,
157
+ 拒绝命令/文件/权限提升和 MCP 授权表单;普通用户问题仍可回答。启动/恢复要求
158
+ provider 回报相符策略,否则关闭自有连接并报错;fork 子会话执行相同校验。已有活动 turn 的只读恢复也拒绝,
159
+ 不能用新策略为正在执行的旧 turn 作保证。`sandboxVerified` 仅表示 provider 回报匹配,
160
+ 不是一份操作系统行为证明。
161
+
162
+ HCC 不为只读 worker 注入自有的任务/锁/结果写操作 MCP,也不提示模型执行 HCC
163
+ 写命令。HCC 控制面仍保存消息、回复、投递和审计。Codex 的文件沙箱不等于所有外部
164
+ 服务或用户配置的 MCP/hooks 都只读;严格隔离验收仍须独立 HOME、无外部工具。
165
+ 它也不同于网页“观察/控制”权限:控制者仍可向只读 worker 发送审阅请求。
166
+
167
+ 此功能自 `1.1.0-rc.4` 起提供。Web 的 native 快照会保留 `sandbox` 与 `sandboxVerified`。
168
+ 请通过 CLI 选择只读策略。
169
+ 原生 fork 继承父会话的持久化策略,不能覆盖或提升;子会话启用前会独立校验。
170
+
74
171
  | 命令 | 参数与作用 |
75
172
  | --- | --- |
76
173
  | `hcc native up` | 启动或复用本项目后台 runtime |
77
174
  | `hcc native status` | 查看持久化 worker 状态和 runtime 身份 |
78
- | `hcc native start` | 必须 `--peer NAME --provider codex\|claude\|dsh`;可选 `--cwd DIR --model MODEL --resume last`;`--binary PATH` 仅适用于 Codex 和 dsh |
79
- | `hcc native send` | 必须 `--peer NAME --body TEXT`;可选 `--from NAME --task ID`;返回持久消息/submission 回执 |
175
+ | `hcc native start` | 必须 `--peer NAME --provider codex\|claude\|dsh`;可选 `--cwd DIR --model MODEL --resume last`;`--binary PATH` 仅适用于 Codex 和 dsh;`--sandbox read-only\|workspace-write` 仅适用于 Codex |
176
+ | `hcc native fork` | 必须 `--parent NAME --peer NEW_NAME`;可选 `--model MODEL --binary PATH`;复制 HCC 持有的 Codex 或 Claude 会话到新 worker |
177
+ | `hcc native send` | 必须 `--peer NAME --body TEXT`;可选 `--from NAME --task ID --submission-id ID`;返回持久消息/submission 回执 |
80
178
  | `hcc native deliveries` | 可选 `--peer NAME`,查看投递回执 |
81
179
  | `hcc native events` | 必须 `--peer NAME`;可选 `--after ID`,查看有界事件历史 |
82
180
  | `hcc native requests` | 必须 `--peer NAME`;查看与该执行器、会话、turn 绑定的待处理请求 |
@@ -135,6 +233,11 @@ hcc native start --peer codex-reviewer --provider codex --resume last
135
233
  的连接恢复会话历史,不是附着已有的活动 TUI 或桌面实例。HCC 无法证明外部应用
136
234
  没有独立打开同一个保存会话,因此不要同时在 owned runtime 外写入该会话。
137
235
 
236
+ 新保存的 worker 还记录工作目录的文件系统身份;即使路径文字未变,恢复前也必须
237
+ 重新匹配该身份。缺少此证据的旧 worker 仍可在 HCC 历史中读取,但不能自动恢复;
238
+ 人工核验与关联流程尚未实现。Web 历史会先标为不可恢复,native 服务在实际接纳时
239
+ 再次校验。
240
+
138
241
  worker 获得明确的 `HCC_ROOT`、`HCC_DB`、`HCC_PEER`、`HCC_NATIVE_OWNER`。provider hook
139
242
  必须匹配该 peer 的 native transport owner。native hook 路径只刷新 owner 心跳和续
140
243
  期其锁,不覆盖 provider binding 或进程身份、不再次注入 inbox、不 ACK 消息,也
@@ -213,7 +316,9 @@ Web 刷新执行状态时在页面内存中保留填写内容;提交、请求
213
316
 
214
317
  - 尚未实现接管或 attach 已有 Codex/Claude/dsh TUI、桌面会话;这些会话继续使用原
215
318
  transport。
216
- - Web 可发现并控制同一项目的现有 native worker,提供消息、回执、中断和明确关闭。
319
+ - Web 可新建 Codex、Claude、dsh native worker,也可发现并控制同一项目的现有 worker,
320
+ 提供消息、回执、中断和明确关闭。“历史”提供 HCC 保留事件与已关闭 worker 的显式恢复;
321
+ 记录不是 provider 完整历史,活跃或停止未确认的 worker 不可从此入口恢复。
217
322
  关闭页面或 Web runtime 保留独立 native worker;支持与当前执行器、turn 绑定的人工应答。
218
323
  使用方式见 [Web 继续本地任务](web-handoff.zh-CN.md#本地-native-worker-接手)。
219
324
  - Codex、Claude 和 dsh native worker 自动获得项目与 peer 受限的 HCC MCP;
@@ -312,3 +417,33 @@ provider 版本、源码摘要、浏览器证据和清理结果;脚本不会
312
417
  消息总线送达的内容保持 peer 消息身份,即使发送方自称 `web` 或 `shell`。旧回执
313
418
  迁移后仍按 peer 消息处理。来源区分不授予工具权限,写入等受控操作仍需审批。
314
419
  委派文件任务时,先由用户明确授权接收 agent 的限定任务,再发送 peer 交接。
420
+
421
+ ## 有界稳定性验收
422
+
423
+ 安装包验收可加 `--stability`,在基础生命周期和跨 provider 通信之后运行持续负载:
424
+
425
+ ```sh
426
+ node /absolute/path/to/acceptance-prefix/node_modules/@logicseek/hello-cc/scripts/native-installed-acceptance.mjs \
427
+ --run-live --codex-bin /absolute/path/to/codex --dsh-bin /absolute/path/to/dsh \
428
+ --archive /absolute/path/to/hello-cc.tgz --stability \
429
+ --stability-cycles 6 --stability-burst 2 --stability-idle-ms 30000 \
430
+ --stability-resume-every 2 --output /absolute/path/to/stability-receipt.json
431
+ ```
432
+
433
+ 三个 provider 同时工作,每轮先向各 worker 排队投递整组消息。每条要求模型从
434
+ 历史中回忆原始随机标记和上一条消息的票据,验证串行处理顺序与上下文保留。
435
+ 每轮还重复提交同一提交 ID,核对只产生一条回复与一个 ACK;定期关闭并恢复
436
+ worker,在中点正常重启自有 daemon,再验证原 session 和历史。空闲窗口继续
437
+ 检查控制接口、pending 请求与会话身份。结束时核对持久投递、数据库完整性、
438
+ 事件保留上限与无回复循环。回执保留每条实际回复、失败状态和自有进程内存
439
+ 采样,不自动重放失败任务,也不把同轮重新尝试改写为成功。
440
+
441
+ 默认 6 轮、每 worker 每轮 2 条、每轮空闲观察 30 秒、每 2 轮恢复。参数限制为
442
+ 1–24 轮、1–4 条、0–300000 毫秒和 1–24 轮恢复间隔;这些选项必须与
443
+ `--stability` 一起使用。这是有界真实模型负载验收,不能代替 24 小时 soak、
444
+ 并发容量测量或内存泄漏证明。DSH 单次恢复成功也不能单独解释历史恢复波动。
445
+
446
+ `--stability-only` 与 `--stability` 一起使用时,只建立三个真实会话并运行稳定性
447
+ 负载,跳过基础中断、命令审批和模型 MCP 通信场景;回执明确标记该范围。
448
+ 适合已有独立生命周期/交互回执时单独补做持续负载,不能把跳过项算作通过。
449
+ 发生任一错误时,脚本在关闭自有 worker 前保存会话快照、最近投递和事件。