Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
4205619
docs(plans): plan stage 1 of ITL-1466, three nested row ids (ITL-1471)
eywalker Nov 26, 2026
e64c73c
feat(nodes): define the entry, instance and record ids in one module …
eywalker Nov 26, 2026
f5cdbc8
feat(nodes)!: key rows by instance and record id; layouts pdb_v2, odb…
eywalker Nov 26, 2026
eba3220
test(golden): pin a pipeline table's instance ids; the approved golde…
eywalker Nov 26, 2026
01024ff
docs: the three row ids, the v2 layouts and the changelog fragment (I…
eywalker Nov 26, 2026
8308b01
docs: name the pipeline row key in two comments (ITL-1471)
eywalker Nov 26, 2026
756facb
test(pipeline): accept either async outcome for two copies of one inp…
eywalker Nov 26, 2026
b556376
docs: name ITL-1482 where the SQLite refusal of an operator cache is …
eywalker Nov 26, 2026
e45e75f
test: regression tests for the review findings on the row ids (ITL-1471)
eywalker Nov 26, 2026
941cf04
fix(nodes): a placeholder on the async route finds its result by the …
eywalker Nov 26, 2026
27b28ce
fix(provenance): a trace resolves a held row by its instance (ITL-1471)
eywalker Nov 26, 2026
8fe95b8
fix(datagrams): the instance id reads a row's typed token columns (IT…
eywalker Nov 26, 2026
a2803ea
docs: the Arrow hash summary names the three ids; rules for tokens, t…
eywalker Nov 26, 2026
2d8a6a8
test(pipeline): build the inactive pod through the decorator (ITL-1471)
eywalker Nov 26, 2026
086e70f
test(pipeline): a stored row recomputes its ids whatever its token co…
eywalker Nov 26, 2026
1f39198
fix(nodes): a pipeline row stores the token columns its instance id w…
eywalker Nov 26, 2026
6fe86ef
test, docs: ordinary rows keep their stored token columns; rows with …
eywalker Nov 26, 2026
f5a7bf0
fix(nodes): a row with no token stores no token column (ITL-1471)
eywalker Nov 26, 2026
5d1ebee
Merge branch 'main' into eywalker/itl-1471-three-nested-row-ids-v2-ta…
eywalker Nov 26, 2026
f3f6842
test(pipeline): name ITL-1491 on the tests that pin the held-rows dif…
eywalker Nov 26, 2026
df42f2d
test: regression tests for the second review of the row ids (ITL-1471)
eywalker Nov 26, 2026
fba3aec
fix(nodes): key the pipeline table by node content hash and record id…
eywalker Nov 26, 2026
ab58159
fix(provenance): select a held row's record by its instance id on eve…
eywalker Nov 26, 2026
2747f25
test, docs: the pipeline table's key, the trace by instance id and th…
eywalker Nov 26, 2026
69d8ec1
docs(hashing): list the pipeline table's key in the hash site invento…
eywalker Nov 26, 2026
5f8eba1
test: one canonical type per token value (ITL-1471)
eywalker Nov 26, 2026
296e877
fix(datagrams): one canonical type per token value; a clear refusal f…
eywalker Nov 26, 2026
4a916ec
fix(nodes): read the stored token types with the preflight's one sche…
eywalker Nov 26, 2026
fdd265c
test(pipeline): a fatal error in a placeholder's lookup gives the sam…
eywalker Nov 26, 2026
ddfc24b
fix(nodes): the async route reports the crash of a placeholder row be…
eywalker Nov 26, 2026
6607424
test(datagrams): a missing token is a null token; a kept token keeps …
eywalker Nov 26, 2026
e851695
fix(datagrams): a missing token is a null token, and a changed row ke…
eywalker Nov 26, 2026
027d908
docs(reference): where the row ids are read, when a new instance comp…
eywalker Nov 26, 2026
d72bc9d
test: review items of PR #583 (which record wins, several instance id…
eywalker Nov 26, 2026
20797df
test(pipeline): compare stored instance ids as a set, the async route…
eywalker Nov 26, 2026
3e90d4d
test(datagrams): a rename moves a column's token with it in every vie…
eywalker Nov 26, 2026
5edd6e3
fix(datagrams): a rename carries only the tokens of the columns the r…
eywalker Nov 26, 2026
03d7abe
test: a fall-through token has one type on both routes and from the s…
eywalker Nov 26, 2026
fd94fb7
fix(datagrams): a column taken from another row has its token typed f…
eywalker Nov 26, 2026
9b65574
test(datagrams): a rename of a placeholder keeps its sentinel tokens …
eywalker Nov 26, 2026
9361884
fix(datagrams): an empty rename returns the row itself, and a placeho…
eywalker Nov 26, 2026
52f2560
feat(row_ids)!: the record id covers the node's content hash and is t…
eywalker Nov 26, 2026
262a0cc
docs(datagrams): the re-typing of a fallen-through data-tag's token i…
eywalker Nov 27, 2026
3298bf5
docs(datagrams): state the token re-typing stopgap exactly, without o…
eywalker Nov 27, 2026
07ca350
test: source-info token columns keep the pipeline's type on the sync …
eywalker Nov 27, 2026
fb8c01e
fix: a source-info token column keeps the pipeline's type on every ro…
eywalker Nov 27, 2026
3577548
Merge branch 'eywalker/itl-1471-three-nested-row-ids-v2-table-layouts…
eywalker Nov 27, 2026
994e658
docs(datagrams): cut the token re-typing stopgap text down to what th…
eywalker Nov 27, 2026
ac1f269
Merge branch 'eywalker/itl-1471-three-nested-row-ids-v2-table-layouts…
eywalker Nov 27, 2026
2907816
test: the findings of the independent review of PR 601, failing befor…
eywalker Nov 27, 2026
d698ea9
fix: token types on the Join's async route, record batches, hand-buil…
eywalker Nov 27, 2026
749ddf5
docs: say only what holds for token types, and state when a refusal m…
eywalker Nov 27, 2026
65c1965
test: a Join never stores its pending marker in a merged token, faili…
eywalker Nov 27, 2026
47b146e
chore: types in the review fixes and tests (ITL-1491)
eywalker Nov 27, 2026
a13e53f
test: a source-info token's layers must be its data's outer layers, f…
eywalker Nov 27, 2026
81582a3
feat(streams): refuse a stream whose source-info token does not have …
eywalker Nov 27, 2026
891a089
test: Index gives the element the declared token type less one layer,…
eywalker Nov 27, 2026
584dbfa
fix(index): the element's token has the declared type less one layer,…
eywalker Nov 27, 2026
789222e
test: row-built form and rows-on-read fixtures give list tokens list …
eywalker Nov 27, 2026
6c61599
test: session and data-tag token fixtures follow the token-shape rule…
eywalker Nov 27, 2026
37beb11
test: stored-row and row-id token fixtures follow the token-shape rul…
eywalker Nov 27, 2026
f5685cd
fix(streaming joins): a batch is held to its stream's token type; fix…
eywalker Nov 27, 2026
b94dc7f
test: channel, record-batch and transport fixtures follow the token-s…
eywalker Nov 27, 2026
0d2f1c7
test: end-to-end and equivalence token fixtures follow the token-shap…
eywalker Nov 27, 2026
838f948
test: the review findings restated under the token-shape rule; the Jo…
eywalker Nov 27, 2026
94ae454
docs: the token-shape rule, two declarations of one token column, and…
eywalker Nov 27, 2026
dca30c9
chore: types in the token-shape test helpers (ITL-1491)
eywalker Nov 27, 2026
76f5398
test: the last hand-built token fixture follows the token-shape rule;…
eywalker Nov 27, 2026
5bd029e
test: the findings of the second review of PR 601, failing before the…
eywalker Nov 27, 2026
128c38a
fix: a string leaf in the token-shape rule, held rows on the async ro…
eywalker Nov 27, 2026
79fd36d
docs: token rules match what is checked and where; the ordinary-sourc…
eywalker Nov 27, 2026
04de92a
test: the findings of the third review of PR 601, failing before thei…
eywalker Nov 27, 2026
05b5ce8
fix: the held-row check reads one normalized form and a row's token l…
eywalker Nov 27, 2026
7b32524
test: a token's list is never null at any level; guards for input no …
eywalker Nov 27, 2026
6c1c9d6
fix: a token's list is never null at any level, checked where a strea…
eywalker Nov 27, 2026
159da25
test: the findings of the fourth review of PR 601, failing before the…
eywalker Nov 27, 2026
ab8a94b
fix: take the async held-row check out; the rule is checked where a s…
eywalker Nov 27, 2026
e4af3a2
docs: say which Index outcome the aside means; state the ITL-1534 lim…
eywalker Nov 27, 2026
ce0cc26
chore: merge main into ITL-1491
eywalker Nov 27, 2026
789c1a2
fix(arrow): declare Join system tags non-nullable and validate source…
eywalker Nov 27, 2026
08d2c67
fix(sources): reject missing custom system tag columns (ITL-1543)
eywalker Nov 27, 2026
969ed09
fix(arrow): honor Join field declarations and validate raw source rea…
eywalker Nov 27, 2026
705d60b
fix(streams): preserve declared system tag fields in rows (ITL-1543)
eywalker Nov 28, 2026
88fd5de
Merge remote-tracking branch 'origin/main' into eywalker/itl-1543-part-b
eywalker Nov 28, 2026
d74dd59
fix(streams): reconcile system tag fields across source and Join path…
eywalker Nov 28, 2026
5ac1301
Merge remote-tracking branch 'origin/main' into eywalker/itl-1543-part-b
eywalker Nov 28, 2026
376bdb6
fix(streams): declare source-info token fields nullable (ITL-1557)
eywalker Nov 28, 2026
0c9b2b8
chore(branch): merge ITL-1543 part B into ITL-1557
eywalker Nov 28, 2026
5d3f24b
fix(streams): validate replayed source tags and share tied Join sorti…
eywalker Nov 28, 2026
ab136d0
fix(sources): validate Arrow exporters before Polars conversion (ITL-…
eywalker Nov 28, 2026
4ca8850
fix(streams): use shared token fields for empty sinks
eywalker Nov 28, 2026
cc249b0
chore(branch): merge updated ITL-1543 part B
eywalker Nov 28, 2026
d902f4e
test(sources): expect refusal of integer system tags (ITL-1543)
eywalker Nov 28, 2026
1f210fd
Merge branch 'eywalker/itl-1543-a-row-must-take-exactly-its-streams-a…
eywalker Nov 28, 2026
5f518d8
test(datagrams): expect preserved Arrow system tag fields (ITL-1543)
eywalker Nov 28, 2026
ecb9ffb
fix(cache): store declared operator output fields (ITL-1562)
eywalker Nov 28, 2026
f624760
Merge remote-tracking branch 'origin/eywalker/itl-1543-part-b' into e…
eywalker Nov 28, 2026
c62f82a
fix(cache): preserve declared token fields on operator replay
eywalker Nov 28, 2026
4f2a63f
Merge remote-tracking branch 'origin/main' into eywalker/itl-1543-part-b
eywalker Nov 28, 2026
8083d19
Merge remote-tracking branch 'origin/main' into eywalker/itl-1543-part-b
eywalker Nov 28, 2026
403ff6f
fix(provenance): preserve declared types when replacing source tokens
eywalker Nov 28, 2026
a9a3794
chore: merge PR 606 into ITL-1491
eywalker Nov 28, 2026
2486c63
chore: merge main into ITL-1491 after API reference fix
eywalker Nov 28, 2026
7ecc2c4
fix(streams): merge declared token types into the provenance stack
eywalker Nov 28, 2026
42197e9
chore: merge main into the provenance stack
eywalker Nov 28, 2026
87a3b0f
test(cache): type list-valued provenance fixtures
eywalker Nov 28, 2026
864a46f
fix(streams): enforce declared provenance fields at cache and transpo…
eywalker Nov 28, 2026
b4e029e
Merge branch 'main' of https://github.com/metamorphic-labs/orcapod-py…
eywalker Nov 28, 2026
4809ad3
fix(streams): preserve declared fields across async routes
eywalker Nov 28, 2026
b256508
test(async): align placeholder schema with producer
eywalker Nov 28, 2026
cb7c7ae
Merge branch 'main' of https://github.com/metamorphic-labs/orcapod-py…
eywalker Nov 28, 2026
490ebf1
fix(provenance): keep declared fields on source and tag inputs
eywalker Nov 28, 2026
b525d7a
fix(provenance): enforce declared token and system-tag types
eywalker Nov 28, 2026
432c7a6
fix(provenance): refuse a null replacement of a held list token
eywalker Nov 28, 2026
fec02ff
chore(branch): merge main into ITL-1557
eywalker Nov 28, 2026
7280ed1
docs(provenance): clarify null constructor token handling
eywalker Nov 28, 2026
d3cf41b
chore(branch): merge main and enforce typed null token rejection
eywalker Nov 28, 2026
2648cb6
chore(branch): merge main into ITL-1557
eywalker Nov 28, 2026
91c5c02
fix(provenance): preserve declared fields across join and channel paths
eywalker Nov 28, 2026
19784af
fix(join): canonicalize full pipeline ties with missing system tags
eywalker Nov 28, 2026
5717c06
Merge remote-tracking branch 'origin/main' into eywalker/itl-1557-re-…
eywalker Nov 28, 2026
c11f85b
fix(join): preserve system tag pairs across hash ties
eywalker Nov 28, 2026
12c6edd
fix(join): preserve symmetric tie ordering and reject missing fields
eywalker Nov 28, 2026
0340bc0
fix(join): retain tied provenance on standalone rows
eywalker Nov 28, 2026
a124fcf
fix(join): keep tied custom metadata at declared positions
eywalker Nov 28, 2026
ad8f10c
fix(join): restore main's tie handling
eywalker Nov 28, 2026
23f2c37
docs(provenance): qualify instance ID equivalence for list tokens
eywalker Nov 28, 2026
fe879bd
chore(branch): merge origin/main into ITL-1557
eywalker Nov 28, 2026
a61816e
chore(branch): merge origin/main into ITL-1557
eywalker Nov 28, 2026
708a861
fix(pods): index token columns once per row
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
215 changes: 176 additions & 39 deletions .zed/rules

Large diffs are not rendered by default.

214 changes: 175 additions & 39 deletions CLAUDE.md

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions changelog.d/ITL-1491.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
### Breaking changes and migration

- **A stream whose source-info token does not have the shape of its data is refused.** A
token column's type is some list layers on top of a string, and those layers must be the
outer list layers of its data column: a `large_list` of tokens needs a `large_list` of
values, a fixed-size list a fixed-size list of the same size. Under its layers a token is
a string. The values may be deeper than their tokens, and a plain string token fits any
value. A token's list is never null at any level: a null is allowed only at the innermost
level, where the element is a string (`["a", null]` is valid, `[null, ["a"]]` under a
two-level token type is not); a plain string token may be null. The rule is checked where a stream is built from a table;
a stream that breaks it raises `InputValidationError` naming the token column, its data column and both
types. Sources, operators and functions always build tokens of the right shape, so only a
table built by hand with `_source_*` columns is affected. Such a table used to be accepted
because nothing checked it; downstream, a `Join` over a data-tag with a null list token
silently stored the characters of an internal marker as the merged token, and so did a
`Join` or `MergeJoin` over a list-of-lists token with a null inner list. (ITL-1491)
- **Inputs that declare one token column with two types are refused.** `MergeJoin` (a
colliding data column, or a data-tag both inputs hold) and `Join` (a data-tag both inputs
hold, whose tokens the join merges) raise `InputValidationError` naming the column and
both types, on the sync and the async path, whether or not a key matches. A `Join` over
such a data-tag used to fail with `ValueError: cannot merge the source info of a list
with that of a scalar` when a key matched and to complete when none did; `MergeJoin`
already refused a colliding column. See the known limitation below for the case that
ordinary sources reach. (ITL-1491)

### Changed

- **The type of a source-info token column is determined by the pipeline, never by the
tokens' values.** A source builds plain `large_string` tokens, and each operator determines
its output's token types from its inputs' types, as it does for every other column. A row
read from a stream keeps that type where it used to be typed again from its value: in the
table built from rows between two nodes, in a node's output, in a row shown as a table
(`data.as_table(columns={"source": True})`, and the Python type
`data.schema(columns={"source": True})` reports), in the rows an async `Join` merges, in
the element `Index` takes from a list of tokens, in a function pod's stream outside a job,
and in record batches. For the tokens that sources and operators build, nothing changes:
no hash, stored path or stored column type moves. A token is still typed from its value
where it is first created from a Python value and no Arrow type exists
(`Data(..., source_info=...)`, `with_source_info`). (ITL-1491)
- **A hand-built raw stream keeps the token type it declares.** A fixed-size list of tokens
(over a fixed-size list of values) stays a fixed-size list, where it used to become a
`large_list`, and a list of tokens keeps its item field's name, nullability and metadata,
also in an operator cache. (ITL-1491)
- **A data-tag that falls through a function pod keeps its source-info token with its type
unchanged.** The token used to be typed again from its value. A column a function returns
is not affected: its token points to the function. (ITL-1491)

### Fixed

- **Rows with a nested source-info token column behave the same on the sync and the async
path.** A row whose token column is nested (a list of tokens, or a list of such lists)
and whose tokens could not be typed again from their values (an empty list, or a null
string inside a list of lists, such as `[[null], []]`) raised an Arrow type error where
the sync path builds a table from rows between two nodes, while the async path recorded
the rows. Both paths now pass such rows on and store them, with the same token types and
the same entry, instance and record ids. (ITL-1491)
- **An async `Join` writes the token of a merged data-tag with the type its inputs
declare.** It rebuilt the merged token from its Python value, so a list token that the
sync path kept as declared became another list type on the async path, and a job run on
one path could not be continued on the other over the same store. (ITL-1491)
- **`Index` gives the element's token the type of the token list's items.** It typed the
token again from its value, so a list item's type could change (a fixed-size list became a
`large_list`). An element that is a null where the remaining token type is a list is
refused with `InputValidationError` naming the column, on both paths. (ITL-1491)
- **A function pod's stream outside a job shows list-valued source-info tokens.**
`pod(stream).as_table(columns={"source": True})` raised `ValueError: Unsupported Python
type` when a data-tag that falls through the function had a list token. (ITL-1491)
- **An async `Join` keeps a token that looks like its internal marker.** A column the join
does not merge keeps its own token on both paths. The async path used to replace a token
that began with the join's internal marker text by a `join_v1:` digest. (ITL-1491)
- **`MergeJoin` reports the same first disagreement in every process.** When several
columns of its two inputs disagree in type, the one first in name order is reported; which
one was reported used to follow the interpreter's hash seed. (ITL-1491)

### Known limitations

- **A `Batch` of single values cannot be joined with a source that already holds lists of
them, on that column.** The two have the same values and data type but different
source-info tokens: a list of tokens (one per member) after `Batch`, one plain token per
list in the source. A `Join` where that column is a data-tag of both inputs, or a
`MergeJoin` where it collides, refuses the inputs with `InputValidationError` naming the
token column and both types. Bring both inputs to one form before the join: batch both,
or neither. Whether the two forms should join is ITL-1522. (ITL-1491)
- **A record batch sent into a record-batch channel is not checked against the token-shape
rule.** The stream built from the channel's batches is. The channels are not used by jobs
yet; checking a batch where it is sent is ITL-1526. (ITL-1491)
- **An input that sends no row over a bare row channel declares no token type.** A `Join`
run directly through `async_execute` over row channels (outside a job) compares its
inputs' token types from their first rows, so it cannot refuse an input that sends none;
the sync call and a job on either orchestrator refuse it. Carrying the declared types over
row channels is ITL-1527. (ITL-1491)
- **Rows an async run holds instead of running are not checked against the token-shape
rule.** The rule is checked where a stream is built. The sync orchestrator builds a held
node's rows into a stream, and the async orchestrator hands them on without building one,
so a held row built by hand with an invalid token shape is refused on sync and accepted
on async. Rows that come from a stream were checked when it was built. Making the two
routes agree is ITL-1534. (ITL-1491)
9 changes: 9 additions & 0 deletions changelog.d/ITL-1543.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
- A custom system-tag column on a source must be a non-nullable string column
with no null values. Sources also reject missing names in `system_tag_columns`.
Convert custom tags to text before building the source.
- Sources refuse Arrow field metadata on nominated custom system tags, including
tag copies nominated with `system_tag_columns`. Remove the field metadata before
building the source. Rebuild a source cache if it was written with field
metadata on a system tag. ITL-1561 tracks re-evaluating this restriction.

### Fixed

- Join uses the declared fields of inputs tied on pipeline hash to set the
sorted system tags' nullability. The tag is non-nullable when every
corresponding input field is non-nullable. Existing entry IDs, instance IDs,
record IDs and operator hashes for source inputs stay the same.
- Rows preserve the stream's Arrow fields for system tags, including width,
nullability, and metadata. Join preserves those declarations for non-tied
operands. IDs can change for hand-built streams with unusual system-tag
fields outside a tie. Entry-ID errors for a raw Arrow Null system tag name
the column and ask for a supported nullable type.
36 changes: 36 additions & 0 deletions changelog.d/ITL-1557.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
### Breaking changes and migration

- Cached sources write nullable source-info fields and new record hashes under
`sdb_v2`. Older `sdb_v1` tables are reported and left untouched. A bound source
populates the new cache from its live data.

- Operator caches store and hash the output stream's declared fields under
`odb_v3`. Older `odb_v2` tables are reported and left untouched. LOG runs
populate the new table (ITL-1562).
- A bare ArrowTableStream with a formerly required token field has a new content
hash. Jobs over that stream have new downstream node content hashes and stored
pipeline record keys. Entry and instance IDs are preserved.
- Jobs fed by an Arrow-backed DataFrameSource without an explicit schema can
move when a null-free data field was declared nullable, including a data-tag.
Preserving that declaration changes the source row entry ID, function instance
and record IDs, and the `pdb_v2` path and key in both execution modes. A
generated source ID also changes. An explicit source ID and the `rdb_v1` path
and result key match the previous behavior when the result ID is held fixed.

### Fixed

- Source-info token fields are nullable in streams, rows, and streaming batches,
including empty outputs.
- DataFrameSource uses its explicit schema for custom system-tag declarations and
validates the raw values, types and metadata before applying the schema.
- Adding Python system tags to an Arrow-backed Tag preserves its existing
system-tag field declarations.
- Record-batch channels keep the accepted schema for empty results and reject
nulls inside required system-tag fields. Record batches and function output
rows refuse conflicting token declarations. `with_source_info` applies Python
replacements under the held token type and rejects null lists at any depth.
The `Data` constructor also checks non-`None` replacements against the held
type. `Data(table, source_info={"x": None})` keeps the token the table already
holds for `x`.
- DBTableSource validates nominated system-tag fields against the batch schema
when the connector provides no column information.
6 changes: 2 additions & 4 deletions changelog.d/ITL-1563.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,5 @@
The values are the row's, wrapped under the declared field, never cast.
- The token type that is checked is the one the row carries (ITL-1563): a hand-built
output made from an Arrow table whose token column is dictionary-encoded or binary
is refused, naming that type. Before, `as_table` typed such a token from its value
and it was stored as a string. Still open until rows keep their token columns'
Arrow types: a NULL token in a column declared with another type is stored as a
`large_string` null and is not refused.
is refused, naming that type. With ITL-1557, the row keeps the declared token
column type even when the token is null, so the same check refuses it.
2 changes: 1 addition & 1 deletion docs/concepts/function-pods.md
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ from that database, and no rows under that key is an empty result, not an error.
over the same sources, not only the saved run's inputs. Rows come in the order the database
returns them; sort them if order matters. The node itself (`as_table()`, `iter_data()`,
`head()`) is empty: it has not run in this process.
- Operators (a join, a filter) store outputs only when caching is enabled, under `odb_v2`.
- Operators (a join, a filter) store outputs only when caching is enabled, under `odb_v3`.
The saved file does not record an operator's cache mode (follow-up ITL-977), so attach a
loaded operator node in `CacheMode.REPLAY` to read the rows its run stored:
`loaded.nodes["joined"].attach_databases(pipeline_database=store.at("<job name>"),
Expand Down
38 changes: 38 additions & 0 deletions docs/concepts/provenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,44 @@ print([(label, run.computed_here) for label, run in trace.function_runs()])
# [('per_animal', True), ('scores', False), ('scores', True)]
```

## The shape of a token

A value's token has the shape of the value. You see tokens in the `_source_<column>`
columns (`stream.as_table(columns={"source": True})`).

- **A plain token fits any value.** A source gives every value one token, a string
(`large_string`), whatever the value is: a number, a text, a list, an array. A function
gives each value it returns one token too. A plain token may be missing (null).
- **A list of tokens needs a list of values.** `Batch`, `GroupBy` and `MergeJoin` put
several rows' values into one list, and their tokens into a list beside it, one token per
member, in the same order: values `[0.8, 0.3]` with tokens
`["scores::...::accuracy", "scores::...::accuracy"]`. After two such steps both are lists
of lists.
- **The values may be deeper than their tokens.** A source column that holds lists has one
plain token per value, so after a `Batch` its values are lists of lists and its tokens a
list of plain tokens.
- **A list of tokens is never missing, at any level; only a token inside the innermost
list may be.** A batch of three rows of which one has no token gives
`["a::row_0::x", null, "a::row_2::x"]`. In a list of lists of tokens, `[null, ["a"]]` is
not valid: the missing inner list would have to be a list, `[[], ["a"]]` or
`[[null], ["a"]]`.

Orcapod's sources, operators and functions always keep these rules. They matter when you
build a table with `_source_*` columns by hand and hand it to `ArrowTableStream`: a list
token over a value that is not a list, a list of another kind (a fixed-size list of tokens
needs a fixed-size list of values of the same size), more list levels in the token than in
the value, a token that is not text, or a missing list of tokens at any level is refused with
`InputValidationError`, which names the token column, its data column and both types.

One case reaches ordinary pipelines. A `Batch` of single values and a source that already
holds lists of them have the same values but different tokens: a list of tokens (one per
member) in the first, one plain token per list in the second. A `Join` on such a column as
a data-tag, or a `MergeJoin` of it, refuses the two inputs and names the token column and
both types. Bring both inputs to one form before the join: batch both, or neither.
Whether the two forms should join is an open question (ITL-1522). The Arrow types, with a table of what is
accepted and refused, are in
[the hashing reference](../reference/hashing.md#the-shape-of-a-source-info-token-column).

## When there is nothing to trace

An operator or function node shows only the rows of its run in this process (see
Expand Down
21 changes: 14 additions & 7 deletions docs/dev/design_issues/ITL-1543-AS2.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
## `src/orcapod/core/streams/`

### AS2 — A stream's Arrow table and its rows can disagree about column types
**Status:** in progress
**Status:** resolved
**Severity:** high
**Issue:** ITL-1543

The stream defines the Arrow schema of each row. Today a row can rebuild its
columns in a different form, which makes identity and storage depend on how the
data was read. For example, a Join of streams tied on pipeline hash can declare
its sorted system tags nullable, although its rows have non-nullable system tags.
The stream defines the Arrow schema of each row. A row that rebuilds its
columns in a different form can make identity and storage depend on how the
data was read. For example, a Join of streams tied on pipeline hash could
declare its sorted system tags nullable while its rows used required fields.

Part A corrects that Join schema and rejects Arrow Null in sources, including
nested Null. Part B remains open and makes rows use the stream's field definitions.
**Fix:**

Part A corrected the Join schema and rejected Arrow Null in sources, including
nested Null. Part B carries declared system-tag fields through rows, tables and
batches, including standalone async joins and both Join and MergeJoin kernels.
Operators with an Arrow output declaration check the materialized fields before
writing cache rows. ITL-1557 makes every top-level source-info field nullable and
ITL-1491 carries the pipeline's declared token types through transport. ITL-1534
tracks hand-built rows passed directly from a held node on the async route.
17 changes: 17 additions & 0 deletions docs/dev/design_issues/ITL-1543-AS4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## `src/orcapod/core/operators/join.py` — system-tag provenance

### AS4 — Join could lose record IDs or attach ID pairs to the wrong operand
**Status:** open
**Severity:** high
**Issue:** ITL-1543

The ID sorter grouped operands by the printed provenance path. Distinct full
pipeline hashes with the same shortened suffix could exchange source and record
IDs, even though other system tags stayed with their operands. A tied Join
could also sort an existing record ID into a position with no declared record-ID
field and drop it. For equal source IDs, the old sort raised on the missing
record ID. The null-safe sort let the affected operand order silently lose it.

The suffix collision requires the hash truncation setting. PR #636 removes
that setting and delivers the corrected entry IDs accepted by the developer
on 2026-11-28 (D27). PR #607 keeps main's tied-Join tables, rows, and entry IDs.
21 changes: 21 additions & 0 deletions docs/dev/design_issues/ITL-1557-AS3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## `src/orcapod/core/streams/`

### AS3 — Token fields disagree between streams and rows
**Status:** resolved
**Severity:** high
**Issue:** ITL-1557

Sources declared generated source-info fields non-nullable while the rows read
from those streams declared them nullable. A bare stream and a CachedSource
incorporated the stream field into their hashes, while a function node used the
row field for its instance ID.

**Fix:** Declare every source-info field nullable at the top level in
`arrow_utils.source_info_field`. Write CachedSource fields and record hashes
under `sdb_v2` and report older tables through stale-table accounting. Function
entry and instance IDs are preserved for the token-nullability change. The
separate fix to preserve nullable data fields on schema-free Arrow-backed
DataFrameSource inputs moves these IDs for affected jobs. Concrete record-batch
channels and Python replacements on Arrow-backed Data retain the declared
token types. Operator caches follow the output stream's declared fields under
ITL-1562.
14 changes: 14 additions & 0 deletions docs/dev/design_issues/ITL-1562-OC1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## `src/orcapod/core/nodes/operator_node.py`

### OC1 — Operator cache token fields depend on the write's values
**Status:** resolved
**Severity:** high
**Issue:** ITL-1562

An operator cache used required token fields for null-free writes and nullable
fields for writes with missing tokens. Appending the other schema could fail or
store a key that could not be reproduced under the table's held schema.

**Fix:** Keep the output stream's declared fields through the operator output
keeper and hash rows under those fields. Store the records under `odb_v3` and
report `odb_v2` tables through the existing stale-layout accounting.
Loading
Loading