Skip to content
1 min read · 140 words

Function: floorTrustTier()

ts
function floorTrustTier<T>(parent: T, entry: T): T;

Defined in: src/batteries/llm/chat_common/helpers.ts:182

Clamp a stash entry's trust tier to its containing media's tier as a FLOOR: a stash entry may render at the parent's tier or LOWER (less trusted), never HIGHER.

Type Parameters

Type Parameter
T extends string

Parameters

ParameterType
parentT
entryT

Returns

T

Remarks

The committee's #1-ranked escalation: a third-party-private Media carrying a stash entry tagged first-party would otherwise render its fallback text in a <trusted_content_…> envelope (the media-fallback renderer keys the envelope off the entry's OWN tier). That lets untrusted content smuggle itself into the trusted tier. Flooring to the parent closes it: a child can de-escalate but never escalate above the asset it belongs to.