Skip to content

feat: add LinkResolver.isTypeKnown so implementers stop naming an internal class - #142

Open
ehennestad wants to merge 1 commit into
document-inherited-contractsfrom
add-linkresolver-istypeknown
Open

feat: add LinkResolver.isTypeKnown so implementers stop naming an internal class#142
ehennestad wants to merge 1 commit into
document-inherited-contractsfrom
add-linkresolver-istypeknown

Conversation

@ehennestad

Copy link
Copy Markdown
Collaborator

Why

The LinkResolver interface documents a fork every implementer has to take. A reference whose type is known can be populated in place; one whose type is not known until it is probed has to be replaced, since an instance cannot change its class. The interface then gave no way to tell which case you were in, so kg-sync tests isa against openminds.internal.MixedTypeReference.

An interface that describes a fork and hides the switch is incomplete.

What

Adds the switch as a static method on the interface rather than promoting the class. An implementer is already reading LinkResolver to find out what to write, so that is where they will look for it, and it adds no new top-level name while MixedTypeReference stays internal.

Also stops the interface's own help pointing at internal classes. It named ResolvingVisitor twice, once in a See also, telling a reader to go look at something they are not meant to use.

🤖 Generated with Claude Code

@ehennestad
ehennestad force-pushed the add-linkresolver-istypeknown branch from 6be947a to 91deb95 Compare September 4, 2026 20:12
@ehennestad
ehennestad force-pushed the add-linkresolver-istypeknown branch from 91deb95 to c706366 Compare September 4, 2026 21:01
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Test Results (R2022a)

803 tests   802 ✅  3m 13s ⏱️
 22 suites    1 💤
  1 files      0 ❌

Results for commit 4d19d5b.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Test Results (R2026a)

803 tests   802 ✅  3m 5s ⏱️
 22 suites    1 💤
  1 files      0 ❌

Results for commit 4d19d5b.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (document-inherited-contracts@e6e437c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
code/+openminds/+interface/LinkResolver.m 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##             document-inherited-contracts     #142   +/-   ##
===============================================================
  Coverage                                ?   81.09%           
===============================================================
  Files                                   ?      422           
  Lines                                   ?     4205           
  Branches                                ?        0           
===============================================================
  Hits                                    ?     3410           
  Misses                                  ?      795           
  Partials                                ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ehennestad
ehennestad force-pushed the add-linkresolver-istypeknown branch from c706366 to e613c5b Compare September 4, 2026 21:10
…ernal class

The LinkResolver interface documents a fork every implementer has to take.
A reference whose type is known can be populated in place; one whose type is
not known until it is probed has to be replaced, since an instance cannot
change its class. The interface then gave no way to tell which case you were
in, so kg-sync tests isa against openminds.internal.MixedTypeReference. An
interface that describes a fork and hides the switch is incomplete.

Add the switch as a static method on the interface rather than promoting the
class. An implementer is already reading LinkResolver to find out what to
write, so that is where they will look for it, and it adds no new top-level
name while MixedTypeReference stays internal.

Also stop the interface's own help pointing at internal classes. It named
ResolvingVisitor twice, once in a See also, which told a reader to go look at
something they are not meant to use. Both now describe the behaviour as the
toolbox's rather than naming the class that implements it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ehennestad
ehennestad force-pushed the add-linkresolver-istypeknown branch from e613c5b to 4d19d5b Compare September 5, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant