ADR-011 — rtp-api as a Separately Published Addon Interface¶
Status: Accepted
Date: 2026-04-15
Context¶
RTP is designed to be extensible: claim plugins, economy systems, custom shapes, and other integrations are expected to hook into the plugin at runtime. Two approaches exist for providing that hook surface:
- Expose
rtp-coredirectly — addon developers compile against the full core module, giving them access to all implementation classes. - Publish a dedicated
rtp-apimodule — a curated, stable interface module that addon developers compile against, withrtp-coreinternals kept separate.
Early in the project's history, there was miscommunication with external developers about which classes and reflection-based utilities were safe to call, how to access internal state, and what the supported integration path was. This created support burden and fragile addons that broke on internal refactors.
Decision¶
All addon developers compile against rtp-api only. The rtp-core module is not published as a public dependency surface. rtp-api contains only the interfaces, enums, shared models, and event hooks that are explicitly supported and maintained across versions.
Rationale¶
Clear contract between core and addons¶
rtp-api provides an unambiguous signal: anything in this module is actively supported and will follow SemVer. Anything in rtp-core is an implementation detail — subject to change, refactor, or removal without notice. This removes the ambiguity that caused early miscommunication about which classes were safe to depend on.
Prevents reflection-based coupling¶
Without a dedicated API module, addon developers were accessing internal utilities via reflection, creating invisible, undocumented dependencies. A clearly bounded rtp-api module gives developers an explicit, documented path and removes the incentive to reach into internals.
Allows rtp-core to evolve freely¶
Because addon developers never compile against rtp-core, internal refactors — renaming classes, changing method signatures, restructuring packages — do not break addons. Only changes to rtp-api constitute a breaking change (and trigger a major version bump per the SemVer policy in CONTRIBUTING.md).
Consequences¶
- Positive: Addon developers have a clear, stable, version-controlled interface with no ambiguity about what is supported.
- Positive:
rtp-corecan be refactored freely without affecting addon compatibility, as long asrtp-apiis unchanged. - Positive: SemVer major bumps are only required when
rtp-apichanges, not on every internal refactor. - Negative: Any new capability that addons need shall be explicitly added to
rtp-api; it cannot be accessed ad-hoc fromrtp-core. - Negative: Maintaining two modules requires discipline to keep
rtp-apiminimal and not leak implementation details into it.