feat(context): add hot/warm/cold tiers and actor views #208

Closed
opened 2026-02-22 23:40:07 +00:00 by freemo · 3 comments
Owner

Metadata

  • Commit Message: feat(context): add hot/warm/cold tiers and actor views
  • Branch: feature/m6-context-tiers

Background

Context tiers (hot/warm/cold) are implemented with in-memory hot, SQLite warm, and file-backed cold storage. LRU eviction, promotion, and demotion move fragments between tiers. Per-actor context views (strategist/executor/reviewer) filter presentation by role.

Acceptance Criteria

  • Implement hot/warm/cold tiers with indexing, LRU eviction, and promotion/demotion.
  • Add tier storage backends (in-memory hot, sqlite warm, file-backed cold).
  • Add per-actor context views (strategist/executor/reviewer) and filtered presentation.
  • Add summarization hook when demoting to cold tier.
  • Enforce project-scoped filtering (ScopedBackendView) so actors never see resources outside the plan's project set.

Definition of Done

This issue is complete when:

  • All subtasks below are completed and checked off.
  • A Git commit is created where the first line of the commit message matches
    the Commit Message in Metadata exactly, followed by a blank line, then
    additional lines providing relevant details about the implementation. The
    commit body should be appropriate in size for a commit message and relatively
    complete in describing what was done.
  • The commit is pushed to the remote on the branch matching the Branch in
    Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and
    merged before this issue is marked done.

Subtasks

  • Implement hot/warm/cold tiers with indexing, LRU eviction, and promotion/demotion.
  • Add tier storage backends (in-memory hot, sqlite warm, file-backed cold).
  • Add per-actor context views (strategist/executor/reviewer) and filtered presentation.
  • Add summarization hook when demoting to cold tier.
  • Enforce project-scoped filtering (ScopedBackendView) so actors never see resources outside the plan's project set.
  • Add skeleton_ratio support to cap inherited context size for subplans.
  • Add tier budget settings (max_tokens_hot, max_decisions_warm, max_decisions_cold) and defaults per project.
  • Add deterministic ordering for tier retrieval (most-recent-first with stable tie-breakers).
  • Add cold-tier compaction job to merge adjacent summaries and cap file size.
  • Add metrics for tier hit/miss counts and expose via agents diagnostics.
  • Add docs/reference/context_tiers.md.
  • Document tier budgets, eviction rules, and summarization policy.
  • Tests (Behave): Add context tier scenarios.
  • Tests (Robot): Add context tier integration tests.
  • Tests (ASV): Add benchmarks/context_tiers_bench.py for tier lookup performance.
  • Verify coverage >=97% via nox -s coverage_report. If coverage is <97% then review the current unit test coverage report at build/coverage.xml and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun nox -s coverage_report to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.
  • Run nox (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.

Section: #### M6: Autonomy Hardening + Server Stubs (Day 30)
Status: Open

## Metadata - **Commit Message**: `feat(context): add hot/warm/cold tiers and actor views` - **Branch**: `feature/m6-context-tiers` ## Background Context tiers (hot/warm/cold) are implemented with in-memory hot, SQLite warm, and file-backed cold storage. LRU eviction, promotion, and demotion move fragments between tiers. Per-actor context views (strategist/executor/reviewer) filter presentation by role. ## Acceptance Criteria - [ ] Implement hot/warm/cold tiers with indexing, LRU eviction, and promotion/demotion. - [ ] Add tier storage backends (in-memory hot, sqlite warm, file-backed cold). - [ ] Add per-actor context views (strategist/executor/reviewer) and filtered presentation. - [ ] Add summarization hook when demoting to cold tier. - [ ] Enforce project-scoped filtering (ScopedBackendView) so actors never see resources outside the plan's project set. ## Definition of Done This issue is complete when: - All subtasks below are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. The commit body should be appropriate in size for a commit message and relatively complete in describing what was done. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. ## Subtasks - [ ] Implement hot/warm/cold tiers with indexing, LRU eviction, and promotion/demotion. - [ ] Add tier storage backends (in-memory hot, sqlite warm, file-backed cold). - [ ] Add per-actor context views (strategist/executor/reviewer) and filtered presentation. - [ ] Add summarization hook when demoting to cold tier. - [ ] Enforce project-scoped filtering (ScopedBackendView) so actors never see resources outside the plan's project set. - [ ] Add `skeleton_ratio` support to cap inherited context size for subplans. - [ ] Add tier budget settings (max_tokens_hot, max_decisions_warm, max_decisions_cold) and defaults per project. - [ ] Add deterministic ordering for tier retrieval (most-recent-first with stable tie-breakers). - [ ] Add cold-tier compaction job to merge adjacent summaries and cap file size. - [ ] Add metrics for tier hit/miss counts and expose via `agents diagnostics`. - [ ] Add `docs/reference/context_tiers.md`. - [ ] Document tier budgets, eviction rules, and summarization policy. - [ ] Tests (Behave): Add context tier scenarios. - [ ] Tests (Robot): Add context tier integration tests. - [ ] Tests (ASV): Add `benchmarks/context_tiers_bench.py` for tier lookup performance. - [ ] Verify coverage >=97% via `nox -s coverage_report`. If coverage is <97% then review the current unit test coverage report at `build/coverage.xml` and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun `nox -s coverage_report` to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%. - [ ] Run `nox` (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across **entire** code base, do not ignore any failure even if it seems unrelated to this commit, fix it. **Section**: #### M6: Autonomy Hardening + Server Stubs (Day 30) **Status**: Open
freemo added this to the v3.5.0 milestone 2026-02-22 23:40:07 +00:00
Author
Owner

Expected completion updated (Day 15 rebaseline): Day 35 / 2026-03-15 (previously Day 31 / 2026-03-11)

**Expected completion updated (Day 15 rebaseline):** Day 35 / 2026-03-15 (previously Day 31 / 2026-03-11)
freemo added the due date 2026-03-08 2026-02-23 18:41:41 +00:00
freemo self-assigned this 2026-02-24 21:53:38 +00:00
Author
Owner

Closing: code merged to master via commit 6519f140 (feat(context): add hot/warm/cold tiers and actor views, 2026-03-03). State/Completed label was already applied. Duplicate tracking issue #530 was also created and closed for this same work.

Closing: code merged to master via commit `6519f140` (feat(context): add hot/warm/cold tiers and actor views, 2026-03-03). State/Completed label was already applied. Duplicate tracking issue #530 was also created and closed for this same work.
Author
Owner

Resolved by PR #530

Resolved by PR #530
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

2026-03-08

Reference
cleveragents/cleveragents-core#208
No description provided.