@@ -70,6 +70,8 @@ const SYSTEM_CTX = { isSystem: true, positions: [], permissions: [] };
7070/** A package the showcase composition really loads — the claim a caller must not be able to make. */
7171const REAL_PACKAGE = 'com.example.showcase' ;
7272const ASSERTION = { _packageId : REAL_PACKAGE , _provenance : 'package' } ;
73+ /** [#28149] The showcase's paired customization package — where a clone of its flow lands. */
74+ const PAIR_PACKAGE = `${ REAL_PACKAGE } .custom` ;
7375
7476const definition = ( name : string ) => ( {
7577 name,
@@ -271,13 +273,22 @@ describe('a flow\'s package provenance is the server\'s fact at every door (show
271273 expect ( put . status , JSON . stringify ( put . json ) ) . toBe ( 200 ) ;
272274 } ) ;
273275
274- it ( 'a clone of a shipped flow is saved as a tenant row that reads back on the metadata door' , async ( ) => {
276+ it ( 'a clone of a shipped flow is saved as a row of the base\'s pair that reads back on the metadata door' , async ( ) => {
275277 const res = await call ( 'POST' , `/automation/${ SHIPPED } /clone` , { name : CLONE , label : 'Dogfood clone' } ) ;
276278 expect ( res . status , JSON . stringify ( res . json ) ) . toBe ( 200 ) ;
279+ // [#28149, ADR-0146 D3/D4] The copy lands in the base's paired
280+ // customization package, never package-less.
281+ expect ( dataOf ( res . json ) ?. packageId ) . toBe ( PAIR_PACKAGE ) ;
277282
278283 const served = await metaRead ( CLONE ) ;
279284 expect ( served . status , JSON . stringify ( served . doc ) ) . toBe ( 200 ) ;
280- expect ( isCodeArtifactBody ( served . doc ) ) . toBe ( false ) ;
285+ // MEASURED, as for META_BOUND above: the served body surfaces the row's
286+ // binding as a package stamp, which reads as code-shipped on its own…
287+ expect ( served . doc ?. _packageId ) . toBe ( PAIR_PACKAGE ) ;
288+ expect ( isCodeArtifactBody ( served . doc ) ) . toBe ( true ) ;
289+ // …and the copy is still the customer's to edit: its round trip saves.
290+ const echoed = await call ( 'PUT' , `/meta/flow/${ CLONE } ?package=${ PAIR_PACKAGE } ` , served . doc ) ;
291+ expect ( echoed . status , JSON . stringify ( echoed . json ) ) . toBe ( 200 ) ;
281292 // The clone is the customer's: the activation door refuses it too.
282293 const off = await call ( 'POST' , `/automation/${ CLONE } /toggle` , { enabled : false } ) ;
283294 expect ( off . status , JSON . stringify ( off . json ) ) . toBe ( 409 ) ;
0 commit comments