chore(profiles): remove unused register_adapter registry - #48
Merged
Conversation
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>
|
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.



Summary
Removes the
Profile.register_adapteradapter registry — built (merged PR #47) but never used: zero callers acrossmountainash-data,mountainash-wearables,mountainash-transport, andmountainash-auth-client. The consumer it was built for (data) solved the need with a consumer-owned(provider_type, auth_class) → fndispatch 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 globalregister_adapterregistry on shared credential classes. Backlog:mountainash-central/01.principles/mountainash-settings/h.backlog/remove-register-adapter-registry.md.Removed (
profiles/profile.py)Profile.register_adapterclassmethodProfile.registered_adaptersclassmethodemit_adaptermodule-level decorator (+ itsprofiles/__init__.pyexport and both__all__entries)_REGISTER_LOCK+ the now-deadthreadingimport_check_two_positionalhelper (only register_adapter used it) + the now-deadinspectimporttests/unit/profiles/test_register_adapter.pyKept (sanctioned 1:M reuse — unchanged)
Adaptertype aliasProfile.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 theregister_adapter"Extending emission" section with the inline-__adapters__+ consumer-owned-dispatch guidance.docs/superpowers/) marked SUPERSEDED.Verification
grepconfirms noregister_adapter/emit_adapter/registered_adaptersreferences remain insrc/ortests/(only the two superseded design docs mention the name, in their history banner).hatch run test:test— 441 passed;ruff:checkclean.profile.pyis removal-only (the lone+line is the trimmed__all__). The 2 remainingmypyerrors inprofile.pyare 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