Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b7480b0
feat(pipeline): node.trace(), node.why_missing() and diagram highligh…
eywalker Nov 23, 2026
d000eb7
fix(provenance): no repeated 'because' line under the removing step (…
eywalker Nov 23, 2026
42d5e93
docs(provenance): concept page and tutorial Part 8 tracing section; r…
eywalker Nov 23, 2026
725a026
fix(provenance): read only held rows, refuse ambiguous links, follow …
eywalker Nov 23, 2026
bf2e471
fix(provenance): second review and CodeRabbit threads of PR 530 (ITL-…
eywalker Nov 23, 2026
68a269a
fix(provenance): no source method runs; inputs matched by position; t…
eywalker Nov 23, 2026
f97048f
fix(provenance): sources known by stored ids; MergeJoin element slots…
eywalker Nov 23, 2026
dbb1f6f
fix(provenance): a selected element keeps its list position; empty ru…
eywalker Nov 23, 2026
e1c4f3f
refactor(provenance): one path model for list positions (ITL-1432)
eywalker Nov 23, 2026
6502920
fix(provenance): each operator maps its columns by its own semantics …
eywalker Nov 23, 2026
beae55f
fix(provenance): effective renames, exact operator types, tied Join s…
eywalker Nov 23, 2026
9b278cb
fix(provenance): tied bindings leave stored history unknown; selectio…
eywalker Nov 23, 2026
38f666d
fix(provenance): SemiJoin right rows never flow on; rows match kept t…
eywalker Nov 23, 2026
c3c0d81
fix(provenance): a failed call is not 'never reached'; why_missing st…
eywalker Nov 23, 2026
c41f88d
fix(provenance): CodeRabbit review of 38f666d7 and twelfth review's J…
eywalker Nov 23, 2026
6619343
fix(provenance): witness needs the held input's hash; own-name data-t…
eywalker Nov 23, 2026
c74a03d
fix(provenance): why_missing reasons for SemiJoin right rows and held…
eywalker Nov 23, 2026
5138afd
fix(provenance): a null join key matches nothing in the missing-key r…
eywalker Nov 23, 2026
fd36f72
docs(provenance): show the diagram highlights on the site (ITL-1432)
eywalker Nov 24, 2026
8544882
feat(provenance): diagram highlight in the text colour, with a captio…
eywalker Nov 24, 2026
37cc410
feat(provenance): the asked node, written-out questions, several rows…
eywalker Nov 24, 2026
d913c74
fix(provenance): operator equality in the reason, collapsed asked nod…
eywalker Nov 24, 2026
352f76f
Merge remote-tracking branch 'origin/main' into eywalker/itl-1432-pro…
eywalker Nov 24, 2026
583c4b2
fix(provenance): follow ITL-1425 source ids after merging main (ITL-1…
eywalker Nov 24, 2026
d1a3432
fix(provenance): why_missing's source argument names exactly one sour…
eywalker Nov 24, 2026
3e1a115
fix(provenance): a full source id asks about that id's records only (…
eywalker Nov 24, 2026
cfcb1dc
fix(provenance): refuse a slot label that is also one of the slot's i…
eywalker Nov 24, 2026
c2e83ea
Merge remote-tracking branch 'origin/main' into eywalker/itl-1432-pro…
eywalker Nov 24, 2026
17c61d1
fix(provenance): follow main's pipeline record metadata and async ord…
eywalker Nov 24, 2026
acca12c
fix(provenance): CodeRabbit reviews of cfcb1dc5 and 17c61d1e (ITL-1432)
eywalker Nov 24, 2026
ade2a31
test(provenance): do not assert async batch grouping of repeated inpu…
eywalker Nov 24, 2026
128b88b
fix(provenance): CodeRabbit review of acca12c9 (ITL-1432)
eywalker Nov 24, 2026
75a0730
fix(function_node): reads follow the order a run passed rows downstre…
eywalker Nov 24, 2026
74c30c6
fix(provenance): CodeRabbit review of 75a0730d (ITL-1432, ITL-1441)
eywalker Nov 24, 2026
792856f
test(provenance): async held order compared as a set; token column bi…
eywalker Nov 24, 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
78 changes: 78 additions & 0 deletions changelog.d/ITL-1432.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
### Added

- Per-row provenance of a job (ITL-1432). `trace` and `why_missing` are provisional in
0.4.0: their answers may be refined; a case they cannot prove is reported unavailable or
refused (`ProvenanceInconsistencyError`), never guessed. `diagram(highlight=...)` is in
development.
- `node.trace(row, column)` on a job node traces cells back to the source cells they
were made from: every held row whose columns equal `row`'s values (any number; `{}`
traces every row; none matching gives status `no_match`). It returns a `Trace`
whose text starts with the question written out (`trace of rate_hz at node rates,
for ...: 2 rows match`), with one tree of `TraceStep`s per row (`roots`) and
`SourceCell` leaves.
- Each function step has a `FunctionRun`: the function's name, version and body
hash, the executor and the time it computed, and whether this row's entry computed
the result or reused one stored for equal inputs.
- A `GroupBy` or `Batch` step lists its members, found by the operator's own rule and
checked by folding their system tags (`ProvenanceInconsistencyError` if they
disagree).
- The trace is exact on a result shared by two input rows, and works the same on a
loaded job after `run(load_only=True)`.
- Where a node holds no run, the trace says `not_computed`.
- A source is never read. A cached, polling, derived or user-defined source is
`unavailable` only for a step that needs the source's own rows (such as a
`GroupBy` straight over it); a step after it is traced from the tokens its rows
carry.
- Every value is checked against the row it came from, and an ambiguous link is
refused.
- `node.why_missing(source, record_id)` returns an `Absence`. `source` is a source
id (as in source-info tokens) or a source node's label. It reads the held run
(`not_computed` without one). Its text starts with the question (`why record row_4
of units is missing at node imec0_rates`). It gives:
- whether a stored entry of the first function node proves the record reached it
(`reached_function`; never "did not reach": a function that raised stores no
entry), and what the store records (`entry_recorded`);
- the nodes holding a row from it;
- the step that removed it, as a `Step` in `explain()`'s words;
- for a join, the key missing from the other input.
- `job.diagram(highlight=...)` outlines a `Highlight`'s nodes and edges in the text
colour (no node status uses it), dims the rest, shows its note (the question
written out) as a caption, leaves out the nodes' run status, and marks the node the
question was asked at ("traced from here", "asked here"; `>` in the listing).
`Trace.highlight()` and `Absence.highlight()` give the trace's or the missing row's
path; a trace's highlight also marks each function node on it `computed`, `reused`
or `computed + reused` (`Highlight.marks`), on the node and in the text listing.
- The new types are in `orcapod.types`. None of these reads computes, calls user code,
polls or writes, and no hash, stored path or stored column changes.

### Fixed

- A function job node's rows are read in the order its run passed them downstream
(ITL-1441). After a synchronous run over a partly stored history, the node used to
hold the stored results first, so a read of it (`iter_data`, `as_table`, `head`, the
data frames) and a downstream node run on its own (`node.run()`: a `Batch`, its sums
and folded record ids, a load-only aggregate, `GroupBy` members that tie) differed
from what the whole job computed. Now every read gives the input order a synchronous
run passed on, fresh, partly stored, load-only and after `clear_cache()`. An
asynchronous run promises no order (ITL-1437): its rows are read in the order that
run emitted them.

### Known limitations

- Provenance (`trace`, `why_missing`) is provisional in 0.4.0 (ITL-1432). Known limits:
- A source is never read. A cached, polling, derived or user-defined source gives
no values for a step that needs its rows: such a step is `unavailable`. Also, the
first step after such a source is never blamed for a missing record.
- Only Orcapod's own operators are followed. A subclass of one, or an operator of
your own, is `unavailable`, for `trace` and for `why_missing` past it.
- Inputs of a commutative `Join` with one pipeline hash (two sources of one schema,
or two upstream joins whose outputs share a pipeline hash) are told apart by their
values. Two such upstream joins holding their sources in opposite orders are
refused rather than guessed. The stored answer (`reached_function`) through tied
inputs is unknown, even when their source ids differ.
- `why_missing` reads the held run: with only stored entries (before a run, or on a
loaded job not yet run) it answers `not_computed`.
- After a fold, the stored answer is known only for the groups the run holds.
- Entries of a recomputed result are told apart only once pipeline entries record
their run id (ITL-1433).
- Job nodes only.
2 changes: 1 addition & 1 deletion docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Everything else lives in subpackages:
| [`orcapod.databases`](databases.md) | Persistent storage backends for computation results |
| [`orcapod.nodes`](nodes.md) | Pipeline graph elements, including the DB-backed job nodes |
| [`orcapod.streams`](streams.md) | Immutable (Tag, Data) sequences backed by PyArrow tables |
| [`orcapod.types`](types.md) | Core type definitions: `Schema`, `ColumnConfig`, `ContentHash`, `Condition`, `col`, `Explanation` |
| [`orcapod.types`](types.md) | Core type definitions: `Schema`, `ColumnConfig`, `ContentHash`, `Condition`, `col`, `Explanation`, `Trace`, `Absence`, `Highlight` |
10 changes: 10 additions & 0 deletions docs/api/nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ The database-backed nodes a `PipelineJob` builds; these are what `job.nodes[labe
::: orcapod.core.nodes.OperatorJobNode

::: orcapod.core.nodes.SourceJobNode

## Provenance of a job's rows

Every job node above (function, operator and source) has these two methods: they trace a
cell to its source cells, and say why a source record does not reach a node. Both are
provisional in 0.4.0: their answers may be refined in a later release; a case they cannot
prove is reported unavailable or refused, never guessed. The known limits are listed on
the [provenance concept page](../concepts/provenance.md#known-limits).

::: orcapod.core.nodes.provenance_methods.ProvenanceMethods
12 changes: 12 additions & 0 deletions docs/api/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@ Core type definitions used throughout Orcapod.
::: orcapod.types.SourceReading

::: orcapod.types.Step

::: orcapod.types.Trace

::: orcapod.types.TraceStep

::: orcapod.types.FunctionRun

::: orcapod.types.SourceCell

::: orcapod.types.Absence

::: orcapod.types.Highlight
Loading
Loading