Graphorin API reference v0.4.0
Graphorin API reference / @graphorin/memory / / capInsightsBelowFacts
Function: capInsightsBelowFacts()
function capInsightsBelowFacts(factHits, insightHits): readonly MemoryHit<Insight>[];Defined in: packages/memory/src/tiers/insight-memory.ts:130
Enforce the P1-1 rank ceiling: an insight may never outrank a primary fact it cites. For each insight hit, if any fact it cites is present in factHits, its score is lowered to strictly below that cited fact's score — so concatenating the two lists and sorting by score descending can never place the insight above the evidence it was synthesized from. Insights whose cited facts are absent from factHits are returned unchanged; this is a relative, not a global, cap (per the execution plan: "never outrank the primary facts they cite").
Pure + deterministic — does not mutate its inputs.
Parameters
| Parameter | Type |
|---|---|
factHits | readonly MemoryHit<Fact>[] |
insightHits | readonly MemoryHit<Insight>[] |
Returns
readonly MemoryHit<Insight>[]