|
| 1 | +# Maintainer and AI-agent guide |
| 2 | + |
| 3 | +SimpleAPI is a shared library consumed by AdvancedCore and other plugins. The repository now uses one Maven project and one source tree with platform-neutral and platform-specific packages; do not recreate the removed experimental submodule build. |
| 4 | + |
| 5 | +## Build and verification |
| 6 | + |
| 7 | +Requirements: JDK 21+ and Maven. The Maven project is in `SimpleAPI/`. |
| 8 | + |
| 9 | +```shell |
| 10 | +mvn -B -f SimpleAPI/pom.xml test |
| 11 | +mvn -B -f SimpleAPI/pom.xml package |
| 12 | +``` |
| 13 | + |
| 14 | +Confirm current CI and POM settings before relying on these commands. Verify that the package invocation produced both the legacy/full artifact and every configured classifier, especially the `shared` JAR. Run `git diff --check` and confirm tests actually ran. |
| 15 | + |
| 16 | +## Packaging boundaries |
| 17 | + |
| 18 | +- `com.bencodez.simpleapi.core` contains platform-independent implementations. |
| 19 | +- Platform adapters belong under packages such as `com.bencodez.simpleapi.bukkit`; future Forge/Fabric/other adapters must remain isolated from core. |
| 20 | +- The full `simpleapi` artifact preserves existing consumers and public package names. |
| 21 | +- The `shared` classifier JAR contains only the explicitly selected neutral API. Because a classifier shares the project's ordinary POM, native consumers must exclude its transitives and explicitly declare the neutral dependencies they use, as documented in `docs/shared-libraries.md`. |
| 22 | +- Compatibility facades in older package names are intentional. Do not remove, relocate, or narrow them without an explicit migration and downstream verification. |
| 23 | +- Previously removed experimental coordinates such as `simpleapi-parent`, `simpleapi-core`, `simpleapi-configurate`, and `simpleapi-sql` are not current build modules. |
| 24 | + |
| 25 | +Core and the shared artifact must not link Bukkit, BungeeCord, Velocity, Minecraft, Forge, Fabric, NeoForge, or other loader-specific classes. Test the packaged JAR, not only source imports: signatures, annotations, superclass references, static initializers, service descriptors, and reflective loading can leak platform dependencies. |
| 26 | + |
| 27 | +## API and configuration compatibility |
| 28 | + |
| 29 | +Treat public signatures, constructors, overloads, generic types, return values, exceptions, callback threading, configuration shapes, and serialized data as compatibility surfaces. |
| 30 | + |
| 31 | +- Preserve legacy YAML key lookup, casing, literal-key behavior, defaults, numeric values, empty/missing distinctions, and copy isolation. |
| 32 | +- Keep structured/plain configuration views bounded and cycle-safe. |
| 33 | +- Shared configuration paths must reject or adapt native platform objects according to their documented contract; Bukkit adapters may preserve native `ConfigurationSection` behavior where promised. |
| 34 | +- Annotation binding must preserve inherited fields, supported value classification, nested traversal, and detached/rootless-section safety. |
| 35 | +- Database abstractions must keep connection ownership, transaction boundaries, timeouts, null/closed-connection handling, and shutdown behavior explicit. |
| 36 | +- Do not introduce hidden user extraction or Bukkit-only behavior into neutral APIs merely for a storage mode that is scheduled for removal. |
| 37 | + |
| 38 | +## Concurrency, lifecycle, and resources |
| 39 | + |
| 40 | +- Avoid blocking I/O on Bukkit, region, proxy, networking, or event threads. |
| 41 | +- Define callback execution context and preserve it across adapters. |
| 42 | +- Bound queues, caches, payloads, recursion, retries, and diagnostic output. |
| 43 | +- Handle cancellation, interruption, executor rejection, partial initialization, reload, and shutdown without leaked work. |
| 44 | +- Optional integrations must not cause class-loading failures when absent. |
| 45 | + |
| 46 | +## Change and PR workflow |
| 47 | + |
| 48 | +Keep changes focused and avoid unrelated formatting. Before any commit, push, PR update, review reply, or other remote change: |
| 49 | + |
| 50 | +1. run relevant focused tests; |
| 51 | +2. run the full Maven package build; |
| 52 | +3. inspect the newly produced full and shared artifacts; |
| 53 | +4. run `git diff --check`; |
| 54 | +5. inspect the complete base-to-HEAD diff and affected AdvancedCore/downstream contracts. |
| 55 | + |
| 56 | +For substantive changes, obtain a fresh source-read-only review. The implementation agent verifies and fixes accepted findings, reruns all required checks, and obtains a new review of the updated snapshot. Do not reuse an earlier clean verdict after changes, and do not merge without explicit authorization. |
0 commit comments