mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
docs: clarify empty_to_none semantics and self-reported identity wording
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 <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
co-authored by
Will Pfleger
parent
7d3d759f75
commit
436589bb29
@@ -860,7 +860,9 @@ async fn handle_kind0_profile(event: &Event, state: &Arc<AppState>) -> 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())
|
||||
|
||||
@@ -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 <human@email>"`. 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 <human@email>"`. 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 <will@example.com>`), 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 <will@example.com>`), 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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user