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): pin goose as a canonical harness name
Claude2855a8c964f7
diff --git a/pkg/asymptoteobserve/harness.go b/pkg/asymptoteobserve/harness.goindex b5852fb5..1bacc6b5 100644--- a/pkg/asymptoteobserve/harness.go+++ b/pkg/asymptoteobserve/harness.go@@ -249,6 +249,42 @@ func NormalizeHarnessName(name string) string {lower == "kiro_agent" || lower == "kiro-agent" || lower == "kiro agent" ||lower == "kiro.dev":return "kiro"+ // goose (Block) reaches Beacon over two paths at once, and pinning the name here is what keeps+ // them from splitting one session in two. The hook path installs with --platform goose; the+ // OTLP path reads goose's own resource attributes, which set service.name and+ // service.namespace to the literal string "goose". Both land on the same value only because+ // this case exists to say so.+ //+ // The canonical spelling is plain `goose` for the reason `cline`, `openhands` and `kiro` are+ // unsuffixed: one agent core serves the CLI, the desktop app and the embedded server, all+ // three discover the same `.agents/plugins` hooks and all three export under the same+ // service.name -- so a CLI suffix would name one of the surfaces the events come from and not+ // the others.+ //+ // Equality against a closed set rather than Contains(lower, "goose"), and here the substring+ // rule would be worse than usual on three counts:+ //+ // - GooseAI is a different company's LLM inference service. Its spellings -- gooseai,+ // goose-ai, goose.ai -- are a model provider, not this runtime, and they are deliberately+ // absent from the set. That is the Muse Spark and OpenHands LM failure in a sharper form:+ // those are at least the same vendor's model, while this would file a third party's+ // inference endpoint as Block's agent.+ // - "goose" is an ordinary English word, so it turns up in repository names, hostnames and+ // user names that a harness attribute can legitimately carry.+ // - goose stamps its own name across paths and configuration a reader may pass through this+ // function -- .goosehints, GOOSE_MODE, goose-docs -- exactly the Kiro hazard above.+ //+ // Everything left out falls to the passthrough case and shows up as itself, which reads as an+ // anomaly a person can act on rather than a silent misattribution.+ //+ // "codename goose" is in the set because it is the project's own branding and appears in+ // release artifacts and documentation, so it is a spelling that arrives in practice rather+ // than one invented here.+ case lower == "goose" || lower == "goose_cli" || lower == "goose-cli" || lower == "goose cli" ||+ lower == "goosecli" || lower == "goose_agent" || lower == "goose-agent" || lower == "goose agent" ||+ lower == "codename_goose" || lower == "codename-goose" || lower == "codename goose" ||+ lower == "block_goose" || lower == "block-goose" || lower == "block goose":+ return "goose"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 1261d194..7081477f 100644--- a/pkg/asymptoteobserve/harness_test.go+++ b/pkg/asymptoteobserve/harness_test.go@@ -22,6 +22,7 @@ func TestHookPlatformsConvergeOnCanonicalNames(t *testing.T) {"qwen": "qwen_code","prime": "prime_agent","muse": "muse_code",+ "goose": "goose",} {t.Run(platform, func(t *testing.T) {if got := NormalizeHarnessName(platform); got != want {@@ -41,7 +42,7 @@ func TestCanonicalNamesAreStableUnderRenormalization(t *testing.T) {"claude_code", "codex_cli", "gemini_cli", "antigravity_cli", "vscode_copilot","copilot_cli", "claude_web", "chatgpt_web", "claude_cowork", "claude_agent_sdk","openclaw_gateway", "pi_cli", "omp", "cline", "qwen_code", "prime_agent", "vercel_fx",- "muse_code", "grok_bot",+ "muse_code", "grok_bot", "goose",} {t.Run(canonical, func(t *testing.T) {if got := NormalizeHarnessName(canonical); got != canonical {@@ -616,3 +617,64 @@ func TestKiroCanonicalNameIsStableUnderRenormalization(t *testing.T) {t.Fatalf("NormalizeHarnessName(%q) = %q, want %q", once, got, once)}}++// goose (Block) is the case where the two writers demonstrably agree before normalization: the+// hook path installs with --platform goose and goose's OTLP resource sets service.name to the+// literal "goose". This pins that agreement rather than assuming it, because the canonical value+// is what every other goose spelling is folded onto.+func TestGooseSpellingsConvergeOnGoose(t *testing.T) {+ for _, in := range []string{+ "goose", "Goose", "GOOSE", " goose ", "goose_cli", "goose-cli", "Goose CLI", "goosecli",+ "goose_agent", "goose-agent", "Goose Agent", "codename_goose", "codename-goose",+ "Codename Goose", "block_goose", "block-goose", "Block Goose",+ } {+ t.Run(in, func(t *testing.T) {+ if got := NormalizeHarnessName(in); got != "goose" {+ t.Errorf("NormalizeHarnessName(%q) = %q, want %q", in, got, "goose")+ }+ })+ }+}++// The sharpest reason the goose case is an equality match. GooseAI is a different company's LLM+// inference service, so a Contains(lower, "goose") rule would report a third party's model+// provider as Block's agent -- the Muse Spark and OpenHands LM hazard, except that those are at+// least the same vendor's own model. These must fall through and show up as themselves.+func TestGooseAIProviderSpellingsAreNotTheGooseHarness(t *testing.T) {+ for _, name := range []string{+ "gooseai", "goose-ai", "goose_ai", "goose.ai", "gooseai/gpt-neo-20b", "GooseAI",+ } {+ t.Run(name, func(t *testing.T) {+ if got := NormalizeHarnessName(name); got == "goose" {+ t.Errorf("NormalizeHarnessName(%q) = %q; GooseAI is an inference provider and "++ "must not be reported as the goose harness", name, got)+ }+ })+ }+}++// "goose" is an ordinary English word and goose stamps it across its own paths and configuration,+// so the closed set has to exclude both. Falling through to the passthrough case is the wanted+// behavior: the value shows up as itself, which reads as an anomaly rather than a goose session.+func TestNamesMerelyContainingGooseAreNotTheGooseHarness(t *testing.T) {+ for _, name := range []string{+ ".goosehints", "GOOSE_MODE", "goose-docs", "mongoose", "gooseberry", "wild-goose-chase",+ "goose-island", "goosebumps",+ } {+ t.Run(name, func(t *testing.T) {+ if got := NormalizeHarnessName(name); got == "goose" {+ t.Errorf("NormalizeHarnessName(%q) = %q; a name merely containing \"goose\" must "++ "not be reported as the goose harness", name, got)+ }+ })+ }+}++// The normalized name is itself a spelling this function accepts, so a row read out of the runtime+// log and fed back in resolves to the same harness rather than drifting to a second name.+func TestGooseCanonicalNameIsStableUnderRenormalization(t *testing.T) {+ once := NormalizeHarnessName("codename goose")+ if got := NormalizeHarnessName(once); got != once {+ t.Fatalf("NormalizeHarnessName(%q) = %q, want %q", once, got, once)+ }+}