Skip to content

v5.15.0 - Context Signal-Over-Noise: ContextComposer + context_pack/blackboard_search MCP tools

Latest

Choose a tag to compare

@Jovancoding Jovancoding released this 06 Jul 21:15

v5.15.0 — Context Signal-Over-Noise

Agents have large context windows, but their effective reasoning window is smaller: irrelevant, stale, or noisy context degrades output quality long before the hard token limit ("context rot"). This release makes curated context a first-class primitive.

ContextComposer (lib/context-composer.ts)

Token-budgeted, relevance-ranked context assembly for any LLM call:

  • Ranking — every candidate entry is scored by relevance (pluggable BYOE SemanticRanker with a deterministic lexical-overlap fallback) x recency (exponential half-life decay) x scope affinity (ContextThrottler tag semantics).
  • Hard token budget — enforced via the new zero-dependency estimateTokens() heuristic; over-budget items are excluded with reasons.
  • Pinned sources — task-critical instructions and Layer-3 project context always lead the pack.
  • Staleness — TTL-expired entries are dropped automatically.
  • Position-aware layout — strongest items placed first and last ("lost in the middle" mitigation), serpentine ordering in between.
  • Full observability — included/excluded lists with per-item scores, token costs, and budget utilization.
  • createSemanticMemoryRanker() adapts an existing SemanticMemory; ContextComposer.fromSnapshot() converts blackboard snapshots.

Two new MCP tools (lib/mcp-tools-context.ts, registered by default — 24 tools total)

  • context_pack — "give me everything relevant to task X in <= N tokens": one call returns a curated, ranked, budget-enforced context brief from the agent's scoped blackboard snapshot. Use instead of blackboard_list + many blackboard_read calls.
  • blackboard_search — ranked top-K search over blackboard entries; semantic when a SemanticMemory is wired, lexical otherwise (mode reported in the response).

Works out of the box in Claude Code, OpenAI Codex, Gemini CLI, Cursor, and any other MCP client.

Testing

  • New test-phase19.ts (78 assertions): token estimation, ranking/budget/pinning/staleness/serpentine layout, semantic-ranker integration + failure fallback, both MCP tools including scoped snapshots and argument validation.
  • Full suite: 3,603 tests passing across 40 suites; tsc --noEmit clean.

Docs

  • README: context feature bullet, MCP tools list, test table, Gemini CLI callout, AGENTS.md row.
  • Consistency sweep: stale test counts fixed in CONTRIBUTING.md and SUPPLY_CHAIN.md; claude-project-prompt.md banner updated; SECURITY.md supported-versions tables move 5.15.x to current.