feat(workflow): authoring, persistence & structured returns (#312 Bolt 2)#326
Open
fanhongy wants to merge 3 commits into
Open
feat(workflow): authoring, persistence & structured returns (#312 Bolt 2)#326fanhongy wants to merge 3 commits into
fanhongy wants to merge 3 commits into
Conversation
N2 spec-service + workflow_index migration + cao workflow CLI (validate/list/get/delete), N3-auth workflow-author skill + workflow-scout profile, N4 structured-return MCP tool + endpoint + in-memory output store. run/cancel/status deferred to Bolt 3 engine. 47 tests. Refs #312
Rebased onto the #320-fixed foundations head. Relocate Bolt 2 runtime DTOs (ReturnAck/StepOutputRecord/WorkflowIndexRow/StepState) to a light workflow_runtime module so the MCP server no longer pulls jsonschema/yaml. Add non-string-key never-raise regression tests; chain delete OSError cause. Refs #312
Add _safe_spec_path: realpath-normalize a spec file path then assert it lives inside its policy-checked directory (startswith containment) before any stat/open. Route load_and_validate / validate_only / get_workflow through it; get_workflow stats only path-like args via the guard, never raw input. Rejects blocked dirs and symlink escapes. Refs #312
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 free
to 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.
Summary
Bolt 2 of #312 (cao workflow): the authoring → persist surface plus structured step returns. Stacks on Bolt 1 (#320, merged).
cao workflow validate / list / get / delete, backed by/workflows*. YAML spec files on disk are the single source of truth; theworkflow_indexSQLite table is a derived, droppable projection rebuilt byte-identically from the files (idempotent migration, covered by a migration test).workflow_returnMCP tool + in-memoryStepOutputStore. A schema-invalid output is stored and returned as200 / validated=False / COMPLETED_UNVALIDATED— never collapsed into an error or a claim that the step ran (honesty discipline; the reprompt loop is Bolt 3).run/cancel/ run-statusand the implicit-upsert-on-runtrigger land in Bolt 3 with the engine (N5). Reserved constructs validate-and-store but never render as executing.Review
Reviewed by a sub-agent against the PR #320 finding-classes to prevent recurrence. Findings fixed in this branch:
1: foo) no longer leaks aTypeErroras an unhandled 500; it surfaces as a cleanfail/ 400. Pinned by service- and endpoint-level regression tests.ReturnAck/StepOutputRecord/WorkflowIndexRow/StepState) moved to a lightmodels/workflow_runtime.pyso the MCP server consumesReturnAckwithout pullingjsonschema/yamlonto the HTTP seam (workflow.pyre-exports them — no call-site churn).delete_workflow'sOSError → ValueErrornow usesraise ... from e.Project rules honored: single HTTP seam (CLI + MCP talk only HTTP); shared path/name validators reused (no ad-hoc regex); core services raise narrow exceptions, API maps to
HTTPException; best-effort index/store never raise into the success path; constants centralized.Test plan
uv run pytest test/ --ignore=test/e2e --ignore=test/providers/test_q_cli_integration.py→ green (the 7 kiro_cli integration errors are pre-existing, require a live authenticated CLI, CI-ignored).Refs #312
🤖 Generated with Claude Code