Skip to content

Port /data/discover/{identifier} to content-node - #519

Merged
adamjohnwright merged 4 commits into
mainfrom
port/discover
Oct 17, 2026
Merged

adamjohnwright merged 4 commits into
mainfrom
port/discover

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Spec 006 T082.

This endpoint describes an event as a schema.org Dataset, for search engines. It is DiscoverController over graph-core's SchemaDataSet, reproduced field by field (schemaDataSet).

Ordering: graph-core's findById here is DatabaseObjectRepository.findByStId/findByDbId: every relationship, both ways, unsorted. Node runs that load and maps it with mapResult, as Spring Data maps it. That load decides the order of creators and citations. Sorting by r.order, by relationship id, or by a one-type expand each disagreed with Java on some event.

Lazy loads: each edit's authors, and each author's affiliations, are loaded as graph-core's LazyFetchAspect loads them: its query (lazyCollectionQuery), in relationship order, repeated by stoichiometry.

Java's answers kept:

  • Jackson's NON_EMPTY drops "", null and [].
  • Not found is a 404, "{id} not found". That includes an object with no relationship at all, whatever its class.
  • A non-event is a 422 with a null message.
  • A dbId past a long is the 500.

Parity: 50 requests against Java across two runs, all byte-identical (an error body's url aside). They cover pathways and reactions, URL, Book and multi-summation citations, an edit with no author, every id form, orphaned objects, and the 404, 422 and 500. No names were printed while checking; comparisons were by bytes and hashes.

Review: an adversarial review found:

  • an orphaned non-event answering 422 where Java answers 404 (fixed, and checked live);
  • the NON_EMPTY gap for "" (fixed);
  • several surviving test mutations. All six are now caught, and the handler's 200 path is tested end to end with a stand-in graph.

Routing: nginx and the dev proxy; the routing tests were shown failing first.

🤖 Generated with Claude Code

adamjohnwright and others added 4 commits October 17, 2026 20:43
An event as a schema.org Dataset: DiscoverController over graph-core's
SchemaDataSet, field by field (schemaDataSet). The event is loaded with
graph-core's own findByStId query -- every relationship, both ways,
unsorted -- and mapped by mapResult, because that load decides the order
of creators and citations: r.order, relationship ids and one-type
expands each disagree with Java on some event. Each edit's authors and
each author's affiliations come as graph-core's LazyFetchAspect loads
them (lazyCollectionQuery), repeated by stoichiometry. Not found is
Java's 404, a non-event its 422 with a null message.

Byte-identical to Java over 30 requests. Routed in nginx and the dev
proxy. Spec 006 T082.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An object with no relationship is null to graph-core's findByStId, so
Java answers 404 whatever its class; node checked the class first and
answered 422 for an orphaned non-event. The class is now checked after
the load. Jackson's NON_EMPTY drops "" as well as null and [], so an
empty description or name is left out. The handler's 200 path, its
404 after the load and a null stoichiometry are tested; no `differs`,
since the Dataset's own url is content.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 024f313 into main Oct 17, 2026
7 checks passed
@adamjohnwright
adamjohnwright deleted the port/discover branch October 17, 2026 21:10
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