From 436589bb29afccbfff689d15d23a5981754ab56e Mon Sep 17 00:00:00 2001 From: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 Date: Fri, 26 Jun 2026 15:32:09 -0400 Subject: [PATCH] docs: clarify empty_to_none semantics and self-reported identity wording MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address Thufir review findings: - side_effects.rs: document that empty string for git_email is intentional and that empty_to_none in the DB layer owns the "" → NULL conversion, consistent with display_name, avatar_url, about. Prevents future readers from adding a redundant filter. - nest_agents.md: replace "verified" with "self-reported" for the Requester-Git-Email identity description — the email is user-asserted, not cryptographically verified. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- crates/buzz-relay/src/handlers/side_effects.rs | 4 +++- desktop/src-tauri/src/managed_agents/nest_agents.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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.