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.
Follow-ups to #1104: strict templating tables, keyless pipelex run --dry-run (#1106)
Louis Choquel021426770151
diff --git a/.drift/acks/cli-docs.toml b/.drift/acks/cli-docs.tomlindex f5a505fd2..cb91e5b60 100644--- a/.drift/acks/cli-docs.toml+++ b/.drift/acks/cli-docs.toml@@ -1,8 +1,8 @@contract = "cli-docs"-digest = "sha256:37ba3d59b8016e418d82b22c4a7a735c142d19bafd2fbbe856536d1a176de065"+digest = "sha256:91b2f3b364728697c389ea2e1b2bf030a20e841e9d9c7bd176fc16b2faf7f3ee"reviewed_by = "Louis Choquel"-reviewed_at = "2026-08-13T11:03:30Z"-rationale = "Review-fix round: the four edited CLI files only change a stderr failure-message prefix from a wrong 'not found'/'Could not find' verdict to a verdict-neutral one so ambiguity failures read truthfully. Reviewed both targets: docs/tools/cli (incl. build/runner|inputs|output pages and codegen surface) documents no error-message text for these commands, and the agent-CLI CLAUDE.md covers only the agent CLI these bare-CLI edits do not touch. No doc change needed."+reviewed_at = "2026-08-15T07:04:47Z"+rationale = "pipelex run --dry-run now boots keyless (needs_inference=not dry_run, needs_model_specs=True), matching pipelex-agent run --dry-run. Reviewed docs/tools/cli/run.md and noted on each --dry-run flag row that no inference credentials are needed; agent-CLI CLAUDE.md already describes the keyless dry-run boot and is unaffected by this bare-CLI change."[trigger_files]"pipelex/cli/__init__.py" = "blob:8b137891791fe96927ad78e64b0aad7bded08bdc"@@ -109,7 +109,7 @@ rationale = "Review-fix round: the four edited CLI files only change a stderr fa"pipelex/cli/commands/run/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391""pipelex/cli/commands/run/_inputs_file_loader.py" = "blob:dde781f846968b667a0acfb4b3e3cea01cef7049""pipelex/cli/commands/run/_inputs_path_resolver.py" = "blob:c8ec89d98718e18af7aaaded44c9f545be60adab"-"pipelex/cli/commands/run/_run_core.py" = "blob:5774e72d68107fcf49355bcb95cfac2924c2af30"+"pipelex/cli/commands/run/_run_core.py" = "blob:c2fe39ee9a1c26656847094240d673f3fad6ebd9""pipelex/cli/commands/run/app.py" = "blob:a7090b0ff6bf2f1d47827fa27d2a138096a2e148""pipelex/cli/commands/run/bundle_cmd.py" = "blob:cb420bf4879c863d64c5e20ed535c42732b720a2""pipelex/cli/commands/run/exceptions.py" = "blob:e9552226e597922b6ac0757f7b52eb880a2e1472"diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2c2b5f5d6..204e8d230 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,6 +8,8 @@- **Compose, image-generation, search and structuring prompts follow the same default (Breaking)**: These paths previously rendered style-less, which the Jinja2 filters silently absorbed as triple-backticks and plain text. They now resolve the same runtime default as the LLM path. Any template of yours that uses `| tag` — including `PipeCompose` templates and construct-mode template fields — changes shape accordingly, whichever model family you run on.- **Templating filters are strict**: The `tag`, `format` and `with_images` Jinja2 filters no longer fall back to a built-in style when the rendering context carries none; a missing tag style or text format raises `Jinja2ContextError`. Every prompt-rendering entry point now supplies a resolved style, so a missing one is a bug rather than a shape nobody chose. An explicit filter argument (`| format("markdown")`) is unaffected, and an unknown format name is now reported as a template error instead of a bare `ValueError`.- **Reasoning budgets are worker-owned**: The thinking-budget lookup is keyed by a family constant on the worker class rather than read from the model spec's `prompting_target`. Behavior is unchanged; the budget maps keep their `anthropic` and `gemini` keys.+- **`templating_style` tables reject unknown keys (Breaking)**: `TemplatingStyle` and the rich template table of `PipeCompose` (`[pipe.name.template]`, i.e. `TemplateBlueprint`) are now `extra="forbid"` like every other blueprint. A misspelled optional key — `{ tag_style = "xml", text_formt = "markdown" }`, or `templating_stile` / `extra_contxt` on a template table — used to be dropped silently, yielding a prompt rendered under a shape the author never asked for; it is a validation error now. The MTHDS JSON Schema gains `additionalProperties: false` on both definitions.+- **`pipelex run --dry-run` no longer requires credentials**: A dry run makes no inference call, so it now boots keyless (every run forced to DRY) with real model specs — the same boot `pipelex-agent run --dry-run` already used. Until now `pipelex run --dry-run` booted as if for a live run and failed outright on a machine without an API key, while the agent CLI succeeded; the two CLIs now agree. Anyone who relied on `pipelex run --dry-run` as a credentials check should use a live run for that.- **Remote inference config bumped to `pipelex_remote_config_12.json`**: The Pipelex Gateway model specs are fetched from a new versioned URL whose `defaults` no longer declare the removed field. Earlier releases stay pinned to `_11`, which is frozen. Unknown keys in the *remote* config's `defaults` are now pruned rather than rejected, so a gateway config written by a different release than the client reading it is version skew to tolerate; local backend files stay strict.### Removeddiff --git a/docs/features/validation-dry-run.md b/docs/features/validation-dry-run.mdindex a8fb0c7ab..5101f4f9c 100644--- a/docs/features/validation-dry-run.md+++ b/docs/features/validation-dry-run.md@@ -31,6 +31,7 @@ Execute pipelines with mocked LLM responses to test pipeline logic, data flow, a- **Mock generation** — Format-compliant mock values for constrained fields, including structured outputs- **Configurable mock behavior** — Control mock list sizes, template handling, and response formats- **Full pipeline execution** — Working memory, controllers, and data flow all work as in production+- **No credentials needed** — A dry run boots without inference credentials, on both `pipelex run --dry-run` and `pipelex-agent run --dry-run`. A backend whose API key is missing is skipped rather than fatal, so a dry run executes on a machine that holds no key at all. The one limit: a model handle that lives on a skipped backend cannot be resolved there, so a pipe pinning a bare handle such as `model = "gpt-4o-mini"` reports it as not found in the model deck; presets and the default model are unaffected## Allowed-to-Fail Pipesdiff --git a/docs/tools/cli/run.md b/docs/tools/cli/run.mdindex 0c278db12..f8c82709e 100644--- a/docs/tools/cli/run.md+++ b/docs/tools/cli/run.md@@ -37,7 +37,7 @@ Runs a pipe by code from your project's pipe library.- `--no-pretty-print` - Skip pretty printing the main output- `--graph` / `--no-graph` - Enable/disable execution graph visualization- `--graph-full-data` / `--graph-no-data` - Include full data in the graph visualization-- `--dry-run` - Dry-run the pipeline without calling AI providers+- `--dry-run` - Dry-run the pipeline without calling AI providers; no inference credentials are needed- `--mock-inputs` - Use mock inputs for the pipeline (requires `--dry-run`)- `--library-dir`, `-L` - Directory to search for pipe definitions. Can be specified multiple times.@@ -59,7 +59,7 @@ pipelex run pipe my_pipe --no-save-main-stuff --no-pretty-print# Write a flat list output to CSV (literal path, not under --output-dir)pipelex run pipe summarize_people --inputs people.json --save-csv summaries.csv-# Dry-run (no AI calls)+# Dry-run (no AI calls, no credentials needed)pipelex run pipe my_pipe --dry-run# Run with custom library directories@@ -90,7 +90,7 @@ Runs a pipeline from a bundle file (`.mthds`) or a pipeline directory. When a di- `--no-pretty-print` - Skip pretty printing the main output- `--graph` / `--no-graph` - Enable/disable execution graph visualization- `--graph-full-data` / `--graph-no-data` - Include full data in the graph visualization-- `--dry-run` - Dry-run the pipeline without calling AI providers+- `--dry-run` - Dry-run the pipeline without calling AI providers; no inference credentials are needed- `--mock-inputs` - Use mock inputs for the pipeline (requires `--dry-run`)- `--library-dir`, `-L` - Directory to search for additional pipe definitions. Can be specified multiple times.@@ -137,7 +137,7 @@ Runs a pipeline from an installed method package.- `--no-pretty-print` - Skip pretty printing the main output- `--graph` / `--no-graph` - Enable/disable execution graph visualization- `--graph-full-data` / `--graph-no-data` - Include full data in the graph visualization-- `--dry-run` - Dry-run the pipeline without calling AI providers+- `--dry-run` - Dry-run the pipeline without calling AI providers; no inference credentials are needed- `--mock-inputs` - Use mock inputs for the pipeline (requires `--dry-run`)- `--library-dir`, `-L` - Directory to search for additional pipe definitions. Can be specified multiple times.diff --git a/pipelex/cli/commands/run/_run_core.py b/pipelex/cli/commands/run/_run_core.pyindex 5774e72d6..c2fe39ee9 100644--- a/pipelex/cli/commands/run/_run_core.py+++ b/pipelex/cli/commands/run/_run_core.py@@ -416,7 +416,16 @@ def execute_run(Shared between the ``method`` and ``pipe`` subcommands."""- make_pipelex_for_cli(context=ErrorContext.VALIDATION_BEFORE_PIPE_RUN, library_dirs=library_dir, boot_orchestrator=orchestrator)+ # A dry run makes no inference call, so it must not demand credentials: boot keyless (every run+ # is then forced to DRY) but with real model specs, so model handles resolve as on a live run.+ # This is the same boot `pipelex-agent run --dry-run` uses, so the two CLIs agree on a keyless machine.+ make_pipelex_for_cli(+ context=ErrorContext.VALIDATION_BEFORE_PIPE_RUN,+ library_dirs=library_dir,+ needs_inference=not dry_run,+ boot_orchestrator=orchestrator,+ needs_model_specs=True,+ )try:with get_telemetry_manager().telemetry_context():diff --git a/pipelex/cogt/templating/template_blueprint.py b/pipelex/cogt/templating/template_blueprint.pyindex ee387faff..2eb669b2b 100644--- a/pipelex/cogt/templating/template_blueprint.py+++ b/pipelex/cogt/templating/template_blueprint.py@@ -1,6 +1,6 @@from typing import Any-from pydantic import BaseModel, Field, model_validator+from pydantic import BaseModel, ConfigDict, Field, model_validatorfrom pipelex.cogt.templating.template_preprocessor import preprocess_templatefrom pipelex.tools.jinja2.exceptions import Jinja2TemplateSyntaxError@@ -11,8 +11,16 @@ from pipelex.tools.templating.templating_style import TemplatingStyleclass TemplateBlueprint(BaseModel):+ """The rich form of a template: its Jinja2 source and category, plus an optional templating style and extra context."""++ # An authored surface (the `[pipe.name.template]` table): unknown keys are rejected, as on every blueprint.+ model_config = ConfigDict(extra="forbid")+template: str = Field(description="Raw template source")- templating_style: TemplatingStyle | None = Field(default=None, description="Style of prompting to use (typically for different LLMs)")+ templating_style: TemplatingStyle | None = Field(+ default=None,+ description="How the tag and format filters render in this template; omit it to take the runtime default templating style",+ )category: TemplateCategory = Field(description="Category of the template (could also be HTML, MARKDOWN, MERMAID, etc.), influences template rendering rules",)diff --git a/pipelex/tools/templating/templating_style.py b/pipelex/tools/templating/templating_style.pyindex 09c730d64..3bd0405ca 100644--- a/pipelex/tools/templating/templating_style.py+++ b/pipelex/tools/templating/templating_style.py@@ -1,6 +1,6 @@from enum import StrEnum-from pydantic import BaseModel, Field+from pydantic import BaseModel, ConfigDict, Fieldfrom typing_extensions import overridefrom pipelex.tools.templating.text_format import TextFormat@@ -14,6 +14,11 @@ class TagStyle(StrEnum):class TemplatingStyle(BaseModel):+ """How a pipe's inputs are tagged and formatted into its prompt: a tag style and a text format."""++ # An authored surface: a misspelled key must fail validation, not silently yield a different prompt shape.+ model_config = ConfigDict(extra="forbid")+tag_style: TagStyle = Field(strict=False)text_format: TextFormat = Field(default=TextFormat.PLAIN, strict=False)diff --git a/tests/unit/pipelex/cli/test_run_core_wrapper.py b/tests/unit/pipelex/cli/test_run_core_wrapper.pyindex 00da9962f..6972283a9 100644--- a/tests/unit/pipelex/cli/test_run_core_wrapper.py+++ b/tests/unit/pipelex/cli/test_run_core_wrapper.py@@ -71,6 +71,24 @@ class TestExecuteRunWrapper:wrapper_mocks["core"].assert_awaited_once()wrapper_mocks["teardown"].assert_called_once()+ def test_live_run_boots_keyed(self, wrapper_mocks: dict[str, Any]) -> None:+ """A live run needs credentials: the boot asks for inference."""+ _call_execute_run(dry_run=False)++ make_kwargs = wrapper_mocks["make_pipelex"].call_args.kwargs+ assert make_kwargs["needs_inference"] is True++ def test_dry_run_boots_keyless_with_real_model_specs(self, wrapper_mocks: dict[str, Any]) -> None:+ """`--dry-run` makes no inference call, so it must not demand credentials — the same boot+ `pipelex-agent run --dry-run` uses: keyless (every run forced to DRY) but with real model+ specs, so model handles resolve as they would on a live run.+ """+ _call_execute_run(dry_run=True)++ make_kwargs = wrapper_mocks["make_pipelex"].call_args.kwargs+ assert make_kwargs["needs_inference"] is False+ assert make_kwargs["needs_model_specs"] is True+def test_model_choice_error_dispatched_to_handler(self, wrapper_mocks: dict[str, Any], mocker: MockerFixture) -> None:"""A model-choice error is routed to its dedicated handler."""choice_error = PipeOperatorModelChoiceError(diff --git a/tests/unit/pipelex/cogt/templating/test_template_blueprint_strictness.py b/tests/unit/pipelex/cogt/templating/test_template_blueprint_strictness.pynew file mode 100644index 000000000..df595dc36--- /dev/null+++ b/tests/unit/pipelex/cogt/templating/test_template_blueprint_strictness.py@@ -0,0 +1,74 @@+"""`TemplateBlueprint` rejects unknown keys, directly and through the `PipeCompose` authoring surface.++The rich `[pipe.name.template]` table is authored by hand; a misspelled `templating_style` or+`extra_context` used to be dropped silently, which yields a template rendered under a style or+context the author never asked for. It is a validation error now, like every other blueprint.+"""++from typing import Any++import pytest+from kajson import kajson+from pydantic import ValidationError++from pipelex.cogt.templating.template_blueprint import TemplateBlueprint+from pipelex.pipe_operators.compose.pipe_compose_blueprint import PipeComposeBlueprint+from pipelex.tools.jinja2.template_category import TemplateCategory+from pipelex.tools.templating.templating_style import TagStyle, TemplatingStyle+from pipelex.tools.templating.text_format import TextFormat++_BASE_COMPOSE_TABLE: dict[str, Any] = {+ "description": "template blueprint strictness test",+ "inputs": {"name": "native.Text"},+ "output": "native.Text",+}+++class TestTemplateBlueprintStrictness:+ def test_misspelled_templating_style_is_rejected(self):+ with pytest.raises(ValidationError, match="templating_stile"):+ TemplateBlueprint.model_validate({"template": "Hello @name", "category": "basic", "templating_stile": {"tag_style": "xml"}})++ def test_misspelled_extra_context_is_rejected(self):+ with pytest.raises(ValidationError, match="extra_contxt"):+ TemplateBlueprint.model_validate({"template": "Hello @name", "category": "basic", "extra_contxt": {"tone": "warm"}})++ def test_well_formed_table_still_parses(self):+ blueprint = TemplateBlueprint.model_validate(+ {+ "template": "Hello @name",+ "category": "markdown",+ "templating_style": {"tag_style": "xml", "text_format": "markdown"},+ "extra_context": {"tone": "warm"},+ }+ )+ assert blueprint.category == TemplateCategory.MARKDOWN+ assert blueprint.templating_style == TemplatingStyle(tag_style=TagStyle.XML, text_format=TextFormat.MARKDOWN)+ assert blueprint.extra_context == {"tone": "warm"}++ def test_misspelled_key_is_rejected_through_pipe_compose_blueprint(self):+ with pytest.raises(ValidationError, match="templating_stile"):+ PipeComposeBlueprint.model_validate(+ {+ **_BASE_COMPOSE_TABLE,+ "template": {"template": "Hello @name", "category": "basic", "templating_stile": {"tag_style": "xml"}},+ }+ )++ def test_misspelled_nested_style_key_is_rejected_through_pipe_compose_blueprint(self):+ with pytest.raises(ValidationError, match="text_formt"):+ PipeComposeBlueprint.model_validate(+ {+ **_BASE_COMPOSE_TABLE,+ "template": {"template": "Hello @name", "category": "basic", "templating_style": {"tag_style": "xml", "text_formt": "markdown"}},+ }+ )++ def test_kajson_round_trip_survives_strictness(self):+ blueprint = TemplateBlueprint(+ template="Hello @name",+ category=TemplateCategory.MARKDOWN,+ templating_style=TemplatingStyle(tag_style=TagStyle.XML, text_format=TextFormat.MARKDOWN),+ extra_context={"tone": "warm"},+ )+ assert kajson.loads(kajson.dumps(blueprint)) == blueprintdiff --git a/tests/unit/pipelex/tools/test_templating_style_strictness.py b/tests/unit/pipelex/tools/test_templating_style_strictness.pynew file mode 100644index 000000000..37d5e097a--- /dev/null+++ b/tests/unit/pipelex/tools/test_templating_style_strictness.py@@ -0,0 +1,40 @@+"""`TemplatingStyle` rejects unknown keys, directly and through the authoring surface that embeds it.++Every sibling authoring model is `extra="forbid"`; a misspelled optional key on the templating style+must be a validation error, not a silently different prompt shape.+"""++from typing import Any++import pytest+from kajson import kajson+from pydantic import ValidationError++from pipelex.pipe_operators.llm.pipe_llm_blueprint import PipeLLMBlueprint+from pipelex.tools.templating.templating_style import TagStyle, TemplatingStyle+from pipelex.tools.templating.text_format import TextFormat++_BASE_TABLE: dict[str, Any] = {+ "description": "templating style strictness test",+ "inputs": {"topic": "native.Text"},+ "output": "native.Text",+ "prompt": "Here is the topic:\n@topic",+}+++class TestTemplatingStyleStrictness:+ def test_misspelled_optional_key_is_rejected(self):+ with pytest.raises(ValidationError, match="text_formt"):+ TemplatingStyle.model_validate({"tag_style": "xml", "text_formt": "markdown"})++ def test_well_formed_table_still_parses(self):+ style = TemplatingStyle.model_validate({"tag_style": "xml", "text_format": "markdown"})+ assert style == TemplatingStyle(tag_style=TagStyle.XML, text_format=TextFormat.MARKDOWN)++ def test_misspelled_key_is_rejected_through_pipe_llm_blueprint(self):+ with pytest.raises(ValidationError, match="text_formt"):+ PipeLLMBlueprint.model_validate({**_BASE_TABLE, "templating_style": {"tag_style": "xml", "text_formt": "markdown"}})++ def test_kajson_round_trip_survives_strictness(self):+ style = TemplatingStyle(tag_style=TagStyle.SQUARE_BRACKETS, text_format=TextFormat.MARKDOWN)+ assert kajson.loads(kajson.dumps(style)) == stylediff --git a/wip/keyless/keyless-boot-changes-dry-prompts.md b/wip/keyless/keyless-boot-changes-dry-prompts.mdindex f7fa7a202..7600418ed 100644--- a/wip/keyless/keyless-boot-changes-dry-prompts.md+++ b/wip/keyless/keyless-boot-changes-dry-prompts.md@@ -1,59 +1,28 @@-# Bug report — a keyless boot silently changes what a DRY run renders+# Bug report — a keyless boot silently changed what a DRY run rendered-**Filed 2026-08-14 as the brief for this fix branch (`fix/Keyless-dry-run`).** Measured 2026-08-08 against the then-current tip; re-verify on this branch before building the fix — the boot and deck code has moved since (v0.43.x, v0.44.0).+**Filed 2026-08-14 as the brief for `fix/Keyless-dry-run`; measured 2026-08-08 and re-verified on the branch at v0.44.0. ✅ CLOSED 2026-08-14 — dissolved, not fixed.** Kept as the record of what the bug was and of the measurement lesson at the end. The residue that survived it is tracked in [`keyless-dry-prompts-fix-plan.md`](keyless-dry-prompts-fix-plan.md).-> ## ✅ CLOSED 2026-08-14 — dissolved, not fixed->-> **This bug no longer exists, and the mechanism it describes has been deleted.** Prompt shape is now an authoring decision: a pipe declares `templating_style`, anything that declares nothing takes one runtime default from config, and **no code path consults the deck, a model spec, or a credential to decide how a prompt is tagged**. A keyless boot and a keyed boot therefore render byte-identical prompts by construction — there is no longer a derivation that could disagree with itself.->-> The two load-bearing facts in "Why it happens" are both gone: `derive_templating_style` is deleted, and the `TagStyle.TICKS` fallback that made a `None` style silently *render* rather than *fail* is deleted too. Where a style is genuinely absent, the Jinja2 filters now raise `Jinja2ContextError` instead of quietly picking a shape — so the specific failure mode named in this report's title, *silently*, is unreachable even in principle.->-> Shipped on this same branch: design in [`../prompting-style/prompt-style-as-an-authoring-decision.md`](../prompting-style/prompt-style-as-an-authoring-decision.md), build in [`../prompting-style/templating-style-implementation-plan.md`](../prompting-style/templating-style-implementation-plan.md). Note the change was **not** undertaken to fix this bug — it was a separate design ruling that happened to dissolve it, which is why the fix plan's core survives while its headline does not.->-> **What did not get fixed.** The underlying boot behaviour this report *diagnosed* is untouched: a keyless boot still drops every backend and still yields an empty deck. That still has consequences — a skipped `max_prompt_images` check, skipped image-param validation, handle-pinned bundles rejected, and the two CLIs disagreeing about whether `--dry-run` needs credentials. Those survive in the re-scoped [`keyless-dry-prompts-fix-plan.md`](keyless-dry-prompts-fix-plan.md) and are pending their own re-judging. **"Why it stayed invisible" below is still worth reading** — the two-sided-gate blindness it describes is a general lesson about measurement, not a fact about prompting.+## What the bug was-## The claim it undermines+A DRY run's whole purpose is to rehearse the real run without spending money — which is why it is documented as needing no keys. That promise reads as "same program, mocked leaves". It was not: **a dry run booted keyless rendered different prompts from a dry run booted with credentials, and nothing in either run said so.**-A DRY run's whole purpose is to rehearse the real run without spending money — which is why it is documented as needing no keys. That promise is naturally read as "same program, mocked leaves". It currently is not: **a dry run booted keyless renders different prompts from a dry run booted with credentials, and nothing in either run says so.**+Take any method where a second `PipeLLM` step's prompt embeds a first step's output, and run it DRY twice — identical inputs, identical method — varying only the boot: `needs_inference=False` (keyless) vs `needs_inference=True` (keyed).-## Reproduction--Take any method where a second `PipeLLM` step's prompt embeds a first step's output (so the tag style is observable in the rendered prompt), and run it DRY twice — identical inputs, identical method. The only difference is the boot: `needs_inference=False` (keyless) vs `needs_inference=True` (keyed).--| boot | `derive_templating_style(llm_setting=…)` | how step 1's output is tagged into step 2's prompt |+| boot | derived templating style | how step 1's output was tagged into step 2's prompt || --- | --- | --- |-| keyless | `None` | fallback style, e.g. `` result: ``` `` |+| keyless | `None` | the Jinja2 filter's own fallback, `` result: ``` `` || keyed | the model's own, e.g. `xml/plain` | `<result>` |-Both runs complete, both report the same usage records, neither logs anything about the difference. The two output texts differ only in how the first step's result is tagged into the second step's prompt.--## Why it happens--`RuntimeBoot.make` derives `effective_needs_model_specs` from `needs_inference`, so a keyless boot loads no inference models into the deck. `pipelex/kernel/llm_ops.py::derive_templating_style` then takes its documented `None` path — written for the external-LLM-plugin case, where "the deck has no model for this handle" means the model is real but managed elsewhere. A keyless boot satisfies that condition for **every** model at once, and the caller cannot tell the two situations apart. Prompt rendering downstream falls back to its default tag style instead of the model's own.--## Why it stayed invisible--Any gate whose two sides boot the same way cannot see this variable at all, and reads as evidence that it does not matter. Two keyless sides agree with each other perfectly; the divergence only surfaces when a keyless side is compared against a side that *cannot* boot keyless (e.g. a worker whose boot hard-fails without credentials). It first presents as a downstream divergence ("the same program produces different content over there") — it is not; splitting the boot variable isolates it.--## Blast radius, as far as it was measured--- Only the *rendered prompt* was compared. Whether anything else keyed off the deck changes under a keyless boot was not enumerated — worth enumerating as part of the fix.-- A dry run used for **validation** — "does this method's prompt render?" — is validating a prompt the live run will not send, whenever it is run keyless.--## What the fix has to decide first--Is a keyless dry run meant to be **faithful** (then the deck's prompting metadata must load without credentials — `needs_model_specs=True` already exists as that seam) or merely **cheap** (then the divergence is by design and should be said out loud, at least as a log line)? Either way, the current state — faithful-looking and unfaithful, with no signal — is the one that should not persist.-----+Both runs completed, both reported the same usage records, neither logged anything about the difference. A dry run used for **validation** — "does this method's prompt render?" — was validating a prompt the live run would never send, whenever it ran keyless.-## Re-verified 2026-08-14 at this branch's base (tip `84b1f682c`, v0.44.0 — before the templating-style change) — and one premise above is wrong+**Why it happened.** `RuntimeBoot.make` derived the boot's need for model specs from `needs_inference`, and — the actual mechanism — a keyless boot loaded the backend library leniently, which skipped every backend whose `${…_API_KEY}` could not substitute. Every shipped backend declares its key that way, so the deck was empty. `derive_templating_style` then took its documented `None` path, written for the external-LLM-plugin case where "the deck has no model for this handle" means the model is real but managed elsewhere; a keyless boot satisfied that condition for **every** model at once and the caller could not tell the two situations apart. `None` reached the Jinja2 filters, whose `TICKS` fallback silently rendered rather than failed.-The divergence reproduces exactly as described: a keyless boot derives `None`, a keyed boot derives `xml/plain`, and `None` renders as `TICKS` because `apply_tag_style` defaults to it when `TAG_STYLE` was never put on the Jinja2 context.+## Why it is gone-> **The TICKS half is now false, deliberately** — see the CLOSED box above. `apply_tag_style` has no fallback any more: a render context with no tag style raises `Jinja2ContextError` rather than quietly choosing a shape, and there is no deck-derived style left to be `None`. Kept as the record of what reproduced at that tip.+Prompt shape is now an authoring decision — a pipe declares `templating_style`, anything that declares nothing takes one runtime default from config, and **no code path consults the deck, a model spec, or a credential to decide how a prompt is tagged.** A keyless boot and a keyed boot therefore render byte-identical prompts by construction. Both load-bearing facts above are deleted: `derive_templating_style` no longer exists, and the Jinja2 filters raise `Jinja2ContextError` where a style is genuinely absent instead of quietly picking a shape — so the failure mode named in this report's title, *silently*, is unreachable even in principle. Design: [`../prompting-style/prompt-style-as-an-authoring-decision.md`](../prompting-style/prompt-style-as-an-authoring-decision.md); build: [`../prompting-style/templating-style-implementation-plan.md`](../prompting-style/templating-style-implementation-plan.md). The change was **not** undertaken to fix this bug — it was a separate design ruling that happened to dissolve it.-**But the last paragraph's parenthesis is false.** `needs_model_specs=True` is *not* the faithful seam. Measured on a machine with no credentials at all, it changes nothing — the deck is empty in both modes. `needs_model_specs` only governs whether the *gateway's* remote specs are fetched or dummied; what empties the deck is `lenient=not needs_inference`, which makes the backend loader **skip every backend whose `${…_API_KEY}` cannot substitute** — and every shipped backend, gateway included, declares its key that way. There is currently no flag combination that gives a credential-free process a populated deck. The seam has to be built, not switched on.+**What did not get fixed.** The boot behaviour this report *diagnosed* is untouched: a keyless boot still drops every backend and still yields an empty deck, which still governs things unrelated to prompting — a skipped `max_prompt_images` check, skipped image-param validation, and handle-pinned bundles rejected on a keyless machine. Those are the subject of the fix plan. One correction from the re-verification is worth carrying: `needs_model_specs=True` is **not** a credential-free seam — it only governs whether the gateway's remote specs are fetched or dummied; the deck is emptied by the lenient backend load, and no flag combination gives a credential-free process a populated deck today.-Two things also worth carrying forward: the prompting metadata itself was credential-free on-disk data (~~`prompting_target` lives in the per-backend spec TOMLs~~ — that field is deleted too), which is what made "faithful" cheap; and the blast radius includes a *loud* converse — on a keyless machine a bundle pinning a bare model handle is **rejected** by validation, while preset-pinned methods silently get rewritten prompts.+## Why it stayed invisible — the lesson that outlives the bug-Full measurements, the enumerated blast radius, and the TDD fix plan: [`keyless-dry-prompts-fix-plan.md`](keyless-dry-prompts-fix-plan.md).+Any gate whose two sides boot the same way cannot see this variable at all, and reads as evidence that it does not matter. Two keyless sides agree with each other perfectly; the divergence only surfaces when a keyless side is compared against a side that *cannot* boot keyless (e.g. a worker whose boot hard-fails without credentials). It first presents as a downstream divergence ("the same program produces different content over there") — it is not; splitting the boot variable isolates it. Any future two-sided gate on this area must vary exactly one thing, credential presence, and nothing else.diff --git a/wip/keyless/keyless-dry-prompts-fix-plan.md b/wip/keyless/keyless-dry-prompts-fix-plan.mdindex 28fbd5e2b..cda5a3022 100644--- a/wip/keyless/keyless-dry-prompts-fix-plan.md+++ b/wip/keyless/keyless-dry-prompts-fix-plan.md@@ -1,91 +1,78 @@-# Fix plan — a keyless boot must not change what a DRY run renders+# Fix plan — a keyless boot must not change what a DRY run validates-**Written 2026-08-14 on `fix/Keyless-dry-run`, against tip `84b1f682c` (v0.44.0).** Brief: [`keyless-boot-changes-dry-prompts.md`](keyless-boot-changes-dry-prompts.md). Everything in §0 was measured on this branch today, not carried over from the 2026-08-08 measurement.+**Written 2026-08-14 on `fix/Keyless-dry-run` (measured at v0.44.0), for the brief in [`keyless-boot-changes-dry-prompts.md`](keyless-boot-changes-dry-prompts.md). Re-scoped the same day, when the templating-style change dissolved the headline symptom, and again on 2026-08-15 when Part 4 shipped.** What is left is a real bug and still worth fixing, but a narrower one than the plan was written for: a keyless boot drops every backend, so the deck is empty — and the deck governs things that have nothing to do with prompting.-> ✅ **Re-scoped 2026-08-14 — the hold is lifted and the headline symptom is gone, dissolved rather than fixed.** The templating-style change shipped on this same branch ([design](../prompting-style/prompt-style-as-an-authoring-decision.md), [build](../prompting-style/templating-style-implementation-plan.md)): prompt shape is now declared on the pipe and defaulted from config, and **no code path consults the deck, a model spec, or a credential to decide it.** A keyless boot and a keyed boot therefore render byte-identical prompts by construction. **Symptoms 1 and 2 no longer exist, and neither do the fields they were about** — `prompting_target` and `derive_templating_style` are deleted. Part 1 (§3.2) is dissolved entirely; Part 3 (§3.4) loses its warning site.->-> **What survives is a real bug and still worth fixing**, but it is a different bug than the one this plan was written for. A keyless boot still drops every backend, so the deck is still empty — and the deck still governs things that have nothing to do with prompting: symptoms 3, 4, 5 and 7 in §2. **Part 2 (§3.3) remains the core and is unchanged**; Part 4 (§3.5) remains the user-visible half. Sections below are annotated in place: struck premises are kept as the record of what was measured, not as instructions.->-> ⚠️ **Re-judging the surviving residue is its own task.** With the headline symptom gone the cost/benefit has changed — the remaining symptoms are narrower and none of them silently rewrites output. Whether Part 2's `BackendLoadMode` surgery is still worth its blast radius is an open question for Louis, not a conclusion this plan should be read as having reached.+**Status:**-## 0. Re-verification, and one correction to the brief+- **Part 4 — ✅ shipped** on the stacked branch `fix/keyless-followups`: `pipelex run --dry-run` boots keyless, like `pipelex-agent run --dry-run` (§3.4).+- **Part 2 — ⏸ awaiting Louis' ruling** (§5). It is the core and the expensive half, and its case got weaker when the silent-rewrite symptom vanished; whether it is still worth its blast radius is an open question, not a conclusion this plan has reached.+- **Parts 0 and 3** — build only with Part 2; they have no meaning without it.-### 0.1 The divergence reproduces ~~(dissolved — historical record)~~+## 0. The mechanism, measured-> **Dissolved.** `derive_templating_style` is deleted; the style no longer comes from the deck at all, so the last column of this table has no meaning against current code. Kept because the *first three* columns still reproduce exactly as measured — a keyless boot still yields a 0-model deck — and that is the mechanism symptoms 3/4/5 ride on.+### 0.1 A keyless boot yields an empty deck-Booting `Pipelex.make(...)` three ways and asking for the deck-resolved default text setting's style:+Booting `Pipelex.make(...)` several ways and counting the deck:-| boot | machine | deck `inference_models` | resolved setting | `derive_templating_style` |-| --- | --- | --- | --- | --- |-| `needs_inference=True` | keyed | 75 | `claude-4.6-sonnet` | `xml/plain` |-| `needs_inference=False` | keyed | 2 | `claude-4.6-sonnet` | **`None`** |-| `needs_inference=False, needs_model_specs=True` | keyed | 75 | `claude-4.6-sonnet` | `xml/plain` |-| `needs_inference=False` | **no credentials at all** | **0** | `claude-4.6-sonnet` | **`None`** |-| `needs_inference=False, needs_model_specs=True` | **no credentials at all** | **0** | `claude-4.6-sonnet` | **`None`** |--`None` is not inert. `apply_tag_style` (`pipelex/tools/jinja2/jinja2_filters.py:120-122`) reads `TAG_STYLE` off the Jinja2 context and, when the key was never set, falls back to `TagStyle.TICKS` — so the step-2 prompt says ``result: ``` `` where a keyed run says `<result>`. The brief's reproduction table is accurate.+| boot | machine | deck `inference_models` |+| --- | --- | --- |+| `needs_inference=True` | keyed | every configured model |+| `needs_inference=False` | keyed | only the backends whose key happens to be set |+| `needs_inference=False, needs_model_specs=True` | keyed | every configured model |+| `needs_inference=False` | **no credentials at all** | **0** |+| `needs_inference=False, needs_model_specs=True` | **no credentials at all** | **0** |-> **Both halves of that sentence are now false, deliberately.** There is no deck-derived style to be `None`, and `apply_tag_style` no longer has a `TICKS` fallback — a context with no tag style raises `Jinja2ContextError` rather than silently choosing a shape. The silent-rewrite failure mode this plan was named for cannot recur: the only two outcomes left are the authored style and a loud error.+Re-verified live on 2026-08-15 with a scratch `HOME` holding no `.env` and every `*_API_KEY` unset: a bundle pinning `model = "gpt-4o-mini"` fails a dry run with *"Model handle 'gpt-4o-mini' was not found in the model deck"*, and passes on the same code with credentials present.-### 0.2 The correction: `needs_model_specs=True` is **not** the faithful seam+### 0.2 `needs_model_specs=True` is **not** the credential-free seam-The brief closes with "`needs_model_specs=True` already exists as that seam". It does not. The last two rows above are the measurement that matters — on a machine with **no credentials**, `needs_model_specs=True` changes nothing, because it only governs whether the *gateway's* remote specs are fetched or dummied (`pipelex/runtime_boot.py:295-342`). The thing that actually empties the deck is a different flag on a different axis:+The brief assumed it was. It is not: on a machine with **no credentials**, `needs_model_specs=True` changes nothing, because it only governs whether the *gateway's* remote specs are fetched or dummied (`pipelex/runtime_boot.py`). The thing that actually empties the deck is a different flag on a different axis:```runtime_boot.setup(needs_inference=False)- → ModelManager.setup(needs_inference=False) # model_manager.py:72- → InferenceBackendLibrary.load(lenient=True) # model_manager.py:83+ → ModelManager.setup(needs_inference=False)+ → InferenceBackendLibrary.load(lenient=True)→ every backend whose `api_key = "${…}"` cannot substitute- is SKIPPED entirely # backend_library.py:119-127- (log.verbose only — invisible at default log level)- → build_deck(enabled_backends=[]) # model_manager.py:93+ is SKIPPED entirely (log.verbose only — invisible at default log level)+ → build_deck(enabled_backends=[])→ deck.inference_models == {}```-Every shipped backend declares its key as a `${VAR}` (`pipelex/kit/configs/inference/backends.toml`), the gateway included (`${PIPELEX_GATEWAY_API_KEY}`). So on a keyless machine **`lenient=True` drops every backend**, and `lenient` is wired to `needs_inference`, not to `needs_model_specs`. There is currently *no* flag combination that gives a credential-free process a populated deck.+Every shipped backend declares its key as a `${VAR}` (`pipelex/kit/configs/inference/backends.toml`), the gateway included. So on a keyless machine **`lenient=True` drops every backend**, and `lenient` is wired to `needs_inference`, not to `needs_model_specs`. There is currently *no* flag combination that gives a credential-free process a populated deck. Note that since the templating-style branch, `lenient` swallows *only* `InferenceBackendCredentialsError` — a broken config file is fatal in both modes — so the conflation left to break is exactly "cannot call this provider" vs "do not know what its models are like".-That reframes the fix: this is not "flip the existing seam on", it is "build the seam".+This is not "flip the existing seam on"; it is "build the seam".### 0.3 The metadata is already credential-free on disk-The reason the faithful option is cheap: `max_prompt_images`, `rules`, `inputs`/`outputs` and costs live in the per-backend spec TOMLs, which need no credential to read. Only the *backend entry's* `${VAR}` substitution fails. The load conflates two unrelated things — "can I call this provider" and "do I know what its models are like" — and drops the second because the first failed.+`max_prompt_images`, `rules`, `inputs`/`outputs` and costs live in the per-backend spec TOMLs, which need no credential to read. Only the *backend entry's* `${VAR}` substitution fails. The load conflates two unrelated things — "can I call this provider" and "do I know what its models are like" — and drops the second because the first failed.-> *(`prompting_target` was the fourth item on that list and the one the plan leaned on hardest; it no longer exists. The argument is unaffected — the remaining fields are just as credential-free, and `max_prompt_images` is what symptom 3 needs.)*--The gateway is the one genuine exception: its specs come from a remote fetch (`RemoteConfigFetcher.fetch_remote_config`, a public URL, no key needed for the fetch itself), so an offline keyless boot cannot know them. That residual is what §3.4 makes audible instead of silent.+The gateway is the one genuine exception: its specs come from a remote fetch (a public URL, no key needed for the fetch itself), so an offline keyless boot cannot know them. That residual is what §3.3 makes audible instead of silent.## 1. The decision: faithful, with the residual said out loud-The brief asks the fix to choose between **faithful** and **cheap-but-honest**. Recommendation: **faithful**, because the metadata is free (§0.3) and because "same program, mocked leaves" is what a dry run is *for* — a rehearsal that quietly rewrites the script is worth less than no rehearsal. Concretely the invariant to establish:+Recommendation, *if Part 2 proceeds at all*: **faithful**, because the metadata is free (§0.3) and because "same program, mocked leaves" is what a dry run is *for* — a rehearsal that quietly skips checks is worth less than no rehearsal. The invariant to establish:> **Credentials gate inference. They do not gate knowledge of models.** A boot without credentials resolves the same models and the same model constraints as a boot with them; what it cannot do is call a provider.-*(The invariant originally said "the same prompting styles" too. That clause is now true unconditionally and for a different reason — prompt shape never consults the deck — so it is dropped rather than claimed as a benefit of this fix.)*--One thing the invariant deliberately does not promise, handled in §3.4: gateway-hosted models on an **offline** keyless boot are unknowable, so warned. *(The second exception — an external-LLM-plugin model, absent from the deck, where a `None` style stayed correct — is gone with the style derivation.)*+One thing the invariant deliberately does not promise, handled in §3.3: gateway-hosted models on an **offline** keyless boot are unknowable, so warned.## 2. Blast radius, enumerated-The brief asks for this enumeration as part of the fix. Everything a keyless boot changes, via the one mechanism "the deck has no `InferenceModelSpec`":+Everything a keyless boot changes, via the one mechanism "the deck has no `InferenceModelSpec`":| # | Symptom | Mechanism | Site | Status || --- | --- | --- | --- | --- |-| ~~1~~ | ~~Step-2 prompts tag step-1 output with ``` ``` ``` instead of `<…>`~~ | ~~style `None` → Jinja2 `TAG_STYLE` unset → `TICKS`~~ | — | **✅ dissolved** — no deck-derived style, and no `TICKS` fallback to land in |-| ~~2~~ | ~~An **explicitly set** `llm_setting.prompting_target` is ignored~~ | ~~deck lookup short-circuits to `None`~~ | — | **✅ dissolved** — the field is deleted; the authored `templating_style` on the pipe is the only declaration and it is always honoured |-| 3 | `PipeImgGen`'s `max_prompt_images` limit is not enforced | `model_spec` `None` → limit `None` → check skipped | `pipe_operators/img_gen/pipe_img_gen.py:172-173`, `img_gen_prompt_blueprint.py:81` | code-read, test in §3.1 |-| 4 | `PipeImgGen` param-support validation is skipped | `spec is None` → early return | `pipe_operators/img_gen/pipe_img_gen.py:100-104` | code-read |-| 5 | A bundle pinning a **bare model handle** is *rejected* on a keyless machine | `is_model_handle_defined` false against an empty deck | `cogt/models/model_deck_check.py:91-101` | **measured** (`ModelChoiceNotFoundError`) |-| 6 | Deck preset validation degrades to log-only noise | every handle missing → `missing_presets_reaction = "log"` | `cogt/models/model_deck.py:612-630`, `pipelex.toml:140` | code-read |-| 7 | The two CLIs disagree with each other on a keyless machine | `pipelex run --dry-run` boots **keyed** (so it fails outright without keys); `pipelex-agent run --dry` boots keyless (so it degrades silently) | `cli/commands/run/_run_core.py:419` vs `cli/agent_cli/commands/run/*_cmd.py` | code-read |+| 3 | `PipeImgGen`'s `max_prompt_images` limit is not enforced | `model_spec` `None` → limit `None` → check skipped | `pipe_operators/img_gen/pipe_img_gen.py`, `img_gen_prompt_blueprint.py` | code-read, test in §3.1 |+| 4 | `PipeImgGen` param-support validation is skipped | `spec is None` → early return | `pipe_operators/img_gen/pipe_img_gen.py` | code-read |+| 5 | A bundle pinning a **bare model handle** is *rejected* on a keyless machine | `is_model_handle_defined` false against an empty deck | `cogt/models/model_deck_check.py` | **measured** (`ModelChoiceNotFoundError`, re-verified 2026-08-15) |+| 6 | Deck preset validation degrades to log-only noise | every handle missing → `missing_presets_reaction = "log"` | `cogt/models/model_deck.py`, `pipelex.toml` | code-read |+| 7 | The two CLIs disagreed on a keyless machine | `pipelex run --dry-run` booted **keyed** (failed outright without keys); `pipelex-agent run --dry` booted keyless | `cli/commands/run/_run_core.py` | **✅ fixed** — Part 4 |-~~Item 5 is the loud converse of item 1 and belongs in the same fix: today a keyless process silently rewrites prompts for preset-pinned methods *and* hard-rejects handle-pinned ones. Both stop once the deck is populated.~~+**Item 5 is the strongest survivor, and it stands alone.** It used to be paired with a *silent* prompt rewrite; what remains is a keyless process *loudly* rejecting handle-pinned bundles. A loud wrong answer is a much weaker motivation for the Part 2 surgery than a silent one was — it is visible, diagnosable, and arguably defensible ("this machine cannot resolve that handle") — but it does mean a keyless CI runner or an agent authoring before keys are configured gets a false rejection for any method that pins a handle. This is the single biggest input into the ruling in §5.-**Item 5 now stands alone, and that changes its character.** With item 1 dissolved there is no longer a silent-rewrite half to pair it with: what remains is a keyless process *loudly rejecting* handle-pinned bundles. A loud wrong answer is a much weaker motivation for the Part 2 surgery than a silent one was — it is visible, diagnosable, and arguably even defensible ("this machine cannot resolve that handle"). This is the single biggest input into the re-judging flagged in the banner.+**Verified non-effects** (so the fix does not chase them): dry-run mock usage records are model-independent — `dry_mock.py` uses fixed `DRY_RUN_INFERENCE_MODEL_*` constants — and mock text length comes from `dry_run_config`, not from any spec.-**Verified non-effects** (so the fix does not chase them): dry-run mock usage records are model-independent — `dry_mock.py:152-165` uses fixed `DRY_RUN_INFERENCE_MODEL_*` constants — and mock text length comes from `dry_run_config`, not from any spec. The brief's "both report the same usage records" holds.--## 3. The fix, in four parts+## 3. The fixTDD throughout: each part lands its tests first, red, then the implementation that turns them green.@@ -100,96 +87,66 @@ New module `tests/integration/pipelex/system/test_keyless_boot_model_metadata.pyBoth via `Pipelex.make(secrets_provider=…, needs_inference=False)`. Assertions, all failing today:-1. `len(deck.inference_models)` is equal on both sides (today: 0 vs 75).-2. ~~`derive_templating_style(...)` is equal and non-`None` on both sides~~ — **dropped, the function is deleted.**-3. A bundle pinning a bare handle passes `check_llm_choice_with_deck` on both sides (today: `ModelChoiceNotFoundError` on the empty side — item 5).--Then the end-to-end assertion the brief actually asks for, `tests/integration/pipelex/pipes/test_dry_prompt_parity_keyless.py`: a two-step method whose second `PipeLLM` embeds the first's output, dry-run under both providers, asserting the two `LlmTextResult.rendered_prompt` values are **identical** — not merely both non-empty. (`tests/unit/pipelex/pipe_operators/pipe_llm/test_prompt_rendering_purity.py` is the precedent for reaching the rendered prompt.)--> **This one is now green before any production edit, and is worth writing anyway — as a guard, not as a receipt.** Prompt rendering no longer reads the deck, so the parity it asserts holds by construction. That makes it exactly the kind of test the sequencing step 5 warns about (*"a parity test that passes against the old code is testing nothing"*) — it must be understood as a regression guard against re-coupling prompt shape to infrastructure, and it should be labelled as such in its docstring so a future reader does not mistake it for evidence that Part 2 works.--And one for item 3: a `PipeImgGen` given more input images than the model's `max_prompt_images`, dry-run keyless with `EmptySecretsProvider`, must raise — today it passes.+1. `len(deck.inference_models)` is equal on both sides (today: 0 vs every configured model).+2. A bundle pinning a bare handle passes `check_llm_choice_with_deck` on both sides (today: `ModelChoiceNotFoundError` on the empty side — item 5).+3. A `PipeImgGen` given more input images than the model's `max_prompt_images`, dry-run keyless with `EmptySecretsProvider`, raises — today it passes (item 3).-### 3.2 ~~Part 1 — style derivation precedence~~ ✅ DISSOLVED — do not build+Optional guard, not a receipt: `tests/integration/pipelex/pipes/test_dry_prompt_parity_keyless.py` — a two-step method whose second `PipeLLM` embeds the first's output, dry-run under both providers, asserting the two rendered prompts are **identical**. It is green before any production edit, because prompt rendering no longer reads the deck; it guards against re-coupling prompt shape to infrastructure and must be labelled as such in its docstring. **Never use it as the mutation-check target for Part 2** — it passes with or without Part 2, so it would produce a false green on the whole gate.-> **Nothing in this section is buildable or wanted.** `derive_templating_style` and `llm_setting.prompting_target` are both deleted; the four-case precedence table below describes a resolution that no longer has any inputs. The concern it encoded — *an explicitly authored declaration must beat an inferred one* — is satisfied structurally: `resolve_templating_style(authored=…)` returns the authored style when there is one and the config default otherwise, with nothing in between to override it. Kept only so a reader of the original plan can see why this part vanished.+### 3.2 Part 2 — credential-free model metadata (the core)-<details>-<summary>Original Part 1 (obsolete)</summary>--Unit module `tests/unit/pipelex/kernel/test_derive_templating_style.py`, stubbing the deck on the hub (`tests/unit/pipelex/cli/test_agent_models_cmd.py:86` shows the fake-deck pattern):--| case | expected | today |-| --- | --- | --- |-| setting carries `prompting_target`, deck has the model | the setting's target wins | deck's target wins — **red** |-| setting carries `prompting_target`, deck has **no** such model | the setting's target is honoured | `None` — **red** |-| setting has no target, deck has the model | the model's target | same — green, pin it |-| setting has no target, deck has no model | `None` (external-plugin case) | same — green, pin it |--Implementation in `pipelex/kernel/llm_ops.py:62-75`: read `llm_setting.prompting_target` first and only consult the deck when it is unset. Keeps the documented `None` path intact and makes an explicitly-pinned target authoritative — which it always should have been.--</details>--### 3.3 Part 2 — credential-free model metadata (the core)--**The conflation to break:** `lenient` currently means both "tolerate a missing credential" and "tolerate a broken config file", and answers both by dropping the backend.+**The conflation to break:** a lenient load answers "cannot resolve this backend's credential" by dropping the backend, and with it every fact about its models.Unit module `tests/unit/pipelex/cogt/model_backends/test_backend_library_metadata_load.py` — a temp-dir `backends.toml` + one backend spec TOML + `EmptySecretsProvider`:-1. metadata-only load: the backend **is present**, its `model_specs` carry `prompting_target`, `api_key is None`, and `missing_credential_vars == ["…_API_KEY"]`.+1. metadata-only load: the backend **is present**, its `model_specs` carry `max_prompt_images` and friends, `api_key is None`, and `missing_credential_vars == ["…_API_KEY"]`.2. credentials-required load (a keyed boot): still raises `InferenceBackendCredentialsError` — unchanged.-3. metadata-only load of a **malformed** spec file: still skipped, still `log.verbose` — unchanged.+3. metadata-only load of a **malformed** spec file: still fatal — unchanged (a config typo must never silently delete a backend).4. a backend with missing credentials is reported as enabled-but-uncredentialed, and is **not** in `all_credentialed_backends()`.Implementation:-- Replace the `lenient: bool` parameter of `InferenceBackendLibrary.load` (`backend_library.py:57-65`) with an explicit `BackendLoadMode` StrEnum — `REQUIRE_CREDENTIALS` / `METADATA_ONLY`. Structural-error skipping stays tied to `METADATA_ONLY`; credential errors no longer skip.-- Substitution today is all-or-nothing: `apply_to_strings_recursive` raises on the first unresolvable `${VAR}` (`backend_library.py:105-145`). Add a collecting variant that, in `METADATA_ONLY`, substitutes what resolves, records the names it could not, and leaves those fields unset. Note `${AZURE_API_BASE}`-style endpoints go the same way — irrelevant to metadata, relevant only to a call.-- `InferenceBackend` (`backend.py:38-48`) gains `missing_credential_vars: list[str]` and an `is_credentialed` property. Keep `all_enabled_backends()` returning uncredentialed backends — the deck must contain their models — and add `all_credentialed_backends()` for callers that mean "usable for inference".-- `ModelManager.setup` picks the mode from `needs_inference` (`model_manager.py:83`, `:88`).-- **Guard the live path loudly.** `pipelex/providers/openai/openai_client_factory.py:45` turns a `None` key into `"unused-no-auth-needed"`, which would surface a missing credential as a provider 401 rather than as our own error. Gate at the point a backend becomes a client/worker: an uncredentialed backend raises `InferenceBackendCredentialsError` there. Defence in depth — a keyless boot is forced-DRY (`runtime_boot.py:539`) so no worker should be built at all — but the placeholder is a live-fire hazard either way and is worth closing while we are here.+- Replace the `lenient: bool` parameter of `InferenceBackendLibrary.load` with an explicit `BackendLoadMode` StrEnum — `REQUIRE_CREDENTIALS` / `METADATA_ONLY`. Credential errors no longer skip the backend in `METADATA_ONLY`; nothing else changes.+- Substitution today is all-or-nothing: `apply_to_strings_recursive` raises on the first unresolvable `${VAR}`. Add a collecting variant that, in `METADATA_ONLY`, substitutes what resolves, records the names it could not, and leaves those fields unset. Note `${AZURE_API_BASE}`-style endpoints go the same way — irrelevant to metadata, relevant only to a call.+- `InferenceBackend` gains `missing_credential_vars: list[str]` and an `is_credentialed` property. Keep `all_enabled_backends()` returning uncredentialed backends — the deck must contain their models — and add `all_credentialed_backends()` for callers that mean "usable for inference".+- `ModelManager.setup` picks the mode from `needs_inference`.+- **Guard the live path loudly.** `pipelex/providers/openai/openai_client_factory.py` turns a `None` key into `"unused-no-auth-needed"`, which would surface a missing credential as a provider 401 rather than as our own error. Gate at the point a backend becomes a client/worker: an uncredentialed backend raises `InferenceBackendCredentialsError` there. Defence in depth — a keyless boot is forced-DRY so no worker should be built at all — but the placeholder is a live-fire hazard either way.- Sweep `all_enabled_backends()` callers (doctor, `show backends`, the init flows) and move the ones that mean "credentialed" onto the new accessor. This is the part most likely to surprise; do it with a grep, not from memory.Green after this: every assertion in §3.1 except any gateway-only model on an offline machine.-### 3.4 Part 3 — the residual, made audible--Once Part 2 lands, a missing model spec on a keyless boot means something specific and narrow: *this model's metadata is genuinely unknowable here* (gateway model, no network, dummy specs) — not "we forgot to load anything". Warn exactly there, and only there.+### 3.3 Part 3 — the residual, made audible-> **The warning site named below is deleted; the need is smaller but not zero.** `derive_templating_style` was where this plan proposed to warn, because a silently-wrong prompt shape was the damage being detected. That damage is gone. What is left worth warning about is narrower: a model whose spec is unknowable still silently skips the `max_prompt_images` check (symptom 3) and the param-support validation (symptom 4). If Part 2 is built, warn at *those* two sites — where a constraint is being skipped rather than enforced — and drop the notion of a style-derivation warning entirely.+Once Part 2 lands, a missing model spec on a keyless boot means something specific and narrow: *this model's metadata is genuinely unknowable here* (gateway model, no network, dummy specs) — not "we forgot to load anything". Warn exactly there, and only there: at the `max_prompt_images` and param-support checks, when the spec is absent under a forced-dry boot, log that the constraint was not enforced and why.-- ~~In `derive_templating_style`, when the deck has no model **and** `is_dry_run_forced()` is set, emit a `log.warning` naming the handle and the fallback tag style.~~ **Obsolete.** Replace with: at the `max_prompt_images` and param-support checks, when the spec is absent under a forced-dry boot, log that the constraint was not enforced and why.-- Dedupe per boot, not per run: keep the already-warned handles on the `ModelDeck` instance, which is rebuilt at each boot. **Not** a ContextVar and not module-global state (`payload-first, no ContextVars`; a process-global set leaks across runs in a server). *(Unchanged — this part of the design survives whichever site does the warning.)*+Dedupe per boot, not per run: keep the already-warned handles on the `ModelDeck` instance, which is rebuilt at each boot. **Not** a ContextVar and not module-global state (payload-first, no ContextVars; a process-global set leaks across runs in a server).-### 3.5 Part 4 — entry-point audit+### 3.4 Part 4 — entry-point audit — ✅ shipped-- `cli/commands/run/_run_core.py:419` boots with the default `needs_inference=True` even for `--dry-run`, so `pipelex run --dry-run` demands credentials it never uses — and outright fails on a keyless machine, while `pipelex-agent run --dry` succeeds and degrades. Change to `needs_inference=not dry_run`. This is what makes the documented promise in `docs/features/validation-dry-run.md` ("no API calls required") true for both CLIs, and it is the user-visible half of the fix.-- Re-check `graph_cmd.py:160` and `show_cmd.py:312` (neither asks for specs today; after Part 2 they get metadata anyway — confirm neither now does surprise network I/O).-- Confirm the programmatic path the brief reproduces with, plain `Pipelex.make(needs_inference=False)`, is faithful for every locally-configured backend without needing `needs_model_specs=True`.+- `pipelex run --dry-run` boots `needs_inference=not dry_run` with `needs_model_specs=True`, the same boot `pipelex-agent run --dry-run` uses. Verified live: on a truly keyless machine the unfixed CLI died with *"Pipelex Gateway API key not set"*, the fixed one completes the dry run. Documented on `docs/tools/cli/run.md` and `docs/features/validation-dry-run.md` (including the item-5 limit, honestly), changelog entry under `[Unreleased]`, `cli-docs` drift contract acked.+- Still to confirm *if Part 2 lands*: `graph_cmd.py` and `show_cmd.py` boot with `needs_inference=False`; after Part 2 they get metadata anyway — confirm neither then does surprise network I/O. And the programmatic path, plain `Pipelex.make(needs_inference=False)`, becomes faithful for every locally-configured backend without needing `needs_model_specs=True`.-## 4. Sequencing+## 4. Sequencing (Parts 0, 2, 3)-1. **Part 0 tests** — commit red (or `xfail` with a reason naming this doc, flipped in step 4). They are the receipt that the bug existed. *(Assertion 2 is dropped and the prompt-parity test is green from the start — see §3.1.)*-2. ~~**Part 1** — self-contained; can merge on its own if Part 2 stalls.~~ **Dissolved; Part 2 no longer has a cheap independent sibling to ship ahead of it.**-3. **Part 2** — the core. ⛳ *Checkpoint*: at this point re-run the §3.1 gate and record actual numbers in this doc before touching the CLI surface; Part 2 is where a hidden `all_enabled_backends()` consumer would show up.-4. **Parts 3 + 4**, then flip the xfails.-5. **Mutation-check the gate**: revert Part 2 locally and confirm the *deck-count and handle-resolution* assertions go red. ⚠️ **Do not mutation-check against the prompt-parity test** — it passes with or without Part 2 now, by construction; using it as the mutation target would produce a false green on the whole gate.-6. `make agent-check` && `make agent-test`.+1. **Part 0 tests** — commit red (or `xfail` with a reason naming this doc, flipped in step 3). They are the receipt that the bug exists.+2. **Part 2** — the core. ⛳ *Checkpoint*: re-run the §3.1 gate and record actual numbers in this doc before touching anything else; Part 2 is where a hidden `all_enabled_backends()` consumer would show up.+3. **Part 3**, then flip the xfails.+4. **Mutation-check the gate**: revert Part 2 locally and confirm the *deck-count and handle-resolution* assertions go red. Do not mutation-check against the prompt-parity guard.+5. `make agent-check` && `make agent-test`.## 5. Decisions for Louis-- **⚠️ First, the prior question: is any of this still worth building?** The symptom that justified "faithful over cheap" — a dry run silently validating a prompt that will not be sent — is gone. Every survivor is either loud (5) or a skipped constraint check (3, 4) or a CLI inconsistency (7). Part 4 is cheap and clearly right on its own; Part 2 is the expensive one and now has to earn its keep against a weaker case. Recommend deciding Part 2 and Part 4 **separately** rather than as one plan.-- **Faithful over cheap** (§1) — confirm, *if Part 2 proceeds at all*. The alternative is a log line and a documented divergence, which is honest but leaves dry-run-as-validation skipping constraint checks it claims to run.-- **`pipelex run --dry-run` stops requiring credentials** (§3.5). Behaviour change, arguably breaking for anyone relying on it as a credential check. It is the right default, but say so in the changelog.-- **Handle-pinned bundles start validating keylessly** (item 5). A bundle that today fails `pipelex-agent validate` on a keyless machine will pass. That is a fix, but it changes CI outcomes for keyless runners.-- **Does `needs_model_specs` survive?** After Part 2 it means only "fetch the gateway's remote specs rather than dummy them" — i.e. a *network* flag, not a metadata flag. Either rename it (`needs_gateway_specs`) or document the narrowed meaning. Renaming touches every CLI command listed in §2 item 7; recommend renaming, since the current name is precisely what made the brief's closing sentence wrong.+- **⚠️ The prior question: is Part 2 still worth building?** The symptom that justified "faithful over cheap" — a dry run silently validating a prompt that would never be sent — is gone. Every survivor is either loud (5), a skipped constraint check (3, 4), or already fixed (7). The case *for*: item 5 gives keyless CI runners and pre-setup agents a false rejection on handle-pinned methods, and the invariant in §1 is the right one in principle. The case *against*: it is a loader-semantics change with a caller sweep and a live-path guard, for symptoms that are all visible or minor. If it proceeds, it is its own PR, not a rider.+- **Faithful over cheap** (§1) — confirm, if Part 2 proceeds. The alternative is a log line and a documented divergence (the docs already state the item-5 limit), which is honest but leaves dry-run-as-validation skipping constraint checks it claims to run.+- **Handle-pinned bundles start validating keylessly** (item 5). A bundle that today fails `pipelex-agent validate` on a keyless machine will pass. That is a fix, but it changes CI outcomes for keyless runners — say so in the changelog.+- **Does `needs_model_specs` survive?** After Part 2 it means only "fetch the gateway's remote specs rather than dummy them" — i.e. a *network* flag, not a metadata flag. Either rename it (`needs_gateway_specs`) or document the narrowed meaning. Renaming touches every CLI command that passes it; recommend renaming, since the current name is precisely what made the brief's closing assumption wrong.-## 6. Docs, changelog, drift+## 6. Docs, changelog, drift (with Part 2)-- `docs/features/validation-dry-run.md` — state the guarantee and its two exceptions (§1).+- `docs/features/validation-dry-run.md` — replace the item-5 limit with the guarantee and its one exception (offline gateway models).- `docs/under-the-hood/dry-run-mock-generation.md` — the credentials-vs-metadata split, and what the new warning means.- Backend config docs — `missing_credential_vars` / uncredentialed-but-enabled as a visible state.-- `CHANGELOG.md` under `## [Unreleased]`: ~~the dry-run parity fix, the explicit-`prompting_target` fix,~~ and the `pipelex run --dry-run` credential change. *(The first two are dissolved and are already covered by the templating-style entry that shipped on this branch — do not double-report them.)*+- `CHANGELOG.md` under `## [Unreleased]`: the keyless-validation change for handle-pinned bundles, and the `needs_model_specs` rename if taken.- `make drift-plan` after staging — Part 2 touches config-model and CLI trigger files; ack with an honest rationale.## 7. Out of scopediff --git a/wip/prompting-style/gateway-config-outlived-prompting-target.md b/wip/prompting-style/gateway-config-outlived-prompting-target.mdnew file mode 100644index 000000000..2f5ddee0f--- /dev/null+++ b/wip/prompting-style/gateway-config-outlived-prompting-target.md@@ -0,0 +1,46 @@+# The served gateway config outlived `prompting_target` — what happened, and what made the fix safe++**Found 2026-08-14, during Phase 3 of the templating-style plan; fully resolved the same day.** Kept as the record of a failure mode that will recur for any field ever removed from `InferenceModelSpecBlueprint`, and of the mechanism that makes such a removal safe.++## What happened++Deleting `prompting_target` from `InferenceModelSpecBlueprint` made **every** test in the suite error at boot, on this machine and on any machine with a cached gateway config:++```+InferenceBackendLibraryError: Invalid inference model spec 'gpt-4o-mini' for backend+'pipelex_gateway' from remote config with local overrides from '.pipelex/inference/backends/pipelex_gateway.toml':+Extra forbidden fields: 'prompting_target'+```++The Pipelex Gateway backend does not read its model specs from a file in this repo. They are fetched from the Pipelex API and cached at `~/.pipelex/cache/remote_config.json`, and that config's `backend_model_specs.defaults` block declared `prompting_target = "anthropic"`. `InferenceModelSpecBlueprint` is `extra="forbid"`, so once the field was deleted here, a config that still declared it stopped validating.++Note the asymmetry inside `InferenceBackendLibrary.load`: the loop that reclassifies unknown keys as outbound HTTP headers iterates the **per-model** dict only. So an unknown key per-model is silently turned into a header, while an unknown key in `defaults` is fatal. Same input, two opposite failure modes, neither of them "ignore it". That asymmetry is the subject of [`../rogue-extra-headers-guard-plan.md`](../rogue-extra-headers-guard-plan.md).++## What was done in `pipelex`++`drop_unknown_gateway_defaults` (`pipelex/cogt/model_backends/gateway_config.py`) prunes keys the blueprint does not know from the **remote** config's `defaults` before the merge with local overrides. Rationale, stated in the docstring: the gateway config is served by a component that deploys on its own schedule, so a client legitimately reads a config written by a different release than itself — an unknown key there is version skew, not a typo. Local backend files stay strict.++This is not a shim for `prompting_target` specifically; it is the tolerance a remote config needs in general, and it would have prevented this failure for any removed field. Tested in `tests/unit/pipelex/cogt/model_backends/test_gateway_unknown_defaults.py`.++The prune is pure and silent by design. It first logged the dropped keys, which crashed any caller that loads backends before `runtime_hub.set_config()` has configured the log dispatch (`RuntimeError: LogConfig is not set`) — and since the served config really did declare an unknown key, that fired on the ordinary success path, not a corner. Pinned by `test_pruning_does_not_need_the_log_hub`.++## What was done in the served config, and why it was safe++`prompting_target` is deleted from the gateway config our back-office repo (private) serves — its gateway-models TOML declared it in `[defaults]`, and its build service publishes that block as the remote config's `backend_model_specs`. It is dead data: nothing in `pipelex` reads it any more.++**The mechanism that made the deletion safe is the versioned config URL, not timing.** Deleting the key would otherwise have been a live prompt change for every deployed client, in the one direction we do not want:++| Client | Config declares the key | Config drops it |+|---|---|---|+| A client with the prune (this branch onward) | pruned → `xml` (the resolved default) | `xml` |+| Earlier release | `anthropic` → `xml` | **`None` → the filter's own `TICKS` fallback** |++An older client never reaches its configured `default_prompting_style`: `PromptingConfig.get_prompting_style(None)` returns `None` rather than the default, so no style reaches `apply_tag_style`, which applies its own `TagStyle.TICKS`. Every gateway prompt in the field would have moved from XML tags to backtick fences, silently.++That never happens because the served config is **versioned in its URL**: `pipelex_details.py` now points at `pipelex_remote_config_12.json` (was `_11`). The edited gateway TOML was published as `_12`; `_11` is frozen and still carries `prompting_target = "anthropic"`, so every earlier release keeps rendering XML. Verified live against both URLs: `_12` `defaults` = `{model_type, sdk, structure_method}`, `_11` = the same plus `prompting_target`, the same model entries either side.++**The URL bump is the compatibility boundary for any breaking change to this config.** It is the reason the deletion did not need to wait for a deployed floor, and it is worth knowing before the next one. Two cautions that go with it: the local cache at `~/.pipelex/cache/remote_config.json` is shared across every checkout on a machine and records no source URL, so a `_12` checkout can be reading an `_11` body populated by another checkout; and our JS runtime (private repo) is a second consumer of this wire contract that still pins `_11` and models `promptingTarget` on its own spec — unaffected today, divergent the moment it moves to `_12`.++## The open design question, answered elsewhere++Whether the per-model unknown-key → HTTP-header rule should survive is decided and planned in [`../rogue-extra-headers-guard-plan.md`](../rogue-extra-headers-guard-plan.md): the rule survives, but only for header-shaped keys; anything else is fatal from a local file and pruned from the served payload. To be executed after the templating-style branch merges, and never in a release that predates the `prompting_target` deletion.diff --git a/wip/prompting-style/gateway-config-still-declares-prompting-target.md b/wip/prompting-style/gateway-config-still-declares-prompting-target.mddeleted file mode 100644index 3e66df520..000000000--- a/wip/prompting-style/gateway-config-still-declares-prompting-target.md+++ /dev/null@@ -1,45 +0,0 @@-# The gateway config still declares `prompting_target` — a cross-repo follow-up--**Found 2026-08-14, during Phase 3 of the templating-style plan.** Deleting `prompting_target` from `InferenceModelSpecBlueprint` made **every** test in the suite error at boot, on this machine and on any machine with a cached gateway config:--```-InferenceBackendLibraryError: Invalid inference model spec 'gpt-4o-mini' for backend-'pipelex_gateway' from remote config with local overrides from '.pipelex/inference/backends/pipelex_gateway.toml':-Extra forbidden fields: 'prompting_target'-```--## Why it happens--The Pipelex Gateway backend does not read its model specs from a file in this repo. They are fetched from the Pipelex API and cached at `~/.pipelex/cache/remote_config.json`, and that config's `backend_model_specs.defaults` block carries `prompting_target = "anthropic"`. `InferenceModelSpecBlueprint` is `extra="forbid"`, so once the field was deleted here, a config that still declares it stopped validating.--Note the asymmetry inside `InferenceBackendLibrary.load`: the loop that reclassifies unknown keys as outbound HTTP headers iterates the **per-model** dict only. So an unknown key per-model is silently turned into a header (the hazard the implementation plan already flags), while an unknown key in `defaults` is fatal. Same input, two opposite failure modes, neither of them "ignore it".--## What was done here--`drop_unknown_gateway_defaults` (`pipelex/cogt/model_backends/gateway_config.py`) prunes keys the blueprint does not know from the **remote** config's `defaults` before the merge with local overrides. Rationale, stated in the docstring: the gateway config is served by a component that deploys on its own schedule, so a client legitimately reads a config written by a different release than itself — unknown key there is version skew, not a typo. Local backend files stay strict.--This is not a shim for `prompting_target` specifically; it is the tolerance a remote config needs in general, and it would have prevented this failure for any removed field. Tested in `tests/unit/pipelex/cogt/model_backends/test_gateway_unknown_defaults.py`.--The prune is pure and silent by design. It first logged the dropped keys, which crashed any caller that loads backends before `runtime_hub.set_config()` has configured the log dispatch (`RuntimeError: LogConfig is not set`) — and since the served config really does declare an unknown key, that fired on the ordinary success path, not a corner. Pinned by `test_pruning_does_not_need_the_log_hub`.--## What still needs doing, elsewhere--1. **Drop `prompting_target` from the gateway config served by the Pipelex API.** It is dead data as of this change: nothing in `pipelex` reads it any more. The source is **our back-office repo** (private), not the hosted server: its gateway-models TOML declares it in `[defaults]`, and its build service publishes that block as the remote config's `backend_model_specs`.-- **Done — and the mechanism that made it safe is the versioned config URL, not timing.** Deleting the key would have been a live prompt change for every deployed client, in the one direction we do not want:-- | Client | Config declares the key | Config drops it |- |---|---|---|- | With the prune (this branch) | pruned → `xml` (the new resolved default) | `xml` |- | Earlier release | `anthropic` → `xml` | **`None` → the filter's own `TICKS` fallback** |-- An older client never reaches its configured `default_prompting_style`: `PromptingConfig.get_prompting_style(None)` returns `None` rather than the default, so no style reaches `apply_tag_style`, which applies its own `TagStyle.TICKS` (`tools/jinja2/jinja2_filters.py`). Every gateway prompt in the field would have moved from XML tags to backtick fences, silently.-- That never happens because the served config is **versioned in its URL**, and this branch bumps it: `pipelex_details.py` now points at `pipelex_remote_config_12.json` (was `_11`). The edited `gateway_models.toml` was published as `_12`; `_11` is frozen and still carries `prompting_target = "anthropic"`, so every earlier release keeps rendering XML. Verified live against both URLs: `_12` `defaults` = `{model_type, sdk, structure_method}`, `_11` = the same plus `prompting_target`, 73 model entries either side.-- The URL bump is the compatibility boundary for *any* breaking change to this config, which is worth knowing before the next one — it is the reason the deletion did not need to wait for a deployed floor.-2. **Decide whether the per-model unknown-key → HTTP-header rule should survive for the gateway backend.** Deliberately untouched here. A removed field that had lived per-model rather than in `defaults` would have been sent to the provider as a header instead of raising — a worse outcome than the one that was actually hit, and one no test would catch.-- **Decided, and planned: [`../rogue-extra-headers-guard-plan.md`](../rogue-extra-headers-guard-plan.md).** The rule survives, but only for header-shaped keys; anything else is fatal from a local file and pruned from the served payload. To be executed after the templating-style branch merges.--Neither is in scope for the templating-style change. Item 1 is a back-office deliverable (private repo); item 2 is a design question about the backend loader that deserves its own look.diff --git a/wip/prompting-style/pr-1104-deferred-review-items.md b/wip/prompting-style/pr-1104-deferred-review-items.mdindex d8f3fc450..b5f9f6054 100644--- a/wip/prompting-style/pr-1104-deferred-review-items.md+++ b/wip/prompting-style/pr-1104-deferred-review-items.md@@ -1,49 +1,27 @@-# PR #1104 — review findings deferred, not dropped+# PR #1104 — review findings deferred out of that PR-Two findings from the bot review of [#1104](https://github.com/Pipelex/pipelex/pull/1104) were confirmed real but deliberately left out of that PR. Both threads stay **open** on the PR.+Two findings from the bot review of [#1104](https://github.com/Pipelex/pipelex/pull/1104) were confirmed real but deliberately left out of that PR. Their state today:----## 1. `TemplatingStyle` silently ignores unknown keys+## 1. `TemplatingStyle` silently ignores unknown keys — ✅ resolved on the stacked branch `fix/keyless-followups`**Reported by:** chatgpt-codex-connector (P2), on `pipelex/pipe_operators/llm/pipe_llm_blueprint.py`.-`TemplatingStyle` (`pipelex/tools/templating/templating_style.py`) is a bare `BaseModel`, so it inherits pydantic's default `extra="ignore"`. An author who misspells an optional key gets a silently different prompt shape:+`TemplatingStyle` was a bare `BaseModel` inheriting pydantic's default `extra="ignore"`, so `templating_style = { tag_style = "xml", text_formt = "markdown" }` parsed fine and yielded `xml/plain`. `TemplateBlueprint` — the rich `[pipe.name.template]` table on `PipeCompose` — had the same hole and a bigger one: `templating_stile` and `extra_contxt` were both dropped silently. Note the reporter's literal example (`{ text_formt = "markdown" }` alone) did **not** reproduce, because `tag_style` has no default and a table missing it fails both arms of the union; the misspelled key has to be an optional one.-```toml-templating_style = { tag_style = "xml", text_formt = "markdown" } # parses fine, yields xml/plain-```+**Fixed as one strictness pass over both nested authoring models, not a drive-by on one of them:** both are `extra="forbid"` now, with tests that pin the rejection directly, through `PipeLLMBlueprint`, through `PipeComposeBlueprint`, and across a kajson round trip. The MTHDS JSON Schema gains `additionalProperties: false` on both definitions (`make gms` / `make cms` green; no tracked diff, since `derived/mthds_schema.json` is gitignored).-Confirmed end-to-end through the MTHDS parse path — nothing at bundle level catches it, because the blueprint validation *is* the check and it stops at the nested-model boundary.--Note the reporter's literal example (`{ text_formt = "markdown" }` alone) does **not** reproduce: `tag_style` has no default, so a table missing it fails both arms of the union. The misspelled key has to be an *optional* one, with `tag_style` present.--Every sibling authoring model is strict — `PipeBlueprint`, `ConceptBlueprint`, `DomainBlueprint`, `SubPipeBlueprint` all set `extra="forbid"`, and `ConfigModel` exists as a shared strict base. `TemplatingStyle` is one of the few nested authoring models that inherits neither.--**Why it was deferred.** The fix reads like a one-liner and isn't:--- `TemplatingStyle` is pre-existing and **already reachable from the published JSON Schema** via `TemplateBlueprint` (on `dev`). Its generated definition currently emits no `additionalProperties`; adding `extra="forbid"` emits `"additionalProperties": false`. That is a schema change requiring `pipelex-dev generate-mthds-schema` plus the `mthds-schema-sync` propagation to the downstream committed copies, gated on a released `pipelex` version. The drift is invisible in a PR because `derived/mthds_schema.json` is gitignored.-- `TemplateBlueprint` itself has the **same hole and a bigger one** — both `templating_stile` and `extra_contxt` are silently dropped today, on the `PipeCompose` authoring surface. Closing only `TemplatingStyle` is exactly the partial fix the templating-style plan warns about elsewhere.--**Recommendation.** One deliberate strictness pass over the nested authoring models — `TemplatingStyle` and `TemplateBlueprint` together — with the schema regen and downstream sync budgeted as part of it. Not a drive-by line in a 120-file PR.--**When.** Any time before the next release that moves the schema; it composes naturally with any other MTHDS-schema-affecting change, since the sync tax is paid once.+**What is still release-gated:** the downstream propagation of that schema change to the committed copies in `mthds`, `vscode-pipelex` and `mthds-ui`, via the `mthds-schema-sync` skill once a `pipelex` release carries it. It rides with the `templating_style` schema change from #1104 itself — the sync tax is paid once. Already listed in the [implementation plan's out-of-scope follow-ups](templating-style-implementation-plan.md#out-of-scope-here--release-gated--cross-repo-follow-ups).----## 2. `PipeStructure` does not resolve the authored templating style+## 2. `PipeStructure` does not resolve the authored templating style — deliberately left as is**Reported by:** cubic-dev-ai (P2), as the second half of the `preliminary_text` finding. The first half — the draft blueprint dropping `templating_style` — was a real bug and is fixed in #1104.-There is a genuine asymmetry between the two structuring paths:--- `direct` — `run_llm_object` renders `output_structure_prompt` under the **authored** style.-- `preliminary_text` — the synthesized `PipeStructure` renders it under the **runtime default**.--**Why it was deferred.** It is unobservable under the shipped templates, and closing it is a refactor that contradicts a decision the code already records:+There is a genuine asymmetry between the two structuring paths: `direct` renders `output_structure_prompt` under the **authored** style, while `preliminary_text` synthesizes a `PipeStructure` that renders it under the **runtime default**.-- Both built-in structuring templates (`structuring_prompt`, `output_structure_prompt` in `pipelex.toml`) use bare `{{ }}` interpolation with no style-sensitive filter, on a value that is already a `str`. The style is inert there.-- `pipe_structure.py` states the choice deliberately: *"No authored style on this operator: the structuring prompt takes the runtime default, the same one an LLM pipe that declares nothing gets."* The matching docs say the same.-- Closing it means a new field on `PipeStructureBlueprint` + `PipeStructureFactory` + the runtime pipe + the builder spec + the JSON schema + downstream schema sync — for zero observable effect today.+**Why it stays:** it is unobservable under the shipped templates, and closing it contradicts a decision the code records on purpose. Both built-in structuring templates (`structuring_prompt`, `output_structure_prompt` in `pipelex.toml`) use bare `{{ }}` interpolation with no style-sensitive filter, on a value that is already a `str` — the style is inert there. `pipe_structure.py` states the choice: *"No authored style on this operator: the structuring prompt takes the runtime default, the same one an LLM pipe that declares nothing gets."* Closing it would mean a new field on `PipeStructureBlueprint` + `PipeStructureFactory` + the runtime pipe + the builder spec + the JSON schema + downstream schema sync, for zero observable effect today.-**Recommendation.** Leave it. Revisit only if a structuring template ever grows a style-sensitive filter (`| tag`, `| format`), at which point the asymmetry becomes observable and the field earns its cost. If revisited, it lands with item 1 above — both pay the same schema-sync tax.+**Revisit only if** a structuring template ever grows a style-sensitive filter (`| tag`, `| format`), at which point the asymmetry becomes observable and the field earns its cost.diff --git a/wip/prompting-style/templating-style-implementation-plan.md b/wip/prompting-style/templating-style-implementation-plan.mdindex 3cd492838..6fcece2ca 100644--- a/wip/prompting-style/templating-style-implementation-plan.md+++ b/wip/prompting-style/templating-style-implementation-plan.md@@ -1,6 +1,6 @@# Templating style as an authoring decision — implementation plan-**2026-08-14, branch `fix/Keyless-dry-run` (worktree `_keyless`), off v0.44.0.** Implements [`prompt-style-as-an-authoring-decision.md`](prompt-style-as-an-authoring-decision.md) under the settled §7 rulings: **`templating_style` everywhere**, global default **`xml` + `plain`**, **no per-model/preset override**, authored surface = **full `TemplatingStyle`** (bare string = `tag_style` shorthand, inline table = full struct).+**2026-08-14, branch `fix/Keyless-dry-run` (worktree `_keyless`), off v0.44.0 — ✅ all phases built and committed; under review as [PR #1104](https://github.com/Pipelex/pipelex/pull/1104) against `dev`.** Implements [`prompt-style-as-an-authoring-decision.md`](prompt-style-as-an-authoring-decision.md) under the settled §7 rulings: **`templating_style` everywhere**, global default **`xml` + `plain`**, **no per-model/preset override**, authored surface = **full `TemplatingStyle`** (bare string = `tag_style` shorthand, inline table = full struct).Progress is tracked with the checkboxes below. **Checkpoints marked ✋ are hard stops: the executing agent must not proceed past them without Louis' explicit go.** At every checkpoint, update this doc first: tick boxes, fill the checkpoint log at the bottom (status, decisions taken, open questions, state of the code), so the work can hand off into a fresh session with nothing lost.@@ -15,12 +15,6 @@ These follow from "one name everywhere" but were not explicitly ruled; they are- **D5 — filters go strict, entry points resolve.** `render_template` keeps an optional `templating_style` (the EXPRESSION and MERMAID categories have no tag/format filters and legitimately render style-less), but the `tag` / `format` / `with_images` filters lose their silent fallbacks (`TICKS`, `PLAIN`): a missing context key raises `Jinja2ContextError`, because after this change every prompt-rendering entry point supplies a resolved style — a missing one is a bug, per §4.3.- **D6 — no new authored field on PipeImgGen/PipeSearch in this change.** They inherit the config default through the resolver (§5's requirement); giving them their own authored knob is a deliberate follow-up if ever wanted, not scope creep now.-## Baseline: what is already sitting uncommitted on this branch--The worktree carries doc-migration changes from the design session: `pipelex/kernel/pipelex_kernel.py` (docstring pointer re-aimed at the new design-doc filename), the `wip/prompting-style/` README deletion + design doc, the `wip/keyless/` brief and plan, and `wip/parity/` updates. Plus this plan and the design doc's §7 ruling record.--- [x] Commit the standing wip/doc baseline as its own commit before Phase 0 code begins, so each phase's diff is reviewable on its own. — Already done before this session: the branch-tip commit "plans" carries exactly that baseline (kernel docstring pointer, wip/prompting-style, wip/keyless, wip/parity).-## Phase map- **Phase 0** — prerequisite: re-home reasoning budgets off `prompting_target` (§6). Standalone, shippable, zero style-behaviour change. → ✋ **Checkpoint 1**@@ -132,7 +126,7 @@ Everything below is uncalled after Phases 0-2; this phase is grep-verified removThe fix is not a shim for this field. `drop_unknown_gateway_defaults` (`cogt/model_backends/gateway_config.py`) prunes keys the blueprint does not know from the **remote** config's `defaults` before the merge with local overrides, on the principle that a config served by a component deploying on its own schedule is legitimately written by a different release than the client reading it — version skew to tolerate, not a typo to reject. Local backend files stay strict. Tested in `tests/unit/pipelex/cogt/model_backends/test_gateway_unknown_defaults.py`.-Two things this leaves for elsewhere, written up in [`gateway-config-still-declares-prompting-target.md`](gateway-config-still-declares-prompting-target.md): dropping the now-dead field from the config our hosted plane serves, and deciding whether the per-model unknown-key → HTTP-header rule should survive for the gateway backend (a removed field living per-model rather than in `defaults` would have been *sent to the provider as a header* instead of raising — a worse outcome than the one actually hit, and one no test would catch).+Two things this leaves for elsewhere, written up in [`gateway-config-outlived-prompting-target.md`](gateway-config-outlived-prompting-target.md): dropping the now-dead field from the config our hosted plane serves, and deciding whether the per-model unknown-key → HTTP-header rule should survive for the gateway backend (a removed field living per-model rather than in `defaults` would have been *sent to the provider as a header* instead of raising — a worse outcome than the one actually hit, and one no test would catch).### ✋ CHECKPOINT 2 — HARD STOP@@ -188,11 +182,11 @@ Everything is green and documented; nothing is committed beyond what earlier che- **`pipelex-api` CI** — its openapi check runs only under its own `make check` and has been bitten by pipelex bumps before; verify on the release bump whether the schema change surfaces there.- **Cookbook / starter sweeps** — no shipped `.mthds` uses any styling surface today, so no migration is expected; a post-release sanity pass confirms.- **Downstream backend-TOML sweep — a boot-breaker, and the one item on this list that is not optional.** Every repo that ships its own `.pipelex/inference/backends/*.toml` still declares `prompting_target`, and local backend files are read strictly: on the `pipelex` version bump each one dies at boot with `Extra forbidden fields: 'prompting_target'`. Tracked-file hits confirmed in `pipelex-api/`, `cocode/`, `pipelex-cookbook/`, `mthds-ui/`, plus our hosted worker, our demo repos, and two fixtures in our JS runtime (all private). **`portkey.toml` is the trap in every one of them**: the key appears once in `[defaults]` *and* again on several per-model entries, so a "fix" that deletes only the `[defaults]` line unblocks the boot while leaving the per-model ones — which the loader reclassifies as **outbound HTTP headers** sent to Portkey. Delete every occurrence, `[defaults]` and per-model alike, and grep to prove it.-- **~~The served gateway config~~ — DONE (2026-08-14), and it changed the branch.** The config is owned by our back-office repo, not the hosted server (both private): its gateway-models TOML declared `prompting_target = "anthropic"` in its `[defaults]`, and its build service publishes that block as the remote config's `backend_model_specs` — that file is the reason `drop_unknown_gateway_defaults` exists. The key is deleted there (edit + `[Unreleased]` changelog, uncommitted in that repo) and **published**.+- **The served gateway config — done (2026-08-14), and it changed the branch.** The config is owned by our back-office repo, not the hosted server (both private): its gateway-models TOML declared `prompting_target = "anthropic"` in its `[defaults]`, and its build service publishes that block as the remote config's `backend_model_specs` — that file is the reason `drop_unknown_gateway_defaults` exists. The key is deleted there and **published**.- Publishing it was only safe because **the served config is versioned in its URL, and this branch bumps it**: `pipelex/system/pipelex_service/pipelex_details.py` now points at `pipelex_remote_config_12.json` (was `_11`) — an uncommitted change on this branch that must ship with it. `_11` is frozen and still carries the key, so earlier releases keep resolving `anthropic` → `xml`; had they read a key-less config they would have fallen through to `TagStyle.TICKS`, flipping every gateway prompt in the field to backtick fences. Verified live against both URLs. Retires the *occasion* for the tolerance, not the tolerance itself, which is general. See [`gateway-config-still-declares-prompting-target.md`](gateway-config-still-declares-prompting-target.md).+ Publishing it was only safe because **the served config is versioned in its URL, and this branch bumps it**: `pipelex/system/pipelex_service/pipelex_details.py` now points at `pipelex_remote_config_12.json` (was `_11`), committed on this branch with its own changelog entry. `_11` is frozen and still carries the key, so earlier releases keep resolving `anthropic` → `xml`; had they read a key-less config they would have fallen through to `TagStyle.TICKS`, flipping every gateway prompt in the field to backtick fences. Verified live against both URLs. Retires the *occasion* for the tolerance, not the tolerance itself, which is general. See [`gateway-config-outlived-prompting-target.md`](gateway-config-outlived-prompting-target.md).- Two things this leaves open: **the URL bump needs a Phase 4 changelog line** (a released client fetching a different config URL is user-visible), and **our JS runtime (private repo) is a second consumer of this same wire contract** — it pins `_11` in its own worker catalogue and models the field as `promptingTarget` on its spec, so it is unaffected today but diverges the moment it moves to `_12`. That is beyond the backend-TOML fixture hits already listed above.+ One thing this leaves open: **our JS runtime (private repo) is a second consumer of this same wire contract** — it pins `_11` in its own worker catalogue and models the field as `promptingTarget` on its spec, so it is unaffected today but diverges the moment it moves to `_12`. That is beyond the backend-TOML fixture hits already listed above.- **PipeImgGen/PipeSearch authored styling** (D6) — only if a real need appears.## Checkpoint log@@ -215,7 +209,7 @@ Everything is green and documented; nothing is committed beyond what earlier che**Phase 3 landed (2026-08-14), committed, all gates green.** `prompting_target` is gone from `LLMSetting`, `InferenceModelSpec`, `InferenceModelSpecBlueprint`, the factory passthrough, and every backend TOML in both trees — the field deletion and the TOML deletions in one commit, as the silent-header hazard requires. The `PromptingTarget` enum module is deleted. The dead `llm_prompt_template.py` / `llm_prompt_factory_abstract.py` / `llm_prompt_template_inputs.py` trio went with it, along with `LLMPromptTemplateInputsError` and its generated error page and identity row; the serde tests they anchored now exercise `LLMPrompt`.- **The one surprise, and it was a big one:** the deletion broke the boot against the *remote* gateway config, which still declares `prompting_target`. Whole suite red, one cause. Resolved with a general remote-config tolerance rather than a field-specific shim; a back-office follow-up and an open design question are written up in [`gateway-config-still-declares-prompting-target.md`](gateway-config-still-declares-prompting-target.md). **This is the item most worth Louis' ruling.**+ **The one surprise, and it was a big one:** the deletion broke the boot against the *remote* gateway config, which still declares `prompting_target`. Whole suite red, one cause. Resolved with a general remote-config tolerance rather than a field-specific shim; a back-office follow-up and an open design question are written up in [`gateway-config-outlived-prompting-target.md`](gateway-config-outlived-prompting-target.md). **This is the item most worth Louis' ruling.****Before / after, one real prompt.** Same template (`Summarize the article below.\n\n@article\n\nKeep it to one sentence.`), same input, rendered under the old OpenAI-family style and under the new default:@@ -234,7 +228,7 @@ Everything is green and documented; nothing is committed beyond what earlier che**Open for Louis at this checkpoint:** (a) the gateway-config finding above and its two follow-ups; (b) the commit strategy — Phases 0-3 are four separate commits on `fix/Keyless-dry-run`, so squashing to any shape is still trivial; (c) whether Phase 4's changelog entry should call out the compose and img-gen flips separately from the LLM one (they change prompt text for anyone whose template uses `| tag`, not just OpenAI-family users).-- **Checkpoint 3:** *(2026-08-14)* **Reached. Phases 4 and 5 complete; `make agent-check`, the full `make agent-test`, and `mkdocs build --strict` all green.** Phases 4-5 are **staged but uncommitted**, per this checkpoint's own terms — the commit/PR shape is Louis' call.+- **Checkpoint 3:** *(2026-08-14)* **Reached. Phases 4 and 5 complete; `make agent-check`, the full `make agent-test`, and `mkdocs build --strict` all green.** Outcome: everything committed on `fix/Keyless-dry-run` (one commit per phase, plus review-fix commits) and opened as [PR #1104](https://github.com/Pipelex/pipelex/pull/1104) against `dev`, branch name kept. Two review findings were deferred out of that PR into [`pr-1104-deferred-review-items.md`](pr-1104-deferred-review-items.md); the strictness one is resolved on the stacked branch `fix/keyless-followups`, along with keyless Part 4 (`pipelex run --dry-run` no longer demands credentials).**Phase 4 — migration surfaces.** Schema regenerated (`make gms`/`make cms` green); it produces no tracked diff because `derived/mthds_schema.json` is gitignored, so the schema reaches consumers only via the release-gated downstream sync. Docs: the dead-premise page `adapt-to-llm-prompting-style-openai-anthropic-mistral.md` is **deleted** and replaced by a new authoring page, [`docs/building-methods/templating-style.md`](../../docs/building-methods/templating-style.md) — the two-level model, bare-string vs full-table, the four-style gallery with rendered output for each, what the two sigils (`@` tag / `$` format) each govern, and the compose/img-gen story. `mkdocs.yml` updated in three places (both nav entries, the legacy redirect re-aimed) plus a **new** redirect from the deleted path — that fourth entry is load-bearing: `docs/404.html`'s prefix rule rewrites the legacy URL to the now-deleted `building-methods/adapt-…` path, so without it the JS-rewrite fallback would land on a 404. `llm-integration.md` (section + front-matter), `features/index.md`, `inference-backend-config.md`, `PipeLLM.md` (new parameter row), `PipeCompose.md` (wording + cross-link) all updated. Changelog `## [Unreleased]` written with the breaking entry.@@ -246,4 +240,4 @@ Everything is green and documented; nothing is committed beyond what earlier che**The re-scope produced a judgement Louis should overrule if he disagrees.** I flagged in that plan that **the surviving residue may no longer be worth Part 2's blast radius**, and said so at the top rather than quietly proceeding. The reasoning: the symptom that justified "faithful over cheap" was a dry run *silently* validating a prompt that would never be sent. Every survivor is either loud (handle-pinned bundles rejected), a skipped constraint check (`max_prompt_images`, img-gen params), or a CLI inconsistency. Item 5 in particular loses its force — it was framed as "the loud converse of item 1", and with item 1 gone a loud refusal is a much weaker case for the `BackendLoadMode` surgery than a silent rewrite was. My recommendation is to decide **Part 2 and Part 4 separately**: Part 4 (`pipelex run --dry-run` should stop demanding credentials) is cheap and clearly right on its own. I also flagged a live trap for whoever builds it: the prompt-parity end-to-end test is now **green before any production edit**, so using it as the mutation-check target would produce a false green across the whole gate.- **Open for Louis:** (a) commit/PR shape for Phases 0-5 — six commits' worth on `fix/Keyless-dry-run`, still trivially squashable; (b) whether the branch keeps its name, since the keyless bug it was cut for was dissolved rather than fixed; (c) the Checkpoint-2 gateway-config finding and its two follow-ups, still unruled; (d) the changelog's separate compose/img-gen entry (my call, easily merged); (e) the Part 2 re-judging above. **The downstream backend-TOML sweep is the one non-optional follow-up** — every repo shipping its own `.pipelex/inference/backends/*.toml` dies at boot on the version bump, and `portkey.toml`'s per-model occurrences become outbound HTTP headers if only the `[defaults]` line is deleted.+ **Rulings since:** the commits stayed as they were and went up as PR #1104 under the existing branch name; the compose/img-gen changelog entry stayed separate; the gateway-config finding is closed (served config fixed and published behind the `_12` URL bump; the header-rule question is planned in [`../rogue-extra-headers-guard-plan.md`](../rogue-extra-headers-guard-plan.md)). **Still open: the Part 2 re-judging** in the keyless plan. **The downstream backend-TOML sweep is the one non-optional follow-up** — every repo shipping its own `.pipelex/inference/backends/*.toml` dies at boot on the version bump, and `portkey.toml`'s per-model occurrences become outbound HTTP headers if only the `[defaults]` line is deleted.diff --git a/wip/rogue-extra-headers-guard-plan.md b/wip/rogue-extra-headers-guard-plan.mdindex f5fb0a90a..ce16c8e58 100644--- a/wip/rogue-extra-headers-guard-plan.md+++ b/wip/rogue-extra-headers-guard-plan.md@@ -1,6 +1,6 @@# Guarding against rogue outbound headers — implementation plan-**Written 2026-08-14, to be executed after the templating-style branch merges.** This answers item 2 of [`prompting-style/gateway-config-still-declares-prompting-target.md`](prompting-style/gateway-config-still-declares-prompting-target.md) — "decide whether the per-model unknown-key → HTTP-header rule should survive" — which that document deliberately left open because it is a design question about the backend loader, not part of the templating change.+**Written 2026-08-14, to be executed after the templating-style branch merges.** This answers item 2 of [`prompting-style/gateway-config-outlived-prompting-target.md`](prompting-style/gateway-config-outlived-prompting-target.md) — "decide whether the per-model unknown-key → HTTP-header rule should survive" — which that document deliberately left open because it is a design question about the backend loader, not part of the templating change.Progress is tracked with the checkboxes below. **The checkpoint marked ✋ is a hard stop: the executing agent must not proceed past it without Louis' explicit go.** At the checkpoint, update this doc first — tick boxes, fill the checkpoint log at the bottom — so the work can hand off into a fresh session with nothing lost.