Repository navigation
refactor(api): move the public scope names into the api layer - #421
Merged
Merged
Conversation
application/scopes.py held ScopeName and its resolver on the grounds that api and generate were independent siblings needing a shared home below both. They are not: generate.declaration already imports api.delta_table over a blessed edge to build the DeltaTable it prints. The names now live where the rest of the public vocabulary does, the resolver is private to the one place that resolves, and application no longer names scopes — it only uses them. The api tests already pin the name-to-scope mapping and the unknown-name rejection through DeltaTable itself, so the module's tests go with it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Deletes
application/scopes.pyand moves its two residents intoapi/delta_table.py:ScopeName(the publicLiteralof scope names) now sits with the rest of the public declaration vocabulary.generateimports it from there — over thegenerate.declaration -> api.delta_tableedge the import contract already exempts, since generate constructs theDeltaTableit prints._resolve_scope_name, private to its only caller.Why
The module existed because api and generate were thought to be independent siblings needing a shared home below both. The blessed import edge says otherwise: generate already imports from api. With that, a 31-line application module served no layering purpose — it parked api's naming concern one layer down. Application now contains no scope naming, only scope use.
tests/application/test_scopes.pyis deleted rather than moved:tests/api/test_delta_table.pyalready pins the same behaviour black-box throughDeltaTable— every public name resolving to its domain scope, and an unknown name rejected at construction.No behaviour changes. Gate: 1395 passed (5 fewer — the deleted redundant tests), ruff check/format clean, mypy clean (178 files), all 7 import contracts kept.
🤖 Generated with Claude Code