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/Tree-era-wording · L-261017-5765ef (#1465)
Louis Choquel8b40093848d4
diff --git a/.drift/acks/config-docs.toml b/.drift/acks/config-docs.tomlindex 3f597414c..180577d63 100644--- a/.drift/acks/config-docs.toml+++ b/.drift/acks/config-docs.toml@@ -1,8 +1,8 @@contract = "config-docs"-digest = "sha256:c97e5b71ae9df6f40b8f3f593ff9ba70748634577f0978d0b9b25b4ef038da3c"+digest = "sha256:425836b0c5fecdd129b3392ec13dbd3c705e897ef9d5f30599b22ac8e4a5a148"reviewed_by = "Louis Choquel"-reviewed_at = "2026-10-16T02:18:45Z"-rationale = "real-catch: pipe_func_config.py changes only the comment on execution_mode, which now says a non-direct mode captures the method's files onto the crate, proves a PipeFunc's function form from the captured source and imports nothing here; docs/configuration/config-technical/library-config.md was stale on the retired func_registry and now documents PipeFunc functions as import paths from the method tree's root, one tree's Python per process and @pipe_func() without arguments. No config field moved, so the migration ledgers need no entry."+reviewed_at = "2026-10-20T05:11:15Z"+rationale = "clean-pass: pipe_func_config.py changes only the comment on execution_mode, which now says a non-direct mode imports none of the method's Python, scanning its text for structure classes, proves a PipeFunc's function form from its module's text, and leaves the sandbox to receive the files of its step's tree, where it said the files were captured onto the crate. No configuration doc describes that behaviour and no config field moved, so the docs and the migration ledgers need no change."[trigger_files]"pipelex/cogt/config_cogt.py" = "blob:293ef22ae123266e6a1886d4ffb07f455e5be9e3"@@ -18,7 +18,7 @@ rationale = "real-catch: pipe_func_config.py changes only the comment on executi"pipelex/system/configuration/config_root.py" = "blob:c7d43851270912d17413cfc6a511247d3c7cc160""pipelex/system/configuration/config_surface.py" = "blob:49424a8103a5611f5b2885135dd699273bde57c8""pipelex/system/configuration/configs.py" = "blob:74175f5e5aac2d50af6f319d3706db0d90dd5eab"-"pipelex/system/configuration/pipe_func_config.py" = "blob:8e82c67de60238d0a02370b3ac53847f8b17b597"+"pipelex/system/configuration/pipe_func_config.py" = "blob:a1911617e74df158891760fbbf47171065a0934f""pipelex/system/telemetry/telemetry_config.py" = "blob:068a785d97a2d52ee43e82e723cd944b8b6601bc""pipelex/tools/aws/aws_config.py" = "blob:0a7c9dbf276e61355b1fa79b9db8caf252450a39""pipelex/tools/log/log_config.py" = "blob:0a893b9e62737b7954a924eaed577ba5c8ef9eaf"diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 31525b042..1a880ac0b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,6 +9,11 @@### Changed- **The API server's examples send a method in `files`**: the server's README and the API Server pages send a method to `/v1/execute` and `/v1/validate` in `files`, a map from each file's path in the method's folder to its content, where they sent `mthds_contents`. The reference pages and the OpenAPI artifact now say that `mthds_contents`, with `bundle_b64`, `resources` and `/v1/validate`'s `mthds_sources`, is being retired and will be refused by a later release, so a client sends `files` now.+- **The refusal of a package the request did not send**: the message of the `unresolved_package_dependency` refusal a static resolution gives, such as the one behind `/v1/resolve`, `/v1/codegen` and `/v1/pipe-io`, tells its reader to send the package's files in `dependencies`, keyed by its address, beside the method's own files in `files`, where it spoke of an in-memory resolve and the host filesystem and advised directory-based resolution; it still carries the words `address-based dependency '<address>'`.++### Fixed++- **Where a method's Python travels, in the docs**: the PipeFunc Requirements, PipeFunc and run pages say that the API server receives a method as a tree holding its bundles and its Python together and judges its `requirements.txt` from the tree's listing, that the runner never imports a method's Python, that a run's crate names each step's method tree by its digest and carries none of its files, that a `PipeFunc` call's files are read through the method file store the worker's host installs, and that a worker a method tree's validation is dispatched to checks the method's requirements again, where they said the server received a method's Python apart from its bundles, the Python was captured as text, the crate carried the method's Python sources and the worker never checked anything.## [v0.90.0] - 2026-10-19diff --git a/api/pipelex_api/routes/pipelex/pipeline.py b/api/pipelex_api/routes/pipelex/pipeline.pyindex 64ceb8cf1..042697c6d 100644--- a/api/pipelex_api/routes/pipelex/pipeline.py+++ b/api/pipelex_api/routes/pipelex/pipeline.py@@ -631,8 +631,10 @@ class ApiRunner(PipelexMTHDSProtocol):raise _missing_bundle_validator_error(mode=orchestration_mode, api_config=api_config)library_dirs = [Path(library_dir) for library_dir in self.library_dirs] if self.library_dirs else None# The method's requirements.txt is judged here, on the runner, which holds the method's files and the package set- # its PipeFunc steps run with, before any dispatch: a dispatched validator never reads these directories. A- # refusal is the method's invalid verdict, as a run of it is refused before its files load.+ # its PipeFunc steps run with, before any dispatch, so a refusal reaches the caller whichever validator runs. A+ # worker a method tree's validation is dispatched to never reads these directories: it receives the method's+ # trees through its method file store and judges their requirements again as it loads them. A refusal is the+ # method's invalid verdict, as a run of it is refused before its files load.try:with translate_to_validate_bundle_error():await self._ensure_served_method_requirements_met()diff --git a/docs/api-server/pipe-run.md b/docs/api-server/pipe-run.mdindex 199fecad1..f9484ae96 100644--- a/docs/api-server/pipe-run.md+++ b/docs/api-server/pipe-run.md@@ -327,7 +327,7 @@ Both `/execute` and `/start` accept **`method_ref`** — a globally resolvable a**Provenance.** The response carries `method_provenance = {address, tag, commit_sha, tree_digest}` — on `/execute` only for `method_ref` runs, on the `/start` ack as a nullable field. Tags can move; the recorded SHA is what keeps a run explainable after the fact, and `tree_digest` names the exact tree the run loaded.-**Custom Python follows the tree rules, plus one more.** What decides is *where the code would execute*: `.mthds` content is data, always acceptable. On a deployment that is **not** sandbox-hosted, a fetched package carrying any `.py` is refused with a `501` `pipelex.deployment.custom_code_requires_sandbox`, whose `origin` is `package`. On a sandbox-hosted deployment, PipeFunc `.py` is accepted (captured as text, executed in the isolated sandbox) — but a package declaring **Python structure classes** (`StructuredContent` subclasses) is refused with a `422` (`pipelex.deployment.python_structures_refused`), exactly as a tree sent with the request is: see [No Python structure classes](#sending-a-method-as-a-tree).+**Custom Python follows the tree rules, plus one more.** What decides is *where the code would execute*: `.mthds` content is data, always acceptable. On a deployment that is **not** sandbox-hosted, a fetched package carrying any `.py` is refused with a `501` `pipelex.deployment.custom_code_requires_sandbox`, whose `origin` is `package`. On a sandbox-hosted deployment, PipeFunc `.py` is accepted (the runner never imports it: validation reads its text, and each PipeFunc call runs in the isolated sandbox, which receives the files of the step's tree) — but a package declaring **Python structure classes** (`StructuredContent` subclasses) is refused with a `422` (`pipelex.deployment.python_structures_refused`), exactly as a tree sent with the request is: see [No Python structure classes](#sending-a-method-as-a-tree).**Errors.** Every resolution failure is an RFC 9457 `problem+json` named by its code (see [Error responses](error-responses.md)):diff --git a/docs/building-methods/pipes/pipe-operators/PipeFunc.md b/docs/building-methods/pipes/pipe-operators/PipeFunc.mdindex d874dfd0b..854e9a227 100644--- a/docs/building-methods/pipes/pipe-operators/PipeFunc.md+++ b/docs/building-methods/pipes/pipe-operators/PipeFunc.md@@ -100,7 +100,7 @@ The guard covers imports only. A file your function reads with `open()` is not c## Sandbox-hosted execution-On a sandbox-hosted deployment, the runner never imports a method's Python. Validation proves each function's form from the method's files, and each call of a `PipeFunc` step runs in a sandbox that receives every file of the step's tree except its `.mthds` files, written at their paths in the tree, the tree's root first on the import path. The runner reads those files once, as the method loads, and only for a tree holding a `PipeFunc` step, so a run goes on after the folder it read them from is gone. A structure class is refused wherever the load finds one, in the library directory's own tree or in a package or repository nested in it. The sandbox generates the `structures` module from the method's concepts, so a function can `from structures import <domain>__<Concept>` without the method shipping a copy.+On a sandbox-hosted deployment, the runner never imports a method's Python. Validation proves each function's form from the method's files, and each call of a `PipeFunc` step runs in a sandbox that receives every file of the step's tree except its `.mthds` files, written at their paths in the tree, the tree's root first on the import path. The run carries none of those files: it names the step's tree by its digest, and whoever runs the call reads the files through the deployment's method file store. A run handed to a worker goes on after the folder the runner read the method from is gone, because the orchestrator that hands it over first copies the trees of the run's steps into the store the worker reads. A structure class is refused wherever the load finds one, in the library directory's own tree or in a package or repository nested in it. The sandbox generates the `structures` module from the method's concepts, so a function can `from structures import <domain>__<Concept>` without the method shipping a copy.## Migrating flat function namesdiff --git a/docs/under-the-hood/pipe-func-requirements.md b/docs/under-the-hood/pipe-func-requirements.mdindex b67cc838b..b58e9bb8d 100644--- a/docs/under-the-hood/pipe-func-requirements.md+++ b/docs/under-the-hood/pipe-func-requirements.md@@ -9,9 +9,9 @@ A method declares the Python packages its own Python imports in a `requirements.## What is checked, and when-A method tree is checked when it holds a `requirements.txt` at its root and a `.py` file anywhere in it. Python is the proxy for "has code that could import a package" rather than "has a PipeFunc pipe", because a server receives a method's Python apart from its bundles: the runner loads a bundle's `.py` files from a directory it makes for the request, while the `.mthds` files arrive as content, so the directory holding the Python holds no pipe to judge it by.+A method tree is checked when it lies on this host's disk, holds a `requirements.txt` at its root, and holds a `.py` file anywhere in it. Python is the proxy for "has code that could import a package" rather than "has a PipeFunc pipe", because the check reads the tree's listing and never its bundles: a load runs it before it parses any of them, and the API server, which receives a method as a tree holding its bundles and its Python together, sent in `files` or `bundle_b64` or fetched by `method_ref`, writes the tree out and judges it before loading anything (see [below](#where-the-check-runs-on-a-sandbox-hosted-deployment)). Python that no step names can import a package too, such as a module a step's function imports, or, in the `direct` mode, a module defining a concept's structure class.-The check is `pipelex/libraries/method_requirements.py`, and a load runs it at three places, each before any Python of the tree is imported or captured and before any of its pipes is built. A load never imports a `PipeFunc`'s module anyway: the step imports its function's module by its import path when it first binds it, in a validation's dry run or its first run, which comes after the load and its check, and the only Python a direct-mode load imports, the modules defining a concept's structure class, is imported after the check too.+The check is `pipelex/libraries/method_requirements.py`, and a load runs it at three places, each before any Python of the tree is imported, or scanned for structure classes on a sandbox-hosted deployment, and before any of its pipes is built. A load never imports a `PipeFunc`'s module anyway: the step imports its function's module by its import path when it first binds it, in a validation's dry run or its first run, which comes after the load and its check, and the only Python a direct-mode load imports, the modules defining a concept's structure class, is imported after the check too.- `LibraryManager.load_libraries` checks every tree of its library directories, and the tree of each bundle file it is handed, once all of them are listed.- `LibraryManager.load_from_blueprints` checks the tree of every bundle read from this host's disk, on every load: a blueprint an earlier load placed in its tree, a refused one included, is judged again rather than taken as judged.@@ -46,12 +46,13 @@ A server loads its own library directories (`PIPELEXPATH`, the instance defaults## Where the check runs on a sandbox-hosted deployment-**On the runner, never on the worker or in the sandbox.** The runner is the process that holds the method's files, and the place a refusal reaches the caller before anything is dispatched. The runner loads the directory it makes for a request's files as one of its own library directories, where a refusal is the host's fault, so it judges the caller's method first, through `ensure_served_method_requirements_met`, run off the event loop since it lists and hashes the method's files:+**On the runner first, and never in the sandbox.** The runner is the process that holds the method's files, and the place a refusal reaches the caller before anything is dispatched. The runner loads the directory it makes for a request's files as one of its own library directories, where a refusal is the host's fault, so it judges the caller's method first, through `ensure_served_method_requirements_met`, run off the event loop since it lists and hashes the method's files:- **A run** (`/execute`, `/start`) with a `files` or `bundle_b64` bundle, or by `method_ref`, is refused there as a `422` naming each requirement, before the method's files load and before any dispatch.-- **A validation by `method_ref`** (`/validate`) is dispatched whole to a validator that never reads the method's Python, a Temporal worker for instance, so `ApiRunner.validate_verdict` returns a refusal as the invalid verdict, one item per line, before the validator is reached. Inline `mthds_contents` carry no Python and are not checked.+- **A validation of a method tree** (`/validate`), sent in `files` or fetched by `method_ref`, is judged there too, whether its validator runs in the runner's process or on a worker it is dispatched to, a Temporal worker for instance: `ApiRunner.validate_verdict` returns a refusal as the invalid verdict, one item per line, before the validator is reached. Inline `mthds_contents` carry no Python and are not checked.- **A directory of the request that cannot be listed** stays the host's fault, a `500` `HostLibraryTreeError` carrying `pipelex.config.invalid`, as the load reports it.-- **The worker** loads the library crate the runner built, which carries the method's Python sources but not its `requirements.txt`, so it never checks anything, and needs to know nothing of the sandbox's packages.+- **The worker running a run** loads the library crate the runner built, which names each step's method tree by its digest and carries none of the tree's files, its Python and its `requirements.txt` included, so loading it checks nothing. A `PipeFunc` call's files are read on the worker, through the method file store its host installs (`HubSlot.METHOD_FILE_STORE`), and handed to the sandbox, which loads the same crate and checks nothing either.+- **A worker a method tree's validation is dispatched to** receives the method's trees rather than a crate (`BundleValidatorProtocol`) and loads them, so it judges the requirements again, as every load of a tree does, against the package set the plugins of its own process state for the mode. Its deployment therefore registers the same offer as the runner's: a worker stating none refuses every method declaring requirements with `PipeFuncPackageSetUnstatedError`.## The seam: stating the sandbox's packages@@ -99,7 +100,7 @@ A mode with one fixed package set ignores the requirements and answers its packa### What our Daytona plugin supplies-For the hosted API, the Daytona sandbox plugin states the package set of the Daytona sandbox snapshot it boots, the lock its snapshot image is built from: the snapshot's distributions and versions, and the marker environment of its base image. The runner, where the check runs, must resolve the same snapshot name the worker's sandboxes boot from, since the worker is the process that creates them; a runner that cannot resolve it answers `None` and refuses every method declaring requirements. A method needing packages the base snapshot lacks runs in an environment the plugin builds for its requirements when a PipeFunc call provisions its box, and since the factory receives the requirements, the plugin can state that environment when the method loads, or refuse the requirements with its resolver's explanation.+For the hosted API, the Daytona sandbox plugin states the package set of the Daytona sandbox snapshot it boots, the lock its snapshot image is built from: the snapshot's distributions and versions, and the marker environment of its base image. The runner, which checks a method before dispatching anything, must resolve the same snapshot name the worker's sandboxes boot from, since the worker is the process that creates them; a runner that cannot resolve it answers `None` and refuses every method declaring requirements. A method needing packages the base snapshot lacks runs in an environment the plugin builds for its requirements when a PipeFunc call provisions its box, and since the factory receives the requirements, the plugin can state that environment when the method loads, or refuse the requirements with its resolver's explanation.## Errorsdiff --git a/pipelex/hosted/hosted_inputs.py b/pipelex/hosted/hosted_inputs.pyindex 8e2cd5e55..5095f7f1b 100644--- a/pipelex/hosted/hosted_inputs.py+++ b/pipelex/hosted/hosted_inputs.py@@ -260,8 +260,8 @@ def _address_dependency_refusal(*, refusal: ApiResponseError) -> HostedLocalFileAn in-memory resolution answers that refusal with its problem, coded `request.unsupported` and giving the reason`ADDRESS_DEPENDENCY_UNSUPPORTED_REASON`: the request is what it cannot serve, not the method, which the run routefetches the dependency of. The tree resolution behind pipe-io answers a call into a package nothing shipped with its- invalid verdict instead (`_unshipped_dependency_refusal`). The refusal's own advice, to send the dependency's contents, is meant for the API's- callers, so the error leaves it out.+ invalid verdict instead (`_unshipped_dependency_refusal`). The refusal's own advice, to send the package's files in+ `dependencies`, is meant for the API's callers, so the error leaves it out.The error does not name the dependency, because the problem does not carry it: `request.unsupported` declares only`field` and `reason`, and the sentence naming the dependency's address is the server's message, which reaches its@@ -283,7 +283,7 @@ def _unshipped_dependency_refusal(*, report: CrateInvalidReport) -> HostedLocalFnothing shipped with its invalid verdict, whose item is coded `method.dependency_missing` with the `kind` `package`,the `reason` `not_found` and the package's address as its `name`. The run route fetches such a dependency, so the method is not at fault. Theerror names the dependency from the item's code and parameters, never from its message, and leaves out the- verdict's advice, to send the dependency's contents, which is meant for the API's callers.+ verdict's advice, to send the package's files in `dependencies`, which is meant for the API's callers."""package = _missing_package(report=report)if package is None:diff --git a/pipelex/libraries/library_manager.py b/pipelex/libraries/library_manager.pyindex b574e8e5c..c771f64bb 100644--- a/pipelex/libraries/library_manager.py+++ b/pipelex/libraries/library_manager.py@@ -733,9 +733,10 @@ class LibraryManager(LibraryManagerAbstract):)# A method declaring Python packages in its requirements.txt is refused here when the environment its- # PipeFunc steps run in does not meet them: before any of its Python is imported or captured, and before- # any of its pipes is built. Every listed tree counts, one holding no bundle included, such as the Python a- # server received beside a method's bundles. A refusal may name host paths: these are the caller's own+ # PipeFunc steps run in does not meet them: before any of its Python is imported, or scanned for structure+ # classes on a sandbox-hosted deployment, and before any of its pipes is built. Every listed tree counts, one+ # holding no bundle included, such as a library directory whose files are submitted beside the bundles parsed+ # from content strings (below). A refusal may name host paths: these are the caller's own# directories, or the host's, whose refusal `reporting_host_library_tree_faults` withholds as its own fault.ensure_method_requirements_met(trees=[@@ -770,9 +771,10 @@ class LibraryManager(LibraryManagerAbstract):# inline bundle, a stored method, a host directory): importing a file runs its module-level# code in this process. A structure class cannot travel to a sandbox: it would have to be# imported here to back a concept, so the load is refused, naming each file and class, before- # any file is kept. Every tree the load lists is scanned, a package or repository nested in a+ # any bundle is parsed. Every tree the load lists is scanned, a package or repository nested in a# library directory included. The refusal is a static scan, which a dynamically built class- # escapes; such a file then travels as source and still never executes here.+ # escapes; such a file then stays a file of its tree, which reaches a sandbox only among the files+ # of a PipeFunc call, and still never executes here.ensure_no_structured_content_in_library_sources(sources_by_dir=_python_sources_by_tree(library_trees=library_trees, bundle_files=all_bundle_files),)diff --git a/pipelex/libraries/method_requirements.py b/pipelex/libraries/method_requirements.pyindex aedae8420..19eb68d3c 100644--- a/pipelex/libraries/method_requirements.py+++ b/pipelex/libraries/method_requirements.py@@ -8,8 +8,8 @@ Pipelex refuses a method whose requirements are not met when it loads, naming eanever installs anything:- A tree is checked when it holds `requirements.txt` at its root and holds Python, a `.py` file anywhere in it: a tree- with no Python has nothing that could import a package. The check runs before any of the tree's Python is imported- or captured, and before any of its pipes is built.+ with no Python has nothing that could import a package. The check runs before any of the tree's Python is imported,+ or scanned for structure classes on a sandbox-hosted deployment, and before any of its pipes is built.- The environment is the one the PipeFunc steps run in (`pipelex/libraries/package_environments.py`): this interpreterin the `direct` execution mode, and in a sandbox-hosted mode the packages the deployment states its sandbox offersfor the tree's requirements, asked for each tree, so trees judged together each get the offer stated for their own.@@ -497,9 +497,10 @@ def ensure_package_requirements_met(*, tree: MethodTree, package_address: str) -def ensure_served_method_requirements_met(*, library_dirs: Sequence[Path], limits: TreeLimits | None = None) -> None:"""Check the requirements of a caller's method a server holds in directories of its own, as loading them would, without loading them.- For a server that hands the directories to a loader elsewhere, such as a validator on a worker that never reads- them, or that loads them as its own library directories, so the refusal is the caller's and comes from the place- that knows the method's files. The directories are the server's: a tree of them that cannot be listed is the+ For a server that hands the method to a loader elsewhere, such as a validator whose worker receives the method's+ trees through its own method file store rather than these directories, or that loads them as its own library+ directories, so the refusal is the caller's and comes, before anything loads or is dispatched, from the process that+ holds the method's files. The directories are the server's: a tree of them that cannot be listed is thehost's fault, as a load of a host's library directories reports it, and a refusal names no path on the host, thedirectories' and this interpreter's included.diff --git a/pipelex/methods/address_dependencies.py b/pipelex/methods/address_dependencies.pyindex 10afbc956..3e049f121 100644--- a/pipelex/methods/address_dependencies.py+++ b/pipelex/methods/address_dependencies.py@@ -27,8 +27,14 @@ class AddressDependencySources(StrEnum):def unshipped_address_dependency_message(*, alias: str) -> str:- """The refusal of an address-based dependency a static resolution cannot load, since nothing shipped it."""+ """The refusal of an address-based dependency a static resolution cannot load, since nothing shipped it.++ The advice is what the caller of such a resolution can do, such as the caller of the API server's `/v1/resolve`,+ `/v1/codegen` and `/v1/pipe-io`: send the package's files in the request's `dependencies`, keyed by its address,+ beside the method's own in `files`.+ """return (- f"In-memory resolve cannot load {ADDRESS_DEPENDENCY_REFUSAL_MARKER} '{alias}' from the host filesystem; "- "provide the dependency contents in the request or use directory-based resolution."+ f"The method calls the {ADDRESS_DEPENDENCY_REFUSAL_MARKER} '{alias}', which was not sent with it, and this "+ "resolution loads only the packages sent with the method, fetching none: send the package's files in "+ "`dependencies`, keyed by its address, beside the method's own files in `files`.")diff --git a/pipelex/methods/structures_check.py b/pipelex/methods/structures_check.pyindex 5e91aa767..e8d554942 100644--- a/pipelex/methods/structures_check.py+++ b/pipelex/methods/structures_check.py@@ -9,9 +9,9 @@ PipeFunc-only Python is supported.Two doors apply it. A fetched package is scanned on disk before it is installed(`ensure_no_structured_content_python`). Every sandbox-hosted library load, whatever the content's-origin (an inline bundle, a stored method, a host directory), scans the sources it would ship to-the sandbox before it keeps any of them (`ensure_no_structured_content_in_library_sources`). Both-run the same walk over one source string, so the two refusals cannot drift apart.+origin (an inline bundle, a stored method, a host directory), scans the text of every Python file+of the trees it lists before it parses any bundle (`ensure_no_structured_content_in_library_sources`).+Both run the same walk over one source string, so the two refusals cannot drift apart.One file declaring such classes is not refused: the `python-structures` projection that`pipelex build structures` writes, left as generated. It is a copy of the method's own MTHDS@@ -103,7 +103,7 @@ def structured_content_class_names_in_source(*, source: str, filename: str) -> l"""Class names declared in one Python source whose bases resolve to `StructuredContent`.This is the one walk both refusals run, over the text itself, so the fetch-time scan of a- directory and the load-time scan of captured sources cannot drift apart. A source that does not+ directory and the load-time scan of the sources a load reads cannot drift apart. A source that does notparse declares nothing: it cannot be imported either, so it cannot smuggle a structure classinto the process. That includes a source nested deeply enough to exhaust the parser, whichPython's own import rejects the same way.@@ -178,14 +178,14 @@ def scan_structured_content_classes(*, package_dir: Path) -> list[StructuredContdef scan_structured_content_sources(*, sources: Mapping[str, str]) -> list[StructuredContentViolation]:- """Scan captured Python sources, keyed by relative path, for `StructuredContent` subclasses.+ """Scan Python sources, keyed by relative path, for `StructuredContent` subclasses.- The sandbox-hosted loader calls this on the very mapping it would ship, so the bytes it refuses- are exactly the bytes that would travel, with no second read of the disk. The generated- `python-structures` projection, left as generated, is not a violation (`is_generated_structures_module`).+ The sandbox-hosted loader calls this on the text of every Python file of the trees it lists+ (`tree_python_sources`), and the API server on the Python of a method tree a request sends. The+ generated `python-structures` projection, left as generated, is not a violation (`is_generated_structures_module`).Args:- sources: POSIX relative path to source text, as the sandbox-hosted loader captures it.+ sources: POSIX relative path to source text, as the sandbox-hosted loader reads it.Returns:One violation per offending source, ordered by relative path.@@ -234,7 +234,7 @@ def ensure_no_structured_content_in_library_sources(*, sources_by_dir: Mapping[Pthe directory itself: on a host that directory is a temporary one, which is not the caller's to read.Args:- sources_by_dir: For each library directory of the load, the Python sources it would ship,+ sources_by_dir: For each library directory of the load, the text of its Python files,keyed by POSIX relative path.Raises:diff --git a/pipelex/pipe_operators/func/pipe_func_python.py b/pipelex/pipe_operators/func/pipe_func_python.pyindex 0816a55ff..03634eb7b 100644--- a/pipelex/pipe_operators/func/pipe_func_python.py+++ b/pipelex/pipe_operators/func/pipe_func_python.py@@ -5,9 +5,11 @@ A `function_name` is an import path from an import root, which is one of three p- **The method tree** the step's bundle was read as a member of, on this host's disk (`mthds/docs/spec/method-tree.md`,"Python Modules"). The module is located among the tree's files with `mthds`' `locate_function`, and imported underthe process's hold on the tree's Python (`pipelex.core.method_trees.tree_python`).-- **The Python submitted with a bundle parsed from a content string**, which a sandbox-hosted deployment captures from- its library directories and sends to the sandbox with the call. Nothing imports it in this process: the step is- validated from the captured text.+- **The Python submitted with a bundle parsed from a content string**, on a sandbox-hosted deployment: the files+ submitted with the content strings and those of a library directory holding no bundle make one tree the library+ assembles, at whose root the bundle sits. Nothing imports them in this process: the step is validated from the text+ of the tree's Python, read from the local method file store, and a call names the tree by its digest, for whoever+ runs the call to read its files through the method file store and hand them to the sandbox.- **This process's own import path**, for a bundle parsed from a content string in `direct` mode, such as a bundle aprogram builds in memory beside its own modules. The module is located through the import system's finders withoutimporting it, then imported as any module of the program is.diff --git a/pipelex/system/configuration/pipe_func_config.py b/pipelex/system/configuration/pipe_func_config.pyindex 8e82c67de..a1911617e 100644--- a/pipelex/system/configuration/pipe_func_config.py+++ b/pipelex/system/configuration/pipe_func_config.py@@ -8,9 +8,9 @@ class PipeFuncConfig(ConfigModel):# plugins populate (the config-selected-singleton seam, sibling of runtime.storage.method). An open# string token: "direct" (core, in-process — imports and runs the customer function here) is the# default; "daytona" (our Daytona sandbox plugin) runs it out-of-process. Any non-"direct" mode is a remote/sandbox- # backend: library loading captures the method's files as they are (onto the crate) instead of- # importing any of them, a PipeFunc's validation proves its function's form from the captured source,- # and the function is imported, checked and run inside the sandbox, never here. This is a hosted-deploy concern, not a+ # backend: library loading imports none of the method's Python, scanning its text for structure classes+ # instead, a PipeFunc's validation proves its function's form from its module's text, and the function is+ # imported, checked and run inside the sandbox, which receives the files of its step's tree, never here. This is a hosted-deploy concern, not a# client preference, so it is intentionally absent from the .pipelex/ override file.## Lives in its own module (not configs.py) so the PipeFuncExecutorRegistry can type its factorydiff --git a/tests/integration/pipelex/pipeline/test_resolve_crate_from_method_dir.py b/tests/integration/pipelex/pipeline/test_resolve_crate_from_method_dir.pyindex 5883587ae..be1475f82 100644--- a/tests/integration/pipelex/pipeline/test_resolve_crate_from_method_dir.py+++ b/tests/integration/pipelex/pipeline/test_resolve_crate_from_method_dir.py@@ -141,6 +141,8 @@ class TestResolveCrateFromMethodDir:assert item.error_type == PipeValidationErrorType.UNRESOLVED_PACKAGE_DEPENDENCYassert item.source == "host.mthds"assert f"{ADDRESS_DEPENDENCY_REFUSAL_MARKER} 'github.com/org/pkg'" in item.message+ # Its advice is what the caller of a crate route can do: send the package's files beside the method's.+ assert "`dependencies`" in item.message# A hosted run tells it apart by the problem item's code and parameters, the package it names included.problem_errors = exc_info.value.to_problem(view=ProblemView.CALLER).errorsassert problem_errors is not None