Skip to content

Consolidate path-get engine; flatten_store alias (#69) - #133

Merged
thorwhalen merged 1 commit into
masterfrom
refactor/consolidate-path-get-69
Oct 14, 2026
Merged

thorwhalen merged 1 commit into
masterfrom
refactor/consolidate-path-get-69

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Closes #69

What

  • One read engine: dol._paths_core.path_get_core (the former paths._path_get loop). path_get, add_path_get and the legacy (non-create_missing) set/del walks in add_path_access now all delegate to it. paths._path_get stays as an alias; paths.raise_on_error is re-exported from the core (same object).
  • path_set was already consolidated in _paths_core (Enabling (optional) KeyPath ability to write when path doesn't already exist #16/Refactor: split oversized modules + dedup triplicated helpers #70); nothing to do.
  • chain_get is not a path walk (first-existing-key lookup), so it is not routed; its docstring now says so and points to path_get.
  • Two flattens disambiguated: dol.flatten_store added as the unambiguous name for trans.flatten (flatten kept, no warning, to not disturb ~86 dependents); flatten_dict / flatten docstrings cross-reference each other. flatten_dict and leaf_paths keep their separate recursions: they differ in visit_nested (Mapping vs dict), so merging would change behaviour.

Tests / gate

  • pytest (incl. doctests): 698 passed, 3 skipped; new test test_one_path_get_engine.
  • priv test-dependents dol --transitive: 133 suites, 88 pass, 32 fail, 1 no-tests on this branch; the identical set of 33 non-passing suites on master (environmental/pre-existing, e.g. missing pipdeptree).
  • Hosted CI is the gate for this public repo.

Adversarial review (fresh Opus agent): verdict SAFE. A 45-case old-vs-new probe (add_path_get reads, legacy set/del, path_get on_error variants, _path_get, flatten, KeyPath) was identical; _paths_core is still stdlib-only; no fleet package imports the moved names. Cosmetic only: inspect metadata (__module__, annotation) of the private _path_get / raise_on_error changed.

🤖 Generated with Claude Code

…as (#69)

path_get, add_path_get/add_path_access and the legacy _path_get alias now share
dol._paths_core.path_get_core. _path_get kept as alias. flatten_store added as the
unambiguous name for trans.flatten (vs paths.flatten_dict); chain_get documented as
a different operation. Behaviour-preserving.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit 30ee5ff into master Oct 14, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the refactor/consolidate-path-get-69 branch October 14, 2026 00:02
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.

Consolidate duplicated path-get and flatten implementations

1 participant