The Problem in 5 Lines
Greplica's memory is entirely session-driven repos with no prior agent sessions start empty, and existing memory is never automatically validated against the evolving codebase. Commit messages, PR descriptions, and co-change patterns in git history are rich sources of architectural knowledge that go completely untapped. Meanwhile, claims with code_anchors pointing to files that have been deleted, renamed, or refactored silently become stale, leading agents to act on outdated information. The current greplica graph audit anchors command only checks file existence on disk, not whether the code's behavior still matches the claim. This proposal solves both problems: bootstrapping memory from git history for cold-start repos, and continuously validating memory accuracy through a background watch daemon.
Proposed Features
1. greplica git ingest — Bootstrap Memory from Git History
Walk git history to auto-generate claims, components, flows, and edges from commit messages, diffs, and co-change patterns — all with deterministic heuristics (no LLM required).
greplica git ingest [--max-commits <n>] [--max-age <days>] [--prs] [--github-token <token>] [--dry-run]
The pipeline:
- Collect Commits — Single
git log call with --format and --numstat
- Analyze Commits — Parse conventional commits (
feat:, fix:, refactor:, etc.) + regex-based decision extraction
- Detect Co-Change Patterns — Statistical lift analysis to discover module boundaries and propose
component + flow definitions
- Analyze PR Metadata (optional) — Fetch PR bodies via GitHub API for richer context
- Generate & Apply Proposal — Produces a standard
MemoryCommitProposal with appropriate edges, sources, and deduplication
Sample output from 127 commits:
Claims to create: 42 (12 decision, 18 fact, 8 insight, 4 requirement)
Components to create: 7 (src/auth/, src/api/, src/db/, ...)
Flows to create: 3 (auth_flow, deployment, api_integration)
Sources to create: 127 (one git_history source per commit)
2. greplica git watch — Continuous Memory Validation
Background daemon that automatically re-validates claims when code changes.
greplica git watch [--daemon] [--interval <seconds>] [--anchor-threshold <days>]
- Polls
git rev-parse HEAD (fast, ~5ms) for new commits
- On new commit: identifies affected claims whose
code_anchors touch changed files
- Re-resolves symbols via tree-sitter; if symbol no longer exists or file was deleted, adds a
needs_review edge to the claim
- Also runs periodic full anchor validation
3. Stale Anchor Detection & Validation
- New edge kind:
needs_review — attached to claims whose code anchors may be stale, with metadata explaining why (file_deleted, symbol_removed, file_content_changed)
- New claim kind:
insight — distinguishes auto-extracted claims from agent-written ones
- New source kind:
git_history — provenance pointing to git commits
- Integration with
proposal validate: rejects proposals that reference claims with stale anchors
- Graph view integration: warning icons on stale claims, filterable view
The Problem in 5 Lines
Greplica's memory is entirely session-driven repos with no prior agent sessions start empty, and existing memory is never automatically validated against the evolving codebase. Commit messages, PR descriptions, and co-change patterns in git history are rich sources of architectural knowledge that go completely untapped. Meanwhile, claims with
code_anchorspointing to files that have been deleted, renamed, or refactored silently become stale, leading agents to act on outdated information. The currentgreplica graph audit anchorscommand only checks file existence on disk, not whether the code's behavior still matches the claim. This proposal solves both problems: bootstrapping memory from git history for cold-start repos, and continuously validating memory accuracy through a background watch daemon.Proposed Features
1.
greplica git ingest— Bootstrap Memory from Git HistoryWalk git history to auto-generate claims, components, flows, and edges from commit messages, diffs, and co-change patterns — all with deterministic heuristics (no LLM required).
The pipeline:
git logcall with--formatand--numstatfeat:,fix:,refactor:, etc.) + regex-based decision extractioncomponent+flowdefinitionsMemoryCommitProposalwith appropriate edges, sources, and deduplicationSample output from 127 commits:
2.
greplica git watch— Continuous Memory ValidationBackground daemon that automatically re-validates claims when code changes.
git rev-parse HEAD(fast, ~5ms) for new commitscode_anchorstouch changed filesneeds_reviewedge to the claim3. Stale Anchor Detection & Validation
needs_review— attached to claims whose code anchors may be stale, with metadata explaining why (file_deleted,symbol_removed,file_content_changed)insight— distinguishes auto-extracted claims from agent-written onesgit_history— provenance pointing to git commitsproposal validate: rejects proposals that reference claims with stale anchors