Synced from Hive. This page is pulled from hivecommons/hive@v5 during the docs build. Edit the canonical source in the Hive repository.
Outbound text: no em-dashes
Nothing hive or its agents send out of the hive may contain an em-dash (U+2014), or an en-dash (U+2013) used as a dash. This page lists where that rule is enforced and how CI keeps new send paths from skipping it (#18970, #19103).
The filter
There is one filter, src/crux/prosefilter. The root module reaches it
through src/pkg/prosefilter, which only delegates. The filter lives in the
crux module so the egress proxy, which cannot import pkg/, uses the same
function.
Sanitizerewrites multi-line Markdown prose. An em-dash becomes-(or-/-at the start or end of a line). An en-dash with spaces on both sides becomes-. An en-dash in a range such as3-5written with U+2013 is left alone.SanitizeTitledoes the same for a single line.SanitizeJSONapplies the same rule to the string values under named keys of a JSON document, at any depth, and leaves every other value unchanged.- Fenced code blocks, inline code spans and blockquote lines are never changed, because they carry quoted or pasted content.
Agents are also told the rule in every kick (the plain-dash rule in the kick header), so most text never needs rewriting.
Where it applies
| Path | Boundary | Filtered |
|---|---|---|
| Agent relay requests (PR, issue, comment, review bodies and titles) | relayBody, CreatePR, the issue-request watcher (src/pkg/github) | yes |
Agent GitHub writes through the egress proxy (gh api, gh pr comment, gh pr create, REST and GraphQL) | sanitizeAgentWriteProse in src/crux/proxy/outbound_prose.go | yes |
| Agent Linear writes through the egress proxy | same, Linear mutation variables | yes |
| Agent commit messages | HEAD commit message in the push broker (src/crux/pushbroker/commit_message.go) | yes, HEAD only (see below) |
Hive-signed commits (createCommitOnBranch) | src/pkg/github/pr_request_signed.go | yes |
| Squash and merge commit messages hive writes | MergePRVia in src/pkg/github/pullrequest.go | yes |
| Hive-rendered GitHub comments, issues and status notes | source templates | enforced at the source by the emit ratchet |
| ntfy, Slack and Discord webhook alerts | notify.(*Notifier).Send | yes |
| Slack DMs from the hub | hub.sendSlackDM | yes |
| Discord bot messages, embeds, edits, threads, topics | discord.(*Bot).do, setChannelTopic | yes |
| Hub Discord webhooks (requests, GitHub activity feed) | hub.postDiscordRequestWebhook, hub.(*GitHubActivityFeed).postDiscord | yes |
| Hub ntfy alert | hub.(*HubServer).pushAuthAuditAlert | yes |
Meeting chat and spoken text (Quorum chat.post, say, say.prewarm) | meetings.(*Client).post | yes |
| Hub-filed GitHub issue titles (self-reports, feedback) | hub.postHubGitHubIssue | yes |
| Hub-filed issue bodies, seen-log comments and affected-hives edits | pkg/fleetreport templates | emit ratchet (the affected-hives block is parsed back from the issue by its separators, so it is not rewritten after rendering) |
| Linear advisory digest | LinearAdvisoryPoster.PostDigest filters before its skip-if-unchanged compare; the footer marker is now plain ASCII and the old em-dash marker is still recognised | yes |
| Linear and Jira work-source writes | worksource.linearGraphQL, worksource.(*jiraSource).doJSON | yes |
| Linear agent activity | linearagent.doGraphQL | yes |
| DIBS inbox ideas | inbox.(*DibsDestination).Deliver | yes |
| GitLab, Gitea and Forgejo writes | pkg/forge | emit ratchet |
| Email replies | no sender is wired yet | not applicable |
The egress proxy
An agent that writes to GitHub itself talks to GitHub through the hive’s MITM
egress proxy. Before #19103 the relay forwarded an allowed write verbatim, so
an agent’s gh api comment kept its em-dashes even though hive’s own writes
were filtered. The proxy now rewrites, just before forwarding:
- REST JSON bodies:
body,titleandmessageat any depth, which covers issue and PR comments, PR and issue titles and bodies, review bodies and their inlinecomments[].body, review-thread replies and contents-API commit messages. - GraphQL mutation variables:
bodyandtitlewhen the document names a comment, review, review-thread reply, PR or issue mutation (addComment,addPullRequestReviewComment,addPullRequestReviewThreadReply,createPullRequest,updatePullRequest,createIssue,updateIssueand the related review and comment-edit mutations). The query text is never changed, so a string literal written inline in the query is not rewritten. - Linear mutation variables:
body,titleanddescription.
It never changes a body that is not JSON, a body that declares a non-JSON
Content-Type, any other field, git smart-HTTP or LFS traffic, or the hive’s
own control-plane requests. A body over 1 MiB is forwarded unchanged rather
than truncated. When a body changes, its Content-Length is recomputed. One
debug line records the agent, method, path and the number of fields and dashes
changed, never the text.
Commit messages
A commit message travels inside the pushed git objects, so it cannot be
rewritten in transit without changing object ids. The push broker, which
already amends an agent’s HEAD commit for the trailing-newline rule, rewrites
the HEAD commit message with the same filter before pushing. Only HEAD is
rewritten: an older commit in the same push keeps its message, because the
broker never rebases an agent’s branch. The rewrite is best-effort: if the message cannot be
read or amended, the broker logs a warning and pushes the commit unchanged. Hive squash-merges, and the squash
commit message it writes is filtered, so the commit that lands on the default
branch is clean either way. Hive installs no git hooks in agent workspaces
(hooks are disabled with core.hooksPath=/dev/null), so this is done by the
broker rather than a commit-msg hook.
AI tool attribution
Coding CLIs credit themselves by default: Claude Code adds
Co-Authored-By: Claude <model> <noreply@anthropic.com> to every commit and a
“Generated with Claude Code” line to every PR body, and the Copilot CLI adds a
Co-authored-by: Copilot trailer. None of it may reach a hive commit or PR
(#20620).
- At the source. Every Claude settings file hive seeds (the shared
~/.claude/settings.jsoninteractive agents read, and both inference-agent files) carries"attribution": {"commit": "", "pr": ""}and the older"includeCoAuthoredBy": false. Both are merged in only when absent, so an operator’s explicit value in the file wins. A sandbox Job seeds no settings file, so its claude command line passes the same keys with--settings. Every agent kick also carries the house rule not to credit an AI tool, which covers the other backends. - Push broker. The HEAD commit amend that rewrites dashes also removes the lines when the lane authored HEAD. An older outgoing lane commit that still carries one is fixed by replaying the outgoing commits onto the base with the lines removed: trees, authors, committers, dates and every other line (Signed-off-by included) are kept, and the push stays a fast forward. Only when that is not possible (a merge in the range, a range that does not sit on the base, a person’s commit that would have to move) is the push refused, naming the line to remove. Merge commits are not judged.
- Egress proxy, pushes. An in-pod lane push whose own commits (merges included) carry one is refused with the line to remove (the proxy cannot rewrite pushed objects). This matches the sign-off rules the proxy already enforces on pushes, and like them it runs only where the proxy reads the push.
- Egress proxy, text. The same JSON text fields the dash filter covers (PR and issue bodies, comments, contents-API commit messages, GraphQL mutation variables) lose the lines.
- Hive’s relays. The PR, issue and comment bodies hive posts for an agent
(
hive-open-pr, the write-surface relays, the forge request relay) lose the lines, and so does the App-signed re-author commit built from the branch commits. - Squash merges hive performs. The squash body hive rebuilds from the branch commits drops the lines.
Only two kinds of line match: a Co-authored-by: whose name or address
identifies an AI tool (a tool’s own address such as noreply@anthropic.com,
a GitHub noreply address of an AI account such as Copilot, or a name such as
Claude Opus 5.5), and a line that is only a Generated with <AI tool>
footer. A human co-author, including one named Claude or one who works at an
AI vendor, and every Signed-off-by: are kept. Lines inside a closed fenced
code block or a blockquote are quoted content and are left alone. Commits
already on a forge are never rewritten, and a merge hive does not compose
(a squash GitHub or Prow composes, or a merge or rebase that lands the branch
commits themselves) keeps whatever the branch commits say.
Switch
HIVE_AGENT_PROSE_FILTER turns off the rewriting of text an agent wrote
itself (its writes through the proxy and its HEAD commit message). It is on by
default; false, 0, off or no turns it off. Text hive composes is always
filtered.
HIVE_AGENT_AI_ATTRIBUTION_FILTER does the same for the AI attribution rules
above (proxy text, proxy push refusal, broker amend and refusal). It is on by
default and takes the same off values. The squash message hive builds is
always filtered.
CI guards
TestOutboundSitesInventory(src/pkg/prosefilter/outbound_sites_test.go) scans every non-test Go file undersrc/pkg,src/cmdandsrc/cruxfor functions that send an HTTP request with a body. Each one must be listed in its inventory as filtered (it calls the filter), filtered upstream by a named function that calls the filter, a hive template under the emit ratchet, or machine traffic with a reason. A new sender that is not listed fails CI, as does a filtered site that stops calling the filter. The test also pins the proxy, push broker, relay, PR, merge and notification boundaries.TestNoNewDashesInEmittedText(src/pkg/prosefilter/emit_guard_test.go) is a ratchet on hive’s own templates: the dash count of each emitter file may only go down.
Follow-ups
- GraphQL string literals inlined in the query text are not rewritten.
- Commits other than HEAD in a multi-commit push keep their messages.
pkg/fleetreportstill renders-separators as em-dashes in the affected-hives block and the seen log (held by the emit ratchet). Moving them to plain hyphens needs a parser that accepts both forms for issues already filed.