Skip to content

feat(runs): record per-run workspace changesets - #197

Open
FekyBaz wants to merge 1 commit into
futrx-com:qafrom
FekyBaz:feat/run-changeset-tracking-83
Open

FekyBaz wants to merge 1 commit into
futrx-com:qafrom
FekyBaz:feat/run-changeset-tracking-83

Conversation

@FekyBaz

@FekyBaz FekyBaz commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Summary

Foundation for #83 (run-scoped agent change tracking): answers "what exactly did this specific
agent run change" at the data layer. Captures the git HEAD baseline when an agent run starts and
appends one changeset record per run to chats/<id>/runs.jsonl when it finishes.

Change

  • gitcli.DiffSummary: numstat-based file/insertion/deletion tally vs a base commit, plus
    untracked files (with line counts). Read-only git use.
  • New runchanges tracker + file store: BeginRun (nil when no repository — non-repos skip
    silently), Finish (nil-safe, error-swallowing; tracking can never break a turn). Record:
    run/provider/model/timestamps/outcome/base/files/insertions/deletions, paths repo-relative.
  • prompt hooks in runPromptAs with outcome mapping (completed/failed/interrupted/error),
    WithoutCancel finish, keyed by the existing ledger run ID so records correlate with turn events.
  • Composition wiring (Dependencies.RunChanges, built from DATA_DIR in cmd/remote).

Deliberately out of scope: HTTP API + UI over runs.jsonl (proposed follow-up once the record
shape is accepted).

Verification

  • New unit tests (gitcli diff incl. real temp repos, tracker incl. nil-safety, outcome mapping).
  • Full gitcli, runchanges, prompt, service suites green; go vet clean.
  • Pre-existing failures untouched and verified on the pristine tree: githistory
    resolveRepositoryPath (this machine), lifecycle overlapping-targets, static.go embed
    (needs a built frontend).

Foundation for futrx-com#83 (run-scoped change tracking): captures the git HEAD baseline when an agent run starts and appends a changeset record (run/provider/model/timestamps/outcome/base/files/insertions/deletions) to chats/<id>/runs.jsonl when it finishes. Read-only git use; non-repositories skip silently; tracking can never break a turn. Adds gitcli.DiffSummary (numstat + untracked files), the runchanges tracker/store, prompt hooks with outcome mapping, and composition wiring. Verified: new unit tests plus full gitcli/runchanges/prompt/service suites green; go vet clean. Pre-existing failures untouched (githistory resolveRepositoryPath on this machine, static.go embed needs built frontend). UI/API over runs.jsonl is follow-up.
@FekyBaz
FekyBaz force-pushed the feat/run-changeset-tracking-83 branch from 51226ff to c7ab1a5 Compare September 11, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant