|
2 | 2 |
|
3 | 3 | ## Status |
4 | 4 |
|
5 | | -Proposed. |
| 5 | +Accepted. |
6 | 6 |
|
7 | 7 | ## Context |
8 | 8 |
|
@@ -277,30 +277,11 @@ escape hatch — but it should be a deliberate choice, not a default. |
277 | 277 |
|
278 | 278 | ## Decision |
279 | 279 |
|
280 | | -*Pending team review.* |
| 280 | +**Option B — Single-package infra.** Every infra and resource façade class moves into `com.marketdata.sdk` and drops the `public` modifier so it becomes package-private; the compiler then refuses any consumer reference to `HttpTransport`, `RequestSpec`, `AsyncSemaphore`, the wire-format deserializers, or any other internal type. B was chosen over A (JPMS) because the threat model includes classpath consumers — still the majority in 2026 — and JPMS enforcement degrades to a soft IDE warning on classpath, while Option B's enforcement is identical at the language level for both consumer modes. |
281 | 281 |
|
282 | 282 | ## Consequences |
283 | 283 |
|
284 | | -Follow-on work implied by each option. The chosen option will be |
285 | | -marked when the decision is made. |
286 | | - |
287 | | -- **A (JPMS, recommended):** Add `src/main/java/module-info.java` with |
288 | | - the exports listed in the option above. Add `requires` clauses for |
289 | | - Jackson and JSpecify (`requires static org.jspecify` for compile-time |
290 | | - only). Update CLAUDE.md to record the modulepath/classpath |
291 | | - enforcement contract. No source moves, no refactor of resource code. |
292 | | - Tests continue to access internals via Gradle's standard test source |
293 | | - set wiring. Verify that `./gradlew build` still succeeds end-to-end |
294 | | - and that `javadoc` no longer surfaces `internal.*` packages. |
295 | | - |
296 | | -- **B (single-package infra):** Move every infra and resource façade |
297 | | - class to `com.marketdata.sdk`; drop `public` from every type that |
298 | | - was internal. Refactor `@JsonDeserialize` annotations off response |
299 | | - records and into a programmatic `SimpleModule` registered on |
300 | | - `HttpTransport`'s `ObjectMapper`. Update every test that imports |
301 | | - formerly-internal types to the new package. Update CLAUDE.md to |
302 | | - describe the single-package convention and the package-private |
303 | | - default for non-DTO classes. |
| 284 | +Move every infra and resource façade class to `com.marketdata.sdk`, drop `public` from every type that was internal, refactor `@JsonDeserialize` annotations off response records into a programmatic `SimpleModule` registered on `HttpTransport`'s `ObjectMapper` (response records become data-only, decoupled from wire-format logic), and migrate every test that imports formerly-internal types to the new package — tests for package-private types must live in the matching test package. README's package-layout section needs to reflect the new tree. |
304 | 285 |
|
305 | 286 | ## References |
306 | 287 |
|
|
0 commit comments