Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bbbef8c
feat(data_function): declare the data function type; python.function.…
Nov 18, 2026
50fae35
refactor(contexts): remove the detection of stores written before 0.4…
Nov 18, 2026
c81f7b6
feat(data_function): the record of python.function.v1 rev1: function_…
Nov 18, 2026
6ea7037
fix(data_function): review round on the type declaration (ITL-1259)
Nov 18, 2026
1c4b149
Merge branch 'eywalker/itl-1259-formalize-the-data-function-type' int…
Nov 18, 2026
ecb532e
fix(release): the release gate refuses an open or missing type snapsh…
Nov 18, 2026
e3c30fa
Merge branch 'eywalker/itl-1259-formalize-the-data-function-type' int…
Nov 18, 2026
549ce73
Merge remote-tracking branch 'origin/main' into eywalker/itl-1259-for…
Nov 18, 2026
cac56d6
Merge remote-tracking branch 'origin/main' into eywalker/itl-1259-for…
Nov 18, 2026
dbf0030
feat(data_function): the rev1 run rules name the refusals main now en…
Nov 18, 2026
5551ead
Merge branch 'eywalker/itl-1259-formalize-the-data-function-type' int…
Nov 18, 2026
add6b2e
test(golden): regenerate the 22 approved entries for python.function.…
Nov 18, 2026
f01a84d
Merge branch 'eywalker/itl-1259-formalize-the-data-function-type' int…
Nov 18, 2026
7cc7a01
test(golden): regenerate the 2 approved stored-signature entries; add…
Nov 18, 2026
75c0a9b
fix(release): harden the snapshot release gate and make the release s…
Nov 18, 2026
8214496
Merge branch 'eywalker/itl-1259-formalize-the-data-function-type' int…
Nov 18, 2026
44661c9
Merge origin/main (PR 434, PR 443) into eywalker/itl-1259-formalize-t…
Nov 19, 2026
efe71c7
Merge #448 (main with PR 434, PR 443) into eywalker/itl-1256-function…
Nov 19, 2026
7defb1a
Merge origin/main (PR 441) into eywalker/itl-1259-formalize-the-data-…
Nov 19, 2026
f45749d
Merge #448 (main with PR 441) into eywalker/itl-1256-function-pods-th…
Nov 19, 2026
94ec183
Merge origin/main (PR 448 squashed as a026d31f, PR 444) into ITL-1256
Nov 19, 2026
28663df
fix(data_function): find the def line by tokenizing; never hash a dec…
Nov 19, 2026
06c585e
docs(data_function): a lambda's content hash is present; only a non-l…
Nov 19, 2026
6b42962
Merge origin/main (PR 450 squashed as 84cc52cd) into ITL-1256
Nov 19, 2026
8c19886
fix(hashing): every refusal of a default names the parameter and the …
Nov 19, 2026
98e6470
Merge origin/main (PR 457 squashed as 1015c268) into ITL-1256
Nov 19, 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
3 changes: 2 additions & 1 deletion .zed/rules
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@ algorithm produced it.**
- A label names the algorithm that produced a digest (the whole procedure: canonical form,
preparation, encoding, digest function) and nothing else. Format `<algorithm>_v<N>`,
integer `N`: `semantic_v1`, `arrow_v1`, `arrow_ordered_v1`, `directory_v1`, `ndarray_v1`,
`polars_expr_v1`, `batch_v1`, `group_v1`. The file content hash keeps `sha256`, the only
`polars_expr_v1`, `batch_v1`, `group_v1`, `function_signature_v1`, `function_content_v1`.
The file content hash keeps `sha256`, the only
exception. A logical type's implementer picks its label.
- Change a label only when its algorithm would give an existing input a different digest.
- Define each label in exactly one place, as a constant beside its algorithm. Never write a
Expand Down
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ algorithm produced it.**
- A label names the algorithm that produced a digest (the whole procedure: canonical form,
preparation, encoding, digest function) and nothing else. Format `<algorithm>_v<N>`,
integer `N`: `semantic_v1`, `arrow_v1`, `arrow_ordered_v1`, `directory_v1`, `ndarray_v1`,
`polars_expr_v1`, `batch_v1`, `group_v1`. The file content hash keeps `sha256`, the only
`polars_expr_v1`, `batch_v1`, `group_v1`, `function_signature_v1`, `function_content_v1`.
The file content hash keeps `sha256`, the only
exception. A logical type's implementer picks its label.
- Change a label only when its algorithm would give an existing input a different digest.
- Define each label in exactly one place, as a constant beside its algorithm. Never write a
Expand Down
13 changes: 13 additions & 0 deletions changelog.d/ITL-1256.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Changed

- The record a function result row keeps about its function (`python.function.v1`,
`rev1`; ITL-1256): a new column `function_module` (the function's `__module__`);
`function_signature_hash` is now the hash of the declared interface (each input with its
effective type and default, by name; the outputs with their types in declared order;
label `function_signature_v1`), so two pods whose output keys differ only in order record
different values; `function_content_hash` is the hash of the source text from the `def`
line on, decorator lines excluded (label `function_content_v1`), and is null when the
source cannot be read (a function typed into a plain REPL or made with `exec`) or, for
a function other than a lambda, does not start at a `def` statement (the module file
changed after the import); a lambda's hash covers its enclosing lines. See
`docs/reference/data-function-types.md`.
11 changes: 6 additions & 5 deletions docs/reference/data-function-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ Each result row holds these columns about the function (`__pf_var_` prefix):
|---|---|---|---|---|
| `function_name` | `str` | `large_string` | yes | the function's name, as in the uri |
| `function_version` | `str` | `large_string` | yes | the full version string the function was declared with (`v3.7`) |
| `function_signature_hash` | `bytes` | `large_binary` | yes | the hash of the function used as a value |
| `function_content_hash` | `bytes` | `large_binary` | yes | the hash of the function's code |
| `function_module` | `str \| None` | `large_string` | yes | the function's module (`__module__`) |
| `function_signature_hash` | `bytes` | `large_binary` | yes | the hash of the function's declared interface |
| `function_content_hash` | `bytes \| None` | `large_binary` | yes | the hash of the function as written (a lambda: its enclosing lines); absent when its source cannot be read (a plain REPL, `python -c`, `exec`) or, for a function other than a lambda, does not start at a `def` statement |
| `git_hash` | `str` | `large_string` | yes | the git commit of the function's file or working directory, with `-dirty`, `-untracked` and `-<source>` suffixes; `unknown` outside git |

and these about how it was computed (`__pf_exec_` prefix):
Expand All @@ -116,8 +117,8 @@ The two hashes, each stored as `<label>:` followed by its digest:

| Column | Label | What it covers |
|---|---|---|
| `function_signature_hash` | `semantic_v1` | the function's module and name, each parameter's name, kind, annotation and default (the default's own hash), and the return annotation ([Hashing](hashing.md#1d-function-values-and-parameter-defaults)) |
| `function_content_hash` | `semantic_v1` | the function's name and module, its source text as written (decorator lines, docstring, comments and whitespace included), its annotations sorted by name, and its code properties (argument counts, number of locals, argument names) |
| `function_signature_hash` | `function_signature_v1` | `{"inputs": {<name>: {"type": <type hash>, "default": <value hash>}}, "outputs": [{"key": <output key>, "type": <type hash>}]}`: the effective types (`input_schema=` / `output_schema=`, else the annotations); inputs keyed by name in no order, a `default` only for a parameter that has one; outputs in declared order (one key is a one-element list, none an empty one). Not in it: the function's name and module (their own columns), the parameters' kind and order, the version, the body |
| `function_content_hash` | `function_content_v1` | `{"source": <text>}`: the source text from the `def` line on, as written (docstring, comments and whitespace included; decorator lines excluded); for a lambda, the enclosing lines `inspect` gives, always present when they can be read. The `def` line is found by tokenizing the text as written, so nothing in the body moves the cut. Absent (null) when the source cannot be read, or when the source of a function other than a lambda does not start at a `def` statement: never a text with a decorator line |

Results are reused by the function's identity (its uri) and the input data hash alone;
these columns record what produced each row and are not compared on a cache hit.
Expand All @@ -141,7 +142,7 @@ stored = types_store.get_all_records(next(p for p in types_store.list_sources()
print([name for name in stored.column_names if not name.startswith("__pf_")])
# ['__input_data_hash', 'total', 'label', '_source_total', '_source_label', '__pod_ts', '__data_context']
print([name for name in stored.column_names if name.startswith("__pf_var_")])
# ['__pf_var_function_name', '__pf_var_function_version', '__pf_var_function_signature_hash', '__pf_var_function_content_hash', '__pf_var_git_hash']
# ['__pf_var_function_name', '__pf_var_function_version', '__pf_var_function_module', '__pf_var_function_signature_hash', '__pf_var_function_content_hash', '__pf_var_git_hash']
```

## Where it is declared, and how a released declaration is kept
Expand Down
15 changes: 10 additions & 5 deletions docs/reference/hashing.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ The labels of v0.3:
| `polars_expr_v1` | the Polars expression hash (§1c) | `POLARS_EXPR_HASH_LABEL`, `hashing/semantic_hashing/polars_expr.py` |
| `polars_dataframe_v1` | the Polars DataFrame value hash (§1e) | `PolarsDataFrameHandler.HASH_LABEL`, `hashing/semantic_hashing/builtin_handlers.py` |
| `polars_series_v1` | the Polars Series value hash (§1e) | `PolarsSeriesHandler.HASH_LABEL`, `hashing/semantic_hashing/builtin_handlers.py` |
| `function_signature_v1` | the stored function signature hash: a function's declared interface ([Data function types](data-function-types.md)) | `FUNCTION_SIGNATURE_HASH_LABEL`, `core/data_function.py` |
| `function_content_v1` | the stored function content hash: its source text from the `def` line on ([Data function types](data-function-types.md)) | `FUNCTION_CONTENT_HASH_LABEL`, `core/data_function.py` |
| `batch_v1` | the folded source id and record id of `Batch` (site 6b) | `BATCH_FOLD_LABEL`, `core/operators/batch.py` |
| `group_v1` | the folded source id and record id of `GroupBy` (site 6b), and the merged source-info token of a data-tag group key | `GROUP_BY_FOLD_LABEL`, `core/operators/group_by.py` |
| `join_v1` | the merged source-info token of a key that is a data-tag on several inputs of a `Join` (site 6b) | `JOIN_FOLD_LABEL`, `core/operators/join.py` |
Expand Down Expand Up @@ -278,7 +280,7 @@ test session with `-p tests.test_hashing.hash_site_trace`.
| `_record_hash` of operator-cache and cached-source tables | `core/nodes/operator_node.py:OperatorJobNode._store_output_stream`, `core/sources/cached_source.py:CachedSource._live_records` |
| side-effect log `record_id`, `record_id_hash` | `side_effects.py:_execute_side_effect_row` |
| the `_content_hash` column | `core/streams/arrow_table_stream.py:ArrowTableStream._assemble_table.<locals>.hashes`, `core/function_pod.py:FunctionPodStream.as_table.<locals>.all_content_hashes`, `core/function_pod.py:FunctionPodStream.head.<locals>.shown_content_hashes`, `core/function_pod.py:FunctionPodStream.head.<locals>.<lambda>`, `core/nodes/function_node.py:FunctionNodeBase.as_table.<locals>.all_content_hashes`, `core/nodes/function_node.py:FunctionNodeBase._head_of_pairs.<locals>.<lambda>`, `side_effects.py:_table_of_rows` |
| `__pf_var_function_signature_hash`, `__pf_var_function_content_hash` | `core/data_function.py:PythonDataFunction.__init__` |
| `__pf_var_function_signature_hash`, `__pf_var_function_content_hash` | `core/data_function.py:function_signature_hash`, `core/data_function.py:function_content_hash`, `core/data_function.py:PythonDataFunction.__init__` |
| saved pipeline and job files | `pipeline/graph.py:Pipeline.save`, `pipeline/job.py:PipelineJob.save`, `pipeline/job.py:PipelineJob.as_pipeline`, `core/sources/base.py:RootSource._identity_config` |
| cached file hashes | `hashing/hash_cachers.py:SqliteHashCacher.put` |
| `InvocationContext.invocation_hash` (`<label>:<hex>::<label>:<hex>`; its redesign is a side-effect follow-up) | `invocation.py:_serialize_component` |
Expand Down Expand Up @@ -690,10 +692,13 @@ registry. Raising is the v0.3 behaviour (developer decision, November 11, 2026);
pod parameter's default as the column value it would be, which would cover `Path`,
`datetime`, `date` and numpy scalars, is the follow-up ITL-971.

**Where the hash is used.** As the hash of a function that appears as a value, and as the
`function_signature_hash` stored with every result row (the
`__pf_var_function_signature_hash` column), which is this same hash of the pod's function. A
function pod's identity does **not** use it: the pod's `uri`, its `pipeline_hash()`, its
**Where the hash is used.** As the hash of a function that appears as a value. The
`function_signature_hash` stored with every result row is another hash
(`function_signature_v1`, ITL-1256): the function's declared interface, each input with its
effective type and default by name and the outputs in declared order, without the function's
name, module or parameter kinds (see [Data function types](data-function-types.md)). Its
defaults are hashed the same way, so a default the hasher cannot hash fails a pod at
construction. A function pod's identity uses neither: the pod's `uri`, its `pipeline_hash()`, its
`content_hash()` and its table paths depend on the function's name, version and output
schema (see [Data Function URI Hash](#5-data-function-uri-hash)), so changing a default
moves no path.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/08-inspecting-and-tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ call. `get_all_records` returns them; ask for the `meta` columns to see the deta
records = pl.from_arrow(job.nodes["rates"].get_all_records(columns={"meta": True}))
meta = [c for c in records.columns if c.startswith("__")]
print(meta)
# ['__data_id', '__input_data_hash', '__output_data_hash', '__data_context', '__computed', '__is_ephemeral', '__input_data_hash_right', '__pf_var_function_name', '__pf_var_function_version', '__pf_var_function_signature_hash', '__pf_var_function_content_hash', '__pf_var_git_hash', '__pf_exec_executor_type', '__pf_exec_executor_info', '__pf_exec_python_version', '__pf_exec_extra_info', '__pod_ts']
# ['__data_id', '__input_data_hash', '__output_data_hash', '__data_context', '__computed', '__is_ephemeral', '__input_data_hash_right', '__pf_var_function_name', '__pf_var_function_version', '__pf_var_function_module', '__pf_var_function_signature_hash', '__pf_var_function_content_hash', '__pf_var_git_hash', '__pf_exec_executor_type', '__pf_exec_executor_info', '__pf_exec_python_version', '__pf_exec_extra_info', '__pod_ts']
```

The ones you are most likely to want:
Expand Down
8 changes: 4 additions & 4 deletions src/orcapod/contexts/data/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,20 @@
"datagram-01.json": "598d4a2851819d76ba674e189222e61733ca1861ca82a59e990a8ee5e1b0a7b3",
"pipeline-01.json": "538958d92057f903d72d5c9e9b35fad23f40078638f4f2291865a536fb643035",
"schema-01.json": "79aa2a068e0724891cf43ee528ce8f569e65f08864faa5e34773bfc69ac9576e",
"semantic-01.json": "45840a7406d232a7686e55805aabe5953594409b447ed175fdff791c49a3f947",
"semantic-01.json": "973a97cd3d74f558910b5854dce773fe5aa38a4df96be88ef10e5e6504ffe73d",
"torch-01.json": "af2e8b68d66dffaa37e1d0ad75acd42f595d65b9fae00ddcde81bf9e13a265c8"
},
"previous": null,
"digest": "28731f440e29a6004d4cfc9318909a10013abcf9488975e15d4864e9544e73c9"
"digest": "9f6e545f710e6c8c36ff546477ddedd251871f1a154588e823145aafa6802442"
},
{
"date": "2026-11-18",
"release": null,
"added": {
"pipeline-02.json": "7584d28939fb31907e9b078f91e0d6605222c31b170eb70bd6e4e4254342358f"
},
"previous": "28731f440e29a6004d4cfc9318909a10013abcf9488975e15d4864e9544e73c9",
"digest": "6096da93e09dbe7276d5f171f43f893297d0afc840f8dcd244729d9505c8d122"
"previous": "9f6e545f710e6c8c36ff546477ddedd251871f1a154588e823145aafa6802442",
"digest": "7be3c4e8659a3bca78bd54a04a444323db181a9ca2a3285cd7ba5ad4a76a305c"
}
],
"provisional": {
Expand Down
Loading
Loading