Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Merge Risk:
|
…trees' into eywalker/itl-1559-step-3-graph-keyed-by-node-hash
|
Closing: this work continues in #695 (ITL-1848, step 3 PR A), which keys compiled graphs by node hash and keeps main's behaviour except for the listed accepted refusals. The rest of step 3 is tracked under ITL-1559 and its children (ITL-1864 for step 4, ITL-1865 for step 6). Posted by a Claude Code agent on behalf of @eywalker. |
Summary
Implement step 3 of ITL-1559 against the final capture specification. The receiving graph names and validates leaves before recording a step. Graph keys are fixed at capture, and saved files and runs use the legacy projection. The capture specification documents 87 cases and maps them to tests. Cached pod outputs keep their recording provenance when a later step consumes them.
Standalone
OrcaDAGandNetworkxBackendkeep main’s behavior for caller-supplied keys, equal aliases, live vertex attributes, edge endpoints, adjacency, traversal, and cycle and missing-vertex errors. Standalone runs also keep main’s result lookup, stale-output diagnostics, and provenance across joins of separately bound jobs. One differential runs 11 scenarios against main at26efe35a, exercising all 14 public DAG operations on the standalone adapters and compiled pipeline and job DAGs, plus the vertex views, async result reads, and join tracing. It compares shared behavior directly and asserts the specified compiled membership and mutation rules.Reference, key, identity and membership
job.<label>orjob.nodes[label]. A bind or rebind keeps the label. Saved labels follow main's choice. BL16 orders same-named unlabelled steps by node hash. Step and input-slot label collisions keep main's numbering.inand a stream, node, or invocation object raisesUndefinedGraphMembershipError. Usejob.nodes[label]orpipeline.nodes[label]. DAG adjacency uses the receiving graph's own nodes (rows 42–51).Refusals and migration
node.as_source()for stored results. ITL-1700 will define implicit names.Main's existing refusals retain their error class and message. The new refusals occur before recording or binding. All tests that used shared-slot bindings now branch from a single slot, use distinct sources, or assert the refusal. The direct blueprint test for a late live-slot collision is covered by the capture refusal in row 52.
Updated tests and documentation
tests/test_hashing/test_identity_chains.pygives the nested symmetry fixture four distinct bindings and rebindsy_slotto a distinct reading.tests/test_pipeline/test_source_id_conflicts.pyasserts the prospective binding refusal and the state preserved after it.tests/test_pipeline/test_source_object_registration.pycovers refusal at bind, at the setter and on load. It reuses one projection object and checks the original diagnostics with separate root objects. A one-call rotation remains covered.docs/concepts/sources.mdanddocs/concepts/identity.mddocument the migration. The documentation samples already use supported capture routes and continue to use the label-keyed job API.Row-to-test table
| Row | Test | Decision asserted |
| 1 |
test_r01_step_inside_graph| Accept || 2 |
test_r02_own_node_later_capture| Accept || 3 |
test_r03_root_once| Accept || 4 |
test_r04_same_object_same_pod| One node, labeld1|| 5 |
test_r05_same_object_two_pods| Accept || 6 |
test_r06_one_object_two_slots_bind_refused| Refused atbind; both slots keep their bindings || 7 |
test_r07_one_object_two_slots_capture_refused| Refused at the step bringingy|| 8 |
test_r08_equal_content_objects_refused|main's error || 9 |
test_r09_one_name_other_keys_refused|main's error || 10 |
test_r10_prebuilt_once| Accept || 11 |
test_r11_prebuilt_same_object_twice| One node, labelp1|| 12 |
test_r12_prebuilt_equal_builds_refused| Refused, names the slot and both streams || 13 |
test_r13_prebuilt_other_content| Accept || 14 |
test_r14_prebuilt_and_its_root| Accept || 15 |
test_r15_prebuilt_over_own_slot_refused|main's error || 16 |
test_r16_raw_without_system_tags_refused|main's error || 17 |
test_r17_raw_once| Accept || 18 |
test_r18_raw_two_distinct(job and blueprint) | Accept || 19 |
test_r19_raw_two_equal_refused| Refused || 20 |
test_r20_other_job_into_job_refused|main's error || 21 |
test_r21_other_job_bound_node_refused| Refused,main's text for a pipeline || 22 |
test_r22_other_job_unbound_node_refused| Refused || 23 |
test_r23_instances_same_binding_refused| Refused || 24 |
test_r24_instances_other_binding_refused| Refused || 25 |
test_r25_other_job_bound_slot_refused| Refused || 26 |
test_r26_other_job_unbound_slot_refused| Refused || 27 |
test_r27_instance_slots_other_binding_refused| Refused || 28 |
test_r28_loaded_job_node_refused| Refused; also a prebuilt stream over it || 29 |
test_r29_derived_source| Accept || 30 |
test_r30_two_derived_objects_refused|main's error || 31 |
test_r31_loaded_derived_source_refused|main's error || 32 |
test_r32_cached_source| Accept || 33 |
test_r33_cached_and_wrapped_refused|main's error || 34 |
test_r34_slot_name_same_leaf| Accept, one slot || 35 |
test_r35_slot_name_other_leaf_refused| Refused || 36 |
test_r36_slot_name_other_schema_refused|main's error || 37 |
test_r37_slot_and_root_name_blueprint_refused| Refused at the root's step || 38 |
test_r38_slot_and_root_name_job_refused| Refused at the root's step || 39 |
test_r39_slot_name_equals_step_label,test_r39_automatic_step_shares_its_new_slot_name| Main’s slot and step labels in both cases || 40 |
test_r40_merge_join_repeated_input| Accept || 41 |
test_r41_label_kept_as_main| One node, labelr1|| 42 |
test_r42_foreign_object_lookup| Object membership raisesUndefinedGraphMembershipError. Label access and owned-node adjacency remain available. || 43 |
test_r43_instances_different_sources| Object membership raisesUndefinedGraphMembershipError. Label access and owned-node adjacency remain available. || 44 |
test_r44_instances_same_source_object| Object membership raisesUndefinedGraphMembershipError. Label access and owned-node adjacency remain available. || 45 |
test_r45_instances_equal_source_objects| Object membership raisesUndefinedGraphMembershipError. Label access and owned-node adjacency remain available. || 46 |
test_r46_unbound_instances| Object membership raisesUndefinedGraphMembershipError. Label access and owned-node adjacency remain available. || 47 |
test_r47_bound_and_unbound_instance| Object membership raisesUndefinedGraphMembershipError. Label access and owned-node adjacency remain available. || 48 |
test_r48_own_node_after_from_pipeline_bind| Object membership raisesUndefinedGraphMembershipError. Label access and owned-node adjacency remain available. || 49 |
test_r49_own_node_captured_job| Object membership raisesUndefinedGraphMembershipError. Label access and owned-node adjacency remain available. || 50 |
test_r50_own_node_unbound_then_bind| Object membership raisesUndefinedGraphMembershipError. Label access and owned-node adjacency remain available. || 51 |
test_r51_blueprint_membership| Object membership raisesUndefinedGraphMembershipError. Label access and owned-node adjacency remain available. || 52 |
test_r52_standalone_job_slot_into_blueprint_refused| Refused |The byte fixtures come from main at
39be606a. The fixture writer version is pinned so test installs at different revisions can compare every byte. In row 39, main gives the explicit stepaand gives its slot the automatic display labela_1. The fixture preserves those labels and the slot namea.Follow-up
Step 4 moves the saved format to the new hashes and records the slot name and source identity. It also makes the most recent explicit label win for saved nodes. Step 6 lifts the shared-source binding refusal, runs both branches, and can accept equivalent objects when ITL-1553 defines source equivalence.
Decisions for the developer
Rows 53–54. The developer confirmed that step 3 refuses capturing the same source object directly and through its explicit slot declaration in either order. ITL-1553 tracks accepting both forms with one bound slot and both branches running once source and stream equivalence is defined.
The third review tested both orders in sync and async, with and without compilation between captures. Main has two live slots named
a, leaves the declaration branch unbound, and reports a partial run withdeclared=[]anddirect=[9,12]. It stores two triple results and two corresponding pipeline records. Reviewed headafd1c7adcompleted both branches and addeddeclared=[6,8], two double results and two corresponding pipeline records. With the version and run ID pinned, the saved job changed from 6,857 to 6,841 bytes. The run URI changed fromjob@af03287e39c266adtojob@3dd6f83f7f5c657e. CSV/Delta readback in both directions reproduced the writer’s rows.Row 85. Step 3 refuses late capture from a compiled blueprint step. Approving a direct edge from
firsttosecondwould save three vertices. Main saves four vertices with a separate implicit slot feedingsecond. In the pinned sync and async review fixture, the saved blueprint would change from 6,317 to 5,114 bytes. With only the original source bound,secondwould return[7, 9]instead of[]. Passing the original invocation stream already saves identical 5,123-byte blueprints and returns[7, 9]on both revisions.Other capture decisions
[70, 90]from the downstream step in both run modes. The refused capture preserves the original branch.Slot and node registration sites
AbstractPipelineBase.record_function_pod_invocation,record_operator_pod_invocationandrecord_side_effect_pod_invocation_record_invocation. The execution-role index checks new leaves and the retained step before publication. Stacked trackers stage their publications together.AbstractPipelineBase.prepare_invocation_record_invocationagain against the current graph.AbstractPipelineBase.from_invocations_record_invocationbefore the new graph is returned.PipelineJob.from_pipeline,PipelineJob.bindand the ownedSourceJobNode.bound_sourcesetterbind.PipelineJob.bindand the owned setter call_bind_sources. The transaction checks the prospective identities of the compiled and pending captured records before changing slots.from_pipeline(sources=...)reaches it throughbind. Standalone slots have no job registry.AbstractPipelineBase.compileandPipelineJob.as_pipelinePipeline.loadandPipelineJob.loadPipelineJob.loadcalls_bind_sourcesto restore bindings against the saved step identities. Loaded graphs refuse live captures.Fifth review
[7, 9]and[17, 19]in all 16 added cases, matching main.Pre-existing on main are the missing
as_slothelper, failure to instantiate a loaded function blueprint's saved stub, and refusal to capture after changing a slot binding.Sixth review
bind, ownedSourceJobNode.bound_sourceassignment,from_pipeline(sources=...)viabind, andPipelineJob.loadall reach_bind_sources. Fresh concrete capture checks its execution roles in_record_invocationbefore publishing them. Compile materializes those checked captures and preserves accepted bindings.26efe35a, with 223 variants per revision, 139 exact refusal and atomicity checks, 36 byte-identical saved fixtures, and 63 matching comparable store and URI observations. The remaining eight paired store observations exercise the specified refusals in rows 67 and 74.Public graph migration
The November 29, 2026 developer decision removes
Pipeline.graphandPipelineJob.graph(rows 76 and 78). Usedagfor topology and adjacency,nodes[label]for node metadata, anddiagram()for rendering. The implementation retains its private capture and compiled graphs.src/orcapod/pipeline/base.py, blueprint loading insrc/orcapod/pipeline/graph.py, and job-to-blueprint projection and job loading insrc/orcapod/pipeline/job.pytests/test_pipeline/test_pipeline.pydagandnodes[label]for topology and node information. The internal pipeline-hash assertion reads_hash_graph.tests/test_pipeline/test_pipeline_base_recording.py,tests/test_pipeline/test_source_object_registration.py, andtest-specification/unit/test_tracker.pytests/test_pipeline/test_capture_boundary.pyandtests/test_pipeline/test_source_id_conflicts.pytests/test_hashing/test_identity_chains.pydocs/concepts/pipeline-job.mdanddocs/reference/hashing.mdPending source and database bindings preflight captured steps before publishing a source, attaching a database, or changing the execution context (row 79).
Main integration and ITL-1767
Merged main at
d5c7f14f. That merge includes #675, #671, #672, #676, #669 and #673. Six conflict hunks were resolved. A second merge at511b7847picked up #616 without conflicts. Blueprint capture keeps the reserved-column check from #616 for source proxy declarations. Main advanced to26efe35aduring review pass 16 CI and merged cleanly.docs/reference/hashing.mdsrc/orcapod/pipeline/job.pysrc/orcapod/pipeline/job.pysrc/orcapod/pipeline/job.pysrc/orcapod/pipeline/job.pytests/test_pipeline/test_source_object_registration.pyFor the overlapping ITL-1767 cases, the ITL-1559 capture or binding diagnostic takes precedence. It covers the same source-alias fixtures earlier and also covers aliases between slots whose consumers use different pods. Distinct steps that would share a legacy execution vertex still receive the ITL-1767 step diagnostic, including when a compiled node's input setter would create the collision. Compile and binding preflight use the execution-role index to select the candidate steps.
Review pass 15
OrcaDAGuses Python object-key semantics. Distinct bound job nodes keep their own vertices, attributes, membership, and edges.Pipeline.from_invocationsandPipelineJob.from_invocationsdefer declaration claims and descriptor registrations until the import compiles. A refused import leaves the caller's input objects reusable.upstreamssetters check newly introduced edges for foreign inputs before installing them. Both run modes continue to return the original rows after a refused edit.Review pass 16
NetworkxBackenduses NetworkX's native object keys and views. Two independently bound nodes keep separate vertices and attributes, with the edge between them.ReservedColumnNameErrorwhen a bound proxy declares system tags. A proxy declaring user fields still retains the delegate's Arrow types.Review pass 17
prepare_invocationvalidation hook for functions, operators and side effects before staging any capture.as_node()descriptors go through the same capture walk as other prebuilt inputs. A wrapper over a foreign job slot reports that slot and the stored-result remedy.Mutation-route audit
set_active, tracker registration and deregistration,record_function_pod_invocation,record_operator_pod_invocation,record_side_effect_pod_invocation, andprepare_invocationand its callbackPipeline.from_invocationsandPipelineJob.from_invocationsPipeline.compile,PipelineJob.compile, and the source, function, operator and side-effect node factory attributesPipeline.load,PipelineJob.load,PipelineJob.from_pipeline,as_pipeline,pipelineandcompiled_pipelineFunctionNode.upstreams,OperatorNode.upstreams,FunctionJobNode.upstreamsandOperatorJobNode.upstreamsStreamBase._rewire. A compiled graph classifies newly introduced objects, preserves the job's shadowed-step error for colliding owned proposals, and refuses changed inputs before installing them. A standalone descriptor held by a job checks its prospective live bindings and execution roles before publishing the edit. A standalone descriptor used by a blueprint protects its saved input identities.SourceNode.upstreams,SourceJobNode.upstreams, and live and restored side-effectupstreamsPipelineJob.bindandSourceJobNode.bound_sourceSourceProxy.bindandunbindOrcaDAG.add_nodeandadd_edge, standaloneOrcaDAG.add_nodeandadd_edge, andNetworkxBackend.add_nodeandadd_edgedag.node_attrs,dag.nodes().mapping, the adapter's native node and edge views,nodes,source_pods,function_pods,operator_podsandsourceslabel, exposeddata_context,executor,node_config,apply_node_config,node_type, and exposedtracker_managerdatabase,result_database,execution_context,cache_mode,attach_databases,set_ephemeral_database,ephemeral_result_database,clear_cacheandadd_pipeline_recordrun,run_async,execute,async_execute,execute_data,save, nodefrom_stream/from_descriptorfactories andresetas_node()descriptor traces its retained inputs through the shared classifier.resetleaves recording state as it was.A stored-result source can follow a binding in another job. Receiving capture refreshes the execution-role index when that dependency changes. Job reads and runs validate the live dependencies.
Verification
Five matrices cover 1,104 cases in sync and async, including 48 mutation cases. The 504 new cases cross inferred, explicit and mixed names with sources, prebuilt streams and declarations, equal and distinct legacy content, and both orders. They cover direct capture into both graph kinds, instantiation, batch bind, and slot setters on direct and blueprint-derived jobs. The 290 accepted cases returned the same downstream rows on current main. Refused cases preserved the receiving graph and binding state.
Against main at
511b7847, the 96 custom-operator cases and the 48 mutation cases passed in both run modes. Main starts rewired controls with their final inputs. All 36 comparable row observations and saved byte fixtures matched, as did 34 accepted run URI comparisons. Each revision read the other revision’s Delta rows for functions and for both ordered and commutative operators. All six golden groups matched in check mode. Review pass 16 replayed the matrices on main at26efe35a, with 223 variants per revision, 139 exact refusal and atomicity checks, 36 byte-identical saved fixtures, and 63 matching comparable store and URI observations. The remaining eight paired store observations exercise the specified refusals in rows 67 and 74.Pass 17 rechecked 290 accepted cases, 223 row variants per revision, 139 exact refusals, 36 saved files byte for byte, and 63 comparable stored-row and run-URI observations against current main. The 34 additional compatibility cases include two-way Delta reads in both run modes. All six golden hash groups matched.
Summary by CodeRabbit
Breaking Changes
graphaccessor withdagfor inspecting pipeline topology and adjacency. Object-membership checks on public graphs are not supported.Bug Fixes