@@ -47,7 +47,8 @@ describe('normalizeAssetPackOutput', () => {
4747 prUrl : 'https://github.com/acme/repo/pull/123' ,
4848 } ) ;
4949 const withSettleKeysPresent = normalizeAssetPackOutput ( output , exec ) ;
50- expect ( withSettleKeysPresent . shippable ?. prUrl ) . toBeUndefined ( ) ;
50+ expect ( ( withSettleKeysPresent as any ) . shippable ) . toBeUndefined ( ) ;
51+ expect ( ( withSettleKeysPresent as any ) . settleDelivery ) . toBeUndefined ( ) ;
5152 expect ( withSettleKeysPresent . deliveryMechanism ?. prUrl ) . toBeUndefined ( ) ;
5253 } ) ;
5354
@@ -191,8 +192,10 @@ describe('normalizeAssetPackOutput', () => {
191192 expect ( result . title ) . toBe ( 'Read satisfaction summary' ) ;
192193 expect ( result . kind ) . toBe ( 'asset_pack_synthesis' ) ;
193194 expect ( result . kind ) . not . toBe ( 'settle_delivery' as any ) ;
194- expect ( result . settleDelivery ) . toBeUndefined ( ) ;
195- expect ( result . shippable ) . toBeUndefined ( ) ;
195+ expect ( ( result as any ) . settleDelivery ) . toBeUndefined ( ) ;
196+ expect ( ( result as any ) . shippable ) . toBeUndefined ( ) ;
197+ expect ( ( result as any ) . assetPackSettlementRightsDeliveryBoundary ) . toBeUndefined ( ) ;
198+ expect ( ( result as any ) . assetPackDeliveryUnlock ) . toBeUndefined ( ) ;
196199 } ) ;
197200
198201 it ( 'strips PR fields from deliveryMechanism on synthesis postprocess' , ( ) => {
@@ -264,6 +267,7 @@ describe('normalizeAssetPackOutput', () => {
264267 const normalized = normalizeAssetPackOutput ( {
265268 success : true ,
266269 summary : 'Measured AssetPack preview ready.' ,
270+ // prUrl on deliveryMechanism must not become a settle PR target.
267271 deliveryMechanism : {
268272 prUrl : 'https://github.com/octocat/Spoon-Knife/pull/28' ,
269273 } ,
@@ -281,55 +285,30 @@ describe('normalizeAssetPackOutput', () => {
281285 fitDepositAssetIds : [ 'fit-deposit-1' ] ,
282286 scoreBand : 'high' ,
283287 } ,
284- disclosurePolicy : {
285- protectedSourceDisclosure : 'forbidden_before_settlement' ,
286- } ,
287- settlementBoundary : {
288- payer : 'reader' ,
289- payee : 'depositor' ,
290- serverCustody : false ,
291- } ,
292- unlock : {
293- state : 'pending_settlement' ,
294- sourceAvailable : false ,
295- } ,
296288 } ) ;
297- expect ( normalized . sourceSafePreview . delivery . pullRequestTarget ) . toBe (
298- 'https://github.com/octocat/Spoon-Knife/pull/28'
299- ) ;
289+ // Synthesis never binds buyer-repo PR targets (settle exclusive).
290+ expect ( normalized . sourceSafePreview . delivery . pullRequestTarget ) . toBeNull ( ) ;
291+ expect ( ( normalized as any ) . settleDelivery ) . toBeUndefined ( ) ;
292+ expect ( ( normalized as any ) . shippable ) . toBeUndefined ( ) ;
300293 expect ( normalized . feeQuote . quoteRoot ) . toMatch ( / ^ s h a 2 5 6 : / ) ;
301294 expect ( normalized . assetPackDisclosureReview ) . toMatchObject ( {
302295 schema : 'bitcode.asset-pack.disclosure-review' ,
303- access : {
304- readRightState : 'pending_settlement' ,
305- sourceVisibility : 'withheld_before_settlement' ,
306- readerAction : 'pay_to_unlock' ,
307- } ,
308- sourceLeakage : {
309- protectedSourceDetected : false ,
310- } ,
311296 } ) ;
312297 expect ( result . sourceSafePreview ?. roots . previewRoot ) . toMatch ( / ^ s h a 2 5 6 : / ) ;
313298 expect ( result . assetPackDisclosureReview ?. roots . reviewRoot ) . toMatch ( / ^ s h a 2 5 6 : / ) ;
314299 expect ( result . feeQuote ?. finalityState ) . toBe ( 'preview_not_paid' ) ;
315300 expect ( result . assetPackPreviewBoundary ?. schema ) . toBe ( 'bitcode.asset-pack.preview-boundary' ) ;
316301 expect ( result . assetPackQuoteReceipt ?. quoteRoot ) . toBe ( result . feeQuote ?. quoteRoot ) ;
317- expect ( result . assetPackSettlementInstructions ) . toMatchObject ( {
318- payer : 'reader' ,
319- payee : 'depositor' ,
320- serverCustody : false ,
321- settlementRequiredBeforeUnlock : true ,
322- } ) ;
323- expect ( result . assetPackDeliveryPosture ) . toMatchObject ( {
324- state : 'withheld_until_settlement' ,
325- sourceBearingDeliveryVisible : false ,
326- availableAfterSettlement : true ,
327- } ) ;
302+ // Settlement instructions / delivery posture / rights unlock not projected.
303+ expect ( ( result as any ) . assetPackSettlementInstructions ) . toBeUndefined ( ) ;
304+ expect ( ( result as any ) . assetPackDeliveryPosture ) . toBeUndefined ( ) ;
305+ expect ( ( result as any ) . assetPackSettlementRightsDeliveryBoundary ) . toBeUndefined ( ) ;
306+ expect ( ( result as any ) . assetPackDeliveryUnlock ) . toBeUndefined ( ) ;
328307 expect ( exec . get ( 'asset-pack/preview' , 'sourceSafe' ) ?. previewId ) . toBe (
329308 normalized . sourceSafePreview . previewId
330309 ) ;
331310 expect ( exec . get ( 'asset-pack/preview' , 'boundary' ) ?. boundaryId ) . toBe (
332- normalized . assetPackPreviewBoundary . boundaryId
311+ ( normalized as any ) . assetPackPreviewBoundary ? .boundaryId
333312 ) ;
334313 expect ( JSON . stringify ( normalized . sourceSafePreview ) ) . not . toContain ( 'diff --git' ) ;
335314 } ) ;
0 commit comments