-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Parent
Part of #204 (Phase 4: Hardening)
Problem
When a bead results in code changes, there's no record of which commits were produced or links to view them on GitHub/GitLab. The bead detail panel shows status and agent assignment but not the actual artifacts of the work. Users have to go to GitHub, find the branch, and manually inspect the commit log to see what the agent did.
Solution
Track commits produced by agents per bead and display them in the bead detail panel with links to the upstream SCM.
Data collection
When a polecat pushes commits (which should happen frequently per GUPP), the container reports them to the TownDO. Two approaches:
Option A ��¢ Post-push hook: After each git push, the agent runner parses the push output or runs git log origin/{branch} --oneline and reports the new commits to the TownDO via a new endpoint.
Option B ��¢ On gt_done: When the polecat calls gt_done, the container runs git log {defaultBranch}..HEAD --format="%H|%s|%an|%ae|%aI" on the agent's branch and includes the commit list in the done payload.
Option B is simpler but only captures commits at completion. Option A captures the incremental push history. Start with Option B; Option A can be added later.
Storage
Store commits as bead events or in a dedicated bead_commits table:
CREATE TABLE bead_commits (
bead_commit_id TEXT PRIMARY KEY,
bead_id TEXT NOT NULL REFERENCES beads(bead_id),
commit_sha TEXT NOT NULL,
commit_message TEXT NOT NULL,
author_name TEXT,
author_email TEXT,
committed_at TEXT NOT NULL,
scm_url TEXT, -- https://github.com/org/repo/commit/{sha}
created_at TEXT NOT NULL DEFAULT (datetime('now'))
);The scm_url is constructed from the rig's gitUrl + the commit SHA. parseGitUrl() in platform-pr.util.ts already extracts the owner/repo.
Dashboard UI
Bead detail panel gets a "Commits" tab:
- List of commits with SHA (truncated, clickable link to SCM), message, author, timestamp
- Total commit count and lines changed summary (if available)
- For merged beads: link to the merge commit on the default branch
Mayor context
When the Mayor inspects a bead via gt_list_beads or a future gt_bead_detail, include a commit summary: "3 commits, +120 -45 lines, last pushed 5 min ago". Gives the Mayor a sense of work scope without reading code.
Acceptance Criteria
- Commits produced by agents are captured and stored per bead
- Each commit record includes SHA, message, author, timestamp, and SCM URL
- Bead detail panel displays commit history with clickable links to GitHub/GitLab
- SCM URLs constructed from rig's
gitUrl+ commit SHA -
gt_donepayload includes commit list from the agent's branch - Commit data available to the Mayor for bead inspection
Notes
- No data migration needed
- The
scm_urlpattern differs by platform: GitHub ishttps://github.com/{owner}/{repo}/commit/{sha}, GitLab ishttps://gitlab.com/{owner}/{repo}/-/commit/{sha}.parseGitUrl()already handles both. - This is related to but distinct from "Code Diffs Linked to Beads" in Cloud Gastown: Future ideas — capabilities unique to or enhanced by the cloud model #447 Ã�Ã�¢ that covers rendering the full diff in the dashboard; this covers the commit history and SCM links.