Skip to content

test(pipeline): a chain built before a job equals the chain built inside it (ITL-1470) - #579

Closed
eywalker wants to merge 8 commits into
eywalker/itl-1387-build-a-pipeline-job-from-streams-madefrom
eywalker/itl-1470-a-stream-built-before-a-job-gets-other
Closed

eywalker wants to merge 8 commits into
eywalker/itl-1387-build-a-pipeline-job-from-streams-madefrom
eywalker/itl-1470-a-stream-built-before-a-job-gets-other

Conversation

@eywalker

@eywalker eywalker commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes ITL-1470.

Stacked on #500 (ITL-1387). The base of this pull request is #500's branch, so the diff is the test, the changelog fragment and the plan. It goes against main once #500 lands. There is no library change here: #500 is the fix.

Reading the diff. This branch was made from current main (5eb327a) with #500's branch merged in, and #500's branch is five commits behind main. Until #500's branch has main merged in, or the base of this pull request moves to main, the diff here also shows those five main commits. The files this pull request adds are three: tests/test_pipeline/test_stream_built_before_job.py, changelog.d/ITL-1470.md and docs/dev/plans/itl-1470-stream-built-before-a-job.md (commits a47ca72 and bbb6d29). The checks here therefore run #500 together with current main.

Cause

Pipeline.compile made a stream that a pod produced before the with block a source slot named <label>:<content hash>. The slot then did what a slot must (ITL-1112): it named its system-tag columns by the hash of its own declared schema, and its pipeline identity was that schema alone. Its content identity delegated to the bound stream. So the content hash stayed that of the chain, while the system-tag column names and the pipeline hash (and the pipeline-table path) moved.

The right names are those of the chain built inside the job, which are also those of the plain stream: a single-stream operator keeps its input's system-tag column names. The slot rule is right for an explicit slot; the bug was making the stream a slot unasked. #500 removes that: a stream given to a step brings its upstream steps down to its sources.

Probe: before the job against inside it

units is a DictSource with tags s, u and data x, y; a function pod add(x, y) is added inside the job, over a chain built before the job or inside it. Columns: the job's nodes, the hash in add's system-tag column names, add's content hash, add's pipeline hash.

On main (5eb327a):

Chain Built Job nodes System-tag columns Content Pipeline
select before SelectTagColumns:<hash>, add 5c5451d9cc03 0050283fd855 bc73a2dd392b
select inside SelectTagColumns, add, units 567df99d3317 0050283fd855 0c0f0f1718cc
map before MapTags:<hash>, add ea17494f640f 99c66b92e4b7 db3d1330c806
map inside MapTags, add, units 567df99d3317 99c66b92e4b7 64c08366c560
select, map before MapTags:<hash>, add b99c44582f15 4c363a993935 d4fc134cf989
select, map inside MapTags, SelectTagColumns, add, units 567df99d3317 4c363a993935 6747690efbc5
join before refused: SourceSpecMismatchError (ITL-1126)
join inside Join, SelectDataColumns, add, other, units 567df99d3317, dca48bdd714c 2464482e030d 4463cbcb853d
none before add, units 567df99d3317 8f5eff63a036 7817bf4359b6
none inside add, units 567df99d3317 8f5eff63a036 7817bf4359b6

On #500 (edb0e6d):

Chain Built Job nodes System-tag columns Content Pipeline
select before SelectTagColumns, add, units 567df99d3317 0050283fd855 0c0f0f1718cc
select inside SelectTagColumns, add, units 567df99d3317 0050283fd855 0c0f0f1718cc
map before MapTags, add, units 567df99d3317 99c66b92e4b7 64c08366c560
map inside MapTags, add, units 567df99d3317 99c66b92e4b7 64c08366c560
select, map before MapTags, SelectTagColumns, add, units 567df99d3317 4c363a993935 6747690efbc5
select, map inside MapTags, SelectTagColumns, add, units 567df99d3317 4c363a993935 6747690efbc5
join before Join, SelectDataColumns, add, other, units 567df99d3317, dca48bdd714c 2464482e030d 4463cbcb853d
join inside Join, SelectDataColumns, add, other, units 567df99d3317, dca48bdd714c 2464482e030d 4463cbcb853d
none before add, units 567df99d3317 8f5eff63a036 7817bf4359b6
none inside add, units 567df99d3317 8f5eff63a036 7817bf4359b6

The plain stream outside any job equals the "inside" row in both tables.

On main the two forms wrote their pipeline table at two paths (.../schema:<pipeline hash>), each with its own column names, and shared the function result table, which holds no system-tag column. So no single table held both sets of names; one content hash had two pipeline tables.

The test

tests/test_pipeline/test_stream_built_before_job.py: a source with two tags and two data columns, a second source for the join, and a function pod with two outputs. Chains: select, map, select then map, join, join then select then map.

  • test_a_chain_built_before_the_job_equals_the_chain_built_inside (each chain, sync and async): node names and types, content and pipeline hashes, every node's column names, system-tag column names and rows, stored table paths, stored column names and stored rows.
  • test_the_job_node_has_the_names_and_hashes_of_the_plain_stream (each chain, built before and inside): the job's node against the same step outside any job.

It fails on main (15 of 20 fail: every before-against-inside case and every "before" case against the plain stream; the 5 "inside" cases pass) and passes on #500 (20 pass).

What moves

Nothing beyond what #500 lists, and only for a job whose step in a with block takes a stream a pod produced before the block:

  • the slot node <label>:<hash> is replaced by the upstream steps and the real sources;
  • the system-tag column names of the nodes downstream take the source's names;
  • their pipeline hash, and so their pipeline-table path.

Unchanged: content hashes, the function result-table path and its rows, source ids, record ids. No golden value moves (generate_golden_hashes.py --check matches on #500's head). No design-issues entry (coordinator's decision).

The plan is docs/dev/plans/itl-1470-stream-built-before-a-job.md.

🤖 Generated with Claude Code

eywalker and others added 7 commits November 24, 2026 15:54
* docs(spiraldb): design the switch to spiral-sdk (ITL-1186)

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

* docs(spiraldb): state the evidence exactly (ITL-1186)

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

* feat(spiraldb)!: read SpiralDB through spiral-sdk (ITL-1186)

Reading only: table source, connector reads, listing, pins, where and counts. Tests are
being ported. Writes are refused.

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

* feat(spiraldb): migration tool, sign-in check, review fixes (ITL-1186)

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

* feat(spiraldb): freeze the schema table's form, version 1 (ITL-1186)

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

* fix(spiraldb): name a changed table in the migration tool; test its steps (ITL-1186)

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

* fix(spiraldb): withdraw the migration marker on any failure after it; SpiralDB out of the write matrices (ITL-1186)

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

* test(spiraldb): reading, refusals and the review findings (ITL-1186)

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

* docs(spiraldb): spiral-sdk, the schema table and the migration; conformance on fake and service (ITL-1186)

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

* fix(scripts): import spiral dynamically in the migration tool (ITL-1186)

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

* docs(spiraldb): say which reads refuse an incomplete record (ITL-1186)

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

* fix(spiraldb): refuse a source in a forked child before its inherited lock (ITL-1186)

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

* fix(spiraldb): CodeRabbit's review of the reading path (ITL-1186)

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

* fix(spiraldb): never adopt another program's schema table; hold the warning's lock (ITL-1186)

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(pipeline): show a source by its assigned label (ITL-1454)

Display only: the diagram, node preview, explain(), trace() and
RestrictedAggregationWarning. No name, hash, id or stored path changes.

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

* fix(sources): read a source's label past its class's hooks (ITL-1454)

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

* test(pipeline): read the display-name tables through the spiral-sdk fake (ITL-1454)

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

* fix(spiraldb): hold no lock while issuing UnrecordedTableSchemaWarning (ITL-1454)

A warning hook may wait for another thread that reads an unrecorded table.
Addresses CodeRabbit's last thread on #550 (discussion_r4687711390).

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

* fix(pipeline): narrow source labels to the diagram, preview and warning (ITL-1454)

explain() and trace() are main's again: their public values must not move.
Reading a label never raises, runs no metaclass hook, and a line break in a
label is shown escaped.

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

* test(pipeline): bind two labelled sources in either order (ITL-1454)

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

* fix(sources): read class data past metaclass properties too (ITL-1454)

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

* fix(sources): use only plain display parts (ITL-1454)

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…55) (#552)

* feat(pipeline): show a source by its assigned label (ITL-1454)

Display only: the diagram, node preview, explain(), trace() and
RestrictedAggregationWarning. No name, hash, id or stored path changes.

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

* fix(sources): read a source's label past its class's hooks (ITL-1454)

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

* test(pipeline): read the display-name tables through the spiral-sdk fake (ITL-1454)

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

* fix(spiraldb): hold no lock while issuing UnrecordedTableSchemaWarning (ITL-1454)

A warning hook may wait for another thread that reads an unrecorded table.
Addresses CodeRabbit's last thread on #550 (discussion_r4687711390).

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

* fix(pipeline): narrow source labels to the diagram, preview and warning (ITL-1454)

explain() and trace() are main's again: their public values must not move.
Reading a label never raises, runs no metaclass hook, and a line break in a
label is shown escaped.

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

* test(pipeline): bind two labelled sources in either order (ITL-1454)

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

* fix(sources): read class data past metaclass properties too (ITL-1454)

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

* fix(sources): use only plain display parts (ITL-1454)

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

* feat(pipeline): draw a SemiJoin's right input as a constraint (ITL-1455)

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

* fix(pipeline): read a constraint's declaration without running code (ITL-1455)

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

* test(pipeline): cover several constraining inputs, with stable test names (ITL-1455)

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…s Tutorials (ITL-1460) (#557)

* docs(tutorial): plain-language pass over Getting Started and the tutorial (ITL-1459)

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

* docs(tutorial): say what the node of a source offers (ITL-1459)

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

* docs(tutorial): say what batch gathers after group_by, and the stale output of an undone edit (ITL-1459)

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

* docs(tutorial): split Part 8 into short tutorials and rename the section Tutorials (ITL-1460)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* docs(dev): style guide rules for short tutorials (ITL-1460)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ne-job-from-streams-made' into eywalker/itl-1470-a-stream-built-before-a-job-gets-other
…ide it (ITL-1470)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 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 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.78646% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/orcapod/databases/spiraldb_connector.py 97.34% 7 Missing ⚠️
src/orcapod/pipeline/diagram.py 97.18% 4 Missing ⚠️
src/orcapod/core/sources/display_names.py 96.80% 3 Missing ⚠️
src/orcapod/databases/spiraldb_schema_table.py 98.26% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/orcapod/core/nodes/source_node.py 95.96% <100.00%> (+0.03%) ⬆️
src/orcapod/core/operators/semijoin.py 97.33% <100.00%> (+0.02%) ⬆️
src/orcapod/core/operators/static_output_pod.py 95.37% <100.00%> (+0.02%) ⬆️
src/orcapod/core/sources/base.py 99.37% <100.00%> (+<0.01%) ⬆️
src/orcapod/core/sources/spiraldb_table_source.py 97.79% <100.00%> (+0.69%) ⬆️
src/orcapod/databases/__init__.py 100.00% <ø> (ø)
src/orcapod/databases/spiraldb_nullability.py 97.91% <100.00%> (+4.46%) ⬆️
src/orcapod/databases/spiraldb_sign_in.py 100.00% <100.00%> (ø)
src/orcapod/errors.py 95.92% <100.00%> (-4.08%) ⬇️
src/orcapod/pipeline/restrictions.py 97.86% <100.00%> (+0.04%) ⬆️
... and 4 more

... and 6 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.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@eywalker

eywalker commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Closing without merging, by the developer's decision (2026-12-03). Overtaken by the capture and slot redesign (ITL-1559); its step 3 is merged in #695. The branch is kept.

Posted by a Claude Code agent on behalf of @eywalker.

@eywalker eywalker closed this Dec 3, 2026
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