Commit Graph

5245 Commits

Author SHA1 Message Date
_Kerman
344943e097 Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	docs/cordis-catalog/services.md
#	examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
#	packages/core/tools/README.i18n.yaml
#	packages/core/tools/src/code-mode.ts
2026-07-26 22:17:47 +08:00
_Kerman
225552fb32 fix(tui,tool-tasks): finish removing dispose-ness from delivery
The TUI's referenced-prompt snapshot now rides the prompt's own
admission transaction instead of a pre-admission inject: while idle, a
one-shot prepended agent/prompt-submit wrapper appends the snapshot to
the allow decision's additionalContexts, so a blocking hook discards
the prompt and its attached context together instead of stranding the
snapshot in history for the next unrelated prompt. A prompt discarded
before admission releases the wrapper; steering keeps the inject path
since it bypasses admission and drains at the same boundary. The
session-reference snapshot adapter pinned the old context-before-prompt
order; the branch-wide order (prompt first, its contexts after) is now
asserted and the fixture re-recorded.

tool-tasks drops the last consumer of the removed thrown-disposed
contract: completion notices now inject unconditionally, which is
well-defined during owner teardown — the loop treats disposal like any
cancel, so the notice appends as durable idle context (persisted for
resume while the session is attached, dropped with the detached log
after). README pair and the owner-disposal tests state the new
delivery contract.
2026-07-26 22:08:35 +08:00
Tianyi Cui
7c038f275d Merge pull request #673 from deepseek-harness/worktree/preserve-retarget-checkpoints
docs: preserve incremental PR retarget checkpoints
2026-07-26 22:03:30 +08:00
Tianyi Cui
047e48bd8d docs: preserve incremental PR retarget checkpoints 2026-07-26 21:59:03 +08:00
Tianyi Cui
e1d4607952 Merge pull request #650 from deepseek-harness/worktree/fix-clean-symlink-boundary
fix(build): contain clean targets within repository
2026-07-26 21:43:44 +08:00
Tianyi Cui
681af6de5e Merge remote-tracking branch 'origin/master' into worktree/fix-clean-symlink-boundary 2026-07-26 21:34:58 +08:00
Tianyi Cui
4bcb52ea12 Merge remote-tracking branch 'origin/master' into worktree/fix-clean-symlink-boundary
# Conflicts:
#	packages/support/llm-mock-server/tests/server.spec.ts
2026-07-26 21:33:44 +08:00
Tianyi Cui
f60d353a53 Merge pull request #658 from deepseek-harness/code-mode-ui/live-parallel
feat(tools): Code Mode live dispatch lifecycle + native-contract parallel sub-calls
2026-07-26 21:29:03 +08:00
_Kerman
04f0435cc9 refactor(tools): let the terminal marker ride the nested result
The staged-promotion machinery (concludingParents keyed by parent token
plus a pendingParentConclusions staging map) spread one fact — this call
concluded the turn — across three registry-side collections with manual
cleanup. Align it with how additionalContexts already crosses the same
boundary: concludeTurn() marks only its own execution, the marker rides
that execution's successful result (ToolExecutionFailure types
concludesTurn as never, so a policy-converted failure sheds it with the
type), and the composite that owns the nested dispatch forwards it —
Code Mode's binding does so beside its existing context forwarding.

The registry loses both parent-keyed collections and the promotion
block; the propagation decision moves to the owning boundary; the
structured-output consumer's own two-phase commit is untouched.
2026-07-26 21:24:16 +08:00
Tianyi Cui
76d95fdc4b docs: bring the zh README pairs along for the parallel-dispatch contract
master's bilingual README pairing (new since this branch forked) covers
packages/core/tools and packages/client/runtime, whose EN sides this PR
edits. Translate the scheduling-contract sentences (bridge pool, SDK
overlap line, loop cross-reference, codeDispatches lifecycle) into the zh
sides — including the verbatim shared model-facing block — and re-record
both pairing records.
2026-07-26 21:19:46 +08:00
_Kerman
39c09c9a49 Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	docs/core-data-structures/tools.i18n.yaml
#	examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
#	packages/core/tools/README.i18n.yaml
2026-07-26 21:08:54 +08:00
Tianyi Cui
fc38f8c813 Merge branch 'master' into code-mode-ui/live-parallel 2026-07-26 21:04:03 +08:00
Tianyi Cui
d9d55f0062 Merge pull request #653 from deepseek-harness/code-mode-ui/web-ui-v1
feat(web): Code Mode UI — sub-calls as native rows nested under the run_code row
2026-07-26 21:00:18 +08:00
Tianyi Cui
aecc16f2d8 test(web): type the Code Mode fixture group row 2026-07-26 20:53:26 +08:00
Tianyi Cui
8847fb7bd4 Merge branch 'master' into code-mode-ui/web-ui-v1 2026-07-26 20:51:41 +08:00
_Kerman
2a51ef85fb fix: close three seams the message-machine refactor left open
agent-loop lifecycle: dispose drains machine.done to true quiescence.
cancel()'s own running-to-idle transition can legitimately re-enter
through an automation listener (goal-session's idle drive runs
synchronously to its first await) and replace done with a fresh
admission after the single capture; teardown now re-cancels and
re-awaits until the slot stabilizes, so the scope never unwinds under a
live run.

tools: a nested concludeTurn() stages on its own execution and promotes
to the enclosing composite only on the call's authoritative successful
verdict. A post-execute policy that converts the nested success into an
error no longer lets a recovering composite stop the turn on a failed
terminal operation (the Code Mode structured-output shape).

goal-session: the driver owns its round durability barrier again. The
loop's persistence is eager write-behind with no turn-end flush, so the
old post-turn agent/error signal for flush failures never fires; a
settled round now sets needsCheckpoint and re-enters drive, flushing
before the next reservation and disarming on failure instead of queueing
an autonomous round on state that was never persisted.
2026-07-26 20:51:32 +08:00
_Kerman
338da9f2e0 refactor(agent): fold agentInterruptReasonOf into loop-private slot invariants
The public classifier existed to defend an exported reader against
arbitrary signals, but its only production caller is the loop reading
its own machine-private turn signal, where cancel() is the sole aborter
and always writes one frozen canonical cause. Delete the export and its
15-line structural validation: settle() states the slot invariant with
one cast, the boolean call sites ask signal.aborted directly, and the
retry veto drops entirely because a requested window already implies a
live signal (cancel() retires the window before aborting).

The abort(reason) channel and first-wins semantics are unchanged; only
the reader's publicness is gone, and with it the paranoia it required.
2026-07-26 20:51:32 +08:00
Tianyi Cui
733d475799 Merge pull request #648 from deepseek-harness/code-mode-ui/host-foundation
feat(tools): run_code description param + native-parity dispatch logging + web Code Mode seam
2026-07-26 20:40:03 +08:00
Tianyi Cui
fdef6b644a docs: sync Code Mode README translations 2026-07-26 20:31:37 +08:00
Tianyi Cui
a0672e8ab3 Merge branch 'master' into code-mode-ui/host-foundation 2026-07-26 20:07:43 +08:00
_Kerman
2985bc5267 test(goal-session): pin the unsettled-attempt yield with a real failure path
The drive-pass guard for an unsettled attempt was wrongly annotated
unreachable after admission joined the running interval. It is reachable:
a contained turn-close failure (pre-commit turn/end rejection) reaches
idle with the attempt's turn open and no terminal reason, and the idle
drive pass must yield to that attempt instead of misreading the absent
reason as settled. Replace the ignore with a test driving exactly that
path; the guard's comment now names the real producer.
2026-07-26 19:13:47 +08:00
_Kerman
050090e512 chore: regenerate catalogs and settle the goal driver's drive-pass guard
The admission-ordering fix changed the event taxonomy's observable order,
so the generated event/producer catalogs and the cordis API catalog are
regenerated. goal-session's mid-drive yield (an unsettled attempt seen by
an idle-triggered drive pass) became unreachable now that claimed prompt
admission joins the loop's running interval — a drive pass requires idle,
so it can no longer observe an unsettled reservation; the guard stays as
an annotated backstop.
2026-07-26 18:54:17 +08:00
Tianyi Cui
57c5fd5661 docs: regen cordis services catalog (source line shifted by the cap helper) 2026-07-26 18:40:45 +08:00
_Kerman
2bc994900b fix(agent-loop): order admission publication and gate idle on committed turns
Three ordering fixes on the admission and settlement boundaries.

kick() installs the abort owner, marks the interval busy (running is
emitted before any listener can observe the claim), and installs the
pending done BEFORE publishing agent/inbox/dequeue: a dequeue listener
that cancels or disposes now finds live cancellation and quiescence
ownership instead of the previous activity's settled state, and claimed
prompt admission — including asynchronous prompt-submit hooks — sits
inside the running interval where cancel routing can reach it. The
admission-rejected path yields one microtask before continueOrIdle so
the idle transition cannot fire inside send()'s synchronous extent.

