// Domain packs — what a workspace is modelling.
//
// The build flow (describe → pick a template → upload the most relevant docs →
// Claude proposes → you correct it) is identical for every domain. Only the
// nouns change. So a domain is *data*: templates, the files you'd start from,
// and the data products each hub would compute. Adding a domain should never
// mean touching the flow.
//
// 'company' reproduces the original Cascade Ridge content so the built
// workspace is unchanged. 'lab' is the second worked example — a high-resolution
// HLA typing lab — included to show the model is not a finance idea.
const DOM_IC = {
grid: '',
doc: '',
people: '',
globe: '',
trend: '',
megaphone: '',
clipboard: '',
search: '',
// Lab-specific
helix: '',
flask: '',
link: '',
mouse: '',
peptide: '',
badge: '',
};
const PROXA_DOMAINS = {
company: {
key: 'company',
label: 'A company',
blurb: 'Finances, customers, projects, people — an operating business.',
orgName: 'Cascade Ridge',
mark: 'assets/crf-mark.svg?v=3',
// "What are you modelling?" — the answer, in the domain's own words.
modelLine: 'A mid-market food manufacturer: two plants, a customer book, a financial model.',
groups: [
{ label: 'Org templates', items: [
{ id: 'finance', name: 'Finance', live: true,
desc: 'Statements, working capital, budget vs. actual, capacity and forecast — from your financial model.',
icon: DOM_IC.grid },
{ id: 'contracts', name: 'Contracts', live: false,
desc: 'Customer agreements, renewals, obligations and pricing — from your MSAs and SOWs.',
icon: DOM_IC.doc },
{ id: 'people', name: 'People', live: false,
desc: 'Headcount, org, compensation and safety — from your roster and payroll exports.',
icon: DOM_IC.people },
{ id: 'commercial', name: 'Commercial', live: false,
desc: 'A 360 per customer — contracts, pipeline, volume, revenue and margin, merged.',
icon: DOM_IC.globe },
{ id: 'sales', name: 'Sales', live: false,
desc: 'Pipeline, bookings, win-rate and forecast across the commercial organization.',
icon: DOM_IC.trend },
{ id: 'marketing', name: 'Marketing', live: false,
desc: 'Campaigns, spend, funnel and attribution across channels.',
icon: DOM_IC.megaphone },
] },
{ label: 'Project templates', items: [
{ id: 'diligence', name: 'Diligence', live: true,
desc: 'Upload a DDQ — Claude turns every request into a tracked data product, answered from the model.',
icon: DOM_IC.clipboard },
{ id: 'audit', name: 'Audit', live: false,
desc: 'A PBC list, encoded — requests, evidence and status against your model.',
icon: DOM_IC.search },
] },
],
// Step 2 — the docs most relevant to start with.
files: [
{ name: 'CascadeRidge-Financial-Data.xlsx', type: 'xlsx', bytes: 252366 },
{ name: 'CascadeRidge-Financial-Model.xlsx', type: 'xlsx', bytes: 151606 },
{ name: 'CascadeRidge-HR-Roster.xlsx', type: 'xlsx', bytes: 80019 },
{ name: 'CascadeRidge-Customer-Report.xlsx', type: 'xlsx', bytes: 97829 },
{ name: 'entities.json', type: 'json', bytes: 592209 },
],
uploadHint: 'Excel workbooks, financial models, data exports',
// What the assistant asks you to hand over, in the domain's own words.
sourceNoun: 'your financial model',
onboard: {
title: 'Build your Finance hub',
body: 'Upload your financial model, general ledger and exports. Claude reads them and builds the '
+ 'data products below — each traced back to your files, nothing invented.',
},
products: [
['P&L & Margin Bridge', 'Revenue growth & the gross-margin story'],
['Three-Statement Model', 'IS / BS / CF + forecast, balanced'],
['Working Capital & AR', 'Aging, DSO, collection health'],
['Budget vs Actual', 'Plan-vs-actual variance'],
['Customer Concentration', 'Revenue mix & top-10 exposure'],
['Capacity & Utilization', 'Line-level utilization'],
['Labor Bridge', 'Headcount & payroll ties'],
['Debt & Capital', 'Amortization, capex, distributions'],
],
// Specifics Claude proposes after reading the sources — Draft until validated.
// Company: the existing Cascade Ridge set lives in model_context.jsx.
derivedSpecific: null,
},
lab: {
key: 'lab',
label: 'A research lab',
blurb: 'Specimens, assays, cohorts, results — work that produces findings, not revenue.',
orgName: 'HLA Typing Lab',
mark: 'assets/lab-mark.svg?v=1',
modelLine: 'A high-resolution HLA typing lab: sequence-based typing feeding transplant '
+ 'matching, vaccine epitope work and humanized-mouse characterization.',
groups: [
{ label: 'Lab templates', items: [
{ id: 'typing', name: 'Typing', live: true,
desc: 'Specimens, runs, sequences and allele assignments — every call stamped with its method version and reference release.',
icon: DOM_IC.helix },
{ id: 'studies', name: 'Studies & Cohorts', live: false,
desc: 'Who requested typing, for which cohort, at what resolution — and what was published from it.',
icon: DOM_IC.clipboard },
{ id: 'matching', name: 'Matching', live: false,
desc: 'Donor–recipient pairs: match grade by locus, mismatch vector, DPB1 permissiveness.',
icon: DOM_IC.link },
{ id: 'ligands', name: 'Ligands & Epitopes', live: false,
desc: 'Eluted peptides mapped to their restricting allele, and population coverage for a candidate set.',
icon: DOM_IC.peptide },
{ id: 'animals', name: 'Animal Models', live: false,
desc: 'Transgene alleles, graft donor typing and chimerism — which animals are valid for which study.',
icon: DOM_IC.mouse },
{ id: 'method', name: 'Method & Validation', live: false,
desc: 'Method versions, concordance, first-pass success and proficiency testing over the life of the assay.',
icon: DOM_IC.badge },
] },
{ label: 'Project templates', items: [
{ id: 'reresolve', name: 'Reference Re-resolution', live: false,
desc: 'A new IMGT/HLA release lands — re-resolve the archive and report every call that changed.',
icon: DOM_IC.flask },
{ id: 'manuscript', name: 'Manuscript Support', live: false,
desc: 'The typing tables, frequencies and methods paragraph for a paper, generated from the model.',
icon: DOM_IC.doc },
] },
],
files: [
{ name: 'HLA-Assignments-2009-2026.csv', type: 'csv', bytes: 4180000 },
{ name: 'SBT-Run-Manifest.xlsx', type: 'xlsx', bytes: 386000 },
{ name: 'IMGT-HLA-Allelelist-3.60.0.txt', type: 'txt', bytes: 1240000 },
{ name: 'Study-Cohorts.xlsx', type: 'xlsx', bytes: 94000 },
{ name: 'KIR-Genotypes.csv', type: 'csv', bytes: 210000 },
{ name: 'sequence-traces.zip', type: 'zip', bytes: 88400000 },
],
uploadHint: 'Assignment exports, run manifests, reference releases, trace archives',
sourceNoun: 'your assignment history and run manifests',
onboard: {
title: 'Build your Typing hub',
body: 'Upload your assignment history, run manifests and the reference release you call against. '
+ 'Claude reads them and builds the data products below — every allele call traced to the run '
+ 'and the release that produced it, nothing invented.',
},
products: [
['Assignment Ledger', 'Every call, stamped with method version & IMGT release'],
['Ambiguity Queue', 'What needs a human at the trace vs. resolvable by convention'],
['Re-resolution Diff', 'New release → which subjects’ calls actually changed'],
['KIR–HLA Ligand Pairing', 'C1/C2, Bw4/Bw6 and KIR genotype, derived'],
['Cohort Allele Frequencies', 'By study and self-reported population'],
['Match Grades', '8/8, 10/10, 12/12 + DPB1 permissiveness per pair'],
['Method Performance', 'Concordance & first-pass rate by locus and version'],
['QC & Proficiency Trend', 'PT results, discordances, reagent-lot effects'],
],
// What Claude proposes after reading the lab's sources. All Draft — these are
// exactly the judgments a supervisor has to confirm or throw out, which is the
// point of the human-in-the-loop step.
derivedSpecific: [
{ title: 'Pre-2014 calls came off the earlier primer set',
judgment: 'Assignments from method v1 (2009–2013) used the pre-v2 primer set, where DRB1 exon 2 first-pass success was materially lower. Read the historical ambiguity rate as a property of the method, not of sample quality — and do not compare it to post-v2 performance without splitting on version.',
affects: ['Assignment Ledger', 'Method Performance'], owner: 'Lab supervisor', status: 'Draft',
derivedFrom: 'How it is normally built' },
{ title: 'DPB1 phase ambiguity is expected, not a failure',
judgment: 'For heterozygotes, cis/trans phase ambiguity at DPB1 is inherent to sequence-based typing. Route it to allele-specific amplification rather than flagging the run as failed or escalating it as a discordance.',
affects: ['Ambiguity Queue', 'Match Grades'], owner: 'Lab supervisor', status: 'Draft',
derivedFrom: 'SBT vs. NGS' },
{ title: 'The 3.60.0 diff is renaming, not re-typing',
judgment: 'Re-resolving the archive against the current release changes the names of alleles already called, and expands some ambiguity strings. Report it as a nomenclature diff; only a change in the resolved allele pair means the subject’s type actually changed.',
affects: ['Re-resolution Diff', 'Assignment Ledger'], owner: 'Lab supervisor', status: 'Draft',
derivedFrom: 'Checks that must always hold' },
{ title: 'Consent scope differs by study — check before reuse',
judgment: 'Some cohorts permit secondary use of their typing and some do not, so the archive is not uniformly reusable. Treat consent scope as a property of the study, and gate cross-study frequency work on it.',
affects: ['Cohort Allele Frequencies', 'Studies & Cohorts'], owner: 'Lab supervisor', status: 'Draft',
derivedFrom: 'The data products it typically holds' },
],
// ── The built workspace ────────────────────────────────────────────────
// Same three tiers as Cascade Ridge: two hubs built and in use, the rest
// shaded as identified-but-not-built. Present so the lab is a working
// workspace rather than only an onboarding walkthrough.
built: {
rail: [
{ key: 'assay', label: 'Assay', abbr: 'ASSAY', hubs: ['Typing'] },
{ key: 'studies', label: 'Studies', abbr: 'STDY', hubs: ['Studies & Cohorts'] },
],
hubs: [
{ tier: 'active', id: 'Typing', name: 'Typing', live: true,
desc: 'Specimens, runs and allele assignments — every call re-derivable against the current release.',
icon: DOM_IC.helix },
{ tier: 'active', id: 'Studies & Cohorts', name: 'Studies & Cohorts', live: true,
desc: 'Who asked, for which cohort, at what resolution — and whether it can be reused.',
icon: DOM_IC.clipboard },
{ tier: 'planned', id: 'matching', name: 'Matching',
desc: 'Donor–recipient pairs: match grade by locus, mismatch vector, DPB1 permissiveness.',
icon: DOM_IC.link },
{ tier: 'planned', id: 'method', name: 'Method & Validation',
desc: 'Concordance, first-pass success and proficiency testing over the life of the assay.',
icon: DOM_IC.badge },
{ tier: 'planned', id: 'ligands', name: 'Ligands & Epitopes',
desc: 'Eluted peptides mapped to their restricting allele, and coverage for a candidate set.',
icon: DOM_IC.peptide },
{ tier: 'planned', id: 'animals', name: 'Animal Models',
desc: 'Transgene alleles, graft donor typing and chimerism — which animals suit which study.',
icon: DOM_IC.mouse },
],
// Same row shapes as the Cascade Ridge constants in workspace.jsx, so the
// Team and Org tabs render these without any change to those components.
emailDomain: 'hlalab.org',
team: [
{ id: 'LAB-01', name: 'Steven Cate', title: 'HLA Typing Lab Supervisor', role: 'owner', you: true,
photo: 'assets/avatar.jpg', hubs: ['Typing', 'Studies & Cohorts'], seen: 'Active now', seenTs: 100 },
{ id: 'LAB-02', name: 'Wren Okonkwo', title: 'Principal Investigator', role: 'admin',
hubs: ['Typing', 'Studies & Cohorts'], seen: '2 hours ago', seenTs: 95 },
{ id: 'LAB-03', name: 'Maya Iyer', title: 'Medical Technologist · Sequencing', role: 'editor',
hubs: ['Typing'], seen: 'Active now', seenTs: 98 },
{ id: 'LAB-04', name: 'Dara Halloran', title: 'Medical Technologist · Resolution', role: 'editor',
hubs: ['Typing'], seen: 'Yesterday', seenTs: 88 },
{ id: 'LAB-05', name: 'Priya Vasquez', title: 'Bioinformatician', role: 'editor',
hubs: ['Typing'], seen: 'Yesterday', seenTs: 86 },
{ id: 'LAB-06', name: 'Rune Lindqvist', title: 'Study Coordinator', role: 'editor',
hubs: ['Studies & Cohorts'], seen: '3 days ago', seenTs: 78 },
{ id: 'LAB-07', name: 'Tomas Beringer', title: 'Vivarium Manager', role: 'viewer',
hubs: [], seen: '2 weeks ago', seenTs: 60 },
{ id: 'LAB-08', name: 'Hana Petit', title: 'Registry Liaison', role: 'viewer', pending: true,
hubs: ['Studies & Cohorts'], seen: null, seenTs: null },
],
// One root, like Cascade Ridge's Executive Office — the chart renders a
// single tree.
org: [
{ id: 'GRP-01', dept: 'Laboratory', parent: null, head: 'LAB-02', focus: 'The lab and its research program', hc: 12 },
{ id: 'GRP-02', dept: 'Typing Core', parent: 'GRP-01', head: 'LAB-01', focus: 'The assay of record', hc: 5, hub: 'Typing' },
{ id: 'GRP-03', dept: 'Sequencing', parent: 'GRP-02', head: 'LAB-03', focus: 'Runs, reagent lots, instruments', hc: 2 },
{ id: 'GRP-04', dept: 'Resolution', parent: 'GRP-02', head: 'LAB-04', focus: 'Ambiguity at the bench', hc: 1 },
{ id: 'GRP-05', dept: 'Bioinformatics', parent: 'GRP-02', head: 'LAB-05', focus: 'Calling & re-resolution', hc: 1 },
{ id: 'GRP-06', dept: 'Study Coordination', parent: 'GRP-01', head: 'LAB-06', focus: 'Consent, manifests, delivery', hc: 1, hub: 'Studies & Cohorts' },
{ id: 'GRP-07', dept: 'Vivarium', parent: 'GRP-01', head: 'LAB-07', focus: 'Humanized mouse colonies', hc: 2 },
],
about: 'A high-resolution HLA typing lab. Sequence-based typing feeds transplant '
+ 'matching, vaccine epitope work and humanized-mouse characterization — the same '
+ 'assignments read three different ways, which is why they are modelled once.',
},
},
};
const PROXA_DOMAIN_ORDER = ['company', 'lab'];
function proxaDomain(key) {
return PROXA_DOMAINS[key] || PROXA_DOMAINS.company;
}
// The workspace's identity mark — each workspace reads as itself in the rail,
// the banner and the switcher.
function proxaMark(key) {
return proxaDomain(key).mark;
}
window.PROXA_DOMAINS = PROXA_DOMAINS;
window.PROXA_DOMAIN_ORDER = PROXA_DOMAIN_ORDER;
window.proxaDomain = proxaDomain;
window.proxaMark = proxaMark;