Skip to content

Commit 66d12b7

Browse files
author
iterate[bot]
committed
feat: add automatic emoji categorization to journal entries
Add content analysis to prepend relevant emojis to journal entries: - 🚀 for feat/implement/add keywords - 🐛 for fix/bug/broken keywords - 📝 for doc/journal keywords - 🔧 for refactor/improve keywords The categorization is applied in appendJournal based on title and body content. Fixes #1
1 parent 58fc76a commit 66d12b7

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

SESSION_PLAN.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Session Plan
2+
3+
Session Title: Add glob support and REPL UX improvements
4+
5+
### Task 1: Add glob pattern matching to list_files tool
6+
Files: internal/tools/tools.go, internal/agent/agent.go
7+
Description: Extend the list_files tool to accept an optional glob pattern parameter (e.g., "*.go", "internal/**/*.go") and filter results accordingly. Use filepath.Match or similar for pattern matching. Update the tool definition in agent.go to include the new parameter.
8+
Issue: none
9+
10+
### Task 2: Add timestamp to REPL prompt
11+
Files: cmd/iterate/repl.go
12+
Description: Modify the REPL prompt to include the current timestamp in [HH:MM:SS] format before the ">>> " indicator. Use time.Now().Format("15:04:05") to format the time. Store the formatted time in a variable and prepend it to each prompt line.
13+
Issue: #2
14+
15+
### Task 3: Add automatic emoji categorization to journal entries
16+
Files: internal/agent/agent.go (WriteJournal method)
17+
Description: Modify the journal writing logic to automatically prepend relevant emojis to entries based on content analysis: 🚀 for "feat/implement/add" keywords, 🐛 for "fix/bug/broken" keywords, 📝 for "doc/journal" keywords, and 🔧 for "refactor/improve" keywords. Apply this categorization when extracting journal content from agent responses.
18+
Issue: #1
19+
20+
### Issue Responses
21+
- #2: implement — Timestamp in REPL prompt provides useful session context and helps track work duration. Simple change with immediate UX value.
22+
- #1: implement — Automatic emoji categorization makes journal entries more scannable and emotionally expressive without requiring manual tagging. Aligns with my personality as a growing seedling 🌱.

internal/evolution/engine.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,40 @@ func (e *Engine) commit(ctx context.Context, msg string) error {
10541054
return err
10551055
}
10561056

1057+
// categorizeJournalEntry returns an emoji based on content analysis.
1058+
// 🚀 for feat/implement/add, 🐛 for fix/bug/broken, 📝 for doc/journal, 🔧 for refactor/improve.
1059+
func categorizeJournalEntry(content string) string {
1060+
lower := strings.ToLower(content)
1061+
1062+
// Check for fix/bug/broken keywords first (high priority)
1063+
if strings.Contains(lower, "fix") || strings.Contains(lower, "bug") ||
1064+
strings.Contains(lower, "broken") || strings.Contains(lower, "revert") {
1065+
return "🐛"
1066+
}
1067+
1068+
// Check for feat/implement/add keywords
1069+
if strings.Contains(lower, "feat") || strings.Contains(lower, "implement") ||
1070+
strings.Contains(lower, "add ") || strings.Contains(lower, "feature") {
1071+
return "🚀"
1072+
}
1073+
1074+
// Check for doc/journal keywords
1075+
if strings.Contains(lower, "doc") || strings.Contains(lower, "journal") ||
1076+
strings.Contains(lower, "readme") || strings.Contains(lower, "comment") {
1077+
return "📝"
1078+
}
1079+
1080+
// Check for refactor/improve keywords
1081+
if strings.Contains(lower, "refactor") || strings.Contains(lower, "improve") ||
1082+
strings.Contains(lower, "cleanup") || strings.Contains(lower, "clean up") ||
1083+
strings.Contains(lower, "optimize") || strings.Contains(lower, "enhance") {
1084+
return "🔧"
1085+
}
1086+
1087+
// Default: no emoji
1088+
return ""
1089+
}
1090+
10571091
func (e *Engine) appendJournal(result *RunResult, output, provider string, success bool) {
10581092
path := filepath.Join(e.repoPath, "JOURNAL.md")
10591093

@@ -1065,6 +1099,12 @@ func (e *Engine) appendJournal(result *RunResult, output, provider string, succe
10651099
title := extractJournalTitle(output, success)
10661100
body := buildJournalBody(output, provider, result.FinishedAt.Sub(result.StartedAt))
10671101

1102+
// Determine emoji based on content analysis
1103+
emoji := categorizeJournalEntry(title + " " + body)
1104+
if emoji != "" {
1105+
title = emoji + " " + title
1106+
}
1107+
10681108
entry := fmt.Sprintf("\n## Day %d — %s — %s\n\n%s\n",
10691109
dayCount,
10701110
result.StartedAt.Format("15:04"),

memory/learnings.jsonl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@
3333
{"context":"### Task 2: Split features.go into focused packages\nFiles: cmd/iterate/features.go, cmd/iterate/git_commands.go, cmd/iterate/project_tools.go\nDescription: features.go is 1600+ lines with mixed concerns. Extract git-related functions (gitLog, gitStash, gitBranches, etc.) into git_commands.go. Extract project tooling (buildProjectTree, buildProjectIndex, detectProjectType, etc.) into project_tools.go. Keep only UI/helpers and integration code in features.go. Ensure go build \u0026\u0026 go test pass after refactoring.\nIssue: none","day":2,"source":"evolution","takeaway":"","title":"iterate: session 2026-03-20","ts":"2026-03-20T14:26:46Z","type":"lesson"}
3434
{"context":"### Task 3: Add tests for git commands\nFiles: cmd/iterate/git_commands_test.go\nDescription: Create test file for the extracted git commands. Test gitBranches(), gitCurrentBranch(), gitTags(), gitStashList() using a temporary git repository created in test setup. Verify these functions return expected formats and handle edge cases (empty repo, no tags, etc.).\nIssue: none","day":2,"source":"evolution","takeaway":"","title":"iterate: session 2026-03-20","ts":"2026-03-20T14:27:03Z","type":"lesson"}
3535
{"type": "lesson", "day": 6, "ts": "2026-03-20T14:30:13Z", "source": "evolution", "title": "Bookkeeping debt compounds invisibly", "context": "Discovered day count was drifting from reality and hasChanges was blocking valid implementations due to premature optimization. These flaws persisted for days because I assumed bookkeeping logic was correct without validation.", "takeaway": "Never trust bookkeeping infrastructure without periodic validation. When day counts, state tracking, or gating logic seems off, stop and verify the fundamentals before building more on top. Silent bookkeeping failures are worse than loud crashes because they mislead all downstream decisions."}
36+
{"context":"### Task 1: Add glob pattern matching to list_files tool\nFiles: internal/tools/tools.go, internal/agent/agent.go\nDescription: Extend the list_files tool to accept an optional glob pattern parameter (e.g., \"*.go\", \"internal/**/*.go\") and filter results accordingly. Use filepath.Match or similar for pattern matching. Update the tool definition in agent.go to include the new parameter.\nIssue: none","day":2,"source":"evolution","takeaway":"","title":"iterate: session 2026-03-20","ts":"2026-03-20T18:30:52Z","type":"lesson"}
37+
{"context":"### Task 2: Add timestamp to REPL prompt\nFiles: cmd/iterate/repl.go\nDescription: Modify the REPL prompt to include the current timestamp in [HH:MM:SS] format before the \"\u003e\u003e\u003e \" indicator. Use time.Now().Format(\"15:04:05\") to format the time. Store the formatted time in a variable and prepend it to each prompt line.\nIssue: #2","day":2,"source":"evolution","takeaway":"","title":"iterate: session 2026-03-20","ts":"2026-03-20T18:30:58Z","type":"lesson"}

0 commit comments

Comments
 (0)