From 43440200facf9f7c51ba4f4638e69e7d651dd50d Mon Sep 17 00:00:00 2001 From: "Claude Sonnet 4.6" Date: Sat, 14 Mar 2026 18:11:44 +0000 Subject: feat(Phase4): add file changes for changestats executor wiring Files changed: CLAUDE.md, internal/api/changestats.go, internal/executor/executor.go, internal/executor/executor_test.go, internal/task/changestats.go (new) Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'CLAUDE.md') diff --git a/CLAUDE.md b/CLAUDE.md index 1d03678..16a48b4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -105,6 +105,20 @@ Batch files wrap multiple tasks under a `tasks:` key. Two tables: `tasks` (with `config_json`, `retry_json`, `tags_json`, `depends_on_json` as JSON blobs) and `executions` (with paths to log files). Schema is auto-migrated on `storage.Open()`. +## Features + +### Changestats + +After each task execution, Claudomator extracts git diff statistics from the execution's stdout log. If the log contains a git `diff --stat` summary line (e.g. `5 files changed, 127 insertions(+), 43 deletions(-)`), the stats are parsed and stored in the `executions.changestats_json` column via `storage.DB.UpdateExecutionChangestats`. + +**Extraction points:** +- `internal/executor.Pool.handleRunResult` — calls `task.ParseChangestatFromFile(exec.StdoutPath)` after every execution; stores via `Store.UpdateExecutionChangestats`. +- `internal/api.Server.processResult` — also extracts changestats when the API server processes a result (same file, idempotent second write). + +**Parser location:** `internal/task/changestats.go` — exported functions `ParseChangestatFromOutput` and `ParseChangestatFromFile` usable by any package without creating circular imports. + +**Frontend display:** `web/app.js` renders a `.changestats-badge` on COMPLETED/READY task cards and in execution history rows. + ## ADRs See `docs/adr/001-language-and-architecture.md` for the Go + SQLite + WebSocket rationale. -- cgit v1.2.3