@inflexa-ai/harness 0.35.7 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/types.d.ts +5 -14
- package/dist/auth/types.js +3 -10
- package/dist/billing/usage-recorder.d.ts +1 -1
- package/dist/contracts/analogy-report.d.ts +1 -1
- package/dist/contracts/analogy-report.js +1 -1
- package/dist/contracts/chat-parts.d.ts +2 -3
- package/dist/contracts/index.d.ts +0 -4
- package/dist/contracts/index.js +0 -2
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -21
- package/dist/lib/metrics.d.ts +1 -1
- package/dist/lib/otel-spans.d.ts +0 -2
- package/dist/lib/otel-spans.js +0 -2
- package/dist/loop/genai-spans.d.ts +20 -0
- package/dist/loop/genai-spans.js +53 -0
- package/dist/loop/run-agent.d.ts +1 -1
- package/dist/loop/run-agent.js +9 -4
- package/dist/providers/ai-sdk.js +8 -0
- package/dist/runtime/assemble.d.ts +0 -3
- package/dist/runtime/assemble.js +0 -3
- package/dist/state/index.d.ts +0 -2
- package/dist/state/index.js +0 -1
- package/dist/state/init.js +1 -60
- package/dist/state/purge-analysis.d.ts +1 -2
- package/dist/state/purge-analysis.js +1 -2
- package/dist/tasks/regulatory-corpus-boot-refresh.js +1 -1
- package/dist/tools/bio/gene-preclinical-profile.d.ts +1 -3
- package/dist/tools/bio/gene-preclinical-profile.js +1 -3
- package/dist/tools/lib/chembl-client.d.ts +1 -4
- package/dist/tools/lib/chembl-client.js +1 -4
- package/dist/tools/lib/clinical-benchmarks-client.d.ts +1 -1
- package/dist/tools/lib/clinical-benchmarks-client.js +1 -1
- package/dist/tools/lib/clinical-trials-client.d.ts +0 -3
- package/dist/tools/lib/clinical-trials-client.js +0 -3
- package/dist/tools/lib/identifier-resolver.d.ts +5 -7
- package/dist/tools/lib/identifier-resolver.js +5 -7
- package/dist/tools/lib/iuphar-client.d.ts +1 -3
- package/dist/tools/lib/iuphar-client.js +1 -3
- package/dist/tools/lib/opentargets-client.d.ts +1 -1
- package/dist/tools/lib/opentargets-client.js +1 -1
- package/dist/tools/lib/protein-family-normalize.d.ts +5 -7
- package/dist/tools/lib/protein-family-normalize.js +5 -7
- package/dist/tools/lib/uniprot-client.d.ts +0 -7
- package/dist/tools/lib/uniprot-client.js +2 -9
- package/package.json +9 -8
- package/dist/contracts/target-assessment-row.d.ts +0 -85
- package/dist/contracts/target-assessment-row.js +0 -37
- package/dist/contracts/target-dossier.d.ts +0 -12423
- package/dist/contracts/target-dossier.js +0 -1282
- package/dist/prompts/target-assessment/briefs/executive-recommendation.d.ts +0 -1
- package/dist/prompts/target-assessment/briefs/executive-recommendation.js +0 -85
- package/dist/prompts/target-assessment/briefs/index.d.ts +0 -4
- package/dist/prompts/target-assessment/briefs/index.js +0 -4
- package/dist/prompts/target-assessment/briefs/liability-bullets.d.ts +0 -1
- package/dist/prompts/target-assessment/briefs/liability-bullets.js +0 -114
- package/dist/prompts/target-assessment/briefs/target-organ-liabilities.d.ts +0 -1
- package/dist/prompts/target-assessment/briefs/target-organ-liabilities.js +0 -37
- package/dist/prompts/target-assessment/briefs/translational-commentary.d.ts +0 -1
- package/dist/prompts/target-assessment/briefs/translational-commentary.js +0 -23
- package/dist/prompts/target-assessment/drugs-in-class.d.ts +0 -1
- package/dist/prompts/target-assessment/drugs-in-class.js +0 -29
- package/dist/prompts/target-assessment/investigation/adversarial-critique.d.ts +0 -1
- package/dist/prompts/target-assessment/investigation/adversarial-critique.js +0 -67
- package/dist/prompts/target-assessment/investigation/claim-reverification.d.ts +0 -1
- package/dist/prompts/target-assessment/investigation/claim-reverification.js +0 -49
- package/dist/prompts/target-assessment/investigation/index.d.ts +0 -3
- package/dist/prompts/target-assessment/investigation/index.js +0 -3
- package/dist/prompts/target-assessment/investigation/mechanism-proposal.d.ts +0 -1
- package/dist/prompts/target-assessment/investigation/mechanism-proposal.js +0 -49
- package/dist/prompts/target-assessment/modulator-triage.d.ts +0 -1
- package/dist/prompts/target-assessment/modulator-triage.js +0 -31
- package/dist/prompts/target-assessment/off-target-annotator.d.ts +0 -1
- package/dist/prompts/target-assessment/off-target-annotator.js +0 -28
- package/dist/prompts/target-assessment/tox-voice/core.d.ts +0 -1
- package/dist/prompts/target-assessment/tox-voice/core.js +0 -74
- package/dist/prompts/target-assessment/tox-voice/critique.d.ts +0 -7
- package/dist/prompts/target-assessment/tox-voice/critique.js +0 -109
- package/dist/prompts/target-assessment/tox-voice/exemplars.d.ts +0 -8
- package/dist/prompts/target-assessment/tox-voice/exemplars.js +0 -24
- package/dist/prompts/target-assessment/tox-voice/index.d.ts +0 -4
- package/dist/prompts/target-assessment/tox-voice/index.js +0 -4
- package/dist/prompts/target-assessment/tox-voice/vocabulary.d.ts +0 -18
- package/dist/prompts/target-assessment/tox-voice/vocabulary.js +0 -61
- package/dist/state/target-assessments.d.ts +0 -68
- package/dist/state/target-assessments.js +0 -222
- package/dist/workflows/execute-target-assessment.d.ts +0 -118
- package/dist/workflows/execute-target-assessment.js +0 -631
- package/dist/workflows/target-assessment/assemblers/index.d.ts +0 -5
- package/dist/workflows/target-assessment/assemblers/index.js +0 -4
- package/dist/workflows/target-assessment/assemblers/literature.d.ts +0 -281
- package/dist/workflows/target-assessment/assemblers/literature.js +0 -971
- package/dist/workflows/target-assessment/assemblers/orchestrator.d.ts +0 -118
- package/dist/workflows/target-assessment/assemblers/orchestrator.js +0 -945
- package/dist/workflows/target-assessment/assemblers/safety.d.ts +0 -374
- package/dist/workflows/target-assessment/assemblers/safety.js +0 -1068
- package/dist/workflows/target-assessment/assemblers/trials.d.ts +0 -30
- package/dist/workflows/target-assessment/assemblers/trials.js +0 -75
- package/dist/workflows/target-assessment/collectors/index.d.ts +0 -114
- package/dist/workflows/target-assessment/collectors/index.js +0 -538
- package/dist/workflows/target-assessment/coverage.d.ts +0 -97
- package/dist/workflows/target-assessment/coverage.js +0 -86
- package/dist/workflows/target-assessment/decisions/index.d.ts +0 -86
- package/dist/workflows/target-assessment/decisions/index.js +0 -127
- package/dist/workflows/target-assessment/fanout/index.d.ts +0 -32
- package/dist/workflows/target-assessment/fanout/index.js +0 -156
- package/dist/workflows/target-assessment/investigation/index.d.ts +0 -97
- package/dist/workflows/target-assessment/investigation/index.js +0 -419
- package/dist/workflows/target-assessment/lib/approval-precedents.d.ts +0 -73
- package/dist/workflows/target-assessment/lib/approval-precedents.js +0 -185
- package/dist/workflows/target-assessment/lib/citation-validator.d.ts +0 -46
- package/dist/workflows/target-assessment/lib/citation-validator.js +0 -316
- package/dist/workflows/target-assessment/lib/clinical-consequence-annotator.d.ts +0 -65
- package/dist/workflows/target-assessment/lib/clinical-consequence-annotator.js +0 -174
- package/dist/workflows/target-assessment/lib/clinical-evidence-attribution.d.ts +0 -44
- package/dist/workflows/target-assessment/lib/clinical-evidence-attribution.js +0 -152
- package/dist/workflows/target-assessment/lib/compute-derived.d.ts +0 -20
- package/dist/workflows/target-assessment/lib/compute-derived.js +0 -261
- package/dist/workflows/target-assessment/lib/compute-selectivity.d.ts +0 -15
- package/dist/workflows/target-assessment/lib/compute-selectivity.js +0 -18
- package/dist/workflows/target-assessment/lib/dedup-modulators.d.ts +0 -37
- package/dist/workflows/target-assessment/lib/dedup-modulators.js +0 -157
- package/dist/workflows/target-assessment/lib/evidence-conflict-detector.d.ts +0 -17
- package/dist/workflows/target-assessment/lib/evidence-conflict-detector.js +0 -100
- package/dist/workflows/target-assessment/lib/expression-constants.d.ts +0 -21
- package/dist/workflows/target-assessment/lib/expression-constants.js +0 -21
- package/dist/workflows/target-assessment/lib/family-complex-supplement.d.ts +0 -20
- package/dist/workflows/target-assessment/lib/family-complex-supplement.js +0 -36
- package/dist/workflows/target-assessment/lib/fda-label-safety.d.ts +0 -72
- package/dist/workflows/target-assessment/lib/fda-label-safety.js +0 -166
- package/dist/workflows/target-assessment/lib/heterodimer-filter.d.ts +0 -30
- package/dist/workflows/target-assessment/lib/heterodimer-filter.js +0 -44
- package/dist/workflows/target-assessment/lib/hpo-organ-map.d.ts +0 -34
- package/dist/workflows/target-assessment/lib/hpo-organ-map.js +0 -63
- package/dist/workflows/target-assessment/lib/impc-organ-map.d.ts +0 -19
- package/dist/workflows/target-assessment/lib/impc-organ-map.js +0 -39
- package/dist/workflows/target-assessment/lib/intended-polypharm-filter.d.ts +0 -4
- package/dist/workflows/target-assessment/lib/intended-polypharm-filter.js +0 -24
- package/dist/workflows/target-assessment/lib/llm-step.d.ts +0 -80
- package/dist/workflows/target-assessment/lib/llm-step.js +0 -101
- package/dist/workflows/target-assessment/lib/meddra-organ-map.d.ts +0 -40
- package/dist/workflows/target-assessment/lib/meddra-organ-map.js +0 -138
- package/dist/workflows/target-assessment/lib/recommendation-quality-gates.d.ts +0 -17
- package/dist/workflows/target-assessment/lib/recommendation-quality-gates.js +0 -99
- package/dist/workflows/target-assessment/lib/recommendation-sanitizer.d.ts +0 -2
- package/dist/workflows/target-assessment/lib/recommendation-sanitizer.js +0 -51
- package/dist/workflows/target-assessment/lib/regulatory-actions.d.ts +0 -25
- package/dist/workflows/target-assessment/lib/regulatory-actions.js +0 -176
- package/dist/workflows/target-assessment/lib/safety-corroboration.d.ts +0 -44
- package/dist/workflows/target-assessment/lib/safety-corroboration.js +0 -273
- package/dist/workflows/target-assessment/lib/structured-llm.d.ts +0 -61
- package/dist/workflows/target-assessment/lib/structured-llm.js +0 -102
- package/dist/workflows/target-assessment/lib/target-identity-filter.d.ts +0 -59
- package/dist/workflows/target-assessment/lib/target-identity-filter.js +0 -95
- package/dist/workflows/target-assessment/lib/therapeutic-programs.d.ts +0 -20
- package/dist/workflows/target-assessment/lib/therapeutic-programs.js +0 -68
- package/dist/workflows/target-assessment/metrics.d.ts +0 -16
- package/dist/workflows/target-assessment/metrics.js +0 -30
- package/dist/workflows/target-assessment/phase4-assemble.d.ts +0 -3182
- package/dist/workflows/target-assessment/phase4-assemble.js +0 -39
- package/dist/workflows/target-assessment/phase5-persist.d.ts +0 -59
- package/dist/workflows/target-assessment/phase5-persist.js +0 -349
- package/dist/workflows/target-assessment/progress-stream.d.ts +0 -75
- package/dist/workflows/target-assessment/progress-stream.js +0 -110
- package/dist/workflows/target-assessment/progress.d.ts +0 -39
- package/dist/workflows/target-assessment/progress.js +0 -77
- package/dist/workflows/target-assessment/schemas.d.ts +0 -970
- package/dist/workflows/target-assessment/schemas.js +0 -318
- package/dist/workflows/target-assessment/steps/collectors/pathways.d.ts +0 -15
- package/dist/workflows/target-assessment/steps/collectors/pathways.js +0 -58
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-class-drug-step.d.ts +0 -34
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-class-drug-step.js +0 -31
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-trial-step.d.ts +0 -57
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-trial-step.js +0 -54
- package/dist/workflows/target-assessment/steps/fanout/faers-for-one-modulator-step.d.ts +0 -35
- package/dist/workflows/target-assessment/steps/fanout/faers-for-one-modulator-step.js +0 -32
- package/dist/workflows/target-assessment/steps/fanout/index.d.ts +0 -14
- package/dist/workflows/target-assessment/steps/fanout/index.js +0 -10
- package/dist/workflows/target-assessment/steps/fanout/polypharm-for-one-modulator-step.d.ts +0 -29
- package/dist/workflows/target-assessment/steps/fanout/polypharm-for-one-modulator-step.js +0 -29
- package/dist/workflows/target-assessment/steps/phase2-aggregate.d.ts +0 -657
- package/dist/workflows/target-assessment/steps/phase2-aggregate.js +0 -34
- package/dist/workflows/target-assessment/steps/phase3-aggregate.d.ts +0 -806
- package/dist/workflows/target-assessment/steps/phase3-aggregate.js +0 -16
- package/dist/workflows/target-assessment/steps/synthesis/diagnostics.d.ts +0 -28
- package/dist/workflows/target-assessment/steps/synthesis/diagnostics.js +0 -27
- package/dist/workflows/target-assessment/sub-workflows/index.d.ts +0 -15
- package/dist/workflows/target-assessment/sub-workflows/index.js +0 -11
- package/dist/workflows/target-assessment/sub-workflows/per-class-drug-aes.d.ts +0 -41
- package/dist/workflows/target-assessment/sub-workflows/per-class-drug-aes.js +0 -12
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-faers.d.ts +0 -41
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-faers.js +0 -12
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-polypharm.d.ts +0 -37
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-polypharm.js +0 -12
- package/dist/workflows/target-assessment/sub-workflows/per-trial-aes.d.ts +0 -66
- package/dist/workflows/target-assessment/sub-workflows/per-trial-aes.js +0 -12
- package/dist/workflows/target-assessment/synthesis/index.d.ts +0 -607
- package/dist/workflows/target-assessment/synthesis/index.js +0 -354
- package/dist/workflows/target-assessment/synthesis-probes.d.ts +0 -56
- package/dist/workflows/target-assessment/synthesis-probes.js +0 -320
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trial-attribution classifier + UniProt-backed identity resolvers.
|
|
3
|
-
*
|
|
4
|
-
* `resolveOnTargetChemblIds` and `resolveFamilySiblingUniprots` fetch from
|
|
5
|
-
* authoritative sources at assembly time — UniProt for ChEMBL cross-references,
|
|
6
|
-
* IUPHAR Guide to Pharmacology for receptor-family siblings — so assessing a
|
|
7
|
-
* new HGNC target needs no per-target curation here.
|
|
8
|
-
*
|
|
9
|
-
* The actual loop-level checks (`isOnTargetChemblId` etc.) take the
|
|
10
|
-
* resolved arrays as plain inputs so the per-row assembly path stays
|
|
11
|
-
* synchronous after a single upfront await.
|
|
12
|
-
*/
|
|
13
|
-
import type { Logger } from "../../../lib/logger.js";
|
|
14
|
-
export type TrialAttributionInput = {
|
|
15
|
-
assessmentUniprot: string;
|
|
16
|
-
/** UniProts of related family receptors (resolved from IUPHAR family siblings). */
|
|
17
|
-
familyUniprots: string[];
|
|
18
|
-
interventions: Array<{
|
|
19
|
-
drugChemblId: string | null;
|
|
20
|
-
name: string;
|
|
21
|
-
}>;
|
|
22
|
-
conditions: string[];
|
|
23
|
-
drugTargetResolver: (chemblId: string) => Promise<string[]>;
|
|
24
|
-
};
|
|
25
|
-
export type TrialAttributionResult = {
|
|
26
|
-
match_confidence: "high" | "low" | "off_target";
|
|
27
|
-
intervention_target_uniprots: string[];
|
|
28
|
-
related_target_uniprots: string[];
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Classify how strongly a trial pertains to the assessment target based on
|
|
32
|
-
* the intervention drug's mechanism target.
|
|
33
|
-
*/
|
|
34
|
-
export declare function classifyTrialAttribution(input: TrialAttributionInput): Promise<TrialAttributionResult>;
|
|
35
|
-
/**
|
|
36
|
-
* Resolve every ChEMBL target id that UniProt links to the given accession.
|
|
37
|
-
* The result is used as a positive list for on-target self-hit detection —
|
|
38
|
-
* a polypharm row whose off_target_id is in this list is the assessment
|
|
39
|
-
* target itself (alternate ChEMBL entry), not an off-target liability.
|
|
40
|
-
*
|
|
41
|
-
* Returns [] when the accession is missing or UniProt has no ChEMBL xrefs.
|
|
42
|
-
* Network failures are surfaced as an empty list so the assembler degrades
|
|
43
|
-
* to "no alternate-id filtering" rather than blocking the run.
|
|
44
|
-
*/
|
|
45
|
-
export declare function resolveOnTargetChemblIds(assessmentUniprot: string, logger?: Logger): Promise<string[]>;
|
|
46
|
-
/**
|
|
47
|
-
* Resolve UniProt accessions of sibling receptors in the same IUPHAR family
|
|
48
|
-
* as the assessment target. Used by `classifyTrialAttribution` so a trial
|
|
49
|
-
* whose intervention hits a paralog (e.g., CALCRL when CALCR is the
|
|
50
|
-
* assessment target) lands in the related bucket rather than the
|
|
51
|
-
* primary trials list.
|
|
52
|
-
*/
|
|
53
|
-
export declare function resolveFamilySiblingUniprots(uniprotOrGeneSymbol: string, logger?: Logger): Promise<string[]>;
|
|
54
|
-
/**
|
|
55
|
-
* Returns true if `chemblId` is among the supplied list of on-target ChEMBL
|
|
56
|
-
* ids for the assessment protein. Caller is responsible for resolving the
|
|
57
|
-
* list once via `resolveOnTargetChemblIds` and reusing it across rows.
|
|
58
|
-
*/
|
|
59
|
-
export declare function isOnTargetChemblId(chemblId: string, onTargetChemblIds: string[]): boolean;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trial-attribution classifier + UniProt-backed identity resolvers.
|
|
3
|
-
*
|
|
4
|
-
* `resolveOnTargetChemblIds` and `resolveFamilySiblingUniprots` fetch from
|
|
5
|
-
* authoritative sources at assembly time — UniProt for ChEMBL cross-references,
|
|
6
|
-
* IUPHAR Guide to Pharmacology for receptor-family siblings — so assessing a
|
|
7
|
-
* new HGNC target needs no per-target curation here.
|
|
8
|
-
*
|
|
9
|
-
* The actual loop-level checks (`isOnTargetChemblId` etc.) take the
|
|
10
|
-
* resolved arrays as plain inputs so the per-row assembly path stays
|
|
11
|
-
* synchronous after a single upfront await.
|
|
12
|
-
*/
|
|
13
|
-
import { createNoopLogger } from "../../../lib/console-logger.js";
|
|
14
|
-
import { withHost } from "../../../lib/host-concurrency.js";
|
|
15
|
-
import { getFamilySiblingUniprots } from "../../../tools/lib/iuphar-client.js";
|
|
16
|
-
import { getChemblIdsByUniProt } from "../../../tools/lib/uniprot-client.js";
|
|
17
|
-
/**
|
|
18
|
-
* Classify how strongly a trial pertains to the assessment target based on
|
|
19
|
-
* the intervention drug's mechanism target.
|
|
20
|
-
*/
|
|
21
|
-
export async function classifyTrialAttribution(input) {
|
|
22
|
-
const interventionTargets = new Set();
|
|
23
|
-
for (const iv of input.interventions) {
|
|
24
|
-
if (!iv.drugChemblId)
|
|
25
|
-
continue;
|
|
26
|
-
const accs = await input.drugTargetResolver(iv.drugChemblId);
|
|
27
|
-
for (const a of accs)
|
|
28
|
-
interventionTargets.add(a);
|
|
29
|
-
}
|
|
30
|
-
const intervention_target_uniprots = [...interventionTargets];
|
|
31
|
-
const hitsAssessment = interventionTargets.has(input.assessmentUniprot);
|
|
32
|
-
const related_target_uniprots = [...interventionTargets].filter((a) => input.familyUniprots.includes(a) && a !== input.assessmentUniprot);
|
|
33
|
-
if (hitsAssessment) {
|
|
34
|
-
return { match_confidence: "high", intervention_target_uniprots, related_target_uniprots };
|
|
35
|
-
}
|
|
36
|
-
if (related_target_uniprots.length > 0) {
|
|
37
|
-
return { match_confidence: "off_target", intervention_target_uniprots, related_target_uniprots };
|
|
38
|
-
}
|
|
39
|
-
return { match_confidence: "low", intervention_target_uniprots, related_target_uniprots };
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Resolve every ChEMBL target id that UniProt links to the given accession.
|
|
43
|
-
* The result is used as a positive list for on-target self-hit detection —
|
|
44
|
-
* a polypharm row whose off_target_id is in this list is the assessment
|
|
45
|
-
* target itself (alternate ChEMBL entry), not an off-target liability.
|
|
46
|
-
*
|
|
47
|
-
* Returns [] when the accession is missing or UniProt has no ChEMBL xrefs.
|
|
48
|
-
* Network failures are surfaced as an empty list so the assembler degrades
|
|
49
|
-
* to "no alternate-id filtering" rather than blocking the run.
|
|
50
|
-
*/
|
|
51
|
-
export async function resolveOnTargetChemblIds(assessmentUniprot, logger) {
|
|
52
|
-
if (!assessmentUniprot)
|
|
53
|
-
return [];
|
|
54
|
-
try {
|
|
55
|
-
return await withHost("uniprot", () => getChemblIdsByUniProt(assessmentUniprot));
|
|
56
|
-
}
|
|
57
|
-
catch (err) {
|
|
58
|
-
// UniProt answers an unknown accession with a 404, and the client maps that
|
|
59
|
-
// to an empty record. Thus a throw here is always an unexpected cause, and
|
|
60
|
-
// the empty list silently turns off the self-hit filter of the panel.
|
|
61
|
-
const log = (logger ?? createNoopLogger()).named("ta-identity.on-target-chembl");
|
|
62
|
-
log.error("UniProt ChEMBL cross-reference lookup failed", { uniprot: assessmentUniprot, ...log.errorFields(err) });
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Resolve UniProt accessions of sibling receptors in the same IUPHAR family
|
|
68
|
-
* as the assessment target. Used by `classifyTrialAttribution` so a trial
|
|
69
|
-
* whose intervention hits a paralog (e.g., CALCRL when CALCR is the
|
|
70
|
-
* assessment target) lands in the related bucket rather than the
|
|
71
|
-
* primary trials list.
|
|
72
|
-
*/
|
|
73
|
-
export async function resolveFamilySiblingUniprots(uniprotOrGeneSymbol, logger) {
|
|
74
|
-
if (!uniprotOrGeneSymbol)
|
|
75
|
-
return [];
|
|
76
|
-
const log = (logger ?? createNoopLogger()).named("ta-identity.family-siblings");
|
|
77
|
-
try {
|
|
78
|
-
return await withHost("iuphar", () => getFamilySiblingUniprots(uniprotOrGeneSymbol, log));
|
|
79
|
-
}
|
|
80
|
-
catch (err) {
|
|
81
|
-
// IUPHAR answers an unknown target with an empty list, thus a throw here is
|
|
82
|
-
// always an unexpected cause. The empty list then routes a paralog trial into
|
|
83
|
-
// the primary trials list, which is the defect that this resolver prevents.
|
|
84
|
-
log.error("IUPHAR family-sibling lookup failed", { query: uniprotOrGeneSymbol, ...log.errorFields(err) });
|
|
85
|
-
return [];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Returns true if `chemblId` is among the supplied list of on-target ChEMBL
|
|
90
|
-
* ids for the assessment protein. Caller is responsible for resolving the
|
|
91
|
-
* list once via `resolveOnTargetChemblIds` and reusing it across rows.
|
|
92
|
-
*/
|
|
93
|
-
export function isOnTargetChemblId(chemblId, onTargetChemblIds) {
|
|
94
|
-
return onTargetChemblIds.includes(chemblId);
|
|
95
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { EvidenceItem } from "@inflexa-ai/harness/contracts/target-dossier.js";
|
|
2
|
-
export type TherapeuticProgramRow = {
|
|
3
|
-
programId: string;
|
|
4
|
-
name: string;
|
|
5
|
-
targetSymbol: string;
|
|
6
|
-
targetUniprot: string | null;
|
|
7
|
-
modality: string;
|
|
8
|
-
sponsor: string | null;
|
|
9
|
-
mechanism: string;
|
|
10
|
-
status: string;
|
|
11
|
-
nctIds: string[];
|
|
12
|
-
pmids: string[];
|
|
13
|
-
evidence: EvidenceItem[];
|
|
14
|
-
confidence: "high" | "medium" | "low";
|
|
15
|
-
};
|
|
16
|
-
export type TherapeuticProgramTarget = {
|
|
17
|
-
geneSymbol: string;
|
|
18
|
-
uniprot: string | null;
|
|
19
|
-
};
|
|
20
|
-
export declare function findTherapeuticProgramsForTarget(target: TherapeuticProgramTarget): TherapeuticProgramRow[];
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
const PROGRAM_REGISTRY = [
|
|
2
|
-
{
|
|
3
|
-
programId: "AL002",
|
|
4
|
-
name: "AL002",
|
|
5
|
-
targetSymbol: "TREM2",
|
|
6
|
-
targetUniprot: "Q9NZC2",
|
|
7
|
-
modality: "agonistic monoclonal antibody",
|
|
8
|
-
sponsor: "Alector",
|
|
9
|
-
mechanism: "TREM2 agonistic antibody intended to activate microglial TREM2 signaling",
|
|
10
|
-
status: "Phase 2 completed; negative efficacy result reported",
|
|
11
|
-
nctIds: ["NCT03635047", "NCT04592874"],
|
|
12
|
-
pmids: ["39444037", "41787076"],
|
|
13
|
-
confidence: "high",
|
|
14
|
-
evidence: [
|
|
15
|
-
{
|
|
16
|
-
source: "pubmed",
|
|
17
|
-
pmid: "39444037",
|
|
18
|
-
predicate: "phase_1_target_engagement",
|
|
19
|
-
is_human: true,
|
|
20
|
-
is_clinical: true,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
source: "pubmed",
|
|
24
|
-
pmid: "41787076",
|
|
25
|
-
predicate: "phase_2_negative_trial",
|
|
26
|
-
is_human: true,
|
|
27
|
-
is_clinical: true,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
source: "clinicaltrials.gov",
|
|
31
|
-
predicate: "registered_trial",
|
|
32
|
-
metadata: { nct_ids: ["NCT03635047", "NCT04592874"] },
|
|
33
|
-
is_human: true,
|
|
34
|
-
is_clinical: true,
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
programId: "VHB937",
|
|
40
|
-
name: "VHB937",
|
|
41
|
-
targetSymbol: "TREM2",
|
|
42
|
-
targetUniprot: "Q9NZC2",
|
|
43
|
-
modality: "TREM2-stabilizing monoclonal antibody",
|
|
44
|
-
sponsor: "Novartis",
|
|
45
|
-
mechanism: "TREM2 antibody program in early Alzheimer disease",
|
|
46
|
-
status: "Phase 2 recruiting",
|
|
47
|
-
nctIds: ["NCT07094516"],
|
|
48
|
-
pmids: [],
|
|
49
|
-
confidence: "medium",
|
|
50
|
-
evidence: [
|
|
51
|
-
{
|
|
52
|
-
source: "clinicaltrials.gov",
|
|
53
|
-
predicate: "registered_trial",
|
|
54
|
-
metadata: { nct_ids: ["NCT07094516"] },
|
|
55
|
-
is_human: true,
|
|
56
|
-
is_clinical: true,
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
];
|
|
61
|
-
export function findTherapeuticProgramsForTarget(target) {
|
|
62
|
-
const symbol = target.geneSymbol.toUpperCase();
|
|
63
|
-
return PROGRAM_REGISTRY.filter((program) => {
|
|
64
|
-
if (program.targetSymbol.toUpperCase() === symbol)
|
|
65
|
-
return true;
|
|
66
|
-
return Boolean(target.uniprot && program.targetUniprot === target.uniprot);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenTelemetry counters for the target-assessment DBOS workflow.
|
|
3
|
-
*
|
|
4
|
-
* Surfaces two signals:
|
|
5
|
-
* - `cortex.harness.ta.workflow.terminal_reason` — per terminal path; the
|
|
6
|
-
* alert in §16.5/§16.6 reads this. `reason` ∈ {completed,
|
|
7
|
-
* target-unresolved, schema-violation, derived-invariant-violation,
|
|
8
|
-
* unexpected-throw, suspended-on-402, operator-cancelled}.
|
|
9
|
-
* - billing cache_hit/_miss live in `harness/billing/target-assessment-resolver.ts`.
|
|
10
|
-
*
|
|
11
|
-
* Memoised meter so a re-imported module in tests doesn't recreate the
|
|
12
|
-
* instruments against the same MeterProvider (which would log noisy
|
|
13
|
-
* "duplicate instrument" warnings).
|
|
14
|
-
*/
|
|
15
|
-
export type TaTerminalReason = "completed" | "target-unresolved" | "schema-violation" | "derived-invariant-violation" | "unexpected-throw" | "suspended-on-402" | "operator-cancelled" | "deleted";
|
|
16
|
-
export declare function recordTerminalReason(reason: TaTerminalReason): void;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenTelemetry counters for the target-assessment DBOS workflow.
|
|
3
|
-
*
|
|
4
|
-
* Surfaces two signals:
|
|
5
|
-
* - `cortex.harness.ta.workflow.terminal_reason` — per terminal path; the
|
|
6
|
-
* alert in §16.5/§16.6 reads this. `reason` ∈ {completed,
|
|
7
|
-
* target-unresolved, schema-violation, derived-invariant-violation,
|
|
8
|
-
* unexpected-throw, suspended-on-402, operator-cancelled}.
|
|
9
|
-
* - billing cache_hit/_miss live in `harness/billing/target-assessment-resolver.ts`.
|
|
10
|
-
*
|
|
11
|
-
* Memoised meter so a re-imported module in tests doesn't recreate the
|
|
12
|
-
* instruments against the same MeterProvider (which would log noisy
|
|
13
|
-
* "duplicate instrument" warnings).
|
|
14
|
-
*/
|
|
15
|
-
import { metrics } from "@opentelemetry/api";
|
|
16
|
-
let _instruments;
|
|
17
|
-
function getInstruments() {
|
|
18
|
-
if (_instruments === undefined) {
|
|
19
|
-
const meter = metrics.getMeter("cortex.harness.ta");
|
|
20
|
-
_instruments = {
|
|
21
|
-
terminalReason: meter.createCounter("cortex.harness.ta.workflow.terminal_reason", {
|
|
22
|
-
description: "TA workflow terminal dispatches by reason (alert source)",
|
|
23
|
-
}),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
return _instruments;
|
|
27
|
-
}
|
|
28
|
-
export function recordTerminalReason(reason) {
|
|
29
|
-
getInstruments().terminalReason.add(1, { reason });
|
|
30
|
-
}
|