Commit Graph
1379 Commits
Author SHA1 Message Date
Tianyi Cui cf255eebb1 fix(scope): harden merged tool and skill boundaries 2026-07-11 23:41:37 +08:00
Tianyi Cui 172005e0e6 fix(scope): align merged agent event contracts 2026-07-11 23:22:57 +08:00
Tianyi Cui 56e34619d7 Merge remote-tracking branch 'origin/master' into codex/pr224-rfc-rewrite
# Conflicts:
#	docs/architecture.md
#	docs/capability-seams.md
#	docs/config-catalog.md
#	docs/cookbook/extension-cookbook.md
#	docs/cordis-catalog/events.md
#	docs/cordis-catalog/services.md
#	docs/event-producer-consumer.md
#	docs/module-graph.md
#	docs/rfc/implemented/feature/2026-06-30-interception-seams.md
#	docs/rfc/proposed/feature/2026-06-14-acp-agent-client-protocol.md
#	docs/tool-execution-pipeline.md
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/core/agent-core/README.md
#	packages/core/agent-loop/README.md
#	packages/core/tools/README.md
#	packages/core/tools/src/index.ts
#	packages/core/tools/tests/tools.spec.ts
#	packages/core/tools/tsconfig.json
#	packages/ui/acp/src/index.ts
#	scripts/doc-budgets.manifest.json
#	scripts/gen-cordis-catalog.ts
#	scripts/gen-doc-graphs.ts
2026-07-11 23:14:09 +08:00
Tianyi Cui 36c94fbe3e docs: align the agent-scope contracts 2026-07-11 22:55:40 +08:00
Tianyi Cui 3263dab822 fix(core): enforce agent-scoped ownership boundaries 2026-07-11 22:55:26 +08:00
Tianyi Cui 7331720c8a Merge pull request #109 from deepseek-harness/codex/skill-system
Add skill registry and local provider
2026-07-11 22:35:05 +08:00
Tianyi Cui 3baaecc078 Merge remote-tracking branch 'origin/master' into codex/skill-system
# Conflicts:
#	docs/rfc/INDEX.md
#	examples/acp-agent/tests/snapshots/both-mode-turn/session.jsonl
#	examples/acp-agent/tests/snapshots/code-mode-turn/session.jsonl
#	examples/acp-agent/tests/snapshots/text-turn/session.jsonl
#	packages/README.md
2026-07-11 22:31:28 +08:00
Tianyi Cui 28f7fa0969 docs(rfc): record deferred skill extensions 2026-07-11 22:18:58 +08:00
Tianyi Cui 9b4ce4f301 Merge pull request #169 from deepseek-harness/feat/sandbox-support
feat(sandbox): file-sandboxed bash execution — sandbox seam + approval seam + escalation + per-session mode switching over ACP config options
2026-07-11 22:17:15 +08:00
Tianyi Cui 0d23d95dde docs(sandbox): record follow-up boundaries 2026-07-11 22:07:56 +08:00
Tianyi Cui 1e2d8014a5 Merge remote-tracking branch 'origin/master' into feat/sandbox-support
# Conflicts:
#	packages/workflow/workflow-workerthread/tests/workflow-workerthread.spec.ts
2026-07-11 21:43:10 +08:00
Tianyi Cui b29a8eca71 fix(review): reconcile sandbox and approval contracts 2026-07-11 21:37:38 +08:00
Tianyi Cui 1b1384c8b8 Merge branch 'master' into codex/skill-system 2026-07-11 21:27:17 +08:00
Tianyi Cui 850796bb35 fix(tools): reserve the Code Mode transport 2026-07-11 20:47:45 +08:00
Tianyi Cui fc0357a100 Merge remote-tracking branch 'origin/master' into codex/pr224-rfc-rewrite
# Conflicts:
#	docs/architecture.md
#	docs/event-producer-consumer.md
#	docs/module-graph.md
#	scripts/doc-budgets.manifest.json
#	scripts/gen-doc-graphs.ts
2026-07-11 20:38:25 +08:00
Tianyi Cui 6091c0a3dc docs: rewrite the agent-scope RFC 2026-07-11 14:01:49 +08:00
Tianyi Cui ee3e4ea8f9 Merge pull request #245 from deepseek-harness/fix/subagent-acp-onerror-containment
fix(subagent-acp): contain onError sink exceptions to keep result from rejecting
2026-07-10 23:33:03 +08:00
Tianyi Cui a8b68e1303 Merge branch 'master' into fix/subagent-acp-onerror-containment 2026-07-10 23:31:17 +08:00
Yichen Jiang 386d4d3ec4 Merge branch 'master' into codex/skill-system 2026-07-10 22:58:15 +08:00
Tianyi Cui ee15a01f61 Merge pull request #252 from deepseek-harness/eslint-project-service
chore(lint): one shared project service; ignore harness-local .claude state
2026-07-10 22:52:21 +08:00
Tianyi Cui dce2945211 Merge branch 'master' into eslint-project-service 2026-07-10 22:50:28 +08:00
Tianyi Cui feb457d425 Merge pull request #236 from deepseek-harness/codex/mock-snapshot-rerecord
Add keyless snapshot refresh mode
2026-07-10 22:36:48 +08:00
Tianyi Cui 65587c6091 Merge remote-tracking branch 'origin/master' into codex/mock-snapshot-rerecord
# Conflicts:
#	packages/workflow/workflow-workerthread/tests/workflow-workerthread.spec.ts
2026-07-10 22:19:18 +08:00
kingwl 53f6a959e2 chore(lint): one shared project service; ignore harness-local .claude state
Two independent multipliers were pushing bare `pnpm run lint` past node's
default heap:

1. parserOptions.project expanded to every package tsconfig plus the root
   one — each matched config built its OWN ts.Program, and the dev paths
   map pulls sibling package SOURCES (plus the vendored Cordis stack) into
   every such program, so resident memory grew as sum-of-closures, not
   repo size: ~4.6 GB peak for 425 repo files. projectService shares one
   tsserver-style graph: ~2.0 GB peak, ~28 s → ~14 s wall.

2. `eslint .` traversed .claude/ harness-local state — stale worktree
   checkouts there carry tens of thousands of additional .ts files
   (whole-repo copies), roughly tripling the work again even under the
   project service. Other checkouts are not this one's sources; ignore
   them like node_modules. (#169 carries the identical ignore line inside
   its chain; the hunks dedupe on its next rebase.)

Type-aware rules verified live under the service: a floating-promise
probe still trips no-floating-promises.
2026-07-10 22:13:40 +08:00
Yichen Jiang e4be19b29e Merge remote-tracking branch 'origin/master' into codex/skill-system
# Conflicts:
#	packages/workflow/workflow-workerthread/tests/workflow-workerthread.spec.ts
2026-07-10 21:10:58 +08:00
Tianyi Cui afb0a2b5cd Merge pull request #246 from deepseek-harness/fix/workflow-workerthread-waitfor
test(workflow-workerthread): flake-proof the lifecycle spec's waits under CI load
2026-07-10 21:05:58 +08:00
pku-xht dd2f37b80f fix(workflow-workerthread): tighten post-result promptness waits back down
Review follow-up: the blanket 10s default correctly targets worker-thread
cold-start races (starting, first-script-line, async child-registration
messages — genuinely CPU-bound under CI contention), but four waits assert
something different — that the HOST reacted PROMPTLY to an event that
already happened (a settled result, an observed worker death). Those had no
cold-start left to wait on, so the generous default just widened the window
a real regression could hide in.

Verified by injecting a 6s delay into the settle-reap's abort call: the
un-overridden helper's test still passed in ~6s. The same mutation now fails
in ~1s with the explicit 1000ms override restored on all four sites (the
abort-on-settle test's own assertion, the two worker-death cancel/dispose
reap checks, and the dispose-ack-race check). The other 12 waits keep the
10s default — they run BEFORE a result is awaited, waiting on the worker to
actually start rather than on a host reaction. Doc comment corrected to
describe the split instead of claiming every wait is a cold-start race.
2026-07-10 20:48:14 +08:00
Yichen Jiang c2c238d36d fix(skill): forward cancellation to local reads 2026-07-10 17:47:28 +08:00
Yichen Jiang 0b20353424 test(acp): clarify skill snapshot fixture 2026-07-10 17:47:11 +08:00
pku-xht 64b4e2ed2d test(workflow-workerthread): flake-proof the lifecycle spec's waits under CI load
The spec's 16 vi.waitFor sites used the 1s default timeout to wait for
worker-thread startup and child registration — CPU-bound work that blows
past 1s on a contended runner. The CI coverage lane (4 vitest workers plus
suites that spawn real subprocesses) hit this 3 times across 4 recent PR
runs, each a different subset of the cancellation/worker-death tests, each
green on rerun.

Every wait now goes through a shared helper with a 10s bound, and the file
sets a 30s test timeout to make room for it. The one deliberately tight
wait keeps its 800ms bound through the helper's override — it proves the
host (not the wedged worker's later loop turn) delivered the cancel, so a
generous bound would erase what it tests. No behavior under test changed.
2026-07-10 16:43:41 +08:00
pku-xht 62627d7625 fix(subagent-acp): contain onError sink exceptions to keep result from rejecting
spec.onError is a caller-supplied callback boundary, but the flattening
catch invoked it unguarded: a throwing sink rejected the whole async result,
breaking the seam's "result never rejects on a child-level failure"
contract (and docs/defensive-patterns.md's contain-callback-exceptions
rule). The sink's own throw is now swallowed — named as such — while the
original child failure still settles as stopReason 'error'. Regression test
drives a spawn failure through a throwing sink and asserts result resolves.

Same defect as the codex backend's, fixed there on PR #240; this is the
symmetric fix for the already-merged ACP backend.
2026-07-10 16:42:20 +08:00
kingwl 6a13dcb364 test(workflow): give the wedged-child waitFors loaded-runner headroom
The three wedged-child scenarios busy-spin their worker for 1.5s while the
host waits for the start RPC; under a loaded 2-core CI runner (this branch
adds several parallel suites) the RPC lands after vi.waitFor default 1s,
failing the coverage lane three runs in a row at the same three sites. An
explicit 10s waitFor timeout (well inside each test own 15s budget) makes
the assertions load-tolerant without weakening them. Belongs upstream with
dsh-workflow-workerthread; carried here because it gates this PR.
2026-07-10 15:44:38 +08:00
kingwl ca39fd89b0 feat(example): sandbox-acp-agent — the live composition; RFCs to implemented
The three-entry cordis.yml (dsh-sandbox-local + dsh-bash-sandbox at a
read-only default + dsh-approval) served over ACP: the first live approval
composition. Recorded snapshot scenarios pin the wire end to end —
config-options advertisement, the mode-switching arc as the suite pinned
header (both switches, the prompt-section delta, one changed-by-the-user
notice per knob, a confined write landing under the switched mode), and
both escalation branches over scripted permissionAnswers (a grant runs
confined under workspace-write; a rejection executes nothing and pins the
fail-closed text). The with-key escalation e2e drives a real model +
real runner + the real bridge answerer, world-verified; ci.yml snapshot
lane and e2e.yml install bubblewrap so the confined replays actually
execute.

Both RFCs move to implemented/ (Decision/Consequences form, deferred
phases tracked in their own sections), with every cross-reference flipped.
2026-07-10 15:44:38 +08:00
kingwl 3f663c9154 feat(modes): per-session sandbox/approval switching — the session log as the store, ACP config options
effective(session) = findLast(the session own knob events)?.value ?? the
composition-config default. One log-only event per knob, owned by its
domain (bash/sandbox-mode in dsh-bash, approval/policy in dsh-approval),
each exporting the same three-piece kit: the event declaration, a pure
fold, and THE write path — a switch IS its event; no owner service, no
facts map. Restart immunity and multi-session isolation fall out of the
log replay by construction.

Execution follows the fold on both sides: the bash tool stamps
escalation grant > session override > executor default, and the approval
seam prepends the never-gate that auto-rejects before any interactive
answerer. Visibility is two layers per knob: a per-agent prompt section
states the effective value on every request (logged through
request/header*, so what-the-model-was-told replays from the log), and an
agent/pre-step narrator injects at most one coalesced delta notice with
positional attribution (user switch vs operator/config drift). The ACP
bridge advertises one capability-gated select per composable knob with
currentValue folded per session, validates set_config_option against the
closed vocabularies, and anchors idle switches at the next turn
prompt-submit under the turn-enclosure contract.
2026-07-10 15:44:38 +08:00
kingwl 0e49615a3d feat(tool-bash): sandbox escalation — one approved wider retry after a denial
The tool gate advertises sandbox_permissions (an enum of exactly the modes
STRICTLY WIDER than the mounted executor default — the schema makes a
non-widening request inexpressible) plus a required justification, exactly
when ctx.bash.sandboxMode reports a confining mode at registration:
composition truth, never a dead lever. An escalating call resolves
ctx.approval BEFORE anything executes with the audit-self-contained reason
"escalate sandbox to <mode>: <justification>"; allowed-once stamps the
granted mode onto that one bash request (the seam-level per-call override),
while rejected / cancelled / unavailable and the no-service / no-agent
paths each fail closed with their own error text and execute nothing. The
description teaches the flow only when the fields exist: retry the SAME
command once after a real denial, never preemptively; a rejected
escalation is final. No new session events: the attempt is an ordinary
tool/call, the decision is the approval audit pair, the outcome an
ordinary tool/result whose facts name the mode it ran under.
2026-07-10 15:43:28 +08:00
kingwl 2eed448acf feat(bash): the sandboxed executor — per-call policy carrier, denial facts, runner-failure classification
dsh-bash grows the per-call policy carrier: BashExecRequest.sandboxMode
(request-optional, spec required-but-nullable — the owner pattern; resolve()
is the one explicit defaulting step) and the BashExecutor.sandboxMode
capability fact (undefined in the base class — composition truth the tool
layer can read). dsh-bash-local carries the field verbatim and confines
nothing.

dsh-bash-sandbox extends LocalBashExecutor and hands ctx.sandbox the exact
argv it is about to spawn. A denial is a RESULT FACT (the command RAN;
result.sandbox.denied is orthogonal to exitCode/signal), classified
conservatively against the wrap own dialect; a RUNNER failure outranks
denial — foreground re-throws the structured SANDBOX_UNAVAILABLE, a settled
background task stamps sandbox.runnerFailed — so a broken sandbox never
reads as a failing command and the command never runs unconfined.
dsh-tool-bash renders the markers and teaches the model not to retry around
a policy denial; escalation and per-session switching are staged follow-ups.
2026-07-10 15:43:02 +08:00
kingwl 7b8c3a9b40 feat(sandbox): the confinement seam and the per-platform native runner chains
ctx.sandbox (dsh-sandbox): confine(argv, policy) returns the argv to spawn
instead — wrapped so the process and its children run confined — plus the
enforcement completeness and the backend denial/runner-failure dialects;
no usable backend throws the fail-closed SANDBOX_UNAVAILABLE. Policy rides
per call. dsh-sandbox-local selects by platform and caches the verdict:
multi-candidate chains probe FUNCTIONALLY in preference order (Linux:
bwrap → the registry-installed node-addon-landlock-run launcher), a sole
candidate is selected unprobed (darwin: sandbox-exec/Seatbelt) and fails
closed at execution via runnerFailureSignatures; win32 is a reserved empty
chain. Profile parity is honest per backend (documented temp-area and ABI
differences; enforcement full|partial is a structured result fact).

CI: the sandbox-e2e matrix proves real-kernel confinement per rung (bwrap,
Landlock per architecture through the registry-installed launcher,
Seatbelt), failing on a silent all-skip; the packed-install rehearsal
installs the launcher family from the registry and asserts the binary
executable apart from kernel enforcement.
2026-07-10 15:43:02 +08:00
kingwl 80d8726601 feat(acp): the bridge approval answerer + scripted permission answers
The ACP bridge registers the first real approval answerer: an ask for an
agent it owns becomes session/request_permission attached to the already-
streamed tool call (one-shot allow_once/reject_once only), outcomes map
conservatively (unknown optionId never grants, client cancel → cancelled),
and foreign or call-less requests delegate down the waterfall. The snapshot
harness accepts scripted permissionAnswers (FIFO; an unscripted prompt
answers cancelled, fail closed) so recorded scenarios can drive the wire
keylessly.
2026-07-10 15:43:02 +08:00
kingwl ef35007d75 feat(approval): the approval seam — one-shot permission decisions over a waterfall of answerers
ctx.approval (dsh-approval): request() dispatches the approval/request
waterfall and always resolves a closed outcome — allowed-once / rejected /
cancelled / unavailable — never rejects; zero listeners fall through to
fail-closed unavailable; abort settles cancelled and discards late answers;
throwing or rogue answerers are contained as unavailable; every ask lands
the log-only approval/asked / approval/decided audit pair. dsh-tools routes
a pre-execute ask through the seam opportunistically (ctx.get) with three
distinct deny reasons, keeping the historical ask→deny degrade when the
seam is absent.

The per-session policy tier, the ACP bridge answerer, and the sandbox
escalation asker are staged follow-ups of the approval-seam RFC.
2026-07-10 15:43:02 +08:00
Yichen Jiang b5b17a7f65 fix(ci): stabilize static and coverage gates 2026-07-10 15:21:22 +08:00
Yichen Jiang 680ae53bb6 Merge remote-tracking branch 'origin/master' into codex/skill-system
# Conflicts:
#	docs/architecture.md
#	docs/config-catalog.md
#	docs/module-graph.md
#	docs/rfc/INDEX.md
#	examples/acp-agent/tests/snapshots/text-turn/session.jsonl
#	packages/core/agent-core/src/index.ts
#	packages/core/tools/tests/gen-tool-catalog.spec.ts
#	packages/support/acp-snapshot/src/suite.ts
#	packages/ui/acp-agent/src/index.ts
2026-07-10 14:43:33 +08:00
Yichen Jiang 6292d52236 feat(skill): move catalogs into session prefixes 2026-07-10 14:19:06 +08:00
Tianyi Cui 42ebbfdf8f Merge pull request #217 from deepseek-harness/feat/subagent-process
feat(subagent): extract dsh-subagent-process shared out-of-process machinery
2026-07-10 10:15:52 +08:00
pku-xht 3eea868a1b Merge branch 'master' into feat/subagent-process 2026-07-10 10:05:01 +08:00
kingwl 7afdc6e3b9 docs(rfc): escalation targets are a closed static vocabulary; strict widening moves to an execution-time check (review blocker)
The default-relative ladder conflicts with per-session overrides: schemas
are registry-global while the effective mode is switchable, so a session
overridden NARROWER than the default loses exactly the lever it needs — a
workspace-write default with a read-only override could only request
danger-full-access (forced over-escalation), and a danger-full-access
default with a read-only override advertised no fields at all (confined,
no escalation path). The enum now pins the closed target vocabulary
(workspace-write / danger-full-access) whenever the executor confines;
strict widening is enforced per call against the session effective mode
(override ?? default), failing closed without prompting anyone. The
default-relative ladder and per-session dynamic schemas move to
Alternatives; the harmless Risks claim is corrected to name the runtime
check as the safety boundary.
2026-07-10 02:34:11 +08:00
kingwl d3a833fc4a docs(rfc): speak of the staged example and recordings at plan-time tense (review)
The proposed forms claimed examples/sandbox-acp-agent, its recorded
scenarios, and the approval servicing of ask as already existing; a reader
of this docs-only change would look for a composition and goldens that are
not in the tree. Usage walkthroughs now name the arc the staged scenarios
are to record, both Testing sections open with the plan-time banner, and
the grounding bullet states todays degrade honestly.
2026-07-10 02:34:11 +08:00
kingwl 3191cb9404 docs(rfc): propose the approval seam and the subprocess sandbox 2026-07-10 02:33:22 +08:00
Tianyi Cui af242dbae5 Preserve snapshot refresh seed boundaries 2026-07-10 01:04:06 +08:00
Tianyi Cui 5f7177a0a9 Stabilize workflow worker coverage wait 2026-07-10 00:55:47 +08:00
Tianyi Cui 9d2cf8ce82 Add keyless snapshot refresh mode 2026-07-10 00:48:27 +08:00