Repository navigation
fix(streams): refuse non-string or null system tags and incomplete ID pairs at construction (ITL-1341) - #638
Conversation
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…(ITL-1471) core/row_ids.py holds the three nested row ids and their preimages. A data datagram gives its source-info tokens as a one-row table (source_info_table), and the EmptyData placeholder carries tokens built as a real output's are, with the sentinel EPHEMERAL_RESULT_GONE in place of the result id. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…_v2, tdb_v2 (ITL-1471) A function node looks a row up by its instance id and keys it by its record id; the recomputation index and the query before every write are gone. Side effects and functions that take the invocation context are keyed by the entry id, the log column record_id_hash is entry_id, and PostRunPayload.record_id_hash is result_id. The operator cache stores the entry id and its insertion time beside its row key, outside the key. FunctionRun.entry_id is record_id. BREAKING CHANGE: stored pipeline tables, operator caches and side-effect logs move to new layouts; every invocation hash changes once; an operator cache on a SQLite database is refused when it is attached. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…n changes (ITL-1471) A pipeline table's record id holds the result id, a UUIDv7, so it cannot be pinned: the golden cases pin the instance ids instead. The 18 changes the developer approved on 2026-11-25 (golden-changes.md of ITL-1466): 6 record-id pins removed, 6 instance-id pins added, 6 table paths moved from pdb_v1 to pdb_v2, in pipeline-02.json (4 entries) and provisional/pipeline.json (8), and the open revision of v1.json. No other value moves. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…TL-1471) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ut (ITL-1471) On the async path the second copy of an identical input either computes its own result (two records) or takes the first's (one record), by scheduling. The first CI run showed the second outcome. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…described (ITL-1471) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Failing on b556376: placeholders fed through async_execute, both jobs' traces after a token-only rerun, and an inactive function node given rows whose token column cannot be typed again from its values. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…input hash (ITL-1471) async_execute sent a placeholder whose instance is not stored to the function like any miss; the pipeline writer then read it as a table and raised EmptyDataAccessError although the result was stored. It now goes to _empty_data_cache_hit, as on the sync route: no call, no pipeline row. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
After a token-only rerun a function's table holds two records of one entry that name one result. The trace matched on system tags and result alone, found both and refused every row of the first job. It now keeps the entry whose stored input tokens are the input row's. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…L-1471) A row read from an Arrow table keeps that table's source-info columns, and source_info_table() returns them with a row's own nullable fields. A token's type is never worked out again from its value, so a lookup no longer fails on rows with a nested token column that the function is never called for. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…races and placeholders (ITL-1471) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…lumn types (ITL-1471) Failing on 2d8a6a8: a token column whose Arrow type is not the type its values would be given again (a list column holding a null; a nested list). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…as made from (ITL-1471)
_add_pipeline_record stored the columns of as_table(columns={'source': True}),
typed again from the token values, while the instance id read the row's typed
columns. One helper, source_info_table(), now gives both, so every stored row
gives its instance and record id again from its own columns. For ordinary rows
the two tables are equal, so no stored column type and no id moves.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…nested tokens are recorded (ITL-1471) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
source_info_table() of a row with no token has no column and no row; the pipeline record leaves it out, as before the change, and the row's ids are recomputed from the stored row all the same. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ference (ITL-1471) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Failing on f3f6842 (18 cases): two nodes sharing a pipeline table, a trace over the source after a rerun with other tokens, and a placeholder without a stored result under the row failure policy on the async route. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…; placeholders under the row failure policy (ITL-1471) One pipeline table holds the rows of every node with one pipeline hash. Keyed by the record id alone, a second node that recorded a shared instance with the cached result lost its row as a duplicate. The key is now the node's content hash with the record id (row_ids.pipeline_row_key), and the record id is stored in its own column; its recipe is unchanged. On the async route a placeholder whose result is not stored is one failed row under the row failure policy, with the sync route's events (the row starts before the lookup), instead of aborting the run. FunctionJobNode.held_instance_ids says which instance each held row is under. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ry branch (ITL-1471) The branch for a function over its source took the one entry before choosing an instance, and the other branch compared token values. Both now keep the stored records of the instance id the node holds the row under. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e placeholder policy (ITL-1471) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ry (ITL-1471) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Failing on 69d8ec1 (17 cases): sessions whose null tokens are typed differently share a table; a null token's instance id does not follow its column's type; differing token types in one table are refused naming the column. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…or two types in one column (ITL-1471) A null token is a large_string null whatever type its column declares, for the instance id's preimage and for the stored column alike; a non-null token keeps its typed column. So sessions whose null token columns are declared differently share a pipeline table again, and a null token's instance id is a function of the row alone. A row whose token column has another type than the rows recorded is refused naming the column and both types. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ma read (ITL-1471) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e events on both routes (ITL-1471) Failing on 4a916ec (4 cases): the async route reports the row's start only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…fore a fatal error stops the run (ITL-1471) A database error or an identity error in a placeholder's result lookup is never a row failure. The async route raised it after the row's start event alone; it now reports the row's crash first, as the sync route does. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Result-cache validation now sees the Arrow token type on serialization even when its value is null. Enable the regression test and update the result-cache documentation.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@coderabbitai review Posted by a Codex agent on behalf of @eywalker. |
Action performed
|
Fixes ITL-1341
ArrowTableStreamrejects non-string system-tag columns, null system-tag values, and incomplete source-ID and record-ID pairs in caller-supplied raw tables at construction. It preserves custom string system tags and nullable declarations on fields whose values are all present. Built-in operators carry existing system tags forward through sync and async execution, including LOG storage.PR #607 validates system-tag declarations at source entry points. The three raw-stream cases were still accepted on its branch. The Rejoin bit comparison described in the issue is already absent on main. This draft now targets main and includes #607, #634, and #645.
Independent review classification
a958449a(main) andcd821208(reviewed head)source_idorrecord_idafter name-extending operatorsArrowTableSourceand run Join, MergeJoin, Batch, or GroupBy. Main returns the output and stores it in LOG mode. The reviewed head refuses 168 materializations and 32 LOG writes across sync and async routes. Standalone async Join emits rows on both revisions.ArrowTableStreamwith an explicitly nominatedsource_idorrecord_idSource follow-up
bf2582d4(main) andae771281(reviewed head)source_id::externalorrecord_id::externalArrowTableSource,DictSource, and Arrow-backedDataFrameSource, nominate either column withsystem_tag_columnsand read it withas_tableoropen_channel. All 24 observations across both layouts succeed on main. The reviewed head refuses all 24 at construction and asks for a partner. The updated head matches main.ArrowTableStreamFound in review, present on main, not addressed here
source_idwith text values such ascustom-aon anArrowTableSource, wrap it inCachedSourcewith an emptyInMemoryArrowDatabase, and callas_table(). Main and the reviewed head raiseCachedSourceIdMismatchErrorbecause the cache reads the tag as a source ID. The updated head matches main forsource_idandsource_id::x.record_idfield, nominate it withsystem_tag_columns, and callas_table(columns={"system_tags": True, "content_hash": True}). Main and the reviewed head raiseKeyErrorfor the duplicate_tag_record_idfield. The updated head matches main for all four ID-shaped nominations.ArrowTableStream(pa.table({"x": [1], "_tag_": ["custom"]}), system_tag_columns=["_tag_"])and readiter_data(). Main and both PR revisions raiseKeyErroron the row read. Passing the same raw field already prefixed, without nominating it, works on main and the updated head. Source builders reserve the prefix.pa.table({"x": [1], "_tag_legacy": [42]})or use a null in a string-typed_tag_legacyfield, then runSelectDataColumns(["x"])in LOG mode. Main writes and replays the malformed row. The PR rejects both raw inputs at construction and rejects the same stored rows at replay stream construction, even with a valid data-tag marker. Repair of historical stores falls outside the construction change. Rebuilding the results from valid inputs restores replay.Fix and regression tests
The shared source builder passes the nominated custom columns and the provenance pair it generated into the library-built stream path. PollingSource uses that path when it combines batches or rebuilds their empty declarations. SpiralDBTableSource uses it for whole-table reads. The stream validates string values and null counts on every path. Pair validation by ID prefix and full provenance path runs only on raw input.
Stream construction audit
ArrowTableStream(...)SourceStreamBuilder.attach_provenancePollingSource._typed_zero_row_table,PollingSource._combine,SpiralDBTableSource._whole_tablestream_from_derived_table.CachedSource._build_merged_stream,DerivedSourceorigin rows, source-node declared rowsstream_from_derived_table.stream_from_derived_table._TiedJoinStreamexplicitly selects the same internal validation path.stream_from_derived_tableor the internal_RowsOfStreamsubclass, which explicitly selects internal validation.stream_from_derived_table.The constructor's provenance-pair inference has one call site. Separate name-based readers on main retain their existing behavior. They are the PollingSource batch key check, CachedSource source-ID check, source-node slot validation and declared-column matching, GroupBy member ordering, Join's tied-field ordering and nullability in table, row and record-batch execution, and pipeline provenance queries. These readers do not invoke raw stream validation.
source_idandrecord_idtags after Join, MergeJoin, Batch, and GroupBy, including LOG writes and a downstream projectiontest_extended_custom_id_tags_survive_operator_logintests/test_core/streams/test_system_tag_validation.py. The 32 cases cover both names, source and raw inputs, all four operators, and sync and async LOG execution. All 32 pass on main, fail on the reviewed implementation, and pass with the fix.test_source_preserves_nominated_custom_id_tagcovers ArrowTableSource, DataFrameSource and DictSource, both names, and sync table and async channel reads.test_a_system_tag_id_requires_its_partner,test_pairing_uses_the_full_provenance_path, andtest_detached_custom_id_tag_read_as_raw_requires_its_partnerin the same file.Decided narrowing for detached Arrow tables
Main accepts a detached table that has a single system tag with the spelling of an ID. The fixed head raises
InputValidationErrorfor its missing partner when the same table is passed to the raw constructor. The detached table has no role information to distinguish the custom tag from an unpaired provenance ID. The normal operator and LOG paths preserve the custom tag. To use the detached values as a custom tag on a new source, rename the column to an unprefixed name and nominate it withArrowTableSource(..., system_tag_columns=[...]). The new source generates its own provenance pair.One-line reproduction (with
pyarrow as pa,ArrowTableStream, andBatchimported):Verification
Source follow-up verification
bf2582d4, the updated head matches 1,720 accepted observations and 464 existing refusals. The only differences are the deliberate raw refusals and the routes that require those refused raw streams. The comparison checks schemas and field metadata, rows, source info, hashes, and row IDs across two field layouts, with deterministic function-result UUIDs.--checkmatched semantic, schema, Arrow, datagram, pipeline, and Torch hashes. Ruff lint and format checks passed. Basedpyright exited 0 with zero errors.Merge verification
Merged
mainat3e640fb5(PR #633) into the reviewed head.src/orcapod/core/nodes/source_node.pykeeps the identity-chain andRootSourceimports from main alongside the existing derived-stream constructor import.src/orcapod/core/streams/arrow_table_stream.pykeeps main's binding-dependent hash property alongside the existing raw system-tag validation method.The merge introduced no additional system-tag behavior changes. The golden hash check and targeted suite passed, including the hash site inventory, identity chains, and system-tag validation. GitHub listed zero review threads and CodeRabbit's rate-limit notice contained no findings to classify.
Main advanced again during CI. The follow-up merge at
208ce487resolved a conflict insrc/orcapod/core/nodes/function_node.pyby keeping PR #646's output-order imports alongside the existing derived-stream constructor import. Function output ordering and derived system-tag roles both retain their reviewed behavior.A clean merge of
08c048a7picked up PR #658's Pick and Index changes in the shared operator files and stream base. The derived-stream constructor remains in place for the affected operator and typed-empty stream paths.Another clean merge of
8c0b7624picked up PR #652's identity-chain tree changes in the shared source node and operator transport. The corresponding derived-stream calls remain in place.CodeRabbit follow-up
CodeRabbit reviewed
0a39e132and reported zero actionable comments and zero threads. Its architecture summary revisited the detached-table example above. The public Batch export and raw reopen succeed on main (8c0b7624). The PR stops at the raw reopen with anInputValidationErrornaming the missing record-ID partner. This is the previously documented intentional raw-input validation. The malformed-store observation was also reproduced on both revisions and is recorded under the pre-existing findings above.The golden hash check, Ruff lint and format checks, basedpyright (exit 0, zero errors), and targeted pytest run (629 passed, 2 expected failures, including the hash site inventory and identity chains) passed on
0a39e132. GitHub CI and CodeRabbit passed.Summary by CodeRabbit
Bug Fixes
Compatibility