dsh-taskbridge 0.0.0-stage → 1.3.2

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 (75) hide show
  1. package/CHANGELOG.md +763 -0
  2. package/LICENSE +21 -0
  3. package/README.md +622 -3
  4. package/bin/dsh-delegate-codex-agent.js +115 -0
  5. package/bin/dsh-delegate-control.d.ts +90 -0
  6. package/bin/dsh-delegate-control.js +450 -0
  7. package/bin/dsh-delegate-mcp.d.ts +121 -0
  8. package/bin/dsh-delegate-mcp.js +273 -0
  9. package/codex/dsh-taskbridge.toml +247 -0
  10. package/cordis.patch.yml +6 -0
  11. package/docs/INTRODUCTION.md +15 -0
  12. package/docs/INTRODUCTION.zh.md +34 -0
  13. package/docs/auth-contract.md +138 -0
  14. package/docs/claude-code.md +31 -0
  15. package/docs/codex-integration.md +937 -0
  16. package/docs/contracts-stage-b.md +443 -0
  17. package/docs/conversation-placement.md +304 -0
  18. package/docs/plugin-market.md +30 -0
  19. package/docs/redaction-contract.md +127 -0
  20. package/docs/runtime-compatibility.md +223 -0
  21. package/docs/silent-wait.md +191 -0
  22. package/docs/taskbridge-upgrade.md +28 -0
  23. package/docs/taskdispatch-upgrade.md +25 -0
  24. package/docs/worker-permissions.md +347 -0
  25. package/docs/workspace-contract.md +538 -0
  26. package/icon.svg +1 -0
  27. package/lib/client.d.ts +118 -0
  28. package/lib/client.js +3232 -0
  29. package/locale/en.json +7 -0
  30. package/locale/zh.json +7 -0
  31. package/package.json +138 -4
  32. package/src/auth/fence.js +361 -0
  33. package/src/auth/grants.js +789 -0
  34. package/src/client/api.js +2322 -0
  35. package/src/client/index.jsx +2333 -0
  36. package/src/client/styles.js +251 -0
  37. package/src/codex/installer.js +3299 -0
  38. package/src/codex/seam.js +429 -0
  39. package/src/codex/toml.js +784 -0
  40. package/src/config/defaults.js +164 -0
  41. package/src/config/redact.js +184 -0
  42. package/src/config/settings.js +629 -0
  43. package/src/config/store.js +186 -0
  44. package/src/config/validate.js +763 -0
  45. package/src/credentials/seam.js +202 -0
  46. package/src/http/execution-plane.js +456 -0
  47. package/src/http/respond.js +175 -0
  48. package/src/http/user-plane.js +1122 -0
  49. package/src/index.d.ts +332 -0
  50. package/src/index.js +657 -0
  51. package/src/jobs/activity.js +1008 -0
  52. package/src/jobs/engine.js +3614 -0
  53. package/src/jobs/history.js +1467 -0
  54. package/src/jobs/title.js +17 -0
  55. package/src/mcp/server.js +1821 -0
  56. package/src/mcp/wait.js +536 -0
  57. package/src/model/connectivity.js +371 -0
  58. package/src/model/discovery.js +582 -0
  59. package/src/model/native-catalog.js +68 -0
  60. package/src/model/openai-adapter.js +671 -0
  61. package/src/model/probe.js +264 -0
  62. package/src/model/providers.js +756 -0
  63. package/src/model/routing.js +321 -0
  64. package/src/review/preset.js +868 -0
  65. package/src/review/prompts.js +126 -0
  66. package/src/review/reviewer.js +933 -0
  67. package/src/runtime/agent-runner.js +1740 -0
  68. package/src/runtime/endpoint-discovery.js +118 -0
  69. package/src/runtime/permissions.js +1429 -0
  70. package/src/runtime/sandbox.js +358 -0
  71. package/src/runtime/session-placement.js +1121 -0
  72. package/src/workspace/audit.js +775 -0
  73. package/src/workspace/locks.js +167 -0
  74. package/src/workspace/preflight.js +424 -0
  75. package/src/workspace/worktrees.js +613 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,763 @@
