Skip to main content

Module affinity

Module affinity 

Source
Expand description

Session promotion (SPEC §8.4): start a continuing session on the rung it already needed.

[escalation.session_promotion] has been parseable — and exported from firstpass_core — since before this module existed, but nothing ever read it. A config that parses and does nothing is the same class of defect as a receipt that records $0.00: the file states one thing and the system does another, with no error to notice. This makes it real.

§What it buys

The escalation tax, measured at 18% of first-pass spend on MBPP: when turn 1 of a conversation escalates haiku → sonnet, turn 2 pays for the doomed haiku call all over again, and so does turn 3. A session that has demonstrated it needs the stronger rung should start there.

§What it must not become

A ratchet. Promotion on its own is one-way — a session that escalates once would stay expensive for its whole life, including the trivial turns at the end (“thanks, that worked”). So every probe_every turns the promotion is deliberately ignored and the request starts one rung lower. If that cheaper rung passes its gate, the promotion is released. That probe is the only way a promotion ever comes down, which is why it is not optional.

§What it cannot do

Lower quality. Like the bandit, this chooses only where the ladder starts; the gate still verifies whatever is served, and escalation still runs from wherever it started. A wrong promotion costs money, never correctness — and the probe bounds even that.

Structs§

Pin
Per-session state. Small and Copy-cheap; there is one of these per live session.
SessionPromoter
Tracks which sessions have earned a higher starting rung.

Enums§

Decision
What the router should do for this request.

Traits§

PromotionStore
Where promotion state lives.

Functions§

promotion_key
Key for a session’s promotion. Tenant first, and not optional: a session id is only unique inside a tenant, and one tenant’s traffic pattern is not a fact about another’s.