Skip to content

feat: expose Nanopub-Query-Loaded-Nanopub-Count response header#100

Merged
tkuhn merged 1 commit into
mainfrom
feature/loaded-nanopub-count-header
May 18, 2026
Merged

feat: expose Nanopub-Query-Loaded-Nanopub-Count response header#100
tkuhn merged 1 commit into
mainfrom
feature/loaded-nanopub-count-header

Conversation

@tkuhn
Copy link
Copy Markdown
Contributor

@tkuhn tkuhn commented May 18, 2026

Summary

  • Adds a new HTTP response header Nanopub-Query-Loaded-Nanopub-Count reporting the cumulative count of nanopubs ever loaded into the full repo.
  • Complements the existing Nanopub-Query-Registry-Nanopub-Count passthrough, which describes the upstream registry's view — together they let clients distinguish "what this instance has loaded" from "what the registry has", which is particularly useful in LOADING_INITIAL to gauge ingestion progress.
  • Semantics match the registry-side counterpart: cumulative, not decremented on invalidation (invalidations are recorded as npx:invalidates markers and don't touch the count).
  • No new persistent state — the value is sourced from the existing npa:hasNanopubCount admin triple that NanopubLoader.loadNanopubToRepo already maintains. The Java-side loadedNanopubCount is a process-local cache: lazily initialised from the store on first read, bumped post-commit on each fresh load to the full repo.

Test plan

  • MainVerticleGlobalHeadersTest.emitsLoadedNanopubCountWhenPresent covers the new header (mirrors the existing forwardsNanopubCountWhenPresent)
  • Full suite passes: Tests run: 215, Failures: 0, Errors: 0

🤖 Generated with Claude Code

Reports the cumulative count of nanopubs ever loaded into the `full`
repo, complementing the existing `Nanopub-Query-Registry-Nanopub-Count`
passthrough so clients can distinguish "what's loaded here" from "what
the registry has". Matches the registry-side semantics (invalidations
don't decrement). Sourced from the existing `npa:hasNanopubCount`
admin triple — no new persistent state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tkuhn tkuhn merged commit 4b405e5 into main May 18, 2026
7 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant