fable-agent/PHASES/phase-02-context-manager.md

27 lines
930 B
Markdown

# Phase 2: Context Manager
**Purpose:** Sliding window with summarization and priority-based pruning.
**TS Module:** `src/tier1-foundation/context-manager.ts`
## What It Does
Manages the agent's context window within budget constraints.
When the budget is exceeded:
1. Summarize lowest-priority entries (oldest 30% by priority score)
2. Drop entries that have already been summarized and remain low-priority
3. Never drop `critical` priority entries
## Priority Levels
| Priority | Weight | When to Use |
|----------|--------|-------------|
| critical | 100 | Current goal, task definition, rubric |
| high | 50 | Recent observations, active state |
| normal | 10 | Skill contents, historical context |
| low | 1 | Archived iterations, verbose logs |
## Usage
Context is managed automatically by the feedback loop. Add key information explicitly when needed via the TS engine or by writing directly to the context window.