agent/idle now names only committed turns: a run that aborts or fails
before its turn/start commits exits without the notification, since
there is no durable turn/end for settlement consumers to act against.
The event's JSDoc states the narrowed contract.
2026-07-26 18:30:26 +08:00
_Kerman
5e8225505c refactor(agent-loop): state slot invariants directly instead of guarding them
The coverage pass left agent.ts with eight v8 ignore annotations — well
above this repo's density elsewhere. Six guarded conditions the
surrounding invariants already exclude; expressing the invariant directly
deletes the dead arm instead of excusing it: admission/run teardown
releases the abort slot unconditionally (no writer can replace the owner
mid-flight), the request-failed branch closes its always-open step
unconditionally, the recovery finally retires the window it installed,
and the driver finally drops its dead last-resort step close (every path
already closes the step). kick()'s dequeue states the non-empty-queue
invariant as a non-null assertion. The two remaining ignores are the
assertNever exhaustiveness guard and the retry()/run() slot-race guard,
both repo-wide conventions.
2026-07-26 17:22:50 +08:00
_Kerman
8117f61396 Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	packages/context/workspace-context/README.md
#	packages/llm/llm-retry/README.md
#	packages/session-persistence/session-checkpoint-policy/README.md
#	scripts/type-equiv.manifest.json
2026-07-26 16:45:27 +08:00
Chinesezjc
3586422b69 Merge pull request #646 from deepseek-harness/fix/intent-draft-sync-echo
fix(web): IME composition corrupts the "Let's start building" composer
2026-07-26 16:16:56 +08:00
Chinesezjc
cdccf69f4b Merge remote-tracking branch 'origin/master' into fix/intent-draft-sync-echo 2026-07-26 16:05:46 +08:00
_Kerman
3d1fe7b45f Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	docs/event-producer-consumer.md
2026-07-26 15:46:29 +08:00
Tianyi Cui
785efe03e3 Merge pull request #651 from deepseek-harness/worktree/i18n-complete-non-readme 2026-07-26 15:38:00 +08:00
Tianyi Cui
7465dfe00f Merge branch 'code-mode-ui/web-ui-v1' into code-mode-ui/live-parallel
Conflict resolution: session.ts keeps this branch's paired-start callTime
(the start event exists here; a settle-only window stays null — the PR2
fix's semantics compose). The README's codeDispatches section is restored
to the running→settled lifecycle this branch implements, keeping PR2's
null-callTime nuance for starts outside the window.
2026-07-26 15:29:33 +08:00
Tianyi Cui
878bf6dc33 Merge branch 'code-mode-ui/host-foundation' into code-mode-ui/web-ui-v1 2026-07-26 15:27:48 +08:00
Tianyi Cui
f9cc62266c fix(tools): single ordered driver lane for the sub-dispatch scheduler; validate the cap
Responding to ds-review-bot round 2 on #658 (three critical findings, one
warning — all rooted in the pump/commit split racing ordered stages):

- ONE driver lane now owns every ordered stage: the start append, prepare
  (pre-execute/guards), and the head-of-line commit (post-execute, context
  deferral, settle append). start() is awaited before the next entry can
  start, so concurrent submissions can no longer run pre-execute pipelines
  concurrently; only the around-dispatch/body stage overlaps, matching the
  native loop's fillPool sequencing.
- An exclusive call's barrier now holds through its COMMIT: later starts
  wait for the exclusive pipeline (post-execute included) to finish, the
  native exclusive-group semantics.
- drainDispatches() awaits the driver run itself, so a commit already
  mid-flight when the program returns is drained before run_code closes
  the turn — the settle event and deferred contexts land inside it.
- maxParallelSubCalls is resolved and validated at construction (positive
  integer), so direct construction can no longer wedge the pool with 0.

