Skip to main content

Crate smix_authoring_propose

Crate smix_authoring_propose 

Source
Expand description

smix-authoring-propose — the fenced authoring-proposal tier.

A failed flow run leaves a structured bundle on disk (run-summary.json, *.fail.tree.json, failure.json, screenshots). This crate turns that bundle, via a local claude CLI, into a Proposal: a machine-checkable list of edits over the real smix_adapter_maestro::Step / smix_selector::Selector vocabulary — never an invented predicate smix has no verb for.

It is an authoring aid, fenced the same way as smix-ai-tier: deletable, opt-in, non-deterministic. Nothing that senses or acts depends on it.

Structs§

AiTierConfig
Re-exported so a CLI wire needs only this crate as a dependency, not smix-ai-tier directly — keeping the authoring-propose fence’s allowlist to a single crate. How to reach the judge.
Proposal
A machine-checkable set of edits over a flow’s Vec<Step>.

Enums§

AmendError
Why propose_and_amend could not turn a failed flow + its bundle into an amended flow yaml. Each arm names the stage that failed; nothing is swallowed and no stage falls back to an empty amend.
ApplyError
Why apply could not turn a Proposal into an amended flow.
ProposalEdit
One structured edit. Internally tagged on op; the tag value is the variant name lowerCamelCased (replaceSelector, insertStep, reorderStep, replaceStep), while the payload fields stay snake_case to mirror how claude naturally names them.
ProposalError
Why a Proposal failed Proposal::validate.

Functions§

apply
Validate a Proposal then apply its edits to a copy of steps, returning the amended flow. Validation runs first (index bounds + insert-wait policy); a failure propagates as ApplyError::Invalid rather than a partial mutation. Edits apply in the order the model emitted them.
parse_proposal_reply
Pull a Proposal out of a model reply, tolerating prose around the JSON object — the same forgiving extraction smix-ai-tier uses for verdicts.
propose_and_amend
Glue the C2/C3 pieces into one device-free primitive: read flow_path, parse it, ask a local claude to propose edits from the on-disk bundle_dir, apply them, and emit the amended flow as maestro yaml.
propose_from_bundle
Ask a local claude to read a failed flow’s bundle and propose edits.