Repository navigation
feat(side-chat): run read-only tools on the DeepSeek Harness backend - #19745
Conversation
Sensitive change review
|
7fdba6e to
33840e9
Compare
Sensitive change review
|
Sensitive Change ReviewSensitive files changed:
|
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS
Not justified as shipped
What this change shipsInventory (7 items) — 6 justifiedIntent: let Side Chat on DeepSeek Harness read and search files while writes stay impossible. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 474ff86 Description read[DESCRIPTION-READ] 7c19bcdedc745809b735c86edf5bd0b2ac4551f9c1a57dff34edfecdc41297c3 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The stock-composition proof trusts every Watch
Suggestions
[DESIGN-REVIEWED] 474ff86 Description read[DESCRIPTION-READ] a3d6ec0ee049238ca00f6e2f96ebf24079767483a05282ce6ee9a473df89aee9 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
33840e9 to
02c4eff
Compare
Sensitive change review
|
|
Disposition for the GPT 6.1 review of 1. 2. |
Security Scope Review -- 🟡 CONCERNSWhich legitimate operations does Verdict basis: the reviewer's own judgement; no confirmed regression. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: CONCERNS TIGHTENING: DeepSeek Harness READ_ONLY (Side Chat) permission resolution -- this change refuses a READ_ONLY turn on a dsh session whose launch did not prove that stock dsh owns the ADJUDICATED: 16 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: Candidates cover three spellings. The
These are named under UNADJUDICATED. UNADJUDICATED:
None of these can be expressed as a shell command line, so no leg can give a verdict on them. This is a gap in what could be tested, not a confirmed regression. [SCOPE-REVIEWED] 474ff86 |
Sensitive change review
|
c2531a2 to
a65373d
Compare
Sensitive change review
|
|
Disposition for the Opus 5.5 review of Relative DeepSeek targets (fixed, fail-closed). Verified: |
Sensitive change review
|
ab3cec7 to
1c046a5
Compare
Sensitive change review
|
|
@buluoray ready for re-review at Your review on
Conflict resolution keeps both backends: |
Sensitive change review
|
|
@buluoray current head is |
Sensitive change review
|
|
@buluoray current head is |
Sensitive change review
|
|
@buluoray current head is |
Sensitive change review
|
|
@buluoray current head is
Ready for your re-review. |
Sensitive change review
|
buluoray
left a comment
There was a problem hiding this comment.
Verdict: APPROVE at 09aa02e223 (re-review of my CHANGES_REQUESTED on e4833be748)
What it does for users
Side Chat on the DeepSeek Harness can now run file reads and searches (read, grep, glob on an absolute path). Before this, every call was refused. Anything that changes something is still refused.
My blocking finding is fixed
On e4833be748 the read-only proof trusted only the tool's name. A plugin composed from the operator's own dsh config could register its own read and get it approved. Now:
- The gate plugin's load marker records the composition after
appReady, once every loader entry has settled. That means every enabled loader entry (id, module, fiber state), plus, for each read name, whether the global layer holds it and whether any scoped layer shadows it (kiro_crew_tool_gate.mjs:153-187, written at:335). Any shape the plugin cannot read is recorded asnull. An unknown scoped-layer shape counts as a shadow (has?.(name) !== false). deepseek_read_only_owner_issue(agent_sdk/tool_gate.py:1015-1067) returns an issue unless all of the following hold:- every entry is a bare
@deepseek-ai/package that is not one of the two code-hosting runners, a loader built-in, or Crew's own gate; - each name is held globally and not shadowed in any scoped layer;
- its stock owner (
platform/tool_names.py:228-232) is composed and active.
- every entry is a bare
- The result is recorded per launch (
acp/harness/deepseek.py:456-478, called at:635, after the existing marker check and only when it passes). The client default is non-empty (acp/client.py:849), so a session that never recorded a proof refuses. A marker that is not a dict already failsgate_marker_issue. - When there is an issue, two independent guards refuse:
build_permission_eventleavesdeepseek_tool_nameempty (acp/_dispatch.py:2632-2637);_resolve_permissionrejects the call outright on a READ_ONLY turn, before any other read-only proof (llm_helpers.py:3520-3533). The provider carries the field across (providers/acp.py:2680-2682).
- Every path fails closed: missing fields, a non-stock entry, a shadow, an inactive owner, an unread composition.
Mutations (one at a time, restored and git status clean between runs)
| Removed | Red test |
|---|---|
whole owner check (return "") |
11 tests, including test_a_shadowing_plugin_keeps_the_side_turn_reject_all and all test_the_read_proof_refuses_a_composition_it_cannot_vouch_for[*] |
| code-host-runner exclusion | ...cannot_vouch_for[host_runner] |
| stock-scope regex | [path_plugin], [dotdot_spec], [host_runner], test_a_shadowing_plugin_keeps_the_side_turn_reject_all |
| scoped-shadow check | [scoped] |
| owner-active check | [owner_failed] |
| recording the issue at launch | the same 11 as the whole owner check |
| non-empty client default | test_an_unproved_session_refuses_every_side_turn_call[read] |
llm_helpers refusal and _dispatch blanking together |
test_a_shadowing_plugin_keeps_the_side_turn_reject_all, test_an_unproved_session_refuses_every_side_turn_call[read] |
The composition tests load the real gate plugin under node, so node must be on PATH. Without node they are skipped, not failed.
Nothing else regressed
- 1078 passed across
test_side_readonly_{deepseek,kas,goose,claude}.py,test_acp_deepseek_backend.py,test_hooks.py,test_backend_cards.py,test_harness_parity.py,test_acp_tool_gate.py,test_llm_helpers_tool_gate.py,test_member_mount_deepseek.py. I confirmed the worktree'stool_gate.pywas the one imported. - The first commit's range-diff against
a65373db60is only the rebase: it moved intoclient_tool_events.pyand merged with the claudeharness_builtin_toolfield. Thegate_tiers.pychange in the fix commit is formatting only. The plugin digest pin was updated together with the plugin (deepseek.py:105). - My earlier follow-up is done: the same-id test now uses an absolute target (
test_side_readonly_deepseek.py:313). - Spec updated in the same PR:
side.md(ownership rule, REJECT_ALL fallback) and H6 inharness-parity.md.
Non-blocking follow-ups
- The
llm_helpersrefusal and the_dispatchname blanking cover each other. Removing either one alone keeps the suite green, and only removing both goes red. A test that drives one guard without the other would pin each separately. - The composition is proved on the read-back probe boot, not on the session's own boot. Any config change between the two goes unseen. The gate proof on main has the same gap, so this PR does not widen it.
Not verified
- dsh is not installed on the review host. I did not check against real dsh:
- which stock
@deepseek-ai/packages can run operator-supplied code, beyond the two runners the PR excludes; - that
entry.options.nameis always the specifier the loader resolved; - that a bare
@deepseek-ai/*specifier cannot resolve to a file the operator controls.
The proof rests on these.
- which stock
- No live dsh session was run. Frame shapes come from the committed capture.
Sensitive change review
|
buluoray
left a comment
There was a problem hiding this comment.
Re-approving after the rebase. Compared against the head I approved (09aa02e): the deepseek ownership gate is unchanged. The deepseek_tool_name / deepseek_read_only_issue copies moved with main's split into providers/acp_turns.py and still sit in the same event-forwarding call beside kas_builtin_ids (acp_turns.py:93-96), so a side turn still carries both fields. The other differences are feature-map and H6 context from main. CI is green.
A READ_ONLY turn approved any non-MCP dsh tool named read, grep or glob on its name alone. A plugin from the operator's own dsh config can register a tool under one of those names, so the name proved nothing. The gate plugin's load marker now lists every enabled loader entry and where each read name is registered. The launch records whether every entry is stock dsh code and the stock tool packages own the names. Until that holds, every deepseek side turn is REJECT_ALL.
Sensitive change review
|
chenmingwei23
left a comment
There was a problem hiding this comment.
Approved via bulk merge run: no failing checks on the current revision.
Problem / Motivation
Goal: On the DeepSeek Harness backend, Side Chat and thread replies can read files and search the codebase, while changes stay impossible.
On
agent.acp_backend: "deepseek"every Side Chat tool call is refused (REJECT_ALL), becauseACP_BACKENDS_SIDE_READONLYnames only kiro-cli and KAS. A side question asked while the main turn is busy is answered from memory, and the footer says tools are unavailable on this backend.Why it matters
Side Chat exists for quick lookups while the main turn runs. On deepseek it cannot open the file the question is about, so the answer is a guess and the user has to wait for the main chat.
Not a goal
ls,git status) in a deepseek side turn. dsh streamsbashaskind: other, so no shell command is recovered for the gate to judge, and making it a shell call would change the main chat's shell tiers too.bashstays refused on side turns.read,grepandglobare mapped.READ_ONLYturn only.What changed (motivation → approach → change)
Safe scope, for review. What a deepseek side turn (Side Chat or thread reply,
READ_ONLY) may run now:READ_ONLY)readwith an absolutefile_path,grep/globwith an absolutepath(~allowed)tool_callframe stated)grep/globwith nopath, or any relative target (dsh resolves it against the session's work dir; the gate's path checks would resolve it against the gateway's)~/.aws,~/.ssh, Crew's secrets)read) or kiro-cli's (fs_read)write,edit,bash, any MCP tool, any other nametool_callframes under one id in a turnWhy deepseek can be a member (H6, on its own evidence). The tempting route, dsh's own
DSH_PERMISSION_MODEread-only posture, is still wrong: it denies rather than asks, so no READ_ONLY decision is made. The route that works is the one every deepseek session already runs: Crew's gate plugin (kiro_crew_tool_gate.mjs) answers dsh'stools/pre-executewithaskfor every call, keeps only the harness's own denies, and turns every downstreamallowintoask. The per-launch patch pinsapproval.policy: ask, and the load marker proves the stock ACP bridge is the only answerer. dsh's approval service has no allow rules (ask/neveronly,allowed-oncethe only grant). So there is no harness-side pre-approval a call could ride past the gate on — the gap that keeps claude out until #19059.Live capture on dsh 0.2.0-rc.2 with the plugin composed (
test/fixtures/acp_frames/deepseek/side-read-only-live.jsonl):read,grep,glob,write,bashand an unknownmcp__probe__readeach raisedsession/request_permission; the rejectedwriteandbashleft no file.What the gate can prove. dsh's ACP bridge writes the dispatched tool name as the
tool_callframe'stitle(kind: "other", no_meta) and the permission frame carries onlytoolCallId. Every dsh MCP tool ismcp__<server>__<tool>, so a barereadis never an MCP tool.platform/tool_names.DEEPSEEK_READ_ONLY_TOOLS(the stdlib leaf the KAS table lives in) mapsread/grep/glob→fs_read/grep/globand names each tool's target parameter (file_path/path). Not aHARNESS_TOOL_TABLESrow, so main-chat hook matching does not move._dispatch.build_permission_eventfillsAcpEvent.deepseek_tool_namewith the cached first-frame name, on the deepseek backend only;providers/acp.pycarries it across.AcpClient: on deepseek, a secondtool_callframe naming the same id differently in one turn leaves the name empty (dsh forwards the provider's id verbatim;tool-call-id-reuse-live.jsonl). The per-turn reset clears it.gate_tiersreads the field underclassifier_onlyonly: dsh's name and its kiro-cli name are both deny targets and one governance identity (alias_groups, as KAS ids are), and_tier_read_onlyproves it viatool_identity._is_deepseek_read_only_builtin(server empty, target parameter an absolute path). The sensitive-path tier runs first, as on kiro-cli.ACP_BACKENDS_SIDE_READONLYgains deepseek; its comment states the evidence and why pi is still out.A name proves the tool only when stock dsh registered it. A plugin from the operator's own dsh config can register a tool called
read(globally ahead of the stock one, or in a per-agent scope created after load). So the name is trusted only when the launch proves that stock dsh composes those tools:composition. It lists every enabled loader entry (id, module, fiber state) fromctx.get("loader").entries(). For each ofread/grep/globit also records whether the global layer holds the name and whether a scoped layer shadows it. A shape the plugin cannot read is reported asnull. The plugin digest is re-pinned.tool_gate.deepseek_read_only_owner_issuereturns""only when all three checks pass:@deepseek-ai/…package that is notdsh-cordis-host-runner/client-runner, a loader built-in (cordis:include/cordis:group), or Crew's sealed gate.dsh-tool-fs/dsh-tool-fs-searchis running (fiber state 2)._record_deepseek_read_only_proofstores the verdict on the session during the launch read-back. The session runs either way.AcpEvent.deepseek_read_only_issue.llm_helpersthen refuses every call on aREAD_ONLYturn, so the side turn is REJECT_ALL with a deny notice and a launch warning. On that sessiondeepseek_tool_nameis also left empty. A client with no recorded proof is refused.include:tool-fs/include:tool-fs-search, and the verdict is"".~/.dsh/profiles/acp/cordis.patch.ymlgives a verdict naming that entry, so the turn is REJECT_ALL.side.md,harness-parity.mdH6, feature-map row, the deepseek corpus README.Backwards compatibility
Compatible: kiro-cli, KAS and every other backend build the same permission events and get the same verdicts; on deepseek the new field is read only on
READ_ONLYturns, which ranREJECT_ALLbefore.Tests
test/test_side_readonly_deepseek.pydrives each frame through the real deepseekAcpClient, the provider conversion and the realHookManager:read,grepandglob, their targets anchored to an absolute path, are approved on a side turn — fail on main, as do the membership pin and two field pins.writeandbash, andbash ls, are refused on a side turn; on a normal turnwrite,bashandreadare all still asked and none auto-approved.mcp__probe__read; two calls under one id in either order; no precedingtool_call; a prose title; a mismatched id; an opencode frame titledreadgets no mapping.read ~/.aws/credentials,grep ~/.ssh,glob ~/.awsrefused; the captured pathlessglob, a pathlessgrep, an emptypath, the captured relativeread note.txtandgrep .,../x/.envand an unexpanded$HOMErefused;auto_deny_toolsin either spelling and governance ceilings (toolsdenyread/fs_read/grep, afilesystem.readdeny) refuse it, and an allow-mode ceiling naming onlyfs_readstill admits it; a Node run of the shipped plugin shows a downstreamallowbecomesaskand adenystaysdeny.Mutations: dropping the duplicate-id clear reddens 2 of the 3 duplicate cases; dropping the absolute-target check reddens the no-target and relative-target cases; dropping the
alias_groupsidentity reddens the 3toolsceiling cases.Ran locally on this head: the new file,
test_backend_cards.py(deepseek core count 4 → 5),test_harness_parity.py,test_hooks.py(kwargs pins gain the field),test_side.py,test_side_readonly_kas.py,test_chat_threads.py,test_side_context.py,test_gate_tiers.py,test_acp_deepseek_backend.py,test_acp_client.py,test_acp_frame_replay.py,test_acp_frame_host_data.py,test_harness_tool_names.py,test_tool_permission.pyand the spec-hook suites — all green. isort, flake8, black gate (pinned 26.3.1) and comment-history gate pass.