1
+ # Changelog
2
+
3
+ ## 1.3.2 — TaskBridge companion and descriptive task workspace names
4
+
5
+ - Rename the shipped Codex companion to `dsh-taskbridge` (`agents/dsh-taskbridge.toml`). Install and startup migrate an unchanged, recognized published `dsh-delegate.toml` and remove the old managed file; edited agent files remain operator-owned. Add TaskBridge CLI aliases while retaining the existing binaries and internal MCP identifiers.
6
+ - Add an optional `title` to `delegate_submit` and carry it through HTTP, the job engine and the native Workspace controller. Newly created Workspaces use a short description of the work rather than the worktree's `task-UUID` directory name. Older callers derive a title from the prompt's goal. Follow-ups and existing Workspaces keep their titles; duplicate titles receive a short suffix. No additional model call is made for naming.
7
+ - Explicit Codex install/repair can migrate a marked legacy MCP entry after the old package was uninstalled, when its missing package path is a known sibling of the current `dsh-taskbridge` installation. Custom wrappers, unrelated paths and automatic startup path adoption remain excluded.
8
+ - Update the settings page, companion dispatch rules and upgrade instructions. Model selection, delegation authorization, quiet waiting and host review retain their existing behavior.
9
+
10
+ - Make loopback HTTP test fixtures avoid Fetch-blocked ports, which Windows can allocate from a customized low dynamic-port range. This only affects tests.
11
+
12
+ ## 1.3.1 — DSH TaskBridge identity and npm distribution
13
+
14
+ - Unify the project, GitHub repository, plugin title, package and bundle identity as **DSH TaskBridge** / `dsh-taskbridge`. The previous GitHub-only `dsh-taskdispatch` name was rejected by npm's similarity protection; it never became an npm package.
15
+ - Add npm installation instructions alongside the pinned-Git custom plugin index. Keep the 1.3.0 release and tag intact; use a new patch release for the different package identity.
16
+ - Retain existing task data, `delegate_*` tools, CLI names and managed Codex identifiers. Recognize the exact published 1.3.0 agent template and this project's historical repository identities during explicit migration.
17
+ - Update bilingual introductions and migration guidance. Execution, wait, permission and review behavior remains the same as 1.2.0; this release changes identity, distribution and compatibility metadata.
18
+ - Forward the control CLI's injected test dependencies into `runControl`; the entry-point refusal test now stays isolated from the operator's actual harness instead of accidentally depending on its response. Default CLI behavior is unchanged.
19
+
20
+ ## 1.3.0 — DSH TaskDispatch identity and public plugin index
21
+
22
+ - Public package/bundle identity changes from `dsh-delegate` to `dsh-taskdispatch`; the display title is **DSH TaskDispatch**. Existing data paths, endpoint discovery, environment variables, MCP `delegate_*` tools, binaries and the managed Codex agent/server identifiers remain stable.
23
+ - Add English/Chinese plugin metadata, an SVG icon, a Chinese product introduction and manual Claude Code MCP instructions. The intro emphasizes configuring DSH's already-connected APIs, models and supported reasoning effort. No new context-window selector or Claude one-click installer is claimed.
24
+ - Enumerate the exact published 1.2.0 agent-template bytes so existing managed integrations remain refreshable. Explicit moved-install adoption requires this project's old/new repository provenance as well as real files and the exact bin mapping; an unrelated same-name npm package is refused.
25
+ - Add a dependency-free, exact-commit format-1 DSH plugin-index generator and an official-actions GitHub Pages deployment workflow. Search requires adding the project's custom index; this does not claim universal official marketplace inclusion or npm publication.
26
+ - Package identity migration requires stopping/uninstalling the old bundle while retaining plugin data, then installing the new bundle and explicitly repairing the managed Codex entry. Do not activate both bundles at once. Full real Desktop migration/restart and real Claude Code acceptance remain separate checks.
27
+
28
+ ## 1.2.0 — waiting that cannot be mistaken for completion, and an independent control channel
29
+
30
+ Fixes the three problems the 1.1.0 real acceptance run reported: an `interrupted`
31
+ observation no longer claims the execution stopped, a local control channel serves
32
+ `status`/`cancel` while a host is blocked in a wait, and an already-installed managed Codex
33
+ integration upgrades itself. The operator's formally installed Desktop profile is still on
34
+ `1.1.0`; this change does not install `1.2.0` there. The complete Desktop upgrade/restart
35
+ acceptance and the actual token-saving ratio have not been measured; candidate-channel
36
+ acceptance evidence belongs in the Release notes.
37
+
38
+ ### `interrupted` no longer claims the execution stopped
39
+
40
+ - The engine reports `interrupted` when an OBSERVER's own request ends — the caller's
41
+ signal aborted, the connection dropped, the engine released the waiter during teardown.
42
+ `delegate_wait` treated that as a terminal answer, so a host was told a healthy run had
43
+ ended.
44
+ - The wait now decides from the TASK RECORD, not from the reason label
45
+ (`classifyInterruption` / `resolveInterruption` in `src/mcp/wait.js`), and answers
46
+ ONCE per observation:
47
+ - `state` `pending`/`running` with no `endedAt` → the observation ended, the task did
48
+ not. The answer is `reason: "interrupted"`, `terminal: false`, the REAL task state,
49
+ and an instruction to wait again on the SAME `taskId`. The call does NOT re-issue
50
+ an observation internally: a disposed observer answers `interrupted` to every
51
+ request, so looping made one `delegate_wait` an unbounded request storm.
52
+ - `state: "interrupted"` (a restart history this build never writes for a live run) →
53
+ terminal, with an instruction to stop blind waiting and read `delegate_result`.
54
+ - a settled state carried by an `interrupted` observation → the REAL outcome:
55
+ `awaiting-host-review` is `ready` (so a finished run still reaches review),
56
+ `failed`/`cancelled` report themselves.
57
+ - a missing or UNRECOGNIZED state → nothing is asserted (`terminal: false`); an unknown
58
+ state string is never treated as a restart history, and neither "stopped" nor "still
59
+ running" is claimed.
60
+ - `ready` never invents `state: "ready"`: with no task record the state is `null`.
61
+ - The task panel shows a real `interrupted` history as 「已中断(进程重启后不会继续执行)」 —
62
+ never as "still running".
63
+
64
+ ### An independent local control channel
65
+
66
+ - The plugin's own stdio MCP transport already serves concurrent requests; a serialising
67
+ HOST is what blocks a session behind one long `delegate_wait`.
68
+ - New `dsh-delegate-control` binary (`bin/dsh-delegate-control.js`, registered in `bin`):
69
+ `status <taskId>` (one bounded `observe` with `waitMs: STATUS_WAIT_MS`, i.e. 1 ms —
70
+ the smallest positive bound the engine and the monitor both keep — compact JSON) and
71
+ `cancel <taskId>` (stops exactly that task). Both use the existing
72
+ `createExecutionClient` and endpoint discovery against the existing loopback plane.
73
+ - `status` used to send `waitMs: 0`. The HTTP route accepts 0, but the engine
74
+ (`clampObserveWait`) and the monitor (`boundedWait`) both read a non-positive wait as
75
+ "no bound requested" and substitute their 25 s default. Against a real running plane
76
+ that made one status read last 25 s, past the command's own 10 s budget, and the
77
+ observation retry then extended the command further — observed as an independent
78
+ `status` timeout during the 1.2.0 candidate acceptance. The wait is now the smallest
79
+ POSITIVE value, and the mock-only assertion on the request payload is replaced by
80
+ tests that pin the real behaviour (see Tests).
81
+ - One whole-command budget now bounds everything: 10 s by default,
82
+ `DSH_DELEGATE_CONTROL_TIMEOUT_MS` may only lower it, and a config with no usable
83
+ `timeoutMs` still gets the 10 s default. It is enforced through a single caller
84
+ `AbortSignal` composed with the request timeout, plus `{ retry: false }` on this call —
85
+ the observation retry (1 s/2 s/5 s) is disabled for the control command so a dead or
86
+ slow endpoint cannot outlive the budget or leave a request running after the answer.
87
+ There is no `Promise.race` and no background request or process.
88
+ - Any disconnect or timeout is a bounded JSON document and a non-zero exit
89
+ (`CONTROL_TIMEOUT` for an exhausted budget), with no stack trace and no secrets.
90
+ - No submit, no settings, no switch, no grant, no batch cancel, no daemon, no new endpoint,
91
+ permission or configuration surface. Stable JSON on stdout, diagnostics on stderr,
92
+ exit code 0/1/2 for answered/refused-or-timed-out/usage.
93
+ - The default MCP behaviour is unchanged: `delegate_wait` keeps its bounded retry, which
94
+ is what lets a wait survive a DSH restart onto a new port. A normal wait never polls
95
+ the control binary.
96
+ - A wait listener that goes away releases only that observation: cancellation is always an
97
+ explicit `cancel`.
98
+ - The Codex companion gains one narrow rule: when the operator asks to stop or inspect the
99
+ task AND the host is blocking the same MCP connection, it may run this binary from the
100
+ same package directory as the configured MCP script. It may not call any other script,
101
+ resubmit, or switch models, and during a normal wait it stays silent.
102
+ - Tool catalog now carries accurate MCP `annotations` (`readOnlyHint`, `destructiveHint`,
103
+ `idempotentHint`, `openWorldHint`). They help a concurrency-aware client; they are not a
104
+ fix for a serialising one, and nothing claims they are.
105
+
106
+ ### Installed Codex integrations now upgrade themselves
107
+
108
+ - Plugin startup used to refresh only the agent file, so an MCP table installed by an
109
+ earlier release stayed without `tool_timeout_sec = 3660`. A client may still end a wait
110
+ earlier through its own default tool timeout (Codex's historical default is one minute);
111
+ the managed entry now requests 3660 s, which a client that honours the field can grant,
112
+ while a client-side cap that ignores it remains a client limit this plugin cannot lift.
113
+ - The startup check now also upgrades an ALREADY INSTALLED `mcp_servers.dsh-delegate` entry,
114
+ and writes only what it can PROVE is its own: the marker comment, exactly this package's
115
+ Node command, exactly ONE argument that is this installation's exact entry point
116
+ (`isOwnedStaleEntry` / `isOwnedEntryScript`), and no foreign env key. A wrapper that
117
+ reuses the marker, the command or even the file name is a `conflict` and is never
118
+ rewritten; a differing arg count is a conflict too.
119
+ - Accepted migrations: an exact `args` match with only `tool_timeout_sec` missing (the core
120
+ upgrade), and — by an EXPLICIT `install`/`repair` only — a different path that is proved to
121
+ be a real installation of this package: real root/bin/entry objects, a manifest whose
122
+ `name` is this package AND whose `bin["dsh-delegate-mcp"]` maps that entry (a `./` prefix
123
+ is allowed; absolute, out-of-package, wrong or missing mappings are refused). The
124
+ automatic startup check never adopts a moved path; it reports `conflict` and points at the
125
+ button. The owned timeout and a proved moved entry script migrate in ONE write.
126
+ - The plan records a SHA-256 of the whole `config.toml` and the write re-reads the file and
127
+ requires that digest to match — for the automatic migration AND for the explicit
128
+ moved-install adoption, which re-proves the boundary, the digest and the current entry
129
+ immediately before writing. A re-classification alone was NOT enough: a concurrent edit to
130
+ an owned value still looks stale-and-managed, so it is now refused (`config-changed`) and
131
+ the file is kept. The boundary (`$CODEX_HOME`, `agents/`) is re-inspected immediately
132
+ before the write as well, and the pre-write document is copied to the plugin data
133
+ directory (never into the package, never into the Codex home). The backup destination's
134
+ ENTIRE ancestor chain is proved to be real directories — a link/junction above the backup
135
+ directory refuses the upgrade, and missing levels are created one at a time and
136
+ re-inspected.
137
+ - It never creates the entry, never adopts an unmarked or operator-edited entry, never
138
+ follows a symlink/junction at `$CODEX_HOME` or `agents/` — the MCP half is now not even
139
+ REPORTED by reading through a link — and never touches another MCP table or setting.
140
+ - The startup target is the SEAM's decision, not a second read of `process.env`: an explicit
141
+ `CODEX_HOME` first, then the home a successful explicit install recorded in the plugin data
142
+ directory, then the default only when it is a real directory. A default that is a link is
143
+ reported (`default-is-link`) instead of walked, and a first run with no Codex home creates
144
+ nothing.
145
+ - The 1.0.0 and 1.1.0 companions are enumerated by exact SHA-256 in both byte forms (CRLF and
146
+ LF), taken from their RELEASE commits (`git show 2750047:…`, `git show 2d71708:…`) and kept as
147
+ test fixtures, so an existing installation upgrades instead of being reported as somebody
148
+ else's file. The explicit 安装 / 更新 button stays, and the status document now reports
149
+ `mcp.drift` (which owned facts are stale) and a per-fact note.
150
+
151
+ ### Tests
152
+
153
+ - `tests/mcp-wait.test.js`: the case that only proved one heartbeat is now a full
154
+ 1,200,000 ms simulation — 48 bounded 25-second observations, 47 heartbeats, ONE return,
155
+ no heartbeat/diff/execution text in the answer. The interruption cases assert the
156
+ single-observation contract: ONE observe per live interruption, a non-terminal answer on
157
+ the same `taskId`, a terminal restart history, a settled record reported as `ready`/
158
+ `failed`/`cancelled`, an UNKNOWN state asserted neither way, and no invented
159
+ `state: "ready"`. Plus a listener-cancellation case that proves no task cancel is issued.
160
+ - `tests/control-cli.test.js`: the command contract, its refusals and exit codes, the
161
+ lower-only request bound, bounded nested output, and — through REAL, asynchronously spawned
162
+ `node dsh-delegate-control.js` child processes while the parent holds an HTTP plane and a
163
+ parked MCP wait — that `status` and `cancel` both arrive before the wait ends and cancel
164
+ exactly the named task. A bad environment, a missing discovery file and a dead endpoint
165
+ are each bounded JSON refusals with a non-zero exit. The `status` case now pins the
166
+ defect it exists for with the REAL serving side — a `JobEngine` running a real task over a
167
+ real temporary workspace with its own `TaskMonitor`, behind the real
168
+ `createExecutionHandler` on a loopback HTTP server (only the native services every engine
169
+ test fakes are faked; the task really stays `running` because its prompt never finishes):
170
+ a separate `node dsh-delegate-control.js` child must report that running task inside its
171
+ own budget while the parent's `delegate_wait` is still parked, and a second child must
172
+ cancel the SAME task so the parked wait then returns `cancelled`. Because the engine's
173
+ own `clampObserveWait` and the monitor's own `boundedWait` decide the wait, a `status`
174
+ that sent `waitMs: 0` again would be parked for their real 25 s fallback and fail the
175
+ child's 10 s budget with `CONTROL_TIMEOUT` — the failure observed on the live plane. The
176
+ request is asserted to carry `waitMs: 1` and `{ retry: false }`; and separate cases
177
+ cover the whole-command budget (`CONTROL_TIMEOUT`), a missing/unusable config timeout,
178
+ and refusals thrown with unusual error shapes.
179
+ - `tests/mcp.test.js`: a caller's `{ retry: false }` makes exactly one `observe` attempt
180
+ with no backoff, while no context, `{}` and `{ retry: true }` all keep the documented
181
+ 1 s/2 s/5 s schedule — the MCP wait's restart-following behaviour is unchanged.
182
+ - `tests/codex-integration.test.js`: the write gate (wrapper refused, extra args refused, the
183
+ core missing-timeout case accepted), an end-to-end startup run that never rewrites a
184
+ wrapper, the DETERMINISTIC check-then-write race (the config changes after the plan; the
185
+ digest comparison refuses and the edit survives), the same race between the explicit
186
+ moved-install proof and its write, the boundary re-check (including a link appearing after
187
+ the proof), the backup (including a linked ANCESTOR and a non-directory ancestor, plus
188
+ missing levels that must be created), the seam-resolved startup target (explicit /
189
+ recorded / real default / linked default / none), the moved-install proof matrix (real
190
+ manifest + `bin` mapping accepted; missing, wrong, absolute, out-of-package and trailing-
191
+ slash mappings refused; POSIX package root preserved), and the real 1.0.0 and 1.1.0
192
+ fixture upgrades (packed and LF, unchanged and edited).
193
+ Both guards are mutation-tested: disabling the digest check or the ownership rule makes
194
+ these tests fail.
195
+
196
+ ### Known limits
197
+
198
+ - The operator's formally installed Desktop profile is still on `1.1.0`; `1.2.0` was not
199
+ installed there by this change. The complete Desktop upgrade/restart acceptance and the
200
+ actual token-saving ratio have not been measured; the candidate MCP/CLI channel is
201
+ exercised against the currently running plane before release, and that evidence belongs
202
+ in the Release notes rather than being pre-filled here.
203
+ - The control channel's behaviour against a specifically serialising host was not observed
204
+ live; the tests use a mock plane and a real stdio fixture.
205
+ - Annotations do not make a serialising client concurrent.
206
+ - `tool_timeout_sec` is a request to the client. A client that ignores it (or applies its
207
+ own default tool timeout) can still end a wait early; the plugin cannot prove otherwise
208
+ for every client.
209
+ - The 1.1.0 published agent bytes are enumerated as packed (CRLF) and as LF; any other byte
210
+ form of that release is not claimed to be refreshable.
211
+
212
+ ## 1.1.0 — silent waiting and concentrated host review
213
+
214
+ Candidate feature release. Ships the monitoring foundation, the browser settings and task
215
+ panels, the Codex companion's wait-based dispatch rules and the managed Codex config
216
+ migration. It is **not** published and **not** installed by this change.
217
+
218
+ The transport that actually returns `delegate_wait` results (HTTP execution-plane and MCP
219
+ tool) lands in the same release but a separate change; until both are present, the
220
+ companion's new rules describe the contract the tool will honour, and the legacy
221
+ `delegate_result` polling path still works.
222
+
223
+ ### Waiting no longer means polling
224
+
225
+ - New global setting `monitoring = { selfCheckSeconds: 300, attentionSeconds: 600 }`,
226
+ stored as whole seconds, validated (self-check 30–3600, attention greater than the
227
+ self-check and at most 7200). Missing blocks use the defaults, so an existing
228
+ document keeps loading unchanged.
229
+ - A running task now reports bounded activity metadata: last activity time, how long it
230
+ has been idle, the current tool call and how long it has run, event counters, and the
231
+ last self-check verdict. It carries **no** transcript, reasoning, tool arguments or
232
+ diff, so a task view can show progress without becoming a second transcript.
233
+ - At the self-check interval the engine performs one read-only local inspection of the
234
+ executor it already holds (alive, phase, pending permission, current tool). No model
235
+ call, no workspace read, no state change, no deadline change.
236
+ - At the attention interval it reports `attention` instead of staying silent. Idle time
237
+ is the only trigger: a single long tool call is not proof of progress, and nothing is
238
+ failed, cancelled or restarted for duration alone.
239
+ - Real progress resets the silence and stays internal, so a healthy run never wakes the
240
+ dispatcher. Connection heartbeats, result polling and page refreshes never reset it.
241
+ - Attention reports are delivered once per silence and then cooled down; concurrent
242
+ observers cannot both deliver the same one.
243
+
244
+ ### Settings page
245
+
246
+ - New advanced monitoring controls in the existing execution panel: 5 and 10 minutes by
247
+ default, shown in minutes, stored as integer seconds, with local validation and a
248
+ narrow "save monitoring only" action. A general settings save persists them too.
249
+ - The page states the behaviour it relies on: the checks are local, no LLM is called,
250
+ no-progress is not failure, and changes apply to newly submitted tasks only.
251
+ - New authenticated route `POST /api/dsh-delegate/monitoring`. It is a browser-plane
252
+ operator action; the MCP surface still has no settings write.
253
+
254
+ ### Task records
255
+
256
+ - Task rows and the detail view show the phase, the last activity, the current tool and
257
+ its elapsed time, and the no-progress diagnostic in plain Chinese. A record written
258
+ before this feature says "no progress information was collected" instead of inventing
259
+ an idle time.
260
+ - The task tab refreshes itself every 5 seconds **only** while it is visible and at least
261
+ one task is still pending or running. It skips a hidden document, never overlaps a
262
+ request, cleans up its timer on tab change and unmount, and never reads or writes
263
+ settings. Terminal tasks stop the refresh.
264
+ - No completion percentage is estimated or displayed.
265
+
266
+ ### Codex companion
267
+
268
+ - Dispatch is now submit → `delegate_wait` on the same task id, repeated until a reason
269
+ is actionable. `heartbeat` is internal and never reaches the model.
270
+ - Each reason has a stated policy: `attention` is a question and the default answer is to
271
+ keep waiting; `permission` is a decision on one call followed by waiting the same task;
272
+ `ready`/`failed`/`cancelled` read `delegate_result` once for full evidence;
273
+ `interrupted` and `wait-limit` immediately re-wait the same task.
274
+ - Corrections are consolidated into a follow-up `continueFromTaskId` submission using the
275
+ same authorized source path.
276
+ - Explicitly forbids the parent commander and the dispatch companion from implementing
277
+ locally while a delegated worker runs, except for an explicit user-authorized takeover.
278
+
279
+ ### Managed Codex config
280
+
281
+ - The managed `[mcp_servers.dsh-delegate]` entry now carries `tool_timeout_sec = 3660`,
282
+ so a default 60-minute wait can complete. The value is written on this entry only.
283
+ - A managed entry from an earlier release without the field is repaired in place, and
284
+ unrelated configuration is preserved byte for byte. An unmarked or differently shaped
285
+ same-name entry is still treated as operator-owned and never overwritten.
286
+ - The published 1.0.0 companion is enumerated by exact SHA-256 (CRLF and LF byte forms),
287
+ so an existing 1.0.0 installation updates through the settings page instead of being
288
+ reported as somebody else's file.
289
+
290
+ ### Known limits
291
+
292
+ - This release does not promise zero model tokens or a measured token saving. It changes
293
+ what a dispatcher is told and when.
294
+ - Wait-return counts and timing metrics come from the transport change, not from this one.
295
+
296
+ ## 1.0.0 — first formal release
297
+
298
+ The first public major release of `dsh-delegate`. It is distributed from the GitHub
299
+ Release as `dsh-delegate-1.0.0.tgz`.
300
+
301
+ - Adds the commander-mediated, per-call permission decision tool while keeping the
302
+ local switch as the single enable/disable control.
303
+ - Publishes the Codex companion migration for existing managed `0.1.14` installations.
304
+ - Includes workspace isolation, continuation placement, model/provider selection,
305
+ optional read-only review, Codex integration, and the documented fail-closed runtime
306
+ checks.
307
+ - Production Desktop provider execution, sandbox commands, and permission-resume flows
308
+ remain explicitly marked as unverified where the compatibility documents say so.
309
+
310
+ ## 0.1.14 — local build (candidate package, not a public release)
311
+
312
+ Per-call, commander-mediated approval for delegated worker runs, plus the release
313
+ packaging that was deferred from the core batch. The package is built and packed locally
314
+ as `dsh-delegate-0.1.14.tgz` for review; it is **not** published to npm and it is **not**
315
+ installed on the production Desktop profile.
316
+
317
+ ### Status: what is and is not proven
318
+
319
+ - **Proven by tests in this repository:** the bridge, its refusals, its redaction, its
320
+ deadlines, the durable evidence and the MCP projection all pass their own suites, and
321
+ the archived manifest contains the updated native module, the sixth MCP tool, the current
322
+ client bundle, the managed Codex companion and the docs.
323
+ - **NOT yet proven: production acceptance.** The `0.1.13` build currently installed on the
324
+ production Desktop profile must be upgraded through the Desktop plugin manager, and the
325
+ MCP server must be reconnected (or a new session started) before the sixth tool
326
+ `delegate_permission_decide` is visible to a host. Until a real end-to-end
327
+ provider → commander → resume run has been observed on that profile, the production
328
+ feature is **unverified**. A passing unit-test count, and any mock or scripted stand-in,
329
+ is **not** that test and must not be reported as one.
330
+
331
+ ### The worker can now ask for wider access for ONE call, and only the commander answers
332
+
333
+ Every delegated worker run previously installed `approval/policy: "never"`, because the
334
+ plugin had no way to answer a native approval prompt: an escalation was refused
335
+ deterministically. That is still the default. What is added is one narrow, armed path:
336
+
337
+ - A new module `src/runtime/permissions.js` holds the bridge. While the commander follows
338
+ a task, a native DSH approval request (`ctx.on('approval/request', …)` on that Agent's
339
+ own scope) **pauses exactly that tool call**, and the request is exposed through the
340
+ existing `delegate_result` view as `permission.pending`.
341
+ - The real operation is read from the **native Session log**: the committed `tool/call`
342
+ event is matched by `callId` and its model-produced `arguments` JSON is parsed. The
343
+ asker's own `reason` prose is carried beside it labelled `reasonSource: "asker-claim"`
344
+ and is never treated as the operation.
345
+ - A new bounded MCP tool `delegate_permission_decide` (route
346
+ `POST /dsh-delegate/x/tasks/permission`) answers `allow-once` or `reject`. It refuses an
347
+ unknown task, another connection's task, an unknown or already-settled request, a
348
+ request past its deadline, and a fingerprint that does not match the pending operation.
349
+ - The approval stance is `ask` **only** when the run carries an armed bridge bound to the
350
+ Agent it drives; otherwise it stays `never`. Both are written and **read back** through
351
+ `ctx.approval.effectivePolicy(session)`, so an `ask` nobody services is never installed.
352
+ A bridge that cannot be armed refuses the run before the prompt with
353
+ `RUN_PERMISSION_BRIDGE_UNAVAILABLE`.
354
+ - The standing sandbox mode stays `workspace-write` for the whole run; no decision writes
355
+ `danger-full-access` into a Session, and a grant is `appliesTo: this-call-only`,
356
+ `reusable: false`.
357
+
358
+ ### State, lifetimes and evidence
359
+
360
+ - Task state semantics are unchanged: a waiting task is still `running`, with phase
361
+ `awaiting-permission` and a `permission` block. It is neither failed nor
362
+ execution-complete, and it keeps its workspace lock, concurrency slot and provider
363
+ lease until the native executor actually settles.
364
+ - The approval wait has its **own** fixed, bounded deadline (default 10 minutes, capped at
365
+ 30) and is NOT charged to `worker.timeoutSeconds`; `permission.pausedExecutionMs`
366
+ reports the time actually spent waiting.
367
+ - Cancellation, switch-off, revocation, agent disposal, plugin teardown and that deadline
368
+ all settle the outstanding waiter and release the request's timer and abort listener.
369
+ A restart begins with no tasks, no bridge and no request, so an interrupted request can
370
+ never be replayed as an allow.
371
+ - The settled trail is bounded (last 8) and every published string is redacted and
372
+ truncated; the exact private fingerprint still binds the decision.
373
+
374
+ ### UI, docs and contracts
375
+
376
+ - The task panel shows, in plain Chinese, that a task is waiting on one call, the
377
+ redacted arguments, the worker's claimed reason (labelled as a claim), the deadline and
378
+ the decision trail. It offers **no** manual approve button: the decision belongs to the
379
+ commander over MCP.
380
+ - `SPEC.md` states the narrow exception to the "MCP cannot widen a grant" rule, including
381
+ what the tool cannot do. `docs/worker-permissions.md`, `docs/auth-contract.md`,
382
+ `docs/runtime-compatibility.md` and `README.md` are updated to match, and the
383
+ same-local-user threat-model limitation is stated rather than glossed over.
384
+ - `tests/permissions.test.js` covers the bridge against the installed native
385
+ `ApprovalService`: locating the real call, the `ask`/`never` stance split, allow-once
386
+ resuming one call exactly once and the next escalation asking again, reject, expiry,
387
+ fingerprint substitution, redaction, cancellation, disposal, foreign requests, the
388
+ engine's phase/slot behaviour, cross-owner and post-terminal refusals, restart, and the
389
+ plane route's validation and switch gate.
390
+
391
+ ### Repair round: independent review R1–R9
392
+
393
+ The provisional review found that several claims were not backed by behaviour. Each is now
394
+ a checked fact with a regression test:
395
+
396
+ - **R1 (live re-verification).** A decision no longer trusts the copy captured at ask time.
397
+ An `allow-once` re-reads the `tool/call` at its recorded Session offset and requires
398
+ byte-identical arguments, the same `callId`, the same tool name, and a turn that is still
399
+ OPEN. A mutated record, a missing record and a closed turn are all
400
+ `PERMISSION_REQUEST_CHANGED`. (The turn check had to scan from the END of the log — a scan
401
+ starting at the call would stop at the `turn/start` behind it and never see a later close.)
402
+ - **R2 (key-aware redaction).** A key whose NAME holds a credential has its whole value
403
+ masked, so `{"apiKey":"…"}` can no longer be published verbatim; the module's default
404
+ redaction now also mirrors the production `NAME=value` / bearer patterns so a bridge built
405
+ without injection is not weaker. Applied to the pending view, the decision reason and the
406
+ stored trail.
407
+ - **R3 (completeness gates an allow).** Every bound that fires is counted, and the request
408
+ publishes `completeness` / `argumentsComplete` / `boundsApplied` / `omitted` /
409
+ `allowBlocked`. An `allow-once` on a shortened operation (a `bash.command` whose tail was
410
+ cut) is refused with `PERMISSION_EVIDENCE_INCOMPLETE`; `reject` stays available because
411
+ refusing is always safe.
412
+ - **R4 (exact Agent identity).** `owns()` now requires the exact bound live Agent object and
413
+ rejects a request with no Agent at all — the previous `agent ?? null` check made a missing
414
+ agent match every bridge.
415
+ - **R5 (honest wording).** "The worker cannot self-approve" is restated as a **tool-surface
416
+ restriction**, explicitly NOT a hard boundary against arbitrary same-OS-user code; the
417
+ shared `local-mcp` identity and the absence of a user-managed token are stated, and no
418
+ claim rests on a caller-supplied role label.
419
+ - **R6 (the execution deadline really pauses).** The single `setTimeout` is replaced by
420
+ `ExecutionDeadline`: a wait clears the timer and charges the elapsed span, resume re-arms
421
+ only what is left, and repeated waits accumulate. A regression drives a REAL native
422
+ approval wait of 220 ms inside a run whose budget is 40 ms and proves the run is not
423
+ reported `timed_out`.
424
+ - **R7 (durable evidence).** `HistoryStore.projectView` now stores a bounded, re-redacted
425
+ `permission` block. A restart rewrites a stored pending request as
426
+ `unavailable` / `decidedBy: "restart"` history; the private fingerprint and exact argument
427
+ text are never stored, so a record cannot be replayed into an allow.
428
+ - **R8 (waterfall ordering).** The bridge registers its `approval/request` listener with
429
+ `prepend: true`, because the native seam is a cordis waterfall and an appended listener
430
+ never runs once a pre-existing UI answerer claims the question. Proven against a real
431
+ `ApprovalService` with a pre-existing answerer: the delegated request reaches the
432
+ commander, the UI answerer is never consulted, and an ordinary session still falls through
433
+ to its own answerer.
434
+ - **R9 (proto-safe hashing).** The fingerprint is computed over a hand-written canonical
435
+ serializer instead of a `JSON.stringify` replacer, so a key named `__proto__` is no longer
436
+ swallowed by the prototype setter and two different JSON objects cannot collide.
437
+ - **Fingerprint is mandatory for `allow-once`** (optional for `reject`), and decisions are
438
+ validated before any request lookup or mutation.
439
+ - Also proven behaviourally, not by constants: switching delegation OFF settles the wait as
440
+ `cancelled`, a plugin dispose settles it as `unavailable`, and a task whose native executor
441
+ has not settled keeps its workspace lock and concurrency slot (`JOB_NATIVE_NOT_STOPPED`).
442
+
443
+ `tests/permissions.test.js` grew from 25 to 51 tests covering all of the above.
444
+
445
+ ### Release packaging in this build
446
+
447
+ - Version `0.1.14` is set consistently in `package.json`, both `package-lock.json` root
448
+ fields, the native `PLUGIN_VERSION`, the MCP `SERVER_INFO`, the managed Codex companion's
449
+ `version` marker and the release-test constants.
450
+ - The managed Codex companion now carries the commander's **per-call decision rules**:
451
+ a task in phase `awaiting-permission` is still running (never duplicate, fail or cancel it
452
+ for waiting), the coordinating Codex is the decider (no second approval model, no operator
453
+ prompt for routine within-task calls, no delegation of the decision to the worker), the
454
+ worker's `reason` is a claim rather than authority, and an allow requires
455
+ `argumentsComplete: true`, `completeness: complete`, no `allowBlocked`, no transport
456
+ truncation, a still-pending request and its exact fingerprint. Its existing activation,
457
+ explicit-continuation, route-from-DSH and source-path rules are unchanged.
458
+ - The published `0.1.13` companion template is now enumerated in `KNOWN_AGENT_TEMPLATES`
459
+ by its exact SHA-256 (`b3a1d2f0…`, 9191 bytes, CRLF, verified against the packed
460
+ `dsh-delegate-0.1.13.tgz`). An unchanged `0.1.13` file is refreshed; a file the operator
461
+ edited still hashes differently and is preserved and reported `modified`. There is no
462
+ implicit new installation and no startup edit of `config.toml` or the MCP entry.
463
+ - Two small corrections: a fully restored pending operation no longer reports a phantom
464
+ `truncation.fields` entry at the skeleton projection stage (only real final cuts are
465
+ reported, and a genuinely cut operation still cannot be allowed), the zero-keep stage
466
+ really drops the settled evidence it declares dropped, and a successful task checkpoint is
467
+ no longer discarded by a *different* task's newer checkpoint.
468
+
469
+ ### Known unfinished work (not claimed as solved in this build)
470
+
471
+ - **No process authentication against arbitrary same-user code.** Switch mode
472
+ deliberately uses one shared `local-mcp` identity; the decision is scoped to that
473
+ connection's OWN tasks, but this is not a per-process boundary and the docs say so.
474
+ `delegate_permission_decide` is absent from the native worker's declared tool catalog,
475
+ which is a **tool-surface restriction** on what the worker's model is handed — it is not
476
+ a claim that a shell process running as the same OS user could not call the shared local
477
+ MCP endpoint directly.
478
+ - **Not published and not installed.** This is a candidate package: no npm publication, no
479
+ Desktop profile upgrade, no switch change, no production acceptance run. See the status
480
+ section above for the exact steps still required.
481
+ - 12 test failures in `tests/continuation-auth.test.js` (11) and
482
+ `tests/controller-lifecycle.test.js` (1) are **pre-existing** in the source baseline
483
+ (`ff`-identical failure sets before and after this batch) and are unrelated to it.
484
+
485
+ ## 0.1.13 — local build (not a public release)
486
+
487
+ A source-path contract fix. It is packed locally for review; it is not published to npm
488
+ and is not a distribution release. Nothing about the execution engine changed.
489
+
490
+ ### The MCP description no longer invites the wrong `workspacePath` on a follow-up
491
+
492
+ Observed on a real Desktop `0.2.2` / Delegate `0.1.12` session: a caller read the tool
493
+ description, passed the **previous task's execution worktree** as `workspacePath`, and
494
+ was refused with `JOB_CONTINUATION_REFUSED` (`another source repository`). The engine was
495
+ already correct — an authorization and a continuation are both bound to the source
496
+ repository, and a continuation reuses the parent's worktree internally — so the defect
497
+ was purely in what the tool surface told the caller. Passing the original source
498
+ repository instead continued the same session successfully on the same machine.
499
+
500
+ - `delegate_submit`'s description, the `workspacePath` and `continueFromTaskId` parameter
501
+ descriptions, and the `initialize` instructions now state one rule: `workspacePath` is
502
+ the operator-authorized **source repository or checkout**, and a follow-up keeps
503
+ passing the parent's **original** source path while the plugin reuses the parent's
504
+ execution worktree or session internally.
505
+ - The rule is scoped to `delegate_submit` and continuation. It does not claim every tool
506
+ is bound to the authorization (`delegate_preflight` is a read-only inspection), and it
507
+ does **not** exclude legitimate sources: a source root may itself be a Git checkout or
508
+ an operator-authorized Git worktree. Only substituting an internal
509
+ `execution.workspacePath` for the parent's original source path is refused.
510
+ - The wording is a clarification only. No parameter, tool or behaviour was added; the
511
+ five-tool closed set, the closed input schemas and every path / ownership / isolation
512
+ check in the engine are unchanged, and no validation was relaxed.
513
+ - `tests/mcp.test.js` gains a public-contract regression that reads the real `initialize`
514
+ and `tools/list` responses off a real server — not a private constant — and asserts the
515
+ source-path rule for both parameters plus the handshake, the automatic internal reuse,
516
+ the fail-closed refusal (never a silent new conversation), the unchanged tool set and
517
+ the closed schema. It asserts properties rather than exact sentences.
518
+
519
+ ### Codex agent-template migration
520
+
521
+ - The published `0.1.12` template is now enumerated in `KNOWN_AGENT_TEMPLATES`
522
+ (`ff04a4bf…`). The digest was verified byte for byte, before this release's template
523
+ edit, against `package/codex/dsh-delegate.toml` inside the packed
524
+ `dsh-delegate-0.1.12.tgz` and against the saved release baseline; both were identical
525
+ to the pre-fix working tree. An unchanged `0.1.12` file is refreshed to `0.1.13` on
526
+ plugin startup and by an explicit install.
527
+ - **No earlier digest was removed or replaced.** The `0.1.6`, both `0.1.7` builds,
528
+ `0.1.8`, `0.1.9`, both `0.1.10` byte forms and `0.1.11` remain enumerated, so a machine
529
+ that skipped `0.1.12` is migrated directly to this build.
530
+ - Ownership is still byte identity, never the version line: a user-edited agent file is
531
+ reported `modified` and is never written, refreshed or removed, by startup migration or
532
+ by an explicit install. The `0.1.11` migration coverage is retained and generalized, and
533
+ the `0.1.12` → `0.1.13` step is covered for startup refresh, explicit status/install,
534
+ and edit preservation.
535
+ - Because the companion body did not change in this release, the older release bytes are
536
+ rebuilt for the tests from the current template by rewriting only the version line, and
537
+ against an explicitly stated CRLF byte form; each reconstruction is proved against a
538
+ fixed published digest. The tests depend on no saved cache, fixture or machine-specific
539
+ path.
540
+
541
+ ### Packaging and metadata
542
+
543
+ - Version bumped to `0.1.13` in `package.json`, both `package-lock.json` root fields,
544
+ `PLUGIN_VERSION`, the MCP `SERVER_INFO` and the shipped Codex agent template
545
+ (`codex/dsh-delegate.toml`). `README.md` and `docs/codex-integration.md` name the
546
+ current package and release; historical release facts are unchanged.
547
+ - No dependency was installed or upgraded, no locked `resolved` version moved, the
548
+ production dependency graph and `pnpm-lock.yaml` are unchanged, and no agent body rule
549
+ was edited.
550
+
551
+ ### Known unfinished work (not claimed as solved)
552
+
553
+ - **Not verified:** `0.1.13` has not been installed or accepted on a Desktop profile. The
554
+ successful three-round real-machine continuation evidence belongs to **`0.1.12`**, the
555
+ previous build, and is the reason this fix exists — it is not an acceptance of this
556
+ build.
557
+ - The delegation switch being `OFF` and cancellation of an in-flight task were **not**
558
+ exercised against this build; their coverage here remains the earlier automated tests.
559
+ - Real attached review (a review agent reading a live run) was not exercised in this
560
+ build.
561
+ - The wording is regression-tested as a property of the advertised strings, not against a
562
+ live model's interpretation; only a real host session can show how a caller reads it.
563
+
564
+ ## 0.1.12 — local build (not a public release)
565
+
566
+ A runtime-compatibility build for DSH `0.2.2-rc.1`. It is packed locally for review;
567
+ it is not published to npm and is not a distribution release.
568
+
569
+ ### DSH 0.2.2-rc.1 is now an admitted runtime
570
+
571
+ - `engines.dsh` and every `@deepseek-ai/dsh-*` peer range now read
572
+ `0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.2-rc.1`.
573
+ - **Nothing was dropped.** Every previously declared exact version is still admitted;
574
+ the development cohort (`devDependencies`, all `0.2.0-rc.2`) is unchanged, the
575
+ production dependency graph is unchanged, and no locked `resolved` version moved.
576
+ No `pnpm install` was run.
577
+ - A plugin build that does not declare `0.2.2-rc.1` (`0.1.11` and earlier) is skipped by
578
+ that host's native gate (`skippedBundles` / denied row) rather than loaded with
579
+ unknown behaviour.
580
+
581
+ ### What 0.2.2 changed, and how the plugin adapts
582
+
583
+ Detailed in the new `docs/runtime-compatibility.md`; the runtime implementation is
584
+ reviewed separately from this release-metadata work.
585
+
586
+ - **Durable model selection.** `0.2.2` gives each agent
587
+ `agent.model.select({ provider, model, reasoningEffort? })`, which appends a durable
588
+ `model/selection` event, and `agent.model.current()`, which returns the recorded
589
+ selection (falling back to the agent's own options). The agent loop fixes a step's
590
+ route from that record and rejects a request that proposes a different one, so the
591
+ route that executes is the one the runtime *records*.
592
+ - **Asynchronous native policy initialization.** `ctx.sandboxPolicy` and
593
+ `ctx.approval` register their Session projections during service initialization. The
594
+ worker contract is unchanged — write, then read back through the native services —
595
+ but the read-back now happens per run, after those services can answer, and a service
596
+ that cannot answer remains the fail-closed `RUN_SANDBOX_POLICY_UNAVAILABLE` raised
597
+ before the prompt.
598
+ - The plugin branches on **observed capabilities**, not on a version string: a modern
599
+ path where the selection API and the initialized services exist, a legacy path
600
+ otherwise. A selection read-back that cannot be obtained is a strict failure before
601
+ the prompt on every path — never a run under an unstated route, and never a claimed
602
+ concrete reasoning effort for a selection that omitted one.
603
+
604
+ ### Codex agent-template migration
605
+
606
+ - The published `0.1.11` agent template is now enumerated in
607
+ `KNOWN_AGENT_TEMPLATES` (`b6ca7c32…`, the digest of the packed
608
+ `dsh-delegate-0.1.11.tgz`). An unchanged `0.1.11` file is refreshed to `0.1.12` on
609
+ plugin startup and by an explicit install; a user-edited file is still reported
610
+ `modified` and is never written, refreshed or removed.
611
+ - **`0.1.10` now carries two exact digests instead of one.** The packed
612
+ `dsh-delegate-0.1.10.tgz` contains a CRLF `package/codex/dsh-delegate.toml`
613
+ (`fc7b2710…`); the same template kept as LF text is `6583f08a…`. Either form can be an
614
+ installed file, so both are enumerated and neither replaces the other. The product
615
+ compares exact bytes: it never normalizes line endings and never rewrites a file to
616
+ change them, and no earlier hash was removed.
617
+ - `0.1.11` was delivered as an uncommitted candidate plus a verified tarball (the last
618
+ commit, `a750c0b`, is `0.1.10`), so its digest `b6ca7c32…` is cited from the tarball and
619
+ the saved baseline, not from a `0.1.11` commit.
620
+ - Ownership protection is unchanged and is not weakened: content identity, not the
621
+ version line, remains the proof, and every earlier digest is still enumerated.
622
+
623
+ ### Packaging and metadata
624
+
625
+ - Version bumped to `0.1.12` in `package.json`, both `package-lock.json` root fields,
626
+ `PLUGIN_VERSION`, the MCP `SERVER_INFO`, and the shipped Codex agent template
627
+ (`codex/dsh-delegate.toml`).
628
+ - `docs/runtime-compatibility.md` is added to the published `files` allowlist. Unlike
629
+ the internal notes, it is an operator-facing document: it is the supported-version
630
+ table and the upgrade guidance a consumer needs.
631
+
632
+ ### Documentation
633
+
634
+ - New `docs/runtime-compatibility.md`: the supported-version table, what `0.2.2`
635
+ introduces, the capability-based modern/legacy split, the upgrade path, and an
636
+ explicit list of what is *not* claimed.
637
+ - `README.md`: the supported-version row, the version-gate note, the `0.2.2` behaviour
638
+ summary and the honest limits section.
639
+ - `docs/codex-integration.md`: the digest table for `0.1.10` (both byte forms) and
640
+ `0.1.11`, and the statement that the product does not normalize line endings.
641
+ - `docs/worker-permissions.md`: the `0.2.2` asynchronous initialization note, and the
642
+ corrected scope of the review exclusion (only the sandbox policy is worker-only; the
643
+ reviewer uses the same model-selection adapter).
644
+
645
+ ### Known unfinished work (not released as solved)
646
+
647
+ - **Not verified:** a real provider call, an actual sandbox command under the installed
648
+ policy, and an end-to-end run on the production DSH Desktop profile. The native checks
649
+ below intercepted prompt delivery inside a disposable fixture.
650
+ - `0.2.1-rc.3` was **not** independently native-boot validated for this release. It stays
651
+ declared as supported on the strength of the previous host build.
652
+ - The OS temporary area remains a native platform exception; on Windows the native
653
+ sandbox admits `GetTempPathW` in some configurations, which is not a permission this
654
+ plugin grants.
655
+ - Node child-process checks that capture piped stdio hit `EPERM` in this repository's
656
+ confined Windows sandbox; that is a boundary of that confinement.
657
+ - A verification run outside the Desktop process is not evidence about the Desktop
658
+ process's own sandbox.
659
+
660
+ ### Native verification on 0.2.2-rc.1 (contract checks, not an acceptance run)
661
+
662
+ - The full base + web + delegate profile loads with no skipped bundles; a real stdio MCP
663
+ `initialize` returns `0.1.12` with five tools and discovers the endpoint;
664
+ `delegate_status` works and an `OFF` submit is refused with `DELEGATION_DISABLED`.
665
+ - Real native Workspace/Session controllers, Agent and AgentModel were used. The runner
666
+ selected and read back its route and effort before prompt delivery, a follow-up reused
667
+ the native session and changed both, and a deliberately wrong readback was refused
668
+ before the prompt. The native create/setup runner path also passed.
669
+ - The policy read back `workspace-write` / `never`, and an escalation inside a valid turn
670
+ was rejected in under 1 ms.
671
+ - The `SessionSeq` / `surfaceOp` failures seen in intermediate runs were **coordinator
672
+ test-driver mistakes** — the synthetic event driver omitted native event sequence and
673
+ surface metadata. They were fixed in the driver with no product code change and are not
674
+ open product bugs.
675
+
676
+ ## 0.1.11 — local build (not a public release)
677
+
678
+ A permission and continuity build. It is packed locally for review; it is not
679
+ published to npm and is not a distribution release.
680
+
681
+ ### Delegated worker sessions are confined and verified
682
+
683
+ - A worker run now installs `sandbox/mode: workspace-write` and
684
+ `approval/policy: never` on its own DSH session **before** the prompt is
685
+ delivered, and then **reads the policy back** through the native
686
+ `ctx.sandboxPolicy.resolve({ session })` and
687
+ `ctx.approval.effectivePolicy(session)` services.
688
+ - The policy is applied on every run, including a `continueFromTaskId` follow-up, so
689
+ a resumed thread converges on the current contract.
690
+ - A missing service, a refused read, or a read-back that disagrees with what was
691
+ written is a fail-closed refusal (`RUN_SANDBOX_POLICY_UNAVAILABLE`) raised before
692
+ the prompt: the worker does not start, and no permissive default is substituted.
693
+ - `never` is deterministic rejection of an escalation, not automatic approval.
694
+ - The read-only review agent is unchanged: its own composition and tool surface are
695
+ not affected by worker permissions.
696
+
697
+ ### Path identity
698
+
699
+ - The sandbox module compares a session's workspace root with its own directory
700
+ through the shared `sameSessionPath` identity instead of a private copy, so
701
+ Windows separators, trailing slashes, root paths and letter case are judged in one
702
+ place. The fail-closed checks and the policy read-back are unchanged.
703
+
704
+ ### Worktrees stay in the plugin data directory
705
+
706
+ - Plugin-managed worktrees continue to live under
707
+ `<dataDir>/worktrees`, inside the plugin's persistent data directory, so a review
708
+ still finds the evidence and a follow-up still finds its parent tree. No real
709
+ directory or ACL was changed by this release.
710
+
711
+ ### Packaging and metadata
712
+
713
+ - Version bumped to `0.1.11` in `package.json`, both `package-lock.json` root fields,
714
+ `PLUGIN_VERSION`, the MCP `SERVER_INFO`, and the shipped Codex agent template
715
+ (`codex/dsh-delegate.toml`).
716
+ - The endpoint-discovery error no longer hard-codes a release version in its text.
717
+ - The native packages the tests load directly are now declared as devDependencies:
718
+ `@deepseek-ai/dsh-sandbox-policy`, `@deepseek-ai/dsh-user-approval`,
719
+ `@deepseek-ai/dsh-session-projection`, `@deepseek-ai/dsh-session` (all
720
+ `0.2.0-rc.2`, matching the existing development cohort) and
721
+ `@deepseek-ai/cordis` (`4.0.5`, as already locked). Both lockfiles were updated in
722
+ place from entries that already existed; no dependency was upgraded.
723
+ - The Codex agent-template migration table still lists every earlier published hash
724
+ and still refuses to touch a user-modified file.
725
+
726
+ ### Continuations belong to one verified connection
727
+
728
+ - A `continueFromTaskId` follow-up may join a thread only when the **same verified
729
+ `connectionId`** submits it. The caller's identity is the authenticated connection
730
+ record, never a field the request states about itself.
731
+ - In the same process the live parent record states the owner and the outcome, and the
732
+ two ids are compared exactly.
733
+ - After a restart the persisted task→session map only says where a thread lives, so a
734
+ second authority is consulted: the durable job history (`HistoryStore`) must state
735
+ the same owner, a terminal state a thread can be continued from, and the same
736
+ source repository and execution directory.
737
+ - A missing, damaged, pruned or otherwise unprovable record is refused. So is another
738
+ connection's task: it is reported as `JOB_TASK_NOT_FOUND`, indistinguishable from an
739
+ unknown id, so the response cannot be used to probe other connections' task ids.
740
+ There is no cross-connection take-over, no permission hand-off, and no matching by
741
+ connection label.
742
+ - `local-mcp` (the local-switch path) is a fixed identity compared exactly like any
743
+ other; it is not `null` and it does not stand for every remote connection.
744
+ - This capability is implemented in the current candidate build. Its acceptance is
745
+ reported separately by Codex; this changelog does not claim a passing real install
746
+ on DSH Desktop, nor a reproduced real attack.
747
+
748
+ ### Documentation
749
+
750
+ - `README.md`: current package filename, a short summary of the worker permission
751
+ contract, the continuation identity rule, and the stale test count removed.
752
+ - `docs/worker-permissions.md`: the full contract, the continuation ownership rule,
753
+ what was verified, and what is still open.
754
+
755
+ ### Known unfinished work (not released as solved)
756
+
757
+ - Real-install acceptance on DSH Desktop.
758
+ - The OS temporary area remains a native platform exception.
759
+ - Node child-process checks that capture piped stdio currently hit `EPERM` in this
760
+ repository's confined Windows sandbox; that is a boundary of that confinement, not
761
+ a failure of the approval fix.
762
+ - A verification run outside the Desktop process is not evidence about the Desktop
763
+ process's own sandbox.