DashboardCodeLTM forSession() budget, phases, and sa…

LTM forSession() budget, phases, and safety-net constants

Category: architecture
Confidence: 0.90
ID: 019e54f5-04be-7a9f-9e62-177d65d5db9f
Project ID: ffa98226-3908-4f0c-936b-969018c62abf
Cross-project: No
Recalled in other projects: 4
Source session: (none)
Created: 2026-06-09 11:33:48
Updated: 2026-06-12 09:52:47

Cross-Project Recalls

ProjectHitsLast recalled
opencode-lore 20 2h ago
attaquer-framework 1 2026-06-11
zebar 1 2026-06-11
sshoq 1 2026-06-11

Content

LTM forSession() architecture: forSession() (ltm.ts) budgets: budget.ltm=0.05, budget.preferenceLtm=0.02. Phases: (1) architecture entries up to ARCH_BUDGET_FRACTION=0.2; (2) remaining by score desc; (3) .lore.md sections. HEADER_OVERHEAD_TOKENS=15 subtracted upfront. Hard cap: if (used+cost>maxTokens) continue. PROJECT_SAFETY_NET=5: top-confidence project entries ALWAYS included even with zero relevance score. NO_CONTEXT_FALLBACK_CAP=10. Global entries (pid=null) must be cross_project=1. Pool SQL: project pool uses cross_project=0; cross pool uses project_id IS NULL OR cross_project=1. Promoted entries (cross_project=1) lose PROJECT_SAFETY_NET guarantee in home project. GOTCHA: vectorSearch() queries knowledge WHERE embedding IS NOT NULL AND confidence>0.2 — test suites must DELETE FROM knowledge WHERE embedding IS NOT NULL in beforeEach. Dedup threshold for Nomic v1.5 is 0.935. system[1] (preferences+entities) cached once per session in stableLtmCache (never invalidated by curation). system[2] (context-bound) in ltmSessionCache — invalidated on idle resume, curation changes, session eviction, Layer 4.

Move to: