dsh-retrace 0.4.139 → 0.4.150

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 (52) hide show
  1. package/README.md +21 -16
  2. package/README.zh.md +21 -12
  3. package/bin/retrace.mjs +0 -0
  4. package/lib/adapter/dsh-writer.js +2 -2
  5. package/lib/adapter/dsh.js +8 -508
  6. package/lib/archaeology-cli.js +3 -3
  7. package/lib/boot-pin.js +1 -1
  8. package/lib/checkpoint-restore.js +769 -0
  9. package/lib/client-config.js +231 -0
  10. package/lib/client-css.js +12 -0
  11. package/lib/client-i18n.js +152 -15
  12. package/lib/client.bundle.js +15 -2
  13. package/lib/client.js +561 -312
  14. package/lib/close-guard-client.js +2 -2
  15. package/lib/compat-matrix.js +302 -0
  16. package/lib/dynamic-client.js +15 -2
  17. package/lib/dynamic-host.js +18 -158
  18. package/lib/host-core.js +12 -94
  19. package/lib/http.js +81 -138
  20. package/lib/index.js +381 -863
  21. package/lib/marker-carrier.js +4 -4
  22. package/lib/platform/dsh-home.js +137 -0
  23. package/lib/platform/session-paths.js +11 -43
  24. package/lib/preimage-store.js +312 -0
  25. package/lib/prewrite-guard.js +0 -28
  26. package/lib/request-guard.js +118 -0
  27. package/lib/rollback.js +390 -26
  28. package/lib/span-semantics.js +1 -1
  29. package/lib/undo-store.js +243 -0
  30. package/lib/versioning.js +54 -2
  31. package/lib/zip-store.js +160 -0
  32. package/package.json +24 -6
  33. package/lib/adapter/compaction-backend.js +0 -92
  34. package/lib/adapter/register-compaction-backend.js +0 -93
  35. package/lib/auto-fold-scheduler.js +0 -519
  36. package/lib/badge.js +0 -65
  37. package/lib/cache-metrics.js +0 -155
  38. package/lib/context-level.js +0 -139
  39. package/lib/core-contract.js +0 -77
  40. package/lib/fold-auto.js +0 -621
  41. package/lib/fold-boundary.js +0 -1000
  42. package/lib/fold-core-text.js +0 -52
  43. package/lib/fold-core.js +0 -191
  44. package/lib/fold-summary.js +0 -168
  45. package/lib/hw3-fallback.js +0 -262
  46. package/lib/identity/code-assign.js +0 -228
  47. package/lib/identity/dedupe.js +0 -168
  48. package/lib/identity/shortcode.js +0 -782
  49. package/lib/identity/sidebar-badge.js +0 -270
  50. package/lib/identity-check-cli.js +0 -379
  51. package/lib/ledger-guard.js +0 -491
  52. package/lib/token-estimate.js +0 -91
package/README.md CHANGED
@@ -35,7 +35,7 @@ it cannot dirty the log, and new markers create **no token-meter pairing debt**
35
35
 
36
36
  > Versions: [VERSIONS.md](./VERSIONS.md)
37
37
 
38
- > 0.4.139 is the current release — install/pin `0.4.139` (the previous npm latest was `0.4.135`; see [VERSIONS.md](./VERSIONS.md)); the `dsh-retrace@0.4.139` examples below apply after that release.
38
+ > **0.4.150 is the current release** — install/pin `0.4.150` (the **GitHub Release is out; the npm package is still pending** — the latest npm version is `0.4.139`; see [VERSIONS.md](./VERSIONS.md)). The `dsh-retrace@0.4.150` examples below apply to this release.
39
39
 
40
40
  ## ⚡ One-minute install
41
41
 
