Commit 40fefd3
test(java): unit tests for FR5d referrer/target population
Add Fr5dReferenceResolutionTest mirroring the TS reference in
server/typescript/packages/metadata/test/fr5d-reference-resolution-errors.test.ts.
Ten cases cover all five reference sites plus envelope-shape contracts:
- extends: unresolved (single + cross-file)
- @payloadRef unresolved → target=payloadRef string
- @requiredSlots missing → target=`payloadRef.slot`
- @via single-hop bad relationship → deepest-valid-prefix in message
- @via multi-hop bad relationship → deepest-valid-prefix names the hops
that DID resolve
- @Of non-existent entity + @Of missing field on existing entity
- resolved envelope carries referrer's files (so IDEs can jump to
declaration site)
- ResolvedSource.from() helper handles JsonSource and CodeSource fallback
Cross-port note in the class javadoc explains the Java vs TS FQN
divergence for top-level objects (Java propagates root `package:`, TS
does not).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 83a6420 commit 40fefd3
1 file changed
Lines changed: 478 additions & 0 deletions
0 commit comments