Alexander Payne
18bc64b36d
feat: Self-Coding Foundation (Phase 1)
Implements the foundational infrastructure for Timmy's self-modification capability:
## New Services
1. **GitSafety** (src/self_coding/git_safety.py)
- Atomic git operations with rollback capability
- Snapshot/restore for safe experimentation
- Feature branch management (timmy/self-edit/{timestamp})
- Merge to main only after tests pass
2. **CodebaseIndexer** (src/self_coding/codebase_indexer.py)
- AST-based parsing of Python source files
- Extracts classes, functions, imports, docstrings
- Builds dependency graph for blast radius analysis
- SQLite storage with hash-based incremental indexing
- get_summary() for LLM context (<4000 tokens)
- get_relevant_files() for task-based file discovery
3. **ModificationJournal** (src/self_coding/modification_journal.py)
- Persistent log of all self-modification attempts
- Tracks outcomes: success, failure, rollback
- find_similar() for learning from past attempts
- Success rate metrics and recent failure tracking
- Supports vector embeddings (Phase 2)
4. **ReflectionService** (src/self_coding/reflection.py)
- LLM-powered analysis of modification attempts
- Generates lessons learned from successes and failures
- Fallback templates when LLM unavailable
- Supports context from similar past attempts
## Test Coverage
- 104 new tests across 7 test files
- 95% code coverage on self_coding module
- Green path tests: full workflow integration
- Red path tests: errors, rollbacks, edge cases
- Safety constraint tests: test coverage requirements, protected files
## Usage
from self_coding import GitSafety, CodebaseIndexer, ModificationJournal
git = GitSafety(repo_path=/path/to/repo)
indexer = CodebaseIndexer(repo_path=/path/to/repo)
journal = ModificationJournal()
Phase 2 will build the Self-Edit MCP Tool that orchestrates these services.
2026-02-26 11:08:05 -05:00
..
2026-02-24 16:48:14 +00:00
2026-02-26 08:30:04 -05:00
2026-02-19 19:05:01 +00:00
2026-02-25 07:57:28 -05:00
2026-02-24 23:36:50 +00:00
2026-02-21 12:57:38 -05:00
2026-02-26 09:11:48 -05:00
2026-02-22 14:04:20 +00:00
2026-02-24 16:48:14 +00:00
2026-02-24 16:31:47 +00:00
2026-02-21 16:53:16 +00:00
2026-02-26 09:35:59 -05:00
2026-02-26 09:35:59 -05:00
2026-02-25 01:11:14 +00:00
2026-02-24 18:29:21 +00:00
2026-02-26 11:08:05 -05:00
2026-02-26 11:08:05 -05:00
2026-02-24 18:29:21 +00:00
2026-02-24 16:31:47 +00:00
2026-02-24 16:31:47 +00:00
2026-02-24 16:31:47 +00:00
2026-02-25 19:18:08 -05:00
2026-02-25 01:11:14 +00:00
2026-02-22 19:01:04 -05:00
2026-02-24 23:36:50 +00:00
2026-02-26 08:01:01 -05:00
2026-02-25 20:22:51 -05:00
2026-02-25 20:22:51 -05:00
2026-02-26 11:08:05 -05:00
2026-02-26 11:08:05 -05:00
2026-02-24 16:31:47 +00:00
2026-02-24 16:31:47 +00:00
2026-02-25 20:22:51 -05:00
2026-02-21 12:57:38 -05:00
2026-02-21 12:57:38 -05:00
2026-02-22 22:04:37 +00:00
2026-02-26 08:01:01 -05:00
2026-02-22 20:20:11 -05:00
2026-02-24 23:36:50 +00:00
2026-02-25 19:59:42 -05:00
2026-02-25 19:59:42 -05:00
2026-02-22 20:48:14 -05:00
2026-02-22 16:21:32 -05:00
2026-02-26 11:08:05 -05:00
2026-02-24 16:31:47 +00:00
2026-02-24 16:48:14 +00:00
2026-02-21 12:57:38 -05:00
2026-02-19 19:05:01 +00:00
2026-02-26 11:08:05 -05:00
2026-02-25 19:43:43 -05:00
2026-02-25 19:43:43 -05:00
2026-02-24 23:36:50 +00:00
2026-02-25 18:07:44 -05:00
2026-02-26 02:07:54 -05:00
2026-02-24 12:58:19 -05:00
2026-02-26 11:08:05 -05:00
2026-02-25 17:23:47 -05:00
2026-02-25 19:18:08 -05:00
2026-02-21 12:57:38 -05:00
2026-02-24 16:31:47 +00:00
2026-02-24 15:51:15 +00:00
2026-02-25 17:28:41 -05:00
2026-02-24 18:29:21 +00:00
2026-02-24 22:25:04 +00:00
2026-02-21 12:57:38 -05:00
2026-02-24 16:31:47 +00:00
2026-02-22 16:21:32 -05:00
2026-02-25 07:20:56 -05:00
2026-02-22 20:20:11 -05:00
2026-02-22 12:21:50 +00:00
2026-02-21 12:57:38 -05:00
2026-02-26 10:27:08 -05:00
2026-02-22 17:16:12 +00:00
2026-02-24 17:18:29 +00:00
2026-02-22 19:01:04 -05:00
2026-02-24 23:36:50 +00:00
2026-02-22 20:33:26 -05:00
2026-02-26 08:01:01 -05:00
2026-02-24 16:31:47 +00:00
2026-02-21 13:45:24 -05:00
2026-02-21 12:57:38 -05:00
2026-02-24 23:36:50 +00:00
2026-02-24 23:36:50 +00:00
2026-02-21 16:36:56 +00:00
2026-02-25 07:57:28 -05:00
2026-02-25 07:57:28 -05:00
2026-02-26 10:27:08 -05:00
2026-02-25 02:08:02 -05:00