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/Left-cut-path-fields · L-261010-c72f69 (#1397)
Louis Choquel82bd3096ea04
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0200a7655..fb642f362 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,7 +4,7 @@### Added-- **The console shows a log call's fields and renders named layouts**: the `console` sink prints a record's fields after its message as a `key=value` suffix, `Scanned the inputs files=7`, each value on one line and cut short past 80 characters, a string or the JSON of a list or a mapping before it is quoted so a quoted value keeps both its quotes and a cut one leaves no unbalanced quote or bracket, a path at its start so the file's name stays, a handled exception's `error.message` and a PipeDocGen template finding's text only past 2000, leaving out the run identifiers, and colours a value by its field's name, a pipe code red and a concept bold green, with any other field dimmed. A call can name a console layout with `layout=`, a Rich template over its fields in which every value is escaped, starting with `LogLayout.PIPE_RUN` for the pipe-run tree; every other sink writes the plain message and the fields.+- **The console shows a log call's fields and renders named layouts**: the `console` sink prints a record's fields after its message as a `key=value` suffix, `Scanned the inputs files=7`, each value on one line and cut short past 80 characters, a string or the JSON of a list or a mapping before it is quoted so a quoted value keeps both its quotes and a cut one leaves no unbalanced quote or bracket, a path or a list of paths (a field named `file.path` or ending in `_path`, `_paths`, `_dir`, `_dirs`, `_file` or `_files`) at its start so the last file's name stays, a handled exception's `error.message` and a PipeDocGen template finding's text only past 2000, leaving out the run identifiers, and colours a value by its field's name, a pipe code red and a concept bold green, with any other field dimmed. A call can name a console layout with `layout=`, a Rich template over its fields in which every value is escaped, starting with `LogLayout.PIPE_RUN` for the pipe-run tree; every other sink writes the plain message and the fields.- **Log-call conventions and their guard**: the logging documentation states how Pipelex's own log calls are written, a fixed message with its values in `fields` named from a shared vocabulary, an exception carried by the record rather than spliced into the text, no run identifier, payload, markup or emoji, and what each level promises. `make check-log-calls` (`pipelex-dev check-log-calls`), part of `make agent-check` and CI, refuses an interpolated or non-literal message at `INFO` and above and a Rich markup tag in a message at any level, against a committed baseline of the existing calls that only shrinks: `--against <ref>` and `--against-merge-base <ref>` refuse an entry the baseline at the base revision does not list, which CI runs against a pull request's base and `make` against the merge base with `origin/dev`. `pipelex.tools.log.error_fields` gives a handled exception's class and text as the `error.type` and `error.message` fields of a line that carries no traceback, a pydantic `ValidationError`'s text as its locations and reasons without the values it refused or the name of a key the model forbids, and any message that may quote the input, a custom validator's or one of pydantic's own templates', such as an unknown discriminator tag, as its error type alone.- **Summary events for inference calls and pipe runs**: every inference call, an LLM call, an image generation, an extraction, a search, a judgment or a document print, a call its checks refuse included, ends with one `INFO` event, `Inference call ends`, carrying the operation under `gen_ai.operation.name`, the model under `model_handle`, `backend_name`, `sdk`, `gen_ai.request.model` and `gen_ai.response.model`, the tokens under `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens` and the price under `cost_usd` where the call recorded them, `duration_ms`, and `outcome`, `success`, `error` with `error.type`, or `cancelled` for work stopped from outside, logged by the worker bases so every provider's and plugin's worker gets it. Every live pipe run ends with `Pipe run ends`, logged as the pipe's own span closes and carrying its ids, with the announcement's fields, `duration_ms`, `outcome` and `error.type`, so a run's `json` output alone gives latency and cost per operation and model; an event that cannot be built is replaced by the warning `A summary event could not be logged` and never changes the work's outcome. The console draws each on one line through `LogLayout.INFERENCE_CALL_END` and `LogLayout.PIPE_RUN_END`; a document engine overrides `render` alone, and the print stage that calls it logs the event.- **Request- and page-priced usage**: a usage says what its counts are in `pricing_unit` (`PricingUnit` in `pipelex.cogt.usage.pricing_unit`), `token`, `request` or `page`, and a worker billed by the request or by the page records it with `record_unit_priced_usage` (`pipelex.cogt.usage.usage_cost`), as the Linkup workers and the extraction page fallback now do, so the summary event carries the call's cost and no token counts.diff --git a/docs/tools/logging.md b/docs/tools/logging.mdindex 04c9d8ae7..3fe2fb582 100644--- a/docs/tools/logging.md+++ b/docs/tools/logging.md@@ -243,7 +243,7 @@ INFO 🧠: Scanned the inputs file_count=7 source=inbox/march```- **What is shown.** The fields the call attached, in the order it gave them, under the name each landed on (`field_name` for a field called `name`). The run identifiers (`request_id`, `pipeline_run_id`, `pipe_run_id`) are left out, since they are the same on every line of a run and would drown the message, and so is `data`, the structured content the message already renders. Nothing else on the record is shown: neither the stdlib's own attributes, nor Pipelex's marks, nor what a record factory or a third-party library stamped on it.-- **How a value is written.** On one line: a string as itself, a number, a boolean, `None`, a mapping, a list or a pydantic model as compact JSON, and anything else as its text. That text is written bare, or quoted when it is empty or holds a space, an `=`, a `"`, a `\` or a character a terminal would act on. Inside the quotes a backslash is written `\\`, a quote `\"` and any character a terminal would act on as its escape (`"line\nbreak"`), so `fields={"a": "b=c"}` prints `a="b=c"` rather than a second pair. A number, a boolean and `None` print bare (`7`, `true`, `null`), and so does a list of numbers (`[1,2]`), while a JSON rendering holding a string holds a quote and is quoted like a string: `["a","b"]` prints `"[\"a\",\"b\"]"`. A value longer than 80 characters is cut short and ends with `…`, its text, a string's or a JSON rendering's, being cut before it is quoted and escaped, so a quoted value keeps both its quotes, no escape is split, and no unbalanced quote or bracket is left whose tail could read as a pair of its own, except `error.message`, a handled exception's text, which is cut only past 2000 characters, quoted and escaped the same way: its diagnosis, a cause chain or a parse error's location, is what a fragment would lose, while a dependency's raw output, a validation error's every line or git's stderr, would flood the terminal uncut. `finding_message`, the text of a PipeDocGen template finding, gets the same generous cut, being the part of its warning a reader acts on. A path, in `file.path`, `file.name`, `backup_path` or `template_file`, is cut at its start instead and begins with `…`, so the file's name stays on the line while the directory every line of a run shares goes. These cuts are the console's alone: every other sink writes each value whole. A key is written the same way, so a field whose name holds a line break, a space, an `=` or an escape sequence is quoted and escaped rather than forging a line or a second pair: `fields={"x=1": 2}` prints `"x=1"=2`. The [redaction](#redaction) has run before the console renders, so a secret is already `[REDACTED]`.+- **How a value is written.** On one line: a string as itself, a number, a boolean, `None`, a mapping, a list or a pydantic model as compact JSON, and anything else as its text. That text is written bare, or quoted when it is empty or holds a space, an `=`, a `"`, a `\` or a character a terminal would act on. Inside the quotes a backslash is written `\\`, a quote `\"` and any character a terminal would act on as its escape (`"line\nbreak"`), so `fields={"a": "b=c"}` prints `a="b=c"` rather than a second pair. A number, a boolean and `None` print bare (`7`, `true`, `null`), and so does a list of numbers (`[1,2]`), while a JSON rendering holding a string holds a quote and is quoted like a string: `["a","b"]` prints `"[\"a\",\"b\"]"`. A value longer than 80 characters is cut short and ends with `…`, its text, a string's or a JSON rendering's, being cut before it is quoted and escaped, so a quoted value keeps both its quotes, no escape is split, and no unbalanced quote or bracket is left whose tail could read as a pair of its own, except `error.message`, a handled exception's text, which is cut only past 2000 characters, quoted and escaped the same way: its diagnosis, a cause chain or a parse error's location, is what a fragment would lose, while a dependency's raw output, a validation error's every line or git's stderr, would flood the terminal uncut. `finding_message`, the text of a PipeDocGen template finding, gets the same generous cut, being the part of its warning a reader acts on. A path is cut at its start instead and begins with `…`, so the file's name stays on the line while the directory every line of a run shares goes. A field is taken for a path by its name: one ending in `.path`, `_path`, `_paths`, `_dir`, `_dirs`, `_file` or `_files`, such as `file.path`, `root_path`, `override_paths`, `library_dirs` or `template_file`, and `file.name` and `storage_key`, whose ends are a file's name too. A list of paths is cut the same way, its JSON rendering at its start before it is quoted, so the last path's file name stays and the cut list is still one quoted value: `override_paths="…/.pipelex/inference/backends_override.toml\"]"`. A path that is not on disk, `url.path` or a `variable_path`, is cut at its start as well, its end being what tells it apart. These cuts are the console's alone: every other sink writes each value whole. A key is written the same way, so a field whose name holds a line break, a space, an `=` or an escape sequence is quoted and escaped rather than forging a line or a second pair: `fields={"x=1": 2}` prints `"x=1"=2`. The [redaction](#redaction) has run before the console renders, so a secret is already `[REDACTED]`.- **Never markup.** The suffix is built as styled Rich `Text`, not as a markup string, so a value carrying `[red]x[/red]` prints exactly that.There is no setting to hide the suffix: it carries the values a message used to interpolate, so hiding it would hide what the line is about.@@ -425,7 +425,7 @@ log.warning(### Values in fields-What varies goes in `fields`, named by the [naming convention](#naming-convention), and one concept has one name across the codebase, so that a query written for one line finds every line about the same thing. Pipelex's own concepts take the names in the table below. A concept the OpenTelemetry semantic conventions define takes their key verbatim: `file.path` for a path on disk and `file.name` for a file's name alone, `url.full` for a URL and `url.path` for the path of a request's URL, `server.address` for the host a request is sent to, `http.response.status_code` for the status of an HTTP response, `user.id` for the authenticated caller, never an identity the server refused, `error.type` for the class of an error, and the `gen_ai.*` keys for inference, such as `gen_ai.provider.name`, `gen_ai.request.model`, `gen_ai.response.model`, `gen_ai.request.temperature`, `gen_ai.operation.name`, `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens`. A `gen_ai.*` key means on a log line what it means on Pipelex's LLM span: `gen_ai.request.model` is the model's handle and `gen_ai.response.model` the provider's id the model deck pins for that handle, the one the call is made with, whichever model the provider says answered. `gen_ai.operation.name` is the one exception for now, as [the inference call end](#the-inference-call-end) explains. A line about an inference call carries them beside `model_handle`, `backend_name` and `sdk`, so it joins its span in a log store, while `model_handle` names the handle on every line about a model, inference or not. An OpenTelemetry key that more than one call site uses is spelled through a constant, so a misspelt one is an error the type checker reports rather than a field no query finds: `OTelLogAttr` in `pipelex/system/telemetry/otel_constants.py` holds those keys, `GenAISpanAttr` beside it the `gen_ai.*` ones, and `pipelex.tools.log.error_fields` the two error keys. A count is named `<what>_count` (`concept_count`) and a duration `duration_ms`, in milliseconds. A field carries one JSON type on every line that has it, `null` aside, so a query compares it one way: where the value would be an integer on some lines and a word on others, `unbounded` for instance, the field is left out of the lines the word would name, and the table says so.+What varies goes in `fields`, named by the [naming convention](#naming-convention), and one concept has one name across the codebase, so that a query written for one line finds every line about the same thing. Pipelex's own concepts take the names in the table below. A concept the OpenTelemetry semantic conventions define takes their key verbatim: `file.path` for a path on disk and `file.name` for a file's name alone, `url.full` for a URL and `url.path` for the path of a request's URL, `server.address` for the host a request is sent to, `http.response.status_code` for the status of an HTTP response, `user.id` for the authenticated caller, never an identity the server refused, `error.type` for the class of an error, and the `gen_ai.*` keys for inference, such as `gen_ai.provider.name`, `gen_ai.request.model`, `gen_ai.response.model`, `gen_ai.request.temperature`, `gen_ai.operation.name`, `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens`. A `gen_ai.*` key means on a log line what it means on Pipelex's LLM span: `gen_ai.request.model` is the model's handle and `gen_ai.response.model` the provider's id the model deck pins for that handle, the one the call is made with, whichever model the provider says answered. `gen_ai.operation.name` is the one exception for now, as [the inference call end](#the-inference-call-end) explains. A line about an inference call carries them beside `model_handle`, `backend_name` and `sdk`, so it joins its span in a log store, while `model_handle` names the handle on every line about a model, inference or not. An OpenTelemetry key that more than one call site uses is spelled through a constant, so a misspelt one is an error the type checker reports rather than a field no query finds: `OTelLogAttr` in `pipelex/system/telemetry/otel_constants.py` holds those keys, `GenAISpanAttr` beside it the `gen_ai.*` ones, and `pipelex.tools.log.error_fields` the two error keys. A count is named `<what>_count` (`concept_count`) and a duration `duration_ms`, in milliseconds. A path is named `<what>_path`, a list of paths `<what>_paths`, a directory `<what>_dir` and a file as a declaration names it `<what>_file`, with their plurals, beside `file.path`: the console takes a field for a path by that ending and cuts its value at its start, keeping the file's name (see [Fields after the message](#fields-after-the-message)), so a field holding no path takes none of these endings. A field carries one JSON type on every line that has it, `null` aside, so a query compares it one way: where the value would be an integer on some lines and a word on others, `unbounded` for instance, the field is left out of the lines the word would name, and the table says so.| Field | Type | What it names || --- | --- | --- |@@ -500,6 +500,7 @@ What varies goes in `fields`, named by the [naming convention](#naming-conventio| `migration_steps` | list of strings | The titles of the migration ledger's steps a stale configuration file was read through, as a list || `has_blocked_steps` | boolean | Whether a stale configuration file needs a migration step that cannot be applied for the user || `file_count` | integer | The number of result files a delivery stored |+| `storage_key` | string | The key a delivery stores a result file under, which ends in the file's name || `env_var` | string | The name of an environment variable, never its value || `default_value` | integer | The value a setting falls back to when its environment variable holds none it can use || `auth_mode` | string | The authentication mode the API server's `AUTH_MODE` names |diff --git a/pipelex/tools/log/console_fields.py b/pipelex/tools/log/console_fields.pyindex 903684bf1..60128f1d3 100644--- a/pipelex/tools/log/console_fields.py+++ b/pipelex/tools/log/console_fields.py@@ -13,12 +13,14 @@ it is empty or holds a space, an equals sign, a quote, a backslash or a charactecase it is quoted, with a backslash and a quote escaped by a backslash and that character written as its escape. So alist of strings, whose JSON holds quotes, is always quoted, while a number or a list of numbers stays bare. The textis cut short past ``FIELD_VALUE_MAX_LENGTH``, or past the generous length ``FIELD_MAX_LENGTHS`` gives a field of its-own, a handled exception's text and a template finding's. A value is cut at its end, except a path's, from-``LEFT_CUT_FIELDS``, which is cut at its start so the file's name stays. The text is cut before it is quoted and-escaped, so a quoted value keeps both its quotes and no escape is split, and the cut can never leave an unbalanced-quote or bracket whose tail reads as another pair. A key is written the same way, so a field name-holding a line break, a space, an equals sign or an escape sequence can forge neither a line nor a pair. Redaction has-already run when the console renders a record, so what is rendered is what the scrub left.+own, a handled exception's text and a template finding's. A value is cut at its end, except a path's, or a list of+paths', which is cut at its start so the last file's name stays: a field is taken for a path by its name, one ending+in ``LEFT_CUT_FIELD_SUFFIXES`` (``file.path``, ``root_path``, ``override_paths``, ``library_dirs``, ``template_file``)+or one of ``LEFT_CUT_FIELDS`` (``file.name``). The text is cut before it is quoted and escaped, a string's own or a+JSON rendering alike, so a quoted value keeps both its quotes and no escape is split, and the cut can never leave an+unbalanced quote or bracket whose tail reads as another pair. A key is written the same way, so a field name holding a+line break, a space, an equals sign or an escape sequence can forge neither a line nor a pair. Redaction has already+run when the console renders a record, so what is rendered is what the scrub left.Colour follows the name the field was given, from ``FIELD_STYLES``, wherever the field appears, and whatevercollision prefix it landed under; a field outside the map renders dimmed. The map is one table in code, the@@ -82,10 +84,17 @@ FINDING_MESSAGE_FIELD = "finding_message"# The fields the console cuts at a length of their own, by the name the caller gave them.FIELD_MAX_LENGTHS: dict[str, int] = {ERROR_MESSAGE_FIELD: ERROR_MESSAGE_MAX_LENGTH, FINDING_MESSAGE_FIELD: ERROR_MESSAGE_MAX_LENGTH}-# The fields carrying a path on disk, by the name the caller gave them, which the console cuts at their start rather-# than at their end: what tells one file from another is its name, at the end, while the start is the directory most-# lines of a run share.-LEFT_CUT_FIELDS = frozenset({"file.path", "file.name", "backup_path", "template_file"})+# The endings of a field's name that say it carries a path or a list of paths, which the console cuts at its start+# rather than at its end: what tells one file from another is its name, at the end, while the start is the directory+# most lines of a run share. ``file.path`` ends in the first, and the vocabulary names a path ``<what>_path``, a list+# of paths ``<what>_paths``, a directory ``<what>_dir`` and a file ``<what>_file``, with their plurals. A list of paths+# is cut the same way, its rendering at its start, so the last path's file name stays. A path that is not on disk,+# ``url.path`` or a ``variable_path`` into working memory, is cut at its start too, its end being what tells it apart.+LEFT_CUT_FIELD_SUFFIXES: tuple[str, ...] = (".path", "_path", "_paths", "_dir", "_dirs", "_file", "_files")++# The fields the console cuts at their start that no ending above reaches, by the name the caller gave them: a file's+# name alone, and a storage key, whose end is the name of the file stored under it.+LEFT_CUT_FIELDS = frozenset({"file.name", "storage_key"})FIELD_SEPARATOR = " "KEY_VALUE_SEPARATOR = "="@@ -149,11 +158,13 @@ def field_max_length(*, name: str) -> int:def field_is_cut_at_start(*, name: str) -> bool:- """Whether the console cuts a field's value at its start, keeping its end: a path's, from ``LEFT_CUT_FIELDS``.+ """Whether the console cuts a field's value at its start, keeping its end: a path's, or a list of paths'.+ A field is taken for a path by its name: one ending in ``LEFT_CUT_FIELD_SUFFIXES``, or one of ``LEFT_CUT_FIELDS``.Read off the name the caller gave rather than the one it landed on, as the style is."""- return given_field_name(name=name) in LEFT_CUT_FIELDS+ given_name = given_field_name(name=name)+ return given_name in LEFT_CUT_FIELDS or given_name.endswith(LEFT_CUT_FIELD_SUFFIXES)def format_field_value(*, value: Any, max_length: int = FIELD_VALUE_MAX_LENGTH, is_cut_at_start: bool = False) -> str:diff --git a/tests/unit/pipelex/tools/test_log_console_fields.py b/tests/unit/pipelex/tools/test_log_console_fields.pyindex eb13a3197..33655caf2 100644--- a/tests/unit/pipelex/tools/test_log_console_fields.py+++ b/tests/unit/pipelex/tools/test_log_console_fields.py@@ -1,6 +1,7 @@from __future__ import annotationsimport io+import jsonimport loggingfrom typing import TYPE_CHECKING, Any@@ -12,9 +13,9 @@ from pipelex.tools.log.console_fields import (FIELD_STYLES,FIELD_VALUE_MAX_LENGTH,FINDING_MESSAGE_FIELD,- LEFT_CUT_FIELDS,TRUNCATION_MARK,UNMAPPED_FIELD_STYLE,+ field_is_cut_at_start,)from pipelex.tools.log.error_fields import error_fieldsfrom pipelex.tools.log.log_fields import (@@ -168,7 +169,35 @@ class TestConsoleFields:assert text.plain.endswith(f"error.message={'y' * (ERROR_MESSAGE_MAX_LENGTH - len(TRUNCATION_MARK))}{TRUNCATION_MARK}")assert "y" * ERROR_MESSAGE_MAX_LENGTH not in text.plain- @pytest.mark.parametrize("path_field", sorted(LEFT_CUT_FIELDS))+ @pytest.mark.parametrize(+ ("name", "is_cut_at_start"),+ [+ ("file.path", True),+ ("url.path", True),+ ("root_path", True),+ ("backup_path", True),+ ("override_paths", True),+ ("mthds_paths", True),+ ("library_dirs", True),+ ("target_dir", True),+ ("template_file", True),+ ("include_files", True),+ ("file.name", True),+ ("storage_key", True),+ (f"{COLLIDING_FIELD_PREFIX}override_paths", True),+ ("file_count", False),+ ("structure_classes", False),+ ("url.full", False),+ ("module_name", False),+ ("error.message", False),+ ("excerpt", False),+ ],+ )+ def test_a_field_is_taken_for_a_path_by_its_name(self, name: str, is_cut_at_start: bool) -> None:+ """Only the names listed one by one were cut at their start, so ``override_paths`` and every other path field lost the file's name."""+ assert field_is_cut_at_start(name=name) is is_cut_at_start++ @pytest.mark.parametrize("path_field", ["file.path", "file.name", "backup_path", "template_file", "root_path", "storage_key"])def test_a_long_path_is_cut_at_its_start_so_the_file_name_stays(self, path_field: str) -> None:"""Cut at its end, a long path kept the directory every line of a run shares and lost the file's name."""long_path = "/Users/someone/projects/acme/" + "nested-directory/" * 8 + "invoice_template_v2.docx"@@ -180,6 +209,47 @@ class TestConsoleFields:assert "/Users/someone" not in text.plainassert text.plain.endswith(f"excerpt={'x' * (FIELD_VALUE_MAX_LENGTH - len(TRUNCATION_MARK))}{TRUNCATION_MARK}")+ @pytest.mark.parametrize(+ ("path_field", "paths", "file_name"),+ [+ (+ "override_paths",+ ["/private/tmp/scratch/-Users-someone-projects-acme/8c7e235e-b5d9-4299-9cca-4821d85192a0/.pipelex/backends_override.toml"],+ "backends_override.toml",+ ),+ (+ "library_dirs",+ ["/Users/someone/projects/acme/methods", "/Users/someone/projects/acme/shared/libraries", "/Users/someone/My methods/a b=c/invoices"],+ "invoices",+ ),+ ],+ ids=["one long override file", "several library directories"],+ )+ def test_a_long_list_of_paths_is_cut_at_its_start_so_the_last_file_name_stays(self, path_field: str, paths: list[str], file_name: str) -> None:+ """Cut at its end, the boot's backends line kept a temporary directory and lost the override file's name.++ The rendering is cut before it is quoted and escaped, so the cut list is one quoted value, and neither a space+ nor an equals sign in its last path reads as a pair of its own.+ """+ text = rendered_text(record=record_with_fields(message="Read", extra={path_field: paths, "attempt": 2}))++ rendering = json.dumps(paths, ensure_ascii=False, separators=(",", ":"))+ kept_tail = rendering[len(rendering) - FIELD_VALUE_MAX_LENGTH + len(TRUNCATION_MARK) :]+ quoted = '"' + f"{TRUNCATION_MARK}{kept_tail}".replace("\\", "\\\\").replace('"', '\\"') + '"'+ assert len(rendering) > FIELD_VALUE_MAX_LENGTH+ assert kept_tail.endswith(f'/{file_name}"]')+ assert text.plain.endswith(f"{path_field}={quoted} attempt=2")+ # The value is one quoted span: every quote inside it is escaped, so nothing after a space reads as a pair.+ assert '"' not in quoted[1:-1].replace('\\"', "")++ def test_a_long_value_of_a_field_not_named_as_a_path_is_still_cut_at_its_end(self) -> None:+ """Only a path field is cut at its start: a text naming files, by a name no path ending reaches, keeps its start."""+ structure_classes = "invoices/structures.py: Invoice, Line; " * 4+ text = rendered_text(record=record_with_fields(message="Fetched", extra={"structure_classes": structure_classes, "attempt": 2}))++ kept_head = structure_classes[: FIELD_VALUE_MAX_LENGTH - len(TRUNCATION_MARK)]+ assert text.plain.endswith(f'structure_classes="{kept_head}{TRUNCATION_MARK}" attempt=2')+@pytest.mark.parametrize(("topic", "file_name"),[diff --git a/tests/unit/pipelex/tools/test_log_json_sink.py b/tests/unit/pipelex/tools/test_log_json_sink.pyindex 7c9b9d0f3..100ee7276 100644--- a/tests/unit/pipelex/tools/test_log_json_sink.py+++ b/tests/unit/pipelex/tools/test_log_json_sink.py@@ -93,19 +93,30 @@ class TestJsonLogSink:assert structured[MESSAGE_KEY].startswith("Config:")def test_the_console_s_cuts_never_reach_a_structured_line(self, json_log: tuple[Log, io.StringIO]) -> None:- """The console cuts a long value, a path at its start and a template finding past its own length; the json sink writes each whole."""+ """The console cuts a long value, a path or a list of paths at its start and a template finding past its own length.++ The json sink writes each whole.+ """fresh, buffer = json_loglong_path = "/Users/someone/projects/acme/" + "nested-directory/" * 8 + "invoice_template_v2.docx"long_finding = "The placeholder 'invoice.lines' is read as a list " + "z" * (2 * ERROR_MESSAGE_MAX_LENGTH)long_excerpt = "x" * (2 * FIELD_VALUE_MAX_LENGTH)fresh.warning(- "Checked", fields={"file.path": long_path, "template_file": long_path, FINDING_MESSAGE_FIELD: long_finding, "excerpt": long_excerpt}+ "Checked",+ fields={+ "file.path": long_path,+ "template_file": long_path,+ "override_paths": [long_path],+ FINDING_MESSAGE_FIELD: long_finding,+ "excerpt": long_excerpt,+ },)(checked,) = _own_lines(buffer)assert checked["file.path"] == long_pathassert checked["template_file"] == long_path+ assert checked["override_paths"] == [long_path]assert checked[FINDING_MESSAGE_FIELD] == long_findingassert checked["excerpt"] == long_excerpt