Skip to content

Spec 033: the last ContentService operations move to node - #1121

Merged
adamjohnwright merged 6 commits into
mainfrom
spec033/content-service-last
Nov 28, 2026
Merged

adamjohnwright merged 6 commits into
mainfrom
spec033/content-service-last

Conversation

@adamjohnwright

@adamjohnwright adamjohnwright commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Specifies moving the last nine operations off the old Java ContentService, so it can be switched off and reactome/content-service archived. Decided on 28 Nov 2026.

Supersedes: #1042's amendment to spec 010, which kept the nine in Java, and spec 006 T101 and T102.

Stories:

  1. PSICQUIC queries (4 operations): the third-party interactor overlays and the count beside each database. Today one database can take 21 s or more for a small pathway, for every visitor. In node, answers are cached on disk for a day and shared between visitors, and each fetch has a 30 s timeout.
  2. Custom interactors (5 operations): uploads and tokens. Every existing token is converted once by Java and checked on each server before its route moves.
  3. Retiring the old service: after one release, the webapp is removed and the repository archived.

Fidelity: answers byte-identical to Java's, with scores matched to Java's three decimals and Java's order. Node calls the library service only for any part that can't reach parity.

Research:

  • R1 and R2: read from the deployed versions (micluster 1.7.14, miscore 1.3.14, psimitab 1.8.6). A prototype built from the reading matched three of beta's Java answers byte for byte.
    • The MI-score depends on OLS serving only its first page of 50 terms, so node's snapshot is that page.
    • The EMBL-EBI libraries declare no licence, so the port is a clean reimplementation.
  • R3 to R7: the cache, the timeout, parity, the token store, uploads and routing.

Review: an adversarial review against content-service 7b9eceb and interactors-core 7513f42 found nine blocking and nine minor problems. I checked each against the source before fixing it.

  • Custom PSICQUIC tokens are not MD5: they're PSI- and a hash product, they collide easily, and Java overwrites on a collision. Node allows both forms and refuses the overwrite.
  • Reading a custom token fetches a user's address: it gets its own fetch, with Java's URL form and error, and the same address checks as uploads (every redirect, and the address actually connected to).
  • A timed-out fetch: dropped from POST details (still 200), but the 500 for POST summary, which the panel's counts use.
  • The cache key: the resource as typed, and Java's iteration order rather than sorted accessions.
  • Uploaded scores aren't all 1.0, and Java's answer order needs each identifier's stored-set order, which the conversion now records.
  • Java does bound the store: past 2 GB, files unread for a week are removed. Node does the same.
  • Token parity runs on every server before its route moves.
  • Also fixed: the registry is now a declared difference; settings and mounts; upload limits and statuses; a rate limit keyed on X-Real-IP; the tasks' dependencies and tooling chores; and wording that described how beta was inspected.

33 tasks. Docs only.

🤖 Generated with Claude Code

The nine operations the old Java ContentService still answers: the
four PSICQUIC queries, cached and bounded by a timeout, and the five
custom-interactor uploads and tokens, every existing token kept. Then
the old service is switched off and its repository archived.

PSICQUIC answers are to match Java's to its three decimal places and
its order. The library service is the fallback for any part that
cannot. This supersedes #1042's amendment and spec 006 T101 and T102.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamjohnwright and others added 5 commits November 28, 2026 18:36
R1 and R2 come from reading the deployed versions (micluster 1.7.14,
miscore 1.3.14, psimitab 1.8.6, not interactors-core main's). A
prototype built from that reading matched three of beta's Java answers
byte for byte. The MI-score depends on the ontology service serving
only its first page of 50 terms, so node's snapshot is that page. The
port is a clean reimplementation: the EMBL-EBI libraries declare no
licence.

The timeout is per fetch, and handled as Java handles a failed fetch:
Java took 102 s for two accessions, so a timeout on the whole request
would fail large diagrams. The cache is on disk: one resource's answer
for a small pathway is 472 KB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 tasks: the deployed versions pinned and beta's answers recorded;
the contract, Java's float and concurrent-map formats, and the
settings; Story 1 in parts (MITAB, clustering, the MI-score with the
first-page ontology snapshot, the clients, the answer, fetching, the
cache, the endpoints, parity, routing); Story 2 (the token conversion
by Java, the parsers, the store, the endpoints with the security
differences, parity for every token, routing); Story 3 (the catch-all,
then switching off and archiving).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing means after the port

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each finding was checked against content-service 7b9eceb and
interactors-core 7513f42 before it was fixed:
- A custom PSICQUIC token is "PSI-" and a hash product, not an MD5, and
  Java overwrites on a collision: both forms are allowed, and node
  refuses to overwrite (declared).
- Reading a custom PSICQUIC token fetches a user's address: it gets its
  own fetch with Java's URL and error, guarded like uploads (every
  redirect, the address connected to).
- A timed-out fetch is dropped from POST details but is the 500 for
  POST summary, which is what the panel's counts use.
- The cache keys on the resource as typed and on Java's iteration
  order, never sorted accessions.
- Uploaded scores are not all 1.0, and the order needs each
  identifier's stored-set order, which the conversion now records.
- Java does bound the store (past 2 GB, files unread for a week go),
  and node does the same.
- Token parity runs on every server before its route moves.
- The registry reading is a declared difference.
- The settings separate host and container names, and nothing in the
  checkout is mounted read-write.
- Upload limits and statuses (50 MB, 431, 422, 415), and a rate limit
  keyed on X-Real-IP.
- The descriptions of how beta was inspected are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 7198c24 into main Nov 28, 2026
13 checks passed
@adamjohnwright
adamjohnwright deleted the spec033/content-service-last branch November 28, 2026 19:29
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