deepseek-harness/scripts
Tianyi Cui 1d43ea3cd5 workflow: dynamic workflows — script-driven multi-agent orchestration
A new capability family at packages/workflow/ in the bash seam shape,
modeled on Claude Code's dynamic workflows: the model writes a JavaScript
orchestration script (export const meta = {...} + plain-JS body), a runtime
executes it, and the script — not the conversation — holds the loop, the
branching, and the intermediate results.

- dsh-workflow (ctx.workflows): abstract WorkflowService + run vocabulary
  (WorkflowRun whose result NEVER rejects) + observe-only workflow/* events
  carrying data snapshots (id + meta, never the live run), per-listener
  contained like subagent/*.
- dsh-workflow-vm: in-process node:vm engine. Meta extraction via a
  string/comment-aware scanner (template interpolation rejected; literal
  evaluated alone in an empty timed context; statement blanked line-
  preservingly so stacks keep script line numbers). Hooks: agent(prompt,
  {label, phase, schema, model}) over ctx.subagents, parallel(), pipeline()
  (no cross-stage barrier), phase(), log(), args. Fatal-vs-null discipline:
  hook misuse (unknown/deferred options, bad arguments, unsupported
  schemas, tripped caps, seam start failures, cancellation) throws fatal
  WorkflowErrors the combinators RE-THROW — never dissolved into the
  per-item null reserved for child failures. Realm boundary: inbound values
  materialized by descriptor walks that never invoke accessors (defineProperty
  copies, __proto__-safe); outbound values rebuilt in-realm via the
  context's own JSON.parse. Determinism bans (Date.now/Math.random/argless
  new Date) kept so future resume support cannot break scripts. Caps and
  timeouts are validated Config. Every hook promise carries a no-op
  rejection consumer (app-boot exits on unhandled rejections).
- dsh-tool-workflow: the model-facing workflow tool, synchronous like
  dsh-tool-subagent (start → await → try/finally dispose; abort bridged;
  non-completed → isError). Generic render card titled by a textual
  meta.name sniff. The tool description carries the authoring contract.

Wired into examples/{coding-agent,acp-agent} with explicit-ask-only
guidance. Coverage at every tier: unit (meta scanner, materializer incl.
counting-getter and __proto__ regressions, combinator semantics,
concurrency ceiling, caps, cancellation, no-unhandled-rejection abandon),
integration over the real spawn stack, with-key e2e (real two-phase run +
the tool through the registry pipeline), and a recorded ACP snapshot
scenario (workflow-run, 1 child session). RFC:
docs/rfc/implemented/feature/2026-07-05-dynamic-workflows.md (deferred
work explicitly listed). AGENTS.md budget 1575 → 1590 for the new group's
layout line.
2026-07-05 13:29:35 +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 scripts: ignore local artifacts in constraints 2026-07-04 00:57:35 +08:00
doc-budgets.manifest.json workflow: dynamic workflows — script-driven multi-agent orchestration 2026-07-05 13:29:35 +08:00
doc-typecheck.ts Add generated persistence log event catalog with freshness + completeness gates 2026-07-04 22:58:28 +08:00
gen-cordis-catalog.ts Split the cordis catalog into separate events and services documents 2026-07-05 00:45:06 +08:00
gen-module-graph.ts Reorganize packages into a modular hierarchy 2026-06-20 22:55:20 +08:00
gen-persistence-catalog.ts Split the cordis catalog into separate events and services documents 2026-07-05 00:45:06 +08:00
gen-rfc-index.ts feat(scripts): generate the RFC index tables from the tree 2026-07-04 14:47:51 +08:00
gen-tool-catalog.ts workflow: dynamic workflows — script-driven multi-agent orchestration 2026-07-05 13:29:35 +08:00
install-lefthook.mjs fix(dev): make hooks and bash seams safer 2026-06-17 21:26:44 +08:00
publint-all.ts scripts: lint only package directories 2026-07-04 00:54:31 +08:00
rfc-index.ts fix(scripts): enforce the invariants the index gate claims 2026-07-04 15:10:22 +08:00
translation-pairing.manifest.json Add generated persistence log event catalog with freshness + completeness gates 2026-07-04 22:58:28 +08:00
type-equiv.manifest.json workflow: dynamic workflows — script-driven multi-agent orchestration 2026-07-05 13:29:35 +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 docs(rfc): classify RFCs by kind via path-encoded subdirectories 2026-06-20 22:29:45 +08:00
verify-md-links.ts docs: bilingual docs contract, translation skill, and pairing gate 2026-07-02 23:12:25 -07:00
verify-md-wrap.ts docs(AGENTS): rewrite the root standing orders to the 1,500-word budget 2026-07-04 14:22:47 +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 review findings: don't treat disabled entries as load failures; scope the verify-package-paths lib skip to a real package root 2026-06-21 19:47:22 +08:00
verify-rfc-classification.ts feat(scripts): generate the RFC index tables from the tree 2026-07-04 14:47:51 +08:00
verify-translation-pairing.ts docs: equal-authority pairing with sidecar consistency records 2026-07-03 07:41:24 -07:00
verify-type-equiv.ts Reorganize packages into a modular hierarchy 2026-06-20 22:55:20 +08:00