diff --git a/.zed/rules b/.zed/rules index 909cc51d5..ae46179fd 100644 --- a/.zed/rules +++ b/.zed/rules @@ -971,8 +971,8 @@ Pipeline structure, bound sources, and slot names contribute to three hashes: 2. pipeline_hash() — schema + topology only. Ignores data content. Used for DB path scoping so that different sources with identical Arrow schemas share database tables. 3. node_hash() — the pipeline hash with its name chain. The name chain still exists - when a contributing slot is unbound. Bound graph keys use content identity while - unbound graph declarations use name-based identity. + when a contributing slot is unbound. In-memory graph keys use node identity. + Saved and execution identities follow the legacy projection. Base case: RootSource.pipeline_identity_structure() returns the Arrow schema identity of its tag and data schemas (below, "Schemas are hashed as Arrow schemas"). diff --git a/CLAUDE.md b/CLAUDE.md index 8c6ad7207..af178dbcd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -991,8 +991,8 @@ Pipeline structure, bound sources, and slot names contribute to three hashes: 2. **`pipeline_hash()`** — schema + topology only. Ignores data content. Used for DB path scoping so that different sources with identical Arrow schemas share database tables. 3. **`node_hash()`** — the pipeline hash with its name chain. The name chain still - exists when a contributing slot is unbound. Bound graph keys use content identity - while unbound graph declarations use name-based identity. + exists when a contributing slot is unbound. In-memory graph keys use node identity. + Saved and execution identities follow the legacy projection. Base case: `RootSource.pipeline_identity_structure()` returns the Arrow schema identity of its tag and data schemas (below, "Schemas are hashed as Arrow schemas"). diff --git a/changelog.d/ITL-1559.md b/changelog.d/ITL-1559.md index a2b462c8e..071b1f800 100644 --- a/changelog.d/ITL-1559.md +++ b/changelog.d/ITL-1559.md @@ -1,5 +1,40 @@ ### Breaking changes and migration +- `Pipeline.graph` and `PipelineJob.graph` are removed. Use `dag` for topology and + adjacency, `nodes[label]` for node information, and `diagram()` to display the graph. + Use the pipeline API to add vertices or edges. +- Jobs refuse one source object on two slots at capture, binding or load. Bind + the source to one slot and branch from that slot. Step 6 of ITL-1559 will let + both slots run (ITL-1442). +- Capture refuses nodes, slots and invocation streams from other blueprints and + jobs, including prebuilt streams over them. Pass the source itself or use + `node.as_source()` to read another job's stored results. Rebuild a loaded + graph from its original code to add steps. +- A slot name holds one leaf object. Reuse the same stream or declare the + other object under its own name with `SourceNode.from_stream(stream, name=...)`. + ITL-1553 will define when separate objects can share a slot. +- Capture refuses a slot and an unrelated step under the same name. Capture and + binding refuse legacy execution identities shared by two slots or by a slot + and a step, including slots with different inferred names. Reuse the recorded + step's output or bind distinct sources. +- Jobs refuse bindings to another graph's live invocation streams and compiled + nodes. Job-derived blueprints keep their compiled graph and refuse new captures. +- Compiled blueprint and job steps refuse input replacements. Build a new graph + to change its edges, or bind a different source to an existing job slot. +- To add a downstream step in a later blueprint capture, pass the original + invocation stream. Capture from the compiled blueprint step is refused. +- Capture refuses reuse of a pod and its input objects when rewiring changes + their graph key. Create a new descriptor for the rewired inputs. +- Capture refuses using both an explicit slot declaration and its exact source + directly until ITL-1553 defines source and stream equivalence. Choose one capture + form and branch from it. +- The DAG and its vertex listing accept membership queries for their own vertices. + A foreign stream, node or invocation raises `UndefinedGraphMembershipError`. + Internal graph-key strings are unavailable in public DAG queries. + Access nodes by label through `job.nodes[label]` or `pipeline.nodes[label]`. + Automatically numbered labels for steps sharing one automatic name follow node-hash order + (ITL-1559). + - Function pods that receive an invocation context now include the configured parameter name in their pipeline hash. Their pipeline tables and downstream tables that use the affected hashes have new `schema:

` paths, and downstream system-tag column names @@ -41,6 +76,37 @@ ### Fixed +- Reversed captures of a commutative custom operator share one graph vertex and + keep the downstream rows visible. (ITL-1559) +- Ordered custom operators retain both branches when captured with reversed + arguments. Rebuilt jobs use ordered identities, and saved jobs can still + read results from previous runs. (ITL-1559) +- Invocation imports refuse foreign output substitutions. Blueprint capture + accepts standalone operator descriptors as independent inputs. (ITL-1559) +- A refused invocation import leaves the caller's declarations and descriptors + available for reuse. Standalone DAGs and the NetworkX adapter use the supplied + objects as keys, preserving distinct bound jobs' nodes and results in both + orchestrators. Standalone DAG adjacency preserves edge operand metadata, and + standalone node runs can join differently bound instances of one blueprint. + Tracing such a join includes both sources. The standalone vertex mapping + exposes live attributes, and async results accept equal aliases and report + stale rows after a rebind. + (ITL-1559) +- Stacked trackers run public validation before recording. Capture applies the + receiving graph's rules with custom source factories and recognizes foreign + inputs inside descriptor wrappers and executed slot outputs. Binding also + refuses executed slot outputs. Jobs check descriptor edits while the descriptor + is reachable from a live input. (ITL-1559) +- Blueprints refuse rewires that change captured input identities and + recompiles that change a held slot's schema. (ITL-1559) + +- Job binding checks whether the proposed databases can store pending steps before updating + sources or databases. (ITL-1559) + +- Blueprints accept schema-only slots even when the example stream matches a recorded step. Capture checks new execution identities incrementally. Jobs refresh those identities after rewiring, binding, and recompilation so a later capture refuses a collision with a live slot. (ITL-1559) + +- Distinct raw Arrow inputs keep their own implicit slots and results. Direct blueprint saves select one legacy descriptor per wire key and write each edge once. (ITL-1559) + - Retained outputs from source slots raise `StaleOutputError` after a contributing slot is rebound. Read the node again for the current binding. This prevents downstream operator logs from recording old rows under the new binding's hash. diff --git a/docs/api/errors.md b/docs/api/errors.md index 860739d66..fe8fac421 100644 --- a/docs/api/errors.md +++ b/docs/api/errors.md @@ -68,6 +68,8 @@ These exceptions and warnings report problems running pipelines, processing rows ::: orcapod.errors.PipelineJobRequiredError +::: orcapod.errors.UndefinedGraphMembershipError + ::: orcapod.errors.DataFunctionUnavailableError ::: orcapod.errors.OutputTypeError diff --git a/docs/concepts/identity.md b/docs/concepts/identity.md index f0a9c4c83..45b00571d 100644 --- a/docs/concepts/identity.md +++ b/docs/concepts/identity.md @@ -33,8 +33,9 @@ Most sources use their schema, `source_id` and key columns in their identity (th 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. + A slot name holds one source or stream object. A job reads a source object through + one slot. At capture, binding, loading and execution, equal-content root source + objects must be reused. 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 diff --git a/docs/concepts/pipeline-job.md b/docs/concepts/pipeline-job.md index 90dde0c30..9e803b110 100644 --- a/docs/concepts/pipeline-job.md +++ b/docs/concepts/pipeline-job.md @@ -90,13 +90,13 @@ node: | Function pod | The `label=` passed when it was applied; otherwise the function's name | | Operator | The operator's class name (`Join`, `GroupBy`), numbered when there are several (`SelectDataColumns_1`) | +Steps with the same automatic name are numbered in `node_hash()` order. + ```python print(sorted(job.nodes)) # ['bmi', 'mice'] ``` -The order in which `job.nodes` lists its names is not meaningful and can differ between -Python sessions; look nodes up by name. A node is a stream: `output_schema()`, `keys()`, `iter_data()`, `as_table()` and `as_pandas_df()` work on it, and show the rows of the job's **current run** in this Python @@ -455,6 +455,15 @@ print(job_c.nodes["bmi"].as_table().num_rows) # 1 ``` +Access a node by label with `job.nodes[label]` or `job.