Skip to content

chore(profiles): remove unused register_adapter registry - #48

Merged
discreteds merged 1 commit into
developfrom
chore/remove-register-adapter
Jun 29, 2026
Merged

chore(profiles): remove unused register_adapter registry#48
discreteds merged 1 commit into
developfrom
chore/remove-register-adapter

Conversation

@discreteds

Copy link
Copy Markdown
Member

Summary

Removes the Profile.register_adapter adapter registry — built (merged PR #47) but never used: zero callers across mountainash-data, mountainash-wearables, mountainash-transport, and mountainash-auth-client. The consumer it was built for (data) solved the need with a consumer-owned (provider_type, auth_class) → fn dispatch table that reads credential data directly and never mutates an auth-client class.

Driver principle: mountainash-auth-client/a.architecture/credentials-are-rendered-by-the-consumer.md (ADOPTED) — no global register_adapter registry on shared credential classes. Backlog: mountainash-central/01.principles/mountainash-settings/h.backlog/remove-register-adapter-registry.md.

Removed (profiles/profile.py)

  • Profile.register_adapter classmethod
  • Profile.registered_adapters classmethod
  • emit_adapter module-level decorator (+ its profiles/__init__.py export and both __all__ entries)
  • _REGISTER_LOCK + the now-dead threading import
  • _check_two_positional helper (only register_adapter used it) + the now-dead inspect import
  • tests/unit/profiles/test_register_adapter.py

Kept (sanctioned 1:M reuse — unchanged)

  • The Adapter type alias
  • Profile.emit(target, *, base) and the inline __adapters__ (target-keyed) / __adapter__ (legacy) dispatch. Only the post-hoc registration machinery is gone; emit-time dispatch over the inline maps is untouched.

Docs

  • docs/profile-spec-pattern.md — replaced the register_adapter "Extending emission" section with the inline-__adapters__ + consumer-owned-dispatch guidance.
  • The 2026-06-27 design spec + plan (in docs/superpowers/) marked SUPERSEDED.

Verification

  • grep confirms no register_adapter / emit_adapter / registered_adapters references remain in src/ or tests/ (only the two superseded design docs mention the name, in their history banner).
  • hatch run test:test441 passed; ruff:check clean.
  • Pure removal — diff in profile.py is removal-only (the lone + line is the trimmed __all__). The 2 remaining mypy errors in profile.py are in _resolve_spec/emit() (untouched functions) — pre-existing type debt, line numbers shifted only.

Supersedes

docs/superpowers/specs/2026-06-27-profile-register-adapter-design.md — the capability it designed is removed as unused/overkill.

🤖 Generated with Claude Code

register_adapter/registered_adapters/emit_adapter (plus the _REGISTER_LOCK,
the now-dead _check_two_positional helper, and the threading/inspect imports)
were built but never called: zero callers across data, wearables, transport,
auth-client. Consumers extend emission via the inline __adapters__ map or a
consumer-owned (provider_type, auth_class)->fn dispatch table, never by
mutating a shared credential class post-hoc.

Keeps the Adapter alias, Profile.emit(), and inline __adapters__/__adapter__
dispatch (the sanctioned 1:M reuse). Pure removal — no consumer coordination.

- delete tests/unit/profiles/test_register_adapter.py
- drop the register_adapter section from docs/profile-spec-pattern.md
- mark the 2026-06-27 design spec + plan SUPERSEDED

Driver: mountainash-auth-client credentials-are-rendered-by-the-consumer
(ADOPTED) — no global register_adapter registry on shared credential classes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@discreteds
discreteds merged commit f947817 into develop Jun 29, 2026
6 checks passed
@discreteds
discreteds deleted the chore/remove-register-adapter branch June 29, 2026 07:05
@sonarqubecloud

Copy link
Copy Markdown

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