deepseek-harness/packages/core/agent-loop/tests
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
..
agent.spec.ts simplify(agent): drop the unused public Agent.abort(), keep whenIdle() 2026-06-21 09:05:21 +08:00
cancel.spec.ts test(agent-loop): cover step-start disposal 2026-06-30 11:33:40 +08:00
config-session-id.spec.ts feat(types): brand bash ids + stop brand erosion; extract Branded to dsh-brand 2026-06-21 07:19:59 +08:00
coverage-edges.spec.ts simplify(session): fold trace-only usage/error events into load-bearing events 2026-06-21 10:00:06 +08:00
inbox.spec.ts Reorganize packages into a modular hierarchy 2026-06-20 22:55:20 +08:00
loop.spec.ts feat(tool-fs): result-time applied-hunk diffs for write/edit 2026-07-03 17:12:00 +08:00
mock-adapter.ts Reorganize packages into a modular hierarchy 2026-06-20 22:55:20 +08:00
properties.spec.ts feat(types): brand bash ids + stop brand erosion; extract Branded to dsh-brand 2026-06-21 07:19:59 +08:00
resume.spec.ts Persist the seed boundary so fork-child replay routes correctly 2026-06-22 20:55:32 +08:00
review-fixes.spec.ts fix pre-step cancellation and compaction convergence 2026-06-30 10:56:34 +08:00