Skip to content

feat(acp): DeepseekHarness, dsh on the shared runtime with a per-session gate ledger (not routed) - #37643

Merged
chenmingwei23 merged 1 commit into
mainfrom
feat/deepseek-harness
Nov 15, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
feat/deepseek-harness

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: the shared runtime can drive one dsh --profile acp process for several sessions, with Crew's tool gate and its completed-unasked tripwire still holding for each session; no session is routed there yet.

deepseek chats each start their own dsh process today (AcpClient + DeepseekLaunch). The shared runtime (AcpRuntime) had no harness for deepseek, and three things about deepseek did not fit it: the gate (a --patch plugin, a read-back probe and a nonce) is built per process; the completed-unasked tripwire keeps its ledger on the client; and dsh restores with session/resume, which the shared runtime never sends.

Why it matters

deepseek dashboard chats are next to share one ACP process, the way KAS, codex, claude and goose chats can, which saves one Node process per chat. Measured on dsh 0.2.0-rc.2 with Crew's gate plugin composed, two sessions on one process: a 60 s command in A took 60.1 s while B answered at 2 s and 30 s in 0.02-0.03 s; no text or tool crossed sessions (same folder or not); each session's model calls saw only its own MCP tools; B kept working after A closed; session/resume brought A back on the same process with only its own tools; every permission request named its own sessionId.

This is the second of three PRs. Stack and merge order: #37641 (PR1, deepseek code off AcpClient, merged) -> #37562 (GooseHarness: the permission_refusal / session_update_issue seams this reuses, merged) -> this PR -> #37646 (the switch). This branch is one commit on main.

Not a goal

  • No routing: deepseek is not added to ACP_BACKENDS_ACP_RUNTIME or to chat sharing. That is the next PR, behind a switch that defaults off.
  • No change to a per-session deepseek chat (AcpClient + DeepseekLaunch).
  • No Side Chat on the shared runtime: its READ_ONLY proof is recorded per process.
  • The per-session client's tripwire (client_permissions._tripwire_pi_gate) stays as it is: it is shared with pi and MiMo Code (pending asks, the shell-only arm), so folding it onto gate_tripwire_issue is its own change.

What changed (motivation -> approach -> change)

The gate is the process's, the ledger is the session's -> run DeepseekLaunch's own spawn once per process, and keep the tripwire's asked/denied ids per session in the runtime's per-session harness state -> one new harness plus small runtime hooks.

  • DeepseekHarness (acp/harness/deepseek.py), registered in _HARNESSES ahead of routing. resolve_spawn runs DeepseekLaunch.resolve_spawn against _RuntimeProbeSession, a stand-in carrying the runtime's extra_env, agent.env snapshot and work dir, so the read-back boots in the environment the child gets. The gate plugin asks about every call of every session and reads no nonce at run time, so one composition serves all sessions on the process.
  • No harness state. The nonce and the pinned DSH_PERMISSION_MODE travel on the new SpawnPlan.child_env, which the runtime places on the child just before apply_spawn_env. apply_spawn_env reads the provider key from Crew's vault (it runs in the launch's off-loop env hop) and strips kiro-cli's KIRO_API_KEY.
  • Tripwire per session. prepare_session returns a _DeepseekSession ledger. permission_refusal records the ask (refuses nothing); a new HarnessAdapter.note_permission_approved hook, called from the handle's approve_tool only after Crew's yes is written, records the approval; session_update_issue trips on a completed call that was never asked about or never approved, and consumes the ids at the terminal frame. Recording the yes rather than the no means every refusal path (the floor, the batch guard, a person), a cancel and an unanswered request all count as not approved. Because the ledger is per session, an ask in A is never counted for a call in B under the same provider id.
  • A call past the gate ends the whole process (trade-off below). New HarnessAdapter.permission_state_issue_ends_process (True only here): _refuse_moved_permission_state marks the runtime dead before any await, then kills it under asyncio.shield (AcpRuntime.kill, now on the handle's runtime contract), so a Stop landing during the kill cannot leave the process serving. Marking it dead first is also what lets this tenant through the ownership gate, which counts only a live runtime's leases. No session/close is sent on this path: the process is ending and dsh keeps the record. goose keeps closing only the one session.
  • Restore. One reader, can_restore_session (agent_sdk/backends_sessions.py), now used by both drivers: AcpClient._initialize_session drops its inline copy and AcpRuntime calls it after initialize. load_session sends session/resume for ACP_BACKENDS_RESUME_WITHOUT_LOAD and accepts a restore answer without modes for ACP_BACKENDS_LOAD_WITHOUT_MODES, as AcpClient does.
  • SpawnContext gains extra_env and agent_env, filled by the runtime.
  • Unstartable MCP servers. The prune AcpClient runs for ACP_BACKENDS_PRUNE_UNSTARTABLE_MCP moves to acp/mcp_prune.py (prune_session_servers, record_pruned), and the runtime's create_session and load_session call it too, so an element whose command cannot start is left out of the array and reported failed instead of failing the whole session/new or session/resume.
  • Audit row. New HarnessAdapter.permission_state_audit: a deepseek trip is written to the audit log as the call that ran (ran_without_gate / ran_without_approval, reason pi_gate_tripwire), not as a mode change.

Trade-off: one chat's tripwire ends every chat on the process

What happens to the other chats: their running turn ends with the runtime's death (the death sentinel wakes it, it does not hang), the process is killed, and each chat is restored on a new process with session/resume. Nothing is lost: dsh keeps each session's record in its own home. Measured: two sessions on one dsh process, B answered once and A in the middle of a 60 s command, the process SIGKILLed; on a fresh process both session/resume calls succeeded, B answered with its earlier turn in the model's history (3 messages) and A with its interrupted turn in history.

Why not close only the chat that tripped: the tripwire means a tool call completed that Crew's gate never saw. The gate is one plugin composed into the process, so that observation is about the process, not the chat; the per-session client stops its process on the same frame. Keeping the other chats on it would leave each of them able to run one more ungated call before its own tripwire could fire, because the tripwire only sees a call after it completed. The cost is an interrupted turn in the other chats, which is rare (it needs the harness to bypass the gate) and recoverable.

Backwards compatibility

Compatible: no session is routed to DeepseekHarness. For every other host SpawnPlan.child_env is empty, note_permission_approved is a no-op, permission_state_issue_ends_process is False, can_restore_session gives the old answer on both drivers, and load_session sends session/load and requires modes as before.

AcpClient._initialize_session replaces its inline restore-capability branch with can_restore_session, same answer. DeepseekHarness.resolve_spawn hands the shared runtime the credential mask DeepseekLaunch resolved (extra_hidden_dirs), so the runtime's sandbox wrap hides the same directories a per-chat dsh process hides.

Reader: src/kiro_crew/acp/client_start.py:_initialize_session -- chat -- test_both_drivers_read_the_restore_capability_with_one_function
Reader: src/kiro_crew/acp/runtime_spawn_launch.py:_spawn_admitted -- chat -- test_the_spawn_composes_the_gate_and_proves_it_in_the_runtimes_environment

Tests

  • New test_deepseek_shared_runtime.py: registration and seams; the spawn composes the gate and proves it in the runtime's environment (stand-in's extra_env, agent.env, work dir; --patch argv; child_env carries the read-back's nonce; vars(harness) == {}); a read-back that did not see the gate refuses the spawn; the vault key reaches the child and KIRO_API_KEY does not; a bad key mapping refuses; resume capability reading for deepseek vs codex, and both drivers use the one reader; tripwire on unasked, asked-once, denied, failed and non-tool updates; two sessions on one process: A's permission frame is recorded on A's ledger only (through the handle's _refuse_by_harness), so B's completion of the same id trips and A's does not; an asked call that completes without Crew's yes trips; a call past the gate marks the runtime dead and then kills it, a cancel during the kill still leaves it dead and killed, and a goose mode move still closes only its own session; only a written yes records an approval (no reject path does); a tripwire in one chat on a real AcpRuntime with two sessions wakes the other's queue with the death sentinel, and a fresh runtime restores that other session with session/resume; a real AcpRuntime starts and closes a session with its ledger and restores one from an answer with no modes. The shared prune drops an unstartable server on a new and on a resumed session and reports it failed; a trip writes the call's audit row.
  • test_acp_harness_contract.py: deepseek joins ALL_BACKENDS and REGISTERED_AHEAD_OF_ROUTING. test_acp_deepseek_backend_session.py: the restore pin now reads the shared reader.
  • Run locally, serial: the files above plus test_goose_shared_runtime.py, test_claude_shared_runtime.py, test_acp_runtime_load_session.py, test_acp_runtime.py, test_acp_runtime_session_start.py, test_acp_runtime_spawn.py, test_acp_harness_wire_parity.py, test_acp_goose_backend.py, test_runtime_bindings.py, test_session_handle_bindings.py, test_harness_parity.py, test_client_bindings.py, test_acp_deepseek_backend*.py, test_side_readonly_deepseek.py: all pass. scripts/check_harness_parity.py passes; black, isort, flake8 and mypy on the changed files are clean.

Proof: not provable -- other: no session is routed to this harness; the two-session and kill-then-resume behaviour it relies on was measured on a real dsh process (numbers above) and the end-to-end chat run lands with the switch PR

Manual verification

Real dsh --profile acp 0.2.0-rc.2 with Crew's gate plugin composed, driven over stdio against a loopback model stub: two sessions on one process, and a SIGKILLed process whose two sessions resume on a new one. Results in "Why it matters" and "Trade-off". The pod run with real chats, process counts and memory comes with the switch PR, which is the first one that routes a chat here.

Related Issues

Part of #5033

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 5dc27e6173364def06d9e1b2833d18518e18ce1d touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 5dc27e6173364def06d9e1b2833d18518e18ce1d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: no session is routed to the new harness, and every new seam (child_env, note_permission_approved, permission_state_issue_ends_process, permission_state_audit) defaults to the old behaviour for every other host.

Notes

  • Three new HarnessAdapter seams and the shared runtime's new session/resume restore path land with no change under docs/. AGENTS.md says the owning spec (acp-client / harness-parity) is updated in the same commit, so add them here rather than in the routing PR.
  • _refuse_moved_permission_state calls _mark_dead before the kill "because the ownership gate counts only a live runtime's leases". That gets past the lease check by changing the runtime's state, not through an explicit kill-authority path in runtime-ownership. Record that it is allowed there before feat(acp): let deepseek dashboard chats share one ACP process, switch off by default #37646 routes chats to this harness.

[DESIGN-REVIEWED] 5dc27e6

Description read

[DESCRIPTION-READ] d0378101c833d6668cf89789e95c7c378d1df9add7f86d138516d0ac355f0e18

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 5dc27e6173364def06d9e1b2833d18518e18ce1d — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing here changes what anyone gets today. Deepseek is registered on the shared runtime but nothing routes to it until #37646. The new tripwire is a second copy that the description defers on purpose.

Notes

  • Item 3: duplicate of client_permissions._tripwire_pi_gate (src/kiro_crew/acp/client_permissions.py:988). The new gate_tripwire_issue is called "The AcpClient tripwire … on one session's own ledger". That leaves two tripwires with the same rule. Subtraction: once deepseek is routed, delete the deepseek arm of _tripwire_pi_gate and point it at gate_tripwire_issue. That leaves one copy for the pi/MiMo fold.
  • Item 2: one consumer, generalized. SpawnContext.extra_env, SpawnContext.agent_env, SpawnPlan.child_env, note_permission_approved and permission_state_audit each have exactly one implementer or reader. I grepped src/ and every hit is harness/deepseek.py. Subtraction: fold child_env into DeepseekHarness.apply_spawn_env by giving the harness the minted nonce and mode at resolve_spawn. That removes one generic SpawnPlan field.

What this change ships

Inventory (9 items) — 7 justified

Intent: let one shared dsh process serve several deepseek chats while each chat keeps its own gate tripwire. This is an ADDITION, and nothing is routed to it yet.

  1. Deepseek is registered as a shared-runtime harness, not routed — justified
  2. The gate is composed once per process and read back in the runtime's environment — one consumer, generalized
  3. Each session keeps its own tripwire ledger of asked and approved ids — duplicate of client_permissions._tripwire_pi_gate
  4. A tripwire on one session kills the whole shared process — justified
  5. A tripwire trip is audited as the call that ran, not as a mode change — justified
  6. The shared runtime restores with session/resume and accepts an answer without modes — justified
  7. Both drivers read the restore capability through one function, can_restore_session — justified
  8. The unstartable-MCP prune is shared with the runtime's new and resume paths — justified
  9. kill is added to the handle's runtime contract — justified

[FIRST-PRINCIPLES-REVIEWED] 5dc27e6

Description read

[DESCRIPTION-READ] b5777099de79a3203403ed0131efe7fd30724a65f7df50b5a0d13e73d63d57e5

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 5dc27e6173364def06d9e1b2833d18518e18ce1d — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 5dc27e6

Verdict parsed from the review's SHA-scoped output markers for commit 5dc27e6173364def06d9e1b2833d18518e18ce1d.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 5dc27e6173364def06d9e1b2833d18518e18ce1d false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 5dc27e6173364def06d9e1b2833d18518e18ce1d and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 5dc27e6

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 5dc27e6173364def06d9e1b2833d18518e18ce1d false-positive: <reason, 20 to 500 characters>

@chenmingwei23
chenmingwei23 force-pushed the feat/deepseek-harness branch 3 times, most recently from dfca5f3 to 831f0a2 Compare November 15, 2026 16:53
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 15, 2026
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 15, 2026
@KiroCrewCaptain

KiroCrewCaptain commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider thinks the change is probably fine but estimates a 15% chance that this change introduces a defect, above the 12% limit for approving on its own.

Adds DeepseekHarness to the shared runtime, registered but not routed. It keeps a gate ledger per session, kills the whole process when a call runs past the gate, adds a session/resume restore path, and moves the unstartable-MCP prune into a shared module. At this head nothing a user sees changes: ACP_BACKENDS_ACP_RUNTIME is still {kiro, kas, codex}. None of these routed backends is in the RESUME_WITHOUT_LOAD, LOAD_WITHOUT_MODES or PRUNE_UNSTARTABLE_MCP sets, and the new HarnessAdapter hooks default to the old behaviour. can_restore_session gives the same answer as the inline code it replaces. Checked: every permission request that passes the earlier refusals reaches _refuse_by_harness, and the only approval path, approve_tool, records the yes after the answer is written. The runtime is marked dead before kill(), which matches how the ownership gate counts leases (dead runtimes' leases are excluded). The new behaviour is covered by tests and CI is green.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 5dc27e6173 · 1366 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 15, 2026
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 15, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/deepseek-harness branch 2 times, most recently from 835635f to c7331e3 Compare November 15, 2026 18:24
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 15, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 15, 2026
@chenmingwei23
chenmingwei23 enabled auto-merge (squash) November 15, 2026 20:44
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 15, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. The review found one test-determinism problem that needs a fix before this can merge.

  1. test/test_deepseek_shared_runtime.py:364 (also the tripwire tests at about lines 350, 404 and 506). These tests call _refuse_moved_permission_state without stubbing sel_module.sel, so each one writes a real audit row through the background sel-writer thread. After test_a_cancel_during_the_kill_still_leaves_the_runtime_dead_and_killed returns, that thread is still importing kiro_crew.security.redaction_structured.engine. The next redaction on the main thread gets the partly initialised module, and compat._load then marks redaction as failed for the rest of the worker. Trigger: run this file and then test/test_acp_runtime_permission_trust.py in one worker, in that order (pytest -n0 test/test_deepseek_shared_runtime.py test/test_acp_runtime_permission_trust.py). Outcome: test_shared_permission_event_carries_redaction_provenance_without_secret and test_fidelity_unaware_consumer_gate_rejects_and_audits fail on every run. In the reverse order everything passes. Under -n auto this can red unrelated PRs, and it breaks the tests-are-deterministic rule. Smallest fix: add one fixture in this file that stubs sel_module.sel for every test that reaches _refuse_moved_permission_state, the same way test_a_trip_is_audited_as_the_call_that_ran_not_as_a_mode_change already does. With that fixture in place, the two-file run passed 45 of 45 on every attempt.

Optional:

  • test_only_a_written_yes_records_an_approval checks the approve hook only through source text. If the hook moves into the finally block, or records on another session's ledger, every covering test still passes. A behavioural test on a real handle would pin it: approve then completed does not trip; GrantEnded then completed trips; approving A leaves B's ledger unchanged.
  • No spec under docs/system-specs/ covers the new session/resume restore verb, gate_tripwire_issue, or the rule that one chat's trip ends the whole process (acp-client.md and agent-host-contract.md). Either update them here, or say in the body that #37646 owns the docs.
  • The Backwards compatibility section names note_permission_rejected, but the hook this diff adds is note_permission_approved. You can fix that with a body edit.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 15, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Fixed in a1b891a: test/test_deepseek_shared_runtime.py now has an autouse fixture that stubs sel_module.sel with a no-op audit log, so no test in the file starts the background sel-writer thread; the audit-row test still installs its own recorder over it. pytest -n0 test/test_deepseek_shared_runtime.py test/test_acp_runtime_permission_trust.py failed 2 of 45 before and passes 45 of 45 on three runs after. The Backwards compatibility line now names note_permission_approved. @KiroCrewCaptain please re-review.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 15, 2026
…ion gate ledger (not routed)

One dsh --profile acp process serves several sessions: dsh 0.2.0-rc.2
runs their turns in parallel, mounts each session's MCP servers on that
session alone, and restores a closed session with session/resume.

DeepseekHarness runs DeepseekLaunch's own spawn (sealed plugin, --patch
overlay, read-back probe) once per process, against a stand-in carrying
the runtime's extra_env, agent.env snapshot and work dir. The nonce and
the pinned mode ride the new SpawnPlan.child_env, so the harness keeps no
state; the vault key is read in apply_spawn_env, off the loop.

The completed-unasked tripwire keys on each session's own ledger: an ask
is recorded through permission_refusal, a no through the new
note_permission_rejected hook on the handle's reject path, and a
tool_call_update is judged through session_update_issue. A call past the
gate fails the runtime (permission_state_issue_ends_process), since the
gate is the process's.

The shared runtime reads sessionCapabilities.resume and sends
session/resume for ACP_BACKENDS_RESUME_WITHOUT_LOAD, and accepts a
restore answer without modes for ACP_BACKENDS_LOAD_WITHOUT_MODES, as
AcpClient does. Registered ahead of routing: no session takes this path.
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

5dc27e6: the audit stub fixture now patches through _floor_monkeypatch (D11) instead of the shared monkeypatch, which Semgrep test-autouse-shared-monkeypatch flagged. Same fix otherwise; the two-file run still passes 45 of 45. @KiroCrewCaptain please re-review this head.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 15, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This head fixes the earlier blocking item. The new autouse fixture stubs the audit log through _floor_monkeypatch, and the order-dependent two-file run (-n0 test_deepseek_shared_runtime.py test_acp_runtime_permission_trust.py) passed 45 of 45 on two runs in a row. The earlier body item is fixed: Backwards compatibility now names note_permission_approved. The other two earlier items were optional, and they are still open below.

The review checked the whole source diff against the hosts that are routed today (kiro, kas, codex). can_restore_session gives the same answer as before outside RESUME_WITHOUT_LOAD. The prune, session/resume and load-without-modes branches fire only for sets that hold no backend in ACP_BACKENDS_ACP_RUNTIME. SpawnPlan.child_env is empty for every other host. The ratchet edits re-pin counts to their true values and do not loosen them. Removing the prune gate or the modes check makes the tests fail. Done well: the ledger records Crew's yes rather than its refusals, so every way a request can end without approval counts as not approved, and each session keeps its own ledger, so a reused id like call_0 in one chat cannot vouch for another.

Security: the trust-boundary changes (the per-session gate ledger, the process kill on a trip, the vault key in the child env) do nothing yet, because no session is routed to DeepseekHarness. On the deepseek arm, every approve path goes through approve_tool after _refuse_by_harness has recorded the ask. _mark_dead before kill() gets through the ownership gate and still refuses a live tenancy. The vault read runs in the off-loop env hop, and READ_ONLY auto-approve fails closed on the runtime path.

The design is signed off under the standing maintainer sign-off for changes by team members.

Optional:

  • Before #37646 routes deepseek, add a behavioural test of the approve hook on a real handle. Approve then completed should not trip. GrantEnded then completed should trip. Approving in A should leave B's ledger alone. Moving the hook into finally still passes every current test. You could also record the approval in the before_write hook, so it can never land after dsh reports the call completed.
  • The Documentation checkbox is ticked, but no spec changed. runtime-ownership.md still says every kill path releases before it signals, and the acp-client.md module row still lists only ProcessAdapters. Neither spec mentions session/resume on the runtime. The _refuse_moved_permission_state docstring still says only the session closes. Update them, or name the PR that owns the update.
  • SpawnPlan.child_env adds a field to the shared spawn seam for one consumer. Keeping the resolved launch on the harness and applying it in apply_spawn_env, as CodexHarness does, would remove that field.

@chenmingwei23
chenmingwei23 merged commit c363397 into main Nov 15, 2026
100 checks passed
@chenmingwei23
chenmingwei23 deleted the feat/deepseek-harness branch November 15, 2026 23:22
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants