From 95bc56de8a9d0768ef6e93f325908f82fda2d391 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 29 Aug 2026 00:34:27 +0200 Subject: [PATCH] refactor(mcp): drop unused RequiredCreate and duplicate op tests --- pkg/modules/mcp/registry.go | 4 ---- pkg/modules/mcp/registry_test.go | 20 -------------------- 2 files changed, 24 deletions(-) diff --git a/pkg/modules/mcp/registry.go b/pkg/modules/mcp/registry.go index 2dc26dde7..13f1d039a 100644 --- a/pkg/modules/mcp/registry.go +++ b/pkg/modules/mcp/registry.go @@ -128,10 +128,6 @@ type Resource struct { // fields are unaffected. OptionalFields []string - // RequiredCreate marks additional fields required on create when the - // tags alone don't say so. - RequiredCreate []string - // IdentityFields overrides how read_one/update/delete address a record, // by JSON property name, for models whose row isn't addressed by its id // (team members go by team + username) or that need parent context the diff --git a/pkg/modules/mcp/registry_test.go b/pkg/modules/mcp/registry_test.go index 53520a3f3..4a384eeac 100644 --- a/pkg/modules/mcp/registry_test.go +++ b/pkg/modules/mcp/registry_test.go @@ -48,19 +48,6 @@ func TestOpPermission(t *testing.T) { } } -func TestOpToolSuffix(t *testing.T) { - cases := map[Op]string{ - OpCreate: "create", - OpReadOne: "read_one", - OpReadAll: "read_all", - OpUpdate: "update", - OpDelete: "delete", - } - for op, want := range cases { - assert.Equalf(t, want, op.ToolSuffix(), "ToolSuffix() for op %d", op) - } -} - func TestOpUnknownPermission(t *testing.T) { // Combined bitmasks and zero values have no defined permission string. assert.Empty(t, Op(0).Permission()) @@ -202,10 +189,3 @@ func TestRegisterOnlyExposesEnabledOps(t *testing.T) { _, ok = lookupTool("stubs_delete") assert.False(t, ok) } - -func TestAllOps(t *testing.T) { - // AllOps must enumerate exactly the five supported ops so the registry - // and the dispatcher walk the same list. - want := []Op{OpCreate, OpReadOne, OpReadAll, OpUpdate, OpDelete} - assert.Equal(t, want, AllOps()) -}