@@ -17,6 +17,12 @@ const ALLOWED_EXTENSION_PATH_STRING_TESTS = new Set([
1717 "src/scripts/test-projects.test.ts" ,
1818] ) ;
1919
20+ const ALLOWED_CONTRACT_BUNDLED_PATH_HELPERS = new Set ( [
21+ "src/plugins/contracts/boundary-invariants.test.ts" ,
22+ "src/plugins/contracts/plugin-sdk-index.bundle.test.ts" ,
23+ "src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts" ,
24+ ] ) ;
25+
2026describe ( "plugin contract boundary invariants" , ( ) => {
2127 it ( "keeps bundled-capability-metadata confined to contract/test inventory" , async ( ) => {
2228 const { globSync } = await import ( "glob" ) ;
@@ -67,4 +73,20 @@ describe("plugin contract boundary invariants", () => {
6773 } ) ;
6874 expect ( offenders ) . toEqual ( [ ] ) ;
6975 } ) ;
76+
77+ it ( "keeps plugin contract tests off bundled path helpers unless the test is explicitly about paths" , async ( ) => {
78+ const { globSync } = await import ( "glob" ) ;
79+ const files = globSync ( "src/plugins/contracts/**/*.test.ts" , {
80+ cwd : REPO_ROOT ,
81+ nodir : true ,
82+ } ) ;
83+ const offenders = files . filter ( ( file ) => {
84+ if ( ALLOWED_CONTRACT_BUNDLED_PATH_HELPERS . has ( file ) ) {
85+ return false ;
86+ }
87+ const source = readFileSync ( resolve ( REPO_ROOT , file ) , "utf8" ) ;
88+ return source . includes ( "test/helpers/bundled-plugin-paths" ) ;
89+ } ) ;
90+ expect ( offenders ) . toEqual ( [ ] ) ;
91+ } ) ;
7092} ) ;
0 commit comments