Commit Graph

5780 Commits

Author SHA1 Message Date
imccyu
6d2e5a7cd7 feat: command.execute returns the lifecycle pairing id ({matched, commandId?})
CommandService.execute now returns a CommandExecution — the normalized
result plus the commandId minted for its command/run/command/done records —
and the wire admission value carries commandId exactly when matched, so the
issuing client can correlate its RPC acknowledgment with the flow node the
lifecycle events produce. apiproxy api/schema/handler, the connection
fixture, and the TUI/plan/goal consumers follow the new shape.
2026-07-27 23:07:13 +08:00
imccyu
2ebaa30c6d refactor: structured command/run payload {commandId, name, args, source}
The line field is deleted (pre-release, no shim): name and args are
parseCommand's own split — name plus verbatim rawInput with its separator
whitespace — so a consumer (a projection unit folding its own command
records, a rich command card) never re-parses a line. CommandNode mirrors
the split (name/args, both null on a run-less cross-window node); the
generic card rebuilds its display line as /name + args. The connection
fixture logs the same structured payload.
2026-07-27 23:06:52 +08:00
imccyu
f72f06e84a rfc: converge the projection contract on state-driven units, host-side push, and the command channel
Rewrites the proposed session-projection note to the settled architecture:
ProjectionDefinition (init/apply/view/stateVersion) replaces the opaque
get(agent) provider; the host is the only computation site (eager drive,
watermark cache, session/projection push frame); the client reduces to a
generic seq-guarded value store with zero per-domain code; plan selection
routes through the standard command channel ({name, args} structured
command/run, both plan RPCs retired, pending becomes a pure replay
quantity); the persisted projection cache (sessionId/key/stateVersion/
observedSeq/state rows) is the later cold-read phase; reverse scans and
absorber declarations are rejected for now. Chinese counterpart updated
per-section, pairing re-recorded.
2026-07-27 23:06:52 +08:00
imccyu
4fcfcf32d5 test: replace tuple casts with structural lifecycle assertions in command specs
Two aggregate-typecheck errors the package-level tsc -b (rootDir=src) never
saw: the commands spec's two-tuple as-cast over the lifecycle slice
(TS2352, host aggregate) becomes a plain commandId projection, and the
fixture spec still read the deleted result member off the pure-admission
execute value (TS2339, client aggregate) — the matched bit is now asserted
as the whole response shape.
2026-07-27 23:06:52 +08:00
imccyu
4ddec0ba2f refactor: command.execute degrades to pure admission; composer notice channel retired
The wire response now carries only the matched bit — CommandExecuteResult
is deleted from the api, schema, and client mirrors (pre-release, no shim);
outcomes ride the durably logged command/run/command/done pair broadcast on
the mux stream and render as flow nodes. ui-command's runDetached→noticeFor
outcome routing is retired: admitted commands surface nothing through the
composer, while admission misses (matched:false, syntax feedback) and
transport failures keep their immediate notice. The connection fixture
mirrors the host: an admitted command appends the lifecycle pair to the
session log instead of returning result text.
2026-07-27 23:06:49 +08:00
imccyu
ba928c5517 feat(gui): generic command flow node and the conversation.chat.commandview keyed slot
The FoldAdapter folds the log-only command/run + command/done pair (paired
by commandId) into a CommandNode outside the surface fold and merges the
nodes into the flow by seq; cross-window cuts soft-fall like tool pairs (a
done-only window builds the node from the done, a run with no done renders
as still executing). ChatView renders command nodes through the new keyed
'conversation.chat.commandview' hole (key = command name) with
GenericCommandCard — a stripped-down GenericToolCard showing the command
line and outcome text — as the render-site fallback, so any slash command
renders durably with zero registration and survives refresh, other tabs,
and resume via the mux-broadcast events.
2026-07-27 23:05:21 +08:00
imccyu
4e50369eb6 feat: durable command lifecycle logging in the executor (command/run + command/done)
CommandService.execute appends the log-only pair around every resolved
handler — run before invocation, done at settlement, including thrown and
aborted handlers (kind:'error'); admission misses log nothing. commandId is
minted monotonically per instance; per-session appends serialize through a
tail queue over SessionStore.appendOutOfBand (zero-step wrap on an idle log,
direct join inside an open turn). The invariant companion now asserts the
pairing relation (unique run ids; a done requires a prior in-log run).
CommandSource is a minimal merge-extensible map (user variant only).
Dependent benches mount SessionStore; TUI/e2e snapshots re-recorded for the
executor's durable-append timing and the /status event counts.
2026-07-27 23:04:57 +08:00
imccyu
e900ebd4c6 feat: todos session-projection provider in tool-todo (knife-4 domain probe) 2026-07-27 22:58:58 +08:00
imccyu
555a6aa7cc refactor(gui): read the typed projections block off the history response
The wire type now carries projections?: SessionProjectionsBlock (host-base
landed), so the structural projectionsOf narrowing and its TODO(gui) go away —
Session reads result.value.projections directly at all three installWindow
sites. ProjectionsBaseline stays as the cell framework's structural twin
(React-free layer keeps depending on the type table only) with values typed
Partial<SessionProjectionMap>; the erased walk moves inside resetBaseline
where per-key typing is re-established by schema.parse.
2026-07-27 22:58:57 +08:00
imccyu
95a3794e68 refactor(gui): source SessionProjectionMap from the interface package's pure-type outlet
Swap the client runtime's parallel-construction placeholder for
import type from @deepseek-ai/dsh-session-projection/types — the zero-import
outlet, never the package root, whose dsh-agent → dsh-session chain would drag
the host Context.sessions merge into the client program. One type table end to
end (host provider, wire block, client cell, React hook); the spec's test key
now declare-merges the real module. Adds the workspace dep and the tsconfig
project reference.
2026-07-27 22:58:57 +08:00
imccyu
70cc77eab0 feat: pure-type /types outlet for dsh-session-projection (client-aggregate import path) 2026-07-27 22:58:57 +08:00
imccyu
65e41f1cb0 feat: projections block on the session.history tail page 2026-07-27 22:58:56 +08:00
imccyu
fa331c6399 feat: dsh-session-projection seam package (ctx.sessionProjections registry) 2026-07-27 22:58:56 +08:00
imccyu
90addbf53c feat(gui): useProjection — the fifth framework hook seat through the standard kit
React half of the session-projection client base: the renderer contract gains
an open-key projections face on SessionMaybeProvideInfo (cellOf(key), distinct
from the static hooks roster), web-react mints projectionHook (per-bundle cache;
per-cell uSES binding via the shared observableHook cache; unresolved keys read
undefined through the absent source so hook order stays constant), standardKit
delivers kit.useProjection, and the runtime merges UseProjection into
SessionStandardProps/SessionMaybeStandardProps (overloads mirror useSession).
3 jsdom specs (kit delivery + live re-render, selector over undefined, faceless
bundle = all absent); existing direct-prop-feed specs gain the one-line stub the
new required seat mandates.
2026-07-27 22:58:53 +08:00
imccyu
fbebe1757a feat(gui): client projection cells — session dispatch seam, one-watermark fold, service roster
Object layer of the session-projection RFC client base: ProjectionCellSpec/
ProjectionCell/ProjectionCellSet with the single seq-watermark rule (live and
window-replace events share one filter; baseline reset re-seeds value+watermark
unless a newer commit applied; absent key = capability absent), Session
dispatch at appendLive/installWindow (projections block read structurally,
TODO(gui) switch to the interface package), SessionsService.registerProjectionCell
roster (live scopes now + future scopes at mint; disposer sweeps every session),
and the provideInfo projections face (key-addressed bare cell sources).
15 object-layer specs: watermark no-rollback, late-baseline seq rule,
capability absence, schema-failure degrade, duplicate-key throw, resync e2e.
2026-07-27 22:56:58 +08:00
imccyu
ed72b56f53 rfc: session projections and command lifecycle logging (proposed, bilingual) 2026-07-27 22:56:58 +08:00
Tianyi Cui
5b5f089bd0 Merge pull request #585 from deepseek-harness/xtr/agent-loop-message-machine
refactor(agent-loop): simplify message machine
2026-07-27 22:39:45 +08:00
Tianyi Cui
096d2dc06a Merge branch 'master' into xtr/agent-loop-message-machine 2026-07-27 22:34:21 +08:00
Tianyi Cui
ec4055adb9 Merge pull request #763 from deepseek-harness/lint-tsx-baseline
chore(lint): bring .tsx files into the eslint, lefthook, and jscpd lanes
2026-07-27 22:30:16 +08:00
imccyu
cdd4d59ea0 chore(lint): clear the semantic .tsx backlog
Hand fixes for the findings --fix cannot touch, mirroring the fixes
already applied on the fe-docs feature branch (same file, same shape)
so its eventual rebase resolves cleanly:

- restore the return the no-confusing-void-expression autofix ate in
  useAbsentSnapshot (typed S | undefined; hook call kept for hook-order
  stability, undefined returned explicitly);
- re-type DOM queries the no-unnecessary-type-assertion autofix broke:
  getByRole<HTMLButtonElement>(...) generics instead of the removed
  as-casts (the eslint program and the client tsconfig aggregate
  disagree about these casts; the generic form satisfies both);
- justified eslint-disable for the deliberate legacy paths: keyCode 229
  IME-composition detection, execCommand clipboard fallbacks, lib.dom
  clipboard optionality, and the any-typed Reflect.get/this probes in
  test fakes;
- drop the dead react/no-danger directive (eslint-plugin-react is not
  loaded, so the rule never applied) keeping its shiki rationale;
- delete the tautological 'Z' comparison and the renameTarget null
  check already implied by renameBlocked;
- css-module non-null assertions replaced by type widening
  (Button className, TAG_CLASS Record) per the established pattern;
- misc: max-len comment wraps, void generic drop in the deferred test
  helper, unused type imports, floating selectWorkspace promises voided,
  member-delimiter newlines in inline type literals.
2026-07-27 22:23:41 +08:00
imccyu
2adf44fb80 chore(lint): declare contract callbacks property-style
unbound-method flags destructuring a method-style member (method
signatures are bivariant and exempt from the this-context check).
These contract members are all plain callbacks — declare them as
property-style function types so consumers can destructure them
without a false this-binding hazard. Type-level only.
2026-07-27 22:23:10 +08:00
_Kerman
fb1dc6d117 Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/session.i18n.yaml
#	docs/event-producer-consumer.md
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
2026-07-27 21:51:37 +08:00
imccyu
49c2e85ac7 chore(lint): apply eslint auto-fixes across the .tsx backlog
Mechanical --fix output over the newly linted .tsx files (indent,
arrow-parens, comma-dangle, member-delimiter-style, unnecessary type
assertions), plus the three generic-arrow test hooks converted to
function declarations up front: the comma-dangle fixer strips the
<T,> disambiguation comma and turns them into parse errors otherwise.
2026-07-27 21:49:40 +08:00
imccyu
36e8141145 chore(lint): bring .tsx files into the eslint, lefthook, and jscpd lanes
.tsx sources and specs were invisible to every lint surface: the eslint
flat-config globs, the lefthook staged-file glob, and the jscpd clone
scan all matched *.ts only. Widen the five eslint file groups (source,
test, client-test, sonar, formatting), the pre-commit glob, and the
jscpd format/pattern to cover .tsx.

Existing .tsx files predate these lanes; follow-up commits on this PR
clear the backlog they surface.
2026-07-27 21:42:08 +08:00
Tianyi Cui
c03c4fdbdd Merge pull request #537 from deepseek-harness/feat/telemetry-otel-plugin
feat(telemetry): session-telemetry seam with mandatory redaction + OTel backend
2026-07-27 21:38:55 +08:00
Tianyi Cui
605df45928 Merge remote-tracking branch 'origin/master' into feat/telemetry-otel-plugin 2026-07-27 21:32:50 +08:00
Tianyi Cui
0af16387ae fix(telemetry): rename record waterfall 2026-07-27 21:30:28 +08:00
imccyu
4feb657b45 Merge pull request #754 from deepseek-harness/fix/question-composer-row-shrink
fix(ui-question): stop option rows absorbing the capped card's shortfall
2026-07-27 21:19:10 +08:00
_Kerman
ed67ad53d2 refactor(agent): return request retry action 2026-07-27 21:17:49 +08:00
Chinesezjc
207bab0c21 Merge remote-tracking branch 'origin/master' into fix/question-composer-row-shrink 2026-07-27 21:11:15 +08:00
Chinesezjc
b5395f9415 docs(agent-note): record that reproducing the shortfall needs a short viewport
The card cap is viewport-relative (min(60vh, 520px)), so shrinking the
conversation column clips the card without under-allocating it. Anything
demonstrating or measuring this defect outside the e2e scenario has to
change the viewport.
2026-07-27 21:11:15 +08:00
imccyu
9b23fe84c1 Merge pull request #751 from deepseek-harness/feat/workspace-native-folder-picker
feat(gui): add native workspace folder picker
2026-07-27 20:59:50 +08:00
kingwl
4182dbdc86 test(snapshot): refresh cordis-inspect-jsdoc for Session.firstLiveSeq
The self-referential inspect tool surfaces Session's public API in its
transcript; the construction-boundary field added in bc8512d17 now
appears there. Keyless refresh; only the affected scenario re-recorded.
2026-07-27 20:38:22 +08:00
kingwl
7d4b984037 Merge remote-tracking branch 'origin/master' into feat/telemetry-otel-plugin
Resolutions: regenerate the conflicted generated docs (cordis services
catalog, event-producer-consumer, module-graph); take master's
packages/README pair and re-insert the telemetry row on both sides;
re-record the README and session-doc translation pairs.
2026-07-27 20:26:21 +08:00
Chinesezjc
82f66f8fde Merge remote-tracking branch 'origin/master' into fix/question-composer-row-shrink 2026-07-27 20:20:16 +08:00
Chinesezjc
3e659db0b7 docs(notes): localize the Chinese Agent Note headings
The Chinese counterpart kept its title and every section heading in
English. The bilingual contract localizes heading text; only the
`# Agent Note:` prefix and the `Status:` token stay verbatim, matching
the renderings already used across the note corpus (问题 / 决策 /
曾考虑的替代方案 / 后果 / 验证). Pairing hashes re-recorded.
2026-07-27 20:20:12 +08:00
kingwl
bf76c52d76 fix(telemetry): reject non-positive maxExportBatchSize at plugin load
Review finding, pinned red-first: the SDK accepts
processor.maxExportBatchSize <= 0 (or fractional), but its shutdown
drain then splices empty batches without consuming the queue —
disposing telemetry hangs forever whenever records are queued. The
constructor now rejects a non-positive-integer batch size before
building the SDK processor, per the misconfiguration-fails-loud rule;
everything else in the processor block remains the SDK's verbatim
passthrough.
2026-07-27 20:11:30 +08:00
Ziya
91d85773ac Merge branch 'master' into feat/workspace-native-folder-picker 2026-07-27 08:06:44 -04:00
Tianyi Cui
3f9afd3a93 Merge pull request #748 from deepseek-harness/turtle1999-patch-1
fix(session-title): improve prompt
2026-07-27 20:03:18 +08:00
Tianyi Cui
08851a1a3e Merge branch 'master' into turtle1999-patch-1 2026-07-27 19:57:43 +08:00
_Kerman
c6073f07c2 Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	docs/architecture.i18n.yaml
#	docs/architecture.md
#	docs/architecture.zh.md
#	docs/core-data-structures/core.i18n.yaml
2026-07-27 19:55:55 +08:00
Tianyi Cui
ee1bf2764a Merge pull request #719 from deepseek-harness/fix/pty-raw-ready-wait
#719: keep the pty settle-boundary contract behind master's raw-mode SIGINT fix
2026-07-27 19:54:57 +08:00
Chinesezjc
f11dc28f1f test(web): record the user-bubble action row in the answered golden
The answered golden omitted the `复制` / `在新对话中分支` / `编辑` buttons
that `MessageItem`'s `UserActions` renders under every user bubble, so the
scenario failed against the built client. They are unconditional in the
accessibility tree — the `@media (hover: hover)` rule only sets `opacity`,
which does not remove a node from an aria snapshot — so there is no
message-row state to stabilize before capture; the golden was simply
recorded against a stale `lib/`. A partially failed `pnpm run build` had
left the client bundles from before its failure current and the rest not.

The Agent Note records that trap: confirm the build exited zero before
refreshing a golden, and note that untracked directories under `packages/`
are compiled too, so a leftover from another branch fails the build for
reasons the diff does not explain.

The same omission is present in the other 15 committed web goldens on
master, where 9 tests across 7 files fail for this reason on a pristine
tree. That is pre-existing and belongs to whoever landed `UserActions`;
this commit fixes only the golden this PR already touches.
2026-07-27 19:54:55 +08:00
kingwl
a72436105b docs(telemetry): state the crash-repair export semantics for resumed streams
Review finding: synthetic turn closers written by SessionPersistence
.load() at crash-resume sit below firstLiveSeq and are never exported,
leaving the remote turn unbalanced. Kept deliberately — exporting a
synthetic closer cannot complete a turn whose real tail records died
in the crashed process's queue; it can only make an incomplete turn
look closed. The OTel README now states the receiver rule (a
never-closed turn on a resumed stream marks the previous process dying
inside it; a later clean shutdown marker attests only to the resumed
process's exit), and the revival Agent Note records why the repair
suffix stays local.
2026-07-27 19:49:19 +08:00
Chinesezjc
0701245007 Merge remote-tracking branch 'origin/master' into fix/pty-raw-ready-wait 2026-07-27 19:44:10 +08:00
Tianyi Cui
5888503d5f Merge pull request #660 from deepseek-harness/worktree-process-service-seam
feat(subprocess): extract the subprocess seam from the bash executor and migrate every spawn site
2026-07-27 19:38:37 +08:00
ZiyaZhang
a5239b0f64 test(gui): cover native workspace picker branches 2026-07-27 04:37:24 -07:00
Tianyi Cui
dd03c88083 Merge commit 'refs/codex-unblock/20260727/pr660-master' into worktree/pr660-merge-20260727
# Conflicts:
#	scripts/doc-budgets.manifest.json
2026-07-27 19:34:55 +08:00
Chinesezjc
9dd57a25c5 fix(ui-question): stop option rows absorbing the capped card's shortfall
The question composer card is capped against the viewport and scrolls its
option list. `.options` is a flex column whose children defaulted to
`flex-shrink: 1`, so a short seat shrank the rows before overflowing the
scroll container: a row collapsed to its 42px minimum while `.optionCopy`
kept the taller height its wrapped copy needs, and `align-items: center`
then painted that copy outside the row's border box — over the question
title above and the next row below. Measured 6.5px of spill at 900x440 on
the shipped client, 10px at 380px tall, with `.options` reporting
scrollHeight === clientHeight and therefore offering no scrollbar.

`.option` and `.custom` now declare `flex-shrink: 0`, so the shortfall
reaches the scroll container that already owns `overflow-y: auto` — the
behavior the cap was designed for. Only rows whose copy wraps could
reproduce this, which is why the recorded scenario now asks a question
with long option descriptions; the web e2e asserts at three squeezed seat
heights that every row's children stay inside its border box, guarded
against holding vacuously by requiring a wrapped row and a scrolling list.
2026-07-27 19:20:33 +08:00
Tianyi Cui
beb885c254 Merge pull request #744 from deepseek-harness/wine-local-gate
ci: share one Wine Windows gate script between CI and an optional local gate
2026-07-27 19:11:36 +08:00