Commit Graph

287 Commits

Author SHA1 Message Date
Tianyi Cui
d404609e19 docs(subprocess): bring the zh side of the consumer-migration pairs along
The parent branch's zh translations were recorded against its pre-reshape
en text; this PR's Node-ward en deltas get minimal zh updates across the
subprocess catalog and the subprocess/lsp-local/subagent READMEs (all
type-equiv blocks byte-identical), with pairing records re-recorded.
2026-07-26 22:54:44 +08:00
Tianyi Cui
1b9d66eaac Merge branch 'worktree-process-service-seam' into worktree-subprocess-consumers
# Conflicts:
#	docs/core-data-structures/subprocess.md
#	packages/subagent/subagent-subprocess/README.md
#	packages/subprocess/README.md
#	packages/subprocess/subprocess-local/README.md
#	scripts/translation-pairing.manifest.json
2026-07-26 22:04:14 +08:00
Tianyi Cui
202582d600 Merge branch 'worktree-tasks-service-seam' into worktree-process-service-seam
# Conflicts:
#	packages/bash/bash-local/README.md
#	scripts/doc-budgets.manifest.json
#	scripts/type-equiv.manifest.json
2026-07-26 20:55:58 +08:00
Tianyi Cui
c3394d3012 Merge remote-tracking branch 'origin/master' into worktree-tasks-service-seam
# Conflicts:
#	packages/tasks/README.md
#	packages/tasks/tasks/README.md
#	scripts/translation-pairing.manifest.json
2026-07-26 20:28:37 +08:00
Tianyi Cui
79a28ad6d9 fix(subprocess): tree-scoped escalation and byte-exact tails (Codex round 1)
(A1) terminate()/dispose()/service teardown keyed on direct-child settlement
could leak a TERM-trapping descendant that outlived the leader (Codex
reproduced it with a disowned trap-SIGTERM helper). kill()/terminate() now
gate on tree liveness instead of outcome settlement; the SIGKILL escalation
timer survives settle (unref'd, re-probing the tree); dispose's tier
quiescence is whole-tree exit via a bounded waitForExit; the service's live
set releases handles only when their tree is gone, and its teardown awaits
tree exit. Three new suites pin the survivor scenarios end to end
(terminate, dispose, service teardown).

(A2) the escalation branch is now real tested behavior — its ignore is gone;
the one remaining signalTree guard ignore states why it is unreachable
through the handle verbs.

(A3) docs contradictions fixed: the impl README's stale POSIX-only bullet
now states the contained best-effort Windows tree story; the lsp-local
README no longer claims taskkill failures stay visible (containment + the
tree-liveness wait is the actual contract); the architecture tables (en+zh)
list all three consumer families.

(B1) OutputCollector keeps a byte-exact tail across uneven chunk boundaries
(trim the head chunk instead of dropping it whole) — the LSP diagnostic-tail
contract; pinned by a cross-chunk test.

(B2) the subagent-acp coverage ignore is narrowed to exactly the
never-settling success arm.
2026-07-26 16:50:36 +08:00
Tianyi Cui
3672cd25b4 feat(subprocess): migrate lsp-local, subagent-acp, and the env scrubs onto the seam
Review direction (tianyicui, PR #660): in a stacked PR, change all other
process-running places to use the new service.

- lsp-local: LspConnection spawns through ctx.subprocess (piped protocol
  streams + a no-spill collected stderr tail); its private process-tree
  helpers (POSIX group signalling, Windows taskkill, liveness polling) are
  deleted in favor of the seam's handle verbs, and its buildChildEnv now
  rides scrubbedParentEnv (LSP children also stop inheriting stale DSH_*).
  The plugin injects 'subprocess'; compositions/tests mount
  dsh-subprocess-local.
- subagent-acp: the ACP child spawns through the seam (piped ndjson streams,
  inherited stderr); spawn failure surfaces through done-rejection into the
  same startup race; disposal is handle.dispose with the plugin's configured
  graces. dsh-subagent-subprocess is DELETED — its dispose ladder and scrub
  are the seam's, and the isolated-config-dir helper had no consumer.
- mcp-client, pty-local, sdk-helper: adopt scrubbedParentEnv as the one
  scrub definition (their spawns stay put by ownership: the MCP SDK and
  node-pty own those calls; the SDK wizard runs outside any composition).
- Coverage: per-file 100% over every touched src file, with each v8 ignore
  carrying a platform or contract reason; new suites cover stdio
  dispositions, the dispose ladder tiers, injected-win32 tree semantics,
  waitForExit, settled-kill/terminate no-ops, and spawn-failure disposal.
- Docs: consumer-migration Agent Note (en; zh follows in this PR), seam note
  updated in place, subprocess.md rewritten for the reshaped vocabulary
  (type-equiv re-registered), READMEs and SERVICE_ROLES updated, taskkill
  added to knip ignoreBinaries.
2026-07-26 15:27:59 +08:00
Tianyi Cui
fc566119a7 refactor(subprocess): rename the process seam to subprocess and address review
Review feedback (tianyicui): 'process' is a poor service name. The family is
now packages/subprocess/ — @deepseek-ai/dsh-subprocess (ctx.subprocess,
abstract SubprocessService, Subprocess* vocabulary) and
@deepseek-ai/dsh-subprocess-local (LocalSubprocessService) — renamed
throughout code, compositions, docs (en+zh, pairs re-recorded), catalogs,
and gates. 'subprocess' is the precise term for managed OS children (the
Python-stdlib sense), avoids colliding with Node's global process object,
and reads as one system beside dsh-subagent-subprocess.

ds-review-bot findings addressed:
- kill() on a settled handle is now a no-op (no signal to a possibly-reused
  pgid, no referenced grace timer delaying exit); pinned by a spy test.
- The moved DshEnvironmentKey/DshEnvironment/CollectedOutput types get
  drift-checked type-equiv blocks on the new subprocess.md page, restoring
  their manifest registration.
- subprocess.md is registered in the core.md sub-page index (en+zh).
2026-07-26 12:43:59 +08:00
Tianyi Cui
8f75565f03 Merge tasks-seam diagnostics fix into the subprocess branch 2026-07-26 12:21:13 +08:00
Tianyi Cui
1bc090fe00 fix(tasks): producer diagnostics name the seam, not one implementation
Review feedback (tianyicui, PR #657 inline): the missing-service message
should mention dsh-tasks, which defines ctx.tasks, rather than promoting a
specific backend. The seam's own surfaces (README, the direct-mount fence)
keep pointing at implementations, so the pointer chain still lands on
dsh-tasks-local without the producer strings going stale when another
backend becomes the recommended default. Agent Note updated accordingly
(en+zh, re-recorded).
2026-07-26 12:17:45 +08:00
Tianyi Cui
0d6bfd8856 refactor(process): split the process manager out of the bash executor
New process/ capability family: @deepseek-ai/dsh-process owns ctx.processes —
abstract ProcessManager.spawn(spec) over a fully-explicit ProcessSpawnSpec —
plus the shared DSH_* managed-environment and CollectedOutput vocabulary;
@deepseek-ai/dsh-process-local carries the former bash-local run.ts plumbing
(detached groups, tail-keep spill-backed output, credential scrub, kill
escalation, kill-and-join disposal) with no config of its own.

dsh-bash-local becomes a consumer: it keeps command defaulting, the fused
deadline timedOut/aborted classification, the model-friendly terminal env
(now merged through the ordinary env channel), and the [stderr]-marked
background read merge, and spawns through ctx.processes. Background-process
lifetime moves to the manager, so an executor reload no longer kills live
background work; a background spawn failure is injected once into the read
path instead of being buffered as fake stderr. dsh-bash re-exports the moved
vocabulary so bash consumers keep one import root; dsh-bash-sandbox only
redeclares the inherited inject.

Every composition loading a bash executor now loads dsh-process-local (CLI,
examples, python bundled runtime, create-sdk bash feature, inline test
configs).
2026-07-26 06:59:01 +08:00
Tianyi Cui
698b391bd6 refactor(tasks): split the task registry into seam and local implementation
The tasks/ family now matches the capability-seam shape: @deepseek-ai/dsh-tasks
keeps the abstract TaskService (ctx.tasks contract, vocabulary types, snapshot
invariant companion) and the new @deepseek-ai/dsh-tasks-local carries the
process-local registry (LocalTaskService: in-memory store, settlement,
owner-cleanup effects, teardown, TASK_WAIT_TIMEOUT). Compositions and test
harnesses now load dsh-tasks-local; producers, TaskKindMap merges, and
dsh-tool-tasks keep importing the seam only.

Producer misconfiguration diagnostics name dsh-tasks-local because loading the
implementation is the fix. The registry behavior suite moves to tasks-local;
the seam keeps a stub-subclass registration test and the probe-based invariant
suite.
2026-07-26 05:13:39 +08:00
Tianyi Cui
226dc7a249 docs: translate remaining READMEs 2026-07-26 05:06:39 +08:00
Tianyi Cui
d3b5988061 docs(subagent): restore refusal contract comment 2026-07-25 15:25:52 +08:00
Turtle
222bebbbbe Clarify ACP workspace resolution 2026-07-25 14:50:22 +08:00
Turtle
2e84a1a194 Merge remote-tracking branch 'origin/master' into codex/trim-redundant-comments
# Conflicts:
#	docs/config-catalog.md
#	examples/acp-agent/tests/acp.e2e.ts
#	packages/ui/acp/src/index.ts
#	packages/ui/acp/tests/bridge.spec.ts
#	packages/ui/acp/tests/config-options.spec.ts
#	packages/ui/acp/tests/dispose.spec.ts
#	packages/ui/acp/tests/properties.spec.ts
2026-07-25 13:36:21 +08:00
Turtle
12fe458e35 Address comment cleanup review 2026-07-25 13:31:51 +08:00
Turtle
fac6c35e9a Trim redundant source comments 2026-07-25 13:02:37 +08:00
Tianyi Cui
440384fdb4 Merge remote-tracking branch 'origin/master' into worktree/acp-automation-protocol
# Conflicts:
#	.agents/notes/implemented/architecture/2026-06-14-session-persistence.md
#	.agents/notes/implemented/architecture/2026-06-20-package-hierarchy.md
#	.agents/notes/implemented/architecture/2026-07-02-tool-render-intent-union.md
#	.agents/notes/implemented/feature/2026-06-14-acp-agent-client-protocol.md
#	.agents/notes/implemented/feature/2026-06-14-acp-multi-session.md
#	.agents/notes/implemented/feature/2026-06-18-acp-terminal-and-tool-rendering.md
#	.agents/notes/implemented/feature/2026-07-19-model-facing-goal-tools.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-19-model-facing-goal-tools.md
#	.agents/notes/implemented/feature/2026-07-19-model-facing-goal-tools.zh.md
#	.agents/notes/implemented/simplification/2026-07-04-trim-acp-bridge-unreachable-surface.md
#	docs/architecture.i18n.yaml
#	docs/cookbook/extension-cookbook.i18n.yaml
#	docs/cookbook/extension-cookbook.md
#	docs/cookbook/extension-cookbook.zh.md
#	docs/core-data-structures/approval.md
#	docs/core-data-structures/user-interaction.md
#	docs/event-producer-consumer.md
#	docs/persistence-catalog.md
#	docs/testing.md
#	docs/tool-catalog.md
#	examples/acp-agent/tests/fixtures/live-mode-switching-2026-07-07.session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
#	examples/acp-agent/tests/snapshots/permission-switching/session.jsonl
#	packages/goal/tool-goal/README.md
#	packages/ui/acp/README.md
#	packages/ui/acp/acp-feature-support.md
#	packages/ui/acp/src/index.ts
#	packages/ui/acp/tests/bridge.spec.ts
#	packages/ui/acp/tests/dispose.spec.ts
#	packages/ui/acp/tests/edges.spec.ts
#	packages/ui/acp/tests/turns.spec.ts
2026-07-24 23:43:10 +08:00
Turtle
b02b438667 refactor(agent): align delivery method names 2026-07-24 15:08:36 +08:00
Tianyi Cui
e819a586b0 refactor(acp): reduce bridge to automation protocol 2026-07-24 01:40:25 +08:00
Turtle
a3ad5241ba Merge remote-tracking branch 'origin/master' into feat/send-unify
# Conflicts:
#	docs/persistence-catalog.md
#	examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
#	packages/context/time-context/tests/time-context.spec.ts
#	packages/cordis/tool-cordis/src/api-catalog.ts
2026-07-23 20:54:48 +08:00
Turtle
44fd93fd06 feat(agent): unify send(target × wakeup), coalesce context/message into user/message
Replace send/steer/inject with one Agent.send primitive over the
(target × wakeup) matrix; followup/steer/inject become fixed-preset
alias methods on the now-abstract Agent class. Coalesce context/message
into user/message (injected context is a non-user source). Replace
agent/queued with agent/inbox/enqueue/dequeue/discard, add cancel
keepInbox, and add a FIFO-conservation invariant.
2026-07-23 19:15:45 +08:00
Tianyi Cui
248d7bb81e Merge branch 'codex/canonical-tool-output' into codex/code-mode-typed-results 2026-07-22 17:07:49 +08:00
Tianyi Cui
4cd5f21c08 Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output 2026-07-22 17:05:38 +08:00
Tianyi Cui
c3fb3de64f Merge PR #500 into codex/tool-json-schema-dsl
# Conflicts:
#	docs/cordis-catalog/services.md
#	scripts/type-equiv.manifest.json
2026-07-22 16:57:45 +08:00
Tianyi Cui
4643e0de10 test(windows): make coverage fixtures portable 2026-07-22 13:10:48 +08:00
Tianyi Cui
ec8e3065ce Merge branch 'codex/canonical-tool-output' into codex/code-mode-typed-results
# Conflicts:
#	examples/acp-agent/tests/snapshots/both-mode-turn/session.jsonl
#	examples/acp-agent/tests/snapshots/code-mode-turn/session.jsonl
#	examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
2026-07-22 00:29:00 +08:00
Tianyi Cui
0dfd9545a6 Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output
# Conflicts:
#	docs/architecture.md
#	docs/config-catalog.md
#	docs/persistence-catalog.md
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	examples/acp-agent/tests/snapshots/fs-escalation-approved/session.jsonl
#	examples/acp-agent/tests/snapshots/fs-write/session.jsonl
#	packages/ui/tui/src/index.ts
#	scripts/type-equiv.manifest.json
2026-07-22 00:23:00 +08:00
Tianyi Cui
4072673c03 Merge remote-tracking branch 'origin/master' into codex/tool-json-schema-dsl
# Conflicts:
#	packages/cordis/tool-cordis/src/api-catalog.ts
2026-07-22 00:05:23 +08:00
Tianyi Cui
9753efcd48 Merge branch 'codex/canonical-tool-output' into codex/code-mode-typed-results
# Conflicts:
#	docs/config-catalog.md
#	docs/cookbook/adding-a-tool.i18n.yaml
#	docs/cookbook/adding-a-tool.md
#	docs/cookbook/adding-a-tool.zh.md
#	docs/cordis-catalog/events.md
#	docs/cordis-catalog/services.md
#	docs/event-producer-consumer.md
#	packages/core/tools/tests/code-mode.spec.ts
2026-07-21 23:51:20 +08:00
Tianyi Cui
53615c91e7 Merge master into worktree-windows-runtime 2026-07-21 23:39:14 +08:00
Tianyi Cui
7d3cb39047 Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output
# Conflicts:
#	.agents/notes/implemented/feature/2026-06-30-interception-seams.md
#	docs/config-catalog.md
#	docs/cookbook/adding-a-tool.i18n.yaml
#	docs/cookbook/adding-a-tool.md
#	docs/cookbook/adding-a-tool.zh.md
#	docs/cordis-catalog/events.md
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/tools.md
#	docs/event-producer-consumer.md
#	docs/persistence-catalog.md
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
#	packages/bash/tool-bash/src/index.ts
#	packages/core/agent-loop/src/tool-calls.ts
#	packages/core/agent-loop/tests/cancel.spec.ts
#	packages/core/agent-loop/tests/contract-regressions.spec.ts
#	packages/core/agent-loop/tests/tool-calls.spec.ts
#	packages/core/tools/README.md
#	packages/core/tools/src/index.ts
#	packages/core/tools/tests/code-mode.spec.ts
#	packages/core/tools/tests/tools.spec.ts
#	packages/fs/tool-fs-search/tests/integration.spec.ts
#	packages/fs/tool-fs-search/tests/tools.spec.ts
#	packages/fs/tool-fs/tests/integration.spec.ts
#	packages/mcp/mcp-client/src/tools.ts
#	packages/timeout/timeout-policy/tests/timeout-policy.spec.ts
#	packages/web/tool-web/tests/integration.spec.ts
#	packages/web/tool-web/tests/tool-web.spec.ts
2026-07-21 23:39:03 +08:00
Tianyi Cui
5d514ccdb2 Merge remote-tracking branch 'origin/master' into codex/tool-json-schema-dsl
# Conflicts:
#	docs/config-catalog.md
#	docs/cookbook/adding-a-tool.i18n.yaml
#	docs/cordis-catalog/events.md
#	docs/cordis-catalog/services.md
#	docs/event-producer-consumer.md
#	packages/core/tools/tests/tools.spec.ts
2026-07-21 23:04:32 +08:00
Tianyi Cui
3176d232b8 Merge master into codex/session-title 2026-07-21 22:59:41 +08:00
Tianyi Cui
3a895ce815 Merge master into codex/session-title 2026-07-21 21:11:32 +08:00
Tianyi Cui
eed5ff4dcf Merge branch 'codex/canonical-tool-output' into codex/code-mode-typed-results
# Conflicts:
#	docs/event-producer-consumer.md
#	docs/module-graph.md
#	packages/code-runtime/code-runtime-worker/package.json
#	packages/spill/spill-policy/package.json
#	pnpm-lock.yaml
2026-07-21 20:06:02 +08:00
Tianyi Cui
0004b8675f Merge remote-tracking branch 'origin/master' into codex/enforce-tool-cancellation
# Conflicts:
#	docs/event-producer-consumer.md
#	examples/acp-agent/tests/snapshots/bash-spill/session.jsonl
#	examples/acp-agent/tests/snapshots/escalation-approved/session.jsonl
#	examples/acp-agent/tests/snapshots/escalation-rejected/session.jsonl
#	examples/acp-agent/tests/snapshots/fs-escalation-approved/session.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-pretool-ask/session.jsonl
#	packages/context/workspace-context/tests/workspace-context.spec.ts
#	packages/core/agent/src/index.ts
#	packages/support/invariants/tests/invariants.spec.ts
#	packages/ui/acp/src/index.ts
#	packages/ui/tui/tests/harness.ts
#	packages/ui/tui/tests/tui.spec.ts
2026-07-21 20:03:00 +08:00
Tianyi Cui
72a48fede6 Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output
# Conflicts:
#	docs/event-producer-consumer.md
#	packages/context/time-context/tests/time-context.spec.ts
#	packages/context/workspace-context/tests/workspace-context.spec.ts
2026-07-21 19:56:43 +08:00
Tianyi Cui
6a45e6e16b Merge remote-tracking branch 'origin/master' into codex/tool-json-schema-dsl
# Conflicts:
#	docs/event-producer-consumer.md
#	packages/cordis/tool-cordis/src/api-catalog.ts
2026-07-21 19:44:49 +08:00
Tianyi Cui
650a9cd82c Merge branch 'codex/canonical-tool-output' into codex/code-mode-typed-results
# Conflicts:
#	docs/module-graph.md
2026-07-21 19:16:10 +08:00
Tianyi Cui
0cc5009f58 Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output
# Conflicts:
#	docs/config-catalog.md
#	examples/acp-agent/tests/snapshots/fs-escalation-approved/session.jsonl
2026-07-21 19:15:18 +08:00
Tianyi Cui
7d9ed9f70a Merge remote-tracking branch 'origin/master' into codex/tool-json-schema-dsl 2026-07-21 19:03:15 +08:00
Tianyi Cui
071fe76755 Merge latest master into invariant service seam 2026-07-21 18:27:46 +08:00
Yichen Jiang
c0d7ef22ec fix(subagent-acp): repair the composition fixture for the merged depth budget
Master landed the tool-subagent depth budget while this branch was in
flight: the numeric default maxDepth now fails the mount against the
ACP provider's depthLimit: false, so the composition fixture must state
maxDepth: 'provider-managed' — the documented opt-out for a provider
whose recursion budget lives in the child harness. The fixture also
moves off the retired stdio-demo REPL onto the current app-boot driver
pattern (runLoaderSmoke + one-shot cli), and the split isDirectory
statements gain the file-not-a-directory case the single-expression
form used to cover implicitly.
2026-07-21 17:14:10 +08:00
Yichen Jiang
6fe8cfb5d1 Merge branch 'fix/acp-subagent-cwd' of github.com:deepseek-harness/deepseek-harness into fix/acp-subagent-cwd 2026-07-21 16:53:46 +08:00
Yichen Jiang
822651a2c7 test(subagent-acp): cover inherited cwd through a Loader composition
The inheritance branch ran only under hand-mounted plugin tests, and
the with-key e2e always configures an explicit cwd. Add a test-only
cordis.yml (scripted delegating model + the scripted mock ACP child)
booting the stdio app through the real Loader with cwd omitted: the
child proves it ran in — and was announced — the parent session's
workspace, keylessly.
2026-07-21 16:53:26 +08:00
Yichen Jiang
04117b58bd docs(subagent): align the parent contract with ACP cwd inheritance
SubagentStartRequest.parent, its core-data type-equiv mirror, and the
ACP backend Agent Note still said the out-of-process backend ignores
request.parent — no longer true: with cwd unconfigured it reads exactly
the session header's cwd, and a parent session without one now rejects
at start. State the one-field read at each owning contract, record the
workspace-resolution decision in the Agent Note, and align the README's
accessibility wording with the search-permission guard.
2026-07-21 16:51:49 +08:00
Yichen Jiang
fcbbd22af7 fix(subagent-acp): require search permission on the child cwd
statSync().isDirectory() is true for a mode-600 directory, but a
subprocess cwd needs X_OK — spawn would fail EACCES, deferring a
self-contained configuration error past the load/start boundary the
resolution owns. Probe accessSync(X_OK) alongside the type check so
"not an accessible directory" is literally what the guard verifies.
2026-07-21 16:51:32 +08:00
Tianyi Cui
5d411f9c4e fix(session-title): preserve agent turn outcomes 2026-07-21 15:49:37 +08:00
Tianyi Cui
c1d7b0df81 feat: return typed values from Code Mode 2026-07-21 04:37:09 +08:00