Why
This is the feature that justifies the project's existence and is the clearest differentiator. Today a user must already know their deterministic path and hand-author a Flow. The high-value, low-friction on-ramp is the reverse: point ChainWeaver at an agent's tool-call trace and have it propose compiled flows automatically. This productizes ChainAnalyzer + the runtime observer (#78) into a single user-facing command.
Proposal
A chainweaver record / chainweaver suggest-from-trace path that:
- Ingests a sequence of observed tool calls (a JSONL trace, or a thin recorder wrapper around an existing agent loop / MCP proxy).
- Detects repeated, schema-compatible sub-sequences via
ChainAnalyzer.
- Emits ready-to-register candidate
Flow objects as .flow.yaml, ranked by frequency × estimated LLM-calls-avoided.
- Reports, per candidate: occurrences, the tools involved, and the projected cost/latency saving.
This should be offline and deterministic (no LLM), consistent with the project's core invariant.
Acceptance criteria
Builds on: #78 (runtime observer), #100/#28 (optional LLM optimizers — out of scope here; this must stay LLM-free).
Why
This is the feature that justifies the project's existence and is the clearest differentiator. Today a user must already know their deterministic path and hand-author a
Flow. The high-value, low-friction on-ramp is the reverse: point ChainWeaver at an agent's tool-call trace and have it propose compiled flows automatically. This productizesChainAnalyzer+ the runtime observer (#78) into a single user-facing command.Proposal
A
chainweaver record/chainweaver suggest-from-tracepath that:ChainAnalyzer.Flowobjects as.flow.yaml, ranked by frequency × estimated LLM-calls-avoided.This should be offline and deterministic (no LLM), consistent with the project's core invariant.
Acceptance criteria
.flow.yamlfiles.examples/demonstrates record → suggest → register → execute on a sample trace.Builds on: #78 (runtime observer), #100/#28 (optional LLM optimizers — out of scope here; this must stay LLM-free).