@@ -88,37 +88,6 @@ func TestFilterTenantOwned_Sagas_SystemFiltered(t *testing.T) {
8888 assert .Equal (t , "tenant_custom_saga" , result .Sagas [0 ].GetName ())
8989}
9090
91- // TestFilterTenantOwned_SagaOverride_Retained verifies that a tenant override saga
92- // (is_system=false with platform_ref) is retained after filtering.
93- // Tenant overrides are not in SystemCodes (they are not platform defaults), so they
94- // pass through filterTenantOwned and must be included in diff planning.
95- func TestFilterTenantOwned_SagaOverride_Retained (t * testing.T ) {
96- live := & LiveState {
97- Sagas : []* controlplanev1.SagaDefinition {
98- // Platform default: is_system=true, filtered out.
99- {Name : "platform_saga" },
100- // Tenant override: is_system=false, has platform_ref (tracked in PlatformRefs).
101- {Name : "override_saga" },
102- // Regular tenant saga: no platform_ref.
103- {Name : "custom_saga" },
104- },
105- SystemCodes : map [ResourceType ]map [string ]bool {
106- ResourceSaga : {"platform_saga" : true },
107- },
108- // PlatformRefs documents which sagas are tenant overrides of platform defaults.
109- PlatformRefs : map [ResourceType ]map [string ]bool {
110- ResourceSaga : {"override_saga" : true },
111- },
112- }
113- result := filterTenantOwned (live )
114- require .NotNil (t , result )
115- require .Len (t , result .Sagas , 2 , "both override_saga and custom_saga should be retained" )
116- names := sagaNames (result .Sagas )
117- assert .Contains (t , names , "override_saga" )
118- assert .Contains (t , names , "custom_saga" )
119- assert .NotContains (t , names , "platform_saga" )
120- }
121-
12291func TestFilterTenantOwned_MultipleTypes (t * testing.T ) {
12392 live := & LiveState {
12493 Instruments : []* controlplanev1.InstrumentDefinition {
@@ -226,20 +195,15 @@ func TestFilterTenantOwned_AllResourceTypesFiltered(t *testing.T) {
226195 assert .Equal (t , "tenant-route" , result .InstructionRoutes [0 ].GetInstructionType ())
227196}
228197
229- func TestFilterTenantOwned_PreservesSystemAndPlatformRefMaps (t * testing.T ) {
198+ func TestFilterTenantOwned_PreservesSystemCodesMap (t * testing.T ) {
230199 systemCodes := map [ResourceType ]map [string ]bool {
231200 ResourceInstrument : {"SYS_GBP" : true },
232201 }
233- platformRefs := map [ResourceType ]map [string ]bool {
234- ResourceSaga : {"override_saga" : true },
235- }
236202 live := & LiveState {
237- SystemCodes : systemCodes ,
238- PlatformRefs : platformRefs ,
203+ SystemCodes : systemCodes ,
239204 }
240205 result := filterTenantOwned (live )
241206 assert .Equal (t , systemCodes , result .SystemCodes )
242- assert .Equal (t , platformRefs , result .PlatformRefs )
243207}
244208
245209// --- helpers ---
@@ -251,11 +215,3 @@ func instrumentCodes(instruments []*controlplanev1.InstrumentDefinition) []strin
251215 }
252216 return codes
253217}
254-
255- func sagaNames (sagas []* controlplanev1.SagaDefinition ) []string {
256- names := make ([]string , len (sagas ))
257- for i , s := range sagas {
258- names [i ] = s .GetName ()
259- }
260- return names
261- }
0 commit comments