@@ -89,9 +89,11 @@ Full steps in [📦 Installation](#-installation).
89
89
 
90
90
  | | What | |
91
91
  |---|---|---|
92
- | 🕘 | **Checkpoints** | a **Checkpoints** tab in the conversation view: every change (type, time, message count, file-change badges), pushed live via `session/projection` (no polling), windowed for long histories; nested history is browsable outline-style |
93
- | ↩️ | **Artifact rollback** | **context-only / artifacts-only / both** with dry-run preview; git-first + content-addressed snapshot fallback; a rollback is itself a new checkpoint (`restore`). Preview refuses while the agent is running (so "preview says yes, confirm says no" cannot happen), and preview/rollback failures are shown in the UI instead of failing silently |
94
- | 🧬 | **Lineage identity** | every new session gets a stable lineage id automatically; the sidebar shows one badge per conversation (no duplicates on refresh) |
92
+ | 🕘 | **Unified restore list** | one **Checkpoints** tab in the conversation view — **change records and pre-operation file snapshots in ONE list**. Each row shows the round (when the log has it), type, time, message count, file-change badges, and old-vs-new input (collapsed by default); pushed live via `session/projection` (no polling), windowed for long histories, nested history browsable outline-style |
93
+ | ↩️ | **Rollback** | **three-way choice: context-only / artifacts-only / both**, with a dry-run preview. Rollback is **always available**; when an entry has no file preimage only context rollback is selectable (the other two are disabled with a reason). A **confirm dialog** lists the round, messages removed, file actions and a risk note (export first). Preview refuses while the agent is running; preview/rollback failures are shown instead of failing silently; a rollback is itself a new checkpoint (`restore`) |
94
+ | ⤓ | **Export as…** | **read-only** zip of exactly that entry (`manifest.json` + the captured file preimages + the original text); it **never rolls anything back**. Uses the host preimage store when available, otherwise a manifest-only archive with a visible note |
95
+ | 🎛 | **Three fixed actions per row** | **Jump to conversation / Rollback / Export as…**, always in that order; an **older host** shows an explicit "upgrade and restart" notice instead of silently missing features |
96
+ | 🧬 | **External binding id (optional)** | a **read-only** per-session binding id for stable cross-view references; the plugin **does not generate identifiers, keeps no mapping table, and never renames or prefixes conversation titles** |
95
97
  | 🧭 | **Jump-to-conversation** | one click from a checkpoint to that point in the conversation (auto-loads history, anchor highlight); when the point is out of the auto-load budget the reason is reported instead of nothing happening |
96
98
  | 🧹 | **Bounded storage** | snapshots keep the most recent N checkpoints (default 50); throttled background sweep prunes truncated ones |
97
99
 
@@ -151,7 +153,7 @@ The same result with plain file edits and `pnpm` — exactly the steps
151
153
  ```json
152
154
  {
153
155
  "dependencies": {
154
- "dsh-retrace": "^0.4.139"
156
+ "dsh-retrace": "^0.4.150"
155
157
  },
156
158
  "dsh": {
157
159
  "profile": {
@@ -255,12 +257,12 @@ Before you exit or reload, know what is still running:
255
257
  > handler, or a pre-quit prompt hook). If the app cannot quit, turning off "Exit
256
258
  > confirmation (close guard)" recovers immediately (no restart).
257
259
 
258
- ### Session badge & display name
260
+ ### External binding id (optional)
259
261
 
260
- - The sidebar shows **one badge per conversation**; the conversation title keeps the plain name. The stable identifier is **derived deterministically from the session id** (no random suffix).
261
- - **There is no setting for this yet.** Two runtime switches exist:
262
- - `DSH_RETRACE_SHOW_CODES=0` — hide lineage codes (host-side, takes effect on restart);
263
- - Custom display names and a settings-page toggle are **planned** — see [docs/PLAN.md](./docs/PLAN.md) and [docs/ROADMAP.md](./docs/ROADMAP.md).
262
+ - The plugin **does not generate or assign conversation identifiers**, keeps **no mapping table**, and **never renames or prefixes conversation titles**.
263
+ - A **read-only** per-session binding id surface remains for integrations: host ops **`sessionBadge`** (one session) and **`badgeMap`** (all sessions). Reading it has no write path.
264
+ - How such an id is produced or mapped is **maintained by the integrator** — the plugin does not document or ship a generation algorithm, table, or format.
265
+ - Titles written by **earlier versions** that still carry a plugin prefix can be restored with the maintenance op **`restoreSessionTitles`** (rename only; conversation content is never touched).
264
266
 
265
267
  ## ⚙️ Settings → General
266
268
 
@@ -343,7 +345,7 @@ The host occasionally removes APIs this plugin relied on. These are **host-side
343
345
 
344
346
  - Boot loop / recovery screen after a host upgrade → switch to a clean session and restart DSH; the plugin falls back to degraded mode instead of blocking.
345
347
  - Version/checkpoint panels empty after an upgrade → run `dsh plugin --profile <p> add dsh-retrace` to refresh the bundle.
346
- - Title/rename behaves differently → automatic title bootstrap is guarded by the host; manual rename keeps working.
348
+ - Title/rename behaves differently → the plugin **does not touch conversation titles**; historical plugin prefixes can be cleaned with `restoreSessionTitles` (rename only).
347
349
  - Dependency floor: `dsh-log-contract >= 0.3.18`.
348
350
 
349
351
  Historical details and exact error strings live in [CHANGELOG.md](./CHANGELOG.md); compatibility matrix in [docs/COMPAT.md](./docs/COMPAT.md).
@@ -351,7 +353,7 @@ Historical details and exact error strings live in [CHANGELOG.md](./CHANGELOG.md
351
353
  ### Upgrading
352
354
 
353
355
  ```bash
354
- dsh plugin --profile desktop add dsh-retrace@0.4.139
356
+ dsh plugin --profile desktop add dsh-retrace@0.4.150
355
357
  # then restart DSH — plugins are not hot-reloaded
356
358
  ```
357
359
 
@@ -375,7 +377,7 @@ whole tree down, so recover first and diagnose second:
375
377
 
376
378
  ### Pinning
377
379
 
378
- Pin an exact plugin version (`dsh-retrace@0.4.139`) and let `dsh-log-contract` resolve to
380
+ Pin an exact plugin version (`dsh-retrace@0.4.150`) and let `dsh-log-contract` resolve to
379
381
  `>=0.3.18`. Do not rely on `^0.4` across a host upgrade: compatibility here is decided by
380
382
  the **host surface**, not by semver alone.
381
383
 
@@ -389,7 +391,6 @@ the **host surface**, not by semver alone.
389
391
  | **DSH** | `>=0.1.5 <0.3.0` (see `package.json#dsh.compatibility`); desktop and web modes supported |
390
392
  | **Runtime files** | All files needed at runtime are **committed** in this repository and declared in `package.json#files` (`lib/**`, `cordis.patch.yml`, `README*.md`, `HUMANS.txt`, `LICENSE`) |
391
393
  | **Build output** | Build output is committed (`lib/client.bundle.js`, `lib/dynamic-client.js`, `lib/dynamic-host.js`) and reproducible in-repo: `pnpm i && pnpm build` (`scripts/generate-dynamic.mjs`, `scripts/build-client.mjs`) |
392
- | **Single-file size** | Every distributed file is **below 256 KiB** (largest ≈ 249 KB) |
393
394
  | **Runtime dependencies** | `dsh-log-contract` (log-contract validation), `zod` (argument validation). No post-install scripts, no network access, no additional code download |
394
395
  | **Peer dependencies** | `@deepseek-ai/cordis` and DSH client packages (provided by DSH itself, not bundled or redistributed here) |
395
396
  | **Permissions / external services** | Reads and writes only the local DSH session data directory and session logs. No external services, no telemetry, no data upload |
@@ -411,6 +412,10 @@ the **host surface**, not by semver alone.
411
412
  `message-pending` ("still being generated") rather than being misreported as gone.
412
413
  - Regenerate re-sends only the **text** of the original prompt; prompts that
413
414
  carried images fall back to the text-only content.
415
+ - File **restore** is text-only: a non-UTF-8 (binary) file is reported as
416
+ `binary-unsupported` and skipped instead of being written back. **Export as…**
417
+ packages the captured preimage bytes (including non-text files) without restoring
418
+ anything.
414
419
  - True restore edits the session log **in place** (it neutralizes the two marker
415
420
  segments; sequence numbers stay as they are). It refuses to run while the session is
416
421
  the one you are viewing, while it is running, or while another process holds the file,
@@ -435,8 +440,8 @@ the **host surface**, not by semver alone.
435
440
  (`fix --neutralize` / `--clip-crossstep`) for sessions that would fail `/compact`.
436
441
  - Read-only host surfaces for integration: `retrace/versions` and `retrace/forkmap`
437
442
  projections, `GET /api/plugins/retrace/{versions,forkmap,lineage,event,surface,doctor,snapshot}`,
438
- `POST /api/plugins/retrace/{rollback/preview,rollback,git/init}`, plus the badge
439
- ops (`sessionBadge` / `setBadgeTitle` / `initBadgeTitles` / `badgeMap`) and the
443
+ `POST /api/plugins/retrace/{rollback/preview,rollback,git/init}`, plus the
444
+ **read-only** session binding id ops (`sessionBadge` / `badgeMap`) and the
440
445
  `retrace` CLI (see below).
441
446
 
442
447
  **What's next** — see [docs/PLAN.md](./docs/PLAN.md) (next steps) and
package/README.zh.md CHANGED
@@ -30,7 +30,7 @@
30
30
 
31
31
  > 版本索引:[VERSIONS.md](./VERSIONS.md)
32
32
 
33
- > 0.4.139 **已发布到 npm**——安装/固定版本请用当前 npm latest `0.4.135`(见 [VERSIONS.md](./VERSIONS.md));下文的 `dsh-retrace@0.4.139` 示例在该版本发布后适用。
33
+ > **0.4.150 为当前版本**——安装/固定请用 `0.4.150`(**GitHub Release 已发,npm 待发**;npm 最新可安装版本仍为 `0.4.139`,见 [VERSIONS.md](./VERSIONS.md));下文的 `dsh-retrace@0.4.150` 示例适用于该版本。
34
34
 
35
35
  ## ⚡ 一分钟安装
36
36
 
@@ -84,9 +84,11 @@ dsh plugin --profile desktop add dshmarket # 只需一次
84
84
 
85
85
  | | 能力 | 说明 |
86
86
  |---|---|---|
87
- | 🕘 | **读档点** | 对话视图里的「读档点」Tab:每个改动(类型/时间/消息数/文件变更徽标),经 `session/projection` 推送帧实时更新(零轮询),大列表窗口化;嵌套历史按大纲逐层展开 |
88
- | ↩️ | **产物回退** | 仅对话 / 仅产物 / 两者,先干跑预览再执行;git 优先 + 内容寻址快照兜底;回退本身是新读档点(`restore`)。预览在会话运行中直接拒绝(不会出现「预览说可以、确认时才被拒」),预览/回档失败都会在界面上显示,不静默 |
89
- | 🧬 | **谱系标识** | 新建会话自动分配稳定谱系标识;侧栏每个会话只显示一个标识(刷新不重复) |
87
+ | 🕘 | **统一读档点列表** | 对话视图里的「读档点」Tab:**改动记录与操作前文件快照合并在一个列表**。每行显示轮次(日志里取得到才有)、类型、时间、消息数、文件变更徽标,以及新旧输入对照(默认折叠);经 `session/projection` 推送帧实时更新(零轮询),大列表窗口化,嵌套历史按大纲逐层展开 |
88
+ | ↩️ | **回档** | **三选一:仅对话 / 仅产物 / 两者**,先干跑预览。回档**始终可用**;该条没有文件前像时只能选「仅对话」(另两项置灰并给出原因)。**确认弹窗**列明轮次、移除消息数、文件动作与风险提示(建议先导出)。预览在会话运行中直接拒绝;预览/回档失败都会在界面上显示,不静默;回档本身是新读档点(`restore`) |
89
+ | ⤓ | **导出另存为** | 把该条内容打成**只读** zip(`manifest.json` + 捕获的文件前像 + 原文),**只导出、不回档**。宿主提供前像存储时用真实前像,否则退化为仅 manifest 的归档并显式提示 |
90
+ | 🎛 | **每行固定三个动作** | **回到会话 / 回档 / 导出另存为**,顺序固定;**旧宿主**会显式提示「请升级并重启」,而不是静默缺少功能 |
91
+ | 🧬 | **外部绑定标识(可选)** | **只读**的每会话绑定标识,便于跨视图稳定引用;插件**不生成标识、不维护映射表、不重命名/不加标题前缀** |
90
92
  | 🧭 | **跳转对话** | 从读档点一键跳转到对应位置(自动翻页加载更早历史 + 锚点高亮);该点超出自动加载预算时,给出可诊断原因,而不是点了没反应 |
91
93
  | 🧹 | **存储有界** | 快照只保留最近 N 个读档点(默认 50);节流后台扫掠回收被截断的旧档 |
92
94
 
@@ -135,7 +137,7 @@ dsh plugin --profile <name> add dsh-retrace
135
137
  ```json
136
138
  {
137
139
  "dependencies": {
138
- "dsh-retrace": "^0.4.139"
140
+ "dsh-retrace": "^0.4.150"
139
141
  },
140
142
  "dsh": {
141
143
  "profile": {
@@ -228,6 +230,13 @@ Client 半区会依据包内 `dsh.client` 元数据被自动打包进 Web 客户
228
230
  > (`will-prevent-unload` 处理,或退出前的询问钩子)。**桌面端退不掉时**,把设置里的
229
231
  > 「退出确认(关闭守卫)」关掉即退回官方形态(**不用重启**)。
230
232
 
233
+ ## 🧬 外部绑定标识(可选)
234
+
235
+ - 插件**不生成、不分配会话标识**,**不维护映射表**,也**不重命名会话标题、不给标题加前缀**。
236
+ - 供集成使用的**只读**每会话绑定标识接口保留:宿主 op **`sessionBadge`**(单会话)与 **`badgeMap`**(全会话)。读取没有写入路径。
237
+ - 这类标识如何生成、如何映射,由**使用方自行维护**——插件不提供、也不文档化任何生成算法、表或格式。
238
+ - 历史版本写入过标题前缀的会话,可用维护 op **`restoreSessionTitles`** 恢复原标题(只重命名,不碰会话内容)。
239
+
231
240
  ## ⚙️ 设置 → 通用
232
241
 
233
242
  | 设置项 | 默认 | 说明 |
@@ -297,7 +306,7 @@ Client 半区会依据包内 `dsh.client` 元数据被自动打包进 Web 客户
297
306
 
298
307
  - 升级后开机循环/恢复界面 → 切到干净会话并重启 DSH(插件降级而非阻断)。
299
308
  - 版本/检查点面板为空 → `dsh plugin --profile <p> add dsh-retrace` 刷新 bundle。
300
- - 标题/重命名行为变化 → 自动标题路径由宿主守卫,手动重命名不受影响。
309
+ - 标题/重命名行为变化 → 插件**不改写会话标题**;历史版本留下的前缀可用 `restoreSessionTitles` 恢复原标题(只重命名、不碰会话内容)。
301
310
  - 依赖下限:`dsh-log-contract >= 0.3.18`。
302
311
 
303
312
  历史细节与原始报错见 [CHANGELOG.md](./CHANGELOG.md);兼容矩阵见 [docs/COMPAT.md](./docs/COMPAT.md)。
@@ -305,7 +314,7 @@ Client 半区会依据包内 `dsh.client` 元数据被自动打包进 Web 客户
305
314
  ### 升级
306
315
 
307
316
  ```bash
308
- dsh plugin --profile desktop add dsh-retrace@0.4.139
317
+ dsh plugin --profile desktop add dsh-retrace@0.4.150
309
318
  # 然后重启 DSH —— 插件不会热重载
310
319
  ```
311
320
 
@@ -324,7 +333,7 @@ dsh plugin --profile desktop add dsh-retrace@0.4.139
324
333
 
325
334
  ### 版本固定建议
326
335
 
327
- 请固定到确切版本(`dsh-retrace@0.4.139`),并让 `dsh-log-contract` 解析到 `>=0.3.18`。
336
+ 请固定到确切版本(`dsh-retrace@0.4.150`),并让 `dsh-log-contract` 解析到 `>=0.3.18`。
328
337
  **不要在跨宿主升级时依赖 `^0.4` 这种范围**:这里的兼容性由**宿主的面**决定,光看 semver 不够。
329
338
 
330
339
  ---
@@ -339,6 +348,7 @@ dsh plugin --profile desktop add dsh-retrace@0.4.139
339
348
  (`target-shadowed`);写入尚未 flush 的消息会如实报 `message-pending`(「消息生成中」),
340
349
  不再被误判成「已不在活跃对话」。
341
350
  - 重新生成只重发原提示的**文本**部分;携带图片的提示会退化为仅文本重发。
351
+ - 文件**恢复**仅支持文本:非 UTF-8(二进制)文件会如实报 `binary-unsupported` 并跳过,不会写回工作区。**导出另存为**会把捕获到的前像字节(含非文本文件)打包带走,但只导出、不回档。
342
352
  - **真正恢复**会**原地**改写会话日志(中和两段标记,seq 编号不动)。会话是你当前正在查看的、
343
353
  正在运行的,或文件被其他进程持有时,它会拒绝执行;成功后需重开该会话(或刷新)才看到结果。
344
354
 
@@ -358,8 +368,8 @@ dsh plugin --profile desktop add dsh-retrace@0.4.139
358
368
  - 配套 **`dsh-log-contract`**:30+ 条离线契约规则 + 原地修复(`fix --neutralize` / `--clip-crossstep`),能处理会让 /compact 永久失败的会话。
359
369
  - 供集成使用的只读宿主面:`retrace/versions`、`retrace/forkmap` 投影,
360
370
  `GET /api/plugins/retrace/{versions,forkmap,lineage,event,surface,doctor,snapshot}`,
361
- `POST /api/plugins/retrace/{rollback/preview,rollback,git/init}`,以及谱系标识操作
362
- (`sessionBadge` / `setBadgeTitle` / `initBadgeTitles` / `badgeMap`)与 `retrace` CLI(见文末)。
371
+ `POST /api/plugins/retrace/{rollback/preview,rollback,git/init}`,以及**只读**的
372
+ 会话绑定标识接口(`sessionBadge` / `badgeMap`)与 `retrace` CLI(见文末)。
363
373
 
364
374
  **未来计划**——agent 业务层规划(运行时守护、中断治理、生态开放接口)**尚未发布**,此节是**计划**而非已上线能力。本 README 描述的是**开发线(main)**,可能领先于 npm 上最新发布版。
365
375
 
@@ -471,7 +481,6 @@ retrace lineage <session> # 会话 parent 链谱系
471
481
  | **Node.js** | `>=20.0.0`(见 `package.json#engines`) |
472
482
  | **DSH** | `>=0.1.5 <0.3.0`(见 `package.json#dsh.compatibility`;桌面与 Web 两种模式均支持) |
473
483
  | **运行所需文件** | 运行时所需文件**全部随仓库提交**并在 `package.json#files` 声明(`lib/**`、`cordis.patch.yml`、README 等) |
474
- | **单文件体积** | 每个分发文件 **< 256 KiB**(最大约 249 KB) |
475
484
  | **构建产物** | 运行所需构建产物**随包提交**(`lib/client.bundle.js`、`lib/dynamic-client.js`、`lib/dynamic-host.js`);仓库内可复现:`pnpm i && pnpm build`(生成器 `scripts/generate-dynamic.mjs`、`scripts/build-client.mjs`) |
476
485
  | **运行时依赖** | `dsh-log-contract`(日志契约校验)、`zod`(参数校验);**不联网、不下载额外代码** |
477
486
  | **宿主依赖(peer)** | `@deepseek-ai/cordis` 与若干 `@deepseek-ai/dsh-*` 客户端包(由 DSH 提供,不由本插件分发) |
@@ -479,4 +488,4 @@ retrace lineage <session> # 会话 parent 链谱系
479
488
  | **失败边界** | 所有写入(撤回/编辑/恢复/回档)均在**目标文件之外先备份**、写后做帧级校验与折叠重放;失败即中止并保留原文件;不可判定时按"拒绝 + 可操作提示"处理,不静默降级 |
480
489
  | **可回退** | 每个操作都有可逆路径;本地管理脚本可一键回退到上一快照 |
481
490
 
482
- - 稳定标识由会话 id 确定性导出(无随机后缀);对同一会话重复读取得到同一个标识。
491
+ - 只读**会话绑定标识**:对同一会话重复读取得到同一个标识;如何映射/生成由消费方自行决定(不属公开契约),插件不重命名会话标题。
package/bin/retrace.mjs CHANGED
File without changes
@@ -214,7 +214,7 @@ export function createDshMarkerWriter({ validateMarker, log = () => {}, meter, d
214
214
  * @returns {Promise<object>} 第 2 段事件(调用方读 seq/surfaceOp)。
215
215
  */
216
216
  async writeMarker(session, span, meta) {
217
- // ── 自动折叠默认关闭(最底层闸,需显式开启)─────────────────────────
217
+ // ── 自动收起默认关闭(最底层闸,需显式开启)─────────────────────────
218
218
  // 判定收敛在 marker-carrier.isAutoFoldSource(op='fold' 且未声明用户发起);
219
219
  // AUTOFOLD_HARD_DISABLED=true ⇒ 拒写并返回显式错误码,零落盘(审计段/载体段
220
220
  // 都不写)。拒写留一行可核日志:走注入的宿主 logger(console.log 进不了宿主
@@ -363,7 +363,7 @@ export function createDshMarkerWriter({ validateMarker, log = () => {}, meter, d
363
363
  * 与 assertPairing)原样保留;本路径一条 claim 都不写 —— 回收副本不遮蔽任何
364
364
  * 节点,写 claim 会留下无人消费的孤儿审计行(真实会话里出现过的
365
365
  * 形态)。单段 append 无第 1 段 ⇒ 无"半对"可言;
366
- * ③ 自动折叠默认关闭的闸(AUTOFOLD_HARD_DISABLED + isAutoFoldSource)只判
366
+ * ③ 自动收起默认关闭的闸(AUTOFOLD_HARD_DISABLED + isAutoFoldSource)只判
367
367
  * `op === 'fold'`:本写入的 op 是回收,不落在该闸上;那道闸的代码一行不动;
368
368
  * ④ 写入前过注入的 `validateMarker`(prewrite-guard 完整契约校验,信封不带 seq
369
369
  * —— 与 unhide 取消标记同规),与 marker 写入共用同一条校验链;