Skip to content

fix(pipeline): refuse graph changes on loaded jobs (ITL-1560) - #608

Draft
eywalker wants to merge 38 commits into
mainfrom
eywalker/itl-1560-a-loaded-job-loses-its-graph-when-a-step
Draft

eywalker wants to merge 38 commits into
mainfrom
eywalker/itl-1560-a-loaded-job-loses-its-graph-when-a-step

Conversation

@eywalker

@eywalker eywalker commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #577 (merge that first)

Mentions ITL-1560
Mentions ITL-1559

What changed and why

PipelineJob.load restores compiled nodes without the recorded invocations that built them. Capture could replace the restored graph with a new branch, and recompilation could erase it. As a release stopgap, the job and its cached blueprint raise RuntimeError on capture or recompilation before changing the graph. Build the job from its pipeline to change the graph. Source binding, load-only runs, stored views, and saving again remain supported.

PipelineJob exposes no register method. The from_invocations classmethod constructs a separate job even when accessed through a loaded instance. The stopgap uses #577's existing prepare phase, so all active trackers validate a step before any records it. The loaded-job refusal runs before source checks on that tracker. Full support for editing a loaded graph is tracked by ITL-1559.

Review findings and tests

  • P2 — Tracker fan-out. test_loaded_job_refusal_leaves_every_active_job_unchanged exercises function, operator, and side-effect recording with both registration orders. In each case, the live job retains its original graph and the loaded job refuses the step. test_loaded_job_refuses_graph_changes verifies ITL-1560 takes precedence over foreign-slot validation, and checks graph and binding identity, held results, and sync and async follow-up runs.
  • P2 — The cached blueprint could save an empty graph. test_loaded_job_blueprint_refuses_edits_and_preserves_saved_graph exercises compile, context capture, and direct recording on loaded.pipeline, then saves and reloads the graph and verifies its load-only results. The shared guard protects the exact object save() serializes, including the compiled_pipeline alias. Keeping that blueprint intact also keeps its existing serialization behavior for saved schemas and node metadata.
  • Existing test audit. No test on the original base expected to capture into or compile a loaded job, and no published documentation sample depends on either operation. The incoming fix(pipeline): reject conflicting fixed source rows (ITL-1469) #577 test test_recompiling_a_loaded_job_preserves_its_sources_mapping expected compilation to succeed and checked only the bindings. Renamed it to test_refusing_to_recompile_a_loaded_job_preserves_its_sources_mapping and verified the refusal preserves its nodes and bindings. test_loaded_job_can_still_bind_sources covers both binding paths followed by load-only runs.
  • P3 — Known limitations. loaded.as_pipeline() and a loaded function node's as_node() can raise AttributeError because the saved job has no function pod. These pre-existing limitations are unchanged.

The stopgap is documented in both saving and loading sections, both agent instruction files, the ITL-1560 known-limitations fragment, and the existing design log entry (LJ5).

Validation

The targeted suite passed with 1,183 tests and one expected failure, including the API-reference check after #614, the SpiralDB range tests from #577, and the data-function type tests after syncing main. Ruff lint and format checks passed, basedpyright exited 0, and all golden hashes matched. The ITL-1560 diff matched exactly after merging the updated stack and syncing main.

eywalker and others added 29 commits November 25, 2026 13:51
…mns differ

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A source id names a dataset; key columns only name its rows. Fixed sources
with different key columns are compared as a multiset of tags and data, and
the slot-name refusal claims they differ only in key columns only when every
source is fixed. Adds RootSource.key_columns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… slots

Developer decision (2026-11-26): until ITL-1506, sources sharing a source id
and schema with different key columns are refused at capture, bind, load and
run, by require_consistent_sources. Fixed sources with equal rows are reported
as differing only in key columns; a source read later is not compared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hecks

Every pair of fixed sources is compared by its own rule, so the diagnosis no
longer follows slot order; unknown key columns neither cause nor hide a
key-column refusal; a job node's run() checks the sources it reads as
job.run() does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RootSource.holds_fixed_rows answers without a digest; the consistency check
memoizes the exact and multiset digests a pair needs; in-memory tables hold
their digests. Documents InconsistentSourceError on side-effect run().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops the lifetime digest cache on in-memory tables, which can share memory
with a caller's frame or array; a check digests each underlying source (a
bound proxy as its delegate) at most once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… run on several columns

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…compared

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@codecov

codecov Bot commented Nov 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/orcapod/pipeline/job.py 96.86% <100.00%> (+0.05%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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