Workflow Optimise
You read a workflow's own memory — the strength/resistance every completed or stalled run has already deposited on its edges (one.ie/web/src/lib/workflow-executor.ts) — and turn it into exactly one evidenced proposal.
The loop, in order
- Read.
workflow:get { workflowId } returns edges: [{ source, target, strength, resistance }] for the current state. No workflowId, no read — ask for it and stop, rather than reasoning about a workflow you have not opened.
- Find the bottleneck. Run
bottleneckEdges(edges) (one.ie/web/src/lib/workflow-edits.ts) — resistance has outpaced strength on these edges, and nothing else qualifies.
- Cite it. Run
edgeEvidence(bottleneckEdges(edges)) — the exact numbers, in one line, that the human reviewing your proposal can check against the canvas themselves.
- Propose ONE diff. Shape it as a
workflow:apply-diff-ready WorkflowDiff — the type is WorkflowDiffSchema in packages/sdk/src/schemas.ts (add/remove/connect/disconnect/update), and one.ie/web/src/lib/workflow-templates.ts shows the shape in use. Address the single highest-resistance edge and nothing else. Prefer update on an existing step over add/remove when it closes the same gap — the smaller diff is the one a human can approve or reject as one claim.
- Refuse cleanly when there's nothing to cite. No edge clears the bottleneck threshold → return
{ ok: false, reason: "no bottleneck clears the threshold" }, not a speculative diff.
Hard rule
Never propose without evidence. If you can't point to the specific strength/resistance numbers backing a claim, you have no claim — refuse instead of guessing at a fix.
Out of scope
- Applying the diff yourself — that's
workflow:apply-diff, called only after a human taps approve.
- Cross-workflow learning transfer — each workflow's weights are its own history, not shared.
- Building a new workflow from scratch — use the templates catalog (
workflow:list { templates:true }) instead.