Skip to content

refactor(api): move the public scope names into the api layer - #421

Merged
Tomoscorbin merged 1 commit into
mainfrom
refactor/scope-names-live-in-api
Sep 2, 2026
Merged

Tomoscorbin merged 1 commit into
mainfrom
refactor/scope-names-live-in-api

Conversation

@Tomoscorbin

Copy link
Copy Markdown
Owner

What

Deletes application/scopes.py and moves its two residents into api/delta_table.py:

  • ScopeName (the public Literal of scope names) now sits with the rest of the public declaration vocabulary. generate imports it from there — over the generate.declaration -> api.delta_table edge the import contract already exempts, since generate constructs the DeltaTable it prints.
  • The resolver becomes _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.py is deleted rather than moved: tests/api/test_delta_table.py already pins the same behaviour black-box through DeltaTable — 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

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.
@Tomoscorbin
Tomoscorbin merged commit d677b58 into main Sep 2, 2026
8 checks passed
@Tomoscorbin
Tomoscorbin deleted the refactor/scope-names-live-in-api branch September 2, 2026 15:11
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