@@ -114,6 +114,46 @@ static void nativeInsertCatalogInstanceProjectionRegression() {
114114 const auto before=juce::JSON::toString (untouched,false );
115115 assert (!projectApprovedNativeV8 (untouched,invalid,true ));
116116 assert (juce::JSON::toString (untouched,false )==before);
117+
118+ // M6: the native projection is the first fail-closed boundary for
119+ // unstable VST3 lease tokens. JS must never be asked to guess which
120+ // physical plugin/editor is owned by a duplicated instance identity.
121+ const auto rejectUnchanged=[](const juce::var& bus) {
122+ auto untouched=canonicalSnapshot ();
123+ const auto before=juce::JSON::toString (untouched,false );
124+ assert (!projectApprovedNativeV8 (untouched,bus,true ));
125+ assert (juce::JSON::toString (untouched,false )==before);
126+ };
127+ auto duplicateAcrossChannels=juce::JSON::parse (
128+ juce::JSON::toString (source,false ));
129+ duplicateAcrossChannels.getProperty (" channels" ,{})[1 ].getDynamicObject ()
130+ ->setProperty (" inserts" ,
131+ duplicateAcrossChannels.getProperty (" channels" ,{})[0 ]
132+ .getProperty (" inserts" ,{}));
133+ rejectUnchanged (duplicateAcrossChannels);
134+
135+ auto duplicateSameChannel=juce::JSON::parse (
136+ juce::JSON::toString (source,false ));
137+ auto * existing=duplicateSameChannel.getProperty (" channels" ,{})[0 ]
138+ .getProperty (" inserts" ,{}).getArray ();
139+ assert (existing && existing->size ()==1 );
140+ existing->add (juce::JSON::parse (juce::JSON::toString ((*existing)[0 ],false )));
141+ rejectUnchanged (duplicateSameChannel);
142+
143+ auto overfullRack=juce::JSON::parse (
144+ juce::JSON::toString (source,false ));
145+ juce::Array<juce::var> nine;
146+ for (int i=0 ;i<9 ;++i) {
147+ auto fx=std::make_unique<juce::DynamicObject>();
148+ fx->setProperty (" instanceId" ," unique-FX-" +juce::String (i+1 ));
149+ fx->setProperty (" id" ," vendor.eq.catalog" );
150+ fx->setProperty (" name" ," Vendor EQ" );
151+ fx->setProperty (" bypassed" ,false );
152+ nine.add (juce::var (fx.release ()));
153+ }
154+ overfullRack.getProperty (" channels" ,{})[0 ].getDynamicObject ()
155+ ->setProperty (" inserts" ,juce::var (nine));
156+ rejectUnchanged (overfullRack);
117157}
118158
119159static void noMutationOnReject (juce::var snapshot,juce::var bus,bool admitted) {
0 commit comments