docs(FN-4223): complete Step 3 — clarify research confidence and run semantics in JSDoc

Fusion-Task-Id: FN-4223
Fusion-Task-Lineage: bc114ff2-ee0f-4e96-b1d2-6ba3112a48e4
This commit is contained in:
Fusion
2026-05-13 05:00:09 -07:00
committed by gsxdsm
parent 930a424253
commit e01a21889a
2 changed files with 22 additions and 0 deletions

View File

@@ -200,6 +200,11 @@ function extractCitations(text: string, sources: ResearchSource[]): string[] {
return [...refs];
}
/**
* Extracts synthesis-emitted confidence (0-1) from model output.
* This is an LLM-provided signal for cited-research synthesis,
* not a statistical MAD confidence metric.
*/
function extractConfidence(text: string): number | undefined {
const jsonBlock = text.match(/```(?:json)?\s*([\s\S]*?)```/i)?.[1] ?? text;
try {