-
Notifications
You must be signed in to change notification settings - Fork 24
Git commit co-authorship â human as Author, agent as Committer #1001
Description
Parent
Part of #204 (Phase 4: Hardening)
Problem
Agent commits currently show Toast (gastown) <toast@gastown.local> as both author and committer (agent-runner.ts:84-87). There's no trace of the human who initiated the work. On GitHub/GitLab, these commits look like they came from a bot â the human gets no contribution credit, and there's no provenance trail for compliance ("who authorized this code?").
Solution
Dual-attribute every agent commit: the human who initiated the work is the Author, the agent is the Committer. This way GitHub contribution graphs credit the human, while the agent identity remains traceable.
Git environment variables
Currently in agent-runner.ts:84-87:
GIT_AUTHOR_NAME: `${request.name} (gastown)`,
GIT_AUTHOR_EMAIL: `${request.name}@gastown.local`,
GIT_COMMITTER_NAME: `${request.name} (gastown)`,
GIT_COMMITTER_EMAIL: `${request.name}@gastown.local`,Change to:
GIT_AUTHOR_NAME: request.userName, // "John Smith"
GIT_AUTHOR_EMAIL: request.userEmail, // "john@company.com"
GIT_COMMITTER_NAME: `${request.name} (Polecat)`,
GIT_COMMITTER_EMAIL: `${request.name}@gastown.kilo.ai`,Data flow
The user's name and email need to flow from the initiating action through to the agent:
- Mayor message or
gt_sling: TheuserIdof the human is already on the request. Resolve their name/email from the Kilo user record. - Bead creation: Store
initiated_by_user_idon the bead (or use the existingcreated_byfield if it stores the userId). - Agent dispatch:
startAgentInContainer()passesuserNameanduserEmailto the container alongside the existingagentName. - Container:
agent-runner.tssetsGIT_AUTHOR_*to the human,GIT_COMMITTER_*to the agent.
Co-authored-by trailers
In addition to the Author/Committer split, append trailers to commit messages:
Co-authored-by: Toast (Polecat) <toast@gastown.kilo.ai>
Requested-by: John Smith <john@company.com>
Bead-ID: gt-abc-123
This requires either:
- Instructing the polecat's system prompt to include trailers in commit messages
- Or post-processing commits via a git hook in the worktree
The prompt approach is simpler and more flexible. Add to the polecat system prompt's "Commit & Push Hygiene" section.
Acceptance Criteria
-
GIT_AUTHOR_NAME/GIT_AUTHOR_EMAILset to the initiating user's name and email -
GIT_COMMITTER_NAME/GIT_COMMITTER_EMAILset to the agent's identity - User name/email resolved from Kilo user record and passed through dispatch
- Polecat system prompt instructs agents to include
Co-authored-byandBead-IDtrailers - GitHub/GitLab contribution graphs credit the human user
- Agent identity remains visible in commit metadata
Notes
- No data migration needed
- This applies to both user-scoped and org-scoped Gastown (see Cloud Gastown: Future ideas — capabilities unique to or enhanced by the cloud model #447 for org-level towns)
- The user's email must match their GitHub/GitLab account email for contribution graph credit to work
- For org-scoped towns, the
initiated_by_user_idmay differ per bead (different team members slinging different work)