Skip to content

Commit c3a57d6

Browse files
V48: Ban settle/delivery from synthesis layers
Synthesis postprocess and Finish never project settleDelivery, shippable PR, settlement rights unlock, delivery posture, or settlement instructions. Those surfaces are exclusive to settle-asset-pack-pipeline. Host/API synthesis paths align.
1 parent 7890344 commit c3a57d6

5 files changed

Lines changed: 87 additions & 235 deletions

File tree

packages/asset-packs-pipelines/domain/src/__tests__/finish-completion.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ describe('finish AssetPack completion evidence', () => {
3333
});
3434
expect((result as any).settlePassThrough).toBeUndefined();
3535
expect((result as any).settleDelivery).toBeUndefined();
36-
expect(result.deliveryMechanism?.pullRequest).toBeNull();
36+
expect((result as any).shippable).toBeUndefined();
37+
expect((result.deliveryMechanism as any)?.pullRequest).toBeUndefined();
3738
expect(result.summary).toContain('octocat/Spoon-Knife');
3839
expect(result.deliveryMechanism?.readiness).toMatchObject({
3940
status: 'pending-user-review',
@@ -58,6 +59,7 @@ describe('finish AssetPack completion evidence', () => {
5859
const result = await AssetPackCompletionAgent({}, exec);
5960
expect((result as any).settlePassThrough).toBeUndefined();
6061
expect((result as any).settleDelivery).toBeUndefined();
61-
expect(result.deliveryMechanism?.pullRequest).toBeNull();
62+
expect((result as any).shippable).toBeUndefined();
63+
expect((result.deliveryMechanism as any)?.pullRequest).toBeUndefined();
6264
});
6365
});

packages/asset-packs-pipelines/domain/src/__tests__/postprocess.test.ts

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -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(/^sha256:/);
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(/^sha256:/);
313298
expect(result.assetPackDisclosureReview?.roots.reviewRoot).toMatch(/^sha256:/);
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
});

packages/asset-packs-pipelines/domain/src/agents/finish/asset-pack-completion-agent.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@ import {
77
} from '../../semantic-resolution';
88

99
// Header-expected shapes for settle delivery + synthesis evidence surfaces.
10-
export const ShippableSchema = z.object({
11-
url: z.string(),
12-
number: z.number().optional(),
13-
title: z.string().optional(),
14-
description: z.string().optional(),
15-
content: z.string().optional(),
16-
status: z.enum(['open', 'closed', 'merged', 'draft']).optional(),
17-
createdAt: z.string().optional(),
18-
});
19-
2010
export const FileChangesSchema = z.object({
2111
edited: z.number().optional(),
2212
created: z.number().optional(),
@@ -28,7 +18,6 @@ export const FileChangesSchema = z.object({
2818
});
2919

3020
const WrittenAssetsSchema = z.object({
31-
pullRequest: ShippableSchema.nullable().optional(),
3221
fileChanges: FileChangesSchema.nullable().optional(),
3322
summary: z.string().nullable().optional(),
3423
});
@@ -38,8 +27,8 @@ const AssetPackSynthesisArtifactsSchema = WrittenAssetsSchema.extend({
3827
reviewNotes: z.array(z.string()).optional(),
3928
});
4029

30+
/** Review readiness only — no pullRequest (settle exclusive). */
4131
const DeliveryMechanismSchema = z.object({
42-
pullRequest: ShippableSchema.nullable().optional(),
4332
summary: z.string().nullable().optional(),
4433
readiness: z
4534
.object({
@@ -234,9 +223,8 @@ const AssetPackCompletionAgent = factoryAgentWithSingleStep<any, AssetPackComple
234223
: {
235224
...writtenAssets,
236225
};
237-
// Review readiness only — never pullRequest / settleDelivery.
226+
// Review readiness only — never pullRequest / settleDelivery / shippable.
238227
const deliveryMechanism = {
239-
pullRequest: null,
240228
summary,
241229
readiness: deliveryReadiness,
242230
};

0 commit comments

Comments
 (0)