Skip to content

feat(sources): mark tags_as_data as provisional - #657

Merged
eywalker merged 4 commits into
mainfrom
eywalker/itl-1020-tags-as-data-provisional
Nov 29, 2026
Merged

eywalker merged 4 commits into
mainfrom
eywalker/itl-1020-tags-as-data-provisional

Conversation

@eywalker

@eywalker eywalker commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes ITL-1020

Summary

This PR carries out the developer's decision on ITL-1020 (BL27): tags_as_data is kept, and it is provisional in 0.4.0: its behaviour and identity may change, or it may be removed, in a later version. Using it warns once per process on each route that takes it (DerivedSource, node.as_source(), SpiralDBTableSource); a saved job that uses it warns when it is loaded; and no frozen golden value depends on it (its golden entries are already in the provisional files, ITL-1331). The docs state the preferred route: when in doubt, start with the column as a data-tag (or at least as data) at the source, and promote it later if needed. How to promote a plain tag properly is a separate design issue, ITL-1694.

What changes for a user

  • The first use of a non-empty tags_as_data mapping in a process issues ProvisionalHashWarning, once for each route: DerivedSource(..., tags_as_data=...), node.as_source(tags_as_data=...) (one warning shared by function and operator nodes) and SpiralDBTableSource(..., tags_as_data=...). An empty mapping does not warn. This warning is separate from the existing DerivedSource identity warning.
  • Loading a saved job whose source config holds a non-empty tags_as_data mapping warns for that route, also when the slot stays unbound. The warning honours a filter that turns it into an error.
  • Docs: a "Provisional" admonition beside every description of tags_as_data (docs/concepts/sources.md, data-tags.md, operators.md, identity.md, docs/reference/hashing.md, golden-hashes.md) and in the docstrings, so the generated API reference (Sources, Nodes, Operators, Errors) shows it. Each says the argument may change or be removed and gives the preferred route: start with a data-tag at the source, or start with data and promote it to a data-tag if needed.
  • CLAUDE.md / .zed/rules, the changelog fragment changelog.d/ITL-1020.md and design issue ITL-1020-TAD1 (resolved) record the decision.

Found by review, fixed here

Finding Fix Test
Loading a saved job with a tags_as_data source whose slot stays unbound gave no tags_as_data warning (only the DerivedSource identity warning). pipeline/serialization.py warns for a non-empty mapping in the saved source config, whether or not the slot is rebound. test_provisional_sources.py::test_a_loaded_job_over_an_unbound_derived_source_warns, ::test_loading_an_unbound_job_honors_the_tags_as_data_error_filter
The generated API reference had no provisional notice for the argument. The docstrings carry the notice and the preferred data-tag route; it renders in the Sources, Nodes, Operators and Errors references. tests/test_docs/test_site_content.py::test_the_documentation_builds (counts the notices per page)
The first version warned once across all routes, so a second route in the same process was silent. One warning per route, keyed by route name; function and operator nodes share the node.as_source() key, and a loaded node-backed config uses it too. test_spiraldb_table_source_tags_as_data.py::test_only_nonempty_mappings_warn_once_per_route, test_provisional_sources.py::test_an_empty_mapping_does_not_warn_about_tags_as_data

Found in review, present on main, not addressed here

  • ITL-1695: a saved job whose slot is bound to node.as_source(tags_as_data=..., source_id=...), or to a tag-copy DerivedSource over an in-memory Arrow table, loads with that slot unbound. This PR only makes that load warn; rebinding is ITL-1695 (the plain node.as_source() form is ITL-956).

Follow-up

  • ITL-1694: design for promoting a tag to a data-tag or data column properly, and whether tags_as_data then stays, changes or goes.

Verification

  • CI on head 162d38a is green: Tests (3.13), Specification tests (3.13), PostgreSQL tests (3.13), Ruff and basedpyright, Build the site, Dependency review, license check.
  • Independent review: READY. CodeRabbit: no open items.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change marks tags_as_data as provisional, adds a once-per-process warning for non-empty mappings, and updates code and project documentation with the warning behavior and usage guidance.

Changes: Provisional tags_as_data status

Layer / File(s) Summary
Warning helper and identity recording
src/orcapod/utils/provisional.py, src/orcapod/core/sources/provisional.py, src/orcapod/errors.py
The warning utility can skip recording a provisional identity. A helper uses this option to warn about tags_as_data.
Source warnings and validation
src/orcapod/core/sources/derived_source.py, src/orcapod/core/sources/spiraldb_table_source.py, tests/test_core/sources/*
Both source constructors warn when tags_as_data is non-empty. Tests check warning behavior, including empty mappings and identity recording.
Provisional status and usage guidance
.zed/rules, CLAUDE.md, changelog.d/*, docs/concepts/*, docs/dev/design_issues/*, docs/reference/*, src/orcapod/core/nodes/*
The documentation and docstrings describe tags_as_data as provisional, note it may change or be removed, and provide usage guidance.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature · Severity of issue fixed: Medium

Possibly related PRs

Merge Risk: Minimal · up to f22e1

This change marks tags_as_data as provisional and adds a once-per-process warning when it is used with a non-empty mapping. Behavior is otherwise unchanged and empty mappings stay silent. No merge-blocking risk was identified.

Security architecture risk: Minimal · up to f22e1

Non-empty tag-copy mappings still work, but they now trigger a provisional-feature warning. Applications that treat this warning as an error can reject affected source construction or job loading. The reviewed change does not expand data access or require a migration.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The added warning path is reachable through existing constructors with a non-empty mapping. Its direct effect is process-local: the helper receives neither mapping contents nor project, table, or credential information, and it grants no new data access.

Resilience and Maintainability Implications

  • inferred — The existing lock and recheck serialize concurrent first use. If warning emission raises or is interrupted before the name is recorded, the next use can warn again. A reentrant warning hook can also enter before that record is written. This state controls warning delivery, not identity or access.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(sources): mark tags_as_data as provisional" states the main change. The changeset marks the tags_as_data argument as provisional across DerivedSource, SpiralDBTableSource, and related …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "feat(sources): mark tags_as_data as provisional" states the main change. The changeset marks the tags_as_data argument as provisional across DerivedSource, SpiralDBTableSource, and related docs. It also adds a once-per-process warning for non-empty mappings and changes warn_provisional_use. The title does not mention the new warning, but it covers the primary intent. The title is concise and specific.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@eywalker

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Posted by a Codex agent on behalf of @eywalker.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant