Verified architecture diagrams

The journal picker, from source data to one result

Two deterministic diagrams explain the system at different scales: the offline data lifecycle that produces bounded assets, and the live request sequence that consumes them.

1. Data lifecycle: broad offline, bounded online

The large corpus belongs in the rebuild path. Catalogs, exact object keys, ordered article IDs, and matrix dimensions are verified before any deployable artifact is produced. The runtime receives immutable derivatives rather than a monolithic corpus scan.

Flowchart from R2 source datasets through a verified local mirror and full BGE matrix to journal centroids, article shards, a PCA map, deployment, and the bounded runtime index.
Architectural-plan rendering; flowchart layout is deterministic. Agentic Mermaid: verified, zero warnings

Canonical inputs

R2 publishes the metadata, full-text, and BGE vector datasets used to reproduce the derived indexes.

Integrity gate

The ordered ID sidecar must match the corpus loader exactly; disagreement stops the build.

Deployable outputs

Seventy-four centroids, seventy-four article shards, and one BGE/PCA map are versioned with the API.

2. Live request: one embedding, three bounded products

The same 384-dimensional query vector drives journal ranking, related-article ranking, and map placement. Related articles and map work run as enrichments after the 74-centroid ranking; optional D1 activity logging remains outside recommendation correctness.

Sequence diagram showing a reader, picker UI Worker, picker API Worker, Workers AI, static assets, and optional D1 activity logging.
Publication-figure rendering; parallel enrichment is explicit. Agentic Mermaid: verified, zero warnings

3. The boundaries that protect availability

Operation Maximum live scope Why it stays bounded
Query embedding One manuscript Workers AI is invoked once and its vector is reused.
Journal ranking 74 centroids Article vectors are averaged and normalized offline.
Related articles Top 3 journal shards The journal result narrows the article candidate set first.
Map placement One stored PCA projection The 384-to-2D basis is computed offline and reused.
Activity logging One optional D1 write Failure is ignored by the matching path.

What is absent is as important as what is present: no author analytics, all-author fingerprint build, TF-IDF portfolio rebuild, full-matrix scan, or runtime R2 listing occurs while a user waits for a recommendation.

4. Reproducible Mermaid source

These sources are kept beside the rendered SVGs. Agentic Mermaid version 0.1.2 parsed and structurally verified both before strict SVG rendering.

Data lifecycle flowchart source
flowchart TB
  R2[(R2 source datasets)] -->|Catalogs and exact keys| Mirror[Verified local mirror]
  Mirror -->|Check ordered article IDs| Full[(32,814 x 384 BGE matrix)]
  Full -->|Mean and normalize| Centroids[(74 journal centroids)]
  Full -->|Split by journal| Shards[(74 article shards)]
  Centroids -->|Offline PCA| Map[(2D journal map)]
  Centroids --> Deploy[Deploy immutable API assets]
  Shards --> Deploy
  Map --> Deploy
  Deploy --> Runtime[Bounded runtime index]
Live request sequence source
sequenceDiagram
  actor Reader
  participant UI as picker-ui Worker
  participant API as picker-api Worker
  participant AI as Workers AI
  participant Assets as Static assets
  participant D1 as Optional D1

  Reader->>UI: Submit title and abstract
  UI->>API: Request journal recommendations
  API->>AI: Embed manuscript once
  AI-->>API: Return 384-d query vector
  API->>Assets: Load 74 journal centroids
  Assets-->>API: Return centroid matrix
  API->>API: Rank 74 journals

  par Related articles
    API->>Assets: Load top 3 journal shards
    Assets-->>API: Return selected vectors
    API->>API: Rank 8 related articles
  and Journal map
    API->>Assets: Load PCA map
    Assets-->>API: Return map projection
    API->>API: Place query on map
  end

  API-->>UI: Journals, articles, and map
  UI-->>Reader: Render partial HTML

  opt Activity logging configured
    UI->>D1: Record result or feedback
  end