| Component | File | Status |
|---|---|---|
| Pre-Tool Semantic Memory Hook | src/hooks/learning-loop/pre_tool_semantic_memory.py |
✅ Implemented |
| Post-Tool Validation | src/hooks/learning-loop/post_tool_learning.py (extends existing) |
✅ Planned |
| Test Suite | test_plan_semantic_memory.py |
✅ 7/7 tests pass |
| Document | File | Purpose |
|---|---|---|
| Full Documentation | docs/mid-stream-semantic-memory.md |
Complete technical reference |
| Wiki: Feature Guide | docs/wiki/Mid-Stream-Semantic-Memory.md |
User-facing guide |
| Wiki: Hooks Reference | docs/wiki/Hooks.md |
Updated hooks documentation |
| Wiki: Plan Mode | docs/wiki/Plan-Mode-Integration.md |
Issue #98 resolution guide |
| Wiki Update Summary | WIKI_UPDATE_SUMMARY.md |
How to publish wiki |
- Extracts last 1500 chars from thinking blocks
- Embeds using sentence-transformers (all-MiniLM-L6-v2)
- Cosine similarity search against heuristics DB
- Injects top-3 relevant heuristics
Triggers:
- Writing to
~/.claude/plans/*.md - Files with "plan", "roadmap", "architecture" in name
- Thinking containing "create a plan", "design document"
Boosts:
- Golden Rules: +20%
- Sequential Thinking: +15%
- Architecture Decision Records: +15%
---
## 🎯 [Plan Mode] Critical Heuristics
### ⭐ GOLDEN RULES (Must Apply to Plan)
- **Always use Sequential Thinking** (90% confidence)
→ Break down complex tasks into steps before coding
---- Detects plan file writes
- Validates injected heuristics were addressed
- Warns if any are missing
- Tracks recently shown heuristics
- Skips if shown in last 3 tool calls
- Always allows Golden Rules
TEST 1: Plan Detection (File Path) ✓ PASS
TEST 2: Plan Detection (Thinking) ✓ PASS
TEST 3: Heuristic Boosting ✓ PASS
TEST 4: Formatting (Plan vs Regular) ✓ PASS
TEST 5: Plan Validation ✓ PASS
TEST 6: Integration Workflow ✓ PASS
TEST 7: Edge Cases ✓ PASS
RESULTS: 7 passed, 0 failed
- Quick Start Guide - Wiki: Mid-Stream-Semantic-Memory
- FAQ - Common questions answered
- Troubleshooting - Debug steps
- Architecture - Data flow diagrams
- Configuration - Environment variables
- Testing - How to run tests
- Problem Analysis - Why heuristics weren't applied
- Solution - Multi-layer approach
- Validation - How plan checking works
git add src/hooks/learning-loop/pre_tool_semantic_memory.py
git add docs/
git add test_plan_semantic_memory.py
git commit -m "feat: Add mid-stream semantic memory..."
git push origin main- Copy
docs/wiki/*.mdto GitHub wiki - Update sidebar/homepage links
- Verify pages render correctly
Add "What's New" section pointing to new docs
| Before | After |
|---|---|
| Heuristics shown once at start | Heuristics injected throughout session |
| Context drift → forgotten rules | Thinking-based matching → fresh relevance |
| Plan mode misses critical patterns | 🎯 Plan mode boosts Sequential Thinking |
| No validation of plan quality | Post-write validation warns if gaps |
| Keyword-only matching | Semantic + keyword hybrid |
| Repetition causes noise | Temporal dedup keeps it fresh |
# Run tests
cd ~/clawd/elf-work
python test_plan_semantic_memory.py
# View documentation
cat docs/mid-stream-semantic-memory.md
# Check what's ready to push
git status- All tests pass
- Documentation complete
- Wiki pages ready
- Issue #98 addressed
- Waiting for "push" command
Say "push" when ready to publish.