fix(dag): httpapi dag.start passes Workflow Authoring - #361
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes#344
What
dag.startHTTP handler now routes through Workflow Authoring: the payload config is wrapped as an inline{title, config}StartSpec and passed toauthoring.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.dag/environment-catalogs.ts(DagEnvironmentCatalogs.makeCatalogLoader(agents, provider)) and used by both the workflow tool and the handler — no duplication.dag.start.schemaless-gate(reporting checkpoint gated on its output withoutoutput_schema— the DAG-01 shape) expects 400.Verification
bun run test:httpapi230/230 (auth + effect modes,missing=0 extra=0)bun test test/dag/589/589 across 51 filesbun run typecheckgreen