feat(protocol)!: PipelexRunner → PipelexMTHDSProtocol — implement the MTHDS Protocol locally#985
Conversation
… MTHDS Protocol locally Phase B2 of the MTHDS Protocol unification (workspace docs/plans/mthds-protocol-20260610/03-pipelex.md). - mthds pin bumped to >= 0.4.0 (dev source: git ref of mthds-python refactor/protocol until the PyPI release is cut at the Phase B checkpoint). - PipelexRunner → PipelexMTHDSProtocol implementing MTHDSProtocol: method renames execute_pipeline → execute, start_pipeline → start (still NotImplementedError locally — async execution is the API layer's; gains the protocol's run_id/callback_urls/method_id kwargs). - New protocol methods: validate() wraps validate_bundle (blueprints + per-pipe structures mapped into the protocol ValidationReport), models() wraps the builder's list_models into the protocol ModelDeck, version() reports protocol_version 0.1.0 with the installed pipelex version. - Response classes: PipelexPipelineExecuteResponse → PipelexRunResult, PipelexPipelineStartResponse → PipelexStartAck; wire fields run_id/state on the response models ONLY — runtime internals (PipeOutput, tracing, telemetry, Temporal) keep pipeline_run_id per master D1. - Agent CLI API path uses MthdsAPIClient directly (ApiRunner deleted upstream), now context-managed so the HTTP client closes. - Generated runner code (builder) emits the new API. - Docs swept for the renames; CHANGELOG v0.33.0 with the pipelex-worker lockstep note (Temporal payload renames ride this pin at Phase C). Verified: make agent-check clean (ruff, plxt, pyright, mypy on the full tree); make agent-test green (full suite); live CLI smoke — pipelex run bundle (real LLM) + validate bundle both pass through the refactored runner. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Greptile SummaryThis PR moves the local runner onto the MTHDS protocol shape. The main changes are:
Confidence Score: 3/5This should wait for fixes before merging.
Important Files Changed
|
There was a problem hiding this comment.
1 issue found across 54 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…names Review fixes: - validate(): restore the caller's current-library and tear down the validation library on the success path too (validate_bundle deliberately leaves it open for the CLI surfaces; this protocol wrapper is long-lived). - version(): tolerate a source checkout without an installed distribution (PackageNotFoundError -> "unknown") instead of failing the public handshake. - Docs: rewrite the stale bare `execute(...)` examples (libraries.md, pipe-output.md, executing-pipelines.md) onto the real PipelexMTHDSProtocol API, incl. the mthds_content -> mthds_contents fix. Protocol wire (D1) follow-up surfaced by the pipelex-api work: the webhook completion payload now carries run_id/state (protocol spellings) alongside the legacy pipeline_run_id/status for one transitional release; both new keys join the reserved webhook payload set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Review triage (greptile + cubic) — all five findings accepted and fixed in the latest commit:
Also in the same push (cross-repo follow-up from the pipelex-api phase): the webhook completion payload now carries
|
…revision) User ruling: pipeline_run_id keeps its name everywhere (wire AND internals — the boundary mapping disappears); only pipeline_state → state is renamed. Webhook completion payloads carry pipeline_run_id + state (+ transitional status alias). start()'s kwarg follows. Full agent-test suite green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Heads-up: D1 was revised by user ruling during C2 — the run identifier stays |
…n error
A DocumentContent/ImageContent input with a blank url resolved as local
path '' → Path('') → '.', and the uncaught IsADirectoryError escaped the
input normalizer as a sanitized 500 on the hosted /v1/start (observed on
dev 2026-06-11; only FileNotFoundError was caught).
New PipelineInputContentError (ErrorDomain.INPUT → 422 at the API layer,
caller-facing message): raised for blank urls before any resolution, and
for the whole OSError surface (IsADirectoryError, PermissionError, ...)
around the local-file read. Error page generated.
Full agent-test suite green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Dev-debug fix: a blank |
… extra passthrough, no named extension args start() drops callback_urls/method_id (server-specific args never ride the protocol interface); execute() and start() gain the protocol's generic extra param — the local runtime defines no extension args and rejects a non-empty extra. Bumps the mthds lock to the matching SDK commit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ipelexVersionInfo/ModelDeck/ValidationReport
The protocol's response models are now base-only (VersionInfo={protocol_version, runner_version}, empty ValidationReport, models-only ModelDeck); pipelex's identification, routing metadata (aliases/waterfalls) and validation artifacts (blueprint/pipe_structures) are its own subclass extensions. Bumps the mthds lock.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…runner pkgs) Pin mthds at 33fcdf0 (v0.4.0). Repoint imports: mthds.models.* → mthds.protocol.*, mthds.client.* / runners.api_runner / runners.results → mthds.runners.api.*, runners.exceptions → runners.api.exceptions, runners.runs → runners.api.runs. Adopt the split run response: pipeline_response now defines PipelexRunResultExecute (RunResultExecute — pipe_output required) and PipelexRunResultStart (RunResultStart — id only), replacing the old PipelexRunResult/PipelexStartAck. Drop the now-dead pipe_output None-guards in the run CLIs. Broaden the stuff-factory test data type to StuffContentOrData | DictStuff (the protocol union no longer names the dict form). make agent-check green; agent-test green except a pre-existing OpenAI 401 (env key). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md # docs/building-methods/pipes/executing-pipelines.md # pipelex/pipe_run/dry_run_pipeline.py # tests/e2e/pipelex/pipes/pipe_controller/pipe_sequence/test_pipe_sequence_multiplicity.py # tests/integration/pipelex/pipeline/test_mock_usage_direct.py
Summary
Phase B2 of the MTHDS Protocol unification program (workspace
docs/plans/mthds-protocol-20260610/03-pipelex.md). The runtime now implements the MTHDS Protocol standard (mthds-ai/mthds#44) throughmthds >= 0.4.0(mthds-ai/mthds-python#25).Breaking changes
PipelexRunner→PipelexMTHDSProtocol, implementingMTHDSProtocol:execute_pipeline→execute,start_pipeline→start(stillNotImplementedErrorlocally — async execution belongs to the API layer; signature gains the protocol'srun_id/callback_urls/method_id).PipelexPipelineExecuteResponse→PipelexRunResult,PipelexPipelineStartResponse→PipelexStartAck; wire fieldsrun_id/stateon the response models ONLY — runtime internals (PipeOutput, tracing, telemetry, Temporal) keeppipeline_run_idper master D1 (deep internal rename is explicitly out of scope).refactor/protocolgit ref via[tool.uv.sources]; the source override drops when the PyPI release is cut at the Phase B checkpoint.Added
validate/models/versionon the runner:validatewrapsvalidate_bundle(blueprints + per-pipe structures → protocolValidationReport);modelswraps the builder'slist_models→ protocolModelDeck;versionreportsprotocol_version0.1.0.Also
MthdsAPIClientdirectly (upstreamApiRunnerwrapper deleted), context-managed so the HTTP client closes.Verification
make agent-checkclean — ruff + plxt + pyright + mypy over the full tree.make agent-testgreen (full suite, exit 0).pipelex run bundlewith a real LLM call andpipelex validate bundleboth pass through the refactored runner; zerorunner/v1/platform/v1strings remain in the repo.Coordination
Blocks pipelex-api (05) which pins this release;
pipelex-workerbumps the same version in lockstep at Phase C.🤖 Generated with Claude Code
Summary by cubic
Implements the local MTHDS Protocol via
PipelexMTHDSProtocol(replacingPipelexRunner), aligning method names, response models, and wire fields; updates docs/CLI and pinsmthds >= 0.4.0via git. Adds clean input URL errors and protocol-compliant webhooks.Migration
PipelexRunner→PipelexMTHDSProtocol;execute_pipeline→execute,start_pipeline→start(still not implemented locally). Nocallback_urls/method_id; both methods acceptextraand reject non-empty values.pipeline_run_idstays (incl.startkwarg).PipelexPipelineExecuteResponse/PipelexPipelineStartResponse→PipelexRunResultExecute/PipelexRunResultStart(protocolRunResult*bases). Wire usesstate; run identifier remainspipeline_run_id.pipeline_run_id+state(plus transitionalstatus);stateis now a reserved webhook key.mthds.protocol.*andmthds.runners.api.*; Agent CLI usesMthdsAPIClient; builder emits the new API; docs updated (incl.mthds_contentsfix).mthdsto>= 0.4.0via a git source in[tool.uv.sources]until the PyPI release.New Features
validate: returns a protocolValidationReport; restores the caller’s current library and closes the validation library on success.models: returns a protocolModelDeck(optional category filter).version: reportsprotocol_version0.1.0and the installed Pipelex version; falls back to"unknown"for source checkouts.PipelineInputContentError(INPUT domain).Written for commit 8b34cc0. Summary will update on new commits.