Skip to content

fix(dag): httpapi dag.start passes Workflow Authoring - #361

Merged
LeXwDeX merged 3 commits into
devfrom
feat/344-issue344
Aug 19, 2026
Merged

fix(dag): httpapi dag.start passes Workflow Authoring#361
LeXwDeX merged 3 commits into
devfrom
feat/344-issue344

Conversation

@LeXwDeX

Copy link
Copy Markdown
Owner

Closes#344

What

  • dag.start HTTP handler now routes through Workflow Authoring: the payload config is wrapped as an inline {title, config} StartSpec and passed to authoring.prepare(action:"start", profile:"environment") with the session's directory + model as environment context. Validation failures (checkpoint gating, output_schema obligations, asset resolution, deep admission minting now server-side) surface as 400 with the full diagnostic list instead of silently creatable danger shapes.
  • The environment catalog loader (agents/worker_types + provider model availability + dag.jsonc tier resolution) extracted from the tool's closure to dag/environment-catalogs.ts (DagEnvironmentCatalogs.makeCatalogLoader(agents, provider)) and used by both the workflow tool and the handler — no duplication.
  • The handler's misleading "Same code path as the workflow tool" comment replaced with the actual contract.
  • httpapi-exercise: new negative scenario dag.start.schemaless-gate (reporting checkpoint gated on its output without output_schema — the DAG-01 shape) expects 400.

Verification

  • bun run test:httpapi 230/230 (auth + effect modes, missing=0 extra=0)
  • bun test test/dag/ 589/589 across 51 files
  • bun run typecheck green

The handler asserted the payload as WorkflowConfig and called dag.create
directly — create runs only structural checks (safe only when authoring has
vetted the graph), so the checkpoint gate, output_schema obligations on gated
checkpoints, worker/model/prompt asset resolution, and server-side deep-mode
admission minting were all bypassed over HTTP. The handler now wraps the
payload as an inline StartSpec and runs authoring.prepare(environment profile)
through the same shared catalog loader the workflow tool uses (extracted to
dag/environment-catalogs.ts); validation failures surface as 400 with the
diagnostic list.
Closes#344
The lint budget is exactly at its cap (4850); the two now-unused imports
pushed CI one warning over.
Sign up for freeto 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.

1 participant

@LeXwDeX