From 082a9bb93a6494145e47dd794e9b1a6f57d61981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E6=BE=9C?= Date: Tue, 4 Aug 2026 11:16:21 +0800 Subject: [PATCH] refactor(cli): relocate test-only decodeSchemaMetaIndexLookup to test helpers --- internal/cli/schema_meta_index.go | 8 -------- internal/cli/schema_orphan_helpers_test.go | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/cli/schema_meta_index.go b/internal/cli/schema_meta_index.go index 5b1fa7fc..2e834c57 100644 --- a/internal/cli/schema_meta_index.go +++ b/internal/cli/schema_meta_index.go @@ -217,14 +217,6 @@ func commandMetaLookupFromIndex(index SchemaMetaIndexSnapshot) (map[string]Comma return registerCommandMetaAliases(lookup, metas), nil } -func decodeSchemaMetaIndexLookup(data []byte) (map[string]CommandMeta, error) { - index, err := DecodeSchemaMetaIndex(data) - if err != nil { - return nil, err - } - return commandMetaLookupFromIndex(index) -} - // ValidateSchemaMetaIndexAgainstSnapshot proves the summary index matches the // Identity / Safety / Selection projection of every ToolSpec in a Catalog // snapshot (generation-time gate before writing the index). diff --git a/internal/cli/schema_orphan_helpers_test.go b/internal/cli/schema_orphan_helpers_test.go index e88fb6b3..4e75c6db 100644 --- a/internal/cli/schema_orphan_helpers_test.go +++ b/internal/cli/schema_orphan_helpers_test.go @@ -173,3 +173,11 @@ func walkLeafCommands(cmd *cobra.Command, fn func(*cobra.Command)) { walkLeafCommands(sub, fn) } } + +func decodeSchemaMetaIndexLookup(data []byte) (map[string]CommandMeta, error) { + index, err := DecodeSchemaMetaIndex(data) + if err != nil { + return nil, err + } + return commandMetaLookupFromIndex(index) +}