diff --git a/.zed/rules b/.zed/rules index b846869d2..c82fe0461 100644 --- a/.zed/rules +++ b/.zed/rules @@ -510,6 +510,17 @@ Orcapod stores or embeds in a name is pinned in the golden folder of the current frozen and provisional files; an operator leaving the group has its entries relocated into a frozen file before the release step. Never put a value that depends on a provisional operator in a frozen file. +- Provisional sources are outside the freeze too (developer, November 21, 2026, ITL-1314: + "make polling source provisional"): orcapod.sources.PROVISIONAL_SOURCES + (core/sources/provisional.py) is the one list (today PollingSource, its identity + decided by ITL-1316), each listed class sets PROVISIONAL = True (declared on + RootSource, which warns when one is constructed, also through from_config), and building + one issues ProvisionalHashWarning once per source kind per process. The warning and the + use record are one helper, utils/provisional.warn_provisional_use (operators use it + too). Unlike a provisional operator, a provisional source is never pinned, in no golden + file: only operators can be declared by a golden case, so compute_group_kinds refuses a + case that builds one. The mark never enters a hash, an identifier, a config or a stored + path. - The unit of immutability is the golden file. The manifest's `golden.history` (`src/orcapod/contexts/data/.json`) lists every file with the sha256 of its bytes; a release appends a revision with `added: {}`, pinned in @@ -830,11 +841,13 @@ element come from a tag value, or from anywhere other than the input's data elem the step is not an operator: it is a derived source. So a tag's value is offered as data only by a source, DerivedSource(origin, tags_as_data={tag: data_name}) (ITL-939), never by an operator. That form is a new root: fresh provenance through SourceStreamBuilder, schema-only -pipeline_hash, and a default source_id of the form -tags_as_data:: (the kind names the operation; the config type key stays -derived), the labelled content hash an operator node doing the -derivation would have (DerivedSource._default_source_id, the one place that defines it; -the string is used as-is in system-tag values and source-info tokens). DerivedSource without tags_as_data (a job node's stored records) +pipeline_hash, and a source_id the user must give (developer, November 21, 2026, ITL-1313: +"simply make them throw an error if source id is not provided"): it has no default, and +DerivedSource(..., tags_as_data=...) and node.as_source(tags_as_data=...) raise +ValueError without one, before the origin is read; a saved config without one is refused +too. The given string is used as-is in system-tag values and source-info tokens, and with the +sorted mapping it is the source's identity (the origin enters only through the schema). The +config type key stays derived. DerivedSource without tags_as_data (a job node's stored records) keeps its old identity; do not change it (ITL-956). ### Two identity chains @@ -1189,8 +1202,8 @@ data. The rules: every source. Every default names its kind first: the class's SOURCE_KIND, which is also its config type key (arrow_table, dict, list, data_frame, derived, csv, delta_table, sqlite_table, postgresql_table, db_table, spiraldb_table, - polling_source, cached), or names the operation that derives the source - (tags_as_data). A default built from a hash is ::, built + polling_source, cached). A DerivedSource with tags_as_data has no default: it + requires a source_id (ITL-1313). A default built from a hash is ::, built only by core/sources/source_ids.hash_source_id (an in-memory source hashes its table as given; hash_in_key_order=True, refused without key columns or with a source_id, hashes it sorted by the key columns in key order, arrow_utils.key_row_order, an Arrow sort after diff --git a/CLAUDE.md b/CLAUDE.md index 3604b9eed..5c979b351 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -521,6 +521,17 @@ Orcapod stores or embeds in a name is pinned in the golden folder of the current frozen and provisional files; an operator leaving the group has its entries relocated into a frozen file before the release step. Never put a value that depends on a provisional operator in a frozen file. +- Provisional sources are outside the freeze too (developer, November 21, 2026, ITL-1314: + "make polling source provisional"): `orcapod.sources.PROVISIONAL_SOURCES` + (`core/sources/provisional.py`) is the one list (today `PollingSource`, its identity + decided by ITL-1316), each listed class sets `PROVISIONAL = True` (declared on + `RootSource`, which warns when one is constructed, also through `from_config`), and building + one issues `ProvisionalHashWarning` once per source kind per process. The warning and the + use record are one helper, `utils/provisional.warn_provisional_use` (operators use it + too). Unlike a provisional operator, a provisional source is never pinned, in no golden + file: only operators can be declared by a golden case, so `compute_group_kinds` refuses a + case that builds one. The mark never enters a hash, an identifier, a config or a stored + path. - The unit of immutability is the golden file. The manifest's `golden.history` (`src/orcapod/contexts/data/.json`) lists every file with the sha256 of its bytes; a release appends a revision with `added: {}`, pinned in @@ -850,11 +861,13 @@ element come from a tag value, or from anywhere other than the input's data elem the step is not an operator: it is a derived source. So a tag's value is offered as data only by a source, `DerivedSource(origin, tags_as_data={tag: data_name})` (ITL-939), never by an operator. That form is a new root: fresh provenance through `SourceStreamBuilder`, schema-only -`pipeline_hash`, and a default `source_id` of the form -`tags_as_data::` (the kind names the operation; the config type key stays -`derived`), the labelled content hash an operator node doing the -derivation would have (`DerivedSource._default_source_id`, the one place that defines it; -the string is used as-is in system-tag values and source-info tokens). `DerivedSource` without `tags_as_data` (a job node's stored records) +`pipeline_hash`, and a `source_id` the user must give (developer, November 21, 2026, ITL-1313: +"simply make them throw an error if source id is not provided"): it has no default, and +`DerivedSource(..., tags_as_data=...)` and `node.as_source(tags_as_data=...)` raise +`ValueError` without one, before the origin is read; a saved config without one is refused +too. The given string is used as-is in system-tag values and source-info tokens, and with the +sorted mapping it is the source's identity (the origin enters only through the schema). The +config type key stays `derived`. `DerivedSource` without `tags_as_data` (a job node's stored records) keeps its old identity; do not change it (ITL-956). ### Two identity chains @@ -1233,8 +1246,8 @@ data. The rules: every source. Every default names its kind first: the class's `SOURCE_KIND`, which is also its config type key (`arrow_table`, `dict`, `list`, `data_frame`, `derived`, `csv`, `delta_table`, `sqlite_table`, `postgresql_table`, `db_table`, `spiraldb_table`, - `polling_source`, `cached`), or names the operation that derives the source - (`tags_as_data`). A default built from a hash is `::`, built + `polling_source`, `cached`). A `DerivedSource` with `tags_as_data` has no default: it + requires a `source_id` (ITL-1313). A default built from a hash is `::`, built only by `core/sources/source_ids.hash_source_id` (an in-memory source hashes its table as given; `hash_in_key_order=True`, refused without key columns or with a `source_id`, hashes it sorted by the key columns in key order, `arrow_utils.key_row_order`, an Arrow sort after diff --git a/changelog.d/ITL-1313.md b/changelog.d/ITL-1313.md new file mode 100644 index 000000000..d9dc253a1 --- /dev/null +++ b/changelog.d/ITL-1313.md @@ -0,0 +1,20 @@ +### Breaking changes and migration + +- `DerivedSource(origin, tags_as_data=...)` and `node.as_source(tags_as_data=...)` need a + `source_id` (ITL-1313): there is no default any more, and building one without it raises + `ValueError` before the origin is read. The default it had, `tags_as_data: