Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.
Corpus axis expansion: operators and controllers (#1134)
Louis Choquelb644a416d2dc
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d030f41ef..84d31c418 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,6 +6,15 @@- **The MTHDS Test Corpus: one canonical, tagged set of `.mthds` methods, with coverage of the language surface turned into a gate instead of a thing somebody has to remember**: Every repo in the workspace had grown its own pile of `.mthds` fixtures, each shaped by its own consumer, and coverage of the MTHDS language surface — a cross-repo invariant — was asserted locally in each of them against a private pile. The result was exactly what that arrangement predicts: the `Time` native concept had no pipelex fixture at all, while another repo had independently patched the same gap in its own corpus without either side knowing. The corpus lives at `pipelex/test_extras/mthds_corpus/` and ships in the wheel, so a consumer that already depends on `pipelex` reads it through `iter_entries()` / `get_entry()` with no copy and no drift — lockstep by construction via the pinned version. Each entry is a directory holding the method, an optional `inputs.json`, and an `entry.toml` declaring what it exercises: `covers` (the axes, drawn from a closed vocabulary), `tier` (the cheapest conformance tier at which it is meaningful), `granularity`, and `validity` — plus, for a deliberately invalid entry, the exact wire `error_type` it must produce. Metadata lives beside the bundle and never inside it, so a bundle stays a pure language artifact. The `native.*` tag vocabulary is **generated** from `NativeConceptCode` by `make generate-corpus-vocabulary` and committed, so a consumer reads the closed tag set without a registry walk; the generator itself stays unshipped dev tooling. Three gates hold it: regeneration must reproduce the committed vocabulary byte for byte, every non-excluded tag must have a `focused` entry covering it, and every entry must mean what its manifest claims — a valid one validating, an invalid one failing with exactly its declared error, both checked against the local runtime rather than a deployed API that lags it, and both run over every entry regardless of tier so an `inference`-tier entry that broke is caught without spending a token. The exhaustivity gate is the one that closes the hole: the moment a registry grows a code, regeneration adds its tag and the build stays red until an entry covers it. The corpus is seeded with a focused entry for every native concept, and no code needed excluding — each one turned out to support a real entry. Entry subject matter is ordinary-world by rule, never AI and never MTHDS's own vocabulary, because an entry exists so a red gate can be narrated in one sentence and *"the model output the model"* is not one. The cross-repo contract is the workspace spec `docs/specs/mthds-test-corpus.md`; the working guide is `docs/contribute/mthds-test-corpus.md`.+- **MTHDS Test Corpus: the `operator.*` and `controller.*` tag axes.** The corpus tag vocabulary now covers every executable pipe kind alongside the native concepts, generated from `PipeType` and split into the two namespaces by that enum's own `category` property — one registry walk, so a pipe kind added later lands in the right namespace with nothing to update. Local names drop the `Pipe` prefix each code carries, since the namespace already says which half it is (`PipeLLM` becomes `operator.llm`), while `code` keeps the registry's spelling. The exhaustivity gate covers both new namespaces, and focused entries land with them: image generation, extraction, search, structuring, composition, and the sequence, batch and condition controllers. `PipeFunc` is the corpus's first recorded exclusion — it names a Python function that the runtime resolves against its function registry at validation time, so no portable entry can declare one.+- **The `feature.*` tag axis opens, with multi-file libraries as its first tag.** Language features are the one thing the corpus vocabulary cannot generate: a feature is a human-named cluster of behaviour rather than a registry entry — some span several blueprint fields, some none at all — and there is no feature registry to walk. So `feature.*` is hand-maintained in the generator, and a tag there carries a `description` where a generated tag carries `code`, since that sentence is the only place its meaning can live. Each feature tag is declared in the same change that lands its first covering entry, never ahead of it, so the vocabulary never advertises coverage the corpus does not have. The first is `feature.multi_file_library`, covered by a research-brief method built top-down across several files with each pipe forward-declared as a signature before it is written — migrated out of the e2e tree, which now reads it from the corpus.++- **Two more `feature.*` axes: optionals and smart inputs.** A noticeboard line whose house-style hint is optional — guarded in the prompt so an absent value renders nothing and is recorded as absent — and a claims summary whose caller passes bare values (a string, a number, a dict, a list) to be shaped top-down against the declared signature. Both migrated out of the e2e tree, which now reads them from the corpus. Re-themed on the way in, per the corpus rule that an entry's subject matter is ordinary-world and never the machinery it exercises; the tests that asserted on the old qualified concept refs moved with them.++- **`feature.structured_output` joins the vocabulary**, covered by the entry that was already its minimal exemplar — a shop's opening hours read off the door into typed fields — rather than by a near-duplicate written beside it. `feature.dependencies`, the remaining name on the v1 list, is deliberately **not** declared: a method depending on another package needs a `METHODS.toml` manifest and a second package directory reached by a relative path, which is a different shape from the one-directory entry the contract pins. Declaring the tag before an entry can cover it would advertise coverage the corpus does not have.++- **A nested structured-output corpus entry**: a driver's round sheet filed into a shape the corpus had no exemplar for — a list of structured objects, each carrying its own list and an optional field. Written fresh rather than migrated: pipelex's own structure-shape matrices are named for the shapes they test (`ConceptWithNestedStructures`, `ConceptWithOptionals`), which is load-bearing for the tests that read them and precisely what the corpus's subject-matter rule forbids, so re-theming them would have made both sides worse.+- **The corpus is proven to ship, against a wheel that is actually built**: wheel consumers reach the corpus through `importlib.resources`, so a corpus that stopped being packaged would be invisible in this repo and would break every consumer at once, on the release. A packaging test builds the real wheel and looks inside it, deriving what it expects from the corpus tree rather than from a list somebody has to maintain — a new entry, a new file kind or a new namespace is covered the moment it lands. It pins both halves of the split at once: the generated `vocabulary.toml` and every entry file ship, and the generator that writes them stays out. No packaging configuration change was needed, which is what the test now holds true rather than assumes.- **Image-payload corpus entries**, so a consumer that needs an `Image` crossing a pipe boundary has one: a sequence that writes a scene and draws it, and a round trip that produces a photograph and reads it back to caption it. Both are `composite`, both sit at the `inference` tier, and — like every other entry — neither names a model. That is a contract property rather than a preference: presets are resolved by the validation engine, so an entry pinning one would fail validation outright on any consumer whose deck does not define it.diff --git a/docs/contribute/mthds-test-corpus.md b/docs/contribute/mthds-test-corpus.mdindex 74ae95086..378ef864b 100644--- a/docs/contribute/mthds-test-corpus.md+++ b/docs/contribute/mthds-test-corpus.md@@ -70,7 +70,9 @@ An **invalid** entry additionally declares the exact wire `error_type` it must p## The tag vocabulary-Tags are namespaced and the vocabulary is closed: an entry covering a tag the vocabulary does not declare fails the gate. `native.*` is generated from `NativeConceptCode`; `feature.*` is reserved for hand-maintained language features; `operator.*`, `controller.*` and `error.*` arrive with their registries.+Tags are namespaced and the vocabulary is closed: an entry covering a tag the vocabulary does not declare fails the gate. `native.*` is generated from `NativeConceptCode`. `operator.*` and `controller.*` are generated from `PipeType` — one registry, split by its own `category` property, so a pipe kind added tomorrow lands in the right namespace with nothing to update here. Their local names drop the `Pipe` prefix every code carries, since the namespace already says which half it is: `PipeLLM` becomes `operator.llm`, `PipeSequence` becomes `controller.sequence`. `error.*` arrives with its registry.++`feature.*` is the one hand-maintained namespace, because a language feature is a human-named cluster of behaviour rather than a registry entry — some span several blueprint fields (optionals show up as `?` in a concept spec), some none at all (a multi-file library is a property of the entry *directory*), and there is no feature registry in `pipelex` to walk. A tag there carries a `description` where a generated one carries `code`, since that sentence is the only place its meaning can live. **Add a feature tag in the same commit that lands its first covering entry, never ahead of it** — declaring one reds the exhaustivity gate until an entry covers it.`vocabulary.toml` is generated in full, so it is never edited by hand:@@ -78,9 +80,11 @@ Tags are namespaced and the vocabulary is closed: an entry covering a tag the vomake generate-corpus-vocabulary```-Everything the file says is decided in the generator, `pipelex/cli/dev_cli/commands/generate_corpus_vocabulary_cmd.py` — the registries it walks, and every exclusion reason. It is unshipped dev tooling (the wheel excludes `pipelex/cli/dev_cli`) while the file it writes ships, which is what lets a consumer read the closed tag set without a registry walk. A hand-maintained namespace will be declared there too when one first has content; `feature.*` is reserved in the contract but has no tags yet, and adding one before an entry covers it would simply red the exhaustivity gate.+Everything the file says is decided in the generator, `pipelex/cli/dev_cli/commands/generate_corpus_vocabulary_cmd.py` — the registries it walks, and every exclusion reason. It is unshipped dev tooling (the wheel excludes `pipelex/cli/dev_cli`) while the file it writes ships, which is what lets a consumer read the closed tag set without a registry walk. The hand-maintained `feature.*` tags are declared in that same file, beside the registry walks — see above for how to add one.++An **exclusion** marks a registry code that no standalone focused entry could meaningfully exercise. It stays in the vocabulary and stays usable by an entry; it is simply not owed a focused entry. The exclusion map is keyed on the registry enum rather than on strings, which is what keeps an exclusion from outliving the code it names: a removed code breaks the generator at import, naming itself.-An **exclusion** marks a registry code that no standalone focused entry could meaningfully exercise. It stays in the vocabulary and stays usable by an entry; it is simply not owed a focused entry. No native code is excluded today — every one of them turned out to support a real entry. The exclusion map is keyed on the registry enum rather than on strings, which is what keeps an exclusion from outliving the code it names: a removed code breaks the generator at import, naming itself.+No native concept is excluded — every one of them turned out to support a real entry. `PipeFunc` is excluded: it names a Python function that the runtime resolves against its function registry *at validation time*, so an entry declaring one fails with `Function '<name>' not found in registry` in every consumer that has not registered that exact function — and a cross-language consumer cannot register a Python function at all. Exercise `PipeFunc` in a consumer's own fixtures, where the function exists.## The gates, and what a red one means@@ -110,7 +114,7 @@ for entry in iter_entries(tier=EntryTier.DRY):The same two calls are how a **consumer outside this repo** reaches the corpus: it ships as package data in the wheel, so anything that already depends on `pipelex` — our own hosted services, most immediately — reads it with no vendored copy and no drift, in lockstep with its pinned version. Paths handed out are real filesystem paths, resolved through `importlib.resources.files`; wheels install unzipped, and a zip-imported distribution is not supported.-The corpus is the single source for language-level `.mthds` methods in this repo: `tests/e2e/pipelex/pipes/date/` and `tests/e2e/pipelex/pipes/yes_no/` already reach for their bundles this way rather than keeping local copies.+The corpus is the single source for language-level `.mthds` methods in this repo, and this repo's own tests are consumers of it like any other: a growing number of trees under `tests/e2e/pipelex/pipes/` call `get_entry(...)` for their bundle rather than keeping a local copy. `grep -rl mthds_corpus tests/` is the current list — the enumeration is deliberately not written down here, since it moves with every migration.!!! note "The entries are data, never auto-loaded"diff --git a/pipelex/cli/dev_cli/commands/generate_corpus_vocabulary_cmd.py b/pipelex/cli/dev_cli/commands/generate_corpus_vocabulary_cmd.pyindex e7dd48838..89aa954bf 100644--- a/pipelex/cli/dev_cli/commands/generate_corpus_vocabulary_cmd.py+++ b/pipelex/cli/dev_cli/commands/generate_corpus_vocabulary_cmd.py@@ -18,6 +18,7 @@ from rich.markup import escapefrom rich.panel import Panelfrom pipelex.core.concepts.native.concept_native import NativeConceptCode+from pipelex.pipe_machinery.pipe_blueprint import PipeCategory, PipeTypefrom pipelex.runtime_hub import get_consolefrom pipelex.test_extras.mthds_corpus.vocabulary import vocabulary_path@@ -26,9 +27,10 @@ _WORD_BOUNDARY_RE = re.compile(r"(?<=[a-z0-9])(?=[A-Z])")_HEADER = """# The MTHDS Test Corpus tag vocabulary — the closed set an entry's `covers` draws from.#-# GENERATED by `pipelex-dev generate-corpus-vocabulary`. Do not edit this file: the generated-# namespaces are derived from the runtime's own registries, and every exclusion reason is-# declared in the generator's source.+# GENERATED by `pipelex-dev generate-corpus-vocabulary`. Do not edit this file: `native.*`,+# `operator.*` and `controller.*` are derived from the runtime's own registries, `feature.*` is+# hand-maintained in the generator because no registry describes a language feature, and every+# exclusion reason is declared in the generator's source alongside them.## This file ships in the pipelex wheel, so it names a document its readers can reach:# https://docs.pipelex.com/contribute/mthds-test-corpus/ — which in turn points at the@@ -44,6 +46,65 @@ _HEADER = """# The MTHDS Test Corpus tag vocabulary — the closed set an entry'# excluding today; every native concept turned out to support a real focused entry._NATIVE_EXCLUSIONS: dict[NativeConceptCode, str] = {}+# The `operator.*` and `controller.*` namespaces come from ONE registry, not two: `PipeType` is the+# closed set of executable pipe kinds, and its `category` property is what splits them. Deriving the+# namespace from that property rather than from a list here is what keeps a newly added pipe kind+# from landing in the wrong half — or in neither.+#+# `PipeSignature` is absent by construction and that is correct: a signature is a contract, not an+# executable kind, so it is deliberately not a `PipeType` member and an explicit `type =+# "PipeSignature"` is rejected upstream. There is nothing for a corpus entry to exercise.+#+# Every registry code here carries the same `Pipe` prefix, and the namespace already says which half+# it is in, so `operator.pipe_llm` would stutter. The prefix is stripped before normalization and+# `code` keeps the registry's own spelling, exactly as `native.yes_no` keeps `code = "YesNo"`.+_PIPE_TYPE_PREFIX = "Pipe"++# `feature.*` is the one hand-maintained namespace: a language feature is a human-named cluster of+# behaviour, not a registry entry. Some span several blueprint fields (optionals show up as `?` in a+# concept spec), some none at all (a multi-file library is a property of the entry *directory*), and+# `pipelex` has no feature registry to walk — so there is nothing to generate from. A tag here+# carries a `description` where a generated one carries `code`, because that sentence is the only+# place the tag's meaning can live.+#+# A tag is added here in the SAME commit that lands its first covering entry, never ahead of it:+# declaring one reds the exhaustivity gate until an entry covers it, and a vocabulary advertising+# coverage the corpus does not have is worse than a short vocabulary. Rendered in alphabetical order,+# there being no registry order to follow.+_FEATURE_TAGS: dict[str, str] = {+ "optionals": (+ "An input declared optional with the `?` suffix, so a run that has no value for it proceeds "+ "instead of failing and the absence is recorded in the working memory. How a method copes with "+ "the absence is the method's business — guarding the reference in a prompt, in a condition "+ "expression, or letting it lift through a chain."+ ),+ "structured_output": (+ "A concept declaring a `structure` table of typed fields, and a pipe producing that shape rather "+ "than free text, so the runtime validates the output against the declared fields."+ ),+ "smart_inputs": (+ "Bare caller values — a string, a number, a dict, a list — interpreted top-down against the entry "+ "pipe's declared signature, so a caller need not wrap each one in its concept envelope."+ ),+ "multi_file_library": (+ "A method split across several `.mthds` files in one directory and merged additively behind a "+ "`bundle.mthds` entry point, so a pipe can be forward-declared as a signature in one file and "+ "satisfied by a concrete definition in another."+ ),+}++# Same contract as `_NATIVE_EXCLUSIONS`, keyed on `PipeType` for the same reason: an exclusion whose+# code leaves the registry breaks this module at import instead of rotting in the generated file.+_PIPE_TYPE_EXCLUSIONS: dict[PipeType, str] = {+ PipeType.PIPE_FUNC: (+ "A PipeFunc names a Python function that is resolved against the runtime's function registry "+ "at validation time, so an entry declaring one fails with \"Function '<name>' not found in "+ 'registry" in every consumer that has not registered that exact function. A corpus entry has '+ "to validate everywhere, and the cross-language consumers cannot register a Python function at "+ "all, so no portable focused entry exists. Exercise PipeFunc in a consumer's own fixtures."+ ),+}+def normalize_registry_code(*, code: str) -> str:"""Turn a CamelCase registry code into a snake_case tag local name.@@ -73,9 +134,53 @@ def _render_native_namespace() -> str:return "\n\n".join(blocks)+def _render_feature_namespace() -> str:+ blocks: list[str] = []+ for local_name in sorted(_FEATURE_TAGS):+ blocks.append("\n".join([f"[feature.{local_name}]", f"description = {_toml_string(value=_FEATURE_TAGS[local_name])}"]))+ return "\n\n".join(blocks)+++def _pipe_type_block(*, pipe_type: PipeType, namespace: str) -> str:+ local_name = normalize_registry_code(code=pipe_type.value.removeprefix(_PIPE_TYPE_PREFIX))+ lines = [f"[{namespace}.{local_name}]", f"code = {_toml_string(value=pipe_type.value)}"]+ exclusion_reason = _PIPE_TYPE_EXCLUSIONS.get(pipe_type)+ if exclusion_reason is not None:+ lines.append(f"excluded = {_toml_string(value=exclusion_reason)}")+ return "\n".join(lines)+++def _render_pipe_type_namespaces() -> list[str]:+ """The two pipe namespaces, each in registry declaration order, rendered separately.++ One walk of the registry, split by the category the registry itself declares — so a pipe kind+ added tomorrow lands in the right namespace with nothing here to update.+ """+ operators: list[str] = []+ controllers: list[str] = []+ for pipe_type in PipeType:+ # Exhaustive, with no default arm, so the guarantee holds in both directions: a new+ # `PipeType` reds `PipeType.category`'s own match, and a new `PipeCategory` reds this one+ # rather than falling silently into whichever half happened to be the `else`.+ match pipe_type.category:+ case PipeCategory.PIPE_OPERATOR:+ operators.append(_pipe_type_block(pipe_type=pipe_type, namespace="operator"))+ case PipeCategory.PIPE_CONTROLLER:+ controllers.append(_pipe_type_block(pipe_type=pipe_type, namespace="controller"))+ return ["\n\n".join(operators), "\n\n".join(controllers)]++def generate_corpus_vocabulary_content() -> str:- """Render the whole vocabulary file, deterministically, in registry declaration order."""- return f"{_HEADER}\n{_render_native_namespace()}\n"+ """Render the whole vocabulary file, deterministically.++ Each generated namespace follows its registry's declaration order, and the two pipe namespaces+ are emitted one after the other rather than interleaved — the file is read by humans choosing an+ entry's `covers`, and grouping should not depend on where a future pipe kind is inserted into+ the enum. `feature.*` has no registry to follow, so it renders alphabetically; it goes last+ because it is the one namespace a reader cannot predict from a registry.+ """+ namespaces = [_render_native_namespace(), *_render_pipe_type_namespaces(), _render_feature_namespace()]+ return f"{_HEADER}\n" + "\n\n".join(namespaces) + "\n"def generate_corpus_vocabulary_cmd(*, quiet: bool = False) -> None:diff --git a/pipelex/test_extras/mthds_corpus/entries/controller_batch_crate_labels/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/controller_batch_crate_labels/bundle.mthdsnew file mode 100644index 000000000..37fb10f31--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/controller_batch_crate_labels/bundle.mthds@@ -0,0 +1,23 @@+domain = "warehouse_labelling"+description = "Writing one crate label for each crate on a pallet"+main_pipe = "label_every_crate"++[concept]+Crate = "A crate standing on a pallet, described by what is in it."+CrateLabel = "The line of text stuck on the outside of a crate."++[pipe.label_every_crate]+type = "PipeBatch"+description = "Writes a label for each crate on the pallet"+inputs = { crates = "Crate[]" }+output = "CrateLabel[]"+branch_pipe_code = "label_one_crate"+input_list_name = "crates"+input_item_name = "crate"++[pipe.label_one_crate]+type = "PipeLLM"+description = "Writes the label for a single crate"+inputs = { crate = "Crate" }+output = "CrateLabel"+prompt = "Write the label that goes on this crate: $crate. One line, no more than eight words."diff --git a/pipelex/test_extras/mthds_corpus/entries/controller_batch_crate_labels/entry.toml b/pipelex/test_extras/mthds_corpus/entries/controller_batch_crate_labels/entry.tomlnew file mode 100644index 000000000..4fba33449--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/controller_batch_crate_labels/entry.toml@@ -0,0 +1,10 @@+name = "controller_batch_crate_labels"+description = "One crate label written for each crate on a pallet"++validity = "valid"+tier = "dry"+granularity = "focused"++covers = [+ "controller.batch",+]diff --git a/pipelex/test_extras/mthds_corpus/entries/controller_condition_parcel_routing/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/controller_condition_parcel_routing/bundle.mthdsnew file mode 100644index 000000000..400ae0a87--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/controller_condition_parcel_routing/bundle.mthds@@ -0,0 +1,44 @@+domain = "parcel_routing"+description = "Sending a parcel down the belt that matches its size"+main_pipe = "route_parcel"++[concept.Parcel]+description = "A parcel waiting at the sorting belt"++[concept.Parcel.structure]+size = { type = "text", description = "How the parcel is sized on the belt: small, medium or large", required = true }+address = { type = "text", description = "Where the parcel is going", required = true }++[pipe.route_parcel]+type = "PipeCondition"+description = "Sends the parcel to the belt that takes its size"+inputs = { parcel = "Parcel" }+output = "Text?"+expression = "parcel.size"+default_outcome = "continue"++[pipe.route_parcel.outcomes]+small = "note_small_belt"+medium = "note_medium_belt"+large = "note_large_belt"++[pipe.note_small_belt]+type = "PipeLLM"+description = "Notes that the parcel goes on the small belt"+inputs = { parcel = "Parcel" }+output = "Text"+prompt = "Write one line saying the parcel for $parcel.address goes on the small belt."++[pipe.note_medium_belt]+type = "PipeLLM"+description = "Notes that the parcel goes on the medium belt"+inputs = { parcel = "Parcel" }+output = "Text"+prompt = "Write one line saying the parcel for $parcel.address goes on the medium belt."++[pipe.note_large_belt]+type = "PipeLLM"+description = "Notes that the parcel goes on the large belt"+inputs = { parcel = "Parcel" }+output = "Text"+prompt = "Write one line saying the parcel for $parcel.address goes on the large belt."diff --git a/pipelex/test_extras/mthds_corpus/entries/controller_condition_parcel_routing/entry.toml b/pipelex/test_extras/mthds_corpus/entries/controller_condition_parcel_routing/entry.tomlnew file mode 100644index 000000000..5256ed3b8--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/controller_condition_parcel_routing/entry.toml@@ -0,0 +1,10 @@+name = "controller_condition_parcel_routing"+description = "A parcel sent to the belt that takes its size"++validity = "valid"+tier = "dry"+granularity = "focused"++covers = [+ "controller.condition",+]diff --git a/pipelex/test_extras/mthds_corpus/entries/controller_condition_parcel_routing/inputs.json b/pipelex/test_extras/mthds_corpus/entries/controller_condition_parcel_routing/inputs.jsonnew file mode 100644index 000000000..46d1e0a82--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/controller_condition_parcel_routing/inputs.json@@ -0,0 +1,9 @@+{+ "parcel": {+ "concept": "parcel_routing.Parcel",+ "content": {+ "size": "medium",+ "address": "14 Rue des Lilas, Rennes"+ }+ }+}diff --git a/pipelex/test_extras/mthds_corpus/entries/controller_sequence_menu_card/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/controller_sequence_menu_card/bundle.mthdsnew file mode 100644index 000000000..93c5274f5--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/controller_sequence_menu_card/bundle.mthds@@ -0,0 +1,31 @@+domain = "bistro_menus"+description = "Writing the day's menu card from a note of what the kitchen has in"+main_pipe = "write_menu_card"++[concept]+KitchenNote = "A short note from the kitchen listing what is available today."+MenuCard = "The menu as it is written out for the dining room."++[pipe.write_menu_card]+type = "PipeSequence"+description = "Turns the kitchen's note into a dish list, then writes the menu card from it"+inputs = { kitchen_note = "KitchenNote" }+output = "MenuCard"+steps = [+ { pipe = "list_dishes", result = "dishes" },+ { pipe = "lay_out_card", result = "menu_card" },+]++[pipe.list_dishes]+type = "PipeLLM"+description = "Names the dishes the kitchen can serve from what it has in"+inputs = { kitchen_note = "KitchenNote" }+output = "Text[]"+prompt = "The kitchen has this in today: $kitchen_note. Name the dishes that can be served from it, one per line."++[pipe.lay_out_card]+type = "PipeLLM"+description = "Writes the dish list out as the menu card the dining room sees"+inputs = { dishes = "Text[]" }+output = "MenuCard"+prompt = "Write these dishes out as a menu card for the dining room: $dishes"diff --git a/pipelex/test_extras/mthds_corpus/entries/controller_sequence_menu_card/entry.toml b/pipelex/test_extras/mthds_corpus/entries/controller_sequence_menu_card/entry.tomlnew file mode 100644index 000000000..bd6cf79a8--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/controller_sequence_menu_card/entry.toml@@ -0,0 +1,10 @@+name = "controller_sequence_menu_card"+description = "A menu card written in two steps from the kitchen's note of what it has in"++validity = "valid"+tier = "dry"+granularity = "focused"++covers = [+ "controller.sequence",+]diff --git a/tests/e2e/pipelex/pipes/additive_multi_file_library/recursive_refinement/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/bundle.mthdssimilarity index 100%rename from tests/e2e/pipelex/pipes/additive_multi_file_library/recursive_refinement/bundle.mthdsrename to pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/bundle.mthdsdiff --git a/tests/e2e/pipelex/pipes/additive_multi_file_library/recursive_refinement/draft_brief.mthds b/pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/draft_brief.mthdssimilarity index 100%rename from tests/e2e/pipelex/pipes/additive_multi_file_library/recursive_refinement/draft_brief.mthdsrename to pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/draft_brief.mthdsdiff --git a/pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/entry.toml b/pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/entry.tomlnew file mode 100644index 000000000..e529e221d--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/entry.toml@@ -0,0 +1,10 @@+name = "feature_multi_file_library_research_brief"+description = "A research brief written from a source document, key findings first"++validity = "valid"+tier = "static"+granularity = "focused"++covers = [+ "feature.multi_file_library",+]diff --git a/tests/e2e/pipelex/pipes/additive_multi_file_library/recursive_refinement/find_key_findings.mthds b/pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/find_key_findings.mthdssimilarity index 100%rename from tests/e2e/pipelex/pipes/additive_multi_file_library/recursive_refinement/find_key_findings.mthdsrename to pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/find_key_findings.mthdsdiff --git a/tests/e2e/pipelex/pipes/additive_multi_file_library/recursive_refinement/write_research_brief.mthds b/pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/write_research_brief.mthdssimilarity index 100%rename from tests/e2e/pipelex/pipes/additive_multi_file_library/recursive_refinement/write_research_brief.mthdsrename to pipelex/test_extras/mthds_corpus/entries/feature_multi_file_library_research_brief/write_research_brief.mthdsdiff --git a/pipelex/test_extras/mthds_corpus/entries/feature_optionals_village_notice/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/feature_optionals_village_notice/bundle.mthdsnew file mode 100644index 000000000..3bd51f049--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/feature_optionals_village_notice/bundle.mthds@@ -0,0 +1,17 @@+domain = "village_noticeboard"+description = "Writing a short notice for the board, where the house-style hint may or may not have been given"+main_pipe = "draft_notice"++[pipe.draft_notice]+type = "PipeLLM"+description = "Drafts the notice, following the house-style hint only when one was given"+inputs = { subject = "Text", style_hint = "Text?" }+output = "Text"+prompt = """+Write one short sentence about $subject for the village noticeboard.++@?style_hint+{% if style_hint is defined %}+Follow the style hint above.+{% endif %}+"""diff --git a/pipelex/test_extras/mthds_corpus/entries/feature_optionals_village_notice/entry.toml b/pipelex/test_extras/mthds_corpus/entries/feature_optionals_village_notice/entry.tomlnew file mode 100644index 000000000..b699a33f4--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/feature_optionals_village_notice/entry.toml@@ -0,0 +1,10 @@+name = "feature_optionals_village_notice"+description = "A village noticeboard entry written up, in a house style when one is given"++validity = "valid"+tier = "dry"+granularity = "focused"++covers = [+ "feature.optionals",+]diff --git a/tests/e2e/pipelex/pipes/smart_inputs/smart_inputs_triage/smart_inputs_triage.mthds b/pipelex/test_extras/mthds_corpus/entries/feature_smart_inputs_claims_triage/bundle.mthdssimilarity index 61%rename from tests/e2e/pipelex/pipes/smart_inputs/smart_inputs_triage/smart_inputs_triage.mthdsrename to pipelex/test_extras/mthds_corpus/entries/feature_smart_inputs_claims_triage/bundle.mthdsindex 5882dd033..1cdd930f4 100644--- a/tests/e2e/pipelex/pipes/smart_inputs/smart_inputs_triage/smart_inputs_triage.mthds+++ b/pipelex/test_extras/mthds_corpus/entries/feature_smart_inputs_claims_triage/bundle.mthds@@ -1,21 +1,21 @@-domain = "smart_inputs_demo"-description = "Bare caller values shaped top-down against the declared signature (Smart Inputs, Phase 2)"+domain = "claims_desk"+description = "Summarising a claim from the bare values the desk clerk typed in"main_pipe = "triage_case"[concept.Question]-description = "A question posed to the triage desk"+description = "A question put to the claims desk"refines = "Text"[concept.Priority]-description = "A numeric priority score"+description = "How urgently the claim needs answering, as a score"refines = "Number"[concept.Tag]-description = "A short routing label"+description = "A short routing label written on the claim"refines = "Text"[concept.Invoice]-description = "An invoice attached to the case"+description = "The invoice attached to the claim"[concept.Invoice.structure]invoice_number = { type = "text", description = "The invoice number", required = true }@@ -23,7 +23,7 @@ amount = { type = "number", description = "The invoice amount", required[pipe.triage_case]type = "PipeLLM"-description = "Triage a case given a bare question, priority, invoice and tags"+description = "Writes the one-line triage summary from the question, priority, invoice and tags"inputs = { question = "Question", priority = "Priority", invoice = "Invoice", tags = "Tag[]" }output = "Text"prompt = """diff --git a/pipelex/test_extras/mthds_corpus/entries/feature_smart_inputs_claims_triage/entry.toml b/pipelex/test_extras/mthds_corpus/entries/feature_smart_inputs_claims_triage/entry.tomlnew file mode 100644index 000000000..496514159--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/feature_smart_inputs_claims_triage/entry.toml@@ -0,0 +1,10 @@+name = "feature_smart_inputs_claims_triage"+description = "An insurance claim sorted by its amount, its description and the notes filed with it"++validity = "valid"+tier = "dry"+granularity = "focused"++covers = [+ "feature.smart_inputs",+]diff --git a/pipelex/test_extras/mthds_corpus/entries/feature_structured_output_delivery_round/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/feature_structured_output_delivery_round/bundle.mthdsnew file mode 100644index 000000000..9636811f8--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/feature_structured_output_delivery_round/bundle.mthds@@ -0,0 +1,32 @@+domain = "delivery_rounds"+description = "Reading a driver's handwritten round sheet into the shape the depot files it in"+main_pipe = "read_round_sheet"++[concept.Stop]+description = "One address on the round, and what is being left there"++[concept.Stop.structure]+address = { type = "text", description = "The address the driver stops at", required = true }+parcels = { type = "list", item_type = "text", description = "The parcel numbers left at this address", required = true }+access_note = { type = "text", description = "How to get in, when the driver wrote something down", required = false }++[concept.DeliveryRound]+description = "A day's round as the depot files it"++[concept.DeliveryRound.structure]+round_date = { type = "text", description = "The day the round was driven, as written on the sheet", required = true }+driver = { type = "text", description = "Who drove the round", required = true }+stops = { type = "list", item_type = "Stop", description = "Every stop on the round, in the order they were driven", required = true }+depot_note = { type = "text", description = "Anything the depot added afterwards", required = false }++[pipe.read_round_sheet]+type = "PipeLLM"+description = "Reads the handwritten round sheet into the filed shape, stop by stop"+inputs = { round_sheet = "Text" }+output = "DeliveryRound"+prompt = """+Read this round sheet and file it. List every stop in the order it was driven, with the parcel+numbers left there, and copy any access note the driver wrote. Leave a note out when there is none.++$round_sheet+"""diff --git a/pipelex/test_extras/mthds_corpus/entries/feature_structured_output_delivery_round/entry.toml b/pipelex/test_extras/mthds_corpus/entries/feature_structured_output_delivery_round/entry.tomlnew file mode 100644index 000000000..a60e8cb80--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/feature_structured_output_delivery_round/entry.toml@@ -0,0 +1,10 @@+name = "feature_structured_output_delivery_round"+description = "A driver's round sheet filed into stops, each with its parcels and any access note"++validity = "valid"+tier = "dry"+granularity = "composite"++covers = [+ "feature.structured_output",+]diff --git a/pipelex/test_extras/mthds_corpus/entries/feature_structured_output_delivery_round/inputs.json b/pipelex/test_extras/mthds_corpus/entries/feature_structured_output_delivery_round/inputs.jsonnew file mode 100644index 000000000..af921b184--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/feature_structured_output_delivery_round/inputs.json@@ -0,0 +1,8 @@+{+ "round_sheet": {+ "concept": "native.Text",+ "content": {+ "text": "Tue 12 May - Yann.\n14 Rue des Lilas, Rennes: RB884120, RB884121. Gate code 4417, leave under the porch.\n2 Place du Marche: RB884133.\n8 Chemin du Moulin: RB884140, RB884141, RB884142. Dog in the yard, ring first."+ }+ }+}diff --git a/pipelex/test_extras/mthds_corpus/entries/native_composite_weather_report/entry.toml b/pipelex/test_extras/mthds_corpus/entries/native_composite_weather_report/entry.tomlindex 8f732cecf..398796667 100644--- a/pipelex/test_extras/mthds_corpus/entries/native_composite_weather_report/entry.toml+++ b/pipelex/test_extras/mthds_corpus/entries/native_composite_weather_report/entry.toml@@ -7,4 +7,5 @@ granularity = "focused"covers = ["native.composite",+ "controller.parallel",]diff --git a/pipelex/test_extras/mthds_corpus/entries/native_text_delay_notice/entry.toml b/pipelex/test_extras/mthds_corpus/entries/native_text_delay_notice/entry.tomlindex be5b9c7d5..36adece2e 100644--- a/pipelex/test_extras/mthds_corpus/entries/native_text_delay_notice/entry.toml+++ b/pipelex/test_extras/mthds_corpus/entries/native_text_delay_notice/entry.toml@@ -7,4 +7,5 @@ granularity = "focused"covers = ["native.text",+ "operator.llm",]diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_compose_delivery_docket/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/operator_compose_delivery_docket/bundle.mthdsnew file mode 100644index 000000000..c57af85cc--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_compose_delivery_docket/bundle.mthds@@ -0,0 +1,29 @@+domain = "deliveries"+description = "Writing out the docket that travels with a weighed parcel"+main_pipe = "write_docket"++[concept.WeighedParcel]+description = "A parcel after it has been weighed at the counter"++[concept.WeighedParcel.structure]+weight_kg = { type = "number", description = "What the parcel weighs on the counter scale, in kilograms", required = true }+destination = { type = "text", description = "The town the parcel is going to", required = true }++[concept.DeliveryDocket]+description = "The docket stapled to a parcel before it leaves the counter"++[concept.DeliveryDocket.structure]+weight_kg = { type = "number", description = "What the parcel weighs, copied from the counter scale", required = true }+destination = { type = "text", description = "The town the parcel is going to", required = true }+carrier = { type = "text", description = "Who is taking the parcel out", required = true }++[pipe.write_docket]+type = "PipeCompose"+description = "Puts the weighed parcel and the carrier's name together into the docket"+inputs = { parcel = "WeighedParcel", carrier = "Text" }+output = "DeliveryDocket"++[pipe.write_docket.construct]+weight_kg = { from = "parcel.weight_kg" }+destination = { from = "parcel.destination" }+carrier = { from = "carrier" }diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_compose_delivery_docket/entry.toml b/pipelex/test_extras/mthds_corpus/entries/operator_compose_delivery_docket/entry.tomlnew file mode 100644index 000000000..15bd65537--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_compose_delivery_docket/entry.toml@@ -0,0 +1,10 @@+name = "operator_compose_delivery_docket"+description = "A delivery docket built from a weighed parcel and the carrier's name"++validity = "valid"+tier = "offline"+granularity = "focused"++covers = [+ "operator.compose",+]diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_compose_delivery_docket/inputs.json b/pipelex/test_extras/mthds_corpus/entries/operator_compose_delivery_docket/inputs.jsonnew file mode 100644index 000000000..c02353e30--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_compose_delivery_docket/inputs.json@@ -0,0 +1,15 @@+{+ "parcel": {+ "concept": "deliveries.WeighedParcel",+ "content": {+ "weight_kg": 3.4,+ "destination": "Quimper"+ }+ },+ "carrier": {+ "concept": "native.Text",+ "content": {+ "text": "Morvan et Fils"+ }+ }+}diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_extract_invoice_pages/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/operator_extract_invoice_pages/bundle.mthdsnew file mode 100644index 000000000..282bdccb6--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_extract_invoice_pages/bundle.mthds@@ -0,0 +1,9 @@+domain = "accounts_payable"+description = "Reading the pages out of a supplier invoice that arrived as a scan"+main_pipe = "read_invoice_pages"++[pipe.read_invoice_pages]+type = "PipeExtract"+description = "Reads each page out of a scanned supplier invoice"+inputs = { invoice_scan = "Document" }+output = "Page[]"diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_extract_invoice_pages/entry.toml b/pipelex/test_extras/mthds_corpus/entries/operator_extract_invoice_pages/entry.tomlnew file mode 100644index 000000000..22c323b9f--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_extract_invoice_pages/entry.toml@@ -0,0 +1,10 @@+name = "operator_extract_invoice_pages"+description = "The pages read out of a scanned supplier invoice"++validity = "valid"+tier = "inference"+granularity = "focused"++covers = [+ "operator.extract",+]diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_img_gen_garden_sign/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/operator_img_gen_garden_sign/bundle.mthdsnew file mode 100644index 000000000..5f83cb725--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_img_gen_garden_sign/bundle.mthds@@ -0,0 +1,9 @@+domain = "garden_signage"+description = "Drawing the little painted signs that mark the beds in a kitchen garden"+main_pipe = "draw_bed_sign"++[pipe.draw_bed_sign]+type = "PipeImgGen"+description = "Draws a weathered wooden sign for a vegetable bed"+output = "Image"+prompt = "A small weathered wooden sign staked in dark garden soil, hand-painted with the word RHUBARB, morning light"diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_img_gen_garden_sign/entry.toml b/pipelex/test_extras/mthds_corpus/entries/operator_img_gen_garden_sign/entry.tomlnew file mode 100644index 000000000..c0fc1b505--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_img_gen_garden_sign/entry.toml@@ -0,0 +1,10 @@+name = "operator_img_gen_garden_sign"+description = "A painted wooden sign for a vegetable bed, drawn from a description"++validity = "valid"+tier = "inference"+granularity = "focused"++covers = [+ "operator.img_gen",+]diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_search_supplier_lead/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/operator_search_supplier_lead/bundle.mthdsnew file mode 100644index 000000000..43786aac8--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_search_supplier_lead/bundle.mthds@@ -0,0 +1,10 @@+domain = "procurement"+description = "Looking up where a hard-to-source part can be bought"+main_pipe = "find_supplier"++[pipe.find_supplier]+type = "PipeSearch"+description = "Looks up suppliers who stock the part"+inputs = { part_name = "Text" }+output = "SearchResult"+prompt = "Which suppliers currently stock $part_name, and what do they charge?"diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_search_supplier_lead/entry.toml b/pipelex/test_extras/mthds_corpus/entries/operator_search_supplier_lead/entry.tomlnew file mode 100644index 000000000..60e047c3f--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_search_supplier_lead/entry.toml@@ -0,0 +1,10 @@+name = "operator_search_supplier_lead"+description = "A lookup for suppliers who stock a hard-to-source part"++validity = "valid"+tier = "inference"+granularity = "focused"++covers = [+ "operator.search",+]diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_structure_opening_hours/bundle.mthds b/pipelex/test_extras/mthds_corpus/entries/operator_structure_opening_hours/bundle.mthdsnew file mode 100644index 000000000..15d53e10a--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_structure_opening_hours/bundle.mthds@@ -0,0 +1,17 @@+domain = "shop_hours"+description = "Turning the opening hours written on a shop door into fields"+main_pipe = "read_opening_hours"++[concept.OpeningHours]+description = "The hours a shop is open on a given day"++[concept.OpeningHours.structure]+day = { type = "text", description = "The day of the week the hours apply to", required = true }+opens = { type = "text", description = "The time the shop opens, as written on the door", required = true }+closes = { type = "text", description = "The time the shop closes, as written on the door", required = true }++[pipe.read_opening_hours]+type = "PipeStructure"+description = "Reads a line of opening hours off a shop door and fills in the fields"+inputs = { door_notice = "Text" }+output = "OpeningHours"diff --git a/pipelex/test_extras/mthds_corpus/entries/operator_structure_opening_hours/entry.toml b/pipelex/test_extras/mthds_corpus/entries/operator_structure_opening_hours/entry.tomlnew file mode 100644index 000000000..47600278a--- /dev/null+++ b/pipelex/test_extras/mthds_corpus/entries/operator_structure_opening_hours/entry.toml@@ -0,0 +1,11 @@+name = "operator_structure_opening_hours"+description = "The opening hours written on a shop door, read into fields"++validity = "valid"+tier = "dry"+granularity = "focused"++covers = [+ "operator.structure",+ "feature.structured_output",+]diff --git a/pipelex/test_extras/mthds_corpus/vocabulary.py b/pipelex/test_extras/mthds_corpus/vocabulary.pyindex 6632ff56e..2800ae191 100644--- a/pipelex/test_extras/mthds_corpus/vocabulary.py+++ b/pipelex/test_extras/mthds_corpus/vocabulary.py@@ -19,13 +19,24 @@ VOCABULARY_FILE_NAME = "vocabulary.toml"class VocabularyTag(BaseModel):"""One tag in the vocabulary.- ``code`` is the registry code the tag was generated from. ``excluded`` carries the reason a- tag is not required to have a focused entry, and is present only on excluded tags.+ A tag says where it came from, and the two kinds of namespace answer that differently.+ A **generated** tag carries ``code``, the registry code it was derived from. A+ **hand-maintained** tag has no registry to point at, so it carries ``description`` — a+ one-line statement of the language feature it names, which is the only place that meaning+ can live. ``excluded`` carries the reason a tag is not required to have a focused entry,+ and is present only on excluded tags.++ All three fields are optional here, and no validator enforces the ``code``-or-``description``+ split, deliberately. This model only *reads*: the generator is the single writer, and the+ drift gate regenerates the committed file in memory and compares it byte for byte, so a tag+ carrying neither cannot reach a reader through the channel this model serves. A validator+ would guard a state the pipeline cannot produce."""model_config = ConfigDict(extra="forbid", frozen=True)- code: str+ code: str | None = None+ description: str | None = Noneexcluded: str | None = Nonediff --git a/pipelex/test_extras/mthds_corpus/vocabulary.toml b/pipelex/test_extras/mthds_corpus/vocabulary.tomlindex 82e658a9f..3915b8b45 100644--- a/pipelex/test_extras/mthds_corpus/vocabulary.toml+++ b/pipelex/test_extras/mthds_corpus/vocabulary.toml@@ -1,8 +1,9 @@# The MTHDS Test Corpus tag vocabulary — the closed set an entry's `covers` draws from.#-# GENERATED by `pipelex-dev generate-corpus-vocabulary`. Do not edit this file: the generated-# namespaces are derived from the runtime's own registries, and every exclusion reason is-# declared in the generator's source.+# GENERATED by `pipelex-dev generate-corpus-vocabulary`. Do not edit this file: `native.*`,+# `operator.*` and `controller.*` are derived from the runtime's own registries, `feature.*` is+# hand-maintained in the generator because no registry describes a language feature, and every+# exclusion reason is declared in the generator's source alongside them.## This file ships in the pipelex wheel, so it names a document its readers can reach:# https://docs.pipelex.com/contribute/mthds-test-corpus/ — which in turn points at the@@ -52,3 +53,49 @@ code = "Anything"[native.composite]code = "Composite"++[operator.func]+code = "PipeFunc"+excluded = "A PipeFunc names a Python function that is resolved against the runtime's function registry at validation time, so an entry declaring one fails with \"Function '<name>' not found in registry\" in every consumer that has not registered that exact function. A corpus entry has to validate everywhere, and the cross-language consumers cannot register a Python function at all, so no portable focused entry exists. Exercise PipeFunc in a consumer's own fixtures."++[operator.img_gen]+code = "PipeImgGen"++[operator.compose]+code = "PipeCompose"++[operator.llm]+code = "PipeLLM"++[operator.extract]+code = "PipeExtract"++[operator.search]+code = "PipeSearch"++[operator.structure]+code = "PipeStructure"++[controller.batch]+code = "PipeBatch"++[controller.condition]+code = "PipeCondition"++[controller.parallel]+code = "PipeParallel"++[controller.sequence]+code = "PipeSequence"++[feature.multi_file_library]+description = "A method split across several `.mthds` files in one directory and merged additively behind a `bundle.mthds` entry point, so a pipe can be forward-declared as a signature in one file and satisfied by a concrete definition in another."++[feature.optionals]+description = "An input declared optional with the `?` suffix, so a run that has no value for it proceeds instead of failing and the absence is recorded in the working memory. How a method copes with the absence is the method's business — guarding the reference in a prompt, in a condition expression, or letting it lift through a chain."++[feature.smart_inputs]+description = "Bare caller values — a string, a number, a dict, a list — interpreted top-down against the entry pipe's declared signature, so a caller need not wrap each one in its concept envelope."++[feature.structured_output]+description = "A concept declaring a `structure` table of typed fields, and a pipe producing that shape rather than free text, so the runtime validates the output against the declared fields."diff --git a/tests/e2e/pipelex/pipes/additive_multi_file_library/test_recursive_refinement.py b/tests/e2e/pipelex/pipes/additive_multi_file_library/test_recursive_refinement.pyindex d322e16dd..e835fbb64 100644--- a/tests/e2e/pipelex/pipes/additive_multi_file_library/test_recursive_refinement.py+++ b/tests/e2e/pipelex/pipes/additive_multi_file_library/test_recursive_refinement.py@@ -15,15 +15,18 @@ likewise. After the additive merge the concretes win at every level and the bund"""from collections.abc import Callable-from pathlib import Pathimport pytestfrom pipelex.pipe_controllers.sequence.pipe_sequence import PipeSequencefrom pipelex.pipe_operators.llm.pipe_llm import PipeLLMfrom pipelex.pipeline.validate_bundle import validate_bundles_from_directory+from pipelex.test_extras.mthds_corpus.loader import get_entry-_BUNDLE_DIR = Path(__file__).parent / "recursive_refinement"+# The library is a corpus entry, not a fixture local to this test: the corpus is the single source+# for language-level `.mthds` methods, and covering `feature.multi_file_library` is exactly why the+# entry exists. The whole directory is the subject here — that is what a multi-file library means.+_BUNDLE_DIR = get_entry(name="feature_multi_file_library_research_brief").directory@pytest.mark.asyncio(loop_scope="class")diff --git a/tests/e2e/pipelex/pipes/optionals/prompt_guard/prompt_guard.mthds b/tests/e2e/pipelex/pipes/optionals/prompt_guard/prompt_guard.mthdsdeleted file mode 100644index 652cc0528..000000000--- a/tests/e2e/pipelex/pipes/optionals/prompt_guard/prompt_guard.mthds+++ /dev/null@@ -1,17 +0,0 @@-domain = "opt_prompt_guard"-description = "PipeLLM whose prompt guards a declared-optional input (dry-run keyless)"-main_pipe = "opg_draft_note"--[pipe.opg_draft_note]-type = "PipeLLM"-description = "Drafts a note; the optional style hint is guarded via the optional sigil and an if-defined block"-inputs = { topic = "Text", style_hint = "Text?" }-output = "Text"-prompt = """-Write one short sentence about $topic.--@?style_hint-{% if style_hint is defined %}-Follow the style hint above.-{% endif %}-"""diff --git a/tests/e2e/pipelex/pipes/optionals/test_prompt_guard_dry_run.py b/tests/e2e/pipelex/pipes/optionals/test_prompt_guard_dry_run.pyindex 74557cc57..58cf679c6 100644--- a/tests/e2e/pipelex/pipes/optionals/test_prompt_guard_dry_run.py+++ b/tests/e2e/pipelex/pipes/optionals/test_prompt_guard_dry_run.py@@ -3,16 +3,17 @@ the live render path (only the cogt leaf mocks), so completing the run proves threndered correctly with the optional input genuinely absent — no API key involved."""-from pathlib import Path-import pytestfrom pipelex.core.memory.absence import AbsenceKindfrom pipelex.pipeline.pipeline_response import RunStatefrom pipelex.pipeline.runner import PipelexMTHDSProtocolfrom pipelex.system.pipe_run_mode import PipeRunMode+from pipelex.test_extras.mthds_corpus.loader import get_entry-_FIXTURE_DIR = Path(__file__).parent / "prompt_guard"+# The bundle is a corpus entry, not a fixture local to this test: the corpus is the single source for+# language-level `.mthds` methods, and covering `feature.optionals` is exactly why the entry exists.+_FIXTURE_DIR = get_entry(name="feature_optionals_village_notice").directory@pytest.mark.asyncio(loop_scope="class")@@ -24,7 +25,7 @@ class TestPromptGuardDryRun:"""runner = PipelexMTHDSProtocol(library_dirs=[str(_FIXTURE_DIR)], pipe_run_mode=PipeRunMode.DRY)- response = await runner.execute(pipe_code="opg_draft_note", inputs={"topic": "quantum computing"})+ response = await runner.execute(pipe_code="draft_notice", inputs={"subject": "the bus timetable change"})assert response.state == RunState.COMPLETEDassert response.pipe_output.main_stuff.as_text.text@@ -41,7 +42,7 @@ class TestPromptGuardDryRun:"""runner = PipelexMTHDSProtocol(library_dirs=[str(_FIXTURE_DIR)], pipe_run_mode=PipeRunMode.DRY)- response = await runner.execute(pipe_code="opg_draft_note", inputs={"topic": "quantum computing", "style_hint": "keep it formal"})+ response = await runner.execute(pipe_code="draft_notice", inputs={"subject": "the bus timetable change", "style_hint": "keep it formal"})assert response.state == RunState.COMPLETEDmemory = response.pipe_output.working_memorydiff --git a/tests/e2e/pipelex/pipes/smart_inputs/test_smart_inputs_dry_run.py b/tests/e2e/pipelex/pipes/smart_inputs/test_smart_inputs_dry_run.pyindex 8754891f6..aa0509b1f 100644--- a/tests/e2e/pipelex/pipes/smart_inputs/test_smart_inputs_dry_run.py+++ b/tests/e2e/pipelex/pipes/smart_inputs/test_smart_inputs_dry_run.py@@ -12,7 +12,6 @@ narrow `PipelineInputs` alias does not (D10 widening is release-gated), which isshape a real caller sends."""-from pathlib import Pathfrom typing import TYPE_CHECKING, Any, castimport pytest@@ -25,11 +24,14 @@ from pipelex.core.stuffs.text_content import TextContentfrom pipelex.pipeline.pipeline_response import RunStatefrom pipelex.pipeline.runner import PipelexMTHDSProtocolfrom pipelex.system.pipe_run_mode import PipeRunMode+from pipelex.test_extras.mthds_corpus.loader import get_entryif TYPE_CHECKING:from pipelex.core.stuffs.stuff_content import StuffContent-_FIXTURE_DIR = Path(__file__).parent / "smart_inputs_triage"+# The bundle is a corpus entry, not a fixture local to this test: the corpus is the single source for+# language-level `.mthds` methods, and covering `feature.smart_inputs` is exactly why the entry exists.+_FIXTURE_DIR = get_entry(name="feature_smart_inputs_claims_triage").directory@pytest.mark.asyncio(loop_scope="class")@@ -50,22 +52,22 @@ class TestSmartInputsDryRun:working_memory = response.pipe_output.working_memoryquestion_stuff = working_memory.get_stuff("question")- assert question_stuff.concept.concept_ref == "smart_inputs_demo.Question"+ assert question_stuff.concept.concept_ref == "claims_desk.Question"assert isinstance(question_stuff.content, TextContent)assert question_stuff.content.text == "What are the late fees?"priority_stuff = working_memory.get_stuff("priority")- assert priority_stuff.concept.concept_ref == "smart_inputs_demo.Priority"+ assert priority_stuff.concept.concept_ref == "claims_desk.Priority"assert isinstance(priority_stuff.content, NumberContent)assert priority_stuff.content.number == 3invoice_stuff = working_memory.get_stuff("invoice")- assert invoice_stuff.concept.concept_ref == "smart_inputs_demo.Invoice"+ assert invoice_stuff.concept.concept_ref == "claims_desk.Invoice"assert isinstance(invoice_stuff.content, StructuredContent)assert invoice_stuff.content.model_dump() == {"invoice_number": "INV-042", "amount": 1250.0}tags_stuff = working_memory.get_stuff("tags")- assert tags_stuff.concept.concept_ref == "smart_inputs_demo.Tag"+ assert tags_stuff.concept.concept_ref == "claims_desk.Tag"tags_content: StuffContent = tags_stuff.contentassert isinstance(tags_content, ListContent)tags_list = cast("ListContent[StuffContent]", tags_content)@@ -86,7 +88,7 @@ class TestSmartInputsDryRun:assert response.state == RunState.COMPLETEDtags_stuff = response.pipe_output.working_memory.get_stuff("tags")- assert tags_stuff.concept.concept_ref == "smart_inputs_demo.Tag"+ assert tags_stuff.concept.concept_ref == "claims_desk.Tag"tags_content: StuffContent = tags_stuff.contentassert isinstance(tags_content, ListContent)tags_list = cast("ListContent[StuffContent]", tags_content)diff --git a/tests/e2e/pipelex/pipes/smart_inputs/test_smart_inputs_light_roundtrip.py b/tests/e2e/pipelex/pipes/smart_inputs/test_smart_inputs_light_roundtrip.pyindex 50f1d21d2..c46c8b433 100644--- a/tests/e2e/pipelex/pipes/smart_inputs/test_smart_inputs_light_roundtrip.py+++ b/tests/e2e/pipelex/pipes/smart_inputs/test_smart_inputs_light_roundtrip.py@@ -13,7 +13,6 @@ The TOML twin of this round trip (through the real binary) lives infrom __future__ import annotationsimport json-from pathlib import Pathfrom typing import TYPE_CHECKING, Anyimport pytest@@ -30,12 +29,16 @@ from pipelex.pipeline.pipeline_response import RunStatefrom pipelex.pipeline.runner import PipelexMTHDSProtocolfrom pipelex.pipeline.validate_bundle import validate_bundlefrom pipelex.system.pipe_run_mode import PipeRunMode+from pipelex.test_extras.mthds_corpus.loader import get_entryif TYPE_CHECKING:from collections.abc import Callable-_FIXTURE_DIR = Path(__file__).parent / "smart_inputs_triage"-_BUNDLE = _FIXTURE_DIR / "smart_inputs_triage.mthds"+# The bundle is a corpus entry, not a fixture local to this test: the corpus is the single source for+# language-level `.mthds` methods, and covering `feature.smart_inputs` is exactly why the entry exists.+_ENTRY = get_entry(name="feature_smart_inputs_claims_triage")+_FIXTURE_DIR = _ENTRY.directory+_BUNDLE = _ENTRY.bundle_pathdef _teardown_validation_library(outer_library_id: str) -> None:@@ -53,7 +56,7 @@ class TestSmartInputsLightRoundTrip:outer_library_id = load_empty_library()try:await validate_bundle(mthds_file_path=_BUNDLE)- the_pipe = get_required_entry_pipe(pipe_code="smart_inputs_demo.triage_case")+ the_pipe = get_required_entry_pipe(pipe_code="claims_desk.triage_case")light_inputs: dict[str, Any] = json.loads(render_inputs(the_pipe))finally:_teardown_validation_library(outer_library_id)@@ -64,7 +67,7 @@ class TestSmartInputsLightRoundTrip:assert response.state == RunState.COMPLETEDworking_memory = response.pipe_output.working_memory- assert working_memory.get_stuff("question").concept.concept_ref == "smart_inputs_demo.Question"- assert working_memory.get_stuff("priority").concept.concept_ref == "smart_inputs_demo.Priority"- assert working_memory.get_stuff("invoice").concept.concept_ref == "smart_inputs_demo.Invoice"- assert working_memory.get_stuff("tags").concept.concept_ref == "smart_inputs_demo.Tag"+ assert working_memory.get_stuff("question").concept.concept_ref == "claims_desk.Question"+ assert working_memory.get_stuff("priority").concept.concept_ref == "claims_desk.Priority"+ assert working_memory.get_stuff("invoice").concept.concept_ref == "claims_desk.Invoice"+ assert working_memory.get_stuff("tags").concept.concept_ref == "claims_desk.Tag"diff --git a/tests/integration/pipelex/pipe_machinery/test_input_renderer_light_golden.py b/tests/integration/pipelex/pipe_machinery/test_input_renderer_light_golden.pyindex 460038f09..5fb91a9ee 100644--- a/tests/integration/pipelex/pipe_machinery/test_input_renderer_light_golden.py+++ b/tests/integration/pipelex/pipe_machinery/test_input_renderer_light_golden.py@@ -30,6 +30,7 @@ from pipelex.interpreter_hub import ()from pipelex.pipe_machinery.rendering.input_renderer import render_inputs, render_inputs_tomlfrom pipelex.pipeline.validate_bundle import validate_bundle+from pipelex.test_extras.mthds_corpus.loader import get_entryif TYPE_CHECKING:from collections.abc import Callable@@ -39,7 +40,9 @@ if TYPE_CHECKING:#: test followed `input_renderer` out of `core/pipes/` into the `pipe_machinery/` mirror._TESTS_ROOT = next(parent for parent in Path(__file__).parents if parent.name == "tests")_SMART_INPUTS = _TESTS_ROOT / "e2e" / "pipelex" / "pipes" / "smart_inputs"-_TRIAGE = _SMART_INPUTS / "smart_inputs_triage" / "smart_inputs_triage.mthds"+#: The triage bundle is a corpus entry now — the corpus is the single source for language-level+#: `.mthds` methods, and `feature.smart_inputs` is exactly what this golden renders against.+_TRIAGE = get_entry(name="feature_smart_inputs_claims_triage").bundle_path_FILES = _SMART_INPUTS / "smart_inputs_files" / "smart_inputs_files.mthds"@@ -62,7 +65,7 @@ class TestInputRendererLightGolden:async def test_triage_light_json_default(self, load_empty_library: Callable[[], str]) -> None:"""The default JSON template is the light shape: bare string/number, structured dict, list of bare strings."""- the_pipe, outer_library_id = await self._load_pipe(_TRIAGE, pipe_ref="smart_inputs_demo.triage_case", load_empty_library=load_empty_library)+ the_pipe, outer_library_id = await self._load_pipe(_TRIAGE, pipe_ref="claims_desk.triage_case", load_empty_library=load_empty_library)try:light = json.loads(render_inputs(the_pipe))finally:@@ -77,15 +80,15 @@ class TestInputRendererLightGolden:async def test_triage_light_toml_carries_concept_comments(self, load_empty_library: Callable[[], str]) -> None:"""The default TOML template carries the declared concept as a comment and loads back to the light dict."""- the_pipe, outer_library_id = await self._load_pipe(_TRIAGE, pipe_ref="smart_inputs_demo.triage_case", load_empty_library=load_empty_library)+ the_pipe, outer_library_id = await self._load_pipe(_TRIAGE, pipe_ref="claims_desk.triage_case", load_empty_library=load_empty_library)try:toml_str = render_inputs_toml(the_pipe)finally:_teardown_validation_library(outer_library_id)- assert "# concept: smart_inputs_demo.Question" in toml_str- assert "# concept: smart_inputs_demo.Priority" in toml_str- assert "# concept: smart_inputs_demo.Tag[]" in toml_str+ assert "# concept: claims_desk.Question" in toml_str+ assert "# concept: claims_desk.Priority" in toml_str+ assert "# concept: claims_desk.Tag[]" in toml_strassert tomli.loads(toml_str) == {"question": "text_value","priority": 1,@@ -95,16 +98,16 @@ class TestInputRendererLightGolden:async def test_triage_explicit_reproduces_envelope(self, load_empty_library: Callable[[], str]) -> None:"""--explicit reproduces the ceremonial {concept, content} envelope, in both JSON and TOML."""- the_pipe, outer_library_id = await self._load_pipe(_TRIAGE, pipe_ref="smart_inputs_demo.triage_case", load_empty_library=load_empty_library)+ the_pipe, outer_library_id = await self._load_pipe(_TRIAGE, pipe_ref="claims_desk.triage_case", load_empty_library=load_empty_library)try:envelope = json.loads(render_inputs(the_pipe, explicit=True))envelope_toml = tomli.loads(render_inputs_toml(the_pipe, explicit=True))finally:_teardown_validation_library(outer_library_id)- assert envelope["question"] == {"concept": "smart_inputs_demo.Question", "content": {"text": "text_value"}}- assert envelope["priority"] == {"concept": "smart_inputs_demo.Priority", "content": {"number": 1}}- assert envelope["tags"] == {"concept": "smart_inputs_demo.Tag", "content": [{"text": "text_value"}]}+ assert envelope["question"] == {"concept": "claims_desk.Question", "content": {"text": "text_value"}}+ assert envelope["priority"] == {"concept": "claims_desk.Priority", "content": {"number": 1}}+ assert envelope["tags"] == {"concept": "claims_desk.Tag", "content": [{"text": "text_value"}]}assert envelope_toml == envelopeasync def test_files_light_json_file_ish_and_structured_list(self, load_empty_library: Callable[[], str]) -> None: