Skip to content

fix(config)!: remove the hash-length truncation settings (ITL-556) - #636

Merged
eywalker merged 5 commits into
mainfrom
eywalker/itl-556-drop-the-hash-length-truncation-settings
Nov 28, 2026
Merged

eywalker merged 5 commits into
mainfrom
eywalker/itl-556-drop-the-hash-length-truncation-settings

Conversation

@eywalker

@eywalker eywalker commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes ITL-556

Removes the three hash-length configuration fields. System-tag column names and logical table paths use full digests. Callers can still shorten a digest for display with ContentHash.to_hex(char_count=...).

Independent review follow-up

Finding Regression coverage
P2 · Typed configs could carry removed fields into a pipeline descriptor that its loader rejected. test_removed_hashing_subclass_field_is_refused covers all three removed keys, including zero and null. test_pipeline_save_omits_removed_hashing_settings checks the written descriptor and loads it again.
P2 · Removing char_count broke public display calls. test_content_hash_to_hex_display_length exercises the original keyword argument and slice behavior.
P3 · The existing SQL table-name digest length needed clarification. test_sql_store_name_v1_has_frozen_canonical_path_digest_and_boundary pins the ITL-1552 o1_ physical table-name format.
P3 · Programmatic mappings and TOML arrays of tables could bypass rejection of removed settings. test_removed_programmatic_hashing_mapping_field_is_refused checks all three keys through construction and with_updates, including zero and null. test_removed_hashing_toml_field_is_refused checks all three keys in both TOML forms.
P3 · OrcapodConfig.from_dict accepted null values for removed settings. test_removed_hashing_mapping_field_is_refused checks all three keys with null, zero and positive values. test_saved_pipeline_accepts_old_default_hashing_settings verifies that older descriptors with null defaults still load.
P3 · Descriptor tests needed multiple tag and data columns, two arrangements, and coverage of every removed key. test_saved_pipeline_accepts_old_default_hashing_settings, test_pipeline_save_omits_removed_hashing_settings, and test_saved_pipeline_refuses_removed_hashing_settings use three tag and three data columns per source in both arrangements. The refusal test checks every key on source and operator descriptors with both object and array inputs.

SQLite and PostgreSQL retain the fixed 32-hex-character digest suffix in their ITL-1552 o1_ physical table names.

Summary by CodeRabbit

  • Behavior Changes
    • System-tag column names and logical storage paths now use full hash digests. Display formatting can still show shortened hashes.
    • Hash-length settings for schema names, system tags, and paths are no longer supported. Configurations containing non-null values for these settings are rejected; legacy null values remain supported.
    • Rebuild stores created with shortened system-tag names before upgrading.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The PR removes three configurable hash-length settings, uses full hexadecimal digests for schema hashes and system-tag suffixes, and updates source-stream construction and pipeline descriptor handling. It adds validation for removed settings, preserves selected legacy descriptor cases, and updates tests and documentation.

Changes: Hash Length Configuration and Naming

Layer / File(s) Summary
Remove hash-length settings
src/orcapod/config.py, tests/test_orcapod_config.py, changelog.d/ITL-556.md, docs/dev/design_issues/ITL-556-HL1.md
Configuration rejects the removed hash-length fields. The changelog and issue document describe the removal and its handling.
Save and restore descriptor configuration
src/orcapod/pipeline/graph.py, src/orcapod/core/nodes/*, src/orcapod/pipeline/loaded_side_effects.py, tests/test_pipeline/test_serialization.py
Pipeline saving uses the configuration serializer, and node loading restores configuration from descriptors. Tests cover legacy defaults and rejection of removed settings.
Use full schema digests
src/orcapod/utils/schema_utils.py, src/orcapod/core/sources/*, src/orcapod/core/nodes/source_node.py, tests/test_core/sources/*, tests/test_hashing/golden/cases.py, tests/test_utils/test_schema_utils.py, docs/reference/hashing.md, scripts/hash_audit_example.py
Schema hashing returns full hexadecimal digests. Source stream builders no longer receive configuration for schema hashing. Related tests and references use the updated API.
Use full digests in system-tag names
src/orcapod/core/operators/*, tests/test_core/operators/*, docs/reference/hashing.md
Batch, grouping, join, and streaming operators use full pipeline-hash digests in system-tag suffixes. Tests now expect full digests.
Keep shortening in display code
src/orcapod/types/__init__.py, src/orcapod/hashing/semantic_hashing/content_identifiable_mixin.py, tests/test_hashing/test_semantic_hasher.py, test-specification/property/test_hash_properties.py, docs/dev/specs/itl-939-experiments/*
Hash display examples shorten the hexadecimal string after conversion or use a named length argument. ContentHash.to_hex documentation and tests cover display lengths.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to eb885

The change removes the hash-length settings and uses full digests in system-tag names and schema hashes. Removed settings are rejected, and legacy null values in saved descriptors still load. No merge-blocking issue was identified.

Security architecture risk: Moderate · up to eb885

Installations that used the default hash lengths already use full digests. Installations that shortened stored names need a coordinated rebuild: removing the old settings lets a pipeline use the new naming rules, but does not convert its existing data. The main risk is interrupted access to affected pipelines or stores during upgrade or rollback; no new unauthorized access path was established.

Retained concerns

  • Medium · reliability · inferred: For deployments that used shortened schema or system-tag identifiers, descriptor acceptance is not a store compatibility check. Removing the legacy values enables full-digest naming without converting the existing store. The rebuild instruction does not define how to prevent mixed-version writers, recover after an interrupted rebuild, or restore the old configuration and matching store together. This creates a bounded availability and rollback risk for affected pipelines; it does not establish data loss or cross-tenant exposure.
Security review details

Security Blast Radius

  • inferred — The evidenced compatibility exposure is to pipelines and their bound stores that previously relied on shortened schema hashes or system-tag names. The default full-digest naming behavior already existed at the merge base.

Trust Boundaries and Controls

  • observed — Parsed descriptor configuration is checked for removed non-null settings before node reconstruction. This check governs naming configuration; it does not validate whether an existing store uses the same column names.

Hardening Proposals

  • proposed — For shortened-name deployments, preflight target schemas against the actual backend, stop old writers, rebuild into a separate store, and validate reads before switching over. Keep the old descriptor, configuration, and store together as the rollback unit until validation is complete.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: removal of the hash-length truncation settings (system_tag_n_char, schema_n_char, path_n_char) from the config, tied to ITL-556. The changeset removes these fields fro…
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.
Full details: Title check

Explanation

The title names the main change: removal of the hash-length truncation settings (system_tag_n_char, schema_n_char, path_n_char) from the config, tied to ITL-556. The changeset removes these fields from HashingConfig, rejects them on load, switches system-tag suffixes and schema hashes to full digests, and updates tests and docs to match. The 'fix(config)!' prefix marks a breaking change, which matches the removal of config keys.

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

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 37f7843 and eb885d9.

Files selected for processing: 48

  • changelog.d/ITL-556.md
  • docs/dev/design_issues/ITL-556-HL1.md
  • docs/dev/specs/itl-939-experiments/exp02_workarounds_today.py
  • docs/dev/specs/itl-939-experiments/exp03_copy_tag_prototype.py
  • docs/dev/specs/itl-939-experiments/exp05_hash_comparison.py
  • docs/dev/specs/itl-939-experiments/exp06_derived_source_today.py
  • docs/dev/specs/itl-939-experiments/exp07_derived_source_prototype.py
  • docs/reference/hashing.md
  • scripts/hash_audit_example.py
  • src/orcapod/config.py
  • src/orcapod/core/nodes/function_node.py
  • src/orcapod/core/nodes/operator_node.py
  • src/orcapod/core/nodes/source_node.py
  • src/orcapod/core/operators/batch.py
  • src/orcapod/core/operators/group_by.py
  • src/orcapod/core/operators/join.py
  • src/orcapod/core/operators/merge_join.py
  • src/orcapod/core/operators/streaming_joins.py
  • src/orcapod/core/sources/arrow_table_source.py
  • src/orcapod/core/sources/csv_source.py
  • src/orcapod/core/sources/data_frame_source.py
  • src/orcapod/core/sources/db_table_source.py
  • src/orcapod/core/sources/delta_table_source.py
  • src/orcapod/core/sources/derived_source.py
  • src/orcapod/core/sources/dict_source.py
  • src/orcapod/core/sources/list_source.py
  • src/orcapod/core/sources/polling_source.py
  • src/orcapod/core/sources/spiraldb_table_source.py
  • src/orcapod/core/sources/stream_builder.py
  • src/orcapod/hashing/semantic_hashing/content_identifiable_mixin.py
  • src/orcapod/pipeline/graph.py
  • src/orcapod/pipeline/loaded_side_effects.py
  • src/orcapod/types/__init__.py
  • src/orcapod/utils/schema_utils.py
  • test-specification/property/test_hash_properties.py
  • tests/test_core/operators/test_async_sync_equivalence.py
  • tests/test_core/operators/test_merge_join.py
  • tests/test_core/operators/test_operators.py
  • tests/test_core/sources/test_default_source_ids.py
  • tests/test_core/sources/test_keyed_default_source_id.py
  • tests/test_core/sources/test_source_id_review_findings.py
  • tests/test_core/sources/test_stream_builder.py
  • tests/test_core/streams/test_streams.py
  • tests/test_hashing/golden/cases.py
  • tests/test_hashing/test_semantic_hasher.py
  • tests/test_orcapod_config.py
  • tests/test_pipeline/test_serialization.py
  • tests/test_utils/test_schema_utils.py
Files with no reviewable changes: 1

  • tests/test_core/sources/test_default_source_ids.py

Limit details: You’ve used the included review currently available. Your 96 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Recent review details

Additional context used

Code guidelines: 1

CLAUDE.md — auto-discovered
Path-based instructions: 4

Source excerpt: A pull request never edits `CHANGELOG.md` (developer, November 11, 2026; ITL-961).

CodeRabbit inference engine (CLAUDE.md)

Files:

  • changelog.d/ITL-556.md
Source excerpt: Every fenced `python` block in `README.md`, `docs/index.md`, `docs/getting-started.md`, `docs/troubleshooting.md`, `docs/concepts/`, `docs/reference/` and `docs/tutorial/` is executed by `tests/test_docs/test_doc_samples.py`...

CodeRabbit inference engine (CLAUDE.md)

Files:

  • docs/reference/hashing.md
Source excerpt: Never move or rename the fixtures in `tests/test_hashing/golden/cases.py`: function pods, dataclasses and pydantic models hash with their module path.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • tests/test_hashing/golden/cases.py
Source excerpt: Every place that produces or reads a digest is listed, with its class (into a hash, stored value, in a name, row identifier, id from a recipe, display only), in the "Hash site inventory" of `docs/reference/hashing.md`.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • docs/reference/hashing.md
Learnings: 5

Common learnings

Learnt from: CR
Repo: metamorphic-labs/orcapod-python PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-11-28T04:58:22.410Z
Learning: Source excerpt:
# Claude Code instructions for orcapod-python

## Lint, format and type checks

What runs where (developer, November 16, 2026; ITL-1181):

- Do not lower the basedpyright strictness mode, and do not add repo-wide or per-directory
  ruff ignores or excludes to make a check pass. A targeted `# noqa: <rule>` on one line
  needs a reason.
Learning: 2026-11-28T11:56:56.029Z

Learnt from: CR
Repo: metamorphic-labs/orcapod-python PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-11-28T11:56:56.029Z
Learning: Applies to {CHANGELOG.md,changelog.d/*.md} : Source excerpt:
# Claude Code instructions for orcapod-python

## Changelog

A pull request never edits `CHANGELOG.md` (developer, November 11, 2026; ITL-961). It adds
exactly one file, `changelog.d/<ISSUE-ID>.md` (e.g. `changelog.d/ITL-955.md`; a PR that
resolves several issues uses its primary issue's id).

Applied to files:

  • changelog.d/ITL-556.md
Learning: 2026-11-28T11:56:56.029Z

Learnt from: CR
Repo: metamorphic-labs/orcapod-python PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-11-28T11:56:56.029Z
Learning: Applies to docs/reference/hashing.md : Source excerpt:
# Claude Code instructions for orcapod-python

## Hash labels

- Every place that produces or reads a digest is listed, with its class (into a hash, stored
  value, in a name, row identifier, id from a recipe, display only), in the "Hash site
  inventory" of `docs/reference/hashing.md`. A new hash site is added there with its class;
  `tests/test_hashing/test_hash_site_inventory.py` traces the library and fails on a call
  site the table does not list.

Applied to files:

  • docs/reference/hashing.md
Learning: 2026-11-28T11:56:56.029Z

Learnt from: CR
Repo: metamorphic-labs/orcapod-python PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-11-28T11:56:56.029Z
Learning: Source excerpt:
# Claude Code instructions for orcapod-python

## Lint, format and type checks

What runs where (developer, November 16, 2026; ITL-1181):

- New and changed code must be ruff-clean and ruff-formatted, and must add no
  basedpyright errors. Warnings are reported but do not fail the check
  (`failOnWarnings = false`); still do not add them needlessly. Run
  `uv run ruff format .` and `uv run ruff check .` before committing;
  `uv run pre-commit install` once per clone runs both on every commit.

Applied to files:

  • src/orcapod/config.py
  • tests/test_orcapod_config.py
Learning: 2026-11-28T11:56:56.029Z

Learnt from: CR
Repo: metamorphic-labs/orcapod-python PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-11-28T11:56:56.029Z
Learning: Use [Google style](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings)
Python docstrings everywhere.

**Never mix in ReST markup.** Do not use `:meth:`, `:class:`, `:exc:`, `:attr:`,
`:func:`, or any other ReST cross-reference roles. Use plain ``backtick`` notation
to refer to names (e.g. ``PollingSource``, ``iter_data``, ``CursorInvalidatedError``).

Applied to files:

  • src/orcapod/core/operators/join.py
ast-grep (0.51.3)

tests/test_pipeline/test_serialization.py

[info] 100-100: use jsonify instead of json.dumps for JSON output
Context: json.dumps(saved)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)

[info] 148-148: use jsonify instead of json.dumps for JSON output
Context: json.dumps(saved)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)

Additional comments: 18

src/orcapod/core/nodes/operator_node.py: 1

1146-1146: Functional Correctness

The removed-setting check already runs before the full-mode branch.

PipelineJob.load does not reach OperatorJobNode.from_descriptor with an unvalidated descriptor. It first calls Pipeline.load on the embedded pipeline. Pipeline.load validates each node's config with validate_descriptor_config before it constructs any node. A removed hash-length setting raises ValueError there, and PipelineJob.load propagates it with the job file path.

The full-mode return in OperatorJobNode.from_descriptor therefore does not let the job accept the removed setting. The descriptor is validated earlier.

tests/test_pipeline/test_serialization.py: 1

5-5: LGTM!

Also applies to: 12-12, 20-20, 53-78, 81-109, 112-132, 135-151

src/orcapod/utils/schema_utils.py: 1

657-657: LGTM!

Also applies to: 660-660

src/orcapod/core/sources/stream_builder.py: 1

31-31: LGTM!

Also applies to: 453-453, 591-591

src/orcapod/core/sources/arrow_table_source.py: 1

121-121: LGTM!

src/orcapod/core/sources/csv_source.py: 1

370-370: LGTM!

src/orcapod/core/sources/data_frame_source.py: 1

106-106: LGTM!

src/orcapod/core/sources/db_table_source.py: 1

255-255: LGTM!

src/orcapod/core/sources/delta_table_source.py: 1

117-117: LGTM!

src/orcapod/core/sources/derived_source.py: 1

619-619: LGTM!

tests/test_core/sources/test_keyed_default_source_id.py: 1

560-560: LGTM!

tests/test_core/sources/test_source_id_review_findings.py: 1

350-350: LGTM!

Also applies to: 358-358

tests/test_core/sources/test_stream_builder.py: 1

21-21: LGTM!

Also applies to: 119-119

tests/test_core/streams/test_streams.py: 1

523-523: LGTM!

tests/test_hashing/golden/cases.py: 1

939-939: LGTM!

Also applies to: 941-943, 950-950, 953-953, 984-984, 1171-1171

tests/test_utils/test_schema_utils.py: 1

49-49: LGTM!

Also applies to: 58-59, 76-77, 89-91

src/orcapod/core/operators/batch.py: 1

197-197: LGTM!

Also applies to: 230-230

src/orcapod/core/operators/group_by.py: 1

554-554: LGTM!

Also applies to: 729-729

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