The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
feat(harness): add the deepseek_harness canonical name
Claude1ead6b954b65
diff --git a/pkg/asymptoteobserve/harness.go b/pkg/asymptoteobserve/harness.goindex e72d7c3b..2c95447d 100644--- a/pkg/asymptoteobserve/harness.go+++ b/pkg/asymptoteobserve/harness.go@@ -315,6 +315,38 @@ func NormalizeHarnessName(name string) string {lower == "codename_goose" || lower == "codename-goose" || lower == "codename goose" ||lower == "block_goose" || lower == "block-goose" || lower == "block goose":return "goose"+ // DeepSeek Harness (`dsh`) is DeepSeek's open agent harness: a TypeScript, plugin-composed+ // runtime whose CLI, Web, ACP and SDK surfaces all boot from one `$DSH_HOME` and one patch+ // layer -- so Beacon hooks all of them at once through a single mount and there is one runtime+ // to name, not four.+ //+ // The canonical spelling is `deepseek_harness` rather than `dsh`, for the reason vercel_fx is+ // not `fx`: harness.name is what a SIEM query groups by, and a three-letter value there says+ // nothing about which product produced the row. `dsh` is accepted as an input spelling because+ // it is what the binary is called and what an operator types.+ //+ // Equality against a closed set, and this is the sharpest case in this function for it.+ // DeepSeek ships the agent and a model family under one name, so every DeepSeek model id+ // begins with the letters the harness does -- deepseek-chat, deepseek-reasoner, deepseek-v3,+ // deepseek-r1, deepseek-coder. A Contains(lower, "deepseek") rule would report any event whose+ // harness attribute happened to carry one of those model strings as a DeepSeek Harness+ // session, and the misattribution would be unreadable as one because both start with the same+ // word. The same hazard applies to `dsh`: the runtime stamps those three letters on+ // environment variables and paths that legitimately appear in other fields -- DSH_HOME,+ // ~/.dsh, DSH_GITHUB_WEBHOOK_SECRET, the managed $DSH_* variables a bash tool call can print.+ //+ // Bare `deepseek` is deliberately NOT in the set, and that is the one entry a reader is most+ // likely to want to add. It is the vendor and the model family, not the harness: an OTLP+ // resource attribute reading "deepseek" is far more likely to have come from a provider route+ // than from this runtime, and filing it under the agent would attribute somebody's API traffic+ // to an endpoint install that may not exist. It falls to the passthrough case and shows up as+ // itself, which reads as an anomaly a person can act on.+ case lower == "dsh" || lower == "dsh_cli" || lower == "dsh-cli" || lower == "dsh cli" ||+ lower == "dshcli" || lower == "deepseek_harness" || lower == "deepseek-harness" ||+ lower == "deepseek harness" || lower == "deepseekharness" ||+ lower == "deepseek_ai/dsh" || lower == "deepseek-ai/dsh" ||+ lower == "@deepseek-ai/dsh" || lower == "deepseek_dsh" || lower == "deepseek-dsh":+ return "deepseek_harness"case name != "":// An unrecognized runtime keeps its own name rather than being coerced or dropped. A new// harness should show up in the log as itself, not as "unknown".diff --git a/pkg/asymptoteobserve/harness_test.go b/pkg/asymptoteobserve/harness_test.goindex 16fb8b81..2df47b10 100644--- a/pkg/asymptoteobserve/harness_test.go+++ b/pkg/asymptoteobserve/harness_test.go@@ -24,6 +24,7 @@ func TestHookPlatformsConvergeOnCanonicalNames(t *testing.T) {"omo": "omo_senpi","muse": "muse_code","goose": "goose",+ "dsh": "deepseek_harness",} {t.Run(platform, func(t *testing.T) {if got := NormalizeHarnessName(platform); got != want {@@ -758,3 +759,74 @@ func TestGooseCanonicalNameIsStableUnderRenormalization(t *testing.T) {t.Fatalf("NormalizeHarnessName(%q) = %q, want %q", once, got, once)}}++func TestDeepSeekHarnessSpellingsConvergeOnDeepSeekHarness(t *testing.T) {+ for _, in := range []string{+ "dsh", "DSH", " dsh ", "Dsh", "dsh_cli", "dsh-cli", "DSH CLI", "dshcli",+ "deepseek_harness", "deepseek-harness", "DeepSeek Harness", "deepseekharness",+ "deepseek_ai/dsh", "deepseek-ai/dsh", "@deepseek-ai/dsh", "deepseek_dsh", "deepseek-dsh",+ } {+ t.Run(in, func(t *testing.T) {+ if got := NormalizeHarnessName(in); got != "deepseek_harness" {+ t.Errorf("NormalizeHarnessName(%q) = %q, want %q", in, got, "deepseek_harness")+ }+ })+ }+}++// The reason the DeepSeek Harness case is an equality match rather than a Contains rule, in its+// model half. DeepSeek ships the agent and a model family under one name, so every DeepSeek model+// id begins with the letters the harness does. A substring rule would file an event whose harness+// attribute carried one of those model strings as a DeepSeek Harness session, and a reader could+// not tell the misattribution from the real thing.+func TestDeepSeekModelSpellingsAreNotTheDeepSeekHarness(t *testing.T) {+ for _, name := range []string{+ "deepseek-chat", "deepseek-reasoner", "deepseek-v3", "deepseek-v3.2", "deepseek-r1",+ "deepseek-coder", "deepseek-coder-v2", "deepseek-ai/DeepSeek-V3", "DeepSeek-R1-0528",+ } {+ t.Run(name, func(t *testing.T) {+ if got := NormalizeHarnessName(name); got == "deepseek_harness" {+ t.Errorf("NormalizeHarnessName(%q) = %q; a DeepSeek model id must not be reported "++ "as the DeepSeek Harness runtime", name, got)+ }+ })+ }+}++// Bare "deepseek" is the vendor and the model family, not the harness. It is the entry a reader is+// most likely to want to add to the set, and adding it would attribute provider traffic to an+// endpoint install that may not exist. Pinned as a decision rather than left to be re-litigated.+func TestBareDeepSeekIsNotTheDeepSeekHarness(t *testing.T) {+ for _, name := range []string{"deepseek", "DeepSeek", " deepseek ", "deepseek.com", "deepseek_api"} {+ t.Run(name, func(t *testing.T) {+ if got := NormalizeHarnessName(name); got == "deepseek_harness" {+ t.Errorf("NormalizeHarnessName(%q) = %q; bare \"deepseek\" names the vendor and "++ "the model family, not the harness", name, got)+ }+ })+ }+}++// The other half of the equality rule. `dsh` is three letters the runtime stamps on environment+// variables and paths that legitimately turn up in other fields, and a Contains rule would claim+// any of them.+func TestNamesMerelyContainingDshAreNotTheDeepSeekHarness(t *testing.T) {+ for _, name := range []string{+ "DSH_HOME", "~/.dsh", ".dsh/skills", "dsh-runtime-sandbox", "dshield", "sdsh", "dshell",+ } {+ t.Run(name, func(t *testing.T) {+ if got := NormalizeHarnessName(name); got == "deepseek_harness" {+ t.Errorf("NormalizeHarnessName(%q) = %q; a name merely containing \"dsh\" must not "++ "be reported as the DeepSeek Harness runtime", name, got)+ }+ })+ }+}++// A name that has been through the function once must not change meaning going through again.+func TestDeepSeekHarnessIsStableUnderRenormalization(t *testing.T) {+ once := NormalizeHarnessName("dsh")+ if twice := NormalizeHarnessName(once); twice != once {+ t.Fatalf("NormalizeHarnessName(%q) = %q; the canonical name must be stable", once, twice)+ }+}diff --git a/pkg/asymptoteobserve/provenance_test.go b/pkg/asymptoteobserve/provenance_test.goindex 77539e58..f65d8bd0 100644--- a/pkg/asymptoteobserve/provenance_test.go+++ b/pkg/asymptoteobserve/provenance_test.go@@ -125,6 +125,15 @@ func TestCollectionMethodForPlatform(t *testing.T) {// loads and executes, which it does not: Kiro runs a command, and the command is the same// beacon-hooks binary every other hook runtime runs."kiro": CollectionMethodHook,+ // DeepSeek Harness is hook-shaped, and it is the case most likely to be argued the other+ // way. The runtime reaches Beacon through `@deepseek-ai/dsh-hooks-claude-code`, a plugin --+ // but that plugin is DeepSeek's, shipped in the `dsh` CLI and versioned with it. What Beacon+ // contributes is a hooks file of command entries and one row mounting the vendor's bridge, so+ // the thing that runs on each event is the same beacon-hooks binary every other hook runtime+ // runs. `plugin` is reserved for the runtimes where Beacon ships and versions the source the+ // runtime loads (opencode, Cline, Pi, Oh My Pi), and claiming it here would send someone to+ // fix Beacon for a field the bridge never sent.+ "dsh": CollectionMethodHook,// vscode is the case that justifies keying on --platform rather than on the normalized// harness name: its hook and OTLP telemetry both normalize to vscode_copilot, so the// harness name cannot distinguish them and only the flag can.