New tests: overlapping-submission ordered-prepare, barrier-through-commit,
drain-mid-commit, cap rejection. 96 keyless snapshots replay unchanged;
Agent Note updated (both languages).
2026-07-26 15:26:52 +08:00
Chinesezjc
9ef532ea34 Merge remote-tracking branch 'origin/master' into fix/intent-draft-sync-echo 2026-07-26 15:22:07 +08:00
Tianyi Cui
b4d032c1a2 docs: make bilingual pairing universal 2026-07-26 15:06:51 +08:00
_Kerman
6a068ec28d test: restore 100% per-file coverage for agent-loop and the acp bridge
agent-loop: behavior tests for retry-while-busy, cancelled recovery
windows, no-facts stream failures, idle-listener preemption, rejected
driver promises under whenIdle, finish-chunk failures after step close,
presentationMeta persistence, pre-aborted and torn-down create/resume
signals, and configured-start failures over existing artifacts or after
teardown. The remaining guards that no public path can reach carry
justified v8 ignore annotations naming the invariant that starves them.

acp bridge: cover the retry-adoption path (a retry turn resolves the
prompt the failed turn deferred), the no-retry quiescence rejection, and
the admission-blocked cancelled settlement; the synchronous send-throw
catch is annotated as a future-proofing guard since the machine's send()
contains listener failures.
2026-07-26 14:57:24 +08:00
Tianyi Cui
acf0d42ed8 fix(client-runtime): settled-only dispatch index carries null callTime; README matches
Responding to ds-review-bot round 2 on #653: the tool/code-dispatch event
is appended at settlement, so using its time as callTime fabricated a
zero-duration call for duration-aware consumers — it is now null (start
unknown) per the ToolResultNode contract, pinned in the session spec. The
README's codeDispatches section described the PR3 running→settled
lifecycle a stack ahead of this tree; it now documents the settled-only
index this PR ships (the running shape lands with the start event in
#658, which already merges cleanly over this).
2026-07-26 14:51:03 +08:00
Tianyi Cui
e5e7c0347e docs(cli): document the DSH_TOOLS_MODE contract in the owning README
Responding to ds-review-bot round 2 on #648: the env seam's accepted
values, native default, process-wide scope, loud-failure behavior, and
temporary status now live in apps/cli/README.md next to the Web/headless
surface it configures, not only in the cordis.yml comment.
2026-07-26 14:47:41 +08:00
Tianyi Cui
df8756ccf5 Merge remote-tracking branch 'origin/master' into worktree/i18n-complete-non-readme
# Conflicts:
#	packages/client/i18n/README.md
#	packages/client/locale/README.i18n.yaml
#	packages/client/locale/README.zh.md
#	packages/client/ui-layout/README.md
#	packages/client/ui-theme/README.md
2026-07-26 14:37:46 +08:00
_Kerman
fc8d339bf0 fix(acp): settle admission-blocked and retried prompts after the merge
The automation bridge inherited two master-era assumptions the message
machine no longer honors. A prompt blocked at pre-turn admission opens no
turn, so no turn/end could ever settle it — the bridge now watches
whenIdle() and reports a turnless slot as cancelled (the disposed-agent
guard moved to a registry identity check before send). A failed turn no
longer rejects at its turn/end either: agent.retry() closes the failed
turn and opens a successor on the same history, so the bridge holds the
terminal error and lets a retry-triggered turn/start adopt the prompt,
rejecting only at quiescence with no successor.

Also: refresh the empty-response-retry fixture for retry-as-turn logging,
adapt master-side tests to the unified send()/UserMessageData API and
registry-fact disposal, resync the doc pairs both sides touched, trim
architecture.md back under its word ceiling, and regenerate the event and
persistence catalogs.
2026-07-26 14:29:30 +08:00
_Kerman
57d90c343d Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	.agents/notes/implemented/feature/2026-06-14-acp-agent-client-protocol.md
#	.agents/notes/implemented/feature/2026-06-14-acp-agent-client-protocol.zh.md
#	.agents/notes/implemented/feature/2026-06-30-hook-bridges.i18n.yaml
#	.agents/notes/implemented/feature/2026-06-30-interception-seams.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-06-sandbox.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-06-sandbox.md
#	.agents/notes/implemented/feature/2026-07-06-sandbox.zh.md
#	.agents/notes/implemented/feature/2026-07-19-model-facing-goal-tools.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-19-same-session-goal-round-driver.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-25-workspace-ui-product-flow.i18n.yaml
#	.agents/notes/implemented/simplification/2026-07-02-remove-stream-chunk-mirror.i18n.yaml
#	docs/architecture.i18n.yaml
#	docs/cookbook/adding-a-tool.i18n.yaml
#	docs/cookbook/extension-cookbook.i18n.yaml
#	docs/core-data-structures/llm-streaming.i18n.yaml
#	docs/core-data-structures/session.i18n.yaml
#	docs/core-data-structures/tools.i18n.yaml
#	docs/event-producer-consumer.md
#	docs/persistence-catalog.md
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.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
#	examples/acp-agent/tests/snapshots/permission-switching/session.jsonl
#	examples/acp-agent/tests/snapshots/plan-mode-reject/session.jsonl
#	examples/acp-agent/tests/snapshots/plan-mode/session.jsonl
#	examples/acp-agent/tests/snapshots/session-sandbox-root/session.jsonl
#	packages/context/session-reference/README.md
#	packages/core/agent-loop/tests/agent.spec.ts
#	packages/hooks/hooks-claude/tests/coverage-cases.ts
#	packages/host/runtime/tests/host-runtime.spec.ts
#	packages/llm/llm-retry/tests/retry.spec.ts
#	packages/session-persistence/session-persistence/src/coordinator.ts
#	packages/support/acp-snapshot/README.md
#	packages/support/acp-snapshot/src/normalize.ts
#	packages/ui/acp/acp-feature-support.md
#	packages/ui/acp/src/codec.ts
#	packages/ui/acp/src/index.ts
#	packages/ui/acp/tests/bridge.spec.ts
#	packages/ui/acp/tests/codec.spec.ts
#	packages/ui/acp/tests/config-options.spec.ts
#	packages/ui/acp/tests/dispose.spec.ts
#	packages/ui/acp/tests/edges.spec.ts
#	packages/ui/acp/tests/stream-update.spec.ts
#	packages/ui/acp/tests/turns.spec.ts
2026-07-26 14:05:33 +08:00
Tianyi Cui
3e1a22eb2b fix(client-runtime): settle-only dispatch windows carry null callTime
Responding to ds-review-bot on #664 (root cause lives here): when a history
window carries a tool/code-dispatch settle without its paired start, the
runtime fabricated callTime = settle time, so downstream duration views
presented a measured 0 ms. Match the native tool-result contract instead —
callTime: null = unknown — and pin it; the trajectory cell already renders
null as the em dash, and the waterfall gains explicit unknown handling in
its own PR.
2026-07-26 14:04:29 +08:00
imccyu
92700c2375 Merge pull request #644 from deepseek-harness/worktree-websettings
Slot-composed settings surface with locale and theme preferences
2026-07-26 13:59:14 +08:00
Tianyi Cui
030973e4ab Merge branch 'master' into worktree/i18n-complete-non-readme 2026-07-26 13:31:20 +08:00
Tianyi Cui
06556237f4 fix(tools): close scheduler coverage gaps; regen persistence catalog
The coverage gate flagged three untaken paths in the bridge scheduler:
- the exclusive-head inFlight re-check was dead (the shared guard above
  already returns for an exclusive head with any in-flight sibling) — removed;
- the commit-cursor undefined-dispatched break was structurally unreachable
  once entries join commitQueue only after start() ran synchronously —
  reordered the pump so the invariant holds by construction, annotated;
- the finish (final-result) commit arm and the pump re-entry guard gain a
  covering test (throwing tools/pre-execute listener) and a defensive
  annotation respectively; mid-run unregistration test renamed to match its
  actual post-result settlement path.

Also covers the direct-construction maxParallelSubCalls default (index.ts)
and commits the regenerated persistence catalog for the new dispatch pair.
2026-07-26 13:24:34 +08:00
imccyu
0fe9ff888d Merge origin/master into worktree-websettings
ui-sidebar shell landed on master (#643: geometry-only shell, the
browsing region moved to the sidebar.workspaces slot); this branch's
sidebar.settings foot seat re-applies on top — the hardcoded foot row
becomes the seat, the seat rides the railIn crossfade, and the shell
spec's renderSlot stub key-splits region vs settings.
2026-07-26 13:15:57 +08:00
Tianyi Cui
847131e4fd Merge pull request #643 from deepseek-harness/worktree-ws-more 2026-07-26 13:06:55 +08:00
Tianyi Cui
8d078d7f64 Merge branch 'master' into worktree-ws-more 2026-07-26 13:01:36 +08:00
imccyu
fabc843c22 docs(gui): regenerate graphs for the returning ui-settings-general package 2026-07-26 12:48:30 +08:00
imccyu
7e20322c40 docs(notes): retitle the rejected alternative as per-feature satellite packages
The rejected shape is a settings satellite per feature; the ownerless
copy stays with ui-settings-general, which carries no feature surface.
2026-07-26 12:43:17 +08:00