KodaX workflow parity contract

August 13, 2026 ยท View on GitHub

This document is the acceptance matrix for @dsh-external/workflow. It records behavior, not copied implementation. KodaX is the design reference; the plugin is an independent DSH/Cordis implementation.

Capability familyKodaX reference behaviorDSH plugin contract
Workflow moduleMetadata plus run(wf, args)Same authoring model for restricted capsules and trusted-local modules
CapsuleVersioned JSON, source, manifest, intent, inputs, requirements, provenancedsh.workflow v1 with the same information classes and DSH version provenance
Restricted runnerStatic host-API policy, isolated capability RPC, sync/wall timeout, JSON boundary, deterministic clock/randomnessQuickJS/WASM separate heap, JSON-only host bridge, CPU/wall/memory/stack limits, deterministic guards, and bridge shutdown on timeout
Trusted-local runner.ts/.mjs/.js, distinct trust class, confirmationSame suffixes and explicit one-shot DSH approval before host execution
WorkflowApi identityrunId, args, budget viewSame
Agent task APIspawn, run, wait, snapshot/output, send, stopSame, adapted to ctx.subagents; runAgent isolates ordinary terminal failure as null, while handle-based wait retains the complete result; unsupported provider features fail before launch
Agent request metadataname/phase/prompt/scope/constraints/readOnly/type/target/model hint/isolation/effort/evidence/verification/schema/terse resultSame contract. Native provider/model/toolFilter/outputSchema/maxTokens fields map directly; command-authored source smoke-validates the same dispatch contract before consuming its one-shot grant; deployment dispatch and isolation adapters provide DSH-dependent target/effort/worktree seams and otherwise fail loud
Coordinationphase, concurrency-limited parallel, item-streaming pipeline, ordinary-failure isolationSame
SynthesisDedicated synthesizer childSame, routed through configurable DSH provider/model tier
NestingNamed nested workflow, maximum one levelSame
Artifacts/logsNamed JSON artifacts and progress eventsSame, durable in run graph
LimitsPlanned/max agents, max concurrency, token budgetSame; DSH token allocation is reserved before start and reconciled from local Session usage when available
Read-only policyChild write capabilities restrictedFail-closed DSH toolFilter allow-list dynamically intersected with the actual parent catalog; unknown, platform-specific, and newly introduced mutation tools cannot leak through
Worktree isolationShared cwd or isolated git worktreeShared cwd is native. Worktree requests pass only when a configured DSH-capable isolation adapter is available; otherwise preflight rejects rather than sharing cwd silently
VerificationMutation/read-path/final-text postconditions, warn or hard, bounded repairBuilt-in read evidence, successful mutation tool plus Git workspace fingerprint change, per-required-path before/after fingerprints, structured result, completed_unverified, and up to two same-actor hard repairs; versioned optional adapter adds non-Git or stronger workspace evidence
Structured outputObject JSON Schema, captured structured result, bounded format repairDSH outputSchema capability plus exactly one same-route, tool-free repair for absent/invalid capture (including rc.2's error-with-report shape); a schema-invalid repair fails the task, and unsupported providers fail loud
Model routingfast/balanced/deep hints and explicit targetConfigured tier map keeps the DSH subagent transport distinct from the LLM provider/model route; exact subagent/provider/model overrides remain available
Events/processWorkflow, phase, agent, message, synthesis, artifact, terminal events and process snapshotsStable phase/agent/step/artifact ProcessSnapshot items with counts, progress, last text and replay origin; domain events plus native tool-workflow/* Session records reuse the existing DSH UI. Dynamic starts are explicitly Session-scoped so a background run outlives the launching step and remains live until its terminal event
Run lifecyclelist/get/subscribe, pause/resume/stopSame. Pause gates future launches; stop aborts and disposes active children
Durable graphrun.json, append-only events, artifacts, snapshots, cost reportSame classes of records under the configured DSH run directory
Resume/rerunRun-id snapshot rerun, saved-name current rerun, successful result cache replaySame distinction; only completed and verification-clean effects are cached, effective read-only policy/runtime/verification identity participates in cache keys, and replay retains the original result status with explicit replay origin
RetentionDelete, force stale deletion, prune preview/executeSame with containment/path checks
IdentityResolve run id, display alias, saved name; report ambiguitySame
DiscoveryBuilt-in + project/personal saved; capsule preferred; project shadows personal; trusted-local suffixesSame priority model under .dsh/workflows and $DSH_HOME/workflows
Save/rename/reviseSave generated run, rename, archive-on-replace, provenanceSame, with atomic exclusive publication and canonical-root junction/symlink rejection
GenerationScout-then-author, structured capsule, validation, quality lint, bounded repair and smoke executionSame, using DSH subagents, structured output, semantic checks, three author attempts, and isolated fake-capability smoke execution
PreflightEnvironment/tools/MCP/skills/model tiers/user interaction, approval summarySame requirement vocabulary with DSH capability inventory config and service checks
ApprovalGenerated and trusted-local execution governed before launchDSH ctx.approval, fail closed without a grant when policy requires it; a /workflow handoff grant is consumed only by the first inline capsule that passes pre-launch smoke validation
Built-insParameterized parallel investigation and immutable-packet scoped reviewParallel investigation honors rubric/agent/concurrency bounds. Public packet input/writer freezes explicitly captured diff/requirements/test evidence into path-contained, budgeted, content-addressed, non-overwriting manifests and chunks. Scoped review enforces packet metadata, strict schemas/read contracts, a second high-risk primary, deterministic finding IDs, exact per-finding disposition, reason-gated severity changes, and audit artifact
Patternsclassify-and-act, fan-out-and-synthesize, adversarial-verification, generate-and-filter, tournament, loop-until-doneIndependent templates with identical orchestration shapes
Human UX/workflow list/create/run/runs/show/pause/resume/stop/delete/prune/rerun/save/rename/revise/help and Git review bridgeSame command surface via ctx.commands; free-text/create immediately hand Worker-owned scout-then-author work to the current Agent. The original query is a visible human Session message that feeds DSH title and Workspace surfaces, while authoring instructions remain separate plugin context. /workflow review captures default/base/commit diffs, requirements and reported test evidence into immutable packets before starting the built-in (no DSH core patch required). Starts return immediately by default; commands that support terminal waiting expose --wait, show defaults to latest, and stop defaults to the active run
Model UXInline run_workflow authoring/execution and process visibilityrun_workflow, workflow_list, and workflow_manage, backed by the same service and immediate durable-process defaults
Outcome/costStable workflow outcome, results, coverage/unresolved/errors, artifacts and aggregate usageSame independent WorkflowOutcome result projection plus DSH wall time, peak concurrency, measured Session/dispatch usage, and requested/resolved route/fallback telemetry without inventing absent remote usage

DSH-specific compatibility rules

  1. DSH remains the authority for agents, provider capabilities, tool visibility, approval, user questions, cancellation, Session events, and background job ownership.
  2. A parity capability that cannot be honored by the selected DSH provider is rejected during preflight or task start. No request field is accepted and ignored.
  3. Existing DSH ctx.workflows and the model-facing workflow tool remain available. This plugin is the reusable/process layer; it does not patch the agent loop or replace the native foreground script engine.
  4. KodaX capsule files are not declared wire-compatible because their runtime/version provenance names KodaX. A migration command may translate data explicitly in a future version; the v0.1 line never executes a foreign capsule by accident.
  5. target, effort, and worktree semantics are part of the public API. Because rc.2 has no universal host seam for them, the plugin requires an authority adapter registered before the first run; lack of that authority is a preflight error, never an ignored downgrade.