Edit linked product system
lca_edit_linkedPatch a saved linked or single-process system (s<N>). A linked system is an explicit process network. Graph ops: add_link (wire a supplier onto a consumer input, or a waste output onto its treatment; the provider joins automatically), remove_link (drop matching edges; orphans are pruned), rewire_link (repoint one edge). Also replace_provider (swap a supplier on every edge it feeds; a bare unit_process swap warns: its background is unwired), set_target_amount and set_title. A swap checks only unit compatibility, so geography, technology and vintage can change. lca_get(ref='s<N>', form='authored') shows every edge and the consumer_input_index needed when a consumer has one flow on several exchanges. A link's amount only validates. mode edit (default) patches in place; fork derives a new s<M>; a mirror is forked automatically. A single-process system takes only the two setters. Composed systems use lca_edit_assembly. Takes p<N>/f<N> refs; UUIDs are not accepted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | Ordered list of edits to apply in one call. | |
| ref | Yes | Saved product-system ref `s<N>` to patch. | |
| mode | No | `edit` (default) → edit the system IN PLACE, appending a new content version and keeping the same `s<N>` (self-contained systems; a drift-tracked mirror auto-forks to a new `s<M>` with a warning, since it can't be mutated in place). `fork` → always derive a NEW `s<M>`, leaving the baseline `s<N>` untouched. | edit |
| workspace | Yes | Name of the workspace to work in, as `lca_get(kind='workspaces')` lists it (backticks optional). Named on every call: several conversations can share one connection, and each names its own workspace. The connection's default is often an empty sandbox rather than the user's work. | |
| base_version_seq | No | REQUIRED here: the system's current content `version_seq`, as `lca_get s<N>` reports it — the version you computed this edit against. Rejected (409) if the system has moved on since, and nothing is changed. Re-read the system between edits: a successful in-place edit advances the version. (Kept optional in the schema so an omission gets the backend's instructive 422 rather than a bare validation error.) |