✨ feat(workflow): freeze a goal into a reusable, schedulable workflow#599
Open
vaayne wants to merge 3 commits into
Open
✨ feat(workflow): freeze a goal into a reusable, schedulable workflow#599vaayne wants to merge 3 commits into
vaayne wants to merge 3 commits into
Conversation
Freeze the decomposition of an accepted composite goal into a reusable
entity. Instantiating it skips the planner and deterministically rebuilds
the subtree, reusing the existing execution / acceptance / rollup /
scheduler machinery. Freeze is per-node: a composite carrying a frozen
subplan runs deterministically; one without is left to the planner
(semi-frozen).
- data model: agent_workflow table; sched_job.dispatch_kind +
sched_job_run.root_goal_id
- internal/goal: FrozenPlan DTO, SnapshotFrozenPlan, InstantiateFrozen
(single-tx recursive materialize), ValidateFrozenPlan
- internal/workflow: entity service (Create / SaveGoalAsWorkflow /
Instantiate / list / get / update / delete)
- scheduler: dispatch_kind=workflow branch + AddWorkflowJob on-ramp,
records root goal on the run
- HTTP: /api/workflows CRUD, instantiate, schedule,
/api/goals/{id}/save-as-workflow (OpenAPI-first)
- CLI: stella workflow (save-as / instantiate / schedule / create /
list / get / update / delete)
- docs+skills: goal-model, how-to, system prompt, tasks reference (EN+ZH)
Refs #594
📊 Coverage ReportTotal coverage: 48.4% (generated files excluded) Lowest-covered entries (first 200) |
Fixes all 10 findings from the multi-perspective review of the freeze-goal-into-workflow feature (#594). - frozen: cap frozen plans at 1024 nodes before instantiation (CR-001) - server: require agent access + validate project_id on workflow ops (CR-002) - server: reject type-mismatched contract/policy JSON with 400 (CR-003) - scheduler: return root_goal_id from dispatchJob and record it on every run path, eliminating the back-channel sink (CR-004, CR-010) - frozen: log orphaned pre-minted sessions on instantiate rollback (CR-005) - queries: scope Get/Update/Delete workflow by user_id (CR-006) - workflow: translate goal sentinels at the service boundary (CR-007) - schema: drop unused system-preset / workflow_key machinery (CR-008) - cli: report the actual source flag on JSON parse errors (CR-009) Refs #594
Adds the web surface for the freeze-goal-into-workflow feature so users can manage frozen workflows without the CLI. - workflows list page: search + pagination + plan-stats rows (#594) - workflow detail: frozen plan tree, acceptance contract, edit name/intent - run (instantiate → jump to the new goal tree), schedule via dialog, delete - "Save as workflow" action on accepted composite goals - Workflows tab in the agent facet nav - en/zh strings for all of the above All wired to the existing generated client (listWorkflows, getWorkflow, instantiateWorkflow, scheduleWorkflow, saveGoalAsWorkflow, update/delete). Refs #594
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.
What
Freeze a once-accepted composite goal's decomposition plan into a reusable, schedulable workflow. Instantiating it skips the planner and deterministically rebuilds the goal subtree, reusing the existing execution / acceptance(contract) / rollup / scheduler infrastructure.
Freeze is per-node (a spectrum, not a switch): a composite node carrying a frozen subplan executes deterministically; a composite node without one is left to the planner ("semi-frozen").
Why
A good decomposition is earned the expensive way — through planning and rework. For a recurring objective whose plan you already trust, re-planning each time wastes tokens and wall-clock. A workflow captures the earned plan so the next run skips straight to acceptance, and can be put on a schedule. Closes #594.
How
agent_workflowtable (owner coupling + systemworkflow_keypartial-unique);sched_job.dispatch_kind,sched_job_run.root_goal_id.FrozenPlanDTO (distinct from the planner'sDecompositionContent),SnapshotFrozenPlan(recursive read),InstantiateFrozen(single-tx recursive materialize → activate),ValidateFrozenPlan. Single-transaction instantiation avoids the dispatcher racing in to plan a frozen composite committed asdraft.Create(hand-authored),SaveGoalAsWorkflow(source must be an accepted composite owned by caller),Instantiate, list/get/update/delete (owner-scoped).dispatch_kind=workflowbranch instantiates the frozen workflow and records the new root goal on the run via a context sink;AddWorkflowJobis the on-ramp (the dispatch branch would be dead code without it)./api/workflowsCRUD,…/instantiate,…/schedule,/api/goals/{id}/save-as-workflow.stella workflow(wf):save-as / instantiate(run) / schedule / create / list / get / update / delete.Verification:
mise run format && mise run build && mise run testgreen; new tests ininternal/goal,internal/workflow,internal/scheduler(incl. workflow-job restart round-trip).Deferred (not v1, per issue)
agent-authority adversarial voting panel · dependency minimization · system-package
workflow_keylate-binding · UI edge editor.Refs