Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4938378
fix(pipeline): reject conflicting fixed source rows (ITL-1469)
eywalker Nov 25, 2026
18abc8e
fix(pipeline): name the function step in projection conflicts
eywalker Nov 25, 2026
4f1526b
Merge remote-tracking branch 'origin/main' into eywalker/itl-1469-two…
eywalker Nov 26, 2026
51acf6d
fix(pipeline): validate refreshed and rebound source rows
eywalker Nov 26, 2026
4bfcc2c
fix(pipeline): compare a bound proxy using its live schema
eywalker Nov 26, 2026
1e181e8
Merge remote-tracking branch 'origin/main' into eywalker/itl-1469-two…
eywalker Nov 26, 2026
2f44c80
test(pipeline): cover the shared source ID key-column stopgap
eywalker Nov 27, 2026
3e8544f
fix(pipeline): explain the temporary key-column slot collision
eywalker Nov 27, 2026
f2dfb38
test(pipeline): compare readings of one dataset by rows when key colu…
eywalker Nov 27, 2026
cad47d9
fix(pipeline): compare one dataset's readings by rows, not record ids
eywalker Nov 27, 2026
b197756
fix(pipeline): refuse one source id with different key columns in any…
eywalker Nov 27, 2026
2addf67
test(pipeline): unknown keys, three-way order and node run source checks
eywalker Nov 27, 2026
3c17de4
fix(pipeline): order-free source checks, unknown keys, and node run c…
eywalker Nov 27, 2026
8e21ee2
test(pipeline): count fixed-row digests per consistency check
eywalker Nov 27, 2026
08bb410
perf(pipeline): compute each fixed-row digest at most once per check
eywalker Nov 27, 2026
9d32705
test(pipeline): digest per check, proxies once, mutated frames rechecked
eywalker Nov 27, 2026
98a8ed9
fix(pipeline): memoize fixed-row digests per check by underlying source
eywalker Nov 27, 2026
aa8b0ff
docs(sources): holds_fixed_rows does not assume constant values
eywalker Nov 27, 2026
38b2537
test(pipeline): capture-time refusals, two-copy derived sources, node…
eywalker Nov 27, 2026
a40296c
fix(pipeline): claim key-only differences only when every source was …
eywalker Nov 27, 2026
0312a9e
refactor(sources): keep source consistency properties private
eywalker Nov 27, 2026
c6d9f72
fix(pipeline): require one source object per content hash
eywalker Nov 27, 2026
990d595
fix(pipeline): preserve source registration across slot changes
eywalker Nov 28, 2026
4830aca
fix(pipeline): validate captures against live source slots
eywalker Nov 28, 2026
9971756
fix(pipeline): block capture until source bindings are restored
eywalker Nov 28, 2026
244f5b6
fix(pipeline): make slot capture stable and atomic
eywalker Nov 28, 2026
1031834
fix(pipeline): refuse foreign bindable source slots
eywalker Nov 28, 2026
a31fd56
test(pipeline): cover explicit foreign slot registration
eywalker Nov 28, 2026
47257e5
fix(pipeline): follow live inputs through source wrappers
eywalker Nov 28, 2026
91eead8
chore: merge main into the source registration branch
eywalker Nov 28, 2026
7ec4fb4
chore: merge the upstream API reference fix
eywalker Nov 28, 2026
3857c77
test(spiraldb): expect source registration to reject distinct windows
eywalker Nov 28, 2026
2e721c8
fix(pipeline): address source registration review findings
eywalker Nov 28, 2026
fc245fb
chore: merge main with the async operator updates
eywalker Nov 28, 2026
e8f38d1
fix(pipeline): reject cyclic source slot bindings
eywalker Nov 28, 2026
7414f6c
Merge remote-tracking branch 'origin/main' into eywalker/pr577-private
eywalker Nov 28, 2026
8b7d1d9
test(pipeline): type the slot cycle regressions
eywalker Nov 28, 2026
13ad734
fix(pipeline): compare live derived schemas and clarify source conflicts
eywalker Nov 28, 2026
d3b98ce
fix(pipeline): refuse bindings that depend on source slots
eywalker Nov 28, 2026
8f6ad30
Merge remote-tracking branch 'origin/main' into eywalker/pr577-private
eywalker Nov 28, 2026
50efa4d
test(pipeline): exercise restriction refusal with a concrete source
eywalker Nov 28, 2026
089db90
Merge remote-tracking branch 'origin/main' into eywalker/pr577-private
eywalker Nov 28, 2026
1b08a01
Merge remote-tracking branch 'origin/main' into eywalker/pr577-private
eywalker Nov 28, 2026
d18b20d
fix(pipeline): revalidate source slot bindings before runs
eywalker Nov 28, 2026
5d518ae
Merge remote-tracking branch 'origin/main' into eywalker/pr577-private
eywalker Nov 28, 2026
7c3f148
fix(pipeline): validate live bindings before direct reads
eywalker Nov 28, 2026
f10f811
fix(pipeline): refuse bindings to the job’s own nodes
eywalker Nov 28, 2026
5ad69a9
fix(pipeline): reject stored-result binding cycles across jobs
eywalker Nov 28, 2026
d9242d5
fix(pipeline): resolve staleness validator without a lazy wrapper
eywalker Nov 28, 2026
99cd83c
fix(pipeline): validate transitive bindings and restore tracker callb…
eywalker Nov 28, 2026
5e4c495
fix(pipeline): validate stored-result captures before recording (ITL-…
eywalker Nov 28, 2026
b997704
fix(pipeline): address source registration review findings
eywalker Nov 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions .zed/rules
Original file line number Diff line number Diff line change
Expand Up @@ -1613,16 +1613,45 @@ data. The rules:
match its previous one (bind does not compare the two), but bind refuses, before replacing
any binding, a bind after which two slots would read one source identity under different
restrictions (below). A job run over a restricted source feeding GroupBy, Batch or MergeJoin issues one RestrictedAggregationWarning.
Each source content hash belongs to one source object per pipeline or job
(ITL-1469). Capture, compile, binding through either API, loading and running
check the sources the graph reads. A slot binding replaces its former source.
A job accepts new steps only while every slot holds the exact source object
it held when that slot was first compiled. A slot originally compiled unbound
must be unbound. Rebinding or unbinding a slot blocks recording until all
original bindings are restored. InconsistentSourceError names the changed
slots. Restore the original bindings or build a new job. A job can compile
and run with its replacement bindings. ITL-1559 tracks capture after rebinding.
As a stopgap pending ITL-1559, a job refuses another job's or a standalone
SourceJobNode, including through prebuilt streams. Its bound_source can change
even if currently unbound. Pass the source itself, or use node.as_source()
for another job's stored results. The job's own slots are allowed with their
original bindings. A schema-only SourceNode declares a new unbound slot.
The ITL-1559 stopgap also refuses prebuilt streams over the job's own slots.
Build the step inside the job from the slot, or pass the source itself.
A slot binding must be independent of every bindable slot and every node
of its own job, including through stored-result sources and other wrappers
(ITL-1559). Binding, direct reads, and both job and node runs (including
load-only) report a dependency as SourceSpecMismatchError. Pass the
underlying source or use another job's node.as_source() for stored results.
A stored-result source still uses its origin's schema and keys. Binding checks
follow the origin's inputs through other jobs and refuse cycles, naming the
slots involved. A one-way stored-result binding stays supported.
Call where() once and reuse the resulting object. A source object conflict
raises InconsistentSourceError before the separate restriction check, which
can see restrictions beneath wrappers.
A pipeline keeps one restriction (or none) per source identity (a restriction leaves the
identity unchanged), so one table restricted two ways (or with and without a restriction) in
one pipeline is refused (restrictions.require_one_restriction, over the sources the streams
read now, sources_read; nothing is remembered between checks, since a rebound slot changes
what they read) at capture, at compile, by bind before it binds and at the start of every
run (refuse_restriction_conflicts), whatever streams lead there: projections, operator
chains, streams built before the capture. A bind's walk matches the job's own slots by object
(Rebinding), never by name. RunSummary keeps one condition and one limit per slot (ITL-1293). Every restriction walk goes through a slot's bound source,
a SourceProxy's delegate and a CachedSource's source (_streams_beneath); a
DerivedSource is a root. A CachedSource
(Rebinding), never by name. RunSummary keeps one condition and one limit per slot (ITL-1293).
Capture and restriction checks follow job bindings and the live_source_inputs
declared by wrappers. A wrapper over stored results ends this walk. Source
registration uses the wrapper itself and its content hash.
A CachedSource
over a restricted source is refused at construction (a cache is kept under the table's
identity; developer, November 18, 2026), and so is an operator job node that caches (LOG or
REPLAY) over a restricted source (developer, November 19, 2026: its cache is kept under the
Expand Down
35 changes: 32 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1662,16 +1662,45 @@ data. The rules:
match its previous one (bind does not compare the two), but `bind` refuses, before replacing
any binding, a bind after which two slots would read one source identity under different
restrictions (below). A job run over a restricted source feeding `GroupBy`, `Batch` or `MergeJoin` issues one `RestrictedAggregationWarning`.
Each source content hash belongs to one source object per pipeline or job
(ITL-1469). Capture, compile, binding through either API, loading and running
check the sources the graph reads. A slot binding replaces its former source.
A job accepts new steps only while every slot holds the exact source object
it held when that slot was first compiled. A slot originally compiled unbound
must be unbound. Rebinding or unbinding a slot blocks recording until all
original bindings are restored. InconsistentSourceError names the changed
slots. Restore the original bindings or build a new job. A job can compile
and run with its replacement bindings. ITL-1559 tracks capture after rebinding.
As a stopgap pending ITL-1559, a job refuses another job's or a standalone
SourceJobNode, including through prebuilt streams. Its bound_source can change
even if currently unbound. Pass the source itself, or use node.as_source()
for another job's stored results. The job's own slots are allowed with their
original bindings. A schema-only SourceNode declares a new unbound slot.
The ITL-1559 stopgap also refuses prebuilt streams over the job's own slots.
Build the step inside the job from the slot, or pass the source itself.
A slot binding must be independent of every bindable slot and every node
of its own job, including through stored-result sources and other wrappers
(ITL-1559). Binding, direct reads, and both job and node runs (including
load-only) report a dependency as SourceSpecMismatchError. Pass the
underlying source or use another job's node.as_source() for stored results.
A stored-result source still uses its origin's schema and keys. Binding checks
follow the origin's inputs through other jobs and refuse cycles, naming the
slots involved. A one-way stored-result binding stays supported.
Call where() once and reuse the resulting object. A source object conflict
raises InconsistentSourceError before the separate restriction check, which
can see restrictions beneath wrappers.
A pipeline keeps one restriction (or none) per source identity (a restriction leaves the
identity unchanged), so one table restricted two ways (or with and without a restriction) in
one pipeline is refused (`restrictions.require_one_restriction`, over the sources the streams
read now, `sources_read`; nothing is remembered between checks, since a rebound slot changes
what they read) at capture, at compile, by `bind` before it binds and at the start of every
run (`refuse_restriction_conflicts`), whatever streams lead there: projections, operator
chains, streams built before the capture. A bind's walk matches the job's own slots by object
(`Rebinding`), never by name. `RunSummary` keeps one condition and one limit per slot (ITL-1293). Every restriction walk goes through a slot's bound source,
a `SourceProxy`'s delegate and a `CachedSource`'s source (`_streams_beneath`); a
`DerivedSource` is a root. A `CachedSource`
(`Rebinding`), never by name. `RunSummary` keeps one condition and one limit per slot (ITL-1293).
Capture and restriction checks follow job bindings and the live_source_inputs
declared by wrappers. A wrapper over stored results ends this walk. Source
registration uses the wrapper itself and its content hash.
A `CachedSource`
over a restricted source is refused at construction (a cache is kept under the table's
identity; developer, November 18, 2026), and so is an operator job node that caches (`LOG` or
`REPLAY`) over a restricted source (developer, November 19, 2026: its cache is kept under the
Expand Down
46 changes: 46 additions & 0 deletions changelog.d/ITL-1469.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
### Fixed

- A pipeline or job accepts one source object per content hash. Capture, binding,
loading and execution reject distinct objects with the same hash, even if
their rows agree. Build a source once and reuse it. Distinct IDs separate
sources only when the ID contributes to the content hash. Rebinding replaces
a slot's source, and loading shares one rebuilt object across slots with
identical source configurations.
- Sources with the same source ID must agree on their Arrow schema and key
columns, including when they occupy different slots. For tag-copy sources
over a bound proxy, registration uses the live Arrow types.
- A capture refused by any active pipeline or job leaves all their graphs
unchanged, including when a stored result depends on the receiving job
through another job's bindings. Successful capture still calls each active
tracker's recording callback in registration order, including trackers that
do not support weak references. Passive trackers still receive source-pod
notifications with no upstream streams. Deferred recording checks source
conflicts again when the callback is called.
- Direct reads and job and node runs recheck source binding dependencies.
If an operator or wrapper introduces a forbidden dependency after binding,
they raise `SourceSpecMismatchError` before reading sources. If source
validation refuses a job run, saving the job retains the previous run's
expected row counts.
- Bindings to stored results reject cycles across jobs and name the slots
involved. They also reject acyclic dependencies on nodes of the receiving
job. Cold side-effect row reads recheck bindings. Pipeline capture and
compilation also reject circular wrapper inputs.

### Known limitations

- ITL-1506 tracks distinct readings of one dataset in distinct slots. ITL-1531
tracks sources that read their rows later. ITL-1553 tracks accepting distinct
objects that represent the same source.
- As a stopgap pending ITL-1559, a job refuses foreign and standalone bindable
slots (`SourceJobNode`), including through streams built from them. Pass the
source itself, or use `node.as_source()` for another job's stored results.
Schema-only `SourceNode` declarations still create independent slots.
- The ITL-1559 stopgap also refuses prebuilt streams over the receiving job's
own slots. Build the step inside the job from its slot, or pass the source
itself.
- Binding a slot to a source or stream that depends on any bindable slot or
any node of its own job raises `SourceSpecMismatchError` (ITL-1559). A
refused batch leaves all bindings intact. Pass the underlying source, or
use another job's `node.as_source()` for stored results.
- Reassigning an invocation's upstreams is unsupported after capture.
Rewiring an operator can leave stale rows in direct reads (ITL-1586).
17 changes: 11 additions & 6 deletions docs/concepts/identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The content hash captures schema, topology, and the **identity of the sources**
pipeline. It is computed recursively: each element's content hash depends on its own identity
plus the content hashes of all its upstream elements, all the way back to the sources.

A source's identity is its class, its schema, its `source_id` and its key columns (the
Most sources use their schema, `source_id` and key columns in their identity (the
`record_id_columns` that name its rows, or none when rows are named by position). What the
`source_id` is depends on how the source was created:

Expand All @@ -23,13 +23,18 @@ A source's identity is its class, its schema, its `source_id` and its key column
- File- and table-backed sources default to a name derived from their location (the file
path for `CSVSource`, the table folder's path or URI for `DeltaTableSource`), not from the
rows.
- If you pass `source_id` yourself, you are naming the source: two sources with the same
class, schema, `source_id` and key columns have the same content hash even when their rows
differ.
- If you pass `source_id` yourself, you are naming the source. The kind is part of the
canonical ID. For sources whose identity uses only the ID, schema and key columns,
matching those fields gives the same content hash even when the rows differ.
`DerivedSource(tags_as_data=...)` also hashes the tag-copy mapping. A derived source
without tag copies takes its identity from the producing node's content hash.
A pipeline or job registers one source object per content hash at capture, binding,
loading and execution.
See [source consistency](sources.md#source-ids-name-the-kind-that-reads-the-data).

Two sources that differ only in their key columns name the same rows differently, so they
are two sources: different content hashes (each gets its own cache), the same pipeline hash
and the same `source_id`.
have different content hashes and the same pipeline hash and `source_id`. A pipeline or
job currently refuses to use both readings under that shared ID (ITL-1506).

Rows are still identified individually. Each row carries its own content hash, and that
per-row hash is what caching uses.
Expand Down
36 changes: 36 additions & 0 deletions docs/concepts/pipeline-job.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ Three more things a job node offers:
the node has run in this process, to use as the input of another pipeline.
- **`upstreams`** and **`label`** let you walk the pipeline backwards.

As a stopgap pending ITL-1559, a job cannot absorb steps from another job by
capturing compiled nodes or other streams that depend on the other job's
bindable source slots (`SourceJobNode`). The same restriction applies to
standalone `SourceJobNode` objects, even when unbound. Pass the source itself to
record a new chain, or use `node.as_source()` to read the stored results of an
earlier job. A job can pass its own slots directly into new steps while their
original bindings are in place. The ITL-1559 stopgap refuses streams built
outside the job over one of its own slots. Build the step from the slot inside
the job, or pass the source itself. A schema-only `SourceNode` declares an
independent slot for each job.

## The database

Any Orcapod database can hold a job's results. Two are used most:
Expand Down Expand Up @@ -372,6 +383,31 @@ tag_schema=Schema({...}), data_schema=Schema({...}))`) means one Arrow type per
zones, declare the slot with Arrow schemas (`tag_schema=pa.schema([...])`). Binding a source
never changes a node's schema or where its results are stored.

A binding must be independent of every bindable source slot and every node
of its own job, including dependencies reached through operators,
`node.as_source()`, or other source wrappers. As a stopgap pending ITL-1559,
Orcapod checks this when binding, when reading the slot directly, and before
each job or node run, including a load-only run. This also protects the schema
and hash lookups needed to construct an `as_source()` result. Pass the
underlying source, or use another job's `node.as_source()` to read stored results.
The stored-result source still uses its origin's schema and keys, so Orcapod
checks the origin's inputs across jobs. If those inputs reach another node in
the receiving job, the error names that node and the receiving slot. If those
inputs form a cycle, the error names the slots in the cycle. A side-effect node
also checks its bindings when read before its first run.

```python
from orcapod.errors import SourceSpecMismatchError
from orcapod.operators import SelectDataColumns

projection = SelectDataColumns(["weight", "height"])(job_b.nodes["mice"])
try:
job_a.bind(sources={"mice": projection})
except SourceSpecMismatchError as error:
print(error)
# Binding source slot 'mice' to a source that depends on source slot 'mice' is not supported yet (ITL-1559). Pass the underlying source, or use a non-slot node's as_source() to read stored results.
```

A job made without sources has **unbound** slots. It can still be run: nodes that depend on
an unbound source are skipped, and `job.unbound_sources` lists what is missing. Bind later
with `job.bind(...)`:
Expand Down
Loading
Loading