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/Validator-graph-target · L-260925-7a9d26 (#1253)
Louis Choquel848486a4be38
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 102b61dec..e60c139ab 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,7 @@### Changed+- **`BundleValidatorProtocol.validate_bundles` requires `graph_pipe_code` (Breaking)**: a host names the pipe the best-effort graph arm dry-runs, resolved the way a run resolves its entry pipe, with `None` keeping the primary blueprint's `main_pipe`. A host validating a fetched method package by address can now graph the pipe its manifest names, which a bundle declaring no `main_pipe` of its own left without a graph. Every validator implementation must accept the argument and hand it to its graph arm, and a host must pass it; `DirectBundleValidator` forwards it to `validate_bundles_in_process`.- **The quick start shows both agents' installs**: the README's Codex install now starts open beside the Claude Code one instead of folded, and the documentation site links its content tabs, so choosing Codex on one page selects it on every page.- **The documentation's front page takes the README's hero**: it opens on "Turn your expertise into an AI-powered App, MCP or API" and the paragraph on building a method with your coding agent and where it runs. **Get Started** now follows the buttons, and **What a Method Looks Like**, which now introduces the MTHDS language, and **Why Methods?** come after it. The front page's entry in the navigation is now **Overview**.diff --git a/docs/under-the-hood/orchestrator-plugins.md b/docs/under-the-hood/orchestrator-plugins.mdindex a09d27e25..24da1c672 100644--- a/docs/under-the-hood/orchestrator-plugins.md+++ b/docs/under-the-hood/orchestrator-plugins.md@@ -78,6 +78,7 @@ class BundleValidatorProtocol(Protocol):allow_signatures: bool,library_dirs: "Sequence[Path] | None",caller_identity: CallerIdentity | None,+ graph_pipe_code: str | None,) -> BundleValidationVerdict: ...```@@ -92,6 +93,8 @@ The seam is deliberately typed at the MTHDS-protocol level (`ValidationReport` f`caller_identity` is who asked for the validation: the `user_id` and `extras` the host would state on a run, as a `CallerIdentity` (`pipelex/system/caller_identity.py`). It is required, with `None` meaning "nobody", so a host cannot leave it out by accident: a validation is not a run and has no `RunMetadata` to carry its caller, and without this argument its telemetry — the sweep's `pipe_dry_run` event and its dry runs — reported under the deployment's configured id. The in-process arm hands it to `validate_bundles_in_process`, which makes it the ambient caller for the whole pass; a worker-dispatched arm must carry it to the worker and do the same there. A `PipelexMTHDSProtocol` exposes the caller it was built for as `caller_identity`, so a host runner passes `caller_identity=self.caller_identity`.+`graph_pipe_code` names the pipe the verdict's best-effort `graph_spec` is drawn from. It is resolved the way a run resolves its entry pipe, so a bare pipe code or a qualified `domain.pipe_code` both work, and `None` keeps the default target: the `main_pipe` of the primary blueprint, the first one declaring one. A host passes a target when it knows the pipe a selector-less run of the same request would execute and the bundles do not say so themselves — a method package fetched by address, whose manifest's `main_pipe` outranks the bundles' own declaration and may be the only entry pipe there is. It is required for the same reason as `caller_identity`: a validator that dropped it would silently graph another pipe. A target that does not resolve degrades the graph to `None` like any other graph-arm failure and never changes the verdict. The in-process arm hands it to `validate_bundles_in_process`; a worker-dispatched arm must carry it to the worker's graph arm.+A plugin contributes one per token, right next to its orchestrator:```pythondiff --git a/pipelex/pipeline/direct_bundle_validator.py b/pipelex/pipeline/direct_bundle_validator.pyindex 6fddb8033..e18572be7 100644--- a/pipelex/pipeline/direct_bundle_validator.py+++ b/pipelex/pipeline/direct_bundle_validator.py@@ -43,6 +43,7 @@ class DirectBundleValidator:allow_signatures: bool,library_dirs: Sequence[Path] | None,caller_identity: CallerIdentity | None,+ graph_pipe_code: str | None,) -> PipelexValidationReport | ErrorReport:try:return await validate_bundles_in_process(@@ -50,6 +51,7 @@ class DirectBundleValidator:mthds_sources=mthds_sources,library_dirs=library_dirs,allow_signatures=allow_signatures,+ graph_pipe_code=graph_pipe_code,log_context="API validate",caller_identity=caller_identity,)diff --git a/pipelex/plugins/bundle_validator_registry.py b/pipelex/plugins/bundle_validator_registry.pyindex db9e6eaae..7eac883cc 100644--- a/pipelex/plugins/bundle_validator_registry.py+++ b/pipelex/plugins/bundle_validator_registry.py@@ -63,6 +63,16 @@ class BundleValidatorProtocol(Protocol):must attribute its telemetry to that caller, never to the deployment's configuredfallback. A worker-dispatched arm carries it to the worker and hands it to the sweepthere.++ ``graph_pipe_code`` names the pipe the best-effort graph arm dry-runs, resolved the way a+ run resolves its entry pipe, so a bare code or a qualified ref both work. ``None`` keeps+ the default target, the primary blueprint's ``main_pipe``. A host that knows the pipe a+ run of the same request would execute (the ``main_pipe`` of a fetched package's manifest,+ which the bundles themselves may not declare) passes it here so the graph shows that pipe.+ It is required for the same reason as ``caller_identity``: a validator that silently+ dropped it would graph a different pipe than the one the host asked for. A target that+ does not resolve degrades the graph to ``None``, like any other graph-arm failure, and+ never changes the verdict."""async def validate_bundles(@@ -73,6 +83,7 @@ class BundleValidatorProtocol(Protocol):allow_signatures: bool,library_dirs: "Sequence[Path] | None",caller_identity: CallerIdentity | None,+ graph_pipe_code: str | None,) -> BundleValidationVerdict: ...diff --git a/tests/unit/pipelex/pipeline/test_direct_bundle_validator.py b/tests/unit/pipelex/pipeline/test_direct_bundle_validator.pyindex 13c227d5a..15d657973 100644--- a/tests/unit/pipelex/pipeline/test_direct_bundle_validator.py+++ b/tests/unit/pipelex/pipeline/test_direct_bundle_validator.py@@ -4,7 +4,8 @@ Pins the wrapper's two branches with the in-process sweep mocked out (its own recovered by test_validation_report.py / the integration test_protocol_validate.py): a successfulsweep is returned verbatim as the valid arm; a ``ValidateBundleError`` is converted to itsstructured ``ErrorReport`` (the invalid arm) rather than propagated. Also pins argument-passthrough, including the ``library_dirs`` host context and the ``log_context`` label.+passthrough, including the ``library_dirs`` host context, the explicit ``graph_pipe_code`` target+and the ``log_context`` label."""from __future__ import annotations@@ -39,6 +40,7 @@ class TestDirectBundleValidator:allow_signatures=True,library_dirs=[Path("lib_dir")],caller_identity=CallerIdentity(user_id="user-42", extras={"organization": "org_acme"}),+ graph_pipe_code="extract_document_markdown",)assert verdict is report@@ -47,6 +49,7 @@ class TestDirectBundleValidator:mthds_sources=["domain.mthds"],library_dirs=[Path("lib_dir")],allow_signatures=True,+ graph_pipe_code="extract_document_markdown",log_context="API validate",caller_identity=CallerIdentity(user_id="user-42", extras={"organization": "org_acme"}),)@@ -65,6 +68,7 @@ class TestDirectBundleValidator:allow_signatures=False,library_dirs=None,caller_identity=None,+ graph_pipe_code=None,)assert isinstance(verdict, ErrorReport)@@ -85,4 +89,5 @@ class TestDirectBundleValidator:allow_signatures=False,library_dirs=None,caller_identity=None,+ graph_pipe_code=None,)diff --git a/tests/unit/pipelex/plugins/test_bundle_validator_registry.py b/tests/unit/pipelex/plugins/test_bundle_validator_registry.pyindex 90d141c98..7a5da4b8d 100644--- a/tests/unit/pipelex/plugins/test_bundle_validator_registry.py+++ b/tests/unit/pipelex/plugins/test_bundle_validator_registry.py@@ -39,6 +39,7 @@ class _FakeBundleValidator:allow_signatures: bool,library_dirs: Sequence[Path] | None,caller_identity: CallerIdentity | None,+ graph_pipe_code: str | None,) -> PipelexValidationReport | ErrorReport:raise NotImplementedError