Files
buzz/migrations/0004_user_git_email.sql
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7andWill Pfleger 7d3d759f75 feat(acp): inject requester git email into [Context] for commit trailers
Agents currently fall back to `git config user.email` for commit trailers,
which resolves to the repo owner's identity — not the human who triggered
the turn. NIP-01 kind:0 already has a standard `email` field; this change
stores it and surfaces it in every prompt so agents can use the correct
identity.

- Add nullable `git_email` column to `users` table (migration 0004)
- Parse the NIP-01 `email` field from kind:0 events in `handle_kind0_profile`
  and store it via `update_user_profile`
- Add `git_email` to `PromptProfile`; parse it in `parse_kind0_profile_lookup`
- Emit `Requester-Git-Email: Name <email>` in `[Context]` when the triggering
  event's author has a git_email set; omit the line entirely when absent
- Update `nest_agents.md`: prefer `Requester-Git-Email:` from `[Context]`
  over `git config user.email`; fall back to git config when absent

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-06-26 13:32:34 -04:00

12 lines
547 B
SQL

-- Add git_email column to users table for agent commit trailer injection.
--
-- Populated from the standard NIP-01 kind:0 `email` field when a user
-- publishes a profile event. Agents read this from `[Context]` as
-- `Requester-Git-Email:` and use it for Co-authored-by / Signed-off-by
-- trailers instead of falling back to `git config user.email`.
--
-- Nullable: users who have not set an email in their profile leave this
-- NULL, and the harness omits the `Requester-Git-Email:` line entirely.
ALTER TABLE users ADD COLUMN git_email TEXT;