Skip to content

fix(pipeline): refuse shadowed job steps (ITL-1767) - #671

Merged
eywalker merged 6 commits into
mainfrom
eywalker/refuse-colliding-steps-at-compile
Nov 30, 2026
Merged

eywalker merged 6 commits into
mainfrom
eywalker/refuse-colliding-steps-at-compile

Conversation

@eywalker

@eywalker eywalker commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Related to ITL-1767. Distinct job steps that would occupy the same execution graph vertex are refused before the graph can run. The error names both steps and suggests putting them in separate jobs or using only one form.

Release decision

The developer chose to ship the construction-time refusal on November 30, 2026 at 03:48 UTC.

let's actually refuse with (b) -- the two 'working' cases sounds like nothing more than special cases where the fault just fails to show

The two cases that worked in review are refused by this decision. The same collision is refused when the join keys are null and when both branches already hold current results.

Structure Final behavior
Direct self-Join alongside a two-slot Join over the same source, direct captured first Refused at construction
Same pair, two-slot Join captured first Refused at construction
Same function pod on two slots bound to one source Refused at construction in either capture order
Different function pods on two slots bound to one source Preserved
Join of both slots with a third source Preserved
Two-slot self-Join alone Preserved
Direct self-Join alone Preserved
Identical pipeline repeated with separate labels Preserved
Direct self-MergeJoin alongside its two-slot form over the same source Refused at construction in either capture order
Direct self-SemiJoin alongside its two-slot form over the same source Refused at construction in either capture order
Pending job with equal operator steps on aliased slots Saving and read-only loading are preserved. Execution still checks for collisions.
Temporarily aliased slots during recovery from a rejected capture Restoring the bindings and running the job are preserved

The check runs during explicit compilation, when accepting new captures, after applying bindings in PipelineJob.from_pipeline, and before building an execution graph after later binding, including load-only replay. The regression matrix covers both orchestrators, capture order, save/load of preserved structures, and the existing load error for previously saved jobs with colliding function stubs. ITL-1767 remains open for independent execution of the conflicting steps.

Summary by CodeRabbit

  • Bug Fixes

    • Jobs now reject distinct steps that would share an execution position, preventing one step’s current-run results from being lost.
    • Conflicting jobs are rejected before execution begins, including when source bindings create the conflict. Sharing sources remains supported when it does not create conflicting steps.
  • Documentation

    • Added guidance on job graph limitations and ways to structure jobs when a direct self-join and an equivalent slot-based join would conflict.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

Pipeline job compilation, source binding, and run preparation now reject distinct non-source steps that compare equal as DAG keys. Tests cover rejected collisions, runnable jobs, and saved-job loading. Documentation describes the limitation and workarounds.

Changes: Job step identity validation

Layer / File(s) Summary
Compilation-time collision validation
src/orcapod/pipeline/base.py, src/orcapod/pipeline/job.py, tests/test_pipeline/test_shadowed_job_steps.py, changelog.d/ITL-1767.md, docs/concepts/pipeline-job.md, docs/dev/design_issues/ITL-1767-PJCOLLISION1.md, docs/reference/hashing.md
Base compilation accepts an optional validator and invokes it before publishing compiled nodes. PipelineJob uses the validator to reject distinct non-source steps that compare equal as DAG keys. Tests cover compile-time collision cases; documentation describes the collision and affected job patterns.
Binding and run-preparation validation
src/orcapod/pipeline/job.py, tests/test_pipeline/test_shadowed_job_steps.py, tests/test_pipeline/test_source_object_registration.py
Source binding and run preparation reject colliding steps. Run preparation validates runnable nodes before marking the run unfinished. Tests cover later source bindings, execution and reload behavior, and loading a saved job with colliding stubs.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: High

Sequence Diagram(s)

sequenceDiagram
  participant PipelineJob
  participant AbstractPipelineBase
  participant ShadowedStepValidator
  PipelineJob->>AbstractPipelineBase: compile with node validator
  AbstractPipelineBase->>ShadowedStepValidator: validate ordered nodes
  ShadowedStepValidator-->>AbstractPipelineBase: return or raise ValueError
  AbstractPipelineBase-->>PipelineJob: publish compiled state after validation
Loading

Possibly related PRs

Merge Risk: Minimal · up to 4a433

The change makes pipeline jobs refuse distinct steps that would share one execution-graph vertex, with documentation and tests alongside. No concrete merge-blocking issue was identified.

Security architecture risk: Low · up to 4a433

The change prevents two distinct job steps from silently sharing one execution slot. The remaining risk is limited to recovery: after a rejected update, an existing job can still run its previous graph without the newly recorded steps.

Retained concerns

  • Trivial · reliability · inferred: If compilation of newly recorded steps fails on an already compiled job, the new invocations remain pending while the previous graph stays marked compiled. If the caller catches the error and runs the job, preflight checks only the previous graph and may execute it without the pending steps. The candidate is not executed, but the failure boundary does not make clear which graph a subsequent run will use.

View findings in the submitted review

Security review details

