AssayLink documentation

Complete single-file export — user documentation and technical documentation, with all screenshots embedded. No internet connection and no other files required.

Generated from src/web/public/docs/ by npm run docs:bundle. The browsable version lives at /docs/index.html in the running application.

Contents

User documentation

User documentation

Why AssayLink exists, where it sits in the assay landscape, and how scientists, stewards and project teams use it.

Mission

AssayLink is an AI-assisted platform for discovering, authoring, governing and reviewing reusable assay definitions in Pharma R&D. It is the intended successor to the Test Definition Portal (TDP): the place where an assay is defined once, in governed language, so later systems can capture and analyse results against that definition.

Today definitions live as ad-hoc JSON, Excel and ageing tools. Metadata is missing or unstandardised, finding a relevant assay is slow, and there is little room for automation. A new portal by itself does not fix that. Stewardship and a controlled vocabulary are what make data consistent across labs and interoperable across PDE, Helix, RedLIMS and reporting systems.

When a project needs “a CYP3A4 induction assay in human hepatocytes”, AssayLink should already hold an approved, findable definition — not another spreadsheet rewrite of the same assay.

Three things are first-class:

  1. Modular templates — reusable assay definitions with versions, not runs.
  2. Controlled vocabulary — preferred terms, synonyms, hierarchy and ontology links, under a data steward.
  3. Explained matching — a free-text need mapped to templates with reasons, so a project can link the right definition.

What AssayLink does not do

AssayLink governs reusable assay definitions. It does not store experimental execution data, raw instrument files, or processed results, and it does not replace LIMS, ELN, PDE or Benchling. Those systems remain the systems of record for work that was actually run; they validate entered data against AssayLink templates.

AssayLink owns AssayLink does not own
Reusable assay definitions (templates) Experimental execution data (runs, plates, samples)
Template versions and review workflow Instrument files, LIMS results, study reports
The assay metadata model itself (sections, fields, rules) Numeric experimental values (Fold Induction, Ct, peak area, …)
Controlled vocabularies and stewardship Protocol / instruments / data-output blocks (future sections); project master data (MaRLay)
Execution systems (PDE, Benchling, LIMS) validate what users enter against the definitions AssayLink maintains. That boundary keeps the product tractable.

Personas

Persona Demo user Main job
Assay Definition Owner Dr Amelia Ostrowski Create and edit draft templates; submit for review; version approved work
Data Steward Dr Sofia Lindqvist Review templates; own the metadata model and vocabulary
Project Team Member Tomas Berg Pick a MaRLay project, describe a need, link a matching template

Core concepts (plain language)

Using the POC role switcher

In this proof of concept, authentication is mocked. The header shows a Role control with the role name (Assay Definition Owner, Data Steward, Project Team Member). Hover to see the demo user. Changing the dropdown switches immediately and lands on that role’s dashboard. In a real deployment this comes from Entra ID / ALB SSO and cannot be changed in the UI.

Continue to the full user guide with screenshots →

↑ Back to contents

User documentation

User guide

Screenshot walkthrough of every major screen, organised by persona. Switch the header persona to match the section you are reading.

App chrome (all personas)

Every page shares the same header: the AssayLink logo (home), a role-filtered navigation on one row, and (in the POC) the Role switcher on the right. The dropdown shows the role; hover for the demo user’s name. Changing it switches immediately. Links you are not allowed to use simply do not appear — and typing a forbidden URL shows a clear “not permitted” page.

Header with logo, navigation, and persona switcher on the owner dashboard
Header + Assay Definition Owner dashboard: drafts, awaiting review, recently approved.

Assay Definition Owner

Demo user: Dr Amelia Ostrowski. Creates and maintains templates through review.

Dashboard

Three columns: My draft templates, Awaiting steward review, and Recently approved. Drafts offer an Edit shortcut.

Template catalogue

Templates are grouped into functional areas (ADME / DMPK is populated; HTS, Safety, In Vivo tiles are greyed placeholders for future scope). Open a group to see templates; filters sit at the top.

Grouped template catalogue with ADME group expanded
Catalogue with ADME / DMPK expanded.

Template detail

Shows metadata, status, versions, review history, the Metadata Quality Score, and actions (submit, edit draft when allowed). Vocabulary-backed values render as governed terms. AssayLink does not show experimental result values.

Template detail page for PK Induction in Heps
Published template detail (PK Induction in Heps).

Authoring wizard (new template)

A metadata-driven wizard paged by steward-configured sections (Assay Identity, Classification, Biological System / Materials, Detection, Readouts / Endpoints, …). Fields, obligation and dropdown values come from MetadataFieldDefinition; conditional rules show or require extra fields (for CYP induction: Target, Cell System, Species, Detection Type). Expected readouts are vocabulary categories, not measured values. A Metadata Quality Score updates as you fill. Hierarchy fields use the vocabulary tree; AI autofill (when enabled) is visibly marked as suggested until accepted.

New template authoring wizard
New template wizard — sections and fields are model-driven.

Edit draft

Owners can reopen drafts and “changes requested” versions. The template code is locked; metadata remains editable until submission.

Edit draft wizard for an existing template
Editing an existing draft.

Find an assay (matcher)

Describe an assay need in free text. The system extracts metadata (rule-based, optionally merged with an LLM), scores published templates, explains each match field by field, and names fields that active metadata rules still require. A Metadata Quality Score estimate is shown from the description — not from experimental results.

Empty matcher form before submitting a query
Matcher before a query.
Matcher results with ranked template recommendations
Matcher results for a CYP3A4 induction need — top match should be PK Induction in Heps with explained scores.

Data Steward

Demo user: Dr Sofia Lindqvist. Reviews templates and owns the semantic foundation (model + vocabulary).

Dashboard

Data Steward dashboard with review and vocabulary stats
Steward dashboard: review queue size, suggestions, mapping gaps, recent changes.

Review queue

Lists submitted / in-review templates with the Metadata Quality Score (missing required fields, ungoverned values, rule warnings). Open a template to approve, reject, or request changes with comments and optional per-field notes.

Steward review queue
Review queue.

Assay Definition Model

A field is one piece of information an assay definition captures — “Assay format”, “Species”, “Target”. Fields sit in steward-named sections (including Biological System / Materials). This screen is what the authoring wizard is generated from.

The knowledge model shows Assay Definition → sections → vocabularies → rules → quality. Section cards sit below. The field and vocabulary map shows scientific sections and fields on the left, vocabularies on the right, connectors for governed values. Conditional rules live under the Rules tab and the Conditional Rule Map.

Metadata model map and field tables
Assay Definition Knowledge Model with section cards and maps.
Field definition editor for Assay type
Field editor — identity, value source, section placement, constraints.

Adding a field. Inputs marked * are required. The two settings that decide how the field behaves are:

Retiring a field. Deprecate is the governed route: authors stop being offered the field, existing template values are kept so history stays readable, and the rules become read-only until the field is reactivated. Delete is only offered when no template has ever held a value for the field — it removes a mistyped or experimental field outright, and the audit entry survives the deletion.

Leave Applies to assay types unticked and the field applies to every assay type. Tick a branch and it only appears once an author selects that assay type or one beneath it — which is why a newly scoped field can look missing in the wizard until the assay type is chosen.

Conditional rules. Under the Rules tab, a steward writes when/then logic over field keys. The CYP induction rule is the demo: when Assay Type is CYP induction or a more specific type, require Target, Cell System, Species and Detection Type, and restrict Expected Readout to Fold Induction, Emax and NOEL. Hide / make-optional stay secondary. Rules never collect experimental numbers.

Vocabulary

Browse vocabularies, open a vocabulary to manage terms, synonyms, hierarchy and ontology mappings. Deprecate carefully; never delete history that templates rely on without a steward decision.

List of controlled vocabularies
Vocabulary catalogue.
Assay Type vocabulary term list
Assay Type terms (hierarchical where configured).

Suggested terms

AI and users may propose labels that are not yet governed. Only a steward can approve them into an active vocabulary term. This is the single gate for growing the terminology.

Suggested term review queue
Suggested-term queue.

Change history

Governed change log
Audit trail of governed changes.

Project Team Member

Demo user: Tomas Berg. Starts from a MaRLay project (six-digit id), not from a blank matcher.

Dashboard and project list

Project member dashboard
Project member dashboard.
MaRLay projects list
My projects — master data from the MaRLay mock.

Project detail and define assay

Open a project to see linked assays. “Define” starts a need description (high-level type + short text), runs matching pinned to that project, then lets you link a template version and add project-specific context.

Project detail with linked assays
Project detail.
Define a project assay flow
Define a project assay (project-first matcher).
Project members do not see a standalone “Find an assay” nav item — matching is reached through the project so recommendations can be linked.

Shared: catalogue and templates

All personas can browse the catalogue and open published templates. Creating, reviewing, and model edits remain role-gated.

Role gates

If you open a URL your role cannot use, AssayLink shows a clear forbidden page naming the capability and which role holds it.

Forbidden page when a project member opens steward vocabulary
Project member attempting Vocabulary — server-enforced, not only hidden UI.

Typical end-to-end scenarios

  1. Author → review → publish: Owner creates a draft → submits → Steward reviews with comments → approves → Owner (or process) publishes / versions as needed.
  2. Discover & link: Project member picks MaRLay project → describes need → selects recommended template → adds project fields → link.
  3. Govern terminology: Matcher or author surfaces an unknown label → Suggested Term → Steward activates synonym or new term → future matches improve.
  4. Evolve the model: Steward opens Assay Definition Model → changes a section, field or rule → wizard and Metadata Quality Score update immediately.

← Back to mission · Technical docs →

↑ Back to contents

Technical documentation

Technical documentation

For developers and coding agents: what AssayLink is, what is already built, and how to change it without breaking the product rules.

Agent brief (read this first)

Goal: a POC that can mature into a product — the assay definition layer (intended TDP successor): AI-assisted template discovery, metadata authoring, vocabulary governance and template review. Not experimental execution data. Stewardship and controlled vocabulary are first-class, not an afterthought.

Two rules that override everything else:

  1. Build a metadata-driven, vocabulary-governed assay template product, not a JSON viewer.
  2. Design so every hard-coded demo behaviour can later become governed configuration.

Canonical project instructions also live in the repo root CLAUDE.md. Prefer this HTML pack for humans and offline export; keep CLAUDE.md as the short agent policy file.

What is implemented today

Capability Status
Next.js 15 App Router app under src/web/Done
Prisma + PostgreSQL schema, migrations, seed from 4 JSON sourcesDone
Three personas with capability-based auth (mock cookie)Done
Grouped catalogue, template detail, lifecycle statusesDone
Metadata-driven authoring wizard (by section) + draft editDone
Steward review queue + review decision formDone
Vocabulary CRUD, suggestions gate, change logDone
Metadata model: Assay Definition Knowledge Model (sections, field–vocabulary map, rules)Done
Metadata Quality Score (completeness, vocabulary, rules)Done
Free-text matcher with explained scoring and rule-derived gapsDone
Hybrid extraction (rules + optional Claude / Azure OpenAI)Done (mock default)
Project-first flow via MaRLay mock + ProjectAssayLinkDone
Static HTML docs at /docs/Done
Real Entra/ALB SSODesigned, not wired
Real MaRLay HTTP clientMock client shaped for swap
Reusable assay subtypes as a primary objectOut of primary UX (ADR-0003)
Protocol / instruments / data-output blocksFUTURE sections on the section map

Non-negotiable engineering rules

Repository map

ph-rnd-assaylink/
├── CLAUDE.md                 # Agent/project policy (short)
├── config.yml                # ONLY infra file to edit
├── terraform/                # DO NOT MODIFY (upstream)
├── docs/                     # Markdown ADRs & product notes (source material)
├── .github/workflows/ci.yml  # Our CI
├── docker-compose.yml        # Local Postgres
├── dev.sh                    # One-command local start
└── src/web/                  # Entire application (Docker build context)
    ├── prisma/               # Schema, migrations, seed
    ├── public/docs/          # THIS documentation (static HTML)
    ├── src/app/              # Routes, server actions
    ├── src/components/       # UI
    ├── src/domain/           # Types + Zod
    ├── src/server/           # services, repositories, ai, auth, integrations
    └── tests/                # unit, integration, e2e

Markdown under repo docs/ (ADRs, meeting notes) remains the historical design record. Prefer linking to those for deep decisions; this HTML site is the navigable export for users and agents.

Architecture → · Implementation detail → · How to continue development →

↑ Back to contents

Technical documentation

Architecture

One Next.js service, layered domain code, metadata and vocabulary as data.

Runtime shape

Browser
  │  /docs  → static HTML (public/docs)
  │  UI     → Server Components + server actions
  ▼
Next.js 15 (App Router)  —  ECS Fargate "web", port 3000
  ├── app/                 routes, actions
  ├── server/services/     business rules
  ├── server/repositories/ Prisma only
  ├── server/ai/           providers, extraction, scoring
  ├── server/integrations/ MaRLay client (mock today)
  └── domain/              Zod + types
  ▼
PostgreSQL (schema assaylink)

Layering rules

LayerMay importMust not
app/**, components services, domain Prisma, repositories
server/services/** repositories, domain, ai React / Next request APIs beyond auth helpers
server/repositories/** db.ts, domain services (no cycles)
server/ai/** domain, repositories (read) services
domain/** zod only everything else

Domain data model (summary)

Full narrative: repo docs/domain-model.md and ADRs 0002, 0007–0010. Schema: src/web/prisma/schema.prisma. AssayLink does not store experimental execution data.

AI architecture

See docs/adr/0005-ai-provider-abstraction.md and docs/ai-recommendation.md.

Authentication & authorisation

POC: signed cookie + role switcher (ENABLE_ROLE_SWITCHER). Pages: guardCapability. Mutations: requireCapability. Capability map in server/auth/roles.ts. Production path: ALB OIDC header → map groups to roles in current-user.ts only (docs/adr/0006-auth-strategy.md).

Deployment constraints

Architecture decision records

ADRTopic
0001Tech stack (Next.js monolith under src/web)
0002Domain model / metadata as data
0003Template versioning (subtypes deferred)
0004Vocabulary governance
0005AI provider abstraction
0006Auth strategy
0007Metadata sections
0008Conditional metadata rules
0009Metadata Quality Score
0010Definitions, not experimental results

Source files: docs/adr/*.md in the repository root.

↑ Back to contents

Technical documentation

Implementation details

Concrete map of routes, services, seed data, and tests.

Run locally

./dev.sh              # Postgres, migrate, seed, next dev
./dev.sh --reset      # wipe DB then seed
./dev.sh --no-seed    # skip seed

App: http://localhost:3000. Docs: http://localhost:3000/docs/. Work only inside src/web for npm scripts.

Primary routes

PathPurposeCapability
/Role dashboard—
/templatesGrouped catalogue—
/templates/new, /templates/[id]/editAuthor / edit drafttemplate:create / ownership
/templates/[id]Detail + lifecycle actionsview; mutate gated
/matcherFree-text match (non-project roles)—
/projects, /projects/[id], .../newProject-first flowproject:link
/steward/review-queueReview queuetemplate:review
/steward/model, /steward/model/rules, /steward/model/sections/[key], /steward/fields/[key]Assay definition modelfield:manage
/steward/vocabulary, suggestions, changesVocabulary governancevocabulary:manage
/docs/Static documentationpublic
/health, /api/readinessHealth / readinesspublic
/forbiddenCapability denial—

Key server modules

ModuleResponsibility
template-service.tsCreate/update drafts, status transitions, field values
review-service.tsQueue + Metadata Quality Score inputs
vocabulary-service.tsTerms, suggestions approval
field-service.tsMetadata field definitions
section-service.tsMetadata sections
rule-service.tsConditional metadata rules
matcher-service.tsExtract → recommend → rule-gap insights
project-link-service.tsProjectAssayLink CRUD
wizard-service.tsWizard payload / edit hydration
catalogue-service.tsGrouped catalogue
integrations/marlay.tsProject master-data client (mock)

Template lifecycle

Statuses and legal transitions live in domain/status.ts (DRAFT, SUBMITTED, IN_REVIEW, CHANGES_REQUESTED, APPROVED, PUBLISHED, REJECTED, …). Editable when isTemplateEditable is true (draft / changes requested).

Seed data

Testing

LevelCommand / location
Unittests/unit/* — matching, scoring, validation, rule evaluation, quality score, diagram layout, …
Integrationtests/integration/* — needs docker-compose Postgres
E2Enpm run test:e2e — Playwright core flows

CI: .github/workflows/ci.yml — lint, typecheck, unit tests, build.

This documentation pack

↑ Back to contents

Technical documentation

Continuing development (agent playbook)

Instructions for a third-party coding agent picking up this repository cold. Scope, constraints, and safe next work.

How an agent should work here

  1. Read CLAUDE.md and this page before large edits.
  2. Treat meeting notes (docs/meeting-notes.md) and the product brief as product-context authoritative for workflow and scope.
  3. Prefer changing data (sections, field definitions, rules, vocabulary, catalogue groups) over hard-coding UI enums.
  4. Keep AI behind server/ai/; validate with Zod; route new terms to SuggestedTerm.
  5. Put business rules in services; Prisma only in repositories.
  6. Add unit tests for domain logic you touch; run lint, typecheck, and tests before reporting completion.
  7. Do not modify terraform/. Infra changes go through config.yml only.
  8. Application code that must ship in the container belongs under src/web/.

Good next increments (examples)

Do not

Definition of done (code change)

cd src/web
npm run lint
npm run typecheck
npm test
# optional: npm run test:e2e
# optional: npm run docs:screenshots   # if UI changed meaningfully

Domain language (use these names)

TermMeaning
Assay TemplateReusable assay definition; has versions
Assay Template VersionImmutable-once-approved metadata snapshot
Project Assay LinkProject’s use of a version + context; not a run
MaRLayExternal project master data; six-digit ids
Vocabulary / TermGoverned controlled list / concept
Metadata Field DefinitionField in the assay metadata model
Metadata SectionSteward-named group of fields; wizard pages by these
Metadata RuleWhen/then logic: show, require, restrict vocabulary terms
Metadata Quality ScoreCompleteness, vocabulary compliance, rule consistency — not experimental results
Template ReviewSteward decision on a submitted version
Suggested TermCandidate awaiting steward approval
Assay subtypes are out of the primary demo UX (ADR-0003). Use Template Version and Project Assay Link / Project Usage. A reusable variant concept remains future-direction documentation only.

← Technical hub · User guide

↑ Back to contents