deepseek-harness/scripts
Tianyi Cui b59d245c7c feat: Code Mode — the registry's mode config, the SDK codegen, and the run_code bridge
The dsh-tools half of the Code Mode RFC (its fourth, final change): the
registry gains its first config — mode: native | code | both — and OWNS how
its tools reach the model. 'code' contributes exactly one wire tool,
run_code, plus a lazy tools:sdk prompt section declaring every other tool
as a generated TypeScript API (jsonSchemaToTs: total over the defineTool
subset, unknown degradation, lexicographic byte-identical rendering);
'both' ships both representations; 'native' is byte-for-byte the old
behavior. Non-native modes fail every assembly loudly without a
typescript-language ctx.codeRuntime.

run_code's dispatch bridge: JSON-normalizes each binding argument before
dispatch (what dispatches is what the tool/code-dispatch event logs — the
append can never fail on payload shape; BigInt/circulars reject that one
call), serializes all program tool calls through a per-run queue (even
Promise.all — no concurrency-safety metadata yet), routes every sub-call
through tools/pre-execute → tools/post-execute (a deny rejects the
program-side promise), drops sub-call additionalContext (no safe outlet
mid-run; pinned), owns a run-scoped abort that follows the outer signal in
and fires on settlement (in-flight sub-dispatch aborted, queued abandoned,
queue drained before returning), and converts a failed run into
CodeRunFailedError → a structured isError carrying kind + captured logs.
tool/code-dispatch joins SessionEventMap by declaration merging (log-only;
deriveMessages ignores it).

The composed surface: the tools config forwards through agent-core and
both app packages; examples/code-agent + demo:code run the worker runtime
under mode code (keyless boot smoke + a with-key e2e proving the collapsed
[run_code] header, the dispatch events, and the file the program wrote);
two new snapshot scenarios (code-mode-turn, both-mode-turn) record the SDK
section, collapsed header, dispatch events, and result card — each its own
header-pinning class (the harness gains per-scenario config overlays and
per-class pins). Catalogs, graphs, cookbook, hooks-bridge notes, and the
RFC (moved to implemented/, restructured to decision-era headings) updated
in the same change.
2026-07-08 12:58:23 +08:00
..
check-vendor-manifest.sh Add lefthook git hooks with a vendor-manifest guard 2026-06-11 15:07:55 +08:00
check-workspace-constraints.ts feat: add the worker-thread code runtime (dsh-code-runtime-worker) 2026-07-08 11:07:14 +08:00
doc-budgets.manifest.json feat: add the code-execution capability seam (ctx.codeRuntime) 2026-07-08 02:17:24 +08:00
doc-typecheck.ts fix(scripts): replace async fs glob with globSync (failed on Node 22.18) 2026-07-07 17:15:41 +08:00
gen-config-catalog.ts Merge remote-tracking branch 'origin/master' into worktree-export-jsdoc-gate 2026-07-07 09:34:12 +08:00
gen-cordis-catalog.ts docs: catalog the code-runtime seam vocabulary (Codex review finding) 2026-07-08 02:38:47 +08:00
gen-doc-graphs.ts feat: Code Mode — the registry's mode config, the SDK codegen, and the run_code bridge 2026-07-08 12:58:23 +08:00
gen-module-graph.ts docs: revise graph docs from review 2026-07-05 01:25:58 +08:00
gen-persistence-catalog.ts docs: flatten single-file catalog dirs to docs/tool-catalog.md and docs/persistence-catalog.md 2026-07-06 22:26:06 +08:00
gen-rfc-index.ts docs(rfc): define and enforce a uniform RFC format; adopt it across the corpus 2026-07-05 22:58:25 +08:00
gen-tool-catalog.ts feat: Code Mode — the registry's mode config, the SDK codegen, and the run_code bridge 2026-07-08 12:58:23 +08:00
install-lefthook.mjs fix(dev): make hooks and bash seams safer 2026-06-17 21:26:44 +08:00
jsdoc.ts Merge remote-tracking branch 'origin/master' into worktree-export-jsdoc-gate 2026-07-07 09:34:12 +08:00
publint-all.ts chore: parallelize pre-push gates 2026-07-06 00:52:00 +08:00
rfc-index.ts docs(rfc): define and enforce a uniform RFC format; adopt it across the corpus 2026-07-05 22:58:25 +08:00
run-gates.ts feat: add the worker-thread code runtime (dsh-code-runtime-worker) 2026-07-08 11:07:14 +08:00
translation-pairing.manifest.json fix: retarget the i18n pairing exclusions to the flattened catalog paths 2026-07-07 00:08:55 +08:00
type-equiv.manifest.json docs: catalog the code-runtime seam vocabulary (Codex review finding) 2026-07-08 02:38:47 +08:00
verify-doc-budgets.ts docs(budgets): ceilings carry at least 5% working headroom 2026-07-04 17:20:18 +08:00
verify-doc-refs.ts fix(scripts): replace async fs glob with globSync (failed on Node 22.18) 2026-07-07 17:15:41 +08:00
verify-export-jsdoc.ts fix review findings: CI leaf-gate wiring, heritage return surface, AGENTS.md self-containedness 2026-07-07 20:30:34 +08:00
verify-md-links.ts fix(scripts): replace async fs glob with globSync (failed on Node 22.18) 2026-07-07 17:15:41 +08:00
verify-md-wrap.ts fix(scripts): replace async fs glob with globSync (failed on Node 22.18) 2026-07-07 17:15:41 +08:00
verify-mermaid.ts fix(scripts): replace async fs glob with globSync (failed on Node 22.18) 2026-07-07 17:15:41 +08:00
verify-node-next-types.ts docs: update rewriteRelativeImportExtensions to current rfc 2026-06-22 09:03:28 +08:00
verify-package-paths.ts fix(scripts): replace async fs glob with globSync (failed on Node 22.18) 2026-07-07 17:15:41 +08:00
verify-rfc-classification.ts docs(rfc): define and enforce a uniform RFC format; adopt it across the corpus 2026-07-05 22:58:25 +08:00
verify-rfc-format.ts docs(rfc): address Codex review — fence-aware format gate, exact corpus counts 2026-07-05 23:45:34 +08:00
verify-translation-pairing.ts fix(scripts): replace async fs glob with globSync (failed on Node 22.18) 2026-07-07 17:15:41 +08:00
verify-type-equiv.ts fix(scripts): replace async fs glob with globSync (failed on Node 22.18) 2026-07-07 17:15:41 +08:00