Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 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
994e658
docs(datagrams): cut the token re-typing stopgap text down to what th…
eywalker Nov 27, 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
110 changes: 96 additions & 14 deletions .zed/rules
Original file line number Diff line number Diff line change
Expand Up @@ -976,15 +976,16 @@ Every row Orcapod stores carries __data_context (constants.DATA_CONTEXT_COL, lar
the key of the data context that wrote it (std:v1:default since v0.3). The key names one
generation of hashing; rows of the current data context are the current entries.

Function pipeline — pdb_v1 (PIPELINE_DB_SCHEMA_VERSION)
Function pipeline — pdb_v2 (PIPELINE_DB_SCHEMA_VERSION)
Function result — rdb_v1, after the type's revision rev1 (RESULT_DB_SCHEMA_VERSION)
Side-effect log — tdb_v1 (TRACKING_DB_SCHEMA_VERSION)
Operator cache — odb_v1 (OPERATOR_DB_SCHEMA_VERSION)
Side-effect log — tdb_v2 (TRACKING_DB_SCHEMA_VERSION)
Operator cache — odb_v2 (OPERATOR_DB_SCHEMA_VERSION)
Cached source — sdb_v1 (SOURCE_DB_SCHEMA_VERSION)

- The layout version is the last component of a table path. Every layout marker starts at v1
for the first release, 0.4.0 (developer, November 18, 2026, ITL-1259; 0.3.0 was withdrawn,
so nothing released uses v2). A change to the common bookkeeping columns of a table kind
- The layout version is the last component of a table path. Every layout marker started at v1
for the first release, 0.4.0 (developer, November 18, 2026, ITL-1259; 0.3.0 was withdrawn).
The pipeline, side-effect log and operator cache layouts moved to v2 before that release,
with the three row ids (developer, November 25, 2026, ITL-1471; below, "Row ids"). A change to the common bookkeeping columns of a table kind
moves its layout version, so the table gets a new path. Never add, rename or retype a stored
column without it.
- A function result table is at
Expand All @@ -1001,7 +1002,7 @@ generation of hashing; rows of the current data context are the current entries.
correct result for the same input? No: a new major. Yes: a new revision (the type's
columns) or a new rdb version (the common columns). Components are delimited, never parsed
out of one string; the major is not repeated.
- Pipeline tables carry no revision (.../python.function.v1/schema:<pipeline hash>/pdb_v1). A
- Pipeline tables carry no revision (.../python.function.v1/schema:<pipeline hash>/pdb_v2). A
saved job names the type and major only (data_function_type_id); the revision comes from
the installed library's declaration (declaration_for(type id)).
- A data function type's declaration (PYTHON_FUNCTION, beside its class in core/data_function.py;
Expand Down Expand Up @@ -1057,6 +1058,85 @@ generation of hashing; rows of the current data context are the current entries.
contexts/logical_types.json, never in a data context manifest: a logical type is
versioned by its own identifier, and that file is not frozen.

Row ids: entry, instance, record (developer, November 25, 2026, ITL-1466, ITL-1471)

A row that passes through a node has three nested ids (docs/reference/hashing.md section 3).
All three, with their preimages, are defined in one module, core/row_ids.py; never build one of
these preimages anywhere else.

entry id — hash of user tags, system tags, the labelled input data hash (__pipeline_entry_id)
instance id — hash of the entry id (labelled) and the input's source-info tokens in name
order (__pipeline_instance_id)
record id — hash of the node's content hash (labelled), the instance id (labelled) and
the result id, __data_id (__pipeline_record_id)

- A function node identifies a row by its instance id (tokens included): it is the plain lookup
column of the pipeline table and the key of the node's in-memory cache. A new instance of a
known entry (same values, other tokens) writes a new row; its result normally comes from the
result store (same input hash), so nothing is computed.
- A pipeline row stores its record id (__pipeline_record_id). It is the table's key, and it
covers the content hash of the node that records the row (developer, November 26, 2026):
with the default pipeline-hash scope one table holds the rows of several nodes, told apart by
__node_content_hash, and two of them can record one instance with one cached result, each
under its own record id. Never take the node's content hash out of the record id: the second
node's row would be dropped as a duplicate. The row stores __node_content_hash, so it gives
its record id again from its own columns. A write skips only a row this node already stored under that record id; a recompute has a new
result id, so it writes a new row. There is no recomputation index: among the rows of one
instance, __recorded_at says which is the latest.
- Only side effects and functions that take the invocation context are keyed by the entry id:
the side-effect log's row key and its entry_id column, and
InvocationContext._entry_id_hash_ch (invocation_hash is pipeline_hash :: entry id). A token
never reaches that key, so a token-only change upstream delivers nothing again.
- The operator cache keeps its whole-row key (_record_hash) and stores, outside that key, the
row's entry id (__pipeline_entry_id) and its insertion time (__recorded_at); a row passed
again is skipped and keeps its first time. Every read of the cache drops both
(_STORED_ONLY_COLUMNS).
- The column names inside a preimage are part of its recipe: renaming one moves the ids made
from it (the golden cases pin a pipeline table's instance ids; a record id holds a random
result id and cannot be pinned).
- The placeholder of an ephemeral result that is gone (EmptyData) carries the source-info
tokens a real output would, with the sentinel row_ids.EPHEMERAL_RESULT_GONE in place of the
result id (one constant; built by data_function.output_source_info, as a real output's tokens
are). A node given a placeholder computes its instance id from those tokens, finds its result
in the result store by the input hash, calls nothing and writes no pipeline row (developer,
November 26, 2026; FunctionJobNode._empty_data_cache_hit is the one place that holds that
choice, to be reconsidered in ITL-1475).
- The instance id reads a row's tokens through `DataProtocol.source_info_table()`: one column
per data column, a data column with no token having a null token. THE INTENDED RULE
(developer, November 27, 2026): the type of every source-info token column is fixed by the
pipeline, like every other column type, and is not meant to be taken from values: each
source and operator determines its output token columns' types from its inputs' types, by
its own rule, in its own module. A data-tag that falls through a function pod is meant to
keep its source-info token with its type unchanged; a column a function returns is never a
pass-through, even with an input's name and value (its token points to the function).
TODAY (ITL-1471), in `source_info_table()`: a null token is a `large_string` null whatever
type its column declares; a non-null token of a row read from an Arrow table (a stream's
row) keeps the type that table declares, with a nullable field; a token given as a Python
value is typed from its value (`arrow_utils.source_info_arrow_type`). STOPGAP, not the
proper solution: today a token's declared type is, in some places, inferred again from its
value (`Data.as_table(columns={"source": True})` and so `_rows_to_table`, the row-built
form, and `with_columns_of`). It can narrow a declared type (example: `[None]` in a token
column a `Batch` declares with two list levels infers one). ITL-1491 removes it. Never
build on the re-typing, and never write "a function passes a column through". A rename
moves a column's token with it; a token held for the destination name before is dropped. A pipeline table keeps one type per token column: a row whose token column
has another type than the rows recorded (a list token beside a string or null token) is
refused, naming the column and both types (_require_one_type_per_token_column), and the write
fails as a database write error. A lookup must never fail on a row its stream holds as valid Arrow. The pipeline row
stores that same table (_add_pipeline_record), never the columns of
as_table(columns={"source": True}): every stored row gives its instance and record id again
from its own columns.
- A trace resolves a held row by its instance id, on every branch of a function step (over a
source and over another node): a function node says which instance it holds each row under
(FunctionJobNode.held_instance_ids), and provenance._entries_for keeps the stored records of
that instance. Never select by comparing token values. Another run's record of the same
entry, with other tokens, is not that row's; several records of one instance stay an
inconsistency.
- On the async path as on the sync path, a placeholder input goes to _empty_data_cache_hit,
never to the function or the pipeline writer, and under the same row failure policy and
events: the row starts before the lookup, and a placeholder with no stored result is one
failed row (continue) or stops the run (fail_fast).
- PostRunPayload.result_id is the result's id (a UUID, not a hash).

### System tag evolution rules

1. Name-preserving — single-stream ops. Column name/value pass through unchanged.
Expand All @@ -1068,8 +1148,8 @@ generation of hashing; rows of the current data context are the current entries.
user tag list[T] and keeps it a tag, while GroupBy keeps its scalar keys and drops every
other user tag (ITL-1070). No tag ever moves to the data group. Source-info columns become
list[str] with one element per member. System tag columns must
stay scalar, because _build_record_id_preimage (core/nodes/function_node.py) hashes them
directly to derive record identity. They fold to a deterministic digest via
stay scalar, because entry_id_preimage (core/row_ids.py) hashes them directly to derive
a row's entry id. They fold to a deterministic digest via
arrow_utils.fold_system_tag_values and their column name gains ::{pipeline_hash}.

The fold is SHA-based (one helper for both system tags: the SHA-256 of the canonical JSON member list after the
Expand Down Expand Up @@ -1717,11 +1797,13 @@ data. The rules:
(`arrow_keys.polars_key_frame`, `arrow_keys.sort_key`) and the rows are taken from the
table, so no value passes through Polars. A tag type with no rule (a map, an interval, a
union, a list view) raises `TypeError` naming the column.
- Data source-info values may be str, None, or list[...], nested to any depth; Arrow/Python
types are derived from the value, with None mapping to large_string. That rule has one
definition, arrow_utils.source_info_arrow_type, and applies only to tokens supplied as
Python values: ArrowTableStream.iter_data hands each row's source info to Data as Arrow
columns, so a type the stream already has is never re-inferred. A many→one operator must
- `Data` source-info values may be `str`, `None`, or `list[...]`, nested to any depth; for a
token supplied as a Python value the Arrow and Python types are derived from the value, with
`None` mapping to `large_string`. That rule has one definition,
`arrow_utils.source_info_arrow_type`. `ArrowTableStream.iter_data` hands each row's source
info to `Data` as Arrow columns, and `source_info_table()` keeps the type the stream
declares for a non-null token. Today a declared type is, in some places, inferred again
from the value, a stopgap ITL-1491 removes (above, "Row ids"). A many→one operator must
emit a list for EVERY row of a list-valued column — mixing in a bare None makes per-row
as_table() schemas diverge and pa.concat_tables fail on the barrier path.
- Operators that build lists (Batch, GroupBy, MergeJoin) build every list-valued column
Expand Down
Loading
Loading