Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DAY_COUNT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0
1
34 changes: 34 additions & 0 deletions SESSION_PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Session Plan

Session Title: Find and fix real code issues

### Task 1: Search for bugs in core packages
Files: cmd/iterate/, internal/evolution/, internal/agent/
Description: Read the Go source code in these directories. Look for:
- Functions with missing error handling
- TODO comments that should be implemented
- Test files with low coverage
- Unused variables or imports
- Potential nil pointer dereferences
- Race conditions in concurrent code
Pick ONE concrete issue and fix it with proper tests.

### Task 2: Check for UX improvements
Files: cmd/iterate/repl.go, cmd/iterate/commands/
Description: Look for user-facing code that could be improved:
- Missing error messages
- Confusing command outputs
- Hardcoded values that should be configurable
- Missing help text
Pick ONE improvement and implement it.

### Task 3: Performance optimization
Files: Any Go files
Description: Look for:
- Inefficient loops
- Unnecessary allocations
- Missing context cancellation
- Blocking operations without timeouts
Pick ONE performance issue and optimize it.

Criteria: Only commit if the change includes BOTH the fix AND tests for the fix.
42 changes: 34 additions & 8 deletions cmd/iterate/features_sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ func initAuditLog() {
_ = os.MkdirAll(filepath.Dir(auditLogPath), 0o755)
}

func logAudit(toolName string, args map[string]interface{}, result string) {
func logAudit(toolName string, args map[string]interface{}, result string) error {
if auditLogPath == "" {
return
return nil
}
f, err := os.OpenFile(auditLogPath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o600)
if err != nil {
return
return fmt.Errorf("open audit log: %w", err)
}
defer f.Close()

Expand All @@ -58,10 +58,15 @@ func logAudit(toolName string, args map[string]interface{}, result string) {
}
line, err := json.Marshal(entry)
if err != nil {
return
return fmt.Errorf("marshal audit entry: %w", err)
}
if _, err := f.Write(line); err != nil {
return fmt.Errorf("write audit entry: %w", err)
}
if _, err := f.Write([]byte{'\n'}); err != nil {
return fmt.Errorf("write audit newline: %w", err)
}
f.Write(line) //nolint:errcheck
f.Write([]byte{'\n'}) //nolint:errcheck
return nil
}

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -98,8 +103,9 @@ func loadSession(name string) ([]iteragent.Message, error) {
}
var msgs []iteragent.Message
if err := json.Unmarshal(data, &msgs); err != nil {
// Try .bak file if primary is corrupt.
if bakData, bakErr := os.ReadFile(path + ".bak"); bakErr == nil {
// Attempt to restore from .bak file
bakData, bakErr := os.ReadFile(path + ".bak")
if bakErr == nil {
var bakMsgs []iteragent.Message
if json.Unmarshal(bakData, &bakMsgs) == nil {
return bakMsgs, nil
Expand Down Expand Up @@ -201,3 +207,23 @@ func maybeNotify() {
// ---------------------------------------------------------------------------
// /debug — toggle debug logging
// ---------------------------------------------------------------------------

func toggleDebugLogging() bool {
if _, ok := os.LookupEnv("ITERATE_DEBUG"); ok {
os.Unsetenv("ITERATE_DEBUG")
return false
}
os.Setenv("ITERATE_DEBUG", "1")
return true
}

func isDebugLogging() bool {
_, ok := os.LookupEnv("ITERATE_DEBUG")
return ok
}

func debugLog(msg string, args ...interface{}) {
if isDebugLogging() {
fmt.Fprintf(os.Stderr, "[debug] "+msg+"\n", args...)
}
}
16 changes: 8 additions & 8 deletions docs/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
</head>
<body>
<h1>iterate — Evolution Dashboard</h1>
<p class="sub">Last updated: 2026-03-29T09:41:47Z</p>
<p class="sub">Last updated: 2026-03-29T16:59:31Z</p>

<div class="grid">
<div class="card"><div class="value">1000</div><div class="label">Total Commits</div></div>
<div class="card"><div class="value">356</div><div class="label">Commits This Week</div></div>
<div class="card"><div class="value">+74,095</div><div class="label">Lines Added</div></div>
<div class="card"><div class="value">-12,978</div><div class="label">Lines Removed</div></div>
<div class="card"><div class="value">1988</div><div class="label">Tests</div></div>
<div class="card"><div class="value">1018</div><div class="label">Total Commits</div></div>
<div class="card"><div class="value">346</div><div class="label">Commits This Week</div></div>
<div class="card"><div class="value">+66,795</div><div class="label">Lines Added</div></div>
<div class="card"><div class="value">-10,849</div><div class="label">Lines Removed</div></div>
<div class="card"><div class="value">1989</div><div class="label">Tests</div></div>
<div class="card"><div class="value">1</div><div class="label">Journal Days</div></div>
</div>

Expand All @@ -50,10 +50,10 @@ <h2>Test Coverage Over Time</h2>
new Chart(document.getElementById('covChart'), {
type: 'line',
data: {
labels: ["0", "1", "2", "3"],
labels: ["0", "1", "2", "3", "4"],
datasets: [{
label: 'Coverage %',
data: [0, 0, 0, 0],
data: [0, 0, 0, 0, 0],
borderColor: '#a3e635',
backgroundColor: 'rgba(163,230,53,.1)',
tension: 0.3,
Expand Down
18 changes: 8 additions & 10 deletions docs/stats.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"generated_at": "2026-03-29T15:00:00Z",
"day_count": 0,
"total_commits": "0",
"commits_this_week": "0",
"sessions_shipped": 0,
"generated_at": "2026-03-29T16:59:31Z",
"total_commits": "1018",
"commits_this_week": "346",
"lines_changed": {
"added": 0,
"removed": 0
"added": 66795,
"removed": 10849
},
"contributors": 1,
"contributors": 6,
"languages": {
"Go": 0
"Go": 85184
},
"test_count": 0,
"test_count": 1989,
"journal_entries": 1
}
1 change: 1 addition & 0 deletions memory/coverage_history.jsonl
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
{"date": "2026-03-26T12:57:41Z", "coverage_pct": 46.6, "test_count": 1014}
{"date": "2026-03-29T09:09:27Z", "coverage_pct": 56.4, "test_count": 1974}
{"date": "2026-03-29T09:41:47Z", "coverage_pct": 56.4, "test_count": 1974}
{"date": "2026-03-29T16:59:31Z", "coverage_pct": 56.5, "test_count": 1975}
8 changes: 4 additions & 4 deletions memory/weekly_summary.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Weekly Summary — 2026-03-29

### Stats
- **Commits this week:** 356
- **Lines added:** 74095
- **Lines removed:** 12978
- **Test count:** 1988
- **Commits this week:** 346
- **Lines added:** 66795
- **Lines removed:** 10849
- **Test count:** 1989
- **Journal entries:** 1

### Recent Activity
Expand Down
Loading