Skip to content

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.

feature/Prune-stale-logs · L-260927-33b10b (#1390)

Louis Choquel3b185ac77ebb
diff --git a/.drift/acks/cli-docs.toml b/.drift/acks/cli-docs.toml
index 7b4540750..34e934523 100644
--- a/.drift/acks/cli-docs.toml
+++ b/.drift/acks/cli-docs.toml
@@ -1,8 +1,8 @@
contract = "cli-docs"
-digest = "sha256:13211c0b5189edf723da8779be456ddd41d0a13eb5f352b6d08f0b91bb314e9b"
-reviewed_by = "Claude (Opus 5.5)"
-reviewed_at = "2026-10-09T18:08:28Z"
-rationale = "clean-pass: the trigger change makes the hosted refusal envelope read error_domain and retryable off the problem document through sent_verdict, because pipelex-sdk 0.36+ fills unsent members from its own table and would otherwise mark an unlabelled 503 retryable; the envelope's output is unchanged. docs/tools/cli/agent-cli.md still says what it does (domain, category and retryable are the runner's own, a 429 is inferred retryable, a 503 only when the answer says so, ApiUnreachableError only before the run request left, HostedRunOutcomeUnknownError after), so no docs change; the agent CLI CLAUDE.md got a clause naming sent_verdict, written with the change rather than caught by this review."
+digest = "sha256:7398755782f220e2cb9fa6ba5396251d5cd1dfd16fdfce691421472189c06279"
+reviewed_by = "Louis Choquel"
+reviewed_at = "2026-10-09T19:02:50Z"
+rationale = "clean-pass: the merge of dev into the log-pruning branch joins two trigger changes each reviewed on its own side, the deletion of VERBOSE lines in pipelex run's output writer and in pipelex which, and the agent CLI's hosted refusal envelope reading error_domain and retryable through sent_verdict. They touch different files and neither moves an option, an output file, a printed line or an exit behaviour the other's review relied on, so docs/tools/cli/ and the agent CLI CLAUDE.md still read as both reviews left them; no docs change."
[trigger_files]
"pipelex/cli/__init__.py" = "blob:8b137891791fe96927ad78e64b0aad7bded08bdc"
@@ -108,7 +108,7 @@ rationale = "clean-pass: the trigger change makes the hosted refusal envelope re
"pipelex/cli/commands/run/_inputs_file_loader.py" = "blob:957e6eb00531d168b3b1e179a517717d069cb7fc"
"pipelex/cli/commands/run/_inputs_path_resolver.py" = "blob:c8ec89d98718e18af7aaaded44c9f545be60adab"
"pipelex/cli/commands/run/_main_stuff_file.py" = "blob:ca806e55085aa2e5748492751521296ce1f42960"
-"pipelex/cli/commands/run/_run_core.py" = "blob:a41aafa3ee899c51e4b3b3919d164c8aaebe2095"
+"pipelex/cli/commands/run/_run_core.py" = "blob:90832f803424b691e30fab0677540ec54f98c66d"
"pipelex/cli/commands/run/_run_hosted.py" = "blob:dd5801877a636f71187e9b23c2fab18d4d25ba32"
"pipelex/cli/commands/run/app.py" = "blob:e312b159625e0a72bc9a18d3bfd2c73e7ac59f24"
"pipelex/cli/commands/run/bundle_cmd.py" = "blob:aba274dc8d6d0ac08baa3f21afbc06b2fdbec356"
@@ -123,7 +123,7 @@ rationale = "clean-pass: the trigger change makes the hosted refusal envelope re
"pipelex/cli/commands/validate/bundle_cmd.py" = "blob:1fbf3e0cf695db39101c83160a724df6468988e9"
"pipelex/cli/commands/validate/method_cmd.py" = "blob:f12ee233fc985d04a4512f1fef6b9ea02a1b9644"
"pipelex/cli/commands/validate/pipe_cmd.py" = "blob:791b9a693f4ec52f727b42dab4b102af46a4ee22"
-"pipelex/cli/commands/which_cmd.py" = "blob:ed45019f8acd3678340fe395c49d065d6fc6c04d"
+"pipelex/cli/commands/which_cmd.py" = "blob:530bcf9c593f5b6d09b84d929b932310fc891fde"
"pipelex/cli/deck_notice.py" = "blob:542877125e89e35b02bc969cfee952155b0d7c2c"
"pipelex/cli/error_handlers.py" = "blob:92d233152460052a423f021e8252fbce872a9de4"
"pipelex/cli/exceptions.py" = "blob:1d51c3a53ddd3f6cf8de566fa2ade3fa75ab7a3a"
diff --git a/.drift/acks/config-docs.toml b/.drift/acks/config-docs.toml
index 8fe38f8ba..e53a89150 100644
--- a/.drift/acks/config-docs.toml
+++ b/.drift/acks/config-docs.toml
@@ -1,8 +1,8 @@
contract = "config-docs"
-digest = "sha256:46c31fd39394e47c2ae4442305c8ba645a976ff45dc44286f8f3416f73a3bf11"
+digest = "sha256:da981a7560d55779afc3d749b23978386605f9333bd8e9c2d25954b7cad15243"
reviewed_by = "Claude (Opus 5.5)"
-reviewed_at = "2026-10-08T12:44:52Z"
-rationale = "clean-pass: merged tree of origin/dev into this branch. The open trigger changes are this branch's own, the run section in pipelex/pipelex.toml and RunConfig in configs.py, already answered on the branch by run-config.md and the five-section list in docs/configuration/index.md; dev changed only the home fill in config_loader.py. The auto-merged index.md reads as one: dev's rewritten PIPELEX_HOME section and this branch's section list touch different paragraphs. A hosted run that reads the run setting goes through load_config and so now fills a home's missing kit files like any boot; run-config.md and run.md say a hosted run boots nothing locally and needs no inference configuration, which stays true, and no doc claims it leaves the home untouched. The run path is additive, so no migration ledger entry, and neither side touched the ledgers."
+reviewed_at = "2026-10-09T18:11:07Z"
+rationale = "real-catch: log_levels.py joins the triggers because the LogLevel enum is what the config docs list. Re-derived from the enum its members VERBOSE, DEBUG, INFO, WARNING, ERROR, CRITICAL and OFF, which match the valid values logging-config.md gives for default_log_level and its gcp severity note naming VERBOSE as the only custom level; removing LogLevel.from_int touches no setting. The review caught logging-config.md's Migrating From the DEV Level section claiming a file naming DEV stops the boot: ConfigLoader.load_config_validated replays the ledger in memory on a validation failure and pipelex-config@6 is a safe remap, so such a file boots at DEBUG with a stale-configuration warning, now said there and pinned by a test through the loader. The ledger entry, configs.py and config_cogt.py name no level beyond that and are unchanged."
[trigger_files]
"pipelex/cogt/config_cogt.py" = "blob:02f71cb4a6b01aebda59c2e31f262ef9c865e17b"
@@ -20,8 +20,9 @@ rationale = "clean-pass: merged tree of origin/dev into this branch. The open tr
"pipelex/system/configuration/configs.py" = "blob:1754391061f3be47e28088a4f8ea85e60b1cdd2b"
"pipelex/system/configuration/pipe_func_config.py" = "blob:dc8890e914fbcdb611147e42eaa0cd87b32288a5"
"pipelex/system/telemetry/telemetry_config.py" = "blob:068a785d97a2d52ee43e82e723cd944b8b6601bc"
-"pipelex/tools/aws/aws_config.py" = "blob:c1aeafeae08d3921464db33795f11a29ff3892ba"
+"pipelex/tools/aws/aws_config.py" = "blob:e27dc96bf0b2ef98a45354712421252fe0b893b5"
"pipelex/tools/log/log_config.py" = "blob:63dd9f81fdbafc1a095aec6cde1b047d0ebdd2d4"
+"pipelex/tools/log/log_levels.py" = "blob:12b94e4d4793a70156ac547ee20c9d483910ecae"
"pipelex/tools/network/network_config.py" = "blob:e12d1d0e4a40d04859f10a77addeaf8fe2b00414"
"pipelex/tools/secrets/secrets_config.py" = "blob:cf30aaec1c76c9cabc0531a5b9fe681e153d7024"
"pipelex/tools/storage/storage_config.py" = "blob:3ba0fee5282937e2639d2707ee8ab61aad7bf206"
diff --git a/.drift/acks/pipelex-kernel-docs.toml b/.drift/acks/pipelex-kernel-docs.toml
index e7d505029..528754aef 100644
--- a/.drift/acks/pipelex-kernel-docs.toml
+++ b/.drift/acks/pipelex-kernel-docs.toml
@@ -1,8 +1,8 @@
contract = "pipelex-kernel-docs"
-digest = "sha256:66bd0bb6f412ad068f472fb10bbde2d67578a831a64f18d8c022d09ee9db585a"
-reviewed_by = "Louis Choquel"
-reviewed_at = "2026-10-08T03:14:32Z"
-rationale = "clean-pass: search_ops.py and judgment_ops.py now pin the resolved setting through write_model_handle, so a served handle spelled like a reference rides as handle:<name>; docs/under-the-hood/pipelex-kernel.md lists resolve_search_setting and resolve_judgment_setting but does not describe how the setting is pinned, so nothing there is stale."
+digest = "sha256:a67b12d7b36c494bbc641d0ed14bd2c574e6ce49a8a3588b1032bf561e796287"
+reviewed_by = "Claude (Opus 5.5)"
+reviewed_at = "2026-10-09T17:40:08Z"
+rationale = "clean-pass: the trigger changes delete VERBOSE lines in llm_ops.py, img_gen_prompt.py and llm_prompt_content.py (the per-image and per-document extraction lines, the prompting-style line and the object-direct generation lines) and the imports they used; no kernel function, parameter or behaviour moved. pipelex-kernel.md's log-context section was re-checked against the code: every kernel function taking a job_metadata still opens with job_metadata.log_context(), and the page quotes none of the deleted lines."
[trigger_files]
"pipelex/kernel/__init__.py" = "blob:c4f1b0fe2ccc17db9110733f71b612f4ac1ba4ce"
@@ -14,12 +14,12 @@ rationale = "clean-pass: search_ops.py and judgment_ops.py now pin the resolved
"pipelex/kernel/func_ops.py" = "blob:97c68c977ddc260c9b36b7eda5f4c7964e956a27"
"pipelex/kernel/func_results.py" = "blob:a7425a0ddc21571f23c53b92f5d7559ffdd08b71"
"pipelex/kernel/img_gen_ops.py" = "blob:b85360f6c118e93be53bf8d1a04504ccb7552469"
-"pipelex/kernel/img_gen_prompt.py" = "blob:e4f72040561929aa0d96ad5f00b1c4af652d3f77"
+"pipelex/kernel/img_gen_prompt.py" = "blob:1f6347e10eaab2eb229fa1cee080c6bbc7878bd2"
"pipelex/kernel/img_gen_results.py" = "blob:46b4ca11c70d906ae6d58ce66461f9b3414f1bfa"
"pipelex/kernel/judgment_ops.py" = "blob:49ce7414eed9cfdf5595e877a64aacd29ada86ca"
"pipelex/kernel/judgment_results.py" = "blob:40ba1258cc81d34df3e427d5511ccd40c6edf789"
-"pipelex/kernel/llm_ops.py" = "blob:6555af22cadf5316cfcadf975d96b6792043c3a6"
-"pipelex/kernel/llm_prompt_content.py" = "blob:3fade4a660226e63ad4f916952ee37d34e7d2bbd"
+"pipelex/kernel/llm_ops.py" = "blob:c106daf0905dd9548a2a3661d580901abff52faa"
+"pipelex/kernel/llm_prompt_content.py" = "blob:eabf0ee760c3a26b8967973d511e712e9275e99b"
"pipelex/kernel/llm_results.py" = "blob:6e3b8a2878b5bb284ece5fac10262fb59ac2029d"
"pipelex/kernel/memory_ops.py" = "blob:7fbbfaaec99f9712d8e215520cb02e26aad3fb40"
"pipelex/kernel/pipelex_kernel.py" = "blob:5dec4e68d517d5ab1d7e9cbb91d836f37b10e713"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca509ebb6..418be957f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,13 @@
- **MTHDS standard 4.0.0 (Breaking)**: pipelex now requires `mthds==0.20.0` and `pipelex-sdk==0.37.0`, the releases that report MTHDS standard `4.0.0`, the language this runtime has implemented since v0.75.0, so everyone downstream inherits those exact versions and a project that pins either package itself has to move with them. `pipelex --version` prints `mthds-standard 4.0.0`, every crate pipelex normalizes is stamped with `mthds_version` `4.0.0` while crate fingerprints stay the same, and a package whose `METHODS.toml` constrains `mthds_version` to `^3.0.0`, `~3.0.0` or exactly `3.0.0` now logs a warning when it loads, which `>=3.0.0` or `^4.0.0` does not.
- **Stored names are plain input names (Breaking)**: every name under which a step stores a value in working memory, a `PipeSequence` step's or a `PipeParallel` branch's `result`, the `batch_as` of either, and a `PipeBatch`'s `input_item_name`, must now be a plain input name matching `[a-z][a-z0-9_]*`, as a binding step's `result` already had to, and a name in any other form, such as `Pages`, `doc.pages` or `_pages`, is refused as `invalid_input_name` wherever a bundle loads, and by the MTHDS JSON Schema, which now carries the input-name pattern on these fields. Rename such a name to a plain one, such as `pages`, along with every input, binding path and `batch_over` that reads it; a plain `batch_over` is still refused only when it starts with the reserved `_bound_`.
- **Hosted-run guidance in messages and help**: the next step of a refused Pipelex API key names `pipelex login` and the working directory's `.env` rather than a shell export, which a `.env` file setting the key overrides, and `pipelex login` names `[run] execution = "hosted"` rather than `pipelex init` to make hosted runs the default. A CLI run missing a provider key, and the `pipelex doctor` report, offer the hosted Pipelex API as a way out; a failed `pipelex-agent` boot points at `pipelex-agent migrate` and `pipelex-agent init` rather than the interactive `pipelex init config`; and `FormerReleaseConfigError` carries its remedy, `pipelex migrate`, as its `user_action`. The `run` help of both CLIs names hosted runs, catalog ids, local method directories and TOML or inline inputs, and `pipelex-agent --help` describes the program rather than printing an internal note.
+- **Debug and verbose log output**: the `DEBUG` and `VERBOSE` lines are fewer and shorter, each naming what it is about rather than narrating every step, and none carries a payload any more: no base64 data, prompt, rendered template, raw response or model dump. An LLM call's reasoning settings are logged once per call, at `DEBUG` with each setting sent as a field, rather than twice at `VERBOSE`, and the error for undecodable base64 input gives the input's length instead of its first bytes.
+- **`log.set_level_by_name` takes only Pipelex level names (Breaking)**: it accepts a `LogLevel` name in any case and raises `ValueError` for any other, so the stdlib spellings `WARN`, `FATAL` and `NOTSET` it used to accept are refused. Pass `WARNING` for `WARN` and `CRITICAL` for `FATAL`; `NOTSET` has no counterpart, `VERBOSE` being the lowest level.
+
+### Removed
+
+- **The DEV log level (Breaking)**: `LogLevel.DEV`, `LOGGING_LEVEL_DEV` and `log.dev()` are gone; the levels are `VERBOSE`, `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` and `OFF`, and code calling `log.dev()` calls `log.debug()` instead. A configuration file naming `DEV`, as `default_log_level` or as a level under `[runtime.log.package_log_levels]`, is migrated in memory at boot by ledger entry `pipelex-config@6`, which reads it as `INFO`, the level that lets through the same records now that nothing logs at `DEV`, and the boot warns that the file is out of date. **Migration:** run `pipelex migrate`, which rewrites `DEV` to `INFO` in the file on disk.
+- **Logging helpers nothing called (Breaking)**: `FuncRegistry.log()` and `FuncRegistry.set_logger()`, with the `func_registry` logger they wrote to, `InferenceManager.print_workers()` and `LogLevel.from_int()` are gone, with no replacement. Code that needs a `LogLevel` from a stdlib level number maps it itself.
### Fixed
diff --git a/docs/building-methods/pipes/pipe-controllers/PipeBatch.md b/docs/building-methods/pipes/pipe-controllers/PipeBatch.md
index ae0f68e3e..294caa4cd 100644
--- a/docs/building-methods/pipes/pipe-controllers/PipeBatch.md
+++ b/docs/building-methods/pipes/pipe-controllers/PipeBatch.md
@@ -32,7 +32,7 @@ For durable, rate-limited execution of very large batches, run the pipeline on t
## Compaction Under Absence
-When a branch's result resolves as a recorded absence — typically because the branch pipe is a `PipeCondition` whose outcome was `continue`, or the branch was skipped (lifted) on an absent optional value — that branch contributes **no item** to the aggregated output list. The list is compacted: a list cannot hold a hole, and absent results are dropped rather than replaced by placeholders. Order is preserved among the results that did produce a value, and each dropped branch is logged with its absence reason.
+When a branch's result resolves as a recorded absence — typically because the branch pipe is a `PipeCondition` whose outcome was `continue`, or the branch was skipped (lifted) on an absent optional value — that branch contributes **no item** to the aggregated output list. The list is compacted: a list cannot hold a hole, and absent results are dropped rather than replaced by placeholders. Order is preserved among the results that did produce a value, and each dropped branch is logged at `DEBUG`, with its index among the inputs and its absence reason as the fields `branch_index` and `absence_reason`, which is how a log explains an output list shorter than its input.
This is the batch arm of the "route or skip" pattern: batch over items with a condition branch pipe that builds a result for the items that qualify and `continue`s past the rest — the output is the compacted list of qualifying results. See [Understanding Optionality](../understanding-optionality.md) for the full absence model.
diff --git a/docs/configuration/config-practical/logging-config.md b/docs/configuration/config-practical/logging-config.md
index 36ec6b242..3b83fadcd 100644
--- a/docs/configuration/config-practical/logging-config.md
+++ b/docs/configuration/config-practical/logging-config.md
@@ -19,7 +19,7 @@ default_log_level = "INFO"
```
- Sets the default logging level for all loggers
-- Valid values: `"VERBOSE"`, `"DEBUG"`, `"DEV"`, `"INFO"`, `"WARNING"`, `"ERROR"`, `"CRITICAL"`, `"OFF"`
+- Valid values: `"VERBOSE"`, `"DEBUG"`, `"INFO"`, `"WARNING"`, `"ERROR"`, `"CRITICAL"`, `"OFF"`; what a line at each level means is in [Logging](../../tools/logging.md#log-levels)
- `"OFF"` silences the loggers `[runtime.log.package_log_levels]` does not pin; Pipelex's own loggers are pinned there at `INFO`, so silencing them, whichever sink is selected, is `pipelex = "OFF"` in that section
### Package-Specific Log Levels
@@ -254,7 +254,7 @@ The sink refreshes its credentials once when it is built, before the transport s
Each record becomes one Cloud Logging entry with a JSON payload:
-- The level maps onto the Cloud Logging severity scale. That scale has nothing below `DEBUG`, so Pipelex's two custom levels, `VERBOSE` and `DEV`, both land there
+- The level maps onto the Cloud Logging severity scale. That scale has nothing below `DEBUG`, so Pipelex's custom `VERBOSE` level lands there
- The payload carries `message`, `logger` and `exception` when the record carries one, `pipelex.trace_id` and `pipelex.span_id` when a Pipelex span is active, the pipe's own or the LLM call's, written exactly as the `json` sink writes them, then every field and the `data` attribute flat beside them. The keys the `json` sink reserves are reserved here too, `time`, `severity`, `trace_id`, `span_id` and `trace_flags` included although the payload carries none of them — the client library takes the time and the severity out of band, and the entry's own `trace`, `spanId` and `traceSampled` carry the current span — so a field named like one of them is carried under a `field_` prefix under either sink rather than under one and not the other; a value JSON cannot carry — a non-finite float, a model, a circular structure — is written as text rather than costing the line
- The run-scoped identifiers become the entry's **labels** rather than payload keys: `request_id`, `pipeline_run_id` and `pipe_run_id`, whichever of them the record carries. Cloud Logging indexes labels, so these are what a query filters a run by
- The entry's `trace`, `spanId` and `traceSampled` name OpenTelemetry's current span, your own code's, the trace project-qualified as `projects/<project>/traces/<trace-id>`, so Cloud Logging files the line under your trace. A line logged where no current span names a trace carries none of the three, inside a Pipelex run too: the `pipeline_run_id` label is what selects a run's lines, and the `pipelex.*` payload keys name its spans
@@ -326,6 +326,10 @@ Two of those keys chose a behaviour their deletion undoes, and no operation in t
- `log_mode = "poor"` chose a plain handler for a process with no terminal; that process now sets `sink = "json"`. `log_mode = "rich"` chose what `console` renders, and asks for nothing either.
- `poor_loggers` and `generic_poor_logger` have nothing to carry over: every record goes to the one selected sink.
+## Migrating From the DEV Level
+
+The `DEV` level, which sat between `DEBUG` and `INFO`, is gone, and so is `log.dev()`. Ledger entry `pipelex-config@6` reads `DEV` as `INFO` wherever a file names it, as `default_log_level` or as a level under `[runtime.log.package_log_levels]`. `INFO` is the equivalent because a `DEV` threshold let through `INFO` and above plus the lines logged at `DEV` itself, and since nothing logs at `DEV` any more, `INFO` lets through exactly the same lines. A third-party package you held at `DEV` therefore keeps its debug output suppressed, a provider SDK's request dumps included. A file that still names `DEV` does not stop the boot: Pipelex migrates it in memory, starts at `INFO`, writes nothing, and warns that the configuration is out of date. Run `pipelex migrate` to rewrite the file on disk, which also ends the warning. Set `DEBUG` yourself where you want the lines a diagnosis needs.
+
## Best Practices
1. **Development Environment**:
diff --git a/docs/tools/logging.md b/docs/tools/logging.md
index 83cbc4df9..cc46c954c 100644
--- a/docs/tools/logging.md
+++ b/docs/tools/logging.md
@@ -11,19 +11,20 @@ Pipelex logs through one facade, `from pipelex import log`, built on Python's st
## Log Levels
-In addition to standard Python log levels, Pipelex introduces custom levels:
-
-| Level | Value | Description |
-|-------|-------|-------------|
-| VERBOSE | 5 | Most detailed logging, below DEBUG |
-| DEBUG | 10 | Standard debug information |
-| DEV | 15 | Development-specific logging (between DEBUG and INFO) |
-| INFO | 20 | General informational messages |
-| WARNING | 30 | Warning messages |
-| ERROR | 40 | Error messages |
-| CRITICAL | 50 | Critical errors |
+Pipelex uses the standard Python log levels and adds two of its own, `VERBOSE` below `DEBUG` and `OFF` above everything. Each level makes a promise about what a line at that level means:
+
+| Level | Value | What a line at this level means |
+|-------|-------|---------------------------------|
+| VERBOSE | 5 | Step-level tracing for Pipelex's own developers, following the runtime through its steps |
+| DEBUG | 10 | What you would need to diagnose a problem from a log a user sends |
+| INFO | 20 | A lifecycle milestone, and there are few of them |
+| WARNING | 30 | A handled degradation, or a user misconfiguration worth fixing; a warning is actionable |
+| ERROR | 40 | A run failed or data was lost |
+| CRITICAL | 50 | The process cannot go on |
| OFF | 999 | Disable logging |
+A line names what it is about, a pipe, a model or a file, and never carries its contents: base64 data, a prompt or a raw response stays out of the log at every level, `DEBUG` and `VERBOSE` included.
+
## Using the Logger
```python
@@ -60,14 +61,11 @@ log.warning("API rate limit approaching", problem_id="rate_limit_warning")
# Error carrying the exception being handled, for the sink to render
log.error("Failed to process", include_exception=True)
-# Development logging
-log.dev("Testing new feature")
-
# Verbose logging
log.verbose("Detailed debug information")
```
-Every one of the seven methods (`verbose`, `debug`, `dev`, `info`, `warning`, `error`, `critical`) takes the same keyword-only `fields` and `layout`, the second naming a [console layout](#layouts). `title`, `inline`, `problem_id` and `include_exception` keep their meaning beside them. `include_exception=True` carries the exception being handled as the record's `exc_info`, with nothing spliced into the message: the `console` sink renders the traceback under the line, the `json` sink writes it under the `exception` key and the `otlp` sink under the `exception.*` attributes. Outside an `except` block it carries nothing.
+Each level's method (`verbose`, `debug`, `info`, `warning`, `error`, `critical`) takes the same keyword-only `fields` and `layout`, the second naming a [console layout](#layouts). `title`, `inline`, `problem_id` and `include_exception` keep their meaning beside them. `include_exception=True` carries the exception being handled as the record's `exc_info`, with nothing spliced into the message: the `console` sink renders the traceback under the line, the `json` sink writes it under the `exception` key and the `otlp` sink under the `exception.*` attributes. Outside an `except` block it carries nothing.
## Fields
@@ -298,13 +296,13 @@ Optional inclusion of caller information in logs, prefixed to the console line:
1. **Log Level Selection**:
- - Use VERBOSE for detailed debugging
- - Use DEBUG for general debugging
- - Use DEV for development-specific logging
- - Use INFO for general progress
- - Use WARNING for potential issues
- - Use ERROR for actual errors
- - Use CRITICAL for system-critical issues
+ - Use VERBOSE for step-level tracing only Pipelex's own developers read
+ - Use DEBUG for what a diagnosis from a user's log would need
+ - Use INFO for the few lifecycle milestones
+ - Use WARNING for a handled degradation or a misconfiguration the user can fix
+ - Use ERROR when a run failed or data was lost
+ - Use CRITICAL when the process cannot go on
+ - Log what a value is about, never the value's payload: no base64 data, prompt or raw response
2. **Fields over interpolation**:
diff --git a/docs/under-the-hood/log-sink-plugins.md b/docs/under-the-hood/log-sink-plugins.md
index 12c74cc41..d6a48d69b 100644
--- a/docs/under-the-hood/log-sink-plugins.md
+++ b/docs/under-the-hood/log-sink-plugins.md
@@ -130,9 +130,9 @@ class LogSinkPlugin:
| Sink | What it does | Where it reads its settings |
|------|--------------|-----------------------------|
| `json` | One JSON object per line on the configured stream: `time`, `severity`, `logger`, `message`, `exception` when there is one, `trace_id`, `span_id` and `trace_flags` in hex when OpenTelemetry's current span names a trace, under the keys OpenTelemetry specifies for trace context in a JSON log that is not OTLP, `pipelex.trace_id` and `pipelex.span_id` in hex when a Pipelex span is active, then the fields, the context identifiers and `data` flat beside them, a field named like one of those keys under a `field_` prefix on every line, a non-finite float as the string `"NaN"`, `"Infinity"` or `"-Infinity"`. The key names are the ones the CloudWatch agent, the Google Cloud Logging agent and any OTLP collector ingest without a parser, and no ANSI ever. What the hosted plane's runner and worker select. | `console_log_target` |
-| `console` | The Rich handler with the emoji formatter and every `[runtime.log.rich_log]` setting, byte for byte what the console showed before sinks existed. Rich, the `cli` extra, is imported when the handler is built, and a process that selects another sink never loads it through this path. | `console_log_target`, `[runtime.log.rich_log]` |
+| `console` | The Rich handler with the emoji formatter and every `[runtime.log.rich_log]` setting, which shows a record's fields after its message, coloured by name, and renders the layouts a call names (see [Console rendering](../tools/logging.md#console-rendering)). Rich, the `cli` extra, is imported when the handler is built, and a process that selects another sink never loads it through this path. | `console_log_target`, `[runtime.log.rich_log]` |
| `otlp` | The OpenTelemetry logs signal: a `LoggerProvider` carrying the same service identity as the tracer, a `BatchLogRecordProcessor` and the OTLP HTTP log exporter. The message is the body, the level maps onto the OTel severity scale, the fields, identifiers and `data` ride as attributes (a mapping as JSON text), an exception lands under the `exception.*` semantic-convention keys, each record is filed under OpenTelemetry's current span, with the active Pipelex span as the `pipelex.trace_id` and `pipelex.span_id` attributes, and a collector receives the logs beside the spans the runtime already exports. The keys the sink writes itself, the `code.*` source location, the two `pipelex.*` keys and the `exception.*` set, are reserved on every record whether or not it carries an exception, so a field named like one of them rides under a `field_` prefix rather than being overwritten. A filter on the handler rejects the records of the sink's own export path, the SDK's by logger name and the transport's by the context value the SDK sets around an export, before the handler's lock is taken, so an export failure never re-enters the pipeline and a shutdown never waits on itself. | `[runtime.log.otlp]` |
-| `gcp` | Google Cloud Logging through the `google-cloud-logging` client library, behind the `gcp-logging` extra. Each record becomes one struct entry: the level maps onto the Cloud Logging severity scale (which has nothing below `DEBUG`, so `VERBOSE` and `DEV` both land there), the message, the logger, the exception and the fields become the JSON payload, the run-scoped identifiers become the entry's labels, which is what Cloud Logging indexes, the entry's `trace`, `spanId` and `traceSampled` name OpenTelemetry's current span, the trace project-qualified, and the active Pipelex span rides in the payload as `pipelex.trace_id` and `pipelex.span_id`. The entries leave through the client library's background-thread transport, which batches them off the calling thread. The factory refreshes the credentials once before that transport starts, so credentials Google refuses stop the boot with `GcpLogSinkCredentialsError` rather than losing every record in silence. **Most processes on Google Cloud want `json` instead**: a platform whose logging agent reads the container's stdout, Cloud Run and GKE among them, ingests what that sink writes and needs no client at all; `gcp` is for a process with no such agent in front of it, or one writing to a log or a project that is not the ambient one. | `[runtime.log.gcp]` |
+| `gcp` | Google Cloud Logging through the `google-cloud-logging` client library, behind the `gcp-logging` extra. Each record becomes one struct entry: the level maps onto the Cloud Logging severity scale (which has nothing below `DEBUG`, so `VERBOSE` lands there), the message, the logger, the exception and the fields become the JSON payload, the run-scoped identifiers become the entry's labels, which is what Cloud Logging indexes, the entry's `trace`, `spanId` and `traceSampled` name OpenTelemetry's current span, the trace project-qualified, and the active Pipelex span rides in the payload as `pipelex.trace_id` and `pipelex.span_id`. The entries leave through the client library's background-thread transport, which batches them off the calling thread. The factory refreshes the credentials once before that transport starts, so credentials Google refuses stop the boot with `GcpLogSinkCredentialsError` rather than losing every record in silence. **Most processes on Google Cloud want `json` instead**: a platform whose logging agent reads the container's stdout, Cloud Run and GKE among them, ingests what that sink writes and needs no client at all; `gcp` is for a process with no such agent in front of it, or one writing to a log or a project that is not the ambient one. | `[runtime.log.gcp]` |
The `otlp` factory imports the OpenTelemetry logs SDK when it runs, and the `gcp` factory the Google Cloud Logging client library, never at register, so registering the built-ins imports neither, which the import-light guard pins.
diff --git a/drift.toml b/drift.toml
index fa026846c..89c439dba 100644
--- a/drift.toml
+++ b/drift.toml
@@ -22,7 +22,8 @@ sites: KitConfig._validate_targets, DryRunConfig.validate_image_urls, \
ImgGenConfig.validate_quality_mapping, LLMConfig.validate_effort_to_budget_mapping.\
"""
# The config model tree is rooted in system/configuration/ but several documented
-# submodels are defined in their own packages — they trigger too.
+# submodels are defined in their own packages — they trigger too, and so does the log-level
+# enum, whose members are the values the logging docs list.
triggers = [
"pipelex/system/configuration/**/*.py",
"pipelex/system/telemetry/telemetry_config.py",
@@ -33,6 +34,7 @@ triggers = [
"pipelex/methods/methods_config.py",
"pipelex/tools/aws/aws_config.py",
"pipelex/tools/log/log_config.py",
+ "pipelex/tools/log/log_levels.py",
"pipelex/tools/network/network_config.py",
"pipelex/tools/secrets/secrets_config.py",
"pipelex/tools/storage/storage_config.py",
diff --git a/pipelex/cli/commands/run/_run_core.py b/pipelex/cli/commands/run/_run_core.py
index a41aafa3e..90832f803 100644
--- a/pipelex/cli/commands/run/_run_core.py
+++ b/pipelex/cli/commands/run/_run_core.py
@@ -339,37 +339,31 @@ async def _execute_run(
if isinstance(main_resolved, AbsenceRecord):
absence_json_path = output_path / "main_stuff.json"
absence_json_path.write_text(build_absence_json(main_resolved), encoding="utf-8")
- log.verbose(f"Main stuff absence JSON saved to: {absence_json_path}")
saved_main_stuff_formats.append("json")
absence_md_path = output_path / "main_stuff.md"
absence_md_path.write_text(build_absence_markdown(main_resolved), encoding="utf-8")
- log.verbose(f"Main stuff absence Markdown saved to: {absence_md_path}")
saved_main_stuff_formats.append("md")
else:
main_stuff = main_resolved
main_stuff_json = await main_stuff.content.rendered_json_async()
main_stuff_json_path = output_path / "main_stuff.json"
main_stuff_json_path.write_text(main_stuff_json, encoding="utf-8")
- log.verbose(f"Main stuff JSON saved to: {main_stuff_json_path}")
saved_main_stuff_formats.append("json")
main_stuff_md = await main_stuff.content.rendered_markdown_async()
main_stuff_md_path = output_path / "main_stuff.md"
main_stuff_md_path.write_text(main_stuff_md, encoding="utf-8")
- log.verbose(f"Main stuff Markdown saved to: {main_stuff_md_path}")
saved_main_stuff_formats.append("md")
main_stuff_html = await main_stuff.content.rendered_html_async()
main_stuff_html_path = output_path / "main_stuff.html"
main_stuff_html_path.write_text(main_stuff_html, encoding="utf-8")
- log.verbose(f"Main stuff HTML saved to: {main_stuff_html_path}")
saved_main_stuff_formats.append("html")
main_stuff_viewer = await render_stuff_viewer(main_stuff)
main_stuff_viewer_path = output_path / "main_stuff_viewer.html"
main_stuff_viewer_path.write_text(main_stuff_viewer, encoding="utf-8")
- log.verbose(f"Main stuff HTML viewer saved to: {main_stuff_viewer_path}")
saved_main_stuff_formats.append("html_viewer")
# A Document or Image main output also lands as the file itself, under its own name. A dry run
@@ -391,7 +385,6 @@ async def _execute_run(
working_memory_output_path = str(output_path / _WORKING_MEMORY_FILENAME)
working_memory_dict = pipe_output.working_memory.smart_dump()
save_as_json_to_path(object_to_save=working_memory_dict, path=Path(working_memory_output_path))
- log.verbose(f"Working memory saved to: {working_memory_output_path}")
# Save main_stuff as CSV if requested. CQ1: write to the literal <path> (cwd-relative),
# NOT resolved under --output-dir. Requires the main stuff to be a flat list (e.g. PersonSummary[]);
@@ -455,7 +448,6 @@ async def _execute_run(
except (ConceptValueError, PipelexError, OSError) as csv_exc:
typer.secho(f"Failed to --save-csv to '{save_csv}': {csv_exc}", fg=typer.colors.RED, err=True)
raise typer.Exit(1) from csv_exc
- log.verbose(f"Main stuff CSV saved to: {save_csv}")
# Render the end-of-run cost report from the usage assembled onto pipe_output (event-sourced).
# The gate is read off the output itself — pipe_output.tokens_usages is None exactly when cost
diff --git a/pipelex/cli/commands/which_cmd.py b/pipelex/cli/commands/which_cmd.py
index ed45019f8..530bcf9c5 100644
--- a/pipelex/cli/commands/which_cmd.py
+++ b/pipelex/cli/commands/which_cmd.py
@@ -59,7 +59,6 @@ def do_which_pipe(pipe_code: str, *, library_dirs: list[Path], source_label: str
source_path = get_pipe_source(pipe_code=pipe_code)
if source_path:
console.print(f" Source: [cyan]{source_path}[/cyan]")
- log.verbose(f"Pipe '{pipe_code}' resolved", title="which")
console.print("")
return True
else:
diff --git a/pipelex/cogt/content_generation/content_generator.py b/pipelex/cogt/content_generation/content_generator.py
index 934098c75..283dbff79 100644
--- a/pipelex/cogt/content_generation/content_generator.py
+++ b/pipelex/cogt/content_generation/content_generator.py
@@ -2,7 +2,6 @@ from typing import Any
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.content_generation.assignment_models import (
ExtractAssignment,
ImgGenAssignment,
@@ -71,18 +70,13 @@ class ContentGenerator(ContentGeneratorProtocol):
llm_setting_main: LLMSetting,
llm_prompt_for_text: LLMPrompt,
) -> str:
- log.verbose(f"{self.__class__.__name__} make_llm_text: {llm_prompt_for_text}")
- log.verbose(f"llm_setting_main: {llm_setting_main}")
llm_assignment = LLMAssignment.make_from_prompt(
job_metadata=job_metadata,
cogt_run_params=cogt_run_params,
llm_setting=llm_setting_main,
llm_prompt=llm_prompt_for_text,
)
- log.verbose(llm_assignment.desc, title="llm_assignment")
- generated_text = await llm_gen_text(llm_assignment=llm_assignment)
- log.verbose(f"{self.__class__.__name__} generated text: {generated_text}")
- return generated_text
+ return await llm_gen_text(llm_assignment=llm_assignment)
@override
@update_job_metadata
@@ -95,7 +89,6 @@ class ContentGenerator(ContentGeneratorProtocol):
llm_setting_for_object: LLMSetting,
llm_prompt_for_object: LLMPrompt,
) -> BaseModelTypeVar:
- log.verbose(f"{self.__class__.__name__} make_object: {llm_prompt_for_object}")
llm_assignment_for_object = LLMAssignment.make_from_prompt(
job_metadata=job_metadata,
cogt_run_params=cogt_run_params,
@@ -107,7 +100,6 @@ class ContentGenerator(ContentGeneratorProtocol):
llm_assignment=llm_assignment_for_object,
)
raw_obj = await llm_gen_object(object_assignment=object_assignment, object_class=object_class)
- log.verbose(f"{self.__class__.__name__} generated object direct: {raw_obj}")
return revalidate_leaf_object(raw_obj, object_class=object_class, is_mock_built=cogt_run_params.run_mode.is_dry)
@override
@@ -134,7 +126,6 @@ class ContentGenerator(ContentGeneratorProtocol):
nb_items=nb_items,
)
raw_list = await llm_gen_object_list(object_assignment=object_assignment, object_class=object_class)
- log.verbose(f"{self.__class__.__name__} generated object list direct: {raw_list}")
return [revalidate_leaf_object(raw_obj, object_class=object_class, is_mock_built=cogt_run_params.run_mode.is_dry) for raw_obj in raw_list]
@override
@@ -159,12 +150,10 @@ class ContentGenerator(ContentGeneratorProtocol):
img_gen_job_config=img_gen_job_config or img_gen_config.img_gen_job,
nb_images=1,
)
- image_content = await img_gen_single_image_and_store(
+ return await img_gen_single_image_and_store(
img_gen_assignment=img_gen_assignment,
generated_content_factory=self._generated_content_factory,
)
- log.verbose(f"{self.__class__.__name__} generated image: {image_content}")
- return image_content
@override
@update_job_metadata
@@ -189,12 +178,10 @@ class ContentGenerator(ContentGeneratorProtocol):
img_gen_job_config=img_gen_job_config or img_gen_config.img_gen_job,
nb_images=nb_images,
)
- image_contents = await img_gen_image_list_and_store(
+ return await img_gen_image_list_and_store(
img_gen_assignment=img_gen_assignment,
generated_content_factory=self._generated_content_factory,
)
- log.verbose(f"{self.__class__.__name__} generated image list: {image_contents}")
- return image_contents
@override
async def make_templated_text(
diff --git a/pipelex/cogt/content_generation/dry_mock.py b/pipelex/cogt/content_generation/dry_mock.py
index c6d6fe93c..4bd41c69b 100644
--- a/pipelex/cogt/content_generation/dry_mock.py
+++ b/pipelex/cogt/content_generation/dry_mock.py
@@ -40,7 +40,6 @@ from polyfactory.exceptions import FactoryException
from pydantic import BaseModel, ValidationError
from pydantic.errors import PydanticInvalidForJsonSchema
-from pipelex import log
from pipelex.cogt.content_generation.assignment_models import (
ExtractAssignment,
ImgGenAssignment,
@@ -48,8 +47,6 @@ from pipelex.cogt.content_generation.assignment_models import (
LLMAssignment,
ObjectAssignment,
RenderDocumentAssignment,
- RenderPageViewsAssignment,
- SearchAssignment,
SearchObjectAssignment,
TemplatingAssignment,
)
@@ -276,7 +273,6 @@ def _dry_text_gen_truncate_length() -> int:
def dry_llm_gen_text(llm_assignment: LLMAssignment) -> str:
"""Dry leaf for ``llm_gen_text``: synthetic job report + a ``DRY RUN:`` marker string."""
job_metadata = llm_assignment.job_metadata
- log.verbose(f"🤡 DRY RUN: llm_gen_text for '{job_metadata.run_metadata.pipeline_run_id}'")
report_func = _dry_report_func(llm_assignment.cogt_run_params)
report_func(job_metadata, llm_setting=llm_assignment.llm_setting, llm_prompt=llm_assignment.llm_prompt)
prompt_truncated = llm_assignment.llm_prompt.desc(truncate_text_length=_dry_text_gen_truncate_length())
@@ -289,13 +285,11 @@ def dry_llm_gen_object(object_assignment: ObjectAssignment, *, object_class: typ
Mirrors the live leaf's class resolution so the two run modes cannot drift: with the caller's class
in hand the mock is built from it, without it the class is rebuilt from the schema.
"""
- log.verbose(f"🤡 DRY RUN: llm_gen_object for '{object_assignment.object_class_name}'")
return _leaf_gen_object(object_assignment, report_func=_dry_report_func(object_assignment.cogt_run_params), object_class=object_class)
def dry_llm_gen_object_list(object_assignment: ObjectAssignment, *, object_class: type[BaseModel] | None = None) -> list[BaseModel]:
"""Dry leaf for ``llm_gen_object_list``: ``nb_items`` mocks + one synthetic report."""
- log.verbose(f"🤡 DRY RUN: llm_gen_object_list for '{object_assignment.object_class_name}'")
return _leaf_gen_object_list(object_assignment, report_func=_dry_report_func(object_assignment.cogt_run_params), object_class=object_class)
@@ -307,7 +301,6 @@ def dry_templating_gen_text(templating_assignment: TemplatingAssignment) -> str:
template_source=templating_assignment.template,
template_category=templating_assignment.category,
)
- log.verbose("🤡 DRY RUN: templating_gen_text")
jinja2_truncated = templating_assignment.template[: _dry_text_gen_truncate_length()]
# Context KEYS only: the context is built from working memory, so dumping values would leak
# inputs the real template never renders (and bloat the mock output).
@@ -339,7 +332,6 @@ def dry_img_gen_image_contents(img_gen_assignment: ImgGenAssignment) -> list[Ima
Sits at the ``*_and_store`` layer — one step above the raw provider leaf — so a dry run never
touches the storage provider (eng review D10).
"""
- log.verbose(f"🤡 DRY RUN: img_gen for '{img_gen_assignment.img_gen_handle}'")
image_urls = get_config().inference.dry_run.image_urls
return [
_dry_image_content(image_url=image_urls[image_index % len(image_urls)], img_gen_assignment=img_gen_assignment)
@@ -353,7 +345,6 @@ def dry_extract_page_contents(extract_assignment: ExtractAssignment) -> list[Pag
Sits at the ``*_and_store`` layer (eng review D10). Page views are attached above the leaf by the
generator-level page-view logic, exactly as in a LIVE run.
"""
- log.verbose(f"🤡 DRY RUN: extract_gen_pages for '{extract_assignment.extract_handle}'")
nb_pages: int
if extract_assignment.extract_input.image_uri:
nb_pages = 1
@@ -371,13 +362,12 @@ def dry_extract_page_contents(extract_assignment: ExtractAssignment) -> list[Pag
]
-def dry_render_page_views(render_assignment: RenderPageViewsAssignment) -> list[ImageContent]:
+def dry_render_page_views() -> list[ImageContent]:
"""Dry leaf for page-view rendering: URL-only page-view image mocks, no pdf rendering, no storage IO.
Fake URLs come from ``inference.dry_run.image_urls`` (validated non-empty) — the single configured
source of truth for dry fake images, same as the img-gen mock.
"""
- log.verbose(f"🤡 DRY RUN: render_page_views for '{render_assignment.job_metadata.run_metadata.pipeline_run_id}'")
nb_pages = get_config().inference.dry_run.nb_extract_pages
image_urls = get_config().inference.dry_run.image_urls
return [_dry_image_content(image_url=image_urls[page_index % len(image_urls)]) for page_index in range(nb_pages)]
@@ -389,13 +379,11 @@ def dry_render_document(render_assignment: RenderDocumentAssignment) -> Document
Its URL is the blank one-page PDF every mocked document carries, whatever the format asked for.
"""
composition = render_assignment.composition
- log.verbose(f"🤡 DRY RUN: render_document '{composition.filename}' for '{render_assignment.job_metadata.run_metadata.pipeline_run_id}'")
return DocumentContent(url=DryRunFactory.generate_mock_document_url(), mime_type=composition.format.mime_type, filename=composition.filename)
-def dry_search_gen_sourced_answer(search_assignment: SearchAssignment) -> SearchResultContent:
+def dry_search_gen_sourced_answer() -> SearchResultContent:
"""Dry leaf for sourced-answer search: polyfactory-built result with mock sources, no provider."""
- log.verbose(f"🤡 DRY RUN: search_gen_sourced_answer for '{search_assignment.search_handle}'")
nb_sources = get_config().inference.dry_run.nb_list_items
mock_sources = build_mock_objects(DocumentContent, count=nb_sources)
return build_mock_object(SearchResultContent, sources=mock_sources)
@@ -410,7 +398,6 @@ def dry_judgment_gen_answers(judgment_assignment: JudgmentAssignment) -> dict[st
producer that measured nothing can say so, and a mock probability would be the one number in the
whole family that nobody could tell apart from a real one.
"""
- log.verbose(f"🤡 DRY RUN: judgment_gen_answers for '{judgment_assignment.judgment_handle}'")
answers: dict[str, JudgmentAnswer] = {}
for question_key, question in judgment_assignment.questions.items():
match question:
@@ -437,7 +424,6 @@ def dry_search_gen_structured(search_object_assignment: SearchObjectAssignment)
attribute — would come back under the renamed key and fail re-validation; see
:func:`~pipelex.cogt.content_generation.object_revalidation.revalidate_leaf_object`.
"""
- log.verbose(f"🤡 DRY RUN: search_gen_structured for '{search_object_assignment.output_class_name}'")
boundary_class = SchemaToModelFactory.make_from_json_schema(
schema=search_object_assignment.output_class_schema,
class_name=search_object_assignment.output_class_name,
@@ -445,11 +431,7 @@ def dry_search_gen_structured(search_object_assignment: SearchObjectAssignment)
return build_mock_object(boundary_class).model_dump(mode="json", by_alias=True)
-def dry_search_gen_structured_object(
- search_assignment: SearchAssignment,
- *,
- output_class: type[BaseModelTypeVar],
-) -> BaseModelTypeVar:
+def dry_search_gen_structured_object(*, output_class: type[BaseModelTypeVar]) -> BaseModelTypeVar:
"""Dry leaf for structured search *in-process*: a mock built from the caller's own class, no provider.
Returns the instance rather than a dump of it, and that is load-bearing rather than a convenience:
@@ -470,7 +452,6 @@ def dry_search_gen_structured_object(
builds the assignment, so a dry-run verdict would depend on how the method is deployed.
"""
_validate_schema_is_generable(output_class=output_class)
- log.verbose(f"🤡 DRY RUN: search_gen_structured_object for '{output_class.__name__}' ({search_assignment.search_handle})")
return build_mock_object(output_class)
diff --git a/pipelex/cogt/content_generation/img_gen_generate.py b/pipelex/cogt/content_generation/img_gen_generate.py
index 3257e56ca..74cc14c4f 100644
--- a/pipelex/cogt/content_generation/img_gen_generate.py
+++ b/pipelex/cogt/content_generation/img_gen_generate.py
@@ -1,4 +1,3 @@
-from pipelex import log
from pipelex.cogt.content_generation.assignment_models import ImgGenAssignment
from pipelex.cogt.content_generation.dry_mock import dry_img_gen_image_contents
from pipelex.cogt.content_generation.generated_content_factory import GeneratedContentFactory
@@ -18,9 +17,7 @@ async def img_gen_single_image(img_gen_assignment: ImgGenAssignment) -> Generate
img_gen_job_config=img_gen_assignment.img_gen_job_config,
job_metadata=img_gen_assignment.job_metadata,
)
- generated_image = await img_gen_worker.gen_image(img_gen_job=img_gen_job)
- log.verbose(f"generated_image:\n{generated_image}")
- return generated_image
+ return await img_gen_worker.gen_image(img_gen_job=img_gen_job)
async def img_gen_image_list(img_gen_assignment: ImgGenAssignment) -> list[GeneratedImageRawDetails]:
@@ -32,12 +29,10 @@ async def img_gen_image_list(img_gen_assignment: ImgGenAssignment) -> list[Gener
img_gen_job_config=img_gen_assignment.img_gen_job_config,
job_metadata=img_gen_assignment.job_metadata,
)
- generated_image_list = await img_gen_worker.gen_image_list(
+ return await img_gen_worker.gen_image_list(
img_gen_job=img_gen_job,
nb_images=img_gen_assignment.nb_images,
)
- log.verbose(f"generated_image_list:\n{generated_image_list}")
- return generated_image_list
async def img_gen_single_image_and_store(
diff --git a/pipelex/cogt/content_generation/llm_generate.py b/pipelex/cogt/content_generation/llm_generate.py
index e0a22a5aa..8d96a1712 100644
--- a/pipelex/cogt/content_generation/llm_generate.py
+++ b/pipelex/cogt/content_generation/llm_generate.py
@@ -2,7 +2,6 @@ from typing import cast
from pydantic import BaseModel
-from pipelex import log
from pipelex.cogt.content_generation.assignment_models import LLMAssignment, ObjectAssignment
from pipelex.cogt.content_generation.dry_mock import (
dry_llm_gen_object,
@@ -29,7 +28,6 @@ async def llm_gen_text(llm_assignment: LLMAssignment) -> str:
dump_prompt(llm_prompt=llm_job.llm_prompt)
generated_text = await llm_worker.gen_text(llm_job=llm_job)
dump_response_from_text_gen(response=generated_text)
- log.verbose(generated_text, title="llm_gen_text")
return generated_text
@@ -69,7 +67,6 @@ async def llm_gen_object_list(object_assignment: ObjectAssignment, *, object_cla
authorize_assignment_reads(job_metadata=llm_assignment.job_metadata, uri_references=object_assignment.referenced_uris())
if object_assignment.cogt_run_params.run_mode.is_dry:
return dry_llm_gen_object_list(object_assignment, object_class=object_class)
- log.verbose(f"llm_gen_object_list to generate a list of '{object_assignment.object_class_name}'")
llm_worker = get_llm_worker(llm_handle=llm_assignment.llm_handle)
llm_job = LLMJobFactory.make_llm_job(
job_metadata=llm_assignment.job_metadata,
diff --git a/pipelex/cogt/content_generation/render_generate.py b/pipelex/cogt/content_generation/render_generate.py
index be7829aa3..6be57d6b2 100644
--- a/pipelex/cogt/content_generation/render_generate.py
+++ b/pipelex/cogt/content_generation/render_generate.py
@@ -28,7 +28,7 @@ async def render_page_views_and_store(
"""
authorize_assignment_reads(job_metadata=render_assignment.job_metadata, uri_references=render_assignment.referenced_uris())
if render_assignment.cogt_run_params.run_mode.is_dry:
- return dry_render_page_views(render_assignment)
+ return dry_render_page_views()
# Deferred import: avoid pulling the pdf rendering SDK at module-load time
from pipelex.tools.pdf.pypdfium2_renderer import pypdfium2_renderer # ruff: ignore[import-outside-top-level]
diff --git a/pipelex/cogt/content_generation/search_generate.py b/pipelex/cogt/content_generation/search_generate.py
index 222acecd9..8f557782c 100644
--- a/pipelex/cogt/content_generation/search_generate.py
+++ b/pipelex/cogt/content_generation/search_generate.py
@@ -61,7 +61,7 @@ def _make_search_job(search_assignment: SearchAssignment) -> SearchJob:
async def search_gen_sourced_answer(search_assignment: SearchAssignment) -> SearchResultContent:
authorize_assignment_reads(job_metadata=search_assignment.job_metadata, uri_references=search_assignment.referenced_uris())
if search_assignment.cogt_run_params.run_mode.is_dry:
- return dry_search_gen_sourced_answer(search_assignment)
+ return dry_search_gen_sourced_answer()
worker = _make_search_worker(search_assignment)
search_job = _make_search_job(search_assignment)
return await worker.search_sourced_answer(search_job=search_job)
@@ -108,7 +108,7 @@ async def search_gen_structured_object(
"""
authorize_assignment_reads(job_metadata=search_assignment.job_metadata, uri_references=search_assignment.referenced_uris())
if search_assignment.cogt_run_params.run_mode.is_dry:
- return dry_search_gen_structured_object(search_assignment, output_class=output_class)
+ return dry_search_gen_structured_object(output_class=output_class)
result_dict = await _run_structured_search(search_assignment, schema=output_class)
# ``is_mock_built=False`` is a statement, not a formality: this data came from the provider, so a
# failure here is a malformed response and keeps its ``ValidationError`` — it is not the dry-run
diff --git a/pipelex/cogt/extract/extract_worker_abstract.py b/pipelex/cogt/extract/extract_worker_abstract.py
index 5a02af972..8bf3d4a47 100644
--- a/pipelex/cogt/extract/extract_worker_abstract.py
+++ b/pipelex/cogt/extract/extract_worker_abstract.py
@@ -3,7 +3,6 @@ from typing import Any
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import CogtError, ExtractCapabilityError, ExtractInputFormatError
from pipelex.cogt.extract.extract_input import ExtractInput
from pipelex.cogt.extract.extract_job import ExtractJob
@@ -113,8 +112,6 @@ class ExtractWorkerAbstract(InferenceWorkerAbstract):
self,
extract_job: ExtractJob,
) -> ExtractOutput:
- log.dev(f"✨ {self.desc} ✨")
-
# Verify that the job is valid
extract_job.validate_before_execution()
diff --git a/pipelex/cogt/img_gen/img_gen_worker_abstract.py b/pipelex/cogt/img_gen/img_gen_worker_abstract.py
index fb36966fd..da6c9b83f 100644
--- a/pipelex/cogt/img_gen/img_gen_worker_abstract.py
+++ b/pipelex/cogt/img_gen/img_gen_worker_abstract.py
@@ -2,7 +2,6 @@ from abc import abstractmethod
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import CogtError, ImgGenParameterError
from pipelex.cogt.image.generated_image import GeneratedImageRawDetails
from pipelex.cogt.img_gen.img_gen_job import ImgGenJob
@@ -53,8 +52,6 @@ class ImgGenWorkerAbstract(InferenceWorkerAbstract):
self,
img_gen_job: ImgGenJob,
) -> GeneratedImageRawDetails:
- log.dev(f"✨ {self.desc} ✨")
-
# Verify that the job is valid
img_gen_job.validate_before_execution()
@@ -94,8 +91,6 @@ class ImgGenWorkerAbstract(InferenceWorkerAbstract):
*,
nb_images: int,
) -> list[GeneratedImageRawDetails]:
- log.dev(f"✨ {self.desc} ✨")
-
# Verify that the job is valid
img_gen_job.validate_before_execution()
diff --git a/pipelex/cogt/inference/inference_manager.py b/pipelex/cogt/inference/inference_manager.py
index 2a0a37e02..fc2600274 100644
--- a/pipelex/cogt/inference/inference_manager.py
+++ b/pipelex/cogt/inference/inference_manager.py
@@ -1,6 +1,5 @@
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.extract.extract_worker_abstract import ExtractWorkerAbstract
from pipelex.cogt.extract.extract_worker_factory import ExtractWorkerFactory
from pipelex.cogt.img_gen.img_gen_worker_abstract import ImgGenWorkerAbstract
@@ -29,21 +28,6 @@ class InferenceManager(InferenceManagerProtocol):
for extract_worker in self.extract_workers.values():
extract_worker.teardown()
self.extract_workers = {}
- log.verbose("InferenceManager teardown done")
-
- def print_workers(self):
- log.verbose("LLM Workers:")
- for handle, llm_worker in self.llm_workers.items():
- log.verbose(f" {handle}:")
- log.verbose(llm_worker.desc)
- log.verbose("Image Workers:")
- for handle, img_gen_worker_async in self.img_gen_workers.items():
- log.verbose(f" {handle}:")
- log.verbose(img_gen_worker_async.desc)
- log.verbose("OCR Workers:")
- for handle, extract_worker_async in self.extract_workers.items():
- log.verbose(f" {handle}:")
- log.verbose(extract_worker_async.desc)
####################################################################################################
# Setup LLM Workers
@@ -74,7 +58,6 @@ class InferenceManager(InferenceManagerProtocol):
def _setup_one_img_gen_worker(self, img_gen_handle: str) -> ImgGenWorkerAbstract:
inference_model = get_models_manager().get_inference_model(model_handle=img_gen_handle, model_type=ModelType.IMG_GEN)
- log.verbose(f"Setting up Image Generation Worker for '{img_gen_handle}'")
img_gen_worker = ImgGenWorkerFactory.make_img_gen_worker(
inference_model=inference_model,
reporting_delegate=get_report_delegate(),
diff --git a/pipelex/cogt/judgment/judgment_worker_abstract.py b/pipelex/cogt/judgment/judgment_worker_abstract.py
index cacf23bb4..046c3886d 100644
--- a/pipelex/cogt/judgment/judgment_worker_abstract.py
+++ b/pipelex/cogt/judgment/judgment_worker_abstract.py
@@ -4,7 +4,6 @@ from collections.abc import Mapping
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import CogtError, JudgmentAnswerMismatchError, JudgmentCapabilityError
from pipelex.cogt.inference.inference_worker_abstract import InferenceWorkerAbstract
from pipelex.cogt.inference.prompt_file_checks import check_prompt_documents_are_read, check_prompt_images_are_images
@@ -43,7 +42,6 @@ class JudgmentWorkerAbstract(InferenceWorkerAbstract):
judgment_job: JudgmentJob,
) -> dict[str, JudgmentAnswer]:
"""Answer every question in the job over its state, keyed as the questions were."""
- log.dev(f"✨ {self.desc} ✨")
judgment_job.validate_before_execution()
judgment_job.job_metadata.unit_job_id = UnitJobId.JUDGMENT_ANSWER
judgment_job.judgment_job_before_start(inference_model=self.inference_model)
diff --git a/pipelex/cogt/llm/llm_worker_abstract.py b/pipelex/cogt/llm/llm_worker_abstract.py
index 563b55b5d..e262e794b 100644
--- a/pipelex/cogt/llm/llm_worker_abstract.py
+++ b/pipelex/cogt/llm/llm_worker_abstract.py
@@ -33,6 +33,8 @@ from pipelex.system.telemetry.telemetry_manager_abstract import TelemetryManager
from pipelex.tools.misc.package_utils import get_package_version
if TYPE_CHECKING:
+ from collections.abc import Mapping
+
from pydantic import BaseModel
from pipelex.cogt.llm.llm_job import LLMJob
@@ -120,6 +122,22 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
return temperature * 2
return temperature
+ @classmethod
+ def _log_reasoning_sent(cls, *, api_name: str, settings: Mapping[str, object]) -> None:
+ """Say the reasoning settings an LLM call sends, once per call, at DEBUG.
+
+ DEBUG because the settings actually sent are what a diagnosis of an exhausted thinking budget or a
+ refused parameter needs. The message is fixed; `api_name` and each setting sent ride as fields, a
+ setting under the name of the request parameter that carries it. `check_request` resolves the same
+ settings before the call, so a provider's resolvers and builders say nothing and each call site says
+ it here. A setting the call does not send is passed as `None` and left out, and a call that sends none
+ logs nothing.
+ """
+ sent = {name: value for name, value in settings.items() if value is not None}
+ if not sent:
+ return
+ log.debug("Sending reasoning settings", fields={"api_name": api_name, **sent})
+
#########################################################
# Instance methods
#########################################################
@@ -167,12 +185,12 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
# Skip if telemetry is disabled (no otel_context)
if otel_context is None:
- log.verbose("[OTel] No otel_context - skipping LLM span")
+ log.verbose("OTel: the job carries no otel_context, so no LLM span is started")
return None
tracer = TelemetryManagerAbstract.get_instance_tracer()
if tracer is None:
- log.verbose("[OTel] No tracer available for LLM span")
+ log.verbose("OTel: no tracer is available, so no LLM span is started")
return None
unit_job_id = job_metadata.unit_job_id
@@ -273,8 +291,6 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
# Use trace_id and span_id from otel_context (precomputed)
# The span_id in otel_context is the parent pipe's span - use it as parent
parent_span_id = otel_context.span_id
- log.verbose(f"[OTel] LLM span:\n pipe_code='{pipe_code}'\n pipeline_run_id='{pipeline_run_id}'\n parent_span_id={parent_span_id:016x}")
-
parent_span_context = SpanContext(
trace_id=otel_context.trace_id,
span_id=parent_span_id,
@@ -295,18 +311,6 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
if span.get_span_context() == parent_span_context:
return None
- # Debug logging, under the span it announces, so the line's `pipelex.*` fields name that span
- span_ctx = span.get_span_context()
- with pipelex_span_active(span=span):
- log.verbose(
- f"[OTel] LLM SPAN STARTED:\n"
- f" pipe_code='{pipe_code}'\n"
- f" pipeline_run_id='{pipeline_run_id}'\n"
- f" trace_id={span_ctx.trace_id:032x}\n"
- f" span_id={span_ctx.span_id:016x}\n"
- f" parent_span_id={parent_span_id:016x}"
- )
-
return span
def _end_otel_span_with_completion_text(self, span: Span | None, *, llm_job: LLMJob, completion_text: str) -> None:
@@ -314,16 +318,6 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
if span is None:
return
- job_metadata = llm_job.job_metadata
- span_ctx = span.get_span_context()
- log.verbose(
- f"[OTel] LLM SPAN ENDING:\n"
- f" pipe_code='{job_metadata.pipe_code}'\n"
- f" pipeline_run_id='{job_metadata.run_metadata.pipeline_run_id}'\n"
- f" trace_id={span_ctx.trace_id:032x}\n"
- f" span_id={span_ctx.span_id:016x}"
- )
-
# Record token usage if available
if llm_job.job_report.llm_tokens_usage:
tokens = llm_job.job_report.llm_tokens_usage.nb_tokens_by_category
@@ -345,16 +339,6 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
if span is None:
return
- job_metadata = llm_job.job_metadata
- span_ctx = span.get_span_context()
- log.verbose(
- f"[OTel] LLM SPAN ENDING:\n"
- f" pipe_code='{job_metadata.pipe_code}'\n"
- f" pipeline_run_id='{job_metadata.run_metadata.pipeline_run_id}'\n"
- f" trace_id={span_ctx.trace_id:032x}\n"
- f" span_id={span_ctx.span_id:016x}"
- )
-
# Record token usage if available
if llm_job.job_report.llm_tokens_usage:
tokens = llm_job.job_report.llm_tokens_usage.nb_tokens_by_category
@@ -372,21 +356,11 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
span.set_status(Status(StatusCode.OK))
span.end()
- def _end_otel_span_with_error(self, span: Span | None, *, llm_job: LLMJob, error: BaseException) -> None:
+ def _end_otel_span_with_error(self, span: Span | None, *, error: BaseException) -> None:
"""End the OTel span, recording the error. Safe to call if span is None."""
if span is None:
return
- job_metadata = llm_job.job_metadata
- span_ctx = span.get_span_context()
- log.verbose(
- f"[OTel] LLM SPAN ENDING WITH ERROR:\n"
- f" pipe_code='{job_metadata.pipe_code}'\n"
- f" pipeline_run_id='{job_metadata.run_metadata.pipeline_run_id}'\n"
- f" trace_id={span_ctx.trace_id:032x}\n"
- f" span_id={span_ctx.span_id:016x}"
- )
-
span.record_exception(error)
span.set_status(Status(StatusCode.ERROR, str(error)))
span.end()
@@ -399,8 +373,6 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
self,
llm_job: LLMJob,
):
- log.dev(f"✨ {self.desc} ✨")
-
# Verify that the job is valid
llm_job.validate_before_execution()
@@ -502,9 +474,6 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
self,
llm_job: LLMJob,
) -> str:
- log.verbose("LLM Worker gen_text")
- log.verbose(llm_job.llm_prompt.desc(), title="llm_prompt")
-
# metadata
llm_job.job_metadata.unit_job_id = UnitJobId.LLM_GEN_TEXT
@@ -531,7 +500,7 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
# failure stays in telemetry. On success `_after_text_job` already ended the span.
pending_error = sys.exc_info()[1]
if pending_error is not None and span is not None and span.is_recording():
- self._end_otel_span_with_error(span=span, llm_job=llm_job, error=pending_error)
+ self._end_otel_span_with_error(span=span, error=pending_error)
@abstractmethod
async def _gen_text(
@@ -546,9 +515,6 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
*,
schema: type[BaseModelTypeVar],
) -> BaseModelTypeVar:
- log.verbose(f"LLM Worker gen_object using {self.desc}")
- log.verbose(llm_job.llm_prompt.desc(), title="llm_prompt")
-
# metadata
llm_job.job_metadata.unit_job_id = UnitJobId.LLM_GEN_OBJECT
@@ -580,7 +546,7 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
# failure stays in telemetry. On success `_after_object_job` already ended the span.
pending_error = sys.exc_info()[1]
if pending_error is not None and span is not None and span.is_recording():
- self._end_otel_span_with_error(span=span, llm_job=llm_job, error=pending_error)
+ self._end_otel_span_with_error(span=span, error=pending_error)
@abstractmethod
async def _gen_object(
diff --git a/pipelex/cogt/models/model_deck.py b/pipelex/cogt/models/model_deck.py
index 174f3f0e2..4eb505023 100644
--- a/pipelex/cogt/models/model_deck.py
+++ b/pipelex/cogt/models/model_deck.py
@@ -1227,7 +1227,7 @@ class ModelDeck(ConfigModel):
served_types_description = ", ".join(f"'{served_type}'" for served_type in served_types)
log.warning(f"Model handle '{ref.name}' is served as {served_types_description} but was requested as '{model_type}'. Skipping.")
return None
- log.verbose(f"Skipping model handle '{model_handle}' because it's was not found in the model deck, it could be an external plugin.")
+ log.verbose(f"Skipping model handle '{model_handle}' because it was not found in the model deck, it could be an external plugin.")
return None
def is_handle_defined(self, model_handle: str, *, model_type: ModelType) -> bool:
@@ -1343,5 +1343,5 @@ class ModelDeck(ConfigModel):
)
raise model_not_found_error
if self.inference_models.get(model_type=model_type, handle=model_handle) is None:
- log.verbose(f"Model handle '{model_handle}' is an alias which resolves to '{inference_model.name}'")
+ log.verbose(f"Model reference '{model_handle}' resolves to model '{inference_model.name}'")
return inference_model
diff --git a/pipelex/cogt/search/search_worker_abstract.py b/pipelex/cogt/search/search_worker_abstract.py
index e8b2a27a3..4b43ad72e 100644
--- a/pipelex/cogt/search/search_worker_abstract.py
+++ b/pipelex/cogt/search/search_worker_abstract.py
@@ -3,7 +3,6 @@ from typing import Any
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import CogtError
from pipelex.cogt.inference.inference_worker_abstract import InferenceWorkerAbstract
from pipelex.cogt.model_backends.model_spec import InferenceModelSpec
@@ -33,7 +32,6 @@ class SearchWorkerAbstract(InferenceWorkerAbstract):
search_job: SearchJob,
) -> SearchResultContent:
"""Execute a search query and return a sourced answer with sources."""
- log.dev(f"✨ {self.desc} ✨")
search_job.validate_before_execution()
search_job.job_metadata.unit_job_id = UnitJobId.SEARCH_SOURCED_ANSWER
search_job.search_job_before_start(inference_model=self.inference_model)
@@ -63,7 +61,6 @@ class SearchWorkerAbstract(InferenceWorkerAbstract):
schema: type[BaseModelTypeVar],
) -> dict[str, Any]:
"""Execute a search query and return structured data matching the schema."""
- log.dev(f"✨ {self.desc} ✨")
search_job.validate_before_execution()
search_job.job_metadata.unit_job_id = UnitJobId.SEARCH_STRUCTURED
search_job.search_job_before_start(inference_model=self.inference_model)
diff --git a/pipelex/cogt/usage/cost_registry.py b/pipelex/cogt/usage/cost_registry.py
index f2dee4e77..54858c949 100644
--- a/pipelex/cogt/usage/cost_registry.py
+++ b/pipelex/cogt/usage/cost_registry.py
@@ -117,8 +117,6 @@ class CostRegistry(RootModel[CostRegistryRoot]):
if not tokens_usages:
if pipeline_run_id != "untitled":
log.warning(f"No report to generate for pipeline '{pipeline_run_id}'")
- else:
- log.verbose(f"No report to generate for pipeline '{pipeline_run_id}'")
return
cls.render_report(
cls.aggregate_costs(tokens_usages=tokens_usages),
diff --git a/pipelex/core/memory/working_memory.py b/pipelex/core/memory/working_memory.py
index 30c881379..06d54ff9f 100644
--- a/pipelex/core/memory/working_memory.py
+++ b/pipelex/core/memory/working_memory.py
@@ -228,8 +228,6 @@ class WorkingMemory(WorkingMemoryAbstract[Stuff], ContextProviderAbstract):
return
elif name != TEST_DUMMY_NAME:
log.warning(f"Key '{name}' already exists in WorkingMemory and will be replaced by something different")
- log.verbose(f"Existing stuff: {existing_stuff}")
- log.verbose(f"New stuff: {stuff}")
# it's a new stuff
self.set_stuff(name=name, stuff=stuff)
@@ -245,11 +243,9 @@ class WorkingMemory(WorkingMemoryAbstract[Stuff], ContextProviderAbstract):
if name:
self.remove_main_stuff()
self.add_new_stuff(name=name, stuff=stuff, aliases=[MAIN_STUFF_NAME])
- log.verbose(f"Setting new main stuff {name}: {stuff.concept.code} = '{stuff.short_desc}'")
else:
self.remove_alias_to_main_stuff()
self.set_stuff(name=MAIN_STUFF_NAME, stuff=stuff)
- log.verbose(f"Setting new main stuff (unnamed): {stuff.concept.code} = '{stuff.short_desc}'")
def set_alias(self, alias: str, *, target: str) -> None:
"""Add an alias pointing to a target name."""
diff --git a/pipelex/core/memory/working_memory_factory.py b/pipelex/core/memory/working_memory_factory.py
index 790c425b5..d0e8ba203 100644
--- a/pipelex/core/memory/working_memory_factory.py
+++ b/pipelex/core/memory/working_memory_factory.py
@@ -160,7 +160,7 @@ class WorkingMemoryFactory(BaseModel):
needed_inputs_for_factory.append(typed_named_stuff_spec)
else:
# Fallback to TextContent if we can't get the proper class
- log.verbose(
+ log.debug(
f"Could not get structure class '{structure_class_name}' for "
f"concept '{named_stuff_spec.concept.code}', falling back to TextContent",
)
@@ -200,7 +200,7 @@ class WorkingMemoryFactory(BaseModel):
structure_class = class_registry.get_class(name=structure_class_name)
if structure_class and issubclass(structure_class, StuffContent):
return TypedNamedStuffSpec.make_from_named(named=named, structure_class=structure_class)
- log.verbose(
+ log.debug(
f"Could not get structure class '{structure_class_name}' for concept '{concept.code}', falling back to TextContent",
)
return TypedNamedStuffSpec.make_from_named(named=named, structure_class=TextContent)
diff --git a/pipelex/graph/graph_factory.py b/pipelex/graph/graph_factory.py
index b416e065d..98689018f 100644
--- a/pipelex/graph/graph_factory.py
+++ b/pipelex/graph/graph_factory.py
@@ -186,7 +186,6 @@ def save_graph_outputs_to_dir(
file_path = output_dir / "graphspec.json"
file_path.write_text(graph_outputs.graphspec_json, encoding="utf-8")
saved_files["graphspec_json"] = file_path
- log.verbose(f"GraphSpec JSON saved to: {file_path}")
# The graphspec's companions sit beside it under the standard's names: a reader resolves them
# from the graphspec's directory, whatever the graphspec file is later renamed to.
@@ -200,7 +199,6 @@ def save_graph_outputs_to_dir(
if text is not None:
file_path.write_text(text, encoding="utf-8")
saved_files[output_key] = file_path
- log.verbose(f"{file_name} saved to: {file_path}")
elif graph_outputs.graphspec_json is not None and file_path.exists():
# A written graphspec owns the companions beside it: one left by an earlier run in a reused
# directory would describe this graph's data with another method's declarations. Said out
@@ -212,18 +210,15 @@ def save_graph_outputs_to_dir(
file_path = output_dir / "mermaidflow.mmd"
file_path.write_text(graph_outputs.mermaidflow_mmd, encoding="utf-8")
saved_files["mermaidflow_mmd"] = file_path
- log.verbose(f"Mermaidflow MMD saved to: {file_path}")
if graph_outputs.mermaidflow_html is not None:
file_path = output_dir / "mermaidflow.html"
file_path.write_text(graph_outputs.mermaidflow_html, encoding="utf-8")
saved_files["mermaidflow_html"] = file_path
- log.verbose(f"Mermaidflow HTML saved to: {file_path}")
if graph_outputs.reactflow_html is not None:
file_path = output_dir / "reactflow.html"
file_path.write_text(graph_outputs.reactflow_html, encoding="utf-8")
saved_files["reactflow_html"] = file_path
- log.verbose(f"ReactFlow HTML saved to: {file_path}")
return saved_files
diff --git a/pipelex/kernel/img_gen_prompt.py b/pipelex/kernel/img_gen_prompt.py
index e4f720405..1f6347e10 100644
--- a/pipelex/kernel/img_gen_prompt.py
+++ b/pipelex/kernel/img_gen_prompt.py
@@ -20,7 +20,6 @@ a line of code — not the kind of subtlety this module exists to centralise.
from typing import TYPE_CHECKING, Any, cast
-from pipelex import log
from pipelex.cogt.image.prompt_image_factory import PromptImageFactory
from pipelex.cogt.img_gen.img_gen_prompt import ImgGenPrompt
from pipelex.cogt.templating.template_blueprint import TemplateBlueprint
@@ -118,8 +117,6 @@ async def assemble_img_gen_prompt(
if image_registry.images:
input_images = [PromptImageFactory.make_prompt_image(uri=registry_image.url) for registry_image in image_registry.images]
- log.verbose(f"ImgGenPrompt: {len(input_images or [])} input images")
-
return ImgGenPrompt(
positive_text=positive_text,
negative_text=negative_text,
@@ -175,7 +172,6 @@ def _extract_direct_image(
image_registry_indices: dict[str, int],
) -> None:
"""Extract a single ImageContent from context and register it."""
- log.verbose(f"Getting direct image '{image_ref.variable_path}' from context")
try:
prompt_image_content = context_provider.get_typed_object_or_attribute(
name=image_ref.variable_path,
@@ -201,7 +197,6 @@ def _extract_direct_list_images(
image_registry_indices: dict[str, int],
) -> None:
"""Extract a list of ImageContent from context and register them."""
- log.verbose(f"Getting image list '{image_ref.variable_path}' from context")
try:
prompt_image_content = context_provider.get_typed_object_or_attribute(
name=image_ref.variable_path,
diff --git a/pipelex/kernel/llm_ops.py b/pipelex/kernel/llm_ops.py
index 6555af22c..c106daf09 100644
--- a/pipelex/kernel/llm_ops.py
+++ b/pipelex/kernel/llm_ops.py
@@ -210,8 +210,6 @@ async def generate_object_content(
with job_metadata.log_context():
content_generator = get_content_generator()
if is_multiple_output:
- count_desc = f"{fixed_nb_output}x" if fixed_nb_output else "list of "
- log.verbose(f"Kernel generating {count_desc}{output_class.__name__} by object_direct")
generated_objects = await content_generator.make_object_list(
job_metadata=job_metadata,
cogt_run_params=cogt_run_params,
@@ -222,7 +220,6 @@ async def generate_object_content(
)
return ListContent(items=generated_objects)
- log.verbose(f"Kernel generating a single {output_class.__name__} by object_direct")
return await content_generator.make_object(
job_metadata=job_metadata,
cogt_run_params=cogt_run_params,
diff --git a/pipelex/kernel/llm_prompt_content.py b/pipelex/kernel/llm_prompt_content.py
index 3fade4a66..eabf0ee76 100644
--- a/pipelex/kernel/llm_prompt_content.py
+++ b/pipelex/kernel/llm_prompt_content.py
@@ -15,7 +15,6 @@ from typing import TYPE_CHECKING, Any, Self, cast
from pydantic import BaseModel
-from pipelex import log
from pipelex.cogt.document.prompt_document import PromptDocument
from pipelex.cogt.document.prompt_document_factory import PromptDocumentFactory
from pipelex.cogt.image.prompt_image_factory import PromptImageFactory
@@ -259,7 +258,6 @@ def _extract_direct_image(
image_registry_indices: dict[str, int],
) -> None:
"""Extract a single ImageContent from context and register it."""
- log.verbose(f"Getting direct image '{image_ref.variable_path}' from context")
try:
prompt_image_content = context_provider.get_typed_object_or_attribute(
name=image_ref.variable_path,
@@ -285,7 +283,6 @@ def _extract_direct_list_images(
image_registry_indices: dict[str, int],
) -> None:
"""Extract a list of ImageContent from context and register them."""
- log.verbose(f"Getting image list '{image_ref.variable_path}' from context")
try:
prompt_image_content = context_provider.get_typed_object_or_attribute(
name=image_ref.variable_path,
@@ -320,7 +317,6 @@ def _extract_direct_document(
prompt_user_documents: dict[str, PromptDocument],
) -> None:
"""Extract a single DocumentContent from context."""
- log.verbose(f"Getting direct document '{doc_ref.variable_path}' from context")
try:
prompt_document_content = context_provider.get_typed_object_or_attribute(
name=doc_ref.variable_path,
@@ -348,7 +344,6 @@ def _extract_direct_list_documents(
prompt_user_documents: dict[str, PromptDocument],
) -> None:
"""Extract a list of DocumentContent from context."""
- log.verbose(f"Getting document list '{doc_ref.variable_path}' from context")
try:
prompt_document_content = context_provider.get_typed_object_or_attribute(
name=doc_ref.variable_path,
@@ -389,7 +384,6 @@ async def _unravel_text(
# A style declared on the blueprint wins over the run-derived one. Kept as a local: writing
# it onto `jinja2_blueprint` would mutate an object the pipe library holds and hands out.
effective_style = jinja2_blueprint.templating_style or templating_style
- log.verbose(f"Rendering with prompting style {effective_style}")
context: dict[str, Any] = context_provider.generate_context()
if extra_params:
diff --git a/pipelex/language/mthds_factory.py b/pipelex/language/mthds_factory.py
index 1fe2137bc..86f43d967 100644
--- a/pipelex/language/mthds_factory.py
+++ b/pipelex/language/mthds_factory.py
@@ -6,7 +6,6 @@ from typing import TYPE_CHECKING, Any, Mapping, cast
import tomlkit
from tomlkit import array, document, inline_table, table
-from pipelex import log
from pipelex.config import get_config
from pipelex.language.toml_string_utils import format_toml_string
from pipelex.tools.misc.json_utils import remove_none_values_from_dict
@@ -249,15 +248,11 @@ class MthdsFactory:
@classmethod
def make_table_obj_for_pipe(cls, section_value: Mapping[str, Any]) -> Any:
"""Make a table object for a pipe section."""
- log.verbose("******** Making table object for pipe section ********")
table_obj = table()
for field_key, field_value in section_value.items():
- log.verbose(f"------ Field {field_key} is a {type(field_value)}")
if not isinstance(field_value, Mapping):
- log.verbose(f"Field is not a mapping: key = {field_key}, value = {field_value}")
table_obj.add(field_key, cls.convert_dicts_to_inline_tables(field_value))
continue
- log.verbose(f"Field is a mapping: key = {field_key}, value = {field_value}")
field_value = cast("Mapping[str, Any]", field_value)
# Convert pipe configuration to table (handles template field specially)
table_obj.add(field_key, cls.convert_mapping_to_table(field_value, field_ordering=cls._mthds_config().pipes.field_ordering))
@@ -266,34 +261,28 @@ class MthdsFactory:
@classmethod
def make_table_obj_for_concept(cls, section_value: Mapping[str, Any]) -> Any:
"""Make a table object for a concept section."""
- log.verbose("******** Making table object for concept section ********")
table_obj = table()
for concept_key, concept_value in section_value.items():
if isinstance(concept_value, str):
- log.verbose(f"Concept '{concept_key}' is a string: {concept_value}")
table_obj.add(concept_key, concept_value)
continue
if not isinstance(concept_value, Mapping):
msg = f"Concept field value is not a mapping: key = {concept_key}, value = {concept_value}"
raise TypeError(msg)
- log.verbose(f"Concept '{concept_key}' is a mapping: {concept_value}")
concept_value = cast("Mapping[str, Any]", concept_value)
concept_table_obj = table()
for concept_field_key, concept_field_value in concept_value.items():
if concept_field_key == CONCEPT_STRUCTURE_FIELD_KEY:
if isinstance(concept_field_value, str):
- log.verbose(f"Structure for concept '{concept_key}' is a string: {concept_field_value}")
concept_table_obj.add("structure", concept_field_value)
continue
if not isinstance(concept_field_value, Mapping):
msg = f"Structure field value is not a mapping: key = {concept_field_key}, value = {concept_field_value}"
raise TypeError(msg)
- log.verbose(f"Structure for concept '{concept_key}' is a mapping: {concept_field_value}")
structure_value = cast("Mapping[str, Any]", concept_field_value)
structure_table_obj = table()
for structure_field_key, structure_field_value in structure_value.items():
if isinstance(structure_field_value, str):
- log.verbose(f"Structure '{structure_field_key}' is a string: {structure_field_value}")
structure_table_obj.add(structure_field_key, structure_field_value)
continue
if not isinstance(structure_field_value, Mapping):
@@ -302,7 +291,6 @@ class MthdsFactory:
f"key = {structure_field_key}, value = {structure_field_value}"
)
raise TypeError(msg)
- log.verbose(f"Structure for '{concept_key}' is a mapping: {structure_field_value}")
# Filter out "required" key if its value is False
structure_field_value = cast("Mapping[str, Any]", structure_field_value)
filtered_value = {key: value for key, value in structure_field_value.items() if not (key == "required" and not value)}
@@ -315,7 +303,6 @@ class MthdsFactory:
concept_table_obj.add("structure", structure_table_obj)
else:
# sub_table = _convert_mapping_to_table(concept_field_value)
- log.verbose(f"{concept_key}/'{concept_field_key}' is inline: {concept_field_value}")
concept_table_obj.add(concept_field_key, cls.convert_dicts_to_inline_tables(concept_field_value))
table_obj.add(concept_key, concept_table_obj)
return table_obj
@@ -323,23 +310,19 @@ class MthdsFactory:
@classmethod
def dict_to_mthds_styled_toml(cls, data: Mapping[str, Any]) -> str:
"""Top-level keys become tables; second-level mappings become tables; inline tables start at third level."""
- log.verbose("=" * 100)
data = remove_none_values_from_dict(data=data)
document_root = document()
for root_key, root_value in data.items():
if not isinstance(root_value, Mapping):
- log.verbose(f"Root root_key is not a mapping: key = {root_key}, value = {root_value}")
document_root.add(root_key, cls.convert_dicts_to_inline_tables(root_value))
continue
# It's a mapping, therefore it's a section
- log.verbose(f"Root {root_key} is a section -------------------")
section_key = SectionKey(root_key)
section_value = cast("Mapping[str, Any]", root_value)
# Skip empty mappings (empty concept and pipe sections)
if not section_value:
- log.verbose(f"Section {section_key} is empty, skipping")
continue
match section_key:
case SectionKey.PIPE:
diff --git a/pipelex/libraries/library_utils.py b/pipelex/libraries/library_utils.py
index 39992931b..cf8e2ac26 100644
--- a/pipelex/libraries/library_utils.py
+++ b/pipelex/libraries/library_utils.py
@@ -29,9 +29,7 @@ def get_pipelex_mthds_files_from_package() -> list[Path]:
for child in sorted(traversable.iterdir(), key=lambda entry: entry.name):
if child.is_file() and is_pipelex_file(Path(child.name)):
- mthds_path_str = str(child)
- collected.append(Path(mthds_path_str))
- log.verbose(f"Found pipelex package MTHDS file: {mthds_path_str}")
+ collected.append(Path(str(child)))
elif child.is_dir():
# Skip excluded directories
if child.name not in excluded_dirs:
diff --git a/pipelex/migration/goldens/pipelex-config/[email protected] b/pipelex/migration/goldens/pipelex-config/[email protected]
new file mode 100644
index 000000000..753da7e4c
--- /dev/null
+++ b/pipelex/migration/goldens/pipelex-config/[email protected]
@@ -0,0 +1,497 @@
+####################################################################################################
+# Runtime — kernel-layer, process-scoped infrastructure (what runtime_hub brokers)
+####################################################################################################
+
+[runtime]
+
+[runtime.storage]
+is_fetch_remote_content_enabled = true
+is_upload_local_content_enabled = true
+method = "local" # local, in_memory, s3, gcp
+
+[runtime.storage.local]
+uri_format = "{hash}.{extension}"
+local_storage_path = ".pipelex/storage"
+
+[runtime.storage.in_memory]
+uri_format = "{hash}.{extension}"
+
+[runtime.storage.s3]
+uri_format = "{hash}.{extension}"
+bucket_name = ""
+region = ""
+signed_urls_lifespan_seconds = 3600
+
+[runtime.storage.gcp]
+uri_format = "{hash}.{extension}"
+bucket_name = ""
+project_id = ""
+signed_urls_lifespan_seconds = 3600
+
+[runtime.network]
+is_fetch_ssrf_guard_enabled = true
+
+[runtime.secrets]
+method = "env" # env (built-in); an external plugin may add e.g. vault
+
+####################################################################################################
+# Log config
+####################################################################################################
+
+[runtime.log]
+default_log_level = "INFO"
+# sink names the registered log sink boot installs on the root logger, the way runtime.storage.method
+# names a storage backend: "console" (the Rich handler, for a terminal), "json" (one JSON object per
+# line, for a server behind a log agent), "otlp" (the OpenTelemetry logs signal, for a collector),
+# "gcp" (Google Cloud Logging through the client library), or a token an installed plugin registers.
+# "console" is the default so the CLI keeps its rendering; a server selects "json". An unregistered
+# token stops the boot naming the registered ones.
+sink = "console"
+# console_log_target controls the stream the console and json sinks write to (log.debug/info/...).
+# Logs are diagnostics → stderr.
+console_log_target = "stderr"
+# console_print_target controls the Console returned by get_console(), used for banners,
+# deck notices, and the main `pipelex` CLI's data tables (`show backends`, `show models`,
+# `which`, `doctor`). Tables are data the user pipes to a file → stdout.
+# Note: the agent CLI (`pipelex-agent`) emits its actual JSON/markdown results via bare
+# builtin `print(...)` to sys.stdout, bypassing Rich entirely — so this knob does NOT
+# affect the agent CLI data channel. The agent CLI factory additionally forces both
+# targets to stderr internally to keep its stdout strictly reserved for the success
+# envelope (see `_AGENT_CLI_STDERR_CONSOLE_OVERRIDES` in `agent_cli_factory.py`).
+console_print_target = "stdout"
+
+json_logs_indent = 4
+presentation_line_width = 120
+silenced_problem_ids = ["azure_openai_no_stream_options"]
+caller_info_template = "file_line"
+is_caller_info_enabled = false
+
+# pretty_print_mode controls the panels `pretty_print(...)` renders, the "Output of pipe" panel after
+# every operator pipe among them: "rich" renders Rich tables, "poor" prints plain text, "silent" prints
+# nothing and builds no renderable at all. A host with no console, or one that runs pipes on a thread
+# that must not stall, sets "silent"; the agent CLI forces it.
+pretty_print_mode = "rich"
+
+[runtime.log.package_log_levels]
+# for logger names, the dots "." have been replaced by "-" to avoid toml parsing issues
+# TODO: use quotes to re-enable names with dots
+anthropic = "INFO"
+asyncio = "INFO"
+botocore = "INFO"
+botocore-credentials = "WARNING"
+google = "INFO"
+httpx = "WARNING"
+httpcore = "INFO"
+openai = "INFO"
+instructor = "INFO"
+urllib3-connectionpool = "INFO"
+urllib3-util-retry = "INFO"
+
+pipelex = "INFO"
+
+
+[runtime.log.rich_log]
+is_show_time = false
+is_show_level = true
+is_link_path_enabled = true
+is_markup_enabled = true
+highlighter_name = "json"
+is_rich_tracebacks = true
+is_tracebacks_word_wrap = true
+is_tracebacks_show_locals = false
+tracebacks_suppress = []
+keywords_to_hilight = []
+
+# The settings of the "otlp" sink. An endpoint key, when set, names the collector's logs URL
+# (for instance "http://localhost:4318/v1/logs"); left unset, the exporter follows the OpenTelemetry
+# environment conventions: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT, then OTEL_EXPORTER_OTLP_ENDPOINT, then
+# the collector default on localhost. Empty headers likewise leave OTEL_EXPORTER_OTLP_HEADERS in charge.
+# A header value may name a secret rather than carry it, a collector's bearer token written
+# "Bearer ${OTLP_AUTH_TOKEN}" for one: it is resolved through the secrets provider [runtime.secrets]
+# selects, which boot builds before the sink, and a variable that does not resolve stops the boot.
+[runtime.log.otlp]
+headers = {}
+
+# The settings of the "gcp" sink, which writes to Google Cloud Logging through the client library.
+# Most processes want "json" instead: a platform that runs a logging agent over the container's
+# stdout, Cloud Run and GKE among them, ingests the JSON objects that sink writes and needs no client
+# at all. Select "gcp" for a process that must write to Cloud Logging directly. log_name is the
+# Cloud Logging log the entries land under. A project_id key names the project when it is not the
+# ambient one the credentials or the metadata server declare, and a credentials_file_path key names a
+# service-account JSON file when Application Default Credentials are not what the process should use.
+# The path may be a secret too, "${GCP_CREDENTIALS_FILE_PATH}" being the one the gcp storage provider
+# reads, resolved through the secrets provider the way the otlp headers are.
+[runtime.log.gcp]
+log_name = "pipelex"
+
+# [runtime.log.redaction] governs the one processor every sink is behind: it scrubs the secret shapes
+# the workspace already knows (an Authorization bearer token, an api-key or signature header, an OAuth
+# code parameter, a cookie, a JSON secret entry, and the sk_ / plx_sk_ / pk_ / bl_ key prefixes) out of
+# the message and out of every string a field carries, and neutralises the control characters in a
+# field value so a caller-supplied string cannot forge a line or a field separator. is_enabled = false
+# turns it off for a process that redacts downstream. extra_patterns are regular expressions added to
+# the shipped families for the secret shapes only this deployment knows; every match is replaced by
+# "[REDACTED]", and a pattern the re module refuses is a configuration error named at load.
+[runtime.log.redaction]
+is_enabled = true
+extra_patterns = []
+
+[runtime.aws]
+api_key_method = "env"
+bedrock_access_variant = "aws_access"
+
+[runtime.reporting]
+is_log_costs_to_console = true
+is_generate_cost_report_file_enabled = false
+cost_report_dir_path = "reports"
+cost_report_base_name = "cost_report"
+cost_report_extension = "csv"
+cost_report_unit_scale = 1.0
+
+####################################################################################################
+# Tracing config (event log for distributed tracing across workers)
+####################################################################################################
+
+[runtime.tracing]
+is_enabled = true
+backend = "ndjson"
+
+[runtime.tracing.ndjson]
+traces_dir = ".pipelex/traces"
+
+[runtime.tracing.dynamodb]
+table_name = ""
+region = ""
+
+[runtime.observer]
+observer_dir = "results/observer"
+
+[runtime.plugins]
+# Names of discovered plugins to skip at startup (a denylist). Discovery is the
+# source of truth for which plugins are present; this only turns one off.
+disabled = []
+
+####################################################################################################
+# Inference — the model-calling seam (was [cogt])
+####################################################################################################
+
+[inference]
+transport_max_retries = 2
+
+[inference.model_deck]
+is_model_fallback_enabled = true
+missing_presets_reaction = "log"
+
+[inference.llm]
+default_max_images = 100
+is_structure_prompt_enabled = true
+is_dump_text_prompts_enabled = false
+is_dump_response_text_enabled = false
+schema_reask_max_attempts = 3
+
+[inference.llm.instructor]
+is_dump_kwargs_enabled = false
+is_dump_response_enabled = false
+is_dump_error_enabled = false
+
+[inference.llm.openai.effort_to_level_map]
+none = "none"
+minimal = "minimal"
+low = "low"
+medium = "medium"
+high = "high"
+xhigh = "xhigh"
+max = "xhigh"
+
+[inference.llm.anthropic]
+structured_output_timeout_seconds = 1200
+
+[inference.llm.anthropic.effort_to_level_map]
+none = "disabled"
+minimal = "low"
+low = "low"
+medium = "medium"
+high = "high"
+xhigh = "xhigh"
+max = "max"
+
+[inference.llm.google.effort_to_level_map]
+none = "disabled"
+minimal = "minimal"
+low = "low"
+medium = "medium"
+high = "high"
+xhigh = "high"
+max = "high"
+
+[inference.llm.mistral.effort_to_level_map]
+none = "disabled"
+minimal = "reasoning"
+low = "reasoning"
+medium = "reasoning"
+high = "reasoning"
+xhigh = "reasoning"
+max = "reasoning"
+
+[inference.llm.effort_to_budget_maps.anthropic]
+none = 0 # Required by validator; unreachable at runtime (level map gates NONE as disabled before budget lookup)
+minimal = 512
+low = 1024
+medium = 5000
+high = 16384
+xhigh = 32768
+max = 65536
+
+[inference.llm.effort_to_budget_maps.gemini]
+none = 0 # Required by validator; unreachable at runtime (level map gates NONE as disabled before budget lookup)
+minimal = 512
+low = 1024
+medium = 5000
+high = 16384
+xhigh = 32768
+max = 65536
+
+[inference.llm.generic_templates]
+output_structure_prompt = """
+
+
+---
+The instance we want to generate will be for the following class:
+{{ class_structure_str }}
+
+DO NOT create information.
+If some information is not present for an attribute, output the default value or None according to the attribute definition.
+"""
+
+structuring_prompt = """
+Read the following text carefully and produce the requested structured output from it.
+
+---
+{{ text }}
+"""
+
+####################################################################################################
+# Image generation config
+####################################################################################################
+
+[inference.img_gen.img_gen_job]
+is_sync_mode = false
+
+[inference.img_gen.img_gen_param_defaults]
+nb_steps = 28 # 28 is a good default for Flux, possible values are [1,2,4,8] for SDXL Lightning
+quality = "low"
+aspect_ratio = "square" # "square", "landscape_4_3", "landscape_3_2", "landscape_16_9", "landscape_21_9", "landscape_4_1", "landscape_8_1", "portrait_3_4", "portrait_2_3", "portrait_9_16", "portrait_9_21", "portrait_1_4", "portrait_1_8"
+guidance_scale = 2.5
+background = "auto"
+is_moderated = true
+safety_tolerance = 5
+is_raw = false
+seed = "auto"
+
+[inference.img_gen.quality_to_steps_maps]
+flux = { "low" = 14, "medium" = 28, "high" = 56 }
+sdxl_lightning = { "low" = 2, "medium" = 4, "high" = 8 }
+qwen_image = { "low" = 10, "medium" = 20, "high" = 28 }
+
+####################################################################################################
+# Extract config
+####################################################################################################
+
+[inference.extract]
+default_page_views_dpi = 72
+
+####################################################################################################
+# Gateway test config
+####################################################################################################
+
+[inference.gateway_test.config_id_substitutions]
+# this is an empty dict, it's only used by Pipelex staff to override the ¨Pipelex Gateway¨ config
+# in order to test new model integrations or debug issues with the Gateway
+
+####################################################################################################
+# Templating config
+####################################################################################################
+
+[inference.templating]
+default_templating_style = { tag_style = "xml" }
+
+####################################################################################################
+# Dry run config
+####################################################################################################
+
+[inference.dry_run]
+text_gen_truncate_length = 256
+nb_list_items = 3
+nb_extract_pages = 4
+allowed_to_fail_pipes = [
+ "failing_pipelines.infinite_loop_1", # Loop but only for testing purposes — matched on the namespaced pipe_ref
+]
+image_urls = [
+ "https://storage.googleapis.com/public_test_files_7fa6_4277_9ab/fashion/fashion_photo_1.jpg",
+ "https://storage.googleapis.com/public_test_files_7fa6_4277_9ab/fashion/fashion_photo_2.png",
+]
+
+####################################################################################################
+# Interpreter — library-scoped method machinery (what interpreter_hub brokers)
+####################################################################################################
+
+[interpreter]
+
+####################################################################################################
+# MTHDS config
+####################################################################################################
+
+[interpreter.mthds.inline_tables]
+spaces_inside_curly_braces = true
+
+[interpreter.mthds.strings]
+prefer_literal = false
+force_multiline = false
+length_limit_to_multiline = 100
+ensure_trailing_newline = true
+ensure_leading_blank_line = true
+
+[interpreter.mthds.concepts]
+structure_field_ordering = [
+ "type",
+ "concept_ref",
+ "item_type",
+ "item_concept_ref",
+ "description",
+ "choices",
+ "required",
+]
+
+[interpreter.mthds.pipes]
+field_ordering = ["type", "description", "inputs", "output"]
+
+####################################################################################################
+# Methods config
+####################################################################################################
+
+[interpreter.methods]
+# When a bundle references another method by address (github.com/...->domain.pipe) and no installed
+# method matches, fetch the package by address and install it into ~/.mthds/methods/ so the load can
+# proceed. Set to false to forbid network fetches at load time — a miss then raises a diagnostic
+# telling you the address and how to install it manually. The PIPELEX_METHODS_FETCH_ON_MISS
+# environment variable (1/0, true/false) overrides this setting when set.
+fetch_on_miss = true
+
+####################################################################################################
+# Pipe run config
+####################################################################################################
+
+[interpreter.pipe_run]
+pipe_stack_limit = 20
+
+####################################################################################################
+# PipeFunc config
+####################################################################################################
+
+[interpreter.pipe_func]
+# PipeFunc execution mode, selected from the PipeFuncExecutorRegistry the plugins populate. "direct"
+# (core) imports and runs customer functions in this process; "daytona" (our Daytona sandbox plugin)
+# runs them in a remote box. Any non-"direct" mode carries customer PipeFunc code as source text and
+# executes it only inside an isolated sandbox, never imported here.
+execution_mode = "direct"
+
+####################################################################################################
+# Pipeline execution config
+####################################################################################################
+
+[interpreter.pipeline_execution]
+is_normalize_data_urls_to_storage = true
+is_mock_inputs = false
+is_generate_graph = true
+is_generate_usage = true
+
+# Bounded fan-out concurrency for PipeBatch: at most this many branches run at once.
+# A modest default keeps a large workload (one pipe over many items) from overwhelming
+# asyncio, memory, and provider rate limits. Set to "unbounded" to disable the bound.
+max_concurrency = 8
+
+[interpreter.pipeline_execution.graph]
+
+[interpreter.pipeline_execution.graph.data_inclusion]
+stuff_json_content = true
+error_stack_traces = true
+pipe_and_concept_registry = true
+
+[interpreter.pipeline_execution.graph.graphs_inclusion]
+graphspec_json = true
+mermaidflow_mmd = true
+mermaidflow_html = true
+reactflow_html = true
+
+[interpreter.pipeline_execution.graph.mermaid]
+direction = "left_to_right"
+is_include_data_edges = true
+is_include_contains_edges = false
+is_include_selected_outcome_edges = true
+is_show_stuff_codes = false
+
+[interpreter.pipeline_execution.graph.mermaid.style]
+theme = "dark"
+
+[interpreter.pipeline_execution.graph.reactflow]
+is_use_cdn = true
+layout_direction = "left_to_right"
+nodesep = 50
+ranksep = 30
+edge_type = "bezier"
+initial_zoom = 1.0
+pan_to_top = true
+default_title = "Pipelex Graph"
+# Forwarded to mthds-ui as `showControllers`: when true, controller pipes (PipeSequence,
+# PipeParallel, PipeCondition, PipeBatch) render as grouping containers around their children;
+# when false, they collapse out of the graph and edges connect stuff nodes directly.
+show_batch_controller = true
+
+[interpreter.pipeline_execution.graph.reactflow.style]
+theme = "dark"
+palette = "dracula"
+
+[interpreter.scan]
+excluded_dirs = [
+ ".venv",
+ "venv",
+ "env",
+ ".env",
+ "virtualenv",
+ ".virtualenv",
+ ".git",
+ "__pycache__",
+ ".pytest_cache",
+ ".mypy_cache",
+ ".ruff_cache",
+ "node_modules",
+ "results",
+]
+
+[interpreter.builder]
+fix_loop_max_attempts = 10
+default_output_dir = "."
+default_bundle_file_name = "bundle"
+default_directory_base_name = "pipeline"
+
+####################################################################################################
+# Run — where `pipelex run` and `pipelex-agent run` execute a method
+####################################################################################################
+
+[run]
+# Where a run executes when the command passes neither --hosted nor --local:
+# - "local" runs on this machine, on the backends configured in .pipelex/inference/ (your own provider keys)
+# - "hosted" runs on the hosted Pipelex API, with the key in PIPELEX_API_KEY (the environment or ~/.pipelex/.env),
+# at the origin in PIPELEX_BASE_URL (https://api.pipelex.com when unset)
+execution = "local"
+
+####################################################################################################
+# Kit Config
+####################################################################################################
+
+[kit]
+# Agent rule files to install (used by `pipelex-dev kit rules`)
+# Each entry is one of: "cursor", "agents", "claude"
+# - "cursor" installs .cursor/rules/*.mdc files (cannot be combined with others)
+# - "agents" / "claude" install AGENTS.md / CLAUDE.md respectively — both can be listed together
+preferred_agent_targets = ["claude", "agents"]
diff --git a/pipelex/migration/goldens/pipelex-config/[email protected] b/pipelex/migration/goldens/pipelex-config/[email protected]
new file mode 100644
index 000000000..c257e5a7d
--- /dev/null
+++ b/pipelex/migration/goldens/pipelex-config/[email protected]
@@ -0,0 +1,1518 @@
+{
+ "surface_id": "pipelex-config",
+ "schema_version": 6,
+ "document_root_is_open": false,
+ "paths": {
+ "inference": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.dry_run": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.dry_run.allowed_to_fail_pipes": {
+ "value_type": "list[str]",
+ "required": false,
+ "default": [
+ "failing_pipelines.infinite_loop_1"
+ ],
+ "open_node": false
+ },
+ "inference.dry_run.image_urls": {
+ "value_type": "list[str]",
+ "required": true,
+ "default": [
+ "https://storage.googleapis.com/public_test_files_7fa6_4277_9ab/fashion/fashion_photo_1.jpg",
+ "https://storage.googleapis.com/public_test_files_7fa6_4277_9ab/fashion/fashion_photo_2.png"
+ ],
+ "open_node": false
+ },
+ "inference.dry_run.nb_extract_pages": {
+ "value_type": "int",
+ "required": true,
+ "default": 4,
+ "open_node": false
+ },
+ "inference.dry_run.nb_list_items": {
+ "value_type": "int",
+ "required": true,
+ "default": 3,
+ "open_node": false
+ },
+ "inference.dry_run.text_gen_truncate_length": {
+ "value_type": "int",
+ "required": true,
+ "default": 256,
+ "open_node": false
+ },
+ "inference.extract": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.extract.default_page_views_dpi": {
+ "value_type": "int",
+ "required": true,
+ "default": 72,
+ "open_node": false
+ },
+ "inference.gateway_test": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.gateway_test.config_id_substitutions": {
+ "value_type": "dict[str, str]",
+ "required": true,
+ "default": {},
+ "open_node": true
+ },
+ "inference.gateway_test.config_id_substitutions.*": {
+ "value_type": "str",
+ "required": true,
+ "open_node": false
+ },
+ "inference.img_gen": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.img_gen.img_gen_job": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.img_gen.img_gen_job.is_sync_mode": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "inference.img_gen.img_gen_param_defaults": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.img_gen.img_gen_param_defaults.aspect_ratio": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "landscape_16_9",
+ "landscape_21_9",
+ "landscape_3_2",
+ "landscape_4_1",
+ "landscape_4_3",
+ "landscape_8_1",
+ "portrait_1_4",
+ "portrait_1_8",
+ "portrait_2_3",
+ "portrait_3_4",
+ "portrait_9_16",
+ "portrait_9_21",
+ "square"
+ ],
+ "default": "square",
+ "open_node": false
+ },
+ "inference.img_gen.img_gen_param_defaults.background": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "auto",
+ "opaque",
+ "transparent"
+ ],
+ "default": "auto",
+ "open_node": false
+ },
+ "inference.img_gen.img_gen_param_defaults.guidance_scale": {
+ "value_type": "float",
+ "required": true,
+ "default": 2.5,
+ "open_node": false,
+ "constraints": {
+ "gt": 0
+ }
+ },
+ "inference.img_gen.img_gen_param_defaults.is_moderated": {
+ "value_type": "bool",
+ "required": false,
+ "default": true,
+ "open_node": false
+ },
+ "inference.img_gen.img_gen_param_defaults.is_raw": {
+ "value_type": "bool",
+ "required": false,
+ "default": false,
+ "open_node": false
+ },
+ "inference.img_gen.img_gen_param_defaults.nb_steps": {
+ "value_type": "int",
+ "required": false,
+ "default": 28,
+ "open_node": false,
+ "constraints": {
+ "gt": 0
+ }
+ },
+ "inference.img_gen.img_gen_param_defaults.quality": {
+ "value_type": "enum",
+ "required": false,
+ "enum_members": [
+ "high",
+ "low",
+ "medium"
+ ],
+ "default": "low",
+ "open_node": false
+ },
+ "inference.img_gen.img_gen_param_defaults.safety_tolerance": {
+ "value_type": "int",
+ "required": true,
+ "default": 5,
+ "open_node": false,
+ "constraints": {
+ "ge": 1,
+ "le": 6
+ }
+ },
+ "inference.img_gen.img_gen_param_defaults.seed": {
+ "value_type": "int | literal",
+ "required": true,
+ "enum_members": [
+ "auto"
+ ],
+ "default": "auto",
+ "open_node": false
+ },
+ "inference.img_gen.img_gen_param_defaults.size": {
+ "value_type": "enum | table",
+ "required": false,
+ "enum_members": [
+ "0.5k",
+ "1k",
+ "2k",
+ "4k"
+ ],
+ "open_node": false
+ },
+ "inference.img_gen.quality_to_steps_maps": {
+ "value_type": "dict[str, dict[str, int]]",
+ "required": true,
+ "default": {
+ "flux": {
+ "low": 14,
+ "medium": 28,
+ "high": 56
+ },
+ "sdxl_lightning": {
+ "low": 2,
+ "medium": 4,
+ "high": 8
+ },
+ "qwen_image": {
+ "low": 10,
+ "medium": 20,
+ "high": 28
+ }
+ },
+ "open_node": true
+ },
+ "inference.img_gen.quality_to_steps_maps.*": {
+ "value_type": "dict[str, int]",
+ "required": true,
+ "open_node": true
+ },
+ "inference.img_gen.quality_to_steps_maps.*.*": {
+ "value_type": "int",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.anthropic": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.anthropic.effort_to_level_map": {
+ "value_type": "dict[str, str]",
+ "required": true,
+ "default": {
+ "none": "disabled",
+ "minimal": "low",
+ "low": "low",
+ "medium": "medium",
+ "high": "high",
+ "xhigh": "xhigh",
+ "max": "max"
+ },
+ "open_node": true
+ },
+ "inference.llm.anthropic.effort_to_level_map.*": {
+ "value_type": "str",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.anthropic.structured_output_timeout_seconds": {
+ "value_type": "int",
+ "required": true,
+ "default": 1200,
+ "open_node": false
+ },
+ "inference.llm.default_max_images": {
+ "value_type": "int",
+ "required": true,
+ "default": 100,
+ "open_node": false
+ },
+ "inference.llm.effort_to_budget_maps": {
+ "value_type": "dict[str, dict[str, int]]",
+ "required": true,
+ "default": {
+ "anthropic": {
+ "none": 0,
+ "minimal": 512,
+ "low": 1024,
+ "medium": 5000,
+ "high": 16384,
+ "xhigh": 32768,
+ "max": 65536
+ },
+ "gemini": {
+ "none": 0,
+ "minimal": 512,
+ "low": 1024,
+ "medium": 5000,
+ "high": 16384,
+ "xhigh": 32768,
+ "max": 65536
+ }
+ },
+ "open_node": true
+ },
+ "inference.llm.effort_to_budget_maps.*": {
+ "value_type": "dict[str, int]",
+ "required": true,
+ "open_node": true
+ },
+ "inference.llm.effort_to_budget_maps.*.*": {
+ "value_type": "int",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.generic_templates": {
+ "value_type": "dict[str, str]",
+ "required": true,
+ "default": {
+ "output_structure_prompt": "\n\n---\nThe instance we want to generate will be for the following class:\n{{ class_structure_str }}\n\nDO NOT create information.\nIf some information is not present for an attribute, output the default value or None according to the attribute definition.\n",
+ "structuring_prompt": "Read the following text carefully and produce the requested structured output from it.\n\n---\n{{ text }}\n"
+ },
+ "open_node": true
+ },
+ "inference.llm.generic_templates.*": {
+ "value_type": "str",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.google": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.google.effort_to_level_map": {
+ "value_type": "dict[str, str]",
+ "required": true,
+ "default": {
+ "none": "disabled",
+ "minimal": "minimal",
+ "low": "low",
+ "medium": "medium",
+ "high": "high",
+ "xhigh": "high",
+ "max": "high"
+ },
+ "open_node": true
+ },
+ "inference.llm.google.effort_to_level_map.*": {
+ "value_type": "str",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.instructor": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.instructor.is_dump_error_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "inference.llm.instructor.is_dump_kwargs_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "inference.llm.instructor.is_dump_response_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "inference.llm.is_dump_response_text_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "inference.llm.is_dump_text_prompts_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "inference.llm.is_structure_prompt_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "inference.llm.mistral": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.mistral.effort_to_level_map": {
+ "value_type": "dict[str, str]",
+ "required": true,
+ "default": {
+ "none": "disabled",
+ "minimal": "reasoning",
+ "low": "reasoning",
+ "medium": "reasoning",
+ "high": "reasoning",
+ "xhigh": "reasoning",
+ "max": "reasoning"
+ },
+ "open_node": true
+ },
+ "inference.llm.mistral.effort_to_level_map.*": {
+ "value_type": "str",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.openai": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.openai.effort_to_level_map": {
+ "value_type": "dict[str, str]",
+ "required": true,
+ "default": {
+ "none": "none",
+ "minimal": "minimal",
+ "low": "low",
+ "medium": "medium",
+ "high": "high",
+ "xhigh": "xhigh",
+ "max": "xhigh"
+ },
+ "open_node": true
+ },
+ "inference.llm.openai.effort_to_level_map.*": {
+ "value_type": "str",
+ "required": true,
+ "open_node": false
+ },
+ "inference.llm.schema_reask_max_attempts": {
+ "value_type": "int",
+ "required": true,
+ "default": 3,
+ "open_node": false,
+ "constraints": {
+ "ge": 1,
+ "le": 10
+ }
+ },
+ "inference.model_deck": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.model_deck.is_model_fallback_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "inference.model_deck.missing_presets_reaction": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "log",
+ "none",
+ "raise"
+ ],
+ "default": "log",
+ "open_node": false
+ },
+ "inference.templating": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.templating.default_templating_style": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "inference.templating.default_templating_style.tag_style": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "no_tag",
+ "square_brackets",
+ "ticks",
+ "xml"
+ ],
+ "default": "xml",
+ "open_node": false
+ },
+ "inference.templating.default_templating_style.text_format": {
+ "value_type": "enum",
+ "required": false,
+ "enum_members": [
+ "html",
+ "json",
+ "markdown",
+ "plain"
+ ],
+ "open_node": false
+ },
+ "inference.transport_max_retries": {
+ "value_type": "int",
+ "required": true,
+ "default": 2,
+ "open_node": false,
+ "constraints": {
+ "ge": 0,
+ "le": 10
+ }
+ },
+ "interpreter": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.builder": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.builder.default_bundle_file_name": {
+ "value_type": "str",
+ "required": true,
+ "default": "bundle",
+ "open_node": false
+ },
+ "interpreter.builder.default_directory_base_name": {
+ "value_type": "str",
+ "required": true,
+ "default": "pipeline",
+ "open_node": false
+ },
+ "interpreter.builder.default_output_dir": {
+ "value_type": "str",
+ "required": true,
+ "default": ".",
+ "open_node": false
+ },
+ "interpreter.builder.fix_loop_max_attempts": {
+ "value_type": "int",
+ "required": true,
+ "default": 10,
+ "open_node": false
+ },
+ "interpreter.methods": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.methods.fetch_on_miss": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.mthds": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.mthds.concepts": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.mthds.concepts.structure_field_ordering": {
+ "value_type": "list[str]",
+ "required": true,
+ "default": [
+ "type",
+ "concept_ref",
+ "item_type",
+ "item_concept_ref",
+ "description",
+ "choices",
+ "required"
+ ],
+ "open_node": false
+ },
+ "interpreter.mthds.inline_tables": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.mthds.inline_tables.spaces_inside_curly_braces": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.mthds.pipes": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.mthds.pipes.field_ordering": {
+ "value_type": "list[str]",
+ "required": true,
+ "default": [
+ "type",
+ "description",
+ "inputs",
+ "output"
+ ],
+ "open_node": false
+ },
+ "interpreter.mthds.strings": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.mthds.strings.ensure_leading_blank_line": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.mthds.strings.ensure_trailing_newline": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.mthds.strings.force_multiline": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "interpreter.mthds.strings.length_limit_to_multiline": {
+ "value_type": "int",
+ "required": true,
+ "default": 100,
+ "open_node": false
+ },
+ "interpreter.mthds.strings.prefer_literal": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "interpreter.pipe_func": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.pipe_func.execution_mode": {
+ "value_type": "str",
+ "required": true,
+ "default": "direct",
+ "open_node": false
+ },
+ "interpreter.pipe_run": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.pipe_run.pipe_stack_limit": {
+ "value_type": "int",
+ "required": true,
+ "default": 20,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.data_inclusion": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.data_inclusion.error_stack_traces": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.data_inclusion.pipe_and_concept_registry": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.data_inclusion.stuff_json_content": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.graphs_inclusion": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.graphs_inclusion.graphspec_json": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.graphs_inclusion.mermaidflow_html": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.graphs_inclusion.mermaidflow_mmd": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.graphs_inclusion.reactflow_html": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.mermaid": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.mermaid.direction": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "left_to_right",
+ "top_down"
+ ],
+ "default": "left_to_right",
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.mermaid.is_include_contains_edges": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.mermaid.is_include_data_edges": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.mermaid.is_include_selected_outcome_edges": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.mermaid.is_show_stuff_codes": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.mermaid.style": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.mermaid.style.theme": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "base",
+ "dark",
+ "default",
+ "forest",
+ "neutral"
+ ],
+ "default": "dark",
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.default_title": {
+ "value_type": "str",
+ "required": true,
+ "default": "Pipelex Graph",
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.edge_type": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "bezier",
+ "smoothstep",
+ "step",
+ "straight"
+ ],
+ "default": "bezier",
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.initial_zoom": {
+ "value_type": "float",
+ "required": true,
+ "default": 1.0,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.is_use_cdn": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.layout_direction": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "left_to_right",
+ "top_down"
+ ],
+ "default": "left_to_right",
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.nodesep": {
+ "value_type": "int",
+ "required": true,
+ "default": 50,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.pan_to_top": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.ranksep": {
+ "value_type": "int",
+ "required": true,
+ "default": 30,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.show_batch_controller": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.style": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.style.palette": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "dracula",
+ "yellow_blue"
+ ],
+ "default": "dracula",
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.graph.reactflow.style.theme": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "dark",
+ "light",
+ "system"
+ ],
+ "default": "dark",
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.is_generate_graph": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.is_generate_usage": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.is_mock_inputs": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.is_normalize_data_urls_to_storage": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "interpreter.pipeline_execution.max_concurrency": {
+ "value_type": "int | literal",
+ "required": true,
+ "enum_members": [
+ "unbounded"
+ ],
+ "default": 8,
+ "open_node": false,
+ "constraints": {
+ "ge": 1
+ }
+ },
+ "interpreter.scan": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "interpreter.scan.excluded_dirs": {
+ "value_type": "frozenset[str]",
+ "required": true,
+ "default": [
+ ".venv",
+ "venv",
+ "env",
+ ".env",
+ "virtualenv",
+ ".virtualenv",
+ ".git",
+ "__pycache__",
+ ".pytest_cache",
+ ".mypy_cache",
+ ".ruff_cache",
+ "node_modules",
+ "results"
+ ],
+ "open_node": false
+ },
+ "kit": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "kit.preferred_agent_targets": {
+ "value_type": "list[enum]",
+ "required": true,
+ "enum_members": [
+ "agents",
+ "claude",
+ "cursor"
+ ],
+ "default": [
+ "claude",
+ "agents"
+ ],
+ "open_node": false
+ },
+ "run": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "run.execution": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "hosted",
+ "local"
+ ],
+ "default": "local",
+ "open_node": false
+ },
+ "runtime": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.aws": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.aws.api_key_method": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "env",
+ "secret_provider"
+ ],
+ "default": "env",
+ "open_node": false
+ },
+ "runtime.aws.bedrock_access_variant": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "aws_access",
+ "bedrock_token"
+ ],
+ "default": "aws_access",
+ "open_node": false
+ },
+ "runtime.log": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.log.caller_info_template": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "file_func",
+ "file_line",
+ "file_line_func",
+ "func",
+ "func_line",
+ "func_module",
+ "func_module_line"
+ ],
+ "default": "file_line",
+ "open_node": false
+ },
+ "runtime.log.console_log_target": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "file",
+ "stderr",
+ "stdout"
+ ],
+ "default": "stderr",
+ "open_node": false
+ },
+ "runtime.log.console_print_target": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "file",
+ "stderr",
+ "stdout"
+ ],
+ "default": "stdout",
+ "open_node": false
+ },
+ "runtime.log.default_log_level": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "CRITICAL",
+ "DEBUG",
+ "ERROR",
+ "INFO",
+ "OFF",
+ "VERBOSE",
+ "WARNING"
+ ],
+ "default": "INFO",
+ "open_node": false
+ },
+ "runtime.log.gcp": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.log.gcp.credentials_file_path": {
+ "value_type": "str",
+ "required": false,
+ "open_node": false
+ },
+ "runtime.log.gcp.log_name": {
+ "value_type": "str",
+ "required": true,
+ "default": "pipelex",
+ "open_node": false
+ },
+ "runtime.log.gcp.project_id": {
+ "value_type": "str",
+ "required": false,
+ "open_node": false
+ },
+ "runtime.log.is_caller_info_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "runtime.log.json_logs_indent": {
+ "value_type": "int",
+ "required": true,
+ "default": 4,
+ "open_node": false
+ },
+ "runtime.log.otlp": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.log.otlp.endpoint": {
+ "value_type": "str",
+ "required": false,
+ "open_node": false
+ },
+ "runtime.log.otlp.headers": {
+ "value_type": "dict[str, str]",
+ "required": true,
+ "default": {},
+ "open_node": true
+ },
+ "runtime.log.otlp.headers.*": {
+ "value_type": "str",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.log.package_log_levels": {
+ "value_type": "dict[str, enum]",
+ "required": true,
+ "default": {
+ "anthropic": "INFO",
+ "asyncio": "INFO",
+ "botocore": "INFO",
+ "botocore-credentials": "WARNING",
+ "google": "INFO",
+ "httpx": "WARNING",
+ "httpcore": "INFO",
+ "openai": "INFO",
+ "instructor": "INFO",
+ "urllib3-connectionpool": "INFO",
+ "urllib3-util-retry": "INFO",
+ "pipelex": "INFO"
+ },
+ "open_node": true
+ },
+ "runtime.log.package_log_levels.*": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "CRITICAL",
+ "DEBUG",
+ "ERROR",
+ "INFO",
+ "OFF",
+ "VERBOSE",
+ "WARNING"
+ ],
+ "open_node": false
+ },
+ "runtime.log.presentation_line_width": {
+ "value_type": "int",
+ "required": true,
+ "default": 120,
+ "open_node": false
+ },
+ "runtime.log.pretty_print_mode": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "poor",
+ "rich",
+ "silent"
+ ],
+ "default": "rich",
+ "open_node": false
+ },
+ "runtime.log.redaction": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.log.redaction.extra_patterns": {
+ "value_type": "list[str]",
+ "required": true,
+ "default": [],
+ "open_node": false
+ },
+ "runtime.log.redaction.is_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.log.rich_log": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.log.rich_log.highlighter_name": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "json",
+ "repr"
+ ],
+ "default": "json",
+ "open_node": false
+ },
+ "runtime.log.rich_log.is_link_path_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.log.rich_log.is_markup_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.log.rich_log.is_rich_tracebacks": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.log.rich_log.is_show_level": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.log.rich_log.is_show_time": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "runtime.log.rich_log.is_tracebacks_show_locals": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "runtime.log.rich_log.is_tracebacks_word_wrap": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.log.rich_log.keywords_to_hilight": {
+ "value_type": "list[str]",
+ "required": true,
+ "default": [],
+ "open_node": false
+ },
+ "runtime.log.rich_log.tracebacks_suppress": {
+ "value_type": "list[str]",
+ "required": true,
+ "default": [],
+ "open_node": false
+ },
+ "runtime.log.silenced_problem_ids": {
+ "value_type": "list[str]",
+ "required": true,
+ "default": [
+ "azure_openai_no_stream_options"
+ ],
+ "open_node": false
+ },
+ "runtime.log.sink": {
+ "value_type": "str",
+ "required": true,
+ "default": "console",
+ "open_node": false
+ },
+ "runtime.network": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.network.is_fetch_ssrf_guard_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.observer": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.observer.observer_dir": {
+ "value_type": "str",
+ "required": true,
+ "default": "results/observer",
+ "open_node": false
+ },
+ "runtime.plugins": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.plugins.disabled": {
+ "value_type": "list[str]",
+ "required": true,
+ "default": [],
+ "open_node": false
+ },
+ "runtime.reporting": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.reporting.cost_report_base_name": {
+ "value_type": "str",
+ "required": true,
+ "default": "cost_report",
+ "open_node": false
+ },
+ "runtime.reporting.cost_report_dir_path": {
+ "value_type": "str",
+ "required": true,
+ "default": "reports",
+ "open_node": false
+ },
+ "runtime.reporting.cost_report_extension": {
+ "value_type": "str",
+ "required": true,
+ "default": "csv",
+ "open_node": false
+ },
+ "runtime.reporting.cost_report_unit_scale": {
+ "value_type": "float",
+ "required": true,
+ "default": 1.0,
+ "open_node": false,
+ "constraints": {
+ "gt": 0
+ }
+ },
+ "runtime.reporting.is_generate_cost_report_file_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": false,
+ "open_node": false
+ },
+ "runtime.reporting.is_log_costs_to_console": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.secrets": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.secrets.method": {
+ "value_type": "str",
+ "required": true,
+ "default": "env",
+ "open_node": false
+ },
+ "runtime.storage": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.storage.gcp": {
+ "value_type": "table",
+ "required": false,
+ "open_node": false
+ },
+ "runtime.storage.gcp.bucket_name": {
+ "value_type": "str",
+ "required": true,
+ "default": "",
+ "open_node": false
+ },
+ "runtime.storage.gcp.project_id": {
+ "value_type": "str",
+ "required": true,
+ "default": "",
+ "open_node": false
+ },
+ "runtime.storage.gcp.signed_urls_lifespan_seconds": {
+ "value_type": "int | literal",
+ "required": true,
+ "enum_members": [
+ "disabled"
+ ],
+ "default": 3600,
+ "open_node": false
+ },
+ "runtime.storage.gcp.uri_format": {
+ "value_type": "str",
+ "required": true,
+ "default": "{hash}.{extension}",
+ "open_node": false
+ },
+ "runtime.storage.in_memory": {
+ "value_type": "table",
+ "required": false,
+ "open_node": false
+ },
+ "runtime.storage.in_memory.uri_format": {
+ "value_type": "str",
+ "required": true,
+ "default": "{hash}.{extension}",
+ "open_node": false
+ },
+ "runtime.storage.is_fetch_remote_content_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.storage.is_upload_local_content_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.storage.local": {
+ "value_type": "table",
+ "required": false,
+ "open_node": false
+ },
+ "runtime.storage.local.local_storage_path": {
+ "value_type": "str",
+ "required": true,
+ "default": ".pipelex/storage",
+ "open_node": false
+ },
+ "runtime.storage.local.uri_format": {
+ "value_type": "str",
+ "required": true,
+ "default": "{hash}.{extension}",
+ "open_node": false
+ },
+ "runtime.storage.method": {
+ "value_type": "str",
+ "required": true,
+ "default": "local",
+ "open_node": false
+ },
+ "runtime.storage.s3": {
+ "value_type": "table",
+ "required": false,
+ "open_node": false
+ },
+ "runtime.storage.s3.bucket_name": {
+ "value_type": "str",
+ "required": true,
+ "default": "",
+ "open_node": false
+ },
+ "runtime.storage.s3.region": {
+ "value_type": "str",
+ "required": true,
+ "default": "",
+ "open_node": false
+ },
+ "runtime.storage.s3.signed_urls_lifespan_seconds": {
+ "value_type": "int | literal",
+ "required": true,
+ "enum_members": [
+ "disabled"
+ ],
+ "default": 3600,
+ "open_node": false
+ },
+ "runtime.storage.s3.uri_format": {
+ "value_type": "str",
+ "required": true,
+ "default": "{hash}.{extension}",
+ "open_node": false
+ },
+ "runtime.tracing": {
+ "value_type": "table",
+ "required": true,
+ "open_node": false
+ },
+ "runtime.tracing.backend": {
+ "value_type": "enum",
+ "required": true,
+ "enum_members": [
+ "dynamodb",
+ "ndjson"
+ ],
+ "default": "ndjson",
+ "open_node": false
+ },
+ "runtime.tracing.dynamodb": {
+ "value_type": "table",
+ "required": false,
+ "open_node": false
+ },
+ "runtime.tracing.dynamodb.region": {
+ "value_type": "str",
+ "required": true,
+ "default": "",
+ "open_node": false
+ },
+ "runtime.tracing.dynamodb.table_name": {
+ "value_type": "str",
+ "required": true,
+ "default": "",
+ "open_node": false
+ },
+ "runtime.tracing.is_enabled": {
+ "value_type": "bool",
+ "required": true,
+ "default": true,
+ "open_node": false
+ },
+ "runtime.tracing.ndjson": {
+ "value_type": "table",
+ "required": false,
+ "open_node": false
+ },
+ "runtime.tracing.ndjson.traces_dir": {
+ "value_type": "str",
+ "required": true,
+ "default": ".pipelex/traces",
+ "open_node": false
+ }
+ }
+}
diff --git a/pipelex/migration/ledgers/pipelex-config.toml b/pipelex/migration/ledgers/pipelex-config.toml
index b3de7d594..268ac54af 100644
--- a/pipelex/migration/ledgers/pipelex-config.toml
+++ b/pipelex/migration/ledgers/pipelex-config.toml
@@ -12,7 +12,7 @@ id = "pipelex-config"
title = "The main Pipelex configuration"
base_file = "pipelex.toml"
tier_glob = "pipelex_*.toml"
-current_schema_version = 5
+current_schema_version = 6
min_supported_schema_version = 0
# This entry is inserted *below* the reshape rather than appended above it, and the order is what
@@ -447,3 +447,38 @@ key = "generic_poor_logger"
kind = "delete_key"
table_path = ["runtime", "log"]
key = "is_console_logging_enabled"
+
+# Safe, because the remap legality rule holds: both paths are enum-typed at this version and `DEV` is no
+# longer a member, so a current-valid file cannot carry it and a replay over one skips. `INFO` rather than
+# `DEBUG` because it is the faithful threshold: a level of `DEV` (15) passed `INFO` and above plus the `DEV`
+# records, and nothing logs at 15 any more, so `INFO` passes exactly the same records. `DEBUG` would lower
+# the threshold, and under `package_log_levels` that would turn on a third-party library's debug output,
+# an SDK's request dumps with prompt content among them, which the file had chosen to suppress.
+[[migration]]
+id = "pipelex-config@6"
+to_schema_version = 6
+introduced_in = "0.80.0"
+breaking = true
+safety = "safe"
+title = "Retire the DEV log level: a file naming it logs at INFO"
+description = """
+The `DEV` log level, which sat between `DEBUG` and `INFO`, is gone, along with `log.dev()`. A file that \
+names it as `default_log_level` or as a level under `[runtime.log.package_log_levels]` has it rewritten to \
+`INFO`, which lets through exactly the records `DEV` did now that nothing logs at the `DEV` level.
+"""
+guidance = """
+Nothing to decide: the rewritten file logs what it logged before. Set `DEBUG` where you want the lines a \
+diagnosis needs, which `DEV` never showed.
+"""
+
+[[migration.ops]]
+kind = "remap_value"
+table_path = ["runtime", "log"]
+key = "default_log_level"
+mapping = { DEV = "INFO" }
+
+[[migration.ops]] # the package names are the user's own keys, so `*` reaches each of them
+kind = "remap_value"
+table_path = ["runtime", "log", "package_log_levels"]
+key = "*"
+mapping = { DEV = "INFO" }
diff --git a/pipelex/pipe_controllers/batch/pipe_batch.py b/pipelex/pipe_controllers/batch/pipe_batch.py
index 353decc7e..ffa2f2251 100644
--- a/pipelex/pipe_controllers/batch/pipe_batch.py
+++ b/pipelex/pipe_controllers/batch/pipe_batch.py
@@ -217,12 +217,16 @@ class PipeBatch(PipeController):
output_items: list[StuffContent] = []
branch_output_stuff_codes: list[str] = []
- for pipe_output in pipe_outputs:
+ for branch_index, pipe_output in enumerate(pipe_outputs):
branch_resolved = pipe_output.working_memory.resolve_main_stuff()
if isinstance(branch_resolved, AbsenceRecord):
# Compaction (D4): an absent branch result cannot occupy a list slot — it is
# dropped, so the aggregated output holds only the found items (compactMap).
- log.verbose(f"PipeBatch '{self.code}': dropping absent branch result ({branch_resolved.reason})")
+ # This line is the only account of why the output list is shorter than its input.
+ log.debug(
+ "Dropped an absent batch branch result",
+ fields={"pipe_code": self.code, "branch_index": branch_index, "absence_reason": branch_resolved.reason},
+ )
continue
output_items.append(branch_resolved.content)
branch_output_stuff_codes.append(branch_resolved.stuff_code)
diff --git a/pipelex/pipe_controllers/binding/binding_step.py b/pipelex/pipe_controllers/binding/binding_step.py
index 8648b26c0..c4994f14b 100644
--- a/pipelex/pipe_controllers/binding/binding_step.py
+++ b/pipelex/pipe_controllers/binding/binding_step.py
@@ -145,7 +145,6 @@ class BindingStep(BaseModel):
concept = root_stuff.concept if derivation.is_bare_name else result_concept
bound_stuff = StuffFactory.make_stuff(concept=concept, content=bound_content, name=self.output_name, code=stuff_code)
working_memory.set_new_main_stuff(bound_stuff, name=self.output_name)
- log.verbose(f"Bound '{self.from_path}' to '{self.output_name}': {concept.concept_ref}")
return BindingOutcome(stuff=bound_stuff)
def skip_untyped_root(self, *, working_memory: WorkingMemory, calling_pipe_code: str, run_mode: PipeRunMode) -> BindingOutcome:
diff --git a/pipelex/pipe_controllers/condition/pipe_condition.py b/pipelex/pipe_controllers/condition/pipe_condition.py
index 960012118..9bffbf4b5 100644
--- a/pipelex/pipe_controllers/condition/pipe_condition.py
+++ b/pipelex/pipe_controllers/condition/pipe_condition.py
@@ -342,7 +342,6 @@ class PipeCondition(PipeController):
context=working_memory.generate_context(),
)
- log.verbose(f"add_alias: {evaluated_expression} -> {self.add_alias_from_expression_to}")
if self.add_alias_from_expression_to:
working_memory.add_alias(
alias=evaluated_expression,
@@ -376,7 +375,6 @@ class PipeCondition(PipeController):
# main stuff stays under its own name (the migration idiom: consume it explicitly
# downstream); it no longer passes through as this pipe's output.
if SpecialOutcome.is_continue(outcome):
- log.dev(f"PipeCondition '{self.code}' continued with outcome: {outcome}. Evaluated expression: {evaluated_expression}")
self._register_execution_data(job_metadata=job_metadata, execution_data=execution_data_dict)
# The reason names only the pipe and the outcome: a pipe that force-unwraps this output quotes it to the caller
# under STRICT disclosure, and the value the expression rendered can be literal text of a condition a host
@@ -458,12 +456,10 @@ class PipeCondition(PipeController):
) -> PipeOutput:
# Validate that the expression template is valid
try:
- full_paths = detect_jinja2_required_variables(
+ detect_jinja2_required_variables(
template_category=TemplateCategory.EXPRESSION,
template_source=self.expression,
)
- required_variables = {get_root_from_dotted_path(path) for path in full_paths}
- log.verbose(f"Expression template is valid, requires variables: {required_variables}")
except Jinja2DetectVariablesError as exc:
log.error(f"Dry run failed: could not detect required variables from expression template: {exc}")
# The expression is the caller's own method. The message quotes neither the expression nor the parser's
diff --git a/pipelex/pipe_controllers/parallel/pipe_parallel.py b/pipelex/pipe_controllers/parallel/pipe_parallel.py
index 88b7c4752..833684a0a 100644
--- a/pipelex/pipe_controllers/parallel/pipe_parallel.py
+++ b/pipelex/pipe_controllers/parallel/pipe_parallel.py
@@ -547,7 +547,6 @@ class PipeParallel(PipeController):
working_memory.add_new_stuff(name=sub_pipe_output_name, stuff=output_stuff)
output_stuffs[sub_pipe_output_name] = output_stuff
output_stuff_contents[sub_pipe_output_name] = output_stuff.content
- log.verbose(f"PipeParallel '{self.code}': output_stuff_contents[{sub_pipe_output_name}]: {output_stuff_contents[sub_pipe_output_name]}")
# Always combine the branch outputs into the declared output concept and stamp it as main stuff:
# a pipe run always resolves its declared output — the combine is the parallel's value arm.
diff --git a/pipelex/pipe_controllers/sub_pipe.py b/pipelex/pipe_controllers/sub_pipe.py
index a6b844db4..0bfb208e2 100644
--- a/pipelex/pipe_controllers/sub_pipe.py
+++ b/pipelex/pipe_controllers/sub_pipe.py
@@ -2,7 +2,6 @@ from typing import TYPE_CHECKING
from pydantic import BaseModel, field_validator
-from pipelex import log
from pipelex.core.memory.exceptions import WorkingMemoryStuffNotFoundError
from pipelex.core.memory.working_memory import WorkingMemory
from pipelex.core.pipes.inputs.exceptions import InputStuffSpecNotFoundError, PipeRunInputsError
@@ -187,7 +186,6 @@ class SubPipe(BaseModel):
variable_name=missing_names[0],
concept_code=None,
)
- log.verbose(working_memory.get_existing_stuffs(names=required_stuff_names), title=f"Required stuffs for {self.pipe_code}")
pipe_output = await get_pipe_router().run(
pipe_job=PipeJobFactory.make_pipe_job(
pipe=sub_pipe,
diff --git a/pipelex/pipe_machinery/pipe_abstract.py b/pipelex/pipe_machinery/pipe_abstract.py
index 85927181c..ff5fb5dda 100644
--- a/pipelex/pipe_machinery/pipe_abstract.py
+++ b/pipelex/pipe_machinery/pipe_abstract.py
@@ -1136,7 +1136,6 @@ class PipeAbstract(ABC, BaseModel):
"""
tracer = TelemetryManagerAbstract.get_instance_tracer()
if tracer is None:
- log.verbose(f"[OTel] No tracer available for pipe '{self.code}'")
return None, False
pipeline_run_id = run_metadata.pipeline_run_id
@@ -1226,19 +1225,6 @@ class PipeAbstract(ABC, BaseModel):
if span.get_span_context() == parent_span_context:
return None, False
- # Debug logging, under the span it announces, so the line's `pipelex.*` fields name that span
- span_ctx = span.get_span_context()
- with pipelex_span_active(span=span):
- log.verbose(
- f"[OTel] PIPE SPAN STARTED:\n"
- f" pipe_code='{self.code}'\n"
- f" pipeline_run_id='{pipeline_run_id}'\n"
- f" trace_id={span_ctx.trace_id:032x}\n"
- f" span_id={span_ctx.span_id:016x}\n"
- f" parent_span_id={parent_span_id:016x}\n"
- f" is_root_span={is_root_span}"
- )
-
return span, is_root_span
def _end_pipe_span_success(self, span: Span | None, *, pipe_output: PipeOutput, is_root_span: bool) -> None:
@@ -1252,9 +1238,6 @@ class PipeAbstract(ABC, BaseModel):
if span is None:
return
- span_ctx = span.get_span_context()
- log.verbose(f"[OTel] PIPE SPAN ENDING:\n pipe_code='{self.code}'\n trace_id={span_ctx.trace_id:032x}\n span_id={span_ctx.span_id:016x}")
-
# Always capture full output content for Langfuse
if TelemetryManagerAbstract.get_langfuse_enabled():
output_json = OtelFactory.make_output_json(
@@ -1286,11 +1269,6 @@ class PipeAbstract(ABC, BaseModel):
if span is None:
return
- span_ctx = span.get_span_context()
- log.verbose(
- f"[OTel] PIPE SPAN ENDING WITH ERROR:\n pipe_code='{self.code}'\n trace_id={span_ctx.trace_id:032x}\n span_id={span_ctx.span_id:016x}"
- )
-
span.set_attribute(PipelexSpanAttr.OUTCOME, SpanOutcome.FAILURE)
span.record_exception(error)
span.set_status(Status(StatusCode.ERROR, str(error)))
diff --git a/pipelex/pipe_operators/compose/pipe_compose.py b/pipelex/pipe_operators/compose/pipe_compose.py
index e535be5cc..2d2d13212 100644
--- a/pipelex/pipe_operators/compose/pipe_compose.py
+++ b/pipelex/pipe_operators/compose/pipe_compose.py
@@ -3,7 +3,6 @@ from typing import Any, Literal
from pydantic import Field
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.content_generation.dry_run_factory import DryRunFactory
from pipelex.cogt.templating.template_preprocessor import rewrite_template_sigils
from pipelex.config import get_config
@@ -221,7 +220,6 @@ class PipeCompose(PipeOperator[PipeComposeOutput]):
result_name=output_name,
)
working_memory = compose_result.memory
- log.verbose(f"Template rendered text:\n{compose_result.rendered_text}")
# Capture execution data for the graph tracer
execution_data_dict: dict[str, Any] = {
@@ -268,7 +266,6 @@ class PipeCompose(PipeOperator[PipeComposeOutput]):
except PipeComposeError as exc:
msg = f"In pipe '{self.code}' (output: {self.output.concept.code}): {exc.message}"
raise PipeComposeError(msg) from exc
- log.verbose(f"Composed structured content: {the_content}")
output_stuff = StuffFactory.make_stuff(concept=self.output.concept, content=the_content, name=output_name)
diff --git a/pipelex/pipe_operators/compose/structured_content_composer.py b/pipelex/pipe_operators/compose/structured_content_composer.py
index 3c62b897f..a7e12702e 100644
--- a/pipelex/pipe_operators/compose/structured_content_composer.py
+++ b/pipelex/pipe_operators/compose/structured_content_composer.py
@@ -4,7 +4,6 @@ from typing import Any, NamedTuple, TypeAlias, cast, get_args, get_origin
from pydantic import BaseModel, ValidationError
-from pipelex import log
from pipelex.cogt.templating.template_rendering import render_template
from pipelex.core.memory.working_memory import WorkingMemory
from pipelex.core.stuffs.date_content import DateContent
@@ -197,7 +196,6 @@ class StructuredContentComposer:
path = field_blueprint.from_path
expected_type: type[Any] | None = self._get_field_expected_type(field_name=field_name)
- log.verbose(f"_resolve_from_var: resolving path '{path}' for field '{field_name}' (expected: {expected_type})")
if "." in path:
resolved_value = self._resolve_dotted_path(path=path, expected_type=expected_type)
@@ -244,7 +242,6 @@ class StructuredContentComposer:
if find_private_path_segment(path=key_attr):
msg = f"list_to_dict_keyed_by names '{key_attr}', which starts with an underscore: it names a public field only"
raise StructuredContentComposerValueError(msg)
- log.verbose(f" Converting list of {len(items)} items to dict keyed by '{key_attr}'")
result: dict[str, Any] = {}
for idx, item in enumerate(items):
@@ -269,7 +266,6 @@ class StructuredContentComposer:
else:
result[key] = item # pyright: ignore[reportUnknownVariableType]
- log.verbose(f" Converted to dict with keys: {list(result.keys())}")
return result
def _resolve_dotted_path(self, path: str, *, expected_type: type[Any] | None) -> Any:
@@ -296,7 +292,6 @@ class StructuredContentComposer:
stuff = self.working_memory.get_stuff(base_name)
stuff_content: StuffContent = stuff.content
- log.verbose(f" Stuff '{base_name}' content type: {type(stuff_content).__name__}")
# Navigate the attribute path - this is dynamic attribute access at runtime
current_value: Any = stuff_content
@@ -308,7 +303,6 @@ class StructuredContentComposer:
else:
msg = f"Cannot resolve path '{path}': attribute '{attr}' not found"
raise StructuredContentComposerValueError(msg)
- log.verbose(f" Resolved value type: {type(current_value).__name__}") # pyright: ignore[reportUnknownArgumentType]
# Apply type conversion if the resolved value is a StuffContent
if isinstance(current_value, StuffContent):
@@ -330,7 +324,6 @@ class StructuredContentComposer:
"""
stuff = self.working_memory.get_stuff(name=name)
stuff_content: StuffContent = stuff.content
- log.verbose(f" Stuff '{name}' content type: {type(stuff_content).__name__}")
return self._convert_for_target_type(stuff_content=stuff_content, expected_type=expected_type)
def _convert_for_target_type(
@@ -353,7 +346,6 @@ class StructuredContentComposer:
if expected_type is not None:
extraction = self._extract_native_scalar(stuff_content=stuff_content, expected_type=expected_type)
if extraction.matched and extraction.value is not None:
- log.verbose(f" -> Target expects a native scalar, extracted {type(extraction.value).__name__} from {type(stuff_content).__name__}")
return extraction.value
if isinstance(stuff_content, TextContent):
return self._convert_text_content(text_content=stuff_content, expected_type=expected_type)
@@ -361,11 +353,9 @@ class StructuredContentComposer:
list_content = cast("ListContent[StuffContent]", stuff_content)
return self._convert_list_content(list_content=list_content, expected_type=expected_type)
elif expected_type is not None and self._expects_type(expected_type=expected_type, target_type=StuffContent):
- log.verbose(f" -> Target expects {expected_type.__name__}, converting content")
return self._convert_content_for_field(stuff_content=stuff_content, expected_type=expected_type)
else:
# Fallback: return as-is
- log.verbose(f" -> Unknown target type, returning {type(stuff_content).__name__} object")
return stuff_content
def _convert_text_content(self, text_content: TextContent, *, expected_type: Any) -> TextContent:
@@ -388,7 +378,6 @@ class StructuredContentComposer:
return converted_text_content
else:
# Default: return the object as-is
- log.verbose(f" -> Unknown target type, returning {type(text_content).__name__} object")
return text_content
def _extract_native_scalar(self, *, stuff_content: StuffContent, expected_type: type[Any]) -> NativeScalarExtraction:
@@ -463,21 +452,17 @@ class StructuredContentComposer:
if expected_type and self._expects_list_content_type(expected_type=expected_type):
# Target field expects ListContent[X], check item compatibility and return as ListContent
expected_item_type = self._get_list_item_type(expected_type=expected_type)
- log.verbose(f" -> Target expects ListContent[{expected_item_type}]")
converted_items = self._convert_list_items_as_objects(items=list_content.items, expected_item_type=expected_item_type)
return ListContent(items=converted_items)
elif expected_type and self._expects_list_type(expected_type=expected_type):
expected_item_type = self._get_list_item_type(expected_type=expected_type)
if expected_item_type is not None and expected_item_type in NATIVE_SCALAR_TARGET_TYPES:
# Target expects list of native scalars, extract the scalar from each item wrapper
- log.verbose(f" -> Target expects list[{expected_item_type}], extracting native scalars from ListContent items")
return self._convert_list_items_as_scalars(items=list_content.items, expected_item_type=expected_item_type)
# Target expects list[X] with structured items, extract items as dicts for Pydantic reconstruction
- log.verbose(f" -> Target expects list[{expected_item_type}], extracting items from ListContent")
return self._convert_list_items_as_dicts(items=list_content.items, expected_item_type=expected_item_type)
else:
# Default: return the object as-is
- log.verbose(f" -> Unknown target type, returning ListContent object with {list_content.nb_items} items")
return list_content
def _get_field_expected_type(self, field_name: str) -> type[Any] | None:
@@ -540,17 +525,14 @@ class StructuredContentComposer:
if isinstance(stuff_content, expected_type):
# Exact match or subclass - return as-is
- log.verbose(f" -> {actual_type.__name__} is compatible with {expected_type.__name__}, returning as-is")
return stuff_content
elif are_classes_equivalent(class_1=actual_type, class_2=expected_type):
# Check structural equivalence and rebuild if compatible
- log.verbose(f" -> {actual_type.__name__} is structurally equivalent to {expected_type.__name__}, rebuilding")
content_dict = stuff_content.model_dump(exclude_none=False, serialize_as_any=True)
return expected_type.model_validate(content_dict)
else:
# Try to rebuild anyway if expected_type accepts the content's fields
try:
- log.verbose(f" -> Attempting to rebuild {actual_type.__name__} as {expected_type.__name__}")
content_dict = stuff_content.model_dump(exclude_none=False, serialize_as_any=True)
return expected_type.model_validate(content_dict)
except ValidationError as exc:
@@ -624,10 +606,7 @@ class StructuredContentComposer:
Returns:
List of item dicts
"""
- log.verbose(f" Converting {len(items)} items to dicts, expected item type: {expected_item_type}")
-
if expected_item_type is None:
- log.verbose(" No expected item type, converting all items to dicts")
return [item.model_dump(exclude_none=False, serialize_as_any=True) for item in items]
converted_items: list[dict[str, Any]] = []
@@ -635,7 +614,6 @@ class StructuredContentComposer:
self._validate_item_compatibility(item=item, expected_type=expected_item_type, idx=idx)
converted_items.append(item.model_dump(exclude_none=False, serialize_as_any=True))
- log.verbose(f" Returning {len(converted_items)} items as dicts")
return converted_items
def _convert_list_items_as_scalars(self, *, items: list[StuffContent], expected_item_type: type[Any]) -> list[NativeScalarValue]:
@@ -654,8 +632,6 @@ class StructuredContentComposer:
Raises:
StructuredContentComposerTypeError: If an item is not a wrapper of the expected scalar type
"""
- log.verbose(f" Extracting {len(items)} items as native scalars, expected item type: {expected_item_type}")
-
converted_items: list[NativeScalarValue] = []
for idx, item in enumerate(items):
extraction = self._extract_native_scalar(stuff_content=item, expected_type=expected_item_type)
@@ -665,7 +641,6 @@ class StructuredContentComposer:
raise StructuredContentComposerTypeError(msg)
converted_items.append(extraction.value)
- log.verbose(f" Returning {len(converted_items)} items as native scalars")
return converted_items
def _convert_list_items_as_objects(self, items: list[StuffContent], *, expected_item_type: type[Any] | None) -> list[StuffContent]:
@@ -681,10 +656,7 @@ class StructuredContentComposer:
Returns:
List of StuffContent objects
"""
- log.verbose(f" Converting {len(items)} items as objects, expected item type: {expected_item_type}")
-
if expected_item_type is None:
- log.verbose(" No expected item type, returning items as-is")
return items
converted_items: list[StuffContent] = []
@@ -692,7 +664,6 @@ class StructuredContentComposer:
converted_item = self._convert_single_item_as_object(item, expected_type=expected_item_type, idx=idx)
converted_items.append(converted_item)
- log.verbose(f" Returning {len(converted_items)} items as objects")
return converted_items
def _validate_item_compatibility(self, item: StuffContent, *, expected_type: type[Any], idx: int) -> None:
@@ -715,7 +686,6 @@ class StructuredContentComposer:
if inspect.isclass(expected_type):
try:
if isinstance(item, expected_type):
- log.verbose(f" Item[{idx}]: {actual_type.__name__} is compatible with {expected_type_name}")
return
except TypeError:
# isinstance() failed - expected_type is not a valid type for this check
@@ -724,7 +694,6 @@ class StructuredContentComposer:
# Case 2: Check structural equivalence - OK
if hasattr(actual_type, "model_fields") and hasattr(expected_type, "model_fields"):
if are_classes_equivalent(class_1=actual_type, class_2=expected_type):
- log.verbose(f" Item[{idx}]: {actual_type.__name__} is structurally equivalent to {expected_type_name}")
return
# Case 3: native scalar item type - a wrapper dump can never validate into a bare scalar,
@@ -738,7 +707,6 @@ class StructuredContentComposer:
raise StructuredContentComposerTypeError(msg)
# Case 4: Try to validate via dict
- log.verbose(f" Item[{idx}]: Validating conversion {actual_type.__name__} -> {expected_type_name}")
item_dict = item.model_dump(exclude_none=False, serialize_as_any=True)
if inspect.isclass(expected_type) and issubclass(expected_type, BaseModel):
@@ -767,7 +735,6 @@ class StructuredContentComposer:
ValueError: If the item cannot be converted to the expected type
"""
try:
- log.verbose(f" Item[{idx}]: Converting {type(item).__name__} to {expected_type.__name__}")
return self._convert_content_for_field(item, expected_type=expected_type)
except StructuredContentComposerTypeError as exc:
# Re-raise with item index in message
diff --git a/pipelex/pipe_operators/func/pipe_func.py b/pipelex/pipe_operators/func/pipe_func.py
index 3e9e79ceb..5b7b74300 100644
--- a/pipelex/pipe_operators/func/pipe_func.py
+++ b/pipelex/pipe_operators/func/pipe_func.py
@@ -151,14 +151,6 @@ class PipeFunc(PipeOperator[PipeFuncOutput]):
is_subclass = not is_same_class and issubclass(item_type, concept_structure_class)
is_same_name = item_type.__name__ == self.output.concept.structure_class_name
- # Debug logging
- log.verbose(
- f"PipeFunc '{self.code}' ListContent validation: "
- f"item_type={item_type.__module__}.{item_type.__name__}, "
- f"concept_structure_class={concept_structure_class.__module__}.{concept_structure_class.__name__}, "
- f"is_same_class={is_same_class}, is_subclass={is_subclass}, is_same_name={is_same_name}"
- )
-
if not (is_same_class or is_subclass or is_same_name):
msg = (
f"PipeFunc '{self.code}' output concept expects structure class '{self.output.concept.structure_class_name}' "
@@ -193,8 +185,6 @@ class PipeFunc(PipeOperator[PipeFuncOutput]):
pipe_run_params: PipeRunParams,
output_name: str | None = None,
) -> PipeFuncOutput:
- log.verbose(f"Running PipeFunc with function '{self.function_name}'")
-
try:
execution_result = await get_pipe_func_executor().run_pipe_func(
job_metadata=job_metadata,
diff --git a/pipelex/pipe_operators/img_gen/pipe_img_gen.py b/pipelex/pipe_operators/img_gen/pipe_img_gen.py
index cd5f37e3e..4bf889f50 100644
--- a/pipelex/pipe_operators/img_gen/pipe_img_gen.py
+++ b/pipelex/pipe_operators/img_gen/pipe_img_gen.py
@@ -3,7 +3,6 @@ from typing import Any, Literal
from pydantic import Field
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.img_gen.img_gen_job_components import AspectRatio, Background, ImgGenSize
from pipelex.cogt.img_gen.img_gen_param_support import ImgGenParamSupport
from pipelex.cogt.img_gen.img_gen_setting import ImgGenModelChoice, ImgGenSetting, ImgGenSettingValueError
@@ -207,7 +206,6 @@ class PipeImgGen(PipeOperator[PipeImgGenOutput]):
background=self.background,
output_format=self.output_format,
)
- log.verbose(f"Using img_gen handle: {img_gen_setting.model}")
nb_images: int
if applied_output_multiplicity is True:
@@ -241,7 +239,6 @@ class PipeImgGen(PipeOperator[PipeImgGenOutput]):
result_name=output_name,
)
working_memory = img_gen_result.memory
- log.verbose(img_gen_result.content, title=f"output stuff content of PipeImg {self.code}")
# Capture execution data for the graph tracer
execution_data_dict: dict[str, Any] = {
diff --git a/pipelex/pipe_operators/judge/pipe_judge.py b/pipelex/pipe_operators/judge/pipe_judge.py
index 184ee9539..71030dad8 100644
--- a/pipelex/pipe_operators/judge/pipe_judge.py
+++ b/pipelex/pipe_operators/judge/pipe_judge.py
@@ -2,7 +2,6 @@ from typing import Any, Literal
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.judgment.judgment_models import ChoiceQuestion, JudgmentKind, JudgmentQuestion, RatingQuestion, YesNoQuestion
from pipelex.cogt.judgment.judgment_setting import JudgmentModelChoice
from pipelex.cogt.models.model_deck_check import check_judgment_choice_with_deck
@@ -183,8 +182,6 @@ class PipeJudge(PipeOperator[PipeJudgeOutput]):
pipe_run_params: PipeRunParams,
output_name: str | None = None,
) -> PipeJudgeOutput:
- log.dev(f"✨ PipeJudge '{self.code}' asking a {self.judgment_kind} question with judgment choice '{self.judgment_choice or 'default'}' ✨")
-
# Resolved per run into a local and never cached onto `self`, for the reason `pipe_llm.py`
# states about its own settings.
judgment_setting = resolve_judgment_setting(judgment_choice=self.judgment_choice, pipe_code=self.code, is_dry=pipe_run_params.run_mode.is_dry)
diff --git a/pipelex/pipe_operators/llm/llm_prompt_blueprint.py b/pipelex/pipe_operators/llm/llm_prompt_blueprint.py
index f31c901dd..a9e187285 100644
--- a/pipelex/pipe_operators/llm/llm_prompt_blueprint.py
+++ b/pipelex/pipe_operators/llm/llm_prompt_blueprint.py
@@ -76,5 +76,6 @@ class LLMPromptBlueprint(BaseModel):
extra_params=extra_params,
templating_style=templating_style,
)
- log.verbose(f"User text with {output_concept_ref=}:\n {llm_prompt.user_text}")
+ user_text_length = len(llm_prompt.user_text) if llm_prompt.user_text else 0
+ log.verbose(f"Rendered the LLM prompt for output '{output_concept_ref}': user text of {user_text_length} characters")
return llm_prompt
diff --git a/pipelex/pipe_operators/llm/pipe_llm.py b/pipelex/pipe_operators/llm/pipe_llm.py
index e5323da9f..21ab95d92 100644
--- a/pipelex/pipe_operators/llm/pipe_llm.py
+++ b/pipelex/pipe_operators/llm/pipe_llm.py
@@ -3,7 +3,6 @@ from typing import TYPE_CHECKING, Any, Literal
from pydantic import ValidationError
from typing_extensions import override
-from pipelex import log
from pipelex.base_exceptions import iter_cause_chain
from pipelex.cogt.exceptions import LLMCompletionError, ModelChoiceNotFoundError
from pipelex.cogt.llm.llm_setting import LLMModelChoice, LLMSetting, LLMSettingChoices
@@ -346,11 +345,6 @@ class PipeLLM(PipeOperator[PipeLLMOutput]):
rendered_llm_prompt = text_result.rendered_prompt
structuring_path = text_result.structuring_path
else:
- if is_multiple_output:
- log.verbose(f"PipeLLM generating {fixed_nb_output} output(s)" if fixed_nb_output else "PipeLLM generating a list of output(s)")
- else:
- log.verbose(f"PipeLLM generating a single object output, class name: '{output_stuff_spec.concept.structure_class_name}'")
-
try:
object_result = await run_llm_object(
memory=working_memory,
diff --git a/pipelex/pipe_operators/search/pipe_search.py b/pipelex/pipe_operators/search/pipe_search.py
index ff9bcc363..c20336d37 100644
--- a/pipelex/pipe_operators/search/pipe_search.py
+++ b/pipelex/pipe_operators/search/pipe_search.py
@@ -2,7 +2,6 @@ from typing import TYPE_CHECKING, Any, Literal
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.models.model_deck_check import check_search_choice_with_deck
from pipelex.cogt.search.search_setting import SearchModelChoice
from pipelex.cogt.templating.template_blueprint import TemplateBlueprint
@@ -84,9 +83,6 @@ class PipeSearch(PipeOperator[PipeSearchOutput]):
pipe_run_params: PipeRunParams,
output_name: str | None = None,
) -> PipeSearchOutput:
- search_choice_desc = self.search_choice or "default"
- log.dev(f"✨ PipeSearch '{self.code}' running with search choice '{search_choice_desc}' ✨")
-
# The deck chain, the handle resolution and the override application are kernel semantics; the
# setting is resolved per run into a local and never cached onto `self`, for the reason
# `pipe_llm.py` states about its own settings.
diff --git a/pipelex/pipe_operators/structure/pipe_structure.py b/pipelex/pipe_operators/structure/pipe_structure.py
index 32d67a223..4829e1b40 100644
--- a/pipelex/pipe_operators/structure/pipe_structure.py
+++ b/pipelex/pipe_operators/structure/pipe_structure.py
@@ -2,7 +2,6 @@ from typing import Any, Literal
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import LLMCompletionError, ModelChoiceNotFoundError
from pipelex.cogt.llm.llm_prompt import LLMPrompt
from pipelex.cogt.llm.llm_setting import LLMModelChoice, LLMSetting
@@ -179,8 +178,6 @@ class PipeStructure(PipeOperator[PipeStructureOutput]):
msg = f"Error generating {what_failed} in PipeStructure {location}: {exc}"
raise PipeRunError(message=msg, run_mode=pipe_run_params.run_mode, pipe_code=self.code) from exc
- log.verbose(f"PipeStructure '{self.code}' produced {content_class.__name__} (list={is_multiple_output})")
-
working_memory = store_result(
memory=working_memory,
concept=self.output.concept,
diff --git a/pipelex/pipe_run/delivery_executor.py b/pipelex/pipe_run/delivery_executor.py
index 92ccb53b2..3eb571bcc 100644
--- a/pipelex/pipe_run/delivery_executor.py
+++ b/pipelex/pipe_run/delivery_executor.py
@@ -417,7 +417,7 @@ class DeliveryExecutor:
for filename, result_file in result_files.items():
key: str = f"{base_key}/{filename}"
await storage_provider.store(data=result_file.data, key=key, content_type=result_file.content_type)
- log.debug(f"Stored: {key}")
+ log.debug("Stored a delivery result file", fields={"storage_key": key})
# TODO: include the full S3 URI (s3://bucket/key/) so result_url is
# self-contained and doesn't depend on knowing the bucket externally.
diff --git a/pipelex/pipe_run/pipe_run.py b/pipelex/pipe_run/pipe_run.py
index ebeae84c0..371f6e643 100644
--- a/pipelex/pipe_run/pipe_run.py
+++ b/pipelex/pipe_run/pipe_run.py
@@ -105,7 +105,7 @@ class PipeRun(PipeRunProtocol):
self._build_pipe_io_artifacts_on_output(pipe_output=pipe_output, pipeline_run_id=pipeline_run_id)
if delivery_assignment is not None:
- log.debug(f"Executing delivery for pipeline_run_id={pipeline_run_id}, status={status}")
+ log.debug("Executing the delivery", fields={"delivery_status": status})
try:
await self._delivery_executor.execute(
pipe_output=pipe_output,
diff --git a/pipelex/pipelex.py b/pipelex/pipelex.py
index 05b571e95..de267e204 100644
--- a/pipelex/pipelex.py
+++ b/pipelex/pipelex.py
@@ -76,8 +76,6 @@ class Pipelex(RuntimeBoot):
# pipeline
self.library_manager: LibraryManagerAbstract | None = None
- log.verbose(f"{PACKAGE_NAME} version {PACKAGE_VERSION} init done")
-
@override
def setup(
self,
@@ -203,8 +201,6 @@ class Pipelex(RuntimeBoot):
self._resolve_hub_slot(slot=HubSlot.PIPE_RUN, default=lambda: PipeRun(pipe_router=self.interpreter_hub.get_required_pipe_router()))
)
- log.verbose(f"{PACKAGE_NAME} version {PACKAGE_VERSION} setup done")
-
@override
def teardown(self) -> None:
# The three phases in this order deliberately: the plugin-contributed callbacks (LIFO) run
@@ -345,5 +341,5 @@ class Pipelex(RuntimeBoot):
# and the delete-on-failure handler above is behind us, so a reader can never adopt an instance
# that is about to be removed from the registry.
pipelex_instance.is_ready = True
- log.verbose(f"{PACKAGE_NAME} version {PACKAGE_VERSION} ready")
+ log.debug(f"{PACKAGE_NAME} version {PACKAGE_VERSION} ready")
return pipelex_instance
diff --git a/pipelex/pipeline/bundle_validator.py b/pipelex/pipeline/bundle_validator.py
index 5d183e3f4..88dc5c7da 100644
--- a/pipelex/pipeline/bundle_validator.py
+++ b/pipelex/pipeline/bundle_validator.py
@@ -519,7 +519,6 @@ class BundleValidator:
return DryRunOutput(
pipe_code=pipe.code, pipe_ref=pipe.pipe_ref, status=DryRunStatus.FAILURE, error_message=error_message, failure=failure
)
- log.verbose(f"✅ Pipe '{pipe.pipe_ref}' dry run completed successfully")
return DryRunOutput(pipe_code=pipe.code, pipe_ref=pipe.pipe_ref, status=DryRunStatus.SUCCESS)
@classmethod
diff --git a/pipelex/pipeline/execution_seams.py b/pipelex/pipeline/execution_seams.py
index 25650fc26..ca18b77f1 100644
--- a/pipelex/pipeline/execution_seams.py
+++ b/pipelex/pipeline/execution_seams.py
@@ -118,9 +118,8 @@ def acquire_library(
effective_dirs, source_label = resolve_library_dirs(library_dirs)
if effective_dirs:
- log.verbose(f"Loading libraries from {len(effective_dirs)} directory(ies) ({source_label}):")
- for index_dir, dir_path in enumerate(effective_dirs):
- log.verbose(f" [{index_dir + 1}] {dir_path}")
+ effective_dirs_desc = ", ".join(str(dir_path) for dir_path in effective_dirs)
+ log.verbose(f"Loading libraries from {len(effective_dirs)} directory(ies) ({source_label}): {effective_dirs_desc}")
library_dirs_translation: AbstractContextManager[None] = (
translate_to_validate_bundle_error() if library_dirs_are_callers else nullcontext()
)
diff --git a/pipelex/pipeline/pipeline_factory.py b/pipelex/pipeline/pipeline_factory.py
index c9b8d4221..9e8401898 100644
--- a/pipelex/pipeline/pipeline_factory.py
+++ b/pipelex/pipeline/pipeline_factory.py
@@ -1,6 +1,5 @@
from uuid import uuid4
-from pipelex import log
from pipelex.pipeline.pipeline import Pipeline
@@ -8,7 +7,6 @@ class PipelineFactory:
@classmethod
def make_pipeline(cls, *, pipeline_run_id: str | None = None) -> Pipeline:
pipeline_run_id = pipeline_run_id or cls.make_pipeline_run_id()
- log.verbose(f"Making new pipeline with run id: {pipeline_run_id}")
return Pipeline(
pipeline_run_id=pipeline_run_id,
)
diff --git a/pipelex/providers/anthropic/anthropic_factory.py b/pipelex/providers/anthropic/anthropic_factory.py
index c4d919e10..ed985a93f 100644
--- a/pipelex/providers/anthropic/anthropic_factory.py
+++ b/pipelex/providers/anthropic/anthropic_factory.py
@@ -122,7 +122,7 @@ class AnthropicFactory:
)
raise AwsCredentialsError(msg) from exc
if is_bedrock_token_in_env:
- log.verbose(
+ log.debug(
f"Ignoring {BEDROCK_TOKEN_VAR_NAME} from the environment: "
f'bedrock_access_variant = "{BedrockAccessVariant.AWS_ACCESS}" signs with the configured AWS access keys.'
)
diff --git a/pipelex/providers/anthropic/anthropic_llm_worker.py b/pipelex/providers/anthropic/anthropic_llm_worker.py
index 500f4f6a2..950ed6bcb 100644
--- a/pipelex/providers/anthropic/anthropic_llm_worker.py
+++ b/pipelex/providers/anthropic/anthropic_llm_worker.py
@@ -11,7 +11,6 @@ from anthropic.types import OutputConfigParam, ThinkingConfigParam
from pydantic.dataclasses import dataclass as pydantic_dataclass
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import InferenceErrorCategory, LLMCapabilityError, LLMCompletionError, SdkTypeError
from pipelex.cogt.inference.error_classification import (
UserAction,
@@ -192,7 +191,6 @@ class AnthropicLLMWorker(LLMWorkerAbstract):
output_config=None,
suppress_temperature=False,
)
- log.verbose(f"Anthropic adaptive thinking with effort={anthropic_effort}")
thinking_config: ThinkingConfigParam = {"type": "adaptive"}
output_config = OutputConfigParam(effort=anthropic_effort) # type: ignore[typeddict-item] # pyright: ignore[reportArgumentType]
return _ThinkingParams(
@@ -220,7 +218,6 @@ class AnthropicLLMWorker(LLMWorkerAbstract):
max_budget=inference_model.max_thinking_budget,
model_desc=inference_model.desc,
)
- log.verbose(f"Anthropic manual thinking with budget_tokens={safe_budget} (from effort={effort})")
thinking_config = {"type": "enabled", "budget_tokens": safe_budget}
return _ThinkingParams(
thinking=thinking_config,
@@ -255,7 +252,6 @@ class AnthropicLLMWorker(LLMWorkerAbstract):
max_budget=inference_model.max_thinking_budget,
model_desc=inference_model.desc,
)
- log.verbose(f"Anthropic thinking with explicit budget_tokens={safe_budget}")
thinking_config: ThinkingConfigParam = {"type": "enabled", "budget_tokens": safe_budget}
return _ThinkingParams(
thinking=thinking_config,
@@ -276,8 +272,9 @@ class AnthropicLLMWorker(LLMWorkerAbstract):
max_tokens = self._sent_max_tokens(requested_max_tokens=job_params.max_tokens or self.default_max_tokens, is_structured=False)
thinking_params = self._build_thinking_params(inference_model=self.inference_model, job_params=job_params, max_tokens=max_tokens)
- log.verbose(thinking_params, title="Thinking params")
- log.verbose(max_tokens, title="Max tokens")
+ self._log_reasoning_sent(
+ api_name="Anthropic", settings={"thinking": thinking_params.thinking, "output_config": thinking_params.output_config}
+ )
sends_temperature = self.inference_model.accepts_temperature and not thinking_params.suppress_temperature
try:
@@ -315,12 +312,6 @@ class AnthropicLLMWorker(LLMWorkerAbstract):
if stripped:
text_parts.append(stripped)
- log.verbose(
- f"content_block_types={block_types}, text_parts_count={len(text_parts)}, "
- f"stop_reason={final_message.stop_reason}, usage={final_message.usage}",
- title="Anthropic response",
- )
-
if not text_parts:
msg = (
f"No text content in response (model may have exhausted tokens on thinking)\n"
@@ -408,7 +399,9 @@ class AnthropicLLMWorker(LLMWorkerAbstract):
# The thinking budget is fitted against the max_tokens this call actually sends
thinking_params = self._build_thinking_params(inference_model=self.inference_model, job_params=job_params, max_tokens=effective_max_tokens)
- log.verbose(thinking_params, title="Thinking params")
+ self._log_reasoning_sent(
+ api_name="Anthropic", settings={"thinking": thinking_params.thinking, "output_config": thinking_params.output_config}
+ )
sends_temperature = self.inference_model.accepts_temperature and not thinking_params.suppress_temperature
# Deferred import: avoid pulling heavy SDK at module-load time
diff --git a/pipelex/providers/azure_rest/azure_img_gen_worker.py b/pipelex/providers/azure_rest/azure_img_gen_worker.py
index 128219773..c4c251459 100644
--- a/pipelex/providers/azure_rest/azure_img_gen_worker.py
+++ b/pipelex/providers/azure_rest/azure_img_gen_worker.py
@@ -25,7 +25,6 @@ from pipelex.plugins.model_handle import ModelHandle
from pipelex.providers.azure_rest.azure_exceptions import AzureCredentialsError
from pipelex.reporting.reporting_protocol import ReportingProtocol
from pipelex.runtime_hub import get_models_manager
-from pipelex.tools.log.log import log
class AzureImgGenWorker(ImgGenWorkerAbstract):
@@ -248,7 +247,6 @@ class AzureImgGenWorker(ImgGenWorkerAbstract):
# Extract usage tokens if available
if (usage_dict := response_dict.get("usage")) and (img_gen_tokens_usage := img_gen_job.job_report.img_gen_tokens_usage):
- log.debug(usage_dict, title="Azure img gen usage")
nb_tokens: NbTokensByCategoryDict = {}
input_tokens = usage_dict.get("prompt_tokens")
if input_tokens is None:
diff --git a/pipelex/providers/bedrock/bedrock_client_aiobotocore.py b/pipelex/providers/bedrock/bedrock_client_aiobotocore.py
index ff75598f0..b41588d51 100644
--- a/pipelex/providers/bedrock/bedrock_client_aiobotocore.py
+++ b/pipelex/providers/bedrock/bedrock_client_aiobotocore.py
@@ -14,7 +14,7 @@ if TYPE_CHECKING:
class BedrockClientAiobotocore(BedrockClientProtocol):
def __init__(self, aws_region: str):
- log.verbose(f"Init BedrockClientAiobotocore with region '{aws_region}'")
+ log.debug(f"Init BedrockClientAiobotocore with region '{aws_region}'")
self.aws_region = aws_region
self.session = get_session()
diff --git a/pipelex/providers/bedrock/bedrock_client_boto3.py b/pipelex/providers/bedrock/bedrock_client_boto3.py
index b8d350547..151861ad0 100644
--- a/pipelex/providers/bedrock/bedrock_client_boto3.py
+++ b/pipelex/providers/bedrock/bedrock_client_boto3.py
@@ -12,7 +12,7 @@ from pipelex.providers.bedrock.bedrock_message import BedrockMessageDictList
class BedrockClientBoto3(BedrockClientProtocol):
def __init__(self, aws_region: str):
- log.verbose(f"Initializing BedrockClientBoto3 with region '{aws_region}'")
+ log.debug(f"Initializing BedrockClientBoto3 with region '{aws_region}'")
self.boto3_client = boto3.client(service_name="bedrock-runtime", region_name=aws_region) # pyright: ignore[reportUnknownMemberType]
@override
diff --git a/pipelex/providers/bedrock/bedrock_factory.py b/pipelex/providers/bedrock/bedrock_factory.py
index 45027c7ae..480566cf0 100644
--- a/pipelex/providers/bedrock/bedrock_factory.py
+++ b/pipelex/providers/bedrock/bedrock_factory.py
@@ -1,6 +1,5 @@
from enum import StrEnum
-from pipelex import log
from pipelex.cogt.exceptions import LLMCapabilityError
from pipelex.cogt.llm.llm_job import LLMJob
from pipelex.cogt.model_backends.backend import InferenceBackend
@@ -38,7 +37,6 @@ class BedrockFactory:
raise BedrockFactoryError(msg) from exc
bedrock_async_client: BedrockClientProtocol
- log.verbose(f"Using '{sdk_variant}' for BedrockClient")
match sdk_variant:
case BedrockSdkVariant.AIOBOTO:
from pipelex.providers.bedrock.bedrock_client_aiobotocore import BedrockClientAiobotocore # ruff: ignore[import-outside-top-level]
diff --git a/pipelex/providers/bedrock/bedrock_llm_worker.py b/pipelex/providers/bedrock/bedrock_llm_worker.py
index 62671d0ff..d41ef6487 100644
--- a/pipelex/providers/bedrock/bedrock_llm_worker.py
+++ b/pipelex/providers/bedrock/bedrock_llm_worker.py
@@ -3,7 +3,6 @@ from typing import Any
from botocore.exceptions import ClientError
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import LLMCapabilityError, SdkTypeError
from pipelex.cogt.inference.error_classification import extract_bedrock_metadata
from pipelex.cogt.inference.error_classify import classify_inference_error
@@ -68,8 +67,6 @@ class BedrockLLMWorker(LLMWorkerAbstract):
job_params = llm_job.applied_job_params or llm_job.job_params
message = BedrockFactory.make_simple_message(llm_job=llm_job)
- log.verbose(self.inference_model.model_id)
-
try:
bedrock_response_text, nb_tokens_by_category = await self.bedrock_client_for_text.chat(
messages=message.to_dict_list(),
diff --git a/pipelex/providers/fal/fal_img_gen_worker.py b/pipelex/providers/fal/fal_img_gen_worker.py
index 9789bb3d9..d36d8778e 100644
--- a/pipelex/providers/fal/fal_img_gen_worker.py
+++ b/pipelex/providers/fal/fal_img_gen_worker.py
@@ -1,11 +1,10 @@
from typing import Any
-from fal_client import AsyncClient, InProgress
+from fal_client import AsyncClient
from fal_client.auth import MissingCredentialsError
from fal_client.client import FalClientError, FalClientHTTPError, FalClientTimeoutError
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import ImgGenParameterError, InferenceErrorCategory, SdkTypeError
from pipelex.cogt.image.generated_image import GeneratedImageRawDetails
from pipelex.cogt.img_gen.img_gen_args_factory import ImgGenArgsFactory
@@ -54,23 +53,11 @@ class FalImgGenWorker(ImgGenWorkerAbstract):
if fal_application is None:
msg = f"Model '{self.inference_model.name}' rules must include a 'model_choice' entry"
raise ImgGenParameterError(msg, error_category=InferenceErrorCategory.CONFIGURATION)
- log.verbose(args_dict, title=f"Fal arguments, application={fal_application}")
try:
handler = await self.fal_async_client.submit(
application=fal_application,
arguments=args_dict,
)
-
- log_index = 0
- async for event in handler.iter_events(with_logs=True):
- if isinstance(event, InProgress):
- if not event.logs:
- continue
- new_logs = event.logs[log_index:]
- for event_log in new_logs:
- log.verbose(event_log["message"], title="FAL Log")
- log_index = len(event.logs)
-
return await handler.get()
except (MissingCredentialsError, FalClientHTTPError, FalClientTimeoutError, FalClientError) as exc:
metadata = extract_fal_metadata(exc)
@@ -89,9 +76,7 @@ class FalImgGenWorker(ImgGenWorkerAbstract):
img_gen_job: ImgGenJob,
) -> GeneratedImageRawDetails:
fal_result = await self._submit_and_get_result(img_gen_job=img_gen_job, nb_images=1)
- generated_image = FalFactory.make_generated_image(fal_result=fal_result)
- log.verbose(generated_image, title="generated_image")
- return generated_image
+ return FalFactory.make_generated_image(fal_result=fal_result)
@override
async def _gen_image_list(
@@ -101,6 +86,4 @@ class FalImgGenWorker(ImgGenWorkerAbstract):
nb_images: int,
) -> list[GeneratedImageRawDetails]:
fal_result = await self._submit_and_get_result(img_gen_job=img_gen_job, nb_images=nb_images)
- generated_image_list = FalFactory.make_generated_image_list(fal_result=fal_result)
- log.verbose(generated_image_list, title="generated_image_list")
- return generated_image_list
+ return FalFactory.make_generated_image_list(fal_result=fal_result)
diff --git a/pipelex/providers/google/google_img_gen_worker.py b/pipelex/providers/google/google_img_gen_worker.py
index 87549b853..d37d2be07 100644
--- a/pipelex/providers/google/google_img_gen_worker.py
+++ b/pipelex/providers/google/google_img_gen_worker.py
@@ -58,7 +58,6 @@ class GoogleImgGenWorker(ImgGenWorkerAbstract):
task = self._event_loop.create_task(self.genai_async_client.aclose())
# Add a callback to log any errors that occur during cleanup
task.add_done_callback(lambda t: log.debug(f"Google async client cleanup error: {t.exception()}") if t.exception() else None)
- log.verbose("Scheduled Google async client cleanup on captured event loop")
return
# Otherwise, try to get the current running loop
@@ -68,15 +67,13 @@ class GoogleImgGenWorker(ImgGenWorkerAbstract):
task = current_loop.create_task(self.genai_async_client.aclose())
# Add a callback to log any errors that occur during cleanup
task.add_done_callback(lambda t: log.debug(f"Google async client cleanup error: {t.exception()}") if t.exception() else None)
- log.verbose("Scheduled Google async client cleanup on current event loop")
except RuntimeError:
# No running event loop, we can safely use asyncio.run()
try:
asyncio.run(self.genai_async_client.aclose())
- log.verbose("Closed Google async client using asyncio.run()")
except Exception as exc: # ruff: ignore[blind-except]
# Best-effort: asyncio.run() runs aclose(), whose failure surface is not enumerable; teardown must never fail.
- log.verbose(f"Error closing Google async client during teardown: {exc}")
+ log.debug(f"Error closing Google async client during teardown: {exc}")
except Exception as exc: # ruff: ignore[blind-except]
# Best-effort cleanup boundary: teardown must never fail, whatever client/event-loop close throws.
log.debug(f"Error during Google async client teardown: {exc}")
diff --git a/pipelex/providers/google/google_llm_worker.py b/pipelex/providers/google/google_llm_worker.py
index c2fea626f..4036e249a 100644
--- a/pipelex/providers/google/google_llm_worker.py
+++ b/pipelex/providers/google/google_llm_worker.py
@@ -86,7 +86,6 @@ class GoogleLLMWorker(LLMWorkerAbstract):
task = self._event_loop.create_task(self.genai_async_client.aclose())
# Add a callback to log any errors that occur during cleanup
task.add_done_callback(lambda t: log.debug(f"Google async client cleanup error: {t.exception()}") if t.exception() else None)
- log.verbose("Scheduled Google async client cleanup on captured event loop")
return
# Otherwise, try to get the current running loop
@@ -96,15 +95,13 @@ class GoogleLLMWorker(LLMWorkerAbstract):
task = current_loop.create_task(self.genai_async_client.aclose())
# Add a callback to log any errors that occur during cleanup
task.add_done_callback(lambda t: log.debug(f"Google async client cleanup error: {t.exception()}") if t.exception() else None)
- log.verbose("Scheduled Google async client cleanup on current event loop")
except RuntimeError:
# No running event loop, we can safely use asyncio.run()
try:
asyncio.run(self.genai_async_client.aclose())
- log.verbose("Closed Google async client using asyncio.run()")
except Exception as exc: # ruff: ignore[blind-except]
# Best-effort: asyncio.run() runs aclose(), whose failure surface is not enumerable; teardown must never fail.
- log.verbose(f"Error closing Google async client during teardown: {exc}")
+ log.debug(f"Error closing Google async client during teardown: {exc}")
except Exception as exc: # ruff: ignore[blind-except]
# Best-effort cleanup boundary: teardown must never fail, whatever client/event-loop close throws.
log.debug(f"Error during Google async client teardown: {exc}")
@@ -158,7 +155,6 @@ class GoogleLLMWorker(LLMWorkerAbstract):
case ThinkingMode.MANUAL:
google_level = get_config().inference.llm.google.get_reasoning_level(effort=effort)
if google_level is None:
- log.verbose("Google manual thinking disabled (effort mapped to disabled)")
return cls._thinking_off_config(inference_model=inference_model)
budget = get_config().inference.llm.get_reasoning_budget(
family=cls.reasoning_budget_family,
@@ -171,14 +167,11 @@ class GoogleLLMWorker(LLMWorkerAbstract):
max_budget=inference_model.max_thinking_budget,
model_desc=inference_model.desc,
)
- log.verbose(f"Google manual thinking with thinking_budget={budget} (from effort={effort})")
return genai_types.ThinkingConfig(thinking_budget=budget)
case ThinkingMode.ADAPTIVE:
thinking_level = get_config().inference.llm.google.get_reasoning_level(effort=effort)
if thinking_level is None:
- log.verbose("Google adaptive thinking disabled (effort=NONE)")
return cls._thinking_off_config(inference_model=inference_model)
- log.verbose(f"Google adaptive thinking with thinking_level={thinking_level}")
return genai_types.ThinkingConfig(thinking_level=thinking_level)
case ThinkingMode.NONE:
msg = f"Model '{inference_model.desc}' does not support reasoning (thinking_mode=none)"
@@ -195,6 +188,13 @@ class GoogleLLMWorker(LLMWorkerAbstract):
raise LLMCapabilityError(msg)
return genai_types.ThinkingConfig(thinking_budget=0)
+ @classmethod
+ def _thinking_settings_sent(cls, *, thinking_config: genai_types.ThinkingConfig | None) -> dict[str, Any]:
+ """The thinking settings as the request sends them: the wire values, `HIGH` rather than the SDK's `ThinkingLevel` member."""
+ if thinking_config is None:
+ return {}
+ return thinking_config.model_dump(mode="json", exclude_none=True)
+
@classmethod
def _build_thinking_config_for_budget(
cls,
@@ -213,7 +213,6 @@ class GoogleLLMWorker(LLMWorkerAbstract):
max_budget=inference_model.max_thinking_budget,
model_desc=inference_model.desc,
)
- log.verbose(f"Google thinking with explicit thinking_budget={budget}")
return genai_types.ThinkingConfig(thinking_budget=budget)
case ThinkingMode.NONE:
msg = f"Model '{inference_model.desc}' does not support reasoning (thinking_mode=none)"
@@ -232,6 +231,7 @@ class GoogleLLMWorker(LLMWorkerAbstract):
contents = await GoogleFactory.prepare_user_contents(llm_prompt=llm_job.llm_prompt)
thinking_config = self._build_thinking_config(inference_model=self.inference_model, job_params=job_params, max_tokens=job_params.max_tokens)
+ self._log_reasoning_sent(api_name="Google", settings=self._thinking_settings_sent(thinking_config=thinking_config))
# Build generation config
generation_config = genai_types.GenerateContentConfig(
@@ -299,6 +299,7 @@ class GoogleLLMWorker(LLMWorkerAbstract):
"""Generate structured output using Google Gemini API with instructor."""
job_params = llm_job.applied_job_params or llm_job.job_params
thinking_config = self._build_thinking_config(inference_model=self.inference_model, job_params=job_params, max_tokens=job_params.max_tokens)
+ self._log_reasoning_sent(api_name="Google", settings=self._thinking_settings_sent(thinking_config=thinking_config))
# instructor's genai handlers read the system prompt only from `system`, and pop it only when it is not
# None: a `system=None` reaches `generate_content`, which refuses the unknown keyword
system_kwargs: dict[str, Any] = {"system": system_text} if (system_text := llm_job.llm_prompt.system_text) else {}
diff --git a/pipelex/providers/huggingface/huggingface_img_gen_worker.py b/pipelex/providers/huggingface/huggingface_img_gen_worker.py
index cde91474e..91aacbea4 100644
--- a/pipelex/providers/huggingface/huggingface_img_gen_worker.py
+++ b/pipelex/providers/huggingface/huggingface_img_gen_worker.py
@@ -5,7 +5,6 @@ from huggingface_hub.errors import HfHubHTTPError, InferenceTimeoutError
from PIL import Image
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import ImgGenParameterError, InferenceErrorCategory, SdkTypeError
from pipelex.cogt.image.generated_image import GeneratedImageRawDetails
from pipelex.cogt.img_gen.img_gen_args_factory import ImgGenArgsFactory
@@ -77,9 +76,7 @@ class HuggingFaceImgGenWorker(ImgGenWorkerAbstract):
) -> GeneratedImageRawDetails:
pil_image = await self._generate_single_image(img_gen_job=img_gen_job)
output_format = img_gen_job.job_params.output_format or ImageFormat.PNG
- generated_image = GeneratedImageRawDetails.make_from_pil_image(pil_image=pil_image, image_format=output_format)
- log.verbose(generated_image, title="generated_image")
- return generated_image
+ return GeneratedImageRawDetails.make_from_pil_image(pil_image=pil_image, image_format=output_format)
@override
async def _gen_image_list(
@@ -91,8 +88,7 @@ class HuggingFaceImgGenWorker(ImgGenWorkerAbstract):
# HuggingFace's text_to_image doesn't support batch generation directly,
# so we generate images one at a time
generated_image_list: list[GeneratedImageRawDetails] = []
- for idx in range(nb_images):
- log.verbose(f"Generating image {idx + 1}/{nb_images}")
+ for _index_image in range(nb_images):
generated_image = await self._gen_image(img_gen_job=img_gen_job)
generated_image_list.append(generated_image)
diff --git a/pipelex/providers/mistral/mistral_factory.py b/pipelex/providers/mistral/mistral_factory.py
index 28493184d..2fecb430a 100644
--- a/pipelex/providers/mistral/mistral_factory.py
+++ b/pipelex/providers/mistral/mistral_factory.py
@@ -232,11 +232,8 @@ class MistralFactory:
Returns:
Cleaned base64 string with metadata removed if it was present
"""
- log.debug("=== Cleaning Mistral image base64 ===")
try:
decoded_bytes = base64.b64decode(base64_str)
- log.debug(f"Decoded image length: {len(decoded_bytes)} bytes")
- log.debug(f"First 24 bytes (hex): {decoded_bytes[:24].hex()}")
# Image file magic numbers
jpeg_magic = b"\xff\xd8" # JPEG SOI (Start of Image) - FF D8
@@ -244,31 +241,23 @@ class MistralFactory:
# Check if the data already starts with a valid image magic number
if decoded_bytes[:2] == jpeg_magic:
- log.debug("Image already starts with JPEG magic (FF D8), no cleaning needed")
return base64_str
if decoded_bytes[:4] == png_magic:
- log.debug("Image already starts with PNG magic, no cleaning needed")
return base64_str
# Scan for JPEG magic in the first 32 bytes
jpeg_pos = decoded_bytes[:32].find(jpeg_magic)
if jpeg_pos > 0:
- log.debug(f"Found JPEG magic (FF D8) at byte position {jpeg_pos}")
cleaned_bytes = decoded_bytes[jpeg_pos:]
- log.debug(f"Cleaned image length: {len(cleaned_bytes)} bytes")
- log.debug(f"Cleaned first 20 bytes (hex): {cleaned_bytes[:20].hex()}")
return base64.b64encode(cleaned_bytes).decode("ascii")
# Scan for PNG magic in the first 32 bytes
png_pos = decoded_bytes[:32].find(png_magic)
if png_pos > 0:
- log.debug(f"Found PNG magic at byte position {png_pos}")
cleaned_bytes = decoded_bytes[png_pos:]
- log.debug(f"Cleaned image length: {len(cleaned_bytes)} bytes")
- log.debug(f"Cleaned first 20 bytes (hex): {cleaned_bytes[:20].hex()}")
return base64.b64encode(cleaned_bytes).decode("ascii")
- log.debug("No image magic number found in first 32 bytes, returning original")
+ # No image magic number in the first 32 bytes: return the original
return base64_str
except ValueError as exc:
# base64 decode/encode failed (binascii.Error / UnicodeDecodeError, both ValueError subclasses) — return the original string unmodified
diff --git a/pipelex/providers/mistral/mistral_llm_worker.py b/pipelex/providers/mistral/mistral_llm_worker.py
index c7a9d675c..1810c1797 100644
--- a/pipelex/providers/mistral/mistral_llm_worker.py
+++ b/pipelex/providers/mistral/mistral_llm_worker.py
@@ -8,7 +8,6 @@ from mistralai.client.models import TextChunk, ThinkChunk
from mistralai.client.types import UNSET
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import InferenceErrorCategory, LLMCapabilityError, LLMCompletionError, SdkTypeError
from pipelex.cogt.inference.error_classification import (
UserAction,
@@ -128,11 +127,7 @@ class MistralLLMWorker(LLMWorkerAbstract):
match thinking_mode:
case ThinkingMode.MANUAL:
mistral_effort = get_config().inference.llm.mistral.get_reasoning_level(effort=effort)
- if mistral_effort is None:
- log.verbose("Mistral reasoning_effort omitted (reasoning disabled)")
- return UNSET
- log.verbose(f"Mistral reasoning_effort={mistral_effort}")
- return mistral_effort
+ return UNSET if mistral_effort is None else mistral_effort
case ThinkingMode.ADAPTIVE:
msg = f"Model '{inference_model.desc}' has thinking_mode=adaptive which is not supported for Mistral models"
raise LLMCapabilityError(msg)
@@ -150,6 +145,7 @@ class MistralLLMWorker(LLMWorkerAbstract):
job_params = llm_job.applied_job_params or llm_job.job_params
messages = await self.mistral_factory.make_simple_messages(llm_job=llm_job)
reasoning_effort = self._resolve_reasoning_effort(inference_model=self.inference_model, job_params=job_params)
+ self._log_reasoning_sent(api_name="Mistral", settings={"reasoning_effort": None if reasoning_effort is UNSET else reasoning_effort})
try:
response: ChatCompletionResponse | None = await self.mistral_client_for_text.chat.complete_async(
messages=messages,
@@ -257,6 +253,7 @@ class MistralLLMWorker(LLMWorkerAbstract):
) -> BaseModelTypeVar:
job_params = llm_job.applied_job_params or llm_job.job_params
reasoning_effort = self._resolve_reasoning_effort(inference_model=self.inference_model, job_params=job_params)
+ self._log_reasoning_sent(api_name="Mistral", settings={"reasoning_effort": None if reasoning_effort is UNSET else reasoning_effort})
# Deferred import: avoid pulling heavy SDK at module-load time
from instructor.core import InstructorRetryException # ruff: ignore[import-outside-top-level]
diff --git a/pipelex/providers/openai/openai_client_factory.py b/pipelex/providers/openai/openai_client_factory.py
index ed4857062..5dbae6677 100644
--- a/pipelex/providers/openai/openai_client_factory.py
+++ b/pipelex/providers/openai/openai_client_factory.py
@@ -51,7 +51,7 @@ class OpenAIClientFactory:
the_client: openai.AsyncOpenAI
match sdk_variant:
case OpenAISdkVariant.AZURE_OPENAI | OpenAISdkVariant.AZURE_OPENAI_RESPONSES:
- log.verbose(f"Making AsyncOpenAI client with endpoint: {backend.endpoint}")
+ log.debug(f"Making AsyncAzureOpenAI client with endpoint: {backend.endpoint}")
if backend.endpoint is None:
msg = "Azure OpenAI endpoint is not set"
raise OpenAIClientFactoryError(msg)
@@ -68,7 +68,7 @@ class OpenAIClientFactory:
| OpenAISdkVariant.BLACKBOXAI_IMG_GEN
| OpenAISdkVariant.OPENROUTER_IMG_GEN
):
- log.verbose(f"Making AsyncOpenAI client with endpoint: {backend.endpoint}")
+ log.debug(f"Making AsyncOpenAI client with endpoint: {backend.endpoint}")
the_client = openai.AsyncOpenAI(
api_key=api_key,
base_url=backend.endpoint,
diff --git a/pipelex/providers/openai/openai_completions_img_gen_worker.py b/pipelex/providers/openai/openai_completions_img_gen_worker.py
index 27c0959c8..31edb0e58 100644
--- a/pipelex/providers/openai/openai_completions_img_gen_worker.py
+++ b/pipelex/providers/openai/openai_completions_img_gen_worker.py
@@ -7,7 +7,6 @@ from openai import (
)
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import ImgGenGenerationError, ImgGenParameterError, InferenceErrorCategory, SdkTypeError
from pipelex.cogt.image.generated_image import GeneratedImageRawDetails
from pipelex.cogt.image.prompt_image_utils import prep_prompt_images
@@ -66,7 +65,6 @@ class OpenAICompletionsImgGenWorker(ImgGenWorkerAbstract):
self,
img_gen_job: ImgGenJob,
) -> GeneratedImageRawDetails:
- log.debug(f"Generating image with model: {self.inference_model.tag}")
image_format = self.fixed_output_format
if image_format is not None:
requested_format = img_gen_job.job_params.output_format
diff --git a/pipelex/providers/openai/openai_completions_llm_worker.py b/pipelex/providers/openai/openai_completions_llm_worker.py
index a395e2fc3..91821fde8 100644
--- a/pipelex/providers/openai/openai_completions_llm_worker.py
+++ b/pipelex/providers/openai/openai_completions_llm_worker.py
@@ -8,7 +8,6 @@ from openai import (
from openai.types.chat import ChatCompletionReasoningEffort
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import InferenceErrorCategory, LLMCapabilityError, LLMCompletionError, SdkTypeError
from pipelex.cogt.inference.error_classification import (
UserAction,
@@ -107,9 +106,7 @@ class OpenAICompletionsLLMWorker(LLMWorkerAbstract):
effort = job_params.reasoning_effort
match thinking_mode:
case ThinkingMode.MANUAL:
- openai_effort = get_config().inference.llm.openai.get_reasoning_level(effort=effort)
- log.verbose(f"OpenAI Chat Completions reasoning_effort={openai_effort}")
- return openai_effort
+ return get_config().inference.llm.openai.get_reasoning_level(effort=effort)
case ThinkingMode.ADAPTIVE:
msg = f"Model '{inference_model.desc}' has thinking_mode=adaptive which is not supported by the OpenAI Chat Completions API"
raise LLMCapabilityError(msg)
@@ -140,6 +137,7 @@ class OpenAICompletionsLLMWorker(LLMWorkerAbstract):
messages = await self.openai_completions_factory.make_simple_messages(llm_job=llm_job)
openai_reasoning_effort = self._resolve_reasoning_effort(inference_model=self.inference_model, job_params=job_params)
+ self._log_reasoning_sent(api_name="OpenAI Chat Completions", settings={"reasoning_effort": openai_reasoning_effort})
try:
extra_headers, extra_body = self.openai_completions_factory.make_extras(
@@ -217,6 +215,7 @@ class OpenAICompletionsLLMWorker(LLMWorkerAbstract):
) -> BaseModelTypeVar:
job_params = llm_job.applied_job_params or llm_job.job_params
openai_reasoning_effort = self._resolve_reasoning_effort(inference_model=self.inference_model, job_params=job_params)
+ self._log_reasoning_sent(api_name="OpenAI Chat Completions", settings={"reasoning_effort": openai_reasoning_effort})
messages = await self.openai_completions_factory.make_simple_messages(llm_job=llm_job)
# Deferred import: avoid pulling heavy SDK at module-load time
from instructor.core import InstructorRetryException # ruff: ignore[import-outside-top-level]
diff --git a/pipelex/providers/openai/openai_responses_llm_worker.py b/pipelex/providers/openai/openai_responses_llm_worker.py
index 9f00d7148..ef0ea65ae 100644
--- a/pipelex/providers/openai/openai_responses_llm_worker.py
+++ b/pipelex/providers/openai/openai_responses_llm_worker.py
@@ -10,7 +10,6 @@ from openai import (
from openai.types.shared_params import Reasoning
from typing_extensions import override
-from pipelex import log
from pipelex.cogt.exceptions import (
InferenceErrorCategory,
LLMCapabilityError,
@@ -115,7 +114,6 @@ class OpenAIResponsesLLMWorker(LLMWorkerAbstract):
openai_effort = get_config().inference.llm.openai.get_reasoning_level(effort=effort)
if openai_effort is None:
return None
- log.verbose(f"OpenAI Responses reasoning effort={openai_effort}")
return Reasoning(effort=openai_effort)
case ThinkingMode.ADAPTIVE:
msg = f"Model '{inference_model.desc}' has thinking_mode=adaptive which is not supported by the OpenAI Responses API"
@@ -147,6 +145,7 @@ class OpenAIResponsesLLMWorker(LLMWorkerAbstract):
input_items = await self.openai_responses_factory.make_input_items(llm_job=llm_job)
openai_reasoning = self._resolve_reasoning(inference_model=self.inference_model, job_params=job_params)
+ self._log_reasoning_sent(api_name="OpenAI Responses", settings={"reasoning": openai_reasoning})
try:
extra_headers, extra_body = self.openai_responses_factory.make_extras(
@@ -198,6 +197,7 @@ class OpenAIResponsesLLMWorker(LLMWorkerAbstract):
) -> BaseModelTypeVar:
job_params = llm_job.applied_job_params or llm_job.job_params
openai_reasoning = self._resolve_reasoning(inference_model=self.inference_model, job_params=job_params)
+ self._log_reasoning_sent(api_name="OpenAI Responses", settings={"reasoning": openai_reasoning})
from instructor.core import InstructorRetryException # ruff: ignore[import-outside-top-level]
if not hasattr(self.instructor_for_objects, "responses"):
diff --git a/pipelex/providers/storage/storage_plugin.py b/pipelex/providers/storage/storage_plugin.py
index 87046e954..11cd14d52 100644
--- a/pipelex/providers/storage/storage_plugin.py
+++ b/pipelex/providers/storage/storage_plugin.py
@@ -18,7 +18,7 @@ def _make_local_storage_provider(config: StorageProviderConfig) -> StorageProvid
msg = "local config is required when method is local"
raise StorageConfigError(msg)
config.local.lazy_validate()
- log.verbose(f"Using local storage at: {config.local.local_storage_path}")
+ log.debug(f"Using local storage at: {config.local.local_storage_path}")
return LocalStorageProvider(root_path=Path(config.local.local_storage_path))
@@ -27,7 +27,7 @@ def _make_in_memory_storage_provider(config: StorageProviderConfig) -> StoragePr
msg = "in_memory config is required when method is in_memory"
raise StorageConfigError(msg)
config.in_memory.lazy_validate()
- log.verbose("Using in-memory storage")
+ log.debug("Using in-memory storage")
return InMemoryStorageProvider()
@@ -36,7 +36,7 @@ def _make_s3_storage_provider(config: StorageProviderConfig) -> StorageProviderA
msg = "S3 config is required when method is s3"
raise StorageConfigError(msg)
config.s3.lazy_validate()
- log.verbose(f"Using S3 storage: bucket={config.s3.bucket_name}, region={config.s3.region}")
+ log.debug(f"Using S3 storage: bucket={config.s3.bucket_name}, region={config.s3.region}")
return S3StorageProvider(
bucket_name=config.s3.bucket_name,
region=config.s3.region,
@@ -49,7 +49,7 @@ def _make_gcp_storage_provider(config: StorageProviderConfig) -> StorageProvider
msg = "GCP config is required when method is gcp"
raise StorageConfigError(msg)
config.gcp.lazy_validate()
- log.verbose(f"Using GCP storage: bucket={config.gcp.bucket_name}, project={config.gcp.project_id}")
+ log.debug(f"Using GCP storage: bucket={config.gcp.bucket_name}, project={config.gcp.project_id}")
return GcpStorageProvider(
bucket_name=config.gcp.bucket_name,
project_id=config.gcp.project_id,
diff --git a/pipelex/reporting/reporting_manager.py b/pipelex/reporting/reporting_manager.py
index 4bd925042..d2018d4ae 100644
--- a/pipelex/reporting/reporting_manager.py
+++ b/pipelex/reporting/reporting_manager.py
@@ -319,7 +319,6 @@ class ReportingManager(ReportingProtocol):
@override
def report_inference_job(self, inference_job: InferenceJobAbstract):
- log.verbose(f"Inference job '{inference_job.job_metadata.unit_job_id}' completed in {inference_job.job_metadata.duration:.2f} seconds")
if isinstance(inference_job, LLMJob):
self._report_llm_job(llm_job=inference_job)
elif isinstance(inference_job, ImgGenJob):
diff --git a/pipelex/runtime_boot.py b/pipelex/runtime_boot.py
index 857b37225..c0bf2bcb3 100644
--- a/pipelex/runtime_boot.py
+++ b/pipelex/runtime_boot.py
@@ -250,7 +250,6 @@ class RuntimeBoot(metaclass=MetaSingleton):
self.runtime_hub.set_console_print_target(target=log_config.console_print_target)
log.configure(log_config=log_config)
self.runtime_hub.set_pretty_print_mode(mode=log_config.pretty_print_mode)
- log.verbose("Logs are configured")
if (stale_warning := config_manager.take_stale_configuration_warning()) is not None:
log.warning(stale_warning)
@@ -267,8 +266,6 @@ class RuntimeBoot(metaclass=MetaSingleton):
self.reporting_delegate: ReportingProtocol | None = None
self.telemetry_manager: TelemetryManagerAbstract | None = None
- log.verbose(f"{PACKAGE_NAME} version {PACKAGE_VERSION} runtime init done")
-
@staticmethod
def _get_config_file_not_found_error_msg(*, component: BootComponent) -> str:
"""Generate error message for missing config files."""
@@ -617,7 +614,6 @@ If you need help, drop by our Discord: we're happy to assist: {URLs.discord}.
# no meaning.
self.class_registry.register_classes(CoreRegistryModels.get_all_models())
if runtime_manager.is_unit_testing:
- log.verbose("Registering test models for unit testing")
self.class_registry.register_classes(TestRegistryModels.get_all_models())
# --- Observers -------------------------------------------------------------------------
@@ -651,8 +647,6 @@ If you need help, drop by our Discord: we're happy to assist: {URLs.discord}.
if isolated_execution_probe_factory is not None:
self.runtime_hub.set_isolated_execution_probe(isolated_execution_probe_factory())
- log.verbose(f"{PACKAGE_NAME} version {PACKAGE_VERSION} runtime setup done")
-
def _resolve_hub_slot(self, *, slot: HubSlot, default: Callable[[], _HubSlotImplT]) -> _HubSlotImplT:
"""Resolve a process-global hub slot: a plugin's claimed thunk if present, else the core default.
@@ -935,7 +929,7 @@ If you need help, drop by our Discord: we're happy to assist: {URLs.discord}.
# and the delete-on-failure handler above is behind us, so a reader can never adopt an instance
# that is about to be removed from the registry.
runtime_boot.is_ready = True
- log.verbose(f"{PACKAGE_NAME} version {PACKAGE_VERSION} runtime ready")
+ log.debug(f"{PACKAGE_NAME} version {PACKAGE_VERSION} runtime ready")
return runtime_boot
@classmethod
diff --git a/pipelex/system/registries/class_registry_utils.py b/pipelex/system/registries/class_registry_utils.py
index 108480d43..d92b6f3bb 100644
--- a/pipelex/system/registries/class_registry_utils.py
+++ b/pipelex/system/registries/class_registry_utils.py
@@ -118,11 +118,9 @@ class ClassRegistryUtils:
import_module_from_file(python_file)
except ModuleFileError:
# Expected: file validation issues (directories with .py extension, etc.)
- # log.verbose(f"Skipping file {python_file}: {e}")
pass
except ImportError:
# Common: missing dependencies, circular imports, relative imports
- # log.verbose(f"Could not import {python_file}: {e}"
pass
except SyntaxError as exc:
# Potentially problematic: invalid Python syntax may indicate broken code
diff --git a/pipelex/system/registries/func_registry.py b/pipelex/system/registries/func_registry.py
index f0103c217..4fea9ae24 100644
--- a/pipelex/system/registries/func_registry.py
+++ b/pipelex/system/registries/func_registry.py
@@ -1,5 +1,4 @@
import inspect
-import logging
from collections.abc import Callable
from typing import Any, TypeVar, cast, get_origin, get_type_hints
@@ -9,8 +8,6 @@ from typing_extensions import override
from pipelex.system.registries.exceptions import FuncRegistryError
from pipelex.urls import URLs
-FUNC_REGISTRY_LOGGER_CHANNEL_NAME = "func_registry"
-
# Type variable for generic function types
T = TypeVar("T")
FuncRegistryDict = dict[str, Callable[..., Any]]
@@ -93,15 +90,8 @@ def _make_ineligible_funcs_dict() -> IneligibleFuncsDict:
class FuncRegistry(RootModel[FuncRegistryDict]):
root: FuncRegistryDict = Field(default_factory=dict)
- _logger: logging.Logger = PrivateAttr(logging.getLogger(FUNC_REGISTRY_LOGGER_CHANNEL_NAME))
_ineligible_decorated_funcs: IneligibleFuncsDict = PrivateAttr(default_factory=_make_ineligible_funcs_dict)
- def log(self, message: str) -> None:
- self._logger.debug(message)
-
- def set_logger(self, logger: logging.Logger) -> None:
- self._logger = logger
-
def teardown(self) -> None:
"""Resets the registry to an empty state."""
self.root.clear()
@@ -128,7 +118,6 @@ class FuncRegistry(RootModel[FuncRegistryDict]):
already_registered = self.root.get(key)
if already_registered is not None:
if already_registered is func:
- self.log(f"Function '{key}' is already registered in registry with the same function object")
return
msg = (
f"Function name '{key}' is already registered by a different function: "
@@ -139,7 +128,6 @@ class FuncRegistry(RootModel[FuncRegistryDict]):
)
raise FuncRegistryError(msg)
- self.log(f"Registered new single function '{key}' in registry")
self.root[key] = func
def unregister_function(self, func: Callable[..., Any]) -> None:
@@ -149,7 +137,6 @@ class FuncRegistry(RootModel[FuncRegistryDict]):
msg = f"Function '{key}' not found in registry"
raise FuncRegistryError(msg)
del self.root[key]
- self.log(f"Unregistered single function '{key}' from registry")
def unregister_function_by_name(self, name: str) -> None:
"""Unregisters a function from the registry by its name."""
@@ -390,7 +377,6 @@ class FuncRegistry(RootModel[FuncRegistryDict]):
func_name = getattr(func, "_pipe_func_name", None) or func.__name__
info = IneligibleFunctionInfo(func_name=func_name, reason=reason, source_file=source_file)
self._ineligible_decorated_funcs[func_name] = info
- self.log(f"Registered ineligible @pipe_func function: {info}")
def get_ineligible_function_info(self, name: str) -> IneligibleFunctionInfo | None:
"""Get information about an ineligible @pipe_func decorated function.
diff --git a/pipelex/system/registries/func_registry_utils.py b/pipelex/system/registries/func_registry_utils.py
index 76521235b..4a5aa3608 100644
--- a/pipelex/system/registries/func_registry_utils.py
+++ b/pipelex/system/registries/func_registry_utils.py
@@ -41,7 +41,6 @@ class FuncRegistryUtils:
):
# Import the module
module = importlib.import_module(modname)
- log.verbose(f"Imported {modname}")
# Find @pipe_func decorated functions in this module
decorated_functions = cls._find_functions_in_module(module)
@@ -59,7 +58,6 @@ class FuncRegistryUtils:
name=func_name,
)
functions_registered += 1
- log.verbose(f"Registered @pipe_func: {func_name} from {modname}")
else:
# Function has @pipe_func but is not eligible - track it for better error messages
func_registry.register_ineligible_function(
@@ -200,7 +198,6 @@ class FuncRegistryUtils:
log.warning(f"Function '{func_name}' in '{file_path}' has @pipe_func() decorator but is not eligible: {eligibility_error}")
except ModuleFileError:
# Expected: file validation issues (directories with .py extension, etc.)
- # log.verbose(f"Skipping file {file_path}: {e}")
pass
except ImportError as exc:
# A module that fails to import (missing sibling module, circular import, bad relative
diff --git a/pipelex/system/telemetry/posthog_span_exporter.py b/pipelex/system/telemetry/posthog_span_exporter.py
index 6c6574ae0..ac584b65c 100644
--- a/pipelex/system/telemetry/posthog_span_exporter.py
+++ b/pipelex/system/telemetry/posthog_span_exporter.py
@@ -307,16 +307,6 @@ class PostHogSpanExporter(SpanExporter):
pipeline_run_id = attributes.get(PipelexSpanAttr.PIPELINE_RUN_ID)
properties["pipeline_run_id"] = pipeline_run_id
- log.verbose(
- f"[OTel->PostHog] EXPORT $ai_generation:\n"
- f" pipe_code='{properties.get('pipe_code')}'\n"
- f" pipeline_run_id='{pipeline_run_id}'\n"
- f" trace_id={properties.get(PostHogAttr.TRACE_ID)}\n"
- f" span_id={properties.get(PostHogAttr.SPAN_ID)}\n"
- f" parent_id={properties.get(PostHogAttr.PARENT_ID)}\n"
- f" model={properties.get(PostHogAttr.MODEL)}"
- )
-
self._capture_event(
event=PostHogEvent.GENERATION,
properties=properties,
@@ -351,15 +341,6 @@ class PostHogSpanExporter(SpanExporter):
# Apply pipe code redaction (only add if not None, for consistency)
if redacted_pipe_code := self._get_redacted_pipe_code(pipe_code):
properties["pipe_code"] = redacted_pipe_code
- log.verbose(
- f"[OTel->PostHog] EXPORT $ai_span:\n"
- f" pipe_code='{properties.get('pipe_code')}'\n"
- f" pipeline_run_id='{pipeline_run_id}'\n"
- f" $ai_span_name='{redacted_span_name}'\n"
- f" trace_id={properties.get(PostHogAttr.TRACE_ID)}\n"
- f" span_id={properties.get(PostHogAttr.SPAN_ID)}\n"
- f" parent_id={properties.get(PostHogAttr.PARENT_ID)}"
- )
self._capture_event(
event=PostHogEvent.SPAN,
@@ -377,32 +358,12 @@ class PostHogSpanExporter(SpanExporter):
return SpanExportResult.SUCCESS
def _do_export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult:
- log.verbose(f"[OTel->PostHog] export() called with {len(spans)} span(s)")
-
for span in spans:
try:
attributes = span.attributes or {}
span_category_str = cast("str", attributes.get(PipelexSpanAttr.SPAN_CATEGORY))
span_category = SpanCategory(span_category_str)
- span_ctx = span.get_span_context()
- parent_id = f"{span.parent.span_id:016x}" if span.parent else "None"
- trace_id_str = f"{span_ctx.trace_id:032x}" if span_ctx else "unknown"
- span_id_str = f"{span_ctx.span_id:016x}" if span_ctx else "unknown"
- pipe_code = attributes.get(PipelexSpanAttr.PIPE_CODE)
- pipeline_run_id = attributes.get(PipelexSpanAttr.PIPELINE_RUN_ID)
- trace_name = attributes.get(PipelexSpanAttr.TRACE_NAME)
- log.verbose(
- f"[OTel->PostHog] Processing span:\n"
- f" trace_name='{trace_name}'\n"
- f" trace_id={trace_id_str}\n"
- f" span_id={span_id_str}\n"
- f" span_category={span_category}\n"
- f" pipeline_run_id='{pipeline_run_id}'\n"
- f" pipe_code='{pipe_code}'\n"
- f" parent_id={parent_id}"
- )
-
match span_category:
case SpanCategory.INFERENCE:
self._export_generation_span(span=span, attributes=attributes)
diff --git a/pipelex/system/telemetry/telemetry_factory.py b/pipelex/system/telemetry/telemetry_factory.py
index 9d1064c61..99fa88d9a 100644
--- a/pipelex/system/telemetry/telemetry_factory.py
+++ b/pipelex/system/telemetry/telemetry_factory.py
@@ -32,7 +32,7 @@ class TelemetryFactory:
telemetry_config = load_telemetry_config(secrets_provider=secrets_provider)
if not telemetry_config.is_custom_telemetry_allowed_for_mode(integration_mode):
- log.verbose(f"Telemetry is disabled because the integration mode '{integration_mode}' does not allow it")
+ log.debug(f"Telemetry is disabled because the integration mode '{integration_mode}' does not allow it")
return TelemetryManagerNoOp()
# Always respect DO_NOT_TRACK env var
diff --git a/pipelex/system/telemetry/telemetry_manager.py b/pipelex/system/telemetry/telemetry_manager.py
index 471f0abde..ada357c3a 100644
--- a/pipelex/system/telemetry/telemetry_manager.py
+++ b/pipelex/system/telemetry/telemetry_manager.py
@@ -333,7 +333,6 @@ class TelemetryManager(TelemetryManagerAbstract):
try:
log.verbose("Shutting down OTel TracerProvider (flushing pending spans)...")
self._tracer_provider.shutdown()
- log.verbose("OTel TracerProvider shutdown complete")
except Exception as exc: # ruff: ignore[blind-except]
# Suppress any shutdown errors to avoid cascading failures
log.debug(f"Error during TracerProvider shutdown: {exc}")
@@ -389,7 +388,8 @@ class TelemetryManager(TelemetryManagerAbstract):
),
)
case PostHogMode.OFF:
- log.verbose(f"Custom telemetry is off, skipping event '{event_name}' for custom client")
+ # Custom telemetry is off: the event goes nowhere.
+ pass
@classmethod
def resolve_event_caller_identity(cls, *, run_metadata: "RunMetadata | None") -> CallerIdentity | None:
@@ -424,11 +424,9 @@ class TelemetryManager(TelemetryManagerAbstract):
properties=capture_properties,
groups=identity.groups or None,
)
- log.verbose(f"Tracked identified event '{event_name}' with properties: {capture_properties}")
else:
capture_properties[PostHogAttr.PROCESS_PERSON_PROFILE] = False
self.custom_posthog_client.capture(event_name, properties=capture_properties)
- log.verbose(f"Tracked anonymous event '{event_name}' with properties: {capture_properties}")
@override
@contextmanager
@@ -508,12 +506,6 @@ class TelemetryManager(TelemetryManagerAbstract):
only with none in scope leaves the stream's fallback.
"""
caller_identity = self.resolve_event_caller_identity(run_metadata=run_metadata)
- log.verbose(
- f"[Telemetry] Emitting trace start event:\n"
- f" trace_name='{trace_name}'\n"
- f" trace_name_redacted='{trace_name_redacted}'\n"
- f" trace_id={trace_id:032x}"
- )
# Send to PostHog if configured (uses full trace name based on user's capture settings)
if self.custom_posthog_client and self.telemetry_config.custom_posthog.tracing.enabled:
diff --git a/pipelex/tools/aws/aws_config.py b/pipelex/tools/aws/aws_config.py
index c1aeafeae..e27dc96bf 100644
--- a/pipelex/tools/aws/aws_config.py
+++ b/pipelex/tools/aws/aws_config.py
@@ -38,7 +38,7 @@ class AwsConfig(ConfigModel):
def get_aws_access_keys_with_method(self, *, api_key_method: AwsKeyMethod) -> tuple[str, str, str]:
match api_key_method:
case AwsKeyMethod.ENV:
- log.verbose("Getting AWS access keys from environment (key id and secret access key).")
+ log.debug("Getting AWS access keys from environment (key id and secret access key).")
try:
aws_access_key_id = get_required_env(AWS_ACCESS_KEY_ID_VAR_NAME)
aws_secret_access_key = get_required_env(AWS_SECRET_ACCESS_KEY_VAR_NAME)
@@ -46,10 +46,9 @@ class AwsConfig(ConfigModel):
except EnvVarNotFoundError as exc:
msg = f"Error getting AWS access keys from environment: {exc}"
raise AwsCredentialsError(msg) from exc
- log.verbose("Getting AWS region from environment (priority override) or from aws_config.")
case AwsKeyMethod.SECRET_PROVIDER:
- log.verbose("Getting AWS secret access key from secrets provider (key id and secret access key).")
+ log.debug("Getting AWS secret access key from secrets provider (key id and secret access key).")
try:
aws_access_key_id = get_secret(AWS_ACCESS_KEY_ID_VAR_NAME)
aws_secret_access_key = get_secret(AWS_SECRET_ACCESS_KEY_VAR_NAME)
@@ -57,7 +56,6 @@ class AwsConfig(ConfigModel):
except SecretNotFoundError as exc:
msg = "Error getting AWS access keys from secrets provider."
raise AwsCredentialsError(msg) from exc
- log.verbose("Getting AWS region from environment (priority override) or from aws_config.")
return aws_access_key_id, aws_secret_access_key, aws_region
diff --git a/pipelex/tools/log/gcp_log_sink.py b/pipelex/tools/log/gcp_log_sink.py
index 4e87a6eb3..d486f58b7 100644
--- a/pipelex/tools/log/gcp_log_sink.py
+++ b/pipelex/tools/log/gcp_log_sink.py
@@ -277,9 +277,8 @@ class GcpExportPathFilter(logging.Filter):
def severity_for_level(*, levelno: int) -> GcpLogSeverity:
"""The Cloud Logging severity for a stdlib level.
- Cloud Logging's scale is coarser than ours and has nothing below ``DEBUG``, so both of our custom
- levels land there: ``VERBOSE`` and ``DEV`` sit below ``INFO``, which is the whole of what the
- severity can say about them.
+ Cloud Logging's scale is coarser than ours and has nothing below ``DEBUG``, so our custom ``VERBOSE``
+ level lands there: it sits below ``INFO``, which is the whole of what the severity can say about it.
"""
if levelno < logging.INFO:
return GcpLogSeverity.DEBUG
diff --git a/pipelex/tools/log/log.py b/pipelex/tools/log/log.py
index aa1dc8503..b164f690b 100644
--- a/pipelex/tools/log/log.py
+++ b/pipelex/tools/log/log.py
@@ -8,7 +8,7 @@ from typing import TYPE_CHECKING, Any
from pipelex.tools.log.log_context import bind_log_context
from pipelex.tools.log.log_dispatch import LogDispatch
from pipelex.tools.log.log_holding import ForwardedRecordFilter, HoldingLogHandler
-from pipelex.tools.log.log_levels import LOGGING_LEVEL_DEV, LOGGING_LEVEL_OFF, LOGGING_LEVEL_VERBOSE, LogLevel
+from pipelex.tools.log.log_levels import LOGGING_LEVEL_VERBOSE, LogLevel
from pipelex.tools.log.log_redaction import make_redaction_processor
from pipelex.tools.log.log_sink import ProcessorFilter
@@ -277,16 +277,13 @@ class Log:
"""Set the log level using a string name.
Args:
- level_name (str): The name of the log level.
+ level_name (str): The name of the log level, one of the ``LogLevel`` members in any case.
+
+ Raises:
+ ValueError: When the name is not a ``LogLevel`` member.
"""
- if level_name.upper() == LogLevel.DEV:
- level = LOGGING_LEVEL_DEV
- elif level_name.upper() == LogLevel.OFF:
- level = LOGGING_LEVEL_OFF
- else:
- level = getattr(logging, level_name.upper())
- self.set_level_by_int(level_int=level)
+ self.set_level(LogLevel(level_name.upper()))
def set_level(self, level: LogLevel):
"""Set the default log level for all loggers.
@@ -379,29 +376,6 @@ class Log:
severity = logging.DEBUG
self.log_dispatch.dispatch(content=content, severity=severity, title=title, inline=inline, fields=fields, layout=layout)
- def dev(
- self,
- content: str | Any,
- *,
- title: str | None = None,
- inline: str | None = None,
- fields: Mapping[str, Any] | None = None,
- layout: LogLayout | None = None,
- ):
- """Log a development message.
-
- Args:
- content (Union[str, Any]): The content to log.
- title (str | None, optional): The title of the log message. Defaults to None.
- inline (str | None, optional): Inline title for the log message. Defaults to None.
- Used to display the title inline, only if the title arg is None.
- fields (Mapping[str, Any] | None, optional): Named values carried as attributes of the record, never rendered into the message.
- layout (LogLayout | None, optional): The console layout to render a string content through; every other sink ignores it.
-
- """
- severity = LOGGING_LEVEL_DEV
- self.log_dispatch.dispatch(content=content, severity=severity, title=title, inline=inline, fields=fields, layout=layout)
-
def info(
self,
content: str | Any,
diff --git a/pipelex/tools/log/log_levels.py b/pipelex/tools/log/log_levels.py
index cd5ba27fa..12b94e4d4 100644
--- a/pipelex/tools/log/log_levels.py
+++ b/pipelex/tools/log/log_levels.py
@@ -1,10 +1,6 @@
import logging
from enum import StrEnum
-# custom logging level for development, between DEBUG and INFO
-LOGGING_LEVEL_DEV = 15
-LOGGING_LEVEL_DEV_NAME = "DEV"
-logging.addLevelName(LOGGING_LEVEL_DEV, LOGGING_LEVEL_DEV_NAME)
# custom logging level for maximal verbosity, below DEBUG
LOGGING_LEVEL_VERBOSE = 5
LOGGING_LEVEL_VERBOSE_NAME = "VERBOSE"
@@ -15,7 +11,6 @@ LOGGING_LEVEL_OFF = 999
class LogLevel(StrEnum):
VERBOSE = LOGGING_LEVEL_VERBOSE_NAME
DEBUG = "DEBUG"
- DEV = LOGGING_LEVEL_DEV_NAME
INFO = "INFO"
WARNING = "WARNING"
ERROR = "ERROR"
@@ -29,8 +24,6 @@ class LogLevel(StrEnum):
return LOGGING_LEVEL_VERBOSE
case LogLevel.DEBUG:
return logging.DEBUG
- case LogLevel.DEV:
- return LOGGING_LEVEL_DEV
case LogLevel.INFO:
return logging.INFO
case LogLevel.WARNING:
@@ -41,14 +34,3 @@ class LogLevel(StrEnum):
return logging.CRITICAL
case LogLevel.OFF:
return LOGGING_LEVEL_OFF
-
- @staticmethod
- def from_int(*, logging_level: int) -> "LogLevel":
- if logging_level == LOGGING_LEVEL_VERBOSE:
- return LogLevel.VERBOSE
- elif logging_level == LOGGING_LEVEL_DEV:
- return LogLevel.DEV
- elif logging_level == LOGGING_LEVEL_OFF or logging_level > logging.CRITICAL:
- return LogLevel.OFF
- else:
- return LogLevel(logging.getLevelName(logging_level))
diff --git a/pipelex/tools/log/otlp_log_sink.py b/pipelex/tools/log/otlp_log_sink.py
index 7eaa4ff19..a9cf7dfc8 100644
--- a/pipelex/tools/log/otlp_log_sink.py
+++ b/pipelex/tools/log/otlp_log_sink.py
@@ -37,7 +37,7 @@ from typing_extensions import override
from pipelex.system.telemetry.current_span import PIPELEX_SPAN_ID_KEY, PIPELEX_TRACE_ID_KEY, pipelex_trace_fields_for_logs
from pipelex.tools.log.log_fields import COLLIDING_FIELD_PREFIX, carried_attributes
-from pipelex.tools.log.log_levels import LOGGING_LEVEL_DEV, LOGGING_LEVEL_VERBOSE
+from pipelex.tools.log.log_levels import LOGGING_LEVEL_VERBOSE
from pipelex.tools.log.log_sink import LogSink, render_json
if TYPE_CHECKING:
@@ -101,13 +101,11 @@ class ExportPathFilter(logging.Filter):
def _severity_number(*, levelno: int) -> SeverityNumber:
- """The OTel severity for a stdlib level, our two custom levels placed where they sit on ours."""
+ """The OTel severity for a stdlib level, our custom ``VERBOSE`` level placed where it sits on ours."""
if levelno <= LOGGING_LEVEL_VERBOSE:
return SeverityNumber.TRACE
- if levelno < LOGGING_LEVEL_DEV:
- return SeverityNumber.DEBUG
if levelno < logging.INFO:
- return SeverityNumber.DEBUG4
+ return SeverityNumber.DEBUG
if levelno < logging.WARNING:
return SeverityNumber.INFO
if levelno < logging.ERROR:
diff --git a/pipelex/tools/misc/filetype_utils.py b/pipelex/tools/misc/filetype_utils.py
index 6942b8cff..f2b3a7626 100644
--- a/pipelex/tools/misc/filetype_utils.py
+++ b/pipelex/tools/misc/filetype_utils.py
@@ -8,7 +8,6 @@ from typing import Final
import filetype
from pydantic import BaseModel
-from pipelex import log
from pipelex.tools.misc.exceptions import FileTypeError
# Constant for unknown/undetectable file types
@@ -97,19 +96,17 @@ def detect_file_type_from_base64(base64_data: str | bytes) -> FileType:
"""
# Normalise to bytes holding only the Base-64 alphabet
if isinstance(base64_data, bytes):
- log.verbose(f"b64 is already bytes: {base64_data[:100]!r}")
base64_bytes = base64_data
else: # str → handle optional data-URL header
- log.verbose(f"b64 is a string: {base64_data[:100]!r}")
if base64_data.lstrip().startswith("data:") and "," in base64_data:
base64_data = base64_data.split(",", 1)[1]
- log.verbose(f"b64 after split: {base64_data[:100]!r}")
base64_bytes = base64_data.encode("ascii") # Base-64 is pure ASCII
try:
raw = base64.b64decode(base64_bytes, validate=True)
except binascii.Error as exc: # malformed Base-64
- msg = f"Could not identify file type of given bytes because input is not valid base64: {exc}\n{base64_bytes[:100]!r}"
+ # The input's length and never its content: this message reaches error logs, and the content is a payload.
+ msg = f"Could not identify file type of given bytes because input is not valid base64 ({len(base64_bytes)} bytes): {exc}"
raise FileTypeError(msg) from exc
return detect_file_type_from_bytes(raw_bytes=raw)
diff --git a/pipelex/tools/misc/tenacity_utils.py b/pipelex/tools/misc/tenacity_utils.py
index 06f7bc38c..f24920652 100644
--- a/pipelex/tools/misc/tenacity_utils.py
+++ b/pipelex/tools/misc/tenacity_utils.py
@@ -1,15 +1,27 @@
+from typing import Any
+
from tenacity import RetryCallState
from pipelex import log
def log_retry(retry_state: RetryCallState) -> None:
- """Called before sleeping between retries."""
+ """Called before sleeping between retries: says a retry is coming, at DEBUG.
+
+ The message names the outcome, a retry, and not a failure, because a retry is not always one: a
+ poller retries on a result, while the job it polls is still queued or running. The attempt just made
+ and the wait before the next one ride as fields, and `exception_type`, the class of what the attempt
+ raised, only when it raised.
+ """
if not retry_state.outcome:
log.error("Tenacity retry state outcome is None")
return
exc = retry_state.outcome.exception()
- attempt = retry_state.attempt_number
- wait_duration = retry_state.next_action.sleep if retry_state.next_action else 0.0
- log.verbose(f"Tenacity retry #{attempt} due to '{type(exc).__name__}'.")
- log.verbose(f"Wait duration before next attempt: {wait_duration:.4f}s")
+ wait_seconds = retry_state.next_action.sleep if retry_state.next_action else 0.0
+ fields: dict[str, Any] = {
+ "attempt_number": retry_state.attempt_number,
+ "wait_seconds": wait_seconds,
+ }
+ if exc is not None:
+ fields["exception_type"] = type(exc).__name__
+ log.debug("Retrying", fields=fields)
diff --git a/pipelex/tools/storage/in_memory_storage_provider.py b/pipelex/tools/storage/in_memory_storage_provider.py
index a07fe3cef..32d371fc1 100644
--- a/pipelex/tools/storage/in_memory_storage_provider.py
+++ b/pipelex/tools/storage/in_memory_storage_provider.py
@@ -1,7 +1,6 @@
from pydantic import RootModel
from typing_extensions import override
-from pipelex import log
from pipelex.tools.misc.exceptions import FileTypeError
from pipelex.tools.misc.filetype_utils import detect_file_type_from_bytes
from pipelex.tools.storage.exceptions import StorageFileNotFoundError
@@ -42,7 +41,6 @@ class InMemoryStorageProvider(RootModel[InMemoryStorageRoot], StorageProviderAbs
except FileTypeError:
pass # MIME type detection failed, return None
- log.dev(f"Loaded data with metadata from key: '{key}', mime_type={mime_type}")
return StoredData(data=data, mime_type=mime_type)
@override
diff --git a/subject_grants.toml b/subject_grants.toml
index 0043e596d..623f0edda 100644
--- a/subject_grants.toml
+++ b/subject_grants.toml
@@ -1164,22 +1164,10 @@ rationale = "Consumes the llm_assignment; single operand."
param = "render_assignment"
rationale = "Dry-run mock of the render leaf: mocks the one render assignment it is handed."
-["pipelex/cogt/content_generation/dry_mock.py::dry_render_page_views"]
-param = "render_assignment"
-rationale = "Consumes the render_assignment; single operand."
-
-["pipelex/cogt/content_generation/dry_mock.py::dry_search_gen_sourced_answer"]
-param = "search_assignment"
-rationale = "Consumes the search_assignment; single operand."
-
["pipelex/cogt/content_generation/dry_mock.py::dry_search_gen_structured"]
param = "search_object_assignment"
rationale = "Consumes the search_object_assignment; single operand."
-["pipelex/cogt/content_generation/dry_mock.py::dry_search_gen_structured_object"]
-param = "search_assignment"
-rationale = "Worker verb–object: processes the search_assignment; single operand."
-
["pipelex/cogt/content_generation/dry_mock.py::dry_templating_gen_text"]
param = "templating_assignment"
rationale = "Consumes the templating_assignment; single operand."
@@ -5436,10 +5424,6 @@ rationale = "Predicate on the function; single operand."
param = "func"
rationale = "Predicate on the function; single operand."
-["pipelex/system/registries/func_registry.py::FuncRegistry.log"]
-param = "message"
-rationale = "Verb-object: logs the message; single operand."
-
["pipelex/system/registries/func_registry.py::FuncRegistry.register_function"]
param = "func"
rationale = "Verb-object: registers the function; options stay keyword."
@@ -5456,10 +5440,6 @@ rationale = "Verb-object: registers the functions mapping; single operand."
param = "func"
rationale = "Verb-object: records the function; reason stays keyword."
-["pipelex/system/registries/func_registry.py::FuncRegistry.set_logger"]
-param = "logger"
-rationale = "Setter: installs the logger; single self-labelling operand."
-
["pipelex/system/registries/func_registry.py::FuncRegistry.unregister_function"]
param = "func"
rationale = "Verb-object: unregisters the function; single operand."
@@ -5924,10 +5904,6 @@ rationale = "Logs the content; single operand (formatting keyword-only)."
param = "content"
rationale = "Logs the content; single operand (formatting keyword-only)."
-["pipelex/tools/log/log.py::Log.dev"]
-param = "content"
-rationale = "Logs the content; single operand (formatting keyword-only)."
-
["pipelex/tools/log/log.py::Log.error"]
param = "content"
rationale = "Logs the content; single operand (formatting keyword-only)."
diff --git a/tests/integration/pipelex/pipes/controller/pipe_batch/test_pipe_batch_compaction.py b/tests/integration/pipelex/pipes/controller/pipe_batch/test_pipe_batch_compaction.py
index 8582c6c9f..c3801eaa6 100644
--- a/tests/integration/pipelex/pipes/controller/pipe_batch/test_pipe_batch_compaction.py
+++ b/tests/integration/pipelex/pipes/controller/pipe_batch/test_pipe_batch_compaction.py
@@ -6,6 +6,7 @@ The absence source is the phase-1 `continue` semantics: the branch is a PipeCond
matching items to a processing pipe and non-matching items to `continue` (declared-absent output).
"""
+import logging
from typing import Callable, cast
import pytest
@@ -16,6 +17,7 @@ from pipelex.core.stuffs.list_content import ListContent
from pipelex.core.stuffs.stuff_factory import StuffFactory
from pipelex.core.stuffs.text_content import TextContent
from pipelex.interpreter_hub import get_pipe_library
+from pipelex.pipe_controllers.batch import pipe_batch as pipe_batch_module
from pipelex.pipe_controllers.batch.pipe_batch import PipeBatch
from pipelex.pipe_controllers.batch.pipe_batch_blueprint import PipeBatchBlueprint
from pipelex.pipe_controllers.condition.pipe_condition import PipeCondition
@@ -137,6 +139,47 @@ class TestPipeBatchCompaction:
texts = [item.text for item in cast("ListContent[TextContent]", list_content).items]
assert texts == ["GOOD MORNING", "GOOD NIGHT"]
+ async def test_a_dropped_branch_is_logged_at_debug_with_its_index_and_absence_reason(
+ self,
+ job_metadata: JobMetadata,
+ load_empty_library: Callable[[], str],
+ caplog: pytest.LogCaptureFixture,
+ ) -> None:
+ """The only account of why the list is shorter than its input: one DEBUG record per dropped branch, the reason as a field."""
+ load_empty_library()
+ batch = _build_compacting_batch()
+
+ items_stuff = StuffFactory.make_stuff(
+ concept=batch.inputs.get_required_stuff_spec("items").concept,
+ content=ListContent[TextContent](
+ items=[TextContent(text="good morning"), TextContent(text="bad day"), TextContent(text="good night")],
+ ),
+ name="items",
+ )
+ working_memory = WorkingMemoryFactory.make_from_single_stuff(items_stuff)
+
+ with caplog.at_level(logging.DEBUG, logger=pipe_batch_module.__name__):
+ await batch.run_pipe(
+ job_metadata=job_metadata,
+ working_memory=working_memory,
+ pipe_run_params=_make_live_run_params(),
+ )
+
+ dropped_records = [
+ record
+ for record in caplog.records
+ if record.name == pipe_batch_module.__name__ and record.getMessage() == "Dropped an absent batch branch result"
+ ]
+ assert len(dropped_records) == 1
+ dropped_record = dropped_records[0]
+ assert dropped_record.levelno == logging.DEBUG
+ record_fields = vars(dropped_record)
+ assert {name: record_fields.get(name) for name in ("pipe_code", "branch_index", "absence_reason")} == {
+ "pipe_code": "opt_batch_compact",
+ "branch_index": 1,
+ "absence_reason": "PipeCondition 'opt_batch_gate' resolved to its 'continue' outcome",
+ }
+
async def test_all_branches_absent_yields_empty_list(self, job_metadata: JobMetadata, load_empty_library: Callable[[], str]):
"""Every item rejected: the batch still delivers a real (empty) list output."""
load_empty_library()
diff --git a/tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py b/tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py
index e6d6b4beb..50e0afe92 100644
--- a/tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py
+++ b/tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py
@@ -10,7 +10,6 @@ the public ``gen_text`` and ``gen_object`` on a worker whose provider half recor
from __future__ import annotations
-import logging
from typing import TYPE_CHECKING
import pytest
@@ -34,19 +33,13 @@ from pipelex.cogt.usage.cost_category import CostCategory
from pipelex.system.job_metadata import JobMetadata, OtelContext, RunMetadata
from pipelex.system.telemetry.current_span import pipelex_span_context_for_logs
from pipelex.system.telemetry.telemetry_manager_abstract import TelemetryManagerAbstract
-from pipelex.tools.log.log_levels import LOGGING_LEVEL_VERBOSE
if TYPE_CHECKING:
- from collections.abc import Iterator
-
from opentelemetry.sdk.trace import ReadableSpan
from pytest_mock import MockerFixture
from pipelex.tools.typing.pydantic_utils import BaseModelTypeVar
-# The logger the worker's own span lines are written on.
-LLM_WORKER_LOGGER = LLMWorkerAbstract.__module__
-
RUN_TRACE_ID = 0x0123456789ABCDEF0123456789ABCDEF
PIPE_SPAN_ID = 0x00000000000000AB
@@ -83,19 +76,6 @@ class _RecordingLLMWorker(LLMWorkerAbstract):
return schema.model_validate({"text": "answer"})
-class _SpanRecordingHandler(logging.Handler):
- """Records each message with the Pipelex span id a sink would write for it under ``pipelex.span_id``, read at emit as a sink reads it."""
-
- def __init__(self) -> None:
- super().__init__(level=logging.NOTSET)
- self.span_ids_by_message: dict[str, int] = {}
-
- @override
- def emit(self, record: logging.LogRecord) -> None:
- span_context = pipelex_span_context_for_logs()
- self.span_ids_by_message[record.getMessage()] = INVALID_SPAN_ID if span_context is None else span_context.span_id
-
-
def _make_worker(*, fails: bool = False) -> _RecordingLLMWorker:
inference_model = InferenceModelSpec(
backend_name="openai",
@@ -149,19 +129,6 @@ def span_exporter(mocker: MockerFixture) -> InMemorySpanExporter:
return exporter
-def worker_lines(caplog: pytest.LogCaptureFixture) -> Iterator[_SpanRecordingHandler]:
- """The worker's own lines at VERBOSE, each with the span a sink would join it to."""
- caplog.set_level(LOGGING_LEVEL_VERBOSE, logger=LLM_WORKER_LOGGER)
- handler = _SpanRecordingHandler()
- logger = logging.getLogger(LLM_WORKER_LOGGER)
- logger.addHandler(handler)
- try:
- yield handler
- finally:
- logger.removeHandler(handler)
-
-
@pytest.mark.asyncio
class TestLLMWorkerCurrentSpan:
async def test_gen_text_runs_the_provider_call_under_its_span(self, span_exporter: InMemorySpanExporter) -> None:
@@ -212,20 +179,6 @@ class TestLLMWorkerCurrentSpan:
assert llm_span.status.status_code is StatusCode.ERROR
assert [event.name for event in llm_span.events] == ["exception"]
- async def test_the_span_started_line_names_the_span_it_announces(
- self, span_exporter: InMemorySpanExporter, worker_lines: _SpanRecordingHandler
- ) -> None:
- """The verbose line the worker logs once its span has started carries that span's id, not the one enclosing the call."""
- worker = _make_worker()
-
- await worker.gen_text(llm_job=_make_llm_job())
-
- llm_span_id = _span_id(_only_span(span_exporter))
- started = {message: span_id for message, span_id in worker_lines.span_ids_by_message.items() if message.startswith("[OTel] LLM SPAN STARTED")}
- assert list(started.values()) == [llm_span_id]
- (message,) = started
- assert f"\n span_id={llm_span_id:016x}\n" in message
-
async def test_a_no_op_tracer_holds_no_span_in_the_call(self, mocker: MockerFixture) -> None:
"""A no-op tracer, what the SDK hands out under ``OTEL_SDK_DISABLED``, gives back the parent it was handed, which is no span of the call's."""
mocker.patch.object(TelemetryManagerAbstract, "get_instance_tracer", return_value=trace.NoOpTracer())
diff --git a/tests/unit/pipelex/cogt/llm/test_llm_worker_reasoning_log.py b/tests/unit/pipelex/cogt/llm/test_llm_worker_reasoning_log.py
new file mode 100644
index 000000000..7f14224aa
--- /dev/null
+++ b/tests/unit/pipelex/cogt/llm/test_llm_worker_reasoning_log.py
@@ -0,0 +1,55 @@
+import pytest
+from pytest_mock import MockerFixture
+
+from pipelex.cogt.llm import llm_worker_abstract
+from pipelex.cogt.llm.llm_worker_abstract import LLMWorkerAbstract
+
+
+class TestLLMWorkerReasoningLog:
+ @pytest.mark.parametrize(
+ ("api_name", "settings", "expected_fields"),
+ [
+ ("OpenAI Responses", {"reasoning": {"effort": "high"}}, {"api_name": "OpenAI Responses", "reasoning": {"effort": "high"}}),
+ (
+ "Anthropic",
+ {"thinking": {"type": "adaptive"}, "output_config": {"effort": "high"}},
+ {"api_name": "Anthropic", "thinking": {"type": "adaptive"}, "output_config": {"effort": "high"}},
+ ),
+ (
+ "Anthropic",
+ {"thinking": {"type": "enabled", "budget_tokens": 2048}, "output_config": None},
+ {"api_name": "Anthropic", "thinking": {"type": "enabled", "budget_tokens": 2048}},
+ ),
+ ("Google", {"thinking_budget": 0}, {"api_name": "Google", "thinking_budget": 0}),
+ ],
+ )
+ def test_the_settings_sent_are_said_once_at_debug_as_fields(
+ self,
+ mocker: MockerFixture,
+ api_name: str,
+ settings: dict[str, object],
+ expected_fields: dict[str, object],
+ ) -> None:
+ """One fixed message; a setting the call does not send is left out, and a falsy value it does send, such as a zero budget, is kept."""
+ debug = mocker.patch.object(llm_worker_abstract.log, "debug")
+ verbose = mocker.patch.object(llm_worker_abstract.log, "verbose")
+
+ LLMWorkerAbstract._log_reasoning_sent(api_name=api_name, settings=settings) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
+
+ debug.assert_called_once_with("Sending reasoning settings", fields=expected_fields)
+ verbose.assert_not_called()
+
+ @pytest.mark.parametrize(
+ "settings",
+ [
+ {},
+ {"reasoning_effort": None},
+ {"thinking": None, "output_config": None},
+ ],
+ )
+ def test_a_call_sending_no_reasoning_setting_logs_nothing(self, mocker: MockerFixture, settings: dict[str, object]) -> None:
+ debug = mocker.patch.object(llm_worker_abstract.log, "debug")
+
+ LLMWorkerAbstract._log_reasoning_sent(api_name="Mistral", settings=settings) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
+
+ debug.assert_not_called()
diff --git a/tests/unit/pipelex/cogt/usage/test_cost_registry.py b/tests/unit/pipelex/cogt/usage/test_cost_registry.py
index 46fc83f67..3d2a7c7b4 100644
--- a/tests/unit/pipelex/cogt/usage/test_cost_registry.py
+++ b/tests/unit/pipelex/cogt/usage/test_cost_registry.py
@@ -287,7 +287,6 @@ class TestCostRegistry:
"""Test proper handling when no usage data."""
# Mock logging
mock_log_warning = mocker.patch("pipelex.cogt.usage.cost_registry.log.warning")
- mock_log_verbose = mocker.patch("pipelex.cogt.usage.cost_registry.log.verbose")
# Test with non-untitled pipeline
CostRegistry.generate_report(
@@ -298,14 +297,14 @@ class TestCostRegistry:
)
mock_log_warning.assert_called_once()
- # Test with untitled pipeline
+ # Test with untitled pipeline: nothing more is warned
CostRegistry.generate_report(
pipeline_run_id="untitled",
tokens_usages=[],
unit_scale=1.0,
cost_report_file_path=None,
)
- mock_log_verbose.assert_called_once()
+ mock_log_warning.assert_called_once()
def test_generate_report_with_file_output(self, job_metadata: JobMetadata, tmp_path: Path, mocker: MockerFixture):
"""Test that CSV file is created when file path is provided."""
diff --git a/tests/unit/pipelex/migration/test_dev_log_level_retirement.py b/tests/unit/pipelex/migration/test_dev_log_level_retirement.py
new file mode 100644
index 000000000..608da2032
--- /dev/null
+++ b/tests/unit/pipelex/migration/test_dev_log_level_retirement.py
@@ -0,0 +1,147 @@
+"""The entry that retires the `DEV` log level, exercised on the files it is about.
+
+`DEV` was an enumerated spelling of both `default_log_level` and every level under
+`[runtime.log.package_log_levels]`, whose keys are the user's own package names. The entry remaps it to
+`INFO` at both paths, the second through the `*` key a remap alone may take: a threshold at `DEV` passed
+`INFO` and above plus the `DEV` records, and nothing logs at `DEV` any more, so `INFO` passes the same
+records, where `DEBUG` would have turned on a third-party library's debug output the file had suppressed.
+It is `safe` because no current-valid file can carry the retired spelling. Being `safe`, it is also what a
+boot replays in memory over a file still naming `DEV`, so such a file boots at `INFO` with a
+stale-configuration warning rather than stopping the boot.
+"""
+
+import logging
+from pathlib import Path
+from typing import Any
+
+import pytest
+from pydantic import ValidationError
+from pytest_mock import MockerFixture
+
+from pipelex.migration.engine import replay_ledger_over_text
+from pipelex.migration.ledger import load_ledger, packaged_migration_dir
+from pipelex.system.configuration.config_loader import ConfigLoader
+from pipelex.system.configuration.config_surface import PIPELEX_CONFIG_SURFACE_ID
+from pipelex.system.configuration.configs import PipelexConfig
+from pipelex.tools.log.log_config import LogConfig
+from pipelex.tools.log.log_levels import LogLevel
+from pipelex.tools.misc.toml_utils import load_toml_from_content, load_toml_from_path
+
+ENTRY_ID = "pipelex-config@6"
+
+FILE_NAMING_DEV = """\
+[runtime.log]
+default_log_level = "DEV"
+
+[runtime.log.package_log_levels]
+pipelex = "DEV"
+openai = "DEV"
+my-package = "DEV"
+httpx = "WARNING"
+"""
+
+FILE_AT_THE_CURRENT_SHAPE = """\
+[runtime.log]
+default_log_level = "DEBUG"
+
+[runtime.log.package_log_levels]
+pipelex = "VERBOSE"
+"""
+
+
+def _base_log_section() -> dict[str, Any]:
+ base: dict[str, Any] = load_toml_from_path(ConfigLoader().pipelex_root_dir / "pipelex.toml")
+ log_section: dict[str, Any] = base["runtime"]["log"]
+ return log_section
+
+
+class TestTheDevLogLevelRetirement:
+ def test_dev_becomes_info_at_the_root_level_and_under_every_package_key(self) -> None:
+ ledger = load_ledger(migration_dir=packaged_migration_dir(), surface_id=PIPELEX_CONFIG_SURFACE_ID)
+ replay = replay_ledger_over_text(ledger=ledger, text=FILE_NAMING_DEV)
+
+ assert replay.blocked == []
+ assert [step.entry_id for step in replay.steps] == [ENTRY_ID]
+ migrated: dict[str, Any] = load_toml_from_content(replay.text)
+ assert migrated == {
+ "runtime": {
+ "log": {
+ "default_log_level": "INFO",
+ "package_log_levels": {"pipelex": "INFO", "openai": "INFO", "my-package": "INFO", "httpx": "WARNING"},
+ }
+ }
+ }
+
+ def test_the_migrated_file_is_accepted_by_the_current_model(self) -> None:
+ ledger = load_ledger(migration_dir=packaged_migration_dir(), surface_id=PIPELEX_CONFIG_SURFACE_ID)
+ replay = replay_ledger_over_text(ledger=ledger, text=FILE_NAMING_DEV)
+ migrated: dict[str, Any] = load_toml_from_content(replay.text)
+
+ log_config = LogConfig.model_validate({**_base_log_section(), **migrated["runtime"]["log"]})
+
+ assert log_config.default_log_level is LogLevel.INFO
+ assert log_config.package_log_levels["my-package"] is LogLevel.INFO
+
+ def test_a_third_party_dev_threshold_still_suppresses_debug_after_the_migration(self) -> None:
+ """`openai = "DEV"` kept the SDK's DEBUG request dumps, prompts included, out of the log; the migrated level must too."""
+ ledger = load_ledger(migration_dir=packaged_migration_dir(), surface_id=PIPELEX_CONFIG_SURFACE_ID)
+ replay = replay_ledger_over_text(ledger=ledger, text=FILE_NAMING_DEV)
+ migrated: dict[str, Any] = load_toml_from_content(replay.text)
+ log_config = LogConfig.model_validate({**_base_log_section(), **migrated["runtime"]["log"]})
+ openai_level = log_config.package_log_levels["openai"]
+ # A logger of this module's own, so the threshold is tried without touching the process's `openai` logger
+ third_party_logger = logging.getLogger(f"{__name__}.openai")
+ third_party_logger.setLevel(openai_level.int_logging_level)
+
+ assert openai_level.int_logging_level > logging.DEBUG
+ assert not third_party_logger.isEnabledFor(logging.DEBUG)
+ assert third_party_logger.isEnabledFor(logging.INFO)
+
+ def test_the_model_alone_refuses_dev_and_names_the_valid_levels(self) -> None:
+ """The refusal the boot's in-memory replay answers: validated without the ledger, `DEV` is no level."""
+ unmigrated: dict[str, Any] = load_toml_from_content(FILE_NAMING_DEV)
+
+ with pytest.raises(ValidationError) as exc_info:
+ LogConfig.model_validate({**_base_log_section(), **unmigrated["runtime"]["log"]})
+
+ message = str(exc_info.value)
+ assert "default_log_level" in message
+ for level in ("VERBOSE", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL", "OFF"):
+ assert level in message
+
+ def test_a_file_at_the_current_shape_hears_nothing(self) -> None:
+ ledger = load_ledger(migration_dir=packaged_migration_dir(), surface_id=PIPELEX_CONFIG_SURFACE_ID)
+ replay = replay_ledger_over_text(ledger=ledger, text=FILE_AT_THE_CURRENT_SHAPE)
+
+ assert replay.blocked == []
+ assert replay.steps == []
+ assert replay.text == FILE_AT_THE_CURRENT_SHAPE
+
+ @pytest.mark.usefixtures("no_pipelex_home")
+ def test_a_project_file_naming_dev_boots_at_info_with_a_warning(self, tmp_path: Path, mocker: MockerFixture) -> None:
+ """Through the boot's own loader: the file is migrated in memory, left as it is on disk, and the warning names the remedy."""
+ fake_home = tmp_path / "home"
+ (fake_home / ".pipelex").mkdir(parents=True)
+ project_root = tmp_path / "project"
+ (project_root / ".git").mkdir(parents=True)
+ project_dir = project_root / ".pipelex"
+ project_dir.mkdir()
+ project_file = project_dir / "pipelex.toml"
+ project_file.write_text(FILE_NAMING_DEV, encoding="utf-8")
+ mocker.patch.object(Path, "home", return_value=fake_home)
+ mocker.patch.object(Path, "cwd", return_value=project_root)
+ loader = ConfigLoader()
+
+ config = loader.load_config_validated(config_cls=PipelexConfig)
+
+ assert config.runtime.log.default_log_level is LogLevel.INFO
+ assert config.runtime.log.package_log_levels["pipelex"] is LogLevel.INFO
+ assert config.runtime.log.package_log_levels["openai"] is LogLevel.INFO
+ assert config.runtime.log.package_log_levels["my-package"] is LogLevel.INFO
+ assert config.runtime.log.package_log_levels["httpx"] is LogLevel.WARNING
+ assert project_file.read_text(encoding="utf-8") == FILE_NAMING_DEV, "a boot writes nothing"
+ parked = loader.take_stale_configuration_warning()
+ assert parked is not None
+ assert str(project_file) in parked
+ assert "Retire the DEV log level" in parked
+ assert "Run `pipelex migrate`" in parked
diff --git a/tests/unit/pipelex/pipe_machinery/test_live_run_pipe_current_span.py b/tests/unit/pipelex/pipe_machinery/test_live_run_pipe_current_span.py
index 00086e452..c38f46671 100644
--- a/tests/unit/pipelex/pipe_machinery/test_live_run_pipe_current_span.py
+++ b/tests/unit/pipelex/pipe_machinery/test_live_run_pipe_current_span.py
@@ -46,7 +46,6 @@ from pipelex.system.telemetry.telemetry_manager_abstract import TelemetryManager
from pipelex.tools.log.json_log_sink import LOGGER_KEY, MESSAGE_KEY, SPAN_ID_KEY, TRACE_ID_KEY, JsonLogSink
from pipelex.tools.log.log import Log
from pipelex.tools.log.log_config import LogConfig
-from pipelex.tools.log.log_levels import LOGGING_LEVEL_VERBOSE
from pipelex.tools.log.otlp_log_sink import OtlpLogSink
from pipelex.tools.misc.toml_utils import load_toml_from_path
from pipelex.tools.typing.pydantic_utils import empty_list_factory_of
@@ -60,9 +59,6 @@ if TYPE_CHECKING:
from pipelex.core.memory.working_memory import WorkingMemory
from pipelex.libraries.library_crate import LibraryCrate
-# The logger the pipe's own span lines are written on.
-PIPE_ABSTRACT_LOGGER = PipeAbstract.__module__
-
# The trace the submission derived for the run, and the virtual root parent every root pipe span takes.
RUN_TRACE_ID = 0x0123456789ABCDEF0123456789ABCDEF
RUN_OTEL_CONTEXT = OtelContext(
@@ -337,25 +333,6 @@ class TestLiveRunPipeCurrentSpan:
pipelex_span_id=_hex_span_id(pipe_span),
)
- async def test_a_span_started_line_names_the_span_it_announces(
- self, sunk: Sunk, span_exporter: InMemorySpanExporter, caplog: pytest.LogCaptureFixture
- ) -> None:
- """The verbose line a pipe logs once its span has started carries that span's ids, not the enclosing pipe's or none."""
- caplog.set_level(LOGGING_LEVEL_VERBOSE, logger=PIPE_ABSTRACT_LOGGER)
- outer = _make_pipe(code="outer", nested=_make_pipe(code="inner"))
-
- await _run(outer)
-
- spans = span_exporter.get_finished_spans()
- started = {
- message: line for message, line in sunk.read_lines_of(PIPE_ABSTRACT_LOGGER).items() if message.startswith("[OTel] PIPE SPAN STARTED")
- }
- assert sorted(line.pipelex_span_id or "" for line in started.values()) == sorted(
- _hex_span_id(_span_named(spans, code=code)) for code in ("outer", "inner")
- )
- for message, line in started.items():
- assert f"\n span_id={line.pipelex_span_id}\n" in message
-
async def test_a_nested_pipe_holds_its_own_span_and_the_outer_one_comes_back(self, sunk: Sunk, span_exporter: InMemorySpanExporter) -> None:
outer = _make_pipe(code="outer", nested=_make_pipe(code="inner"))
diff --git a/tests/unit/pipelex/pipe_run/test_delivery_executor.py b/tests/unit/pipelex/pipe_run/test_delivery_executor.py
index f50890eeb..efcae7041 100644
--- a/tests/unit/pipelex/pipe_run/test_delivery_executor.py
+++ b/tests/unit/pipelex/pipe_run/test_delivery_executor.py
@@ -112,6 +112,34 @@ class TestDeliveryExecutor:
assert any("tenant/plr-123/results/main_stuff.html" in key for key in stored_keys)
assert any("tenant/plr-123/results/tokens_usages.json" in key for key in stored_keys)
+ async def test_each_stored_file_is_logged_at_debug_by_its_key(self, mocker: MockerFixture) -> None:
+ """A user's log says which result files were written before a failure, one line per key."""
+ from pipelex import log as pipelex_log # ruff: ignore[import-outside-top-level]
+
+ debug_spy = mocker.spy(pipelex_log, "debug")
+ mock_storage = mocker.AsyncMock()
+ mock_storage.store = mocker.AsyncMock(return_value="pipelex-storage://test-key")
+ mocker.patch("pipelex.pipe_run.delivery_executor.get_storage_provider", return_value=mock_storage)
+
+ mock_output = _make_output_mock(mocker)
+ mock_output.working_memory_raw = None
+ mock_output.working_memory.smart_dump.return_value = {"root": {}, "aliases": {}}
+ mock_output.working_memory.resolve_main_stuff.return_value = _make_main_stuff()
+ mock_output.graph_spec = None
+
+ await DeliveryExecutor().execute(
+ pipe_output=mock_output,
+ storage_scope="tenant/plr-123",
+ pipeline_run_id="plr-123",
+ delivery_assignment=DeliveryAssignment(storage=StorageTarget()),
+ status=DeliveryStatus.COMPLETED,
+ )
+
+ stored_keys = [call.kwargs["key"] for call in mock_storage.store.call_args_list]
+ logged_keys = [call.kwargs["fields"]["storage_key"] for call in debug_spy.call_args_list if call.args[0] == "Stored a delivery result file"]
+ assert stored_keys
+ assert logged_keys == stored_keys
+
async def test_key_prefix_inserts_a_level_and_never_supplies_the_leaf(self, mocker: MockerFixture) -> None:
"""`results/` is the RUNTIME's leaf; `key_prefix` sits before it, never instead of it.
diff --git a/tests/unit/pipelex/pipe_run/test_pipe_run.py b/tests/unit/pipelex/pipe_run/test_pipe_run.py
index defe6234c..8a86e0647 100644
--- a/tests/unit/pipelex/pipe_run/test_pipe_run.py
+++ b/tests/unit/pipelex/pipe_run/test_pipe_run.py
@@ -1,7 +1,12 @@
+import logging
+from contextlib import AbstractContextManager, nullcontext
+from typing import Any
+
import pytest
from pytest_mock import MockerFixture
-from pipelex.pipe_run.delivery_assignment import DeliveryAssignment, StorageTarget
+from pipelex.pipe_run import pipe_run as pipe_run_module
+from pipelex.pipe_run.delivery_assignment import DeliveryAssignment, DeliveryStatus, StorageTarget
from pipelex.pipe_run.exceptions import PipeRouterError, WebhookDeliveryError
from pipelex.pipe_run.pipe_run import PipeRun
from pipelex.system.job_metadata import JobMetadata, RunMetadata
@@ -78,6 +83,44 @@ class TestPipeRun:
call_kwargs = mock_executor_instance.execute.call_args.kwargs
assert call_kwargs["request_id"] == "req-direct-mode"
+ @pytest.mark.parametrize(
+ ("router_error", "expected_status"),
+ [
+ (None, DeliveryStatus.COMPLETED),
+ (RuntimeError("router blew up"), DeliveryStatus.FAILED),
+ ],
+ )
+ async def test_the_delivery_is_logged_at_debug_with_its_status(
+ self,
+ mocker: MockerFixture,
+ caplog: pytest.LogCaptureFixture,
+ router_error: Exception | None,
+ expected_status: DeliveryStatus,
+ ) -> None:
+ """A user's log says whether delivery ran and for which outcome; the run context stamps the run id."""
+ mock_router = mocker.AsyncMock()
+ mock_router.run = mocker.AsyncMock(return_value=mocker.MagicMock(), side_effect=router_error)
+ mock_executor = mocker.patch("pipelex.pipe_run.pipe_run.DeliveryExecutor")
+ mock_executor.return_value.execute = mocker.AsyncMock()
+ mock_job = mocker.MagicMock()
+ mock_job.job_metadata = JobMetadata(
+ run_metadata=RunMetadata(user_id="pytest", pipeline_run_id="plr-delivery-log", storage_scope="test/scope", read_scope=None)
+ )
+
+ expectation: AbstractContextManager[Any] = pytest.raises(RuntimeError, match="router blew up") if router_error is not None else nullcontext()
+ with expectation, caplog.at_level(logging.DEBUG, logger=pipe_run_module.__name__):
+ await PipeRun(pipe_router=mock_router).run(pipe_job=mock_job, delivery_assignment=DeliveryAssignment(storage=StorageTarget()))
+
+ delivery_records = [
+ record for record in caplog.records if record.name == pipe_run_module.__name__ and record.getMessage() == "Executing the delivery"
+ ]
+ assert len(delivery_records) == 1
+ delivery_record = delivery_records[0]
+ assert delivery_record.levelno == logging.DEBUG
+ record_fields = vars(delivery_record)
+ assert record_fields.get("delivery_status") == expected_status
+ assert record_fields.get("pipeline_run_id") == "plr-delivery-log"
+
async def test_run_success_no_delivery_when_none(self, mocker: MockerFixture) -> None:
"""When delivery_assignment is None, the delivery executor is not called."""
mock_output = mocker.MagicMock()
diff --git a/tests/unit/pipelex/providers/google/test_google_llm_worker_structured_thinking.py b/tests/unit/pipelex/providers/google/test_google_llm_worker_structured_thinking.py
index 45dd6c611..466c847f9 100644
--- a/tests/unit/pipelex/providers/google/test_google_llm_worker_structured_thinking.py
+++ b/tests/unit/pipelex/providers/google/test_google_llm_worker_structured_thinking.py
@@ -16,6 +16,7 @@ if TYPE_CHECKING:
from pipelex.cogt.llm.structured_output import StructureMethod
from pipelex.cogt.exceptions import LLMCapabilityError
+from pipelex.cogt.llm import llm_worker_abstract
from pipelex.cogt.llm.llm_job_components import ReasoningEffort
from pipelex.cogt.llm.thinking_mode import ThinkingMode
from tests.helpers.google_structured_request import GENAI_STRUCTURE_METHODS, make_structured_worker
@@ -79,6 +80,22 @@ class TestGoogleLLMWorkerStructuredThinking:
assert captured["config"].thinking_config == genai_types.ThinkingConfig(thinking_level=genai_types.ThinkingLevel.HIGH)
+ async def test_an_adaptive_thinking_level_is_logged_as_its_wire_value(self, mocker: MockerFixture, structure_method: StructureMethod) -> None:
+ """The log carries `HIGH`, the string the request sends, not the SDK's `ThinkingLevel` member."""
+ captured: dict[str, Any] = {}
+ worker = make_structured_worker(mocker, structure_method=structure_method, captured=captured, thinking_mode=ThinkingMode.ADAPTIVE)
+ llm_job = make_llm_job(mocker)
+ llm_job.job_params.reasoning_effort = ReasoningEffort.HIGH
+ debug = mocker.patch.object(llm_worker_abstract.log, "debug")
+
+ await worker._gen_object(llm_job=llm_job, schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
+
+ reasoning_calls = [call for call in debug.call_args_list if call.args == ("Sending reasoning settings",)]
+ assert len(reasoning_calls) == 1
+ logged_fields = reasoning_calls[0].kwargs["fields"]
+ assert logged_fields == {"api_name": "Google", "thinking_level": "HIGH"}
+ assert type(logged_fields["thinking_level"]) is str
+
async def test_without_a_reasoning_setting_no_thinking_config_is_sent(self, mocker: MockerFixture, structure_method: StructureMethod) -> None:
captured: dict[str, Any] = {}
worker = make_structured_worker(mocker, structure_method=structure_method, captured=captured, thinking_mode=ThinkingMode.MANUAL)
diff --git a/tests/unit/pipelex/providers/google/test_google_llm_worker_text_request.py b/tests/unit/pipelex/providers/google/test_google_llm_worker_text_request.py
index dbd18167f..a7bd1cd68 100644
--- a/tests/unit/pipelex/providers/google/test_google_llm_worker_text_request.py
+++ b/tests/unit/pipelex/providers/google/test_google_llm_worker_text_request.py
@@ -1,4 +1,4 @@
-"""The temperature the Google LLM worker's text call sends.
+"""The temperature the Google LLM worker's text call sends, and the reasoning settings it says it sends.
Gemini keeps a temperature beside thinking, so one is sent unless the model lists `temperature_unsupported`,
whose provider refuses one.
@@ -11,7 +11,10 @@ from typing import TYPE_CHECKING, Any
import pytest
from google.genai import types as genai_types
+from pipelex.cogt.llm import llm_worker_abstract
+from pipelex.cogt.llm.llm_job_components import ReasoningEffort
from pipelex.cogt.llm.structured_output import StructureMethod
+from pipelex.cogt.llm.thinking_mode import ThinkingMode
from tests.helpers.google_structured_request import make_structured_worker
from tests.helpers.instructor_test_utils import make_llm_job
@@ -41,3 +44,22 @@ class TestGoogleLLMWorkerTextRequest:
await worker._gen_text(llm_job=make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert captured["config"].temperature is None
+
+ async def test_an_adaptive_thinking_level_is_logged_as_its_wire_value(self, mocker: MockerFixture) -> None:
+ """The log carries `HIGH`, the string the request sends, not the SDK's `ThinkingLevel` member."""
+ captured: dict[str, Any] = {}
+ worker = make_structured_worker(
+ mocker, structure_method=StructureMethod.INSTRUCTOR_GENAI_STRUCTURED_OUTPUTS, captured=captured, thinking_mode=ThinkingMode.ADAPTIVE
+ )
+ llm_job = make_llm_job(mocker)
+ llm_job.job_params.reasoning_effort = ReasoningEffort.HIGH
+ debug = mocker.patch.object(llm_worker_abstract.log, "debug")
+
+ await worker._gen_text(llm_job=llm_job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
+
+ assert captured["config"].thinking_config == genai_types.ThinkingConfig(thinking_level=genai_types.ThinkingLevel.HIGH)
+ reasoning_calls = [call for call in debug.call_args_list if call.args == ("Sending reasoning settings",)]
+ assert len(reasoning_calls) == 1
+ logged_fields = reasoning_calls[0].kwargs["fields"]
+ assert logged_fields == {"api_name": "Google", "thinking_level": "HIGH"}
+ assert type(logged_fields["thinking_level"]) is str
diff --git a/tests/unit/pipelex/tools/misc/test_filetype_utils.py b/tests/unit/pipelex/tools/misc/test_filetype_utils.py
index 54ada9e70..ca5e42347 100644
--- a/tests/unit/pipelex/tools/misc/test_filetype_utils.py
+++ b/tests/unit/pipelex/tools/misc/test_filetype_utils.py
@@ -193,6 +193,16 @@ class TestDetectFileTypeFromBase64:
with pytest.raises(FileTypeError, match="Could not identify file type of given bytes because input is not valid base64"):
detect_file_type_from_base64(invalid_b64_bytes)
+ def test_detect_file_type_from_base64_error_names_the_length_and_none_of_the_content(self) -> None:
+ payload = "SECRETPAYLOAD!" * 10
+
+ with pytest.raises(FileTypeError) as exc_info:
+ detect_file_type_from_base64(payload)
+
+ message = str(exc_info.value)
+ assert f"({len(payload)} bytes)" in message
+ assert "SECRETPAYLOAD" not in message
+
def test_detect_file_type_from_base64_data_url_no_comma(self, mocker: MockerFixture):
# Test data URL without comma (should be treated as regular base64)
mocker.patch(
diff --git a/tests/unit/pipelex/tools/misc/test_tenacity_utils.py b/tests/unit/pipelex/tools/misc/test_tenacity_utils.py
new file mode 100644
index 000000000..93611bb04
--- /dev/null
+++ b/tests/unit/pipelex/tools/misc/test_tenacity_utils.py
@@ -0,0 +1,80 @@
+from collections.abc import Callable
+from typing import Any
+
+import pytest
+from pytest_mock import MockerFixture
+from tenacity import Retrying, retry_base, retry_if_exception_type, retry_if_result, stop_after_attempt, wait_fixed
+
+from pipelex.tools.misc import tenacity_utils
+from pipelex.tools.misc.tenacity_utils import log_retry
+
+WAIT_SECONDS = 1.5
+
+
+def _fail_once_with_value_error() -> Callable[[], str | None]:
+ calls: list[int] = []
+
+ def attempt() -> str | None:
+ calls.append(1)
+ if len(calls) == 1:
+ msg = "first attempt fails"
+ raise ValueError(msg)
+ return "done"
+
+ return attempt
+
+
+def _return_none_once() -> Callable[[], str | None]:
+ calls: list[int] = []
+
+ def attempt() -> str | None:
+ calls.append(1)
+ if len(calls) == 1:
+ return None
+ return "done"
+
+ return attempt
+
+
+class TestLogRetry:
+ @pytest.mark.parametrize(
+ ("topic", "make_attempt", "retry_condition", "expected_fields"),
+ [
+ (
+ "retry on an exception",
+ _fail_once_with_value_error,
+ retry_if_exception_type(ValueError),
+ {"attempt_number": 1, "wait_seconds": WAIT_SECONDS, "exception_type": "ValueError"},
+ ),
+ (
+ "retry on a result",
+ _return_none_once,
+ retry_if_result(lambda result: result is None),
+ {"attempt_number": 1, "wait_seconds": WAIT_SECONDS},
+ ),
+ ],
+ )
+ def test_a_retry_is_logged_at_debug_by_its_outcome_with_its_values_as_fields(
+ self,
+ mocker: MockerFixture,
+ topic: str,
+ make_attempt: Callable[[], Callable[[], str | None]],
+ retry_condition: retry_base,
+ expected_fields: dict[str, Any],
+ ) -> None:
+ """One fixed message per retry, true of a retry on a result as of one on an exception.
+
+ The attempt and the wait ride as fields, and the exception's class only when the attempt raised.
+ """
+ debug = mocker.patch.object(tenacity_utils.log, "debug")
+ retrying = Retrying(
+ retry=retry_condition,
+ wait=wait_fixed(WAIT_SECONDS),
+ stop=stop_after_attempt(2),
+ before_sleep=log_retry,
+ sleep=lambda _seconds: None,
+ reraise=True,
+ )
+
+ assert retrying(make_attempt()) == "done", topic
+ debug.assert_called_once_with("Retrying", fields=expected_fields)
diff --git a/tests/unit/pipelex/tools/test_func_registry.py b/tests/unit/pipelex/tools/test_func_registry.py
index fabe5be8d..dc352ae07 100644
--- a/tests/unit/pipelex/tools/test_func_registry.py
+++ b/tests/unit/pipelex/tools/test_func_registry.py
@@ -1,9 +1,7 @@
-import logging
from collections.abc import Callable
from typing import Any
import pytest
-from pytest import LogCaptureFixture
from pipelex.core.memory.working_memory import WorkingMemory
from pipelex.core.stuffs.text_content import TextContent
@@ -196,16 +194,3 @@ class TestFuncRegistry:
registry.root["not_a_function"] = "a string" # type: ignore[assignment]
with pytest.raises(FuncRegistryError, match="is not a callable function"):
registry.get_required_function_with_signature("not_a_function")
-
- def test_set_logger(self, registry: FuncRegistry, caplog: LogCaptureFixture):
- """Test setting a custom logger"""
- custom_logger = logging.getLogger("custom_test_logger")
- registry.set_logger(custom_logger)
-
- # Test that the custom logger is being used by triggering a log message
- with caplog.at_level("DEBUG", logger="custom_test_logger"):
- registry.register_function(valid_function)
-
- # Verify the log message was captured by our custom logger
- assert len(caplog.records) > 0
- assert any("Registered new single function" in record.message for record in caplog.records)
diff --git a/tests/unit/pipelex/tools/test_log_before_configure.py b/tests/unit/pipelex/tools/test_log_before_configure.py
index 53d6081f5..7bd9eb3cb 100644
--- a/tests/unit/pipelex/tools/test_log_before_configure.py
+++ b/tests/unit/pipelex/tools/test_log_before_configure.py
@@ -31,7 +31,6 @@ class TestLogBeforeConfigure:
with caplog.at_level(LOGGING_LEVEL_VERBOSE):
fresh.verbose("verbose")
fresh.debug("debug")
- fresh.dev("dev")
fresh.info("info", fields={"files": 1})
fresh.warning("warning", problem_id="some_problem")
try:
@@ -45,12 +44,12 @@ class TestLogBeforeConfigure:
assert logging.getLogger().handlers == root_handlers_before
records = _own_records(caplog)
messages = [record.getMessage() for record in records]
- assert messages[:5] == ["verbose", "debug", "dev", "info", "warning"]
- assert messages[5] == "error"
- assert records[5].exc_info is not None
- assert records[5].exc_info[0] is ValueError
- assert messages[6] == "critical"
- assert messages[7].startswith("Data:")
+ assert messages[:4] == ["verbose", "debug", "info", "warning"]
+ assert messages[4] == "error"
+ assert records[4].exc_info is not None
+ assert records[4].exc_info[0] is ValueError
+ assert messages[5] == "critical"
+ assert messages[6].startswith("Data:")
assert all(record.name == __name__ for record in _own_records(caplog))
def test_a_cold_process_routes_to_the_stdlib_default_handling(self) -> None:
diff --git a/tests/unit/pipelex/tools/test_log_caller_module.py b/tests/unit/pipelex/tools/test_log_caller_module.py
index 0e5f84186..c00732c9b 100644
--- a/tests/unit/pipelex/tools/test_log_caller_module.py
+++ b/tests/unit/pipelex/tools/test_log_caller_module.py
@@ -70,7 +70,6 @@ class TestLoggerNames:
with caplog.at_level(LOGGING_LEVEL_VERBOSE):
log.verbose("verbose")
log.debug("debug")
- log.dev("dev")
log.info("info")
log.warning("warning")
log.error("error")
@@ -78,5 +77,5 @@ class TestLoggerNames:
log.info({"structured": True})
messages = [record.getMessage() for record in _own_records(caplog, name=__name__)]
- assert messages[:7] == ["verbose", "debug", "dev", "info", "warning", "error", "critical"]
- assert len(messages) == 8
+ assert messages[:6] == ["verbose", "debug", "info", "warning", "error", "critical"]
+ assert len(messages) == 7
diff --git a/tests/unit/pipelex/tools/test_log_fields.py b/tests/unit/pipelex/tools/test_log_fields.py
index f2ec57212..d258574f3 100644
--- a/tests/unit/pipelex/tools/test_log_fields.py
+++ b/tests/unit/pipelex/tools/test_log_fields.py
@@ -83,7 +83,6 @@ class TestLogFields:
[
(LOGGING_LEVEL_VERBOSE, "verbose"),
(logging.DEBUG, "debug"),
- (15, "dev"),
(logging.INFO, "info"),
(logging.WARNING, "warning"),
(logging.ERROR, "error"),
diff --git a/tests/unit/pipelex/tools/test_log_gcp_client_library_contract.py b/tests/unit/pipelex/tools/test_log_gcp_client_library_contract.py
index 5b86b7cad..69fddb645 100644
--- a/tests/unit/pipelex/tools/test_log_gcp_client_library_contract.py
+++ b/tests/unit/pipelex/tools/test_log_gcp_client_library_contract.py
@@ -2,7 +2,7 @@
The sink declares the transport's shape rather than importing it, it computes the severity itself
rather than letting the library derive one from the level, because the library's own normalization has
-no spelling for our ``VERBOSE`` and ``DEV``, and it rejects the library's own export path by the logger
+no spelling for our ``VERBOSE``, and it rejects the library's own export path by the logger
names and the thread name the library chooses. Every one of those is an assumption about a third party
whose change would break a production sink silently and no other test would see: a renamed worker
thread or a renamed transport logger would let a refused batch be reported through the pipeline that
diff --git a/tests/unit/pipelex/tools/test_log_gcp_sink.py b/tests/unit/pipelex/tools/test_log_gcp_sink.py
index 81baae174..6d8ebb154 100644
--- a/tests/unit/pipelex/tools/test_log_gcp_sink.py
+++ b/tests/unit/pipelex/tools/test_log_gcp_sink.py
@@ -385,7 +385,6 @@ class TestGcpLogSink:
[
("verbose", GcpLogSeverity.DEBUG),
("debug", GcpLogSeverity.DEBUG),
- ("dev", GcpLogSeverity.DEBUG),
("info", GcpLogSeverity.INFO),
("warning", GcpLogSeverity.WARNING),
("error", GcpLogSeverity.ERROR),
diff --git a/tests/unit/pipelex/tools/test_log_gcp_sink_mapping.py b/tests/unit/pipelex/tools/test_log_gcp_sink_mapping.py
index cef2f7c4e..91fb3b00c 100644
--- a/tests/unit/pipelex/tools/test_log_gcp_sink_mapping.py
+++ b/tests/unit/pipelex/tools/test_log_gcp_sink_mapping.py
@@ -10,12 +10,13 @@ from __future__ import annotations
import logging
from pipelex.tools.log.gcp_log_sink import GcpLogSeverity, severity_for_level, trace_name
+from pipelex.tools.log.log_levels import LOGGING_LEVEL_VERBOSE
class TestGcpLogSinkMapping:
- def test_the_two_custom_levels_land_on_debug(self) -> None:
- assert severity_for_level(levelno=5) is GcpLogSeverity.DEBUG
- assert severity_for_level(levelno=15) is GcpLogSeverity.DEBUG
+ def test_every_level_below_info_lands_on_debug(self) -> None:
+ assert severity_for_level(levelno=LOGGING_LEVEL_VERBOSE) is GcpLogSeverity.DEBUG
+ assert severity_for_level(levelno=logging.DEBUG + 5) is GcpLogSeverity.DEBUG
def test_a_level_above_critical_still_maps_to_critical(self) -> None:
assert severity_for_level(levelno=logging.CRITICAL + 10) is GcpLogSeverity.CRITICAL
diff --git a/tests/unit/pipelex/tools/test_log_levels.py b/tests/unit/pipelex/tools/test_log_levels.py
index 9c5bdc415..4d601e45d 100644
--- a/tests/unit/pipelex/tools/test_log_levels.py
+++ b/tests/unit/pipelex/tools/test_log_levels.py
@@ -1,9 +1,10 @@
import logging
import pytest
+from pytest_mock import MockerFixture
+from pipelex.tools.log.log import Log
from pipelex.tools.log.log_levels import (
- LOGGING_LEVEL_DEV,
LOGGING_LEVEL_OFF,
LOGGING_LEVEL_VERBOSE,
LogLevel,
@@ -16,7 +17,6 @@ class TestLogLevels:
[
(LogLevel.VERBOSE, LOGGING_LEVEL_VERBOSE),
(LogLevel.DEBUG, logging.DEBUG),
- (LogLevel.DEV, LOGGING_LEVEL_DEV),
(LogLevel.INFO, logging.INFO),
(LogLevel.WARNING, logging.WARNING),
(LogLevel.ERROR, logging.ERROR),
@@ -28,15 +28,23 @@ class TestLogLevels:
assert log_level.int_logging_level == expected_int_level
@pytest.mark.parametrize(
- ("raw_level", "expected_enum"),
+ ("level_name", "expected_int_level"),
[
- (LOGGING_LEVEL_VERBOSE, LogLevel.VERBOSE),
- (LOGGING_LEVEL_DEV, LogLevel.DEV),
- (LOGGING_LEVEL_OFF, LogLevel.OFF),
- (logging.CRITICAL + 1, LogLevel.OFF),
- (logging.DEBUG, LogLevel.DEBUG),
- (logging.INFO, LogLevel.INFO),
+ ("verbose", LOGGING_LEVEL_VERBOSE),
+ ("DEBUG", logging.DEBUG),
+ ("Off", LOGGING_LEVEL_OFF),
],
)
- def test_from_int_converts_to_enum(self, raw_level: int, expected_enum: LogLevel) -> None:
- assert LogLevel.from_int(logging_level=raw_level) == expected_enum
+ def test_set_level_by_name_takes_a_member_name_in_any_case(self, mocker: MockerFixture, level_name: str, expected_int_level: int) -> None:
+ fresh = Log()
+ set_level_by_int = mocker.patch.object(fresh, "set_level_by_int")
+
+ fresh.set_level_by_name(level_name)
+
+ set_level_by_int.assert_called_once_with(level_int=expected_int_level)
+
+ @pytest.mark.parametrize("level_name", ["DEV", "WARN", "FATAL", "NOTSET"])
+ def test_set_level_by_name_refuses_a_name_that_is_no_level(self, level_name: str) -> None:
+ """The retired `DEV` and the stdlib-only spellings alike: only a `LogLevel` name is a level here."""
+ with pytest.raises(ValueError, match=level_name):
+ Log().set_level_by_name(level_name)
diff --git a/tests/unit/pipelex/tools/test_log_otlp_sink.py b/tests/unit/pipelex/tools/test_log_otlp_sink.py
index 4fde2d3db..1b13ad3fe 100644
--- a/tests/unit/pipelex/tools/test_log_otlp_sink.py
+++ b/tests/unit/pipelex/tools/test_log_otlp_sink.py
@@ -197,7 +197,6 @@ class TestOtlpLogSink:
[
("verbose", "VERBOSE", SeverityNumber.TRACE),
("debug", "DEBUG", SeverityNumber.DEBUG),
- ("dev", "DEV", SeverityNumber.DEBUG4),
("info", "INFO", SeverityNumber.INFO),
("warning", "WARN", SeverityNumber.WARN),
("error", "ERROR", SeverityNumber.ERROR),