Back to Scholarships Lab
Current schema 1.0

Lab Coach API Contract

Versioned, field-by-field reference for the lab coach payload. Each version below mirrors the Zod schema and server enforcer used at runtime. Future schema bumps append a new entry — older versions stay here for historical reference.

v1.0current

Released 2025-01-15

Initial public contract. Server enforces normalizeLabResult on every response; client runs a runtime guard and rejects incomplete payloads.

Response envelope

FieldTypeReqNotes
okenum
true | false
yes
Whether the request produced a usable lab result.
schemaVersionstring yes
Semver-style wire version (MAJOR.MINOR). Client compares to LAB_COACH_SCHEMA_VERSION; major mismatch → hard error, minor drift → warning.
matches /^\d+\.\d+$/
resultobject no
Present when ok === true. See sections below.
errorstring no
Present when ok === false. Human-readable error message.
validationReasonsstring[] no
Populated when the server's enforcer had to repair the model output. Useful for production diagnostics; absent when no recovery was needed.
synthesizedSectionsstring[] no
Names of fields the server synthesised because the model omitted them. Empty / absent when the model produced a fully valid payload.
usedModelsstring[] no
Models consulted to produce this result (primary + fallbacks).

Lab summary & alignment

Required narrative fields — always non-empty strings.

FieldTypeReqNotes
labSummarystring yes
Plain-language summary of what the lab does.
non-empty
alignmentstring yes
How the candidate's profile aligns with the lab.
non-empty
suggestedOpeningstring yes
Suggested opening line for an outreach email.
non-empty
fitScoreinteger yes
Overall fit score.
0–100, clamped server-side

Research context

Optional context arrays — default to [] when absent.

FieldTypeReqNotes
researchThemesstring[] no
Themes the lab pursues.
default []
recentPublicationsobject[] no
Recent papers from the lab.
default []
titlestring yes
Publication title.
yearstring no
Publication year as a string.
takeawaystring no
One-line takeaway describing the paper's contribution.
default ""
strengthsstring[] no
Candidate strengths relative to this lab.
default []
gapsstring[] no
Candidate gaps relative to this lab.
default []
hintsobject[] no
Tactical outreach hints.
default []
titlestring yes
Hint title.
suggestionstring yes
Concrete suggestion text.

PI analysis (optional block)

Present when PI metrics were available. Entire block is optional; individual fields default to empty strings or [] when synthesised.

FieldTypeReqNotes
piNamestring no
Principal investigator name.
affiliationstring no
Institutional affiliation.
totalCitationsstring no
Total citation count (string for formatting flexibility).
hIndexstring no
h-index metric.
i10Indexstring no
i10-index metric.
researchDirectionstring no
Narrative paragraph on overall research direction.
default ""
coreThemesstring[] no
Established research themes.
default []
emergingDirectionsstring[] no
Newer / forward-looking research threads.
default []
methodsAndTechniquesstring[] no
Methods and techniques the lab is known for.
default []
signatureCollaborationsstring[] no
Notable recurring collaborators.
default []
topPublicationsobject[] no
Highlight publications.
default []
titlestring yes
Publication title.
yearstring no
Publication year as a string.
takeawaystring no
One-line takeaway describing the paper's contribution.
default ""
recentTrajectorystring no
Where the lab appears to be heading.
default ""

CV fit (optional block)

Present when a CV was supplied. When present, verdict / verdictHeadline / matchScore / reasoning are required.

FieldTypeReqNotes
verdictenum
strong_match | moderate_match | weak_match | not_suitable
yes
Categorical CV fit verdict.
verdictHeadlinestring yes
Short headline summarising the verdict.
matchScoreinteger yes
CV-to-lab match score.
0–100
reasoningstring yes
Explanation of the verdict.
matchingSkillsstring[] no
Skills present in both CV and lab requirements.
default []
missingSkillsstring[] no
Lab-required skills missing from the CV.
default []
recommendedActionsobject[] no
Concrete next steps to improve fit.
default []
titlestring yes
Action title.
actionstring yes
Description of the recommended action.

Migration notes

  • No prior version — this is the baseline contract.
  • Clients MUST read `schemaVersion` and call `checkSchemaCompatibility` before trusting `result`.
  • Server-side: every code path must stamp `schemaVersion` (including early error returns).