Skip to content

Include the recognised entity for vc-recognition matches - #71

Merged
ottonomy merged 1 commit into
nightshift/47-remove-the-deprecated-check-field-from-check-resfrom
nightshift/50-include-the-recognised-entity-for-vc-recognition
Oct 20, 2026
Merged

ottonomy merged 1 commit into
nightshift/47-remove-the-deprecated-check-field-from-check-resfrom
nightshift/50-include-the-recognised-entity-for-vc-recognition

Conversation

@ottonomy

Copy link
Copy Markdown
Contributor

Closes #50

Stacked on #70 — review and merge that first (or merge the stack together).

Departures

None. The handler now returns the recognised credentialSubject entry as the
match's entity, mapped the way the OIDF handler maps its metadata, and the
five places that said vc-recognition matches carry no entity have been
rewritten.

Decisions not in the issue

  • subjectContainsDid became findSubjectEntry, returning the matching entry
    rather than a boolean, and the array and single-object subject shapes are now
    handled by one find over a one-element array instead of two branches. The
    behaviour for a missing or non-object subject is unchanged.
  • The entity mapping lives in a local entityFromEntry, mirroring the name and
    the doc-comment shape the OIDF and dcc-legacy handlers already use, rather
    than being shared between handlers: the three mappings read different source
    shapes and nothing is deduplicated by pulling them together.
  • Two existing tests asserted the whole found result with toEqual, so they
    now carry the expected entity too. New tests cover the string url/logo
    case alongside an unmapped image, an entry with no name, an entry whose
    name, url and logo are a language map / object / array, and a second
    lookup served from the handler's cache.
  • New assertions are written against the whole handler result rather than
    result.entity, as the OIDF spec does: HandlerResult is a union whose
    not-found member has no entity, so reading the property directly would
    add a type error to the dev type-check.
  • The architecture doc's file-tree line for vc-recognition-handler.ts was left
    alone; the OIDF line next to it does not mention entities either, and the
    prose section further down carries the description.

Agent-Run: b8b4ceec-5ec2-4bd8-8aa4-f7b4617ddde8

The vc-recognition handler kept only a yes or no from the verified
recognition credential's subject. It now returns the matching
credentialSubject entry as the match's entity: name, url and logo from the
entry's members of those names, each only where the entry's value is a
string, and the whole entry as raw. The credential is verified before its
subject is read, on a cache hit as well as on a fresh fetch, so the entity
is as trusted as the membership itself.

The mapping follows the OIDF handler's: a name that is a language map or
an object yields no entity.name and stays readable through raw, as does
anything else the entry holds.

The RegistryEntity type comment, the README, the verification-results
guide, the architecture doc and the CHANGELOG no longer say
vc-recognition matches carry no entity.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ottonomy
ottonomy force-pushed the nightshift/50-include-the-recognised-entity-for-vc-recognition branch from 9c27657 to 051e19c Compare October 20, 2026 19:23
@ottonomy
ottonomy merged commit 546f3f7 into main Oct 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Opened by an unattended agent — review before trusting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include the recognised entity for vc-recognition matches

1 participant