Skip to content

fix/Runner-pipe-code-option · L-261117-ca9158 - #112

Merged
lchoquel merged 2 commits into
devfrom
fix/Runner-pipe-code-option
Nov 17, 2026
Merged

lchoquel merged 2 commits into
devfrom
fix/Runner-pipe-code-option

Conversation

@lchoquel

@lchoquel lchoquel commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

  • The local Pipelex runner refuses a pipe code that is not a pipe reference of the standard's grammar, and passes the code to pipelex run pipe last, behind --.
  • A pipe code starting with - reached the pipelex command line as a bare positional and was read as one of its options (-L <dir>, --output-dir …), which matters to any application that forwards an end user's pipe code.

Behaviour changes

  • PipelexRunner.execute(pipe_code="-L"), or any code outside the grammar → raises PipelexRunnerError before the CLI is looked up, anything is written or the CLI runs, on both the run pipe path and the run bundle --pipe path (it used to run pipelex … run pipe -L …).
  • pipelex run pipe <code> [options] → pipelex run pipe [options] -- <code>.

Changes

Runner

  • mthds/runners/pipelex/runner.py: a pipe-reference pattern built from the standard's "Pipe Reference Syntax" (a bare code, a domain-qualified one, or a package alias followed by a domain and the code, every part [a-z][a-z0-9_]*), checked by _ensure_pipe_ref at the top of execute; the run pipe positional now goes last, behind --, which pipelex's Typer and Click versions accept (checked with a Typer app of the same shape under pipelex's own environment).
  • The other positionals the runner builds are its own: bundle <dir> and validate bundle <dir> take the absolute path of the run's temporary directory, and -L, -i, -o and --working-memory-path are option values, which Click consumes whatever their first character.

Tests

  • tests/unit/test_pipelex_runner.py: each form of pipe reference reaches the CLI as the last argument behind --; codes outside the grammar, those starting with a dash first, are refused with and without files, with nothing written and the CLI never run. Cases live in PipeCodeCases in tests/unit/test_data.py.

How it was verified

  • make agent-check: ruff, pyright (0 errors), mypy (Success: no issues found in 134 source files) and the error-registry check all passed.
  • DO_NOT_TRACK=1 make agent-test: All tests passed.
  • pytest tests/unit/test_pipelex_runner.py: 31 passed.

Documentation

  • docs/runners.md: the PipelexRunner entry states the pipe-code rule and the --, and now says execute uses pipelex run pipe when given no files and that version raises until the CLI reports its protocol version, which it already did.
  • CHANGELOG.md: a ### Security entry under [Unreleased].

Not done

  • The JS twin of this fix belongs to mthds-js and is tracked there separately.
  • mthds-python's own is_snake_case is stricter than the standard's [a-z][a-z0-9_]* (it refuses doubled and trailing underscores); the runner follows the standard, and aligning the package is tracked in L-261117-990baf.

Closes L-261117-ca9158

🤖 Generated with Claude Code

https://claude.ai/code/session_019TF9N3aUmciysxinm72XqX


Summary by cubic

Fixes the local PipelexRunner so a pipe code starting with - can no longer be read as a pipelex CLI option. execute now validates pipe_code against the standard's pipe-reference grammar before anything is written or the CLI runs, and pipelex run pipe receives the code last, behind --.

  • A valid reference is bare (answer), domain-qualified (legal.contracts.answer), or package-qualified with its domain (docproc->extraction.extract_text); every part matches [a-z][a-z0-9_]*, and a package alias is always followed by a domain, so docproc->extract_text is refused.
  • Codes outside the grammar raise PipelexRunnerError on both the run pipe and run bundle --pipe paths, before the CLI is looked up or anything is written.
  • Adds unit tests covering every valid reference form and a set of refused codes, with nothing written and the CLI never run.
  • Updates docs/runners.md and adds a CHANGELOG.md security entry.

Written for commit cb5d081. Summary will update on new commits.

View guided diff Turn on auto-fix

…runner

PipelexRunner.execute handed the caller's pipe code to `pipelex run pipe`
as a bare positional, so a code starting with `-` was read as an option of
the CLI. The code is now checked against the standard's pipe-reference
grammar (bare, domain-qualified or package-qualified, every part matching
[a-z][a-z0-9_]*) before anything is written or the CLI runs, on both the
`run pipe` and the `run bundle --pipe` paths, and `run pipe` now receives
the code last, behind `--`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TF9N3aUmciysxinm72XqX
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T18:17:16.104877Z 01d9004 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01d9004fe4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread mthds/runners/pipelex/runner.py Resolved
The standard's package-qualified form is `alias->domain.pipe_code`, and
pipelex keys a dependency's pipes that way, so `alias->pipe_code` is
refused with the other codes outside the grammar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TF9N3aUmciysxinm72XqX
@lchoquel

Copy link
Copy Markdown
Contributor Author

Review pass: profile 1, round 1 (bar open), reviewers cubic and Codex (codex:review), both of which produced a review of 01d9004.

  • Codex: no findings.
  • cubic: one P3, the runner's pipe-reference pattern follows the standard's [a-z][a-z0-9_]* while the package's own is_snake_case is stricter. Deferred, unverified, to L-261117-990baf, which aligns the package with the standard.
  • PR thread (package alias with no domain): fixed in cb5d081, which requires a domain after alias->.

Verdict: converged — the round-1 pass at profile 1 was clean with full coverage, at or above the required depth of 1; nothing further is warranted

@lchoquel
lchoquel merged commit fcde5c3 into dev Nov 17, 2026
22 checks passed
@lchoquel
lchoquel deleted the fix/Runner-pipe-code-option branch November 17, 2026 18:22
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant