Skip to content

feat(context): add intelligent context caching and diff tracking #9

@foundatron

Description

@foundatron

Problem Statement

The context fetcher reads OctopusGarden's CLAUDE.md and architecture.md each scan cycle. It should cache these files and detect when they change, since changes to OctopusGarden's architecture affect how articles should be analyzed.

Proposed Change

Add intelligent caching with change detection for OctopusGarden context.

Files to Modify

  • `tentacle/context.py` - Add file-based caching with SHA-256 checksums, detect changes between scans, include diff summary in analysis context when architecture changes
  • `tentacle/db.py` - Add `context_cache` table (file, content, checksum, fetched_at)
  • `tests/test_context.py` - New test file for context caching logic

Acceptance Criteria

  • Context files cached to `~/.cache/tentacle/` with checksums
  • Cache invalidation when checksum changes
  • Change summary included in LLM context when architecture evolves
  • Graceful fallback when OctopusGarden repo is unreachable
  • Tests cover caching, invalidation, fallback

Design Notes

Cache files locally with metadata JSON. When architecture.md changes, include a "Recent Changes" section in the analysis context so the LLM can assess relevance against the latest architecture.


Generated by tentacle bootstrap plan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions