dsh-plugin-dev-kb 1.0.0

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 (234) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/cordis.patch.yml +12 -0
  4. package/kb/INDEX.md +210 -0
  5. package/kb/README.md +69 -0
  6. package/kb/extra/AGENTS.md +75 -0
  7. package/kb/extra/api-gateway.md +164 -0
  8. package/kb/extra/api-gateway.zh.md +164 -0
  9. package/kb/extra/cookbook/adding-a-vendored-package.md +59 -0
  10. package/kb/extra/cookbook/adding-a-vendored-package.zh.md +59 -0
  11. package/kb/extra/cookbook/maintaining-dsh-code-review.md +64 -0
  12. package/kb/extra/cookbook/maintaining-dsh-code-review.zh.md +64 -0
  13. package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
  14. package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
  15. package/kb/extra/defensive-patterns.md +33 -0
  16. package/kb/extra/defensive-patterns.zh.md +33 -0
  17. package/kb/extra/development.md +171 -0
  18. package/kb/extra/development.zh.md +171 -0
  19. package/kb/extra/event-producer-consumer.md +76 -0
  20. package/kb/extra/event-producer-consumer.zh.md +78 -0
  21. package/kb/extra/glossary.md +45 -0
  22. package/kb/extra/glossary.zh.md +45 -0
  23. package/kb/extra/graph-atlas.md +24 -0
  24. package/kb/extra/graph-atlas.zh.md +26 -0
  25. package/kb/extra/i18n/README.md +60 -0
  26. package/kb/extra/i18n/README.zh.md +60 -0
  27. package/kb/extra/i18n/style-samples.md +87 -0
  28. package/kb/extra/i18n/terminology.md +214 -0
  29. package/kb/extra/i18n/translation-prompt.md +263 -0
  30. package/kb/extra/i18n/translation-rules.md +69 -0
  31. package/kb/extra/i18n/translation-rules.zh.md +69 -0
  32. package/kb/extra/module-graph.md +1641 -0
  33. package/kb/extra/module-graph.zh.md +1643 -0
  34. package/kb/extra/postmortem/0001-acp-default-export-drops-inject.md +113 -0
  35. package/kb/extra/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
  36. package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
  37. package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
  38. package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
  39. package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
  40. package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
  41. package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
  42. package/kb/extra/postmortem/README.md +18 -0
  43. package/kb/extra/postmortem/README.zh.md +18 -0
  44. package/kb/extra/rescope.md +53 -0
  45. package/kb/extra/rescope.zh.md +53 -0
  46. package/kb/extra/subsystems/attachment.md +125 -0
  47. package/kb/extra/subsystems/attachment.zh.md +125 -0
  48. package/kb/extra/subsystems/extensions.md +364 -0
  49. package/kb/extra/subsystems/extensions.zh.md +364 -0
  50. package/kb/extra/subsystems/feedback.md +266 -0
  51. package/kb/extra/subsystems/feedback.zh.md +266 -0
  52. package/kb/extra/testing.md +49 -0
  53. package/kb/extra/testing.zh.md +49 -0
  54. package/kb/extra/web-styling.md +25 -0
  55. package/kb/extra/web-styling.zh.md +25 -0
  56. package/kb/meta/search-index.json +1328 -0
  57. package/kb/meta/site-pages.txt +168 -0
  58. package/kb/meta/source.json +13 -0
  59. package/kb/meta/topics.md +75 -0
  60. package/kb/site/develop/basic/config.md +108 -0
  61. package/kb/site/develop/basic/index.md +146 -0
  62. package/kb/site/develop/basic/publish.md +185 -0
  63. package/kb/site/develop/basic/tool.md +54 -0
  64. package/kb/site/develop/cordis-tutorial/01-first-plugin.md +95 -0
  65. package/kb/site/develop/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  66. package/kb/site/develop/cordis-tutorial/03-services.md +98 -0
  67. package/kb/site/develop/cordis-tutorial/04-events.md +144 -0
  68. package/kb/site/develop/cordis-tutorial/05-config.md +84 -0
  69. package/kb/site/develop/cordis-tutorial/06-composition-and-hmr.md +113 -0
  70. package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +107 -0
  71. package/kb/site/develop/cordis-tutorial/index.md +62 -0
  72. package/kb/site/develop/framework/events.md +145 -0
  73. package/kb/site/develop/framework/index.md +139 -0
  74. package/kb/site/develop/framework/service.md +152 -0
  75. package/kb/site/develop/practice/index.md +157 -0
  76. package/kb/site/develop/practice/llm-adapter.md +190 -0
  77. package/kb/site/en/develop/basic/config.md +108 -0
  78. package/kb/site/en/develop/basic/index.md +146 -0
  79. package/kb/site/en/develop/basic/publish.md +185 -0
  80. package/kb/site/en/develop/basic/tool.md +54 -0
  81. package/kb/site/en/develop/cordis-tutorial/01-first-plugin.md +95 -0
  82. package/kb/site/en/develop/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  83. package/kb/site/en/develop/cordis-tutorial/03-services.md +98 -0
  84. package/kb/site/en/develop/cordis-tutorial/04-events.md +144 -0
  85. package/kb/site/en/develop/cordis-tutorial/05-config.md +84 -0
  86. package/kb/site/en/develop/cordis-tutorial/06-composition-and-hmr.md +113 -0
  87. package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +107 -0
  88. package/kb/site/en/develop/cordis-tutorial/index.md +60 -0
  89. package/kb/site/en/develop/framework/events.md +145 -0
  90. package/kb/site/en/develop/framework/index.md +139 -0
  91. package/kb/site/en/develop/framework/service.md +150 -0
  92. package/kb/site/en/develop/practice/index.md +157 -0
  93. package/kb/site/en/develop/practice/llm-adapter.md +190 -0
  94. package/kb/site/en/guide/providers-custom-form.png +0 -0
  95. package/kb/site/en/guide/providers-models-page.png +0 -0
  96. package/kb/site/en/guide/providers.md +100 -0
  97. package/kb/site/en/guide/python-sdk.md +106 -0
  98. package/kb/site/en/guide/quickstart.md +32 -0
  99. package/kb/site/en/index.md +8 -0
  100. package/kb/site/en/reference/agent-lifecycle.md +86 -0
  101. package/kb/site/en/reference/capability-seams.md +475 -0
  102. package/kb/site/en/reference/config-catalog.md +3155 -0
  103. package/kb/site/en/reference/cookbook/adding-a-conversation-node.md +235 -0
  104. package/kb/site/en/reference/cookbook/adding-a-package.md +120 -0
  105. package/kb/site/en/reference/cookbook/adding-a-settings-card.md +102 -0
  106. package/kb/site/en/reference/cookbook/adding-a-tool.md +96 -0
  107. package/kb/site/en/reference/cookbook/adding-an-llm-adapter.md +45 -0
  108. package/kb/site/en/reference/cookbook/extension-cookbook.md +131 -0
  109. package/kb/site/en/reference/cordis-api/context.md +368 -0
  110. package/kb/site/en/reference/cordis-api/events.md +211 -0
  111. package/kb/site/en/reference/cordis-api/fiber.md +379 -0
  112. package/kb/site/en/reference/cordis-api/inherited.md +43 -0
  113. package/kb/site/en/reference/cordis-api/registry.md +156 -0
  114. package/kb/site/en/reference/cordis-api/service.md +106 -0
  115. package/kb/site/en/reference/cordis-primer.md +46 -0
  116. package/kb/site/en/reference/index.md +131 -0
  117. package/kb/site/en/reference/persistence-catalog.md +949 -0
  118. package/kb/site/en/reference/subsystems/approval.md +173 -0
  119. package/kb/site/en/reference/subsystems/client-modules.md +121 -0
  120. package/kb/site/en/reference/subsystems/code-runtime.md +194 -0
  121. package/kb/site/en/reference/subsystems/commands.md +190 -0
  122. package/kb/site/en/reference/subsystems/compaction.md +241 -0
  123. package/kb/site/en/reference/subsystems/core.md +1073 -0
  124. package/kb/site/en/reference/subsystems/credentials.md +136 -0
  125. package/kb/site/en/reference/subsystems/filesystem.md +498 -0
  126. package/kb/site/en/reference/subsystems/goal.md +280 -0
  127. package/kb/site/en/reference/subsystems/index.md +58 -0
  128. package/kb/site/en/reference/subsystems/invariants.md +91 -0
  129. package/kb/site/en/reference/subsystems/jobs.md +293 -0
  130. package/kb/site/en/reference/subsystems/llm-streaming.md +920 -0
  131. package/kb/site/en/reference/subsystems/lsp.md +205 -0
  132. package/kb/site/en/reference/subsystems/permission-presets.md +134 -0
  133. package/kb/site/en/reference/subsystems/persistence.md +388 -0
  134. package/kb/site/en/reference/subsystems/plan.md +90 -0
  135. package/kb/site/en/reference/subsystems/sandbox.md +221 -0
  136. package/kb/site/en/reference/subsystems/schedule.md +189 -0
  137. package/kb/site/en/reference/subsystems/scope.md +62 -0
  138. package/kb/site/en/reference/subsystems/session-projection.md +265 -0
  139. package/kb/site/en/reference/subsystems/session-query.md +498 -0
  140. package/kb/site/en/reference/subsystems/session-reference.md +111 -0
  141. package/kb/site/en/reference/subsystems/session-telemetry.md +197 -0
  142. package/kb/site/en/reference/subsystems/session-title.md +207 -0
  143. package/kb/site/en/reference/subsystems/session.md +852 -0
  144. package/kb/site/en/reference/subsystems/settings.md +313 -0
  145. package/kb/site/en/reference/subsystems/shell.md +306 -0
  146. package/kb/site/en/reference/subsystems/skills.md +334 -0
  147. package/kb/site/en/reference/subsystems/spill.md +120 -0
  148. package/kb/site/en/reference/subsystems/storage.md +232 -0
  149. package/kb/site/en/reference/subsystems/subagent.md +737 -0
  150. package/kb/site/en/reference/subsystems/subprocess.md +327 -0
  151. package/kb/site/en/reference/subsystems/system-prompt.md +210 -0
  152. package/kb/site/en/reference/subsystems/terminal.md +187 -0
  153. package/kb/site/en/reference/subsystems/token-meter.md +93 -0
  154. package/kb/site/en/reference/subsystems/tools.md +723 -0
  155. package/kb/site/en/reference/subsystems/typert.md +339 -0
  156. package/kb/site/en/reference/subsystems/user-questions.md +181 -0
  157. package/kb/site/en/reference/subsystems/web-server.md +111 -0
  158. package/kb/site/en/reference/subsystems/web.md +202 -0
  159. package/kb/site/en/reference/subsystems/workflow.md +281 -0
  160. package/kb/site/en/reference/subsystems/workspace.md +231 -0
  161. package/kb/site/en/reference/tool-catalog.md +1877 -0
  162. package/kb/site/en/reference/tool-execution-pipeline.md +66 -0
  163. package/kb/site/guide/providers-custom-form.zh.png +0 -0
  164. package/kb/site/guide/providers-models-page.zh.png +0 -0
  165. package/kb/site/guide/providers.md +100 -0
  166. package/kb/site/guide/python-sdk.md +106 -0
  167. package/kb/site/guide/quickstart.md +32 -0
  168. package/kb/site/index.md +8 -0
  169. package/kb/site/reference/agent-lifecycle.md +86 -0
  170. package/kb/site/reference/capability-seams.md +475 -0
  171. package/kb/site/reference/config-catalog.md +3154 -0
  172. package/kb/site/reference/cookbook/adding-a-conversation-node.md +235 -0
  173. package/kb/site/reference/cookbook/adding-a-package.md +120 -0
  174. package/kb/site/reference/cookbook/adding-a-settings-card.md +102 -0
  175. package/kb/site/reference/cookbook/adding-a-tool.md +98 -0
  176. package/kb/site/reference/cookbook/adding-an-llm-adapter.md +45 -0
  177. package/kb/site/reference/cookbook/extension-cookbook.md +133 -0
  178. package/kb/site/reference/cordis-api/context.md +368 -0
  179. package/kb/site/reference/cordis-api/events.md +211 -0
  180. package/kb/site/reference/cordis-api/fiber.md +379 -0
  181. package/kb/site/reference/cordis-api/inherited.md +43 -0
  182. package/kb/site/reference/cordis-api/registry.md +156 -0
  183. package/kb/site/reference/cordis-api/service.md +106 -0
  184. package/kb/site/reference/cordis-primer.md +52 -0
  185. package/kb/site/reference/index.md +135 -0
  186. package/kb/site/reference/persistence-catalog.md +949 -0
  187. package/kb/site/reference/subsystems/approval.md +173 -0
  188. package/kb/site/reference/subsystems/client-modules.md +121 -0
  189. package/kb/site/reference/subsystems/code-runtime.md +194 -0
  190. package/kb/site/reference/subsystems/commands.md +190 -0
  191. package/kb/site/reference/subsystems/compaction.md +241 -0
  192. package/kb/site/reference/subsystems/core.md +1081 -0
  193. package/kb/site/reference/subsystems/credentials.md +136 -0
  194. package/kb/site/reference/subsystems/filesystem.md +498 -0
  195. package/kb/site/reference/subsystems/goal.md +280 -0
  196. package/kb/site/reference/subsystems/index.md +58 -0
  197. package/kb/site/reference/subsystems/invariants.md +91 -0
  198. package/kb/site/reference/subsystems/jobs.md +293 -0
  199. package/kb/site/reference/subsystems/llm-streaming.md +926 -0
  200. package/kb/site/reference/subsystems/lsp.md +205 -0
  201. package/kb/site/reference/subsystems/permission-presets.md +134 -0
  202. package/kb/site/reference/subsystems/persistence.md +388 -0
  203. package/kb/site/reference/subsystems/plan.md +90 -0
  204. package/kb/site/reference/subsystems/sandbox.md +221 -0
  205. package/kb/site/reference/subsystems/schedule.md +189 -0
  206. package/kb/site/reference/subsystems/scope.md +62 -0
  207. package/kb/site/reference/subsystems/session-projection.md +265 -0
  208. package/kb/site/reference/subsystems/session-query.md +498 -0
  209. package/kb/site/reference/subsystems/session-reference.md +111 -0
  210. package/kb/site/reference/subsystems/session-telemetry.md +197 -0
  211. package/kb/site/reference/subsystems/session-title.md +207 -0
  212. package/kb/site/reference/subsystems/session.md +854 -0
  213. package/kb/site/reference/subsystems/settings.md +313 -0
  214. package/kb/site/reference/subsystems/shell.md +306 -0
  215. package/kb/site/reference/subsystems/skills.md +334 -0
  216. package/kb/site/reference/subsystems/spill.md +120 -0
  217. package/kb/site/reference/subsystems/storage.md +232 -0
  218. package/kb/site/reference/subsystems/subagent.md +739 -0
  219. package/kb/site/reference/subsystems/subprocess.md +327 -0
  220. package/kb/site/reference/subsystems/system-prompt.md +210 -0
  221. package/kb/site/reference/subsystems/terminal.md +187 -0
  222. package/kb/site/reference/subsystems/token-meter.md +93 -0
  223. package/kb/site/reference/subsystems/tools.md +723 -0
  224. package/kb/site/reference/subsystems/typert.md +339 -0
  225. package/kb/site/reference/subsystems/user-questions.md +181 -0
  226. package/kb/site/reference/subsystems/web-server.md +111 -0
  227. package/kb/site/reference/subsystems/web.md +202 -0
  228. package/kb/site/reference/subsystems/workflow.md +281 -0
  229. package/kb/site/reference/subsystems/workspace.md +231 -0
  230. package/kb/site/reference/tool-catalog.md +1880 -0
  231. package/kb/site/reference/tool-execution-pipeline.md +66 -0
  232. package/package.json +40 -0
  233. package/scripts/rebuild-index.mjs +88 -0
  234. package/skills/dsh-plugin-dev-kb.md +66 -0
@@ -0,0 +1,388 @@
1
+ ---
2
+ editSource: "docs/subsystems/persistence.md"
3
+ outline: [2,3]
4
+ ---
5
+
6
+ # Session Persistence
7
+
8
+ The **durability seam** for the event log. [session.md](./session.md) describes the in-memory `Session` — the append-only `SessionEvent` log that is the source of truth. This page describes how that log is made durable: the abstract `SessionPersistence` service, its backends, the flush checkpoint, crash recovery, and the metadata header that travels alongside the log. The event vocabulary the log carries is enumerated, member by member, in the generated [persistence log event catalog](../persistence-catalog.md).
9
+
10
+ The seam is a [capability seam](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-06-13-capability-seams.md): one abstract service ([dsh-session-persistence](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/session/session-persistence), `ctx.sessionPersistence`) defining locate/create/append, reusable Session preparation, logical load/inspect, physical suffix reads, and lightweight list/snapshot observation over the existing `SessionEvent` — **no parallel persisted event type** — and two interchangeable backends implementing the same contract. See the [session-persistence Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-06-14-session-persistence.md).
11
+
12
+ ## The flush checkpoint
13
+
14
+ `session/event` is a *synchronous* notification; persistence plugins copy the event into a per-session controller without blocking the producer. The first pending event starts a fixed batching window, and later events join without resetting its deadline. Expiry starts one durable batch; events admitted during that write receive their own deadline and form a follow-up batch. `session/flush` cancels the wait and drains through quiescence, so the loop still uses it as the ordering and error-observation checkpoint before claiming the next ordinary turn. A rejected background write retains its events and pauses automatic retry; a new event starts a fresh window, while explicit flush retries immediately and reports failure through `agent/error` and the logger, never as a session event past the closed turn. Disposal performs the same final drain. The configured maximum bounds only intentional batching wait, not event-loop scheduling or backend durability latency ([decision](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-08-08-bounded-session-persistence-write-batching.md)).
15
+
16
+ ## Crash recovery preserves an interrupted turn
17
+
18
+ A backend that reloads a log crashed mid-turn finds an open `turn/start` with no `turn/end`. It does **not** truncate — a single turn can be huge in a long-horizon task (many steps, large tool output), and those events were durably appended before the crash. Instead it closes the orphaned turn with a synthetic `turn/end { reason: { kind: 'interrupted' } }`, keeping the interrupted execution balanced without changing any standalone events before or after it. `interrupted` is the one `TurnEndReason` no loop emits (see [session.md](./session.md#why-a-turn-ended-turnendreasonmap)).
19
+
20
+ Repair applies only to cold sessions. For a live id, `SessionPersistence.load(id)` waits until the authoritative in-memory snapshot is durable and returns it only when balanced; an open live turn rejects rather than receiving synthetic interruption boundaries. HMR adopts a live prefix without closing its active turn.
21
+
22
+ `SessionPersistence.inspect(id)` constructs an immutable logical Session without publishing it or writing recovery. Cold inspection balances an interrupted turn in memory while leaving torn physical tails untouched; inspection of an already-live Session borrows its current immutable snapshot and may therefore contain an open turn. Coordinator-backed implementations retain the exact cold unpublished Session in a bounded LRU, so repeated history reads and a later `prepare(id)` share one read, decompression, validation, freeze, and Session construction. `prepare(id)` reserves the Session, commits pending repair, and returns a disposable publication handle; `load(id)` uses the same machinery to commit repair without publication. The [Session preparation decision](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-08-05-session-preparation.md) owns this lifecycle.
23
+
24
+ ## `SessionLocation` — optional per-session artifact target
25
+
26
+ `SessionPersistence.locate(meta)` synchronously resolves a backend-owned independent artifact without reading, creating, or flushing it. JSONL returns the absolute transcript path inside its project/session directory; SQLite returns `undefined` because sessions share one database. A returned path can therefore name a file that does not yet exist or lacks the current unflushed turn; it is a location hint, not authorization or a freshness guarantee.
27
+
28
+ ```ts type-equiv
29
+ /**
30
+ * A backend-resolved, per-session local artifact location. The path is an
31
+ * absolute target path and can name an artifact that has not materialized yet.
32
+ * Consumers must treat it as a location hint, never as an authorization token.
33
+ */
34
+ interface SessionLocation {
35
+ /** Backend-specific artifact kind, for example `jsonl`. */
36
+ readonly kind: string
37
+ /** Absolute path to this session's backend-owned artifact. */
38
+ readonly path: string
39
+ }
40
+ ```
41
+
42
+ <a id="sessionheader--metadata-beside-the-log"></a>
43
+
44
+ ## `SessionHeader` — metadata beside the log
45
+
46
+ Per-session metadata travels **separately** from the event log: format version, cwd, lineage, and the seed boundary are storage concerns, not conversation events, so they stay out of `SessionEventMap` and never reach `deriveMessages()`. The header is attached to a `Session` via `session.header`.
47
+
48
+ Source: [`packages/core/session/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
49
+
50
+ ```ts type-equiv
51
+ /**
52
+ * Immutable validated storage metadata, kept outside the conversation event log.
53
+ */
54
+ interface SessionHeader {
55
+ /**
56
+ * On-disk format version, stamped from {@link SESSION_FORMAT_VERSION} when the
57
+ * session is created. A persistence backend rejects any other version on load
58
+ * (no migration — see the constant).
59
+ */
60
+ readonly version: number
61
+ /** The session's id (mirrors the {@link Session}'s id). */
62
+ readonly id: SessionId
63
+ /** Non-negative safe-integer Unix epoch milliseconds when the session was created. */
64
+ readonly createdAt: number
65
+ /** Absolute working directory the session was created in (if any). */
66
+ readonly cwd?: string
67
+ /** The session this one was forked from (seed lineage), if any. */
68
+ readonly parentSession?: SessionId
69
+ /**
70
+ * How many leading events were inherited through a seed. Persisting this
71
+ * boundary lets resume and replay distinguish parent history from child work.
72
+ */
73
+ readonly seedLength?: number
74
+ /**
75
+ * Coarse product classification for a session created as a subagent child.
76
+ * This is presentation metadata, not proof that the child is continuable.
77
+ */
78
+ readonly origin?: 'subagent'
79
+ /**
80
+ * Delegation depth: absent (zero) for a top-level session, parent depth + 1
81
+ * for a subagent child. Persisted so a recursion budget survives restart and
82
+ * resume — a runtime-only depth would reset a resumed child to top-level.
83
+ */
84
+ readonly delegationDepth?: number
85
+ /**
86
+ * Id of the agent preset this session's agent was composed from, when the
87
+ * deployment composes per session. Durable because the preset decides the
88
+ * session's tools and prompt: a resume that restored a different composition
89
+ * would replay history the model can no longer act on.
90
+ */
91
+ readonly agentPreset?: string
92
+ }
93
+ ```
94
+
95
+ ## Format refusal — logs a build cannot faithfully read
96
+
97
+ A backend refuses a log it cannot faithfully interpret with `SessionFormatUnsupportedError`, distinct from `SessionPersistenceCorruptionError` because nothing is damaged. A header `version` ahead of `SESSION_FORMAT_VERSION` names the direction ("written by a newer harness — upgrade the harness to open it"); one behind it states that this build ships no upgrade path. After legacy-shape normalization, an event type outside this build's generated vocabulary (`KNOWN_SESSION_EVENT_TYPES`, emitted by `gen-persistence-catalog`) refuses the same way unless the event's envelope carries `ignorable: true` — silently skipping an unrecognized required event could change how the rest of the log must be read. The message appends the raw log path when the backend keeps one artifact per session, so the refused text stays reachable. The JSONL backend refuses a foreign version straight from the raw header line, before validating today's header shape or decoding any event row — a structurally different future format still reports the upgrade direction, never "corrupt"; SQLite gates whole-file structure through its own `SCHEMA_VERSION` pragma first. Design rationale and the deferred upgrader chain live in the [session-log-version-mechanism note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-08-10-session-log-version-mechanism.md).
98
+
99
+ ## `CreateSessionOptions` — seeding and metadata
100
+
101
+ Creating a `Session` through the store takes a `seed` (initial replay or fork history) and `meta` (the storage-level fields the store folds into a `SessionHeader`). The store fills in `version`/`id` and defaults `createdAt`; the caller may supply the validated absolute `cwd`, the `parentSession` lineage, the `seedLength` seed boundary, the optional coarse `origin`, the `delegationDepth`, the `agentPreset` the agent was composed from, and an existing `createdAt`. `origin: 'subagent'` lets product navigation hide duplicate child rows; it does not prove that a descriptor is valid or that the child can resume.
102
+
103
+ ```ts type-equiv
104
+ /**
105
+ * Options for creating a {@link Session} via the store. `seed` replays/forks
106
+ * an existing event log; `meta` carries the caller-supplied storage fields the
107
+ * store folds into a {@link SessionHeader}.
108
+ */
109
+ interface CreateSessionOptions {
110
+ /** Initial replay or fork history supplied at construction. */
111
+ readonly seed?: readonly SessionEvent[]
112
+ /**
113
+ * Storage metadata read once before publication. `seedLength` is explicit
114
+ * because a resumed seed contains the full stored log, not only its inherited prefix.
115
+ */
116
+ readonly meta?: {
117
+ readonly cwd?: string
118
+ readonly parentSession?: SessionId
119
+ readonly createdAt?: number
120
+ readonly seedLength?: number
121
+ readonly origin?: 'subagent'
122
+ readonly delegationDepth?: number
123
+ readonly agentPreset?: string
124
+ }
125
+ }
126
+ ```
127
+
128
+ Replay/fork is therefore `ctx.sessions.create(id, { seed: seedEvents })`; resuming a *persisted* session into a live agent is `ctx.agents.resume({ resumeSessionId })`.
129
+
130
+ ## `SessionRawArtifact` — verbatim stored artifact text
131
+
132
+ A backend's own artifact text for one session, byte-identical to what it durably wrote (decoded from its physical encoding). `readRaw` returns it without reconstructing from parsed events, so backend-specific serialization (chunk packing, key order, line breaks) survives. Consumers first test `supportsRawArtifacts`: `false` means the backend does not provide this capability (for example SQLite), while `readRaw(...) === undefined` means a supported backend has no materialized artifact for that session.
133
+
134
+ ```ts type-equiv
135
+ /** A backend's own raw artifact text for one session, verbatim. */
136
+ interface SessionRawArtifact {
137
+ /** The session header parsed from the artifact's own first line. */
138
+ readonly meta: SessionHeader
139
+ /** The artifact's base filename on disk, without any physical encoding suffix. */
140
+ readonly filename: string
141
+ /** The artifact's full text content, decoded from the backend's physical encoding. */
142
+ readonly content: string
143
+ }
144
+ ```
145
+
146
+ ## Preparation and restoration ownership
147
+
148
+ `SessionStore.prepare()` accepts ordinary creation options or fresh persistence graphs transferred through `RestoredSessionOptions`. The restoration branch validates and freezes the transferred header and events in place, so callers must retain no mutable aliases. `SessionPreparation` then owns the exact unpublished Session until publication or rollback; disposal is synchronous and idempotent. Persistence inspection exposes only `SessionInspection`, an immutable logical view borrowed from the same prepared Session.
149
+
150
+ ```ts type-equiv
151
+ /**
152
+ * Fresh storage values transferred to {@link SessionStore.prepare} without a
153
+ * second serialization copy. Callers retain no mutable aliases.
154
+ */
155
+ interface RestoredSessionOptions {
156
+ /** Fresh detached storage events to validate and freeze in place. */
157
+ readonly seed: SessionEvent[]
158
+ /** Fresh detached storage metadata to validate and freeze in place. */
159
+ readonly meta: SessionHeader
160
+ /** Select the persistence ownership-transfer path. */
161
+ readonly seedSource: 'persistence'
162
+ }
163
+ ```
164
+
165
+ ```ts type-equiv
166
+ /** Inputs accepted while constructing an unpublished Session. */
167
+ type PrepareSessionOptions =
168
+ | (CreateSessionOptions & { readonly seedSource?: undefined })
169
+ | RestoredSessionOptions
170
+ ```
171
+
172
+ ```ts type-equiv
173
+ /** Options for a preparation whose provider retains unpublished state. */
174
+ interface SessionPreparationOptions {
175
+ /** Release provider-owned state when the Session was not published. */
176
+ readonly release?: () => void
177
+ }
178
+ ```
179
+
180
+ ```ts public-api
181
+ /**
182
+ * One exact unpublished Session and the provider state that keeps it usable.
183
+ * Disposal is synchronous and idempotent. Providers decide whether release
184
+ * returns the Session to a cache or discards it; publication may consume that
185
+ * state before disposal, making the callback a no-op.
186
+ */
187
+ declare class SessionPreparation implements Disposable {
188
+ /** The exact Session to use for setup and publication. */
189
+ readonly session: Session;
190
+ /**
191
+ * Wrap an unpublished Session in one preparation lifetime.
192
+ * @param session - exact unpublished Session.
193
+ * @param options - optional provider release behavior.
194
+ * @returns a preparation disposed after publication or rollback.
195
+ */
196
+ static create(session: Session, options?: SessionPreparationOptions): SessionPreparation;
197
+ /** Release provider state once when this preparation leaves its caller. */
198
+ [Symbol.dispose](): void;
199
+ }
200
+ ```
201
+
202
+ ```ts type-equiv
203
+ /** Immutable logical session prepared from persistence or a live owner. */
204
+ interface SessionInspection {
205
+ /** Validated immutable session metadata. */
206
+ readonly meta: SessionHeader
207
+ /** Validated contiguous logical event log. */
208
+ readonly events: readonly SessionEvent[]
209
+ }
210
+ ```
211
+
212
+ ## Lightweight source revisions
213
+
214
+ Consumers of derived state compare a cheap opaque revision before loading a full event log. The persistence backend owns its representation and changes it transactionally with append or mutating load repair; callers compare it only for equality.
215
+
216
+ ```ts type-equiv
217
+ /**
218
+ * Backend-owned token that identifies both one storage source and one revision
219
+ * of a persisted session log.
220
+ */
221
+ type SessionPersistenceRevision = Branded<'SessionPersistenceRevision'>
222
+ ```
223
+
224
+ ```ts type-equiv
225
+ /** Lightweight immutable source identity returned without loading a full log. */
226
+ interface SessionPersistenceSnapshot {
227
+ /** Detached metadata for one materialized session. */
228
+ header: SessionHeader
229
+ /** Opaque source-qualified token that changes whenever this stored log changes. */
230
+ revision: SessionPersistenceRevision
231
+ }
232
+ ```
233
+
234
+ ## The backends
235
+
236
+ Both implement the same abstract `SessionPersistence` (locate/create/append/prepare/load/inspect/readFrom/list/listSnapshots over `SessionEvent`, with optional cancellation on observation methods) and pass the shared `runPersistenceContract` suite:
237
+
238
+ - **[dsh-session-persistence-jsonl](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/session/session-persistence-jsonl)** — an append-only logical JSONL log per session, stored as checksummed concatenated Zstandard frames by default or raw lines by configuration, with crash-safe atomic writes, interrupted-turn recovery, and a read/replay path.
239
+ - **[dsh-session-persistence-sqlite](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/session/session-persistence-sqlite)** — `node:sqlite`, one row per `SessionEvent`. The row fields `(session_id, seq, type, time, data, source_event_seqs, surface_op)` map 1:1 onto the event, including optional surface metadata, so there is no parallel persisted schema to keep in sync.
240
+
241
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
242
+
243
+ <a id="cordis-surface"></a>
244
+
245
+ ## Cordis API
246
+
247
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — this section is byte-identical in both language sides of the page. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
248
+
249
+ <a id="ctxsessionpersistence--sessionpersistence-abstract-seam"></a>
250
+
251
+ ### `ctx.sessionPersistence` — `SessionPersistence` (abstract seam)
252
+
253
+ Durable append-only session storage. Implementations preserve contiguous, losslessly JSON-serializable events; append resolves only after durability, and load balances a complete interrupted tail without rewriting committed events.
254
+
255
+ ```ts cordis-catalog
256
+ /**
257
+ * Resolve this backend's independent local artifact for a session without
258
+ * reading, creating, flushing, or otherwise materializing it. Backends such
259
+ * as SQLite that do not own one artifact per session return `undefined`.
260
+ * @param meta - the immutable session header whose artifact is requested.
261
+ * @returns the backend-specific absolute location, when one exists.
262
+ */
263
+ abstract locate(meta: SessionHeader): SessionLocation | undefined
264
+
265
+ /**
266
+ * Read a session's backend-owned artifact text verbatim — the exact durable
267
+ * bytes the backend wrote (decoded from its physical encoding, e.g. a
268
+ * decompressed JSONL). The returned `content` is the raw text, not a
269
+ * reconstruction from parsed events, so it preserves backend-specific
270
+ * serialization (chunk packing, key order, line breaks). Callers first test
271
+ * {@link supportsRawArtifacts}; `undefined` then means only that the requested
272
+ * session has no materialized artifact.
273
+ * @param _id - the persisted session to read (unused by the default: no
274
+ * per-session artifact).
275
+ * @param signal - optional cancellation for backend read work.
276
+ * @returns the raw artifact plus its parsed header, or `undefined` when the
277
+ * session is absent.
278
+ * @throws when this backend does not expose per-session raw artifacts.
279
+ */
280
+ readRaw(_id: SessionId, signal?: AbortSignal): Promise<SessionRawArtifact | undefined>
281
+
282
+ /**
283
+ * Register a new session's metadata. A backend MAY defer the physical write
284
+ * until the first {@link append} (lazy materialization), in which case a
285
+ * created-but-never-appended session is absent from {@link list}
286
+ * — abandoned sessions leave nothing behind.
287
+ * @param meta - the immutable header (id, version, cwd, lineage) to record.
288
+ */
289
+ abstract create(meta: SessionHeader): Promise<void>
290
+
291
+ /**
292
+ * Durably persist a batch of events. Honors the append-only and contiguous-
293
+ * seq contracts: the first event's `seq` MUST equal the stored next-seq
294
+ * (after `load` has durably closed any interrupted turn). Rejects non-JSON-
295
+ * serializable `event.data` with an error naming the offending event type.
296
+ * @param id - the session the batch belongs to.
297
+ * @param events - the contiguous batch to persist, in seq order.
298
+ */
299
+ abstract append(id: SessionId, events: readonly SessionEvent[]): Promise<void>
300
+
301
+ /**
302
+ * Prepare the exact unpublished Session used by resume. Implementations may
303
+ * reuse object graphs retained by an earlier {@link inspect} after confirming
304
+ * their durable revision is still current; disposal releases an unpublished
305
+ * reservation. Revision retries require the durable log to remain unchanged
306
+ * for one read/check round trip; continuous external writers may delay completion.
307
+ * @param id - persisted session to prepare.
308
+ * @param signal - optional cancellation for preparation work.
309
+ * @returns one owned unpublished Session preparation.
310
+ */
311
+ async prepare(id: SessionId, signal?: AbortSignal): Promise<SessionPreparation>
312
+
313
+ /**
314
+ * Load an immutable balanced logical view and commit any required cold
315
+ * recovery. A complete interrupted final turn is preserved and durably
316
+ * closed with missing tool errors plus any open step and turn boundaries;
317
+ * only a torn final record is discarded. Unknown versions and corruption in
318
+ * the committed prefix reject. Implementations MUST NOT crash-repair an
319
+ * identity still bound to a live Session: a balanced live log may return as a
320
+ * durable snapshot, while an open live turn rejects. Returned values may be
321
+ * shared with immutable live or prepared state and must not be mutated.
322
+ * Revision-based implementations may wait for one stable read/check round trip.
323
+ * @param id - the persisted session to reload.
324
+ * @returns the header and a log ending on a balanced `turn/end`.
325
+ */
326
+ abstract load(id: SessionId): Promise<SessionInspection>
327
+
328
+ /**
329
+ * Inspect an immutable logical session without committing recovery or
330
+ * publishing it. A cold complete interrupted turn receives synthetic closers
331
+ * in memory and a torn physical tail remains untouched. An already-live
332
+ * Session instead yields its current immutable snapshot, which may contain an
333
+ * open turn and its `session/end-seed` boundary. Coordinator-backed
334
+ * implementations retain the exact cold unpublished Session for bounded
335
+ * reuse by a later {@link prepare}. A stale ready source is reloaded; a source
336
+ * already committing or reserved for resume remains exclusive, and inspection
337
+ * may borrow its immutable view. Callers borrow only the immutable header and
338
+ * log. Continuous external writers may delay revision convergence.
339
+ * @param id - the persisted session to inspect.
340
+ * @param signal - optional cancellation for queued and backend read work.
341
+ * @returns the validated header and current logical event log.
342
+ */
343
+ abstract inspect(id: SessionId, signal?: AbortSignal): Promise<SessionInspection>
344
+
345
+ /**
346
+ * Read the stored events from `fromSeq` onward — the read-from-seq
347
+ * primitive for read models that resume from a watermark (e.g. a persisted
348
+ * projection cache folding only the tail past its checkpoint). Unlike
349
+ * {@link inspect}, it is a detached physical suffix read: no preparation
350
+ * cache, torn-tail truncation, synthetic closers, or coordinator-state
351
+ * publication. Only events from the valid contiguous stored prefix are
352
+ * returned, so a torn fragment never reaches the caller. `fromSeq` at or
353
+ * beyond the stored prefix returns an empty event list (never an error).
354
+ * Backends whose medium can seek by seq
355
+ * (SQLite) read only the suffix; sequential media (JSONL, both encodings)
356
+ * still parse the whole artifact and skip forward — the primitive bounds
357
+ * what is RETURNED and refolded, not every backend's physical read.
358
+ * @param id - the persisted session to read.
359
+ * @param fromSeq - first event seq to include; a non-negative safe integer.
360
+ * @param signal - optional cancellation for queued and backend read work.
361
+ * @returns the header and the stored events with `seq >= fromSeq`.
362
+ */
363
+ abstract readFrom(id: SessionId, fromSeq: number, signal?: AbortSignal): Promise<{ meta: SessionHeader; events: SessionEvent[] }>
364
+
365
+ /**
366
+ * Lightweight listing from metadata, without a full-log parse.
367
+ * @param signal - optional cancellation for backend listing work.
368
+ * @returns one header per materialized session.
369
+ */
370
+ abstract list(signal?: AbortSignal): Promise<SessionHeader[]>
371
+
372
+ /**
373
+ * List materialized sessions with cheap per-log change tokens.
374
+ *
375
+ * Repeated observations of an unchanged log return the same revision. A
376
+ * successful mutating {@link load} repair changes the next listed revision.
377
+ * Revisions also distinguish independently backed stores so backend-local
378
+ * counters cannot compare equal across different persistence sources.
379
+ * @param signal - optional cancellation for backend snapshot-listing work.
380
+ * @returns one header and opaque revision per materialized session without loading full logs.
381
+ */
382
+ abstract listSnapshots(signal?: AbortSignal): Promise<SessionPersistenceSnapshot[]>
383
+ ```
384
+
385
+ Types: [SessionEvent](./session.md) · [SessionId](./core.md)
386
+
387
+ Source: [`packages/session/session-persistence/src/index.ts:84`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-persistence/src/index.ts)
388
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,90 @@
1
+ ---
2
+ editSource: "docs/subsystems/plan.md"
3
+ outline: [2,3]
4
+ ---
5
+
6
+ # Plan Mode
7
+
8
+ Plan mode is logged per-agent collaboration state owned by [dsh-plan-mode](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/plan/plan-mode) (`ctx.planMode`, `PlanModeController`): while active, a deployment-owned guidance section is included in each model request. Plan mode is **soft guidance**. [Sandbox mode](./sandbox.md) and [approval policy](./approval.md) enforce restrictions independently; neither reads or writes plan state, so deployments configure them separately. The package is optional, and the agent loop does not depend on it. It contributes the `plan:policy` prompt section and registers the `exit_plan_mode` tool and `/plan` command. The [design note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/simplification/2026-07-22-plan-specific-collaboration-state.md) owns the rationale; the [package README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/plan/plan-mode/README.md) owns the model-experience and limitation detail.
9
+
10
+ Source: [`packages/plan/plan-mode/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/plan/plan-mode/src/index.ts)
11
+
12
+ ## Logged state and recovery
13
+
14
+ `plan/mode` (`{ active: boolean }`) is a log-only, whole-value-replace [session event](./session.md): durable and replayable, never in the model transcript. `foldPlanMode(events, end?)` returns the last logged value in the prefix, or `false` when there is none — the state in force is always a pure fold of the session log, so resume, fork, and compaction recover it with no live mirror, and UIs observe committed flips through `session/event`. The complete event declaration is in the [persistence log event catalog](../persistence-catalog.md).
15
+
16
+ ## Pending selections and the pre-step append
17
+
18
+ Because every session event is turn-enclosed, a user selection remains pending until the next accepted in-turn pre-step appends it before request derivation, in whichever turn that occurs. A selection never forces continuation, so one made after a turn's final accepted pre-step is appended in a later turn. `set(agent, active)` records the pending selection (a no-op when the target equals the logged-or-already-pending state), and `get(agent)` returns `{ active: boolean; pending?: boolean }`: the logged state used to assemble the current step plus the selected state waiting to be appended.
19
+
20
+ The only append point while an agent is running is a prepended `agent/pre-step` listener. It observes every proposed request step, including turn 1 step 1 and request-recovery retries, calls downstream listeners first, and appends only after they accept the step. Prompt admission happens before a turn and cannot append `plan/mode`, so a selection made at the prompt is appended by the first accepted in-turn pre-step of the turn it starts. An append failure cannot block the turn, and the selection remains pending for a later accepted in-turn pre-step. An appended user selection also records one plugin-sourced `user/message` notice, but only when the last logged request header described the other state, so the model is told exactly when its context changed and never redundantly. A selection made after a turn's final accepted pre-step remains process-local and is lost if the process exits before another accepted in-turn pre-step ([README limitation](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/plan/plan-mode/README.md#known-limitations-and-deferred-work)).
21
+
22
+ ## Configuration
23
+
24
+ ```ts type-equiv
25
+ /** Deployment-owned plan guidance. */
26
+ interface PlanModeConfig {
27
+ /** Guidance rendered as the `plan:policy` prompt section while plan mode is active. */
28
+ section: string
29
+ }
30
+ ```
31
+
32
+ A missing, blank, or non-string `section` and any unknown key fail at plugin load rather than being ignored. While plan mode is active, the exact `section` text renders as the `plan:policy` [system-prompt section](./system-prompt.md) at order 50; inactive plan mode contributes no text.
33
+
34
+ ## The exit tool and the `/plan` command
35
+
36
+ [`exit_plan_mode`](../tool-catalog.md#deepseek-aidsh-plan-mode) stays registered while plan mode is inactive, so entering or leaving plan mode changes only the prompt section, never the request tool catalog; execution outside plan mode fails. In plan mode it requires a complete markdown plan starting with a `#` heading and presents it for review through the [user-questions seam](./user-questions.md). Approval returns `{ approved: true }` and records a silent (non-narrated) pending exit that is appended at the next accepted in-turn pre-step. Plan guidance therefore remains active for the rest of the assistant's current tool batch, and the tool result itself reports the transition. Keep-planning is a failed call carrying the user's feedback, so the model revises and presents again; a missing interaction channel and a service reload during review also fail the call rather than silently leaving plan mode.
37
+
38
+ When [`ctx.commands`](./commands.md) is composed, the plugin registers `/plan [off|message]`: bare `/plan` selects plan mode, any other non-empty message selects it and then submits the text through `agent.steer()` so it becomes the next step's ordinary logged user message under plan guidance, and the exact argument `off` selects inactive, which also cancels a pending entry before it is appended and becomes visible to a request.
39
+
40
+ ## The service
41
+
42
+ `ctx.planMode` owns the logged plan state, applies and narrates selected state at step start, and owns the `plan:policy` section, the `/plan` command, and the stable exit tool; `get`/`set` signatures are in the generated [service catalog](#ctxplanmode--planmodecontroller).
43
+
44
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
45
+
46
+ <a id="cordis-surface"></a>
47
+
48
+ ## Cordis API
49
+
50
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — this section is byte-identical in both language sides of the page. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
51
+
52
+ <a id="ctxplanmode--planmodecontroller"></a>
53
+
54
+ ### `ctx.planMode` — `PlanModeController`
55
+
56
+ `ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the stable exit tool. UIs observe committed flips through `session/event`; there is no live mirror.
57
+
58
+ ```ts cordis-catalog
59
+ /**
60
+ * Read the logged plan state and any selected state awaiting the next
61
+ * accepted in-turn pre-step.
62
+ *
63
+ * @param agent The agent to read.
64
+ * @returns Current logged state plus a pending selection, when present.
65
+ */
66
+ get(agent: Agent): { active: boolean; pending?: boolean }
67
+
68
+ /**
69
+ * Select whether plan mode should be active. Between turns the method
70
+ * appends the change immediately because no in-turn pre-step will run until
71
+ * another prompt starts a turn. The open-turn fold is the idle signal:
72
+ * agent status stays `running` through post-turn checkpointing, when no
73
+ * further in-turn pre-step runs. During an open turn the selection remains
74
+ * pending until the next accepted in-turn pre-step. Repeated selection of
75
+ * the current or already-pending state is a no-op.
76
+ *
77
+ * @param agent The agent to switch.
78
+ * @param active Whether plan mode should be active.
79
+ * @returns what happened: `committed` (logged now), `queued` (awaiting the
80
+ * next accepted in-turn pre-step), `cancelled` (an opposite pending selection
81
+ * was cleared; the logged state already matches), or `noop` (already in that
82
+ * state).
83
+ */
84
+ set(agent: Agent, active: boolean): 'committed' | 'queued' | 'cancelled' | 'noop'
85
+ ```
86
+
87
+ Types: [Agent](./core.md)
88
+
89
+ Source: [`packages/plan/plan-mode/src/index.ts:184`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/plan/plan-mode/src/index.ts)
90
+ <!-- END GENERATED cordis-surface -->