@@ -587,6 +587,58 @@ describe("release plan producer", () => {
587587 ] ) ;
588588 } ) ;
589589
590+ it ( "ignores large runtime trees when collecting candidate metadata" , ( ) => {
591+ const fixture = createFixtureRepo ( ) ;
592+ const params = sourceParams ( fixture ) ;
593+ const expected = produceReleasePlan ( params ) . inventory ;
594+ const git = ( args : string [ ] , input ?: string ) =>
595+ execFileSync (
596+ "git" ,
597+ [ "-c" , "user.name=OpenClaw Test" , "-c" , "[email protected] " , ...
args ] , 598+ { cwd : fixture . root , encoding : "utf8" , input } ,
599+ ) . trim ( ) ;
600+ const blob = git ( [ "hash-object" , "-w" , "--stdin" ] , "" ) ;
601+ // Git objects reproduce the >1 MiB listing without creating thousands of files.
602+ const runtimeTree = git (
603+ [ "mktree" ] ,
604+ Array . from (
605+ { length : 6000 } ,
606+ ( _ , index ) => `100644 blob ${ blob } \truntime-${ index } -${ "x" . repeat ( 180 ) } .ts\n` ,
607+ ) . join ( "" ) ,
608+ ) ;
609+ const pluginsTree = git ( [ "mktree" ] , `040000 tree ${ runtimeTree } \tnoise\n` ) ;
610+ const rootTree = git (
611+ [ "mktree" ] ,
612+ `${ git ( [ "ls-tree" , fixture . candidateSha ] ) } \n040000 tree ${ pluginsTree } \textensions\n` ,
613+ ) ;
614+ const candidateSha = git ( [
615+ "commit-tree" ,
616+ rootTree ,
617+ "-p" ,
618+ fixture . candidateSha ,
619+ "-m" ,
620+ "runtime" ,
621+ ] ) ;
622+ expect ( produceReleasePlan ( { ...params , candidateSha } ) . inventory ) . toEqual ( expected ) ;
623+ } ) ;
624+
625+ it . each ( [
626+ "package.json" ,
627+ "packages/ai/package.json" ,
628+ "extensions/linked/package.json" ,
629+ "extensions/linked/README.md" ,
630+ ] ) ( "rejects candidate metadata symlinks at %s" , ( path ) => {
631+ const fixture = createFixtureRepo ( ) ;
632+ const target = join ( fixture . root , path ) ;
633+ mkdirSync ( dirname ( target ) , { recursive : true } ) ;
634+ rmSync ( target , { force : true } ) ;
635+ symlinkSync ( "must-not-be-read" , target ) ;
636+ const candidateSha = commit ( fixture . root , "linked metadata" ) ;
637+ expect ( ( ) => produceReleasePlan ( { ...sourceParams ( fixture ) , candidateSha } ) ) . toThrow (
638+ "candidate package inventory must not contain symbolic links" ,
639+ ) ;
640+ } ) ;
641+
590642 it ( "requires the final tag only for postpublish confidence" , ( ) => {
591643 const fixture = createFixtureRepo ( ) ;
592644 expect ( produceReleasePlan ( sourceParams ( fixture ) ) ) . toMatchObject ( {
0 commit comments