Security Blast Radius

  • inferred — The demonstrated effect is on execution and result integrity within the job whose steps and bindings produce the collision. The changed paths do not demonstrate added authority over another job or store.

Trust Boundaries and Controls

  • observed — Source consistency and restriction checks still apply in compilation and binding. Run preparation retains the restriction check before source refresh, computation, and write setup.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(pipeline): refuse shadowed job steps (ITL-1767)" names the main change. The PR makes PipelineJob compilation and execution refuse distinct job steps that map to the same execution-graph…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(pipeline): refuse shadowed job steps (ITL-1767)" names the main change. The PR makes PipelineJob compilation and execution refuse distinct job steps that map to the same execution-graph vertex. The title uses the same term as the code and docs (shadowed job steps) and includes the issue ID. It is specific and concise.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@coderabbitai coderabbitai 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.

Architecture findings (1)

Advisory architecture findings (1)

  • Trivial — A collision refusal after incremental capture can leave an already compiled job with newly recorded invocations and the previous executable graph. The capture path records edits before context exit, but refusal neither rolls them back nor makes the previous graph ineligible for run or save. If a caller handles the error and reuses the job before resolving the rejected edits, it can execute or persist the old graph without the requested changes. The base did not have this collision-triggered refusal; the exposure is confined to the reused job and its existing stores.
Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ec762d6 and f306701.

Files selected for processing: 8

  • changelog.d/ITL-1767.md
  • docs/concepts/pipeline-job.md
  • docs/dev/design_issues/ITL-1767-PJCOLLISION1.md
  • docs/reference/hashing.md
  • src/orcapod/pipeline/base.py
  • src/orcapod/pipeline/job.py
  • tests/test_pipeline/test_shadowed_job_steps.py
  • tests/test_pipeline/test_source_object_registration.py

Limit details: You’ve used the included review currently available. Your 101 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit
Additional context used

Code guidelines: 1

CLAUDE.md — auto-discovered
Path-based instructions: 2

Source excerpt: Every fenced `python` block in `README.md`, `docs/index.md`, `docs/getting-started.md`, `docs/troubleshooting.md`, `docs/concepts/`, `docs/reference/` and `docs/tutorial/` is executed by `tests/test_docs/test_doc_samples.py`...

CodeRabbit inference engine (CLAUDE.md)

Files:

  • docs/concepts/pipeline-job.md
  • docs/reference/hashing.md
Source excerpt: The file holds only the text that would have gone under the release heading in `CHANGELOG.md`: the same category headings `CHANGELOG.md` uses (`### Breaking changes and migration`, `### Added`, `### Changed`, `### Fixed`, `#...

CodeRabbit inference engine (CLAUDE.md)

Files:

  • changelog.d/ITL-1767.md

@coderabbitai coderabbitai 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.

Architecture findings (1)

Advisory architecture findings (1)

  • Trivial — If compilation of newly recorded steps fails on an already compiled job, the new invocations remain pending while the previous graph stays marked compiled. If the caller catches the error and runs the job, preflight checks only the previous graph and may execute it without the pending steps. The candidate is not executed, but the failure boundary does not make clear which graph a subsequent run will use.
Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f306701 and 4a433aa.

Files selected for processing: 7

  • changelog.d/ITL-1767.md
  • docs/concepts/pipeline-job.md
  • docs/dev/design_issues/ITL-1767-PJCOLLISION1.md
  • src/orcapod/pipeline/base.py
  • src/orcapod/pipeline/job.py
  • tests/test_pipeline/test_shadowed_job_steps.py
  • tests/test_pipeline/test_source_object_registration.py

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Review details

Additional context used

Code guidelines: 1

CLAUDE.md — auto-discovered
Path-based instructions: 5

Source excerpt: Every fenced `python` block in `README.md`, `docs/index.md`, `docs/getting-started.md`, `docs/troubleshooting.md`, `docs/concepts/`, `docs/reference/` and `docs/tutorial/` is executed by `tests/test_docs/test_doc_samples.py`...

CodeRabbit inference engine (CLAUDE.md)

Files:

  • docs/concepts/pipeline-job.md
Source excerpt: `docs/` is the only source.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • docs/concepts/pipeline-job.md
  • docs/dev/design_issues/ITL-1767-PJCOLLISION1.md
Source excerpt: An entry is the file `docs/dev/design_issues/-.md` (e.g.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • docs/dev/design_issues/ITL-1767-PJCOLLISION1.md
Source excerpt: The file holds only the text that would have gone under the release heading in `CHANGELOG.md`: the same category headings `CHANGELOG.md` uses (`### Breaking changes and migration`, `### Added`, `### Changed`, `### Fixed`, `#...

CodeRabbit inference engine (CLAUDE.md)

Files:

  • changelog.d/ITL-1767.md
Source excerpt: Use [Google style](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) Python docstrings everywhere.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • src/orcapod/pipeline/base.py
  • src/orcapod/pipeline/job.py
  • tests/test_pipeline/test_shadowed_job_steps.py
  • tests/test_pipeline/test_source_object_registration.py

@eywalker
eywalker merged commit d5c7f14 into main Nov 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant