Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 16 additions & 3 deletions .zed/rules
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@ as a bare `pa.Table` (which the semantic hasher hashes as a value).

## Golden hash values

Hash values must stay identical across releases (developer, November 10, 2026). Not covered:
a provisional operator's identity and every hash downstream of it (ITL-1266, below). Every hash
Orcapod stores or embeds in a name is pinned in the golden folder of the current data context,
Frozen hash values must stay identical across releases (developer, November 10, 2026).
Provisional features and their downstream hashes are outside the freeze as described below.
Orcapod pins the hashes it stores or embeds in names in the golden folder of the current data context,
`tests/test_hashing/golden/data/<folder>/<group>-NN.json`, and checked by
`tests/test_hashing/golden/test_golden_hashes.py`. The mechanism is
`docs/reference/golden-hashes.md` (developer, November 15, 2026, ITL-946).
Expand Down Expand Up @@ -550,6 +550,15 @@ Orcapod stores or embeds in a name is pinned in the golden folder of the current
The refusal sees a direct use only: a user class with a field of such a type embeds its
identifier in an identity built once and cached, so golden items are split by
`cases.provisional_types_of` (checked against every fixture class's identity record).
- `SideEffectPod` and its decorators (`@side_effect_pod`, `@sink_pod`, `@tap_pod`) are
provisional as a whole in 0.4.0 (developer, November 28, 2026, ITL-555). The pod's
identity, firing rule, `tdb` log layout and all hashes downstream are outside the freeze.
`core/provisional_pods.py` lists provisional pod kinds by issue. Building the pod or restoring
its node from a saved job or blueprint uses the shared `warn_provisional_use` helper.
Golden cases that do either declare `provisional=("SideEffectPod",)`.
A function pod configured with a context argument is also provisional in 0.4.0 (ITL-947):
its identity, firing rule, stored tables, and downstream hashes are outside the freeze.
Golden cases declare provisional=("FunctionPod with a context argument",).
- Provisional sources are outside the freeze too (developer, November 21, 2026, ITL-1314:
"make polling source provisional"; ITL-1331: "Let's also make DerivedSource as
provisional?", both forms): `orcapod.sources.PROVISIONAL_SOURCES`
Expand Down Expand Up @@ -981,6 +990,10 @@ generation of hashing; rows of the current data context are the current entries.
Operator cache — odb_v3 (OPERATOR_DB_SCHEMA_VERSION)
Cached source — sdb_v2 (SOURCE_DB_SCHEMA_VERSION)

The tdb layout and the SideEffectPod identity are outside the 0.4.0 freeze while the
pod is provisional. The stored tables for a function pod that takes the invocation context
are also provisional and will be designed alongside the side-effect log (ITL-947).

- 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,
Expand Down
19 changes: 16 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,9 @@ as a bare `pa.Table` (which the semantic hasher hashes as a value).

## Golden hash values

Hash values must stay identical across releases (developer, November 10, 2026). Not covered:
a provisional operator's identity and every hash downstream of it (ITL-1266, below). Every hash
Orcapod stores or embeds in a name is pinned in the golden folder of the current data context,
Frozen hash values must stay identical across releases (developer, November 10, 2026).
Provisional features and their downstream hashes are outside the freeze as described below.
Orcapod pins the hashes it stores or embeds in names in the golden folder of the current data context,
`tests/test_hashing/golden/data/<folder>/<group>-NN.json`, and checked by
`tests/test_hashing/golden/test_golden_hashes.py`. The mechanism is
`docs/reference/golden-hashes.md` (developer, November 15, 2026, ITL-946).
Expand Down Expand Up @@ -561,6 +561,15 @@ Orcapod stores or embeds in a name is pinned in the golden folder of the current
The refusal sees a direct use only: a user class with a field of such a type embeds its
identifier in an identity built once and cached, so golden items are split by
`cases.provisional_types_of` (checked against every fixture class's identity record).
- `SideEffectPod` and its decorators (`@side_effect_pod`, `@sink_pod`, `@tap_pod`) are
provisional as a whole in 0.4.0 (developer, November 28, 2026, ITL-555). The pod's
identity, firing rule, `tdb` log layout and all hashes downstream are outside the freeze.
`core/provisional_pods.py` lists provisional pod kinds by issue. Building the pod or restoring
its node from a saved job or blueprint uses the shared `warn_provisional_use` helper.
Golden cases that do either declare `provisional=("SideEffectPod",)`.
A function pod configured with a context argument is also provisional in 0.4.0 (ITL-947):
its identity, firing rule, stored tables, and downstream hashes are outside the freeze.
Golden cases declare `provisional=("FunctionPod with a context argument",)`.
- Provisional sources are outside the freeze too (developer, November 21, 2026, ITL-1314:
"make polling source provisional"; ITL-1331: "Let's also make DerivedSource as
provisional?", both forms): `orcapod.sources.PROVISIONAL_SOURCES`
Expand Down Expand Up @@ -1010,6 +1019,10 @@ current data context are the current entries.
| Operator cache | `odb_v3` | `OPERATOR_DB_SCHEMA_VERSION` |
| Cached source | `sdb_v2` | `SOURCE_DB_SCHEMA_VERSION` |

The `tdb` layout and the `SideEffectPod` identity are outside the 0.4.0 freeze while the
pod is provisional. The stored tables for a function pod that takes the invocation context
are also provisional and will be designed alongside the side-effect log (ITL-947).

- 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,
Expand Down
11 changes: 11 additions & 0 deletions changelog.d/ITL-555.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Changed

- `SideEffectPod`, `@side_effect_pod`, `@sink_pod`, and `@tap_pod` are provisional in
0.4.0. Building a side-effect pod or loading its node from a saved job or pipeline
issues one shared `ProvisionalHashWarning` per process.

### Known limitations

- A side-effect pod's identity, delivery rules, delivery log layout, and downstream hashes
are outside the 0.4.0 freeze. Stored tables at and below the pod may move and a delivery
may be repeated once after an upgrade. The follow-up design is tracked in ITL-947.
12 changes: 12 additions & 0 deletions changelog.d/ITL-947.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Changed

- Function pods configured with `ctx_arg` are provisional in 0.4.0. They issue a
`ProvisionalHashWarning` once per process on construction or when loaded from a saved job
or blueprint. Their identity, firing rule, stored tables, and downstream hashes are
outside the 0.4.0 freeze.

### Known limitations

- Function pods that take the invocation context will get their own table arrangement,
designed alongside the side-effect pod's tables. Stored tables at the pod and downstream
may move, and a side effect may be repeated once after an upgrade.
12 changes: 12 additions & 0 deletions docs/api/function-pods.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ code. See site/README.md.

Function pods wrap Python functions to transform individual data in a stream.

!!! warning "Provisional"
In 0.4.0, `SideEffectPod` and its decorators are provisional: the pod's identity,
when it delivers, and the layout of its delivery log may change in a later version.
Stored tables at the pod and downstream may move, and a delivery may be repeated once
after an upgrade.

!!! warning "Provisional"
In 0.4.0, function pods that take the invocation context (`ctx_arg`) are provisional.
Their identity, when they are called, and where their results are stored may change
in a later version. Stored tables at the pod and downstream may move, and a side
effect may be repeated once after an upgrade.

::: orcapod.core.function_pod.FunctionPod

::: orcapod.core.function_pod.function_pod
Expand Down
6 changes: 6 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ directly:
| [`PipelineJob`](pipeline.md) | A pipeline bound to sources and a database; the object you run |
| [`side_effect_pod`, `sink_pod`, `tap_pod`](function-pods.md) | Decorators for functions run for their side effects |

!!! warning "Provisional"
In 0.4.0, `SideEffectPod` and its decorators are provisional: the pod's identity,
when it delivers, and the layout of its delivery log may change in a later version.
Stored tables at the pod and downstream may move, and a delivery may be repeated once
after an upgrade.

The table lists the public modules alongside the top-level `orcapod` namespace.
Other modules support Orcapod internally or are covered in the concept pages.

Expand Down
12 changes: 12 additions & 0 deletions docs/concepts/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ for tag, data in scale.pod(source):
The v0.2 tables and rows stay on disk unchanged, readable with v0.2. A migration is
planned after v0.3 (ITL-889).

!!! warning "Provisional"
In 0.4.0, `SideEffectPod` and its decorators are provisional: the pod's identity,
when it delivers, and the layout of its delivery log may change in a later version.
Stored tables at the pod and downstream may move, and a delivery may be repeated once
after an upgrade.

!!! warning "Provisional"
In 0.4.0, function pods that take the invocation context (`ctx_arg`) are provisional.
Their identity, when they are called, and where their results are stored may change
in a later version. Stored tables at the pod and downstream may move, and a side
effect may be repeated once after an upgrade.

## Provisional value hashes

The value hashes and stored identities of the library value types are provisional in v0.3:
Expand Down
34 changes: 33 additions & 1 deletion docs/concepts/function-pods.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Key points:
`OutputTypeError`): to keep the value, declare an output key with its type (a return
annotation or `output_schema`), or return nothing. Such a pod is
limited for now: in a job its rows fail, over data-tags and before an operator it
raises (ITL-1260); for a function run for its effect, use a `SideEffectPod`. An
raises (ITL-1260). For a function run for its effect, use a provisional `SideEffectPod`. An
output that may be
missing is not "no outputs": it is one output key typed `T | None`, and a returned
`None` is stored as a null.
Expand Down Expand Up @@ -1019,8 +1019,40 @@ re-run would fail at the same row. Both orchestrators handle these rows the same
This is the contract for now. An opt-in mode that tolerates database failures may be added
later.

### Functions that take the invocation context

!!! warning "Provisional"
In 0.4.0, function pods that take the invocation context (`ctx_arg`) are provisional.
Their identity, when they are called, and where their results are stored may change
in a later version. Stored tables at the pod and downstream may move, and a side
effect may be repeated once after an upgrade.

Set `ctx_arg` to the parameter that receives the invocation context. The parameter
is supplied by Orcapod and needs no input column.

```python
from orcapod import InvocationContext, function_pod

reports = []

@function_pod(output_keys="rounded_weight", ctx_arg="ctx")
def report_weight(weight: float, ctx: InvocationContext) -> int:
rounded = round(weight)
reports.append((ctx.invocation_hash, rounded)) # stands for sending a report
return rounded
```

See [Sharing function results between jobs](pipeline-job.md#sharing-function-results-between-jobs) for when a job
calls the function.

### Side effects in a job: delivered by a run, never by a read

!!! warning "Provisional"
In 0.4.0, `SideEffectPod` and its decorators are provisional: the pod's identity,
when it delivers, and the layout of its delivery log may change in a later version.
Stored tables at the pod and downstream may move, and a delivery may be repeated once
after an upgrade.

A `SideEffectPod` (or `side_effect_pod`, `sink_pod`, `tap_pod`) calls its function for every
row for what the call does outside Orcapod (send an email, write a file) and passes the row
on unchanged. In a job, side effects are delivered only by running: `job.run()`, or
Expand Down
6 changes: 6 additions & 0 deletions docs/concepts/notebooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ nodes (sources, operators, function pods, side-effect pods) and the streams betw
laid out left to right. Here is `job` as the last line of a cell, after its run, with the
`rates` node selected:

!!! warning "Provisional"
In 0.4.0, `SideEffectPod` and its decorators are provisional: the pod's identity,
when it delivers, and the layout of its delivery log may change in a later version.
Stored tables at the pod and downstream may move, and a delivery may be repeated once
after an upgrade.

![The diagram of the tutorial job in JupyterLab: the sources sessions and units on the left, through column selections and a join into the function pod rates, then GroupBy, a selection and the function pod session_means on the right; the sources are marked bound and every other node current, the vertical and collapse checkboxes next to the zoom buttons are unticked, and the details panel of the selected node rates lists its tag and data columns, the node it reads from and the row counts of the last run](notebooks-diagram-light.png#gh-light-mode-only)
![The diagram of the tutorial job in JupyterLab's dark theme: the sources sessions and units on the left, through column selections and a join into the function pod rates, then GroupBy, a selection and the function pod session_means on the right; the sources are marked bound and every other node current, the vertical and collapse checkboxes next to the zoom buttons are unticked, and the details panel of the selected node rates lists its tag and data columns, the node it reads from and the row counts of the last run](notebooks-diagram-dark.png#gh-dark-mode-only)

Expand Down
15 changes: 14 additions & 1 deletion docs/concepts/pipeline-job.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ A `CachedSource` is not a node of the job: its cache is kept in the cache databa
the path it was created with, whatever job reads it, so two jobs given one `CachedSource`
(or one cache database and path) share its cache.

!!! warning "Provisional"
In 0.4.0, `SideEffectPod` and its decorators are provisional: the pod's identity,
when it delivers, and the layout of its delivery log may change in a later version.
Stored tables at the pod and downstream may move, and a delivery may be repeated once
after an upgrade.

!!! warning "Provisional"
In 0.4.0, function pods that take the invocation context (`ctx_arg`) are provisional.
Their identity, when they are called, and where their results are stored may change
in a later version. Stored tables at the pod and downstream may move, and a side
effect may be repeated once after an upgrade.

Every run reads a function node's stored tables (its result table and its pipeline
records) as they are when the node starts: results that another job, or another handle on
the same database (a second `DeltaTableDatabase` over the same directory, another
Expand All @@ -224,7 +236,8 @@ had loaded the old table keeps reading it (ITL-1413). Open a new database object
replacing a table.

A function that takes the invocation context (`ctx_arg`) can perform an external action.
Rows with equal input data reuse a stored result even when their tags differ. In an async
A job calls the function once per distinct input, even when rows have different tags.
This rule is provisional. In an async
run, overlapping rows at one node give the first call time to store its result before
checking for it again. Jobs that share a result database share stored results. A row can
call the function again if the result was discarded or deleted. To perform an action for
Expand Down
6 changes: 6 additions & 0 deletions docs/concepts/sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,12 @@ IDs, and a `sink_pod` delivers it again. Because every key includes the hash of
data, no result is ever paired with the wrong row; a function's stored result for that data
is reused rather than recomputed.

!!! warning "Provisional"
In 0.4.0, `SideEffectPod` and its decorators are provisional: the pod's identity,
when it delivers, and the layout of its delivery log may change in a later version.
Stored tables at the pod and downstream may move, and a delivery may be repeated once
after an upgrade.

Every source accepts `record_id_columns`, one or several key columns whose values name the
row instead (`{"unit":"u1","time":1700000000}`), so the record ID follows the row. Both
system tags must be stable: when you omit `source_id` an in-memory source is named after a
Expand Down
6 changes: 6 additions & 0 deletions docs/concepts/streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ side-effect stream outside a job delivers its side effects again (its `head()` s
a polling source polls again and a `SpiralDBTableSource` reads its whole table again. A view never asks its stream for more columns, because for those
streams asking again is not a read.

!!! warning "Provisional"
In 0.4.0, `SideEffectPod` and its decorators are provisional: the pod's identity,
when it delivers, and the layout of its delivery log may change in a later version.
Stored tables at the pod and downstream may move, and a delivery may be repeated once
after an upgrade.

What `run()` does on each kind of object:

| Object | `run()` |
Expand Down
20 changes: 20 additions & 0 deletions docs/dev/design_issues/ITL-555-SE3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## `src/orcapod/side_effects.py`

### SE3 — Side-effect pods need a provisional contract in 0.4.0
**Status:** resolved
**Severity:** high
**Issue:** ITL-555

Freezing `SideEffectPod` in 0.4.0 would commit the release to its current identity,
delivery rules, and invocation log layout before the follow-up design is ready.

**Fix:** The November 28, 2026 decision (SE1) keeps the entire pod and its decorators
provisional in 0.4.0. This covers its identity, firing rule, `tdb` layout, and downstream
hashes. Constructing the pod or restoring its node from a saved job or blueprint warns
once per process, and golden cases that do either must declare the pod.
The follow-up decision also makes function pods that take the invocation context
provisional (see ITL-947, SL4).

ITL-947 tracks the design after 0.4.0: firing levels, one log row per arrival with its
delivery status, and coordination separate from the store that holds a lock from before
delivery until the outcome is recorded.
14 changes: 14 additions & 0 deletions docs/dev/design_issues/ITL-947-SL4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## `src/orcapod/core/function_pod.py` — function pod identity

### SL4 — Context-taking function pods need their own stored table arrangement
**Status:** open
**Severity:** high
**Issue:** ITL-947

Function pods configured with an invocation context can perform an external action.
Their current identity, firing rule, and result and pipeline storage should remain
provisional in 0.4.0, including every hash downstream.

The November 29, 2026 decision applies the shared provisional pod warning to construction
and saved graph loading. Golden cases that depend on these pods must declare them. The
table arrangement is still to be designed alongside the side-effect pod's tables.
6 changes: 6 additions & 0 deletions docs/reference/data-function-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ A function stores each result in its result table, at
For a job given a separate result database (`PipelineJob(..., result_database=...)`), the
path starts at `<function>`, in that database, with no `<job>/_result`.

!!! warning "Provisional"
In 0.4.0, function pods that take the invocation context (`ctx_arg`) are provisional.
Their identity, when they are called, and where their results are stored may change
in a later version. Stored tables at the pod and downstream may move, and a side
effect may be repeated once after an upgrade.

A job's default result path for a pod configured with `ctx_arg` is

```text
Expand Down
Loading
Loading