@@ -76,7 +76,9 @@ describe('normalizeAssetPackOutput', () => {
7676 } as any ) ;
7777
7878 expect ( result . semanticKind ) . toBe ( 'asset-pack-written-asset' ) ;
79- expect ( result . kind ) . toBe ( 'shippable' ) ;
79+ // Pure synthesis: not settle_delivery (settle-pipeline exclusive).
80+ expect ( result . kind ) . toBe ( 'asset_pack_synthesis' ) ;
81+ expect ( result . settleDelivery ) . toBeUndefined ( ) ;
8082 expect ( result . read ) . toBe ( 'Read a review-ready written asset' ) ;
8183 expect ( result . writtenAssetType ) . toBe ( 'read-satisfaction-asset-pack' ) ;
8284 expect ( result . deliveryMechanismTemplate ) . toBe ( 'pull-request' ) ;
@@ -92,6 +94,55 @@ describe('normalizeAssetPackOutput', () => {
9294 } ) ;
9395 } ) ;
9496
97+ it ( 'uses deposit_options kind when productPipeline is deposit synthesis' , ( ) => {
98+ const exec = new Execution ( 'pipeline:synthesize_deposit_asset_packs' ) ;
99+ exec . store ( 'execution' , 'id' , 'exec-deposit' ) ;
100+ exec . store ( 'pipeline' , 'productPipeline' , 'synthesize-deposits-asset-packs-pipeline' ) ;
101+ exec . store ( 'finish' , 'selectionEnvelope' , {
102+ schema : 'bitcode.deposit.synthesize-asset-packs.selection-envelope' ,
103+ options : [ { title : 'opt-a' } ] ,
104+ } ) ;
105+ exec . store ( 'implementation' , 'assetPackSynthesisArtifacts' , {
106+ summary : 'Deposit options ready for selection.' ,
107+ } ) ;
108+
109+ const result = buildAssetPackPostprocessedResult ( exec , {
110+ success : true ,
111+ summary : '' ,
112+ options : [ { title : 'opt-a' } ] ,
113+ selectionEnvelope : {
114+ schema : 'bitcode.deposit.synthesize-asset-packs.selection-envelope' ,
115+ options : [ { title : 'opt-a' } ] ,
116+ } ,
117+ } as any ) ;
118+
119+ expect ( result . kind ) . toBe ( 'deposit_options' ) ;
120+ expect ( result . settleDelivery ) . toBeUndefined ( ) ;
121+ expect ( result . selectionEnvelope ?. options ) . toHaveLength ( 1 ) ;
122+ expect ( result . summary ) . toBe ( 'Deposit options ready for selection.' ) ;
123+ } ) ;
124+
125+ it ( 'never prefers finish settleDelivery summary for synthesis (settle-exclusive surface)' , ( ) => {
126+ const exec = new Execution ( 'pipeline:asset-pack' ) ;
127+ exec . store ( 'implementation' , 'assetPackSynthesisArtifacts' , {
128+ summary : 'Authoritative synthesis summary.' ,
129+ } ) ;
130+ // Misnamed residual store must not win summary authority.
131+ exec . store ( 'finish/asset_pack_completion' , 'settleDelivery' , {
132+ summary : 'Wrong settle-shaped summary from synthesis Finish.' ,
133+ pullRequest : null ,
134+ } ) ;
135+
136+ const result = buildAssetPackPostprocessedResult ( exec , {
137+ success : true ,
138+ summary : '' ,
139+ } as any ) ;
140+
141+ expect ( result . summary ) . toBe ( 'Authoritative synthesis summary.' ) ;
142+ expect ( result . kind ) . not . toBe ( 'settle_delivery' ) ;
143+ expect ( result . settleDelivery ) . toBeUndefined ( ) ;
144+ } ) ;
145+
95146 it ( 'preserves implementation artifacts when postprocess runs from a sibling execution node' , ( ) => {
96147 const root = new Execution ( 'pipeline:asset-pack' ) ;
97148 const implementation = root . child ( 'phase:implementation' ) ;
@@ -118,32 +169,49 @@ describe('normalizeAssetPackOutput', () => {
118169 expect ( result . assetPackSynthesisArtifacts ?. proofEvidence ) . toEqual ( [ 'sibling-implementation-read' ] ) ;
119170 } ) ;
120171
121- it ( 'uses pull-request delivery mechanisms as canonical shippable evidence for the written asset ' , ( ) => {
172+ it ( 'surfaces settleDelivery only when settle Simple shippable exists on the EE ' , ( ) => {
122173 const exec = new Execution ( 'pipeline:asset-pack' ) ;
123174 exec . store ( 'execution' , 'id' , 'exec-2' ) ;
175+ exec . store ( 'settle-asset-pack-pipeline' , 'shippable' , {
176+ prUrl : 'https://github.com/acme/repo/pull/26' ,
177+ optionTitle : 'AssetPack PR' ,
178+ } ) ;
124179
125180 const result = buildAssetPackPostprocessedResult ( exec , {
126181 success : true ,
127- summary : 'Written asset delivered through PR .' ,
182+ summary : 'Settled delivery complete .' ,
128183 writtenAsset : {
129184 title : 'Read satisfaction summary' ,
130185 } ,
186+ semanticKind : 'asset-pack-written-asset' ,
187+ } as any ) ;
188+
189+ expect ( result . title ) . toBe ( 'Read satisfaction summary' ) ;
190+ expect ( result . kind ) . toBe ( 'settle_delivery' ) ;
191+ expect ( result . settleDelivery ?. pullRequest ) . toMatchObject ( {
192+ url : 'https://github.com/acme/repo/pull/26' ,
193+ } ) ;
194+ } ) ;
195+
196+ it ( 'does not invent settleDelivery from synthesis deliveryMechanism alone' , ( ) => {
197+ const exec = new Execution ( 'pipeline:asset-pack' ) ;
198+ exec . store ( 'execution' , 'id' , 'exec-2b' ) ;
199+
200+ const result = buildAssetPackPostprocessedResult ( exec , {
201+ success : true ,
202+ summary : 'Synthesis only — no settle.' ,
203+ writtenAsset : { title : 'Option set' } ,
131204 deliveryMechanism : {
132- title : 'AssetPack PR' ,
205+ title : 'Not a settle PR' ,
133206 prUrl : 'https://github.com/acme/repo/pull/26' ,
134207 } ,
135208 semanticKind : 'asset-pack-written-asset' ,
136209 } as any ) ;
137210
138- expect ( result . title ) . toBe ( 'Read satisfaction summary' ) ;
139- expect ( result . deliveryMechanism ) . toEqual ( {
140- title : 'AssetPack PR' ,
141- prUrl : 'https://github.com/acme/repo/pull/26' ,
142- } ) ;
143- expect ( result . shippable ) . toEqual ( {
144- title : 'AssetPack PR' ,
145- prUrl : 'https://github.com/acme/repo/pull/26' ,
146- } ) ;
211+ expect ( result . kind ) . toBe ( 'asset_pack_synthesis' ) ;
212+ expect ( result . settleDelivery ) . toBeUndefined ( ) ;
213+ // deliveryMechanism may still carry readiness-shaped data from the input
214+ expect ( result . deliveryMechanism ?. prUrl ) . toBe ( 'https://github.com/acme/repo/pull/26' ) ;
147215 } ) ;
148216
149217 it ( 'derives and stores source-safe preview evidence from an accepted Need and Finding Fits result' , ( ) => {
0 commit comments