diff --git a/crates/buzz-relay/src/handlers/side_effects.rs b/crates/buzz-relay/src/handlers/side_effects.rs index 6f30c6746..aa3aa7ed1 100644 --- a/crates/buzz-relay/src/handlers/side_effects.rs +++ b/crates/buzz-relay/src/handlers/side_effects.rs @@ -860,7 +860,9 @@ async fn handle_kind0_profile(event: &Event, state: &Arc) -> anyhow::R let nip05_handle = nip05_owned.as_deref().unwrap_or(""); // NIP-01 standard `email` field — stored as-is for agent commit trailer injection. - // No validation beyond presence: the user is responsible for setting a valid git email. + // Empty string is intentional: `update_user_profile` passes it through `empty_to_none`, + // which converts "" → NULL in the DB (consistent with display_name, avatar_url, about). + // Do NOT add an explicit `.filter(|s| !s.is_empty())` here — `empty_to_none` owns that. let git_email_owned = content .get("email") .and_then(|v| v.as_str()) diff --git a/desktop/src-tauri/src/managed_agents/nest_agents.md b/desktop/src-tauri/src/managed_agents/nest_agents.md index db7456bfc..4b5e04f24 100644 --- a/desktop/src-tauri/src/managed_agents/nest_agents.md +++ b/desktop/src-tauri/src/managed_agents/nest_agents.md @@ -50,7 +50,7 @@ The human operator signs off for accountability. - **Human sign-off (required):** every commit MUST include a `Signed-off-by` trailer for the human operator who is responsible for the agent's work. Add via `git commit --trailer "Signed-off-by: Human Name "`. One blank line must separate trailers from the commit body. - **Human credit (`Co-authored-by`):** every commit MUST also include a `Co-authored-by` trailer for the same human operator, with identical name and email to the `Signed-off-by` line. GitHub parses `Co-authored-by` for contribution-graph credit; `Signed-off-by` alone does not grant it. Add via `git commit --trailer "Co-authored-by: Human Name "`. Place `Co-authored-by` before `Signed-off-by` in the trailer block. -- **Discovering the human's identity:** When the `[Context]` block includes a `Requester-Git-Email:` line (e.g. `Requester-Git-Email: Will Pfleger `), use that name and email for both trailers — it is the triggering human's verified git identity. If `Requester-Git-Email:` is absent, fall back to reading `git config user.name` and `git config user.email` from the working repository. Do NOT hardcode, guess, or prompt for the email — the `[Context]` field or repo config is the source of truth. If neither source yields an email, STOP and ask the human operator for their name and email before committing. +- **Discovering the human's identity:** When the `[Context]` block includes a `Requester-Git-Email:` line (e.g. `Requester-Git-Email: Will Pfleger `), use that name and email for both trailers — it is the triggering human's self-reported git identity. If `Requester-Git-Email:` is absent, fall back to reading `git config user.name` and `git config user.email` from the working repository. Do NOT hardcode, guess, or prompt for the email — the `[Context]` field or repo config is the source of truth. If neither source yields an email, STOP and ask the human operator for their name and email before committing. - **Signing:** if the agent has a registered signing key, sign commits. If not, commits will land unverified — this is acceptable until agent SSH keys are provisioned. Do NOT use the human's signing key. - **Verify before pushing:** `git log -1` should show the human's `Signed-off-by` trailer.