feat(context,infra): compression pipeline stages 4-5 — token pruning + relevance + ToMe
- build() is now suspend: pipeline runs all stages in fixed order, each gated by level - TOKEN_PRUNE (level 3): TokenPruner interface + LLMLingua-2 sidecar (sidecars/llmlingua) + HttpTokenPruner adapter (fails open if sidecar down); prunes freeform, preserves protected spans, skips tier-0 turns when TIER_SPLIT on - TOME_MERGE (level 8): ToMeMerger collapses near-duplicate freeform turns (Jaccard) - Stage 5 selection: RelevanceScorer + EmbeddingRelevanceScorer (cosine over Embedder); query-conditioned reorder so least-relevant freeform drops first under budget - [orchestration] compression_level + token_pruner_url config, wired in Main - suspend ripple fixed across builder callers/stubs
This commit is contained in:
@@ -68,7 +68,7 @@ import java.util.UUID
|
||||
class GraphRerouteTest {
|
||||
|
||||
private val passthroughBuilder = object : ContextPackBuilder {
|
||||
override fun build(
|
||||
override suspend fun build(
|
||||
id: ContextPackId,
|
||||
sessionId: SessionId,
|
||||
stageId: StageId,
|
||||
|
||||
@@ -68,7 +68,7 @@ class NeedsArtifactInjectionTest {
|
||||
private val capturedEntries = mutableListOf<ContextEntry>()
|
||||
|
||||
private val capturingBuilder = object : ContextPackBuilder {
|
||||
override fun build(
|
||||
override suspend fun build(
|
||||
id: ContextPackId,
|
||||
sessionId: SessionId,
|
||||
stageId: StageId,
|
||||
|
||||
@@ -63,7 +63,7 @@ class SteeringPreemptionTest {
|
||||
private val capturedEntries = mutableListOf<ContextEntry>()
|
||||
|
||||
private val capturingBuilder = object : ContextPackBuilder {
|
||||
override fun build(
|
||||
override suspend fun build(
|
||||
id: ContextPackId,
|
||||
sessionId: SessionId,
|
||||
stageId: StageId,
|
||||
|
||||
Reference in New Issue
Block a user