Commit Graph
623 Commits
Author SHA1 Message Date
Tianyi Cui db885271ed docs: polish Chinese README summary 2026-07-04 01:18:32 +08:00
Tianyi Cui 51640362b5 docs: rename coding demo to repl 2026-07-04 01:07:26 +08:00
Tianyi Cui 4cf2ade4ba docs: clarify top-level demos 2026-07-04 00:57:49 +08:00
Tianyi Cui ca91d7c2da scripts: ignore local artifacts in constraints 2026-07-04 00:57:35 +08:00
Tianyi Cui bae8bf4990 scripts: lint only package directories 2026-07-04 00:54:31 +08:00
Tianyi Cui 39cdb3ea28 docs: add translation review guidance 2026-07-04 00:51:25 +08:00
Tianyi Cui ed022780a2 docs: rebrand README for DeepSeek Harness SDK
Replace outdated references to 'DeepSeek Code' with the correct
product name 'DeepSeek Harness SDK'. Update demo commands to
reflect the SDK nature (demo:agent, demo:acp) rather than the
old coding-agent product.
2026-07-04 00:42:59 +08:00
Tianyi Cui 9e71c886e3 Merge pull request #133 from deepseek-harness/docs/i18n-translate-skill
docs: bilingual docs contract, translation skill, and pairing gate
2026-07-03 23:54:32 +08:00
Tianyi Cui 19db3aa28a Merge branch 'master' into docs/i18n-translate-skill 2026-07-03 23:50:53 +08:00
Tianyi Cui 5702f6244c Merge pull request #135 from deepseek-harness/fs-acp-applied-hunk-diffs
feat(tool-fs): result-time applied-hunk diffs for write/edit
2026-07-03 23:19:37 +08:00
Tianyi Cui 497ea15bdf fix(acp): relativize the completed diff card title
The result-time diff card sent view.title raw, so a completed edit/write
of an absolute in-workspace path flipped the card header back from the
relativized `Edit src/b.ts` to the absolute path — the pending card
relativizes, the result did not, and tool_call_update.title replaces the
header. Apply displayTitle to the result diff arm using the diff path,
mirroring the call-side card. Regression test proven red on the unfixed
arm.

Also record the overwrite diff-basis pre-read as a bounded follow-up
(TODO(overwrite-diff-bound) + RFC non-goal): overwriting a large file
reads the whole prior text into memory for a UI-only diff.
2026-07-03 23:14:22 +08:00
Tianyi Cui 9c6e09c0d8 Merge remote-tracking branch 'origin/master' into fs-acp-applied-hunk-diffs 2026-07-03 22:57:09 +08:00
Tianyi Cui 97de62a0ab Merge pull request #132 from deepseek-harness/fs-acp-render-intent-union
refactor(tools): tagged render-intent union for tool-call presentation
2026-07-03 22:56:48 +08:00
Tianyi Cui 8ca82d03ab refactor(tool-web): port web tools to the render-intent union
master's web_search/web_fetch tools were authored against the old
ToolCallPresentation bag; the render-intent union replaces it with a
card-tagged discriminated union. Both are simple generic cards, so they
declare card:'generic' explicitly.
2026-07-03 22:52:18 +08:00
Ziya ec05295a0c docs: equal-authority pairing with sidecar consistency records
Redesign per review: neither language is canonical. A pair is three
sibling files — foo.md, foo.zh.md, foo.i18n.yaml — and either language
may be authored first (a Chinese-first RFC is as legitimate as an
English-first one). The sidecar record holds the FULL git blob hash of
both sides as of the last confirmed-consistent state, replacing the
in-file one-directional fingerprint; editing either side without
re-confirming the pair goes red. New --write mode re-records a pair
after both sides are brought in line, making the confirmation a
reviewable yaml diff. Pairs merge whole (completeness enforced).

- gate rewritten around pair anchors (union of .zh.md and .i18n.yaml
  remnants) so half-deleted pairs are caught from either side; red/green
  proven for en-only edit, zh-only edit, missing record, and a record
  for an excluded file
- verify-rfc-classification now skips .zh.md counterparts (same RFC,
  indexed via its English filename; the pairing gate owns consistency)
- docs/i18n/README.md + translation-rules.md reframed bidirectionally
  (terminology table binds both directions; typography section governs
  the Chinese side); zh counterparts updated; skill workflow updated
- RFC amended to the shipped design, records the English-canonical
  in-file-fingerprint model as considered-and-revised; RFC translated
  (docs/rfc/.../2026-07-02-bilingual-docs-and-pairing-gate.zh.md) and
  added to the required frontier
- generated docs stay excluded with the follow-up recorded: teach the
  generators to emit Chinese, then de-list
2026-07-03 07:41:24 -07:00
Tianyi Cui 53ebf6fc54 Merge remote-tracking branch 'origin/master' into fs-acp-render-intent-union 2026-07-03 22:41:10 +08:00
Tianyi Cui 97b5b5509e Merge pull request #128 from deepseek-harness/fs-acp-policy-reject-snapshot
test(acp): snapshot the fs-policy rejection card
2026-07-03 22:40:48 +08:00
Tianyi Cui f28cb6b179 Merge remote-tracking branch 'origin/master' into fs-acp-policy-reject-snapshot 2026-07-03 22:28:01 +08:00
Tianyi Cui e09852f5a6 docs: correct three more result-diff comments to the whole-file case
Three comments still implied the result diff is always an applied hunk or
that write returns undefined on no-hunk: the toolResultUpdate JSDoc (a diff
result "emits the applied-hunk blocks, which replace the call-time snippet"),
the empty-diffs test comment ("an empty write returns undefined" — write now
falls back to a whole-file diff), and diffsFromMeta's JSDoc ("a bad meta
yields no diff card" — only true for edit; write falls back to a whole-file
diff). Each now states the write whole-file fallback. Regenerate the catalog.
2026-07-03 22:01:54 +08:00
Tianyi Cui e07886599c docs: finish the whole-file-diff sweep across comments and RFCs
Codex's stale-prose pass found seven more spots still describing the
result diff as ALWAYS an applied contextual hunk, or a create/binary
overwrite as rendering "only the call-time card": the DiffCallView JSDoc
and the acp bridge diff-arm comment, the FsWriteOutcome.before and
readTextForDiff JSDoc, and three RFC lines. All now say: the result diff
is the applied change — a contextual hunk when there is a before-image,
else a whole-file diff (create / undiffable binary) — and a successful
mutation always returns the result diff so the model-facing text can't
clobber it. Regenerate the cordis catalog (source line shift).
2026-07-03 21:50:52 +08:00
Tianyi Cui d753660d66 docs(fs-local): a null before-image still renders a whole-file diff card
The writeText comment still said a null `before` (a create or an
undiffable binary file) means "a consumer renders no result-time diff,
only the call-time whole-file card." That is stale since write's
presentResult renders a whole-file diff for a null before-image. Correct
it: a null `before` gives no contextual-hunk basis, so the consumer falls
back to a whole-file diff — the tool still renders a result diff card, not
the raw result text.
2026-07-03 21:38:42 +08:00
Tianyi Cui 86457689fc docs(acp): note the whole-file-diff create case in the presentResult list
The acp README's presentResult card list still described the `diff` result
as always "the APPLIED hunks computed from before/after". Qualify it like
the other surfaces: typically the applied hunks, or a whole-file diff for a
create, and a successful mutation always returns it so the result text
can't clobber the diff.
2026-07-03 21:30:11 +08:00
Tianyi Cui da1d7f281d docs(tools): DiffResultView.diffs may be a whole-file diff, not only hunks
The write-diff-card fix made write's presentResult return an args-derived
whole-file diff (oldText:null) for a create / unchanged overwrite, but the
DiffResultView contract and its mirrored docs still said `diffs` is ALWAYS
the applied contextual hunks computed from before/after. Correct the type
JSDoc, the write execute-side comment, and the four mirrored surfaces
(tools.md, tools README, acp-feature-support, adding-a-tool cookbook) to
say: typically the applied hunks, or a whole-file diff when there is no
before-image (a create) — and that a mutation returns the diff result even
when it duplicates the call-time card, since a tool_call_update.content
replace would otherwise clobber the diff with the model-facing text.
Regenerate the cordis catalog (source line shift).
2026-07-03 21:26:50 +08:00
Tianyi Cui 53b215c646 fix(tool-fs): write always renders a diff card on the completed update
A Write CREATE rendered its completed tool_call_update as the model-facing
result TEXT (`<path>…</path>…Created file`), which — because an ACP
tool_call_update.content REPLACES the call's content — clobbered the
new-file diff the pending call installed. So Zed showed the diff, then
replaced it with raw XML-ish text; only overwrite/edit looked right
(their result re-sends a diff).

write's presentResult now ALWAYS returns a diff card for a successful
write: the applied contextual hunk from `meta` when there is one
(overwrite), else an args-derived whole-file diff (`oldText: null`) for a
create or an unchanged-content overwrite. This matches claude-agent-acp,
where the create diff rides on the update and no result text replaces it.
An error still falls through to generic rendering so its message shows.
edit is unchanged (it always has a hunk; no whole-file fallback).

Re-recorded fs-write / fs-write-overwrite goldens; the create's completed
update is now a {type:'diff'} block, not the XML result text.
2026-07-03 20:52:36 +08:00
Tianyi Cui d24f3ffef0 Merge pull request #114 from deepseek-harness/web-capability-seam
Add web capability seam: ctx.web, search/fetch providers, web tools
2026-07-03 20:46:55 +08:00
Tianyi Cui 57923c68ee Merge branch 'fs-acp-render-intent-union' into fs-acp-applied-hunk-diffs 2026-07-03 19:21:24 +08:00
Tianyi Cui 4d36c0466b docs(acp): drop tool/result field enumeration in ToolPresenter comment
Same stale enumeration as the presenter-note fix, in the ToolPresenter
JSDoc: it said the tool/result event "carries only { callId, content,
isError }". The event also carries error and meta; the load-bearing fact
is that it omits the tool name/args (why the presenter remembers them per
callId). State that instead of an exhaustive list that drifts.
2026-07-03 19:20:14 +08:00
Tianyi Cui ce4036addb Merge branch 'fs-acp-render-intent-union' into fs-acp-applied-hunk-diffs 2026-07-03 19:05:59 +08:00
Tianyi Cui f86e0bedec docs(tools): sync ToolExecutionResult.meta comment to unknown
The pasted type-equiv block's JSDoc still said the meta payload is
`{@link JsonValue}`; the source comment is `unknown` (the meta channel is
opaque at the seam). verify-type-equiv compares type structure, not the
comment, so the drift slipped through — align the doc comment.
2026-07-03 19:05:46 +08:00
Tianyi Cui a928a5a47a docs(acp): don't enumerate tool/result fields in the presenter note
The callId→args map note said the tool/result event "carries only
{ callId, content, isError }" — an exhaustive field list that drifts as
the event grows (it also carries error, and now meta). State the load-
bearing fact instead: the event omits the tool name/args, which is why
the bridge remembers them per callId.
2026-07-03 19:04:11 +08:00
Tianyi Cui dee2dee402 fix(tool-fs): CRLF-safe write diff, opaque meta, doc sync
Address the applied-hunk-diffs review:

- CRLF write overwrite emitted bogus every-line-changed hunks: write's
  `before` was LF-normalized but `after` kept the raw model content, so a
  CRLF rewrite of an LF file diffed every line. Normalize write's `after`
  to LF so both sides share the diff basis (edit already did). Regression
  test proves it fails on the raw-after path.
- The tool-private `meta` payload is now typed `unknown` (opaque) at every
  seam instead of `JsonValue`. This drops the `dsh-tools -> dsh-session`
  package edge that existed only to name the type, and removes the
  `FileDiff` index signature that had been widening the type solely for
  JsonValue-assignability. Serializability is still enforced at runtime by
  `Session.append`'s isJsonValue check, which was always the real guard.
- Sync the docs the new result/meta surface left stale: ToolResultView's
  diff card + ToolExecutionResult.meta in tools.md/session.md type-equiv
  blocks, the acp/tools READMEs, and the adding-a-tool cookbook; regenerate
  the cordis catalog and module graph.
2026-07-03 18:00:16 +08:00
Ziya bb10931478 docs: apply translation-review findings across the four zh files
A four-way parallel review of every EN<->ZH pair (one reviewer per pair,
findings verified before applying) surfaced:

- terminology: stale-sense 过期 -> 陈旧 in development.zh.md (the table
  reserves 过期 for expired); GitHub workflow -> GitHub 工作流 per the
  table; dropped the invented 质量 in 'CI gates' -> CI 门禁; taxonomy ->
  分类体系 in translation-rules.zh.md; skill first-occurrence annotation
  added in the i18n README
- verbatim spans: <current-blob> restored inside an inline code span the
  translation had localized
- typography: full-width dashes normalized to no surrounding spaces
  across all four files (the rules' own MUST); one 顿号 between clauses
  -> comma; 顿号 before 以及 dropped
- fidelity/wording: must-not rendered 不得 (not 不应); local setup ->
  本地环境搭建; enforce -> 强制执行; verified surface -> 受验证的范围;
  batch-lands-before-neighbors nuance restored; 更新粘贴内容
2026-07-03 02:53:08 -07:00
Ziya 0282778126 docs: one more stale-sense 过期 -> 陈旧 in the i18n README translation 2026-07-03 02:33:42 -07:00
Ziya f508ff2bf5 docs: freshness/stale renderings per MDN HTTP-caching zh precedent
freshness -> 新鲜度 confirmed against MDN's zh HTTP caching docs (freshness
lifetime -> 新鲜度生命周期); precedent now cited in the table. The same
source pairs stale with 陈旧, not 过期 (过期 maps to expired), so the stale
entry and the i18n README translation now say 陈旧译文.
2026-07-03 02:32:54 -07:00
Ziya 50a32cdcb1 docs: extend terminology table with i18n mechanism terms
Every new term the bilingual-docs work introduced, with precedented
renderings where precedent exists:

- orphan -> 孤立 (git's official zh l10n renders orphan as 孤立, e.g.
  孤立分支 — not 孤儿; the translations were corrected to match)
- info string -> 信息字符串 (CommonMark zh convention; corrected in the
  i18n README translation)
- fenced code block -> 围栏代码块 (MDN zh), staged -> 暂存 (git zh),
  event-sourced -> 事件溯源 (DDD convention), smoke test -> 冒烟测试,
  fail-fast -> 快速失败, plus fingerprint/pairing/freshness/stale/contract
- mechanism names coined by this repo, marked as such in the notes:
  language switcher -> 语言切换行, structural signature -> 结构签名,
  enforcement frontier -> 强制边界
- keep-English entries so future translators don't guess: backlog,
  blob hash, CI, doc-sync, e2e, monorepo, PR, worktree
2026-07-03 02:24:17 -07:00
Tianyi Cui d8fd3225af feat(tool-fs): result-time applied-hunk diffs for write/edit
fs write/edit now emit a result-time contextual-diff tool_call_update
(the applied hunk with ±3 context lines, one hunk per replace_all site),
matching what claude-agent-acp sends and what makes an editor render the
change in place. The call-time snippet diff stays; the result hunk
supersedes it (ACP content-replace).

Mechanism:
- A persisted tool-private `meta` channel: execute may return
  `{ content, meta }`; `meta` (JsonValue) rides on the tool/result event
  and is handed back to presentResult, so the diff reproduces on replay
  (event-sourced). JsonValue is now exported from dsh-session.
- The backend returns raw before/after text (storage facts) on
  FsWriteOutcome/FsEditOutcome; the tool computes the hunk via the npm
  `diff` package's structuredPatch. A create has no before → no result
  diff; a failed/aborted mutation carries no meta.
- ToolResultView gains a DiffResultView; the bridge's result-side switch
  renders it as {type:'diff'} content blocks.

RFC: docs/rfc/implemented/architecture/2026-07-02-result-time-applied-hunk-diffs.md
(justifies the npm `diff` runtime dep over vendoring and the meta channel);
the render-intent-union RFC's Non-goal is updated to record this shipped.
All fs snapshot goldens re-recorded; edit/overwrite gain the contextual
result diff, create/read/policy-reject unchanged in structure.
2026-07-03 17:12:00 +08:00
Ziya a899226397 docs: harden pairing gate per review — structural signature, not counts
Review findings addressed:

- The gate compared only heading and code-block COUNTS, understating the
  contract it claims to enforce. It now compares ordered structural
  signatures: heading depths, fenced code blocks verbatim (info string +
  content), table column counts, list kinds, and every link target except
  the language switcher. Proven red on a heading demotion, a reworded
  code-block comment, and a retargeted link; green on all existing pairs.
- Stated the gate's limit explicitly (header comment + docs/i18n/README.md
  both languages): green means fresh and structurally sound, NOT verified —
  translation quality is the reviewer's half of the contract.
- first-line extraction no longer silently drops the last character of a
  newline-less file (split with limit instead of indexOf slice).
- isExcluded documents the trailing-slash-is-the-boundary invariant.
- Rollout guidance: grow the required frontier at the pace translation
  review is resourced.
- dsh-code-review's doc-sync sublist is now the exhaustive chain.

docs/i18n/README.zh.md updated via the minimal-diff workflow and
re-fingerprinted.
2026-07-03 02:06:57 -07:00
Dudu-0223 0a595aea78 test(web): cover the config-present branch of exa/perplexity apply
The numResults (exa) and searchRecency (perplexity) conditional spreads
in apply() were only exercised on their absent side, leaving the 100%
per-file branch gate red. Add plugin-registration tests that pass those
config fields and assert they reach the request body.
2026-07-03 17:03:54 +08:00
Dudu-0223 005db3c610 Merge remote-tracking branch 'origin/master' into web-capability-seam
# Conflicts:
#	docs/architecture.md
#	docs/module-graph.md
#	docs/rfc/README.md
#	packages/README.md
#	tsconfig.build.json
#	tsconfig.json
2026-07-03 16:49:00 +08:00
Ziya cd9d559805 docs: translate development.md to Chinese
First backlog item translated with the dsh-translate-docs skill: full-file
translation, terminology per docs/i18n/terminology.md, structure locked to
the source (11 headings, 10 byte-identical code blocks), fingerprinted and
added to the manifest's required list.
2026-07-03 01:27:34 -07:00
Dudu-0223 580496b72a feat(web): expose exa/perplexity search tuning as config
The Exa and Perplexity providers hard-coded request parameters that
deployments should control while defaults are still unsettled. Exa gains
searchType, numResults, and highlightsPerResult; Perplexity gains
maxTokens (it previously sent none) and an optional searchRecency. Each
follows the deepseek provider's shape: a defaulted Config field, a
DEFAULT_* constant, and a positive-integer status() check for numeric
limits. The call-level maxResults still flows through WebSearchRequest
and wins over the configured default, keeping the seam layering intact.

Addresses tianyicui's "make everything configurable" review comment.
2026-07-03 16:21:12 +08:00
Dudu-0223 7441307251 fix(web): open WebError.code to string, aligning with other seams
The closed WebErrorCode union leaked fetch-transport details (redirect,
too-large, content-type) into the seam's shared vocabulary and made web
the only seam with a closed error-code union. Drop it and let WebError
carry an open code: string like LlmError/SubagentError; document the
codes grouped by owner (seam-neutral vs dsh-web-fetch-local transport).

Addresses tianyicui's leaky-abstraction review comment on WebErrorCode.
2026-07-03 15:56:47 +08:00
Ziya 4d89bb3e74 docs: bilingual docs contract, translation skill, and pairing gate
Establish EN->ZH bilingual documentation for the README and docs tree:

- docs/i18n/README.md — the pairing contract: sibling foo.md <-> foo.zh.md,
  English canonical, blob-hash source fingerprints, language switchers,
  scope/exclusions, and a manifest-driven rollout ratchet.
- docs/i18n/translation-rules.md — how to translate: faithfulness, structure
  preservation, terminology discipline over docs/i18n/terminology.md, and
  typography rules grounded in MDN/K8s/Vue/clreq conventions.
- .agents/skills/dsh-translate-docs — the committed agent workflow, following
  the dsh-code-review pattern of deferring to docs as sources of truth.
- scripts/verify-translation-pairing.ts + manifest — a doc-sync gate: required
  pairs exist; every existing .zh.md is fresh (fingerprint = current source
  blob), switcher-linked, structure-matched, and non-orphaned; excluded
  (generated) docs stay unpaired. --list prints the translation work list.
- RFC (implemented/process) recording the decision and the alternatives.
- Dogfood: README.zh.md and the two i18n docs translated under their own rules.

Gates: doc-sync green including the new gate; red/green proven for stale
fingerprint, orphan, and excluded-file violations.
2026-07-02 23:12:25 -07:00
Dudu-0223 d8ea99756d Merge pull request #96 from deepseek-harness/fs-tool-clean
Add filesystem capability seam and tools
2026-07-03 10:07:00 +08:00
Tianyi Cui af79ceea1c fix(acp): exhaustive result-card switch + tighten display-path guard
Address the render-intent-union review:

- toolResultUpdate branched on `if (card === 'terminal')` with a generic
  fallthrough; ToolResultView is a closed union, so make it an exhaustive
  `switch (view.card)` ending in assertNever (matching the call-side
  renderer and the § Conventions closed-union rule). Adding a result card
  later now fails to compile at the switch. Regression test: a rogue result
  card throws.
- displayTitle's `rel.startsWith('..')` guard mis-rejected an in-workspace
  target whose relative form merely begins with the chars `..` (e.g.
  `..cache/x`, a real sibling name), leaving its title absolute. Test for a
  `..` SEGMENT (`..` alone or `..<sep>…`) so such paths relativize, matching
  claude-agent-acp's `cwd + sep` prefix check. Regression test added.
2026-07-03 02:27:20 +08:00
Tianyi Cui 1a57d67058 refactor(tools): tagged render-intent union for tool-call presentation
Replace the "bag of optional fields" tool-presentation types
(ToolCallPresentation / ToolResultPresentation / ToolTerminal) with a
card-tagged discriminated union — the standing FIXME(tool-presentation).
A tool declares one render intent per call/result and the ACP bridge
switches on `card`:

  ToolCallView   = generic | terminal | diff
  ToolResultView = generic | terminal

The `diff` card is new: fs write/edit now emit an ACP {type:'diff'}
content block (an editor's inline diff), which the old shapes could not
express. The bridge also relativizes a file card's title against the
session cwd (mirroring claude-agent-acp's toDisplayPath) while keeping
locations/diff paths raw, and derives the no-capability fenced console
fallback from a terminal result's output. read gains the window-in-title
(`Read foo.txt (5 - 8)`) and an always-set location line, matching the
reference adapter field-for-field.

Migrates all three producer families (tool-fs, tool-bash, tool-todo) and
the sole consumer (the ACP bridge) together — the source does not compile
piecewise. Adds snapshot coverage for the terminal _meta path (a new
capability-advertising scenario) and re-records the fs goldens to show the
diff cards. Applied-hunk (result-time, context-line) diffs need a new
result/event shape and are a follow-up.

RFC: docs/rfc/implemented/architecture/2026-07-02-tool-render-intent-union.md
2026-07-03 02:04:03 +08:00
Tianyi Cui 490fe002a1 test(acp): snapshot the fs-policy rejection card
The fs-policy gate throws FS_NOT_OBSERVED when the model edits a file it
never read; that rejection surfaces as a failed tool_call_update, but no
snapshot pinned it — a regression that dropped or mis-rendered the failed
card would pass every gate. Record a scenario that edits a seeded file
without a preceding read: the edit is vetoed, the file stays unchanged on
disk, and the transcript shows the pending edit card followed by a
status:'failed' update carrying the policy error.
2026-07-02 23:41:02 +08:00
Tianyi Cui 3aa6b3c77a chore(knip): register tool-fs e2e tests as knip entry points
The new packages/fs/tool-fs/tests/*.e2e.ts (+ its harness.ts) need an explicit
knip workspace entry — mirroring the other e2e-bearing packages — so knip
follows them and does not flag the files or their dsh-agent-loop/dsh-llm-deepseek
devDeps as unused.
2026-07-02 20:47:20 +08:00
Tianyi Cui b3f8b4c9c6 test(fs): close abort/concurrency/observed coverage gaps + with-key e2e
Behavioral gaps from the coverage audit (line coverage was already 100%; these
close BEHAVIOR gaps):

- fs-local: service-level writeText/editText pre-abort → FS_ABORTED (file
  unchanged); concurrent guarded-write race and mixed write-vs-edit race (one
  wins, one FS_STALE_VERSION, locks released); edit→edit version refresh at the
  provider; the replaceIfVersion post-write version matches a fresh stat. fsio:
  a mid-stream abort → FS_ABORTED (previously only pre-abort was covered).
- fs-policy: the agent-without-session owner rung ({agent:{}} → no owner →
  createIfAbsent / FS_NOT_OBSERVED); fs/write-intent first-wins (symmetric to
  the existing edit-intent test).
- tool-fs: abort-through-the-tool for read/write/edit (isError FS_ABORTED, file
  unchanged); a deterministic tool-tier concurrent-edit race via a shared read;
  the throwing-fs/observed contract (a throwing listener surfaces as isError but
  the mutation already hit disk); the replace_all edit message; parseReadArgs
  rejects fractional/NaN offset and zero/negative limit.
- dsh-fs: FsError chains a cause through ErrorOptions.

New with-key e2e (packages/fs/tool-fs/tests/fs-tools.e2e.ts, self-skips without
DEEPSEEK_API_KEY): a real model drives the real read/write/edit tools to create
→ read → edit a file, verified on disk; a second test proves a relative path
resolves against the per-session cwd (factory meta.cwd) not config.cwd. Booted
via a plain tests/harness.ts. Added dsh-agent-loop + dsh-llm-deepseek devDeps.
2026-07-02 20:38:06 +08:00
Tianyi Cui 94cbec8162 test(acp): snapshot scenarios for the filesystem tools
Five recorded ACP snapshot scenarios exercising read/write/edit end-to-end
through the real acp-agent subprocess, replayed keyless in CI:

- fs-read — read a seeded file (read tool + presentation + observed-state)
- fs-write — create a file (write, no prior version guard)
- fs-edit — read then literal-replace (read-before-edit authorization)
- fs-write-overwrite — read then rewrite (replaceIfVersion after a read)
- fs-read-window — read lines 5-8 with offset/limit (windowing + the offset
  surfaced as the tool_call location line)

The goldens confirm the tools render with their new presentation — Read/Write/
Edit <path> titles, read/edit kinds, and `locations` (fs-read-window carries
`{path, line:5}`) — and that the prompts steered the model to the fs tools, not
bash (zero bash calls in any golden). Recorded against the real API, filtered to
the new scenarios so no existing fixture churned.
2026-07-02 20:09:09 +08:00