@@ -12,6 +12,7 @@ import * as Effect from "effect/Effect";
1212import { makePrimeArtifactGraduationHarness } from "./PrimeAgentArtifactGraduation.test-fixture.ts" ;
1313import { loadPrimeAgentDaemonBridge } from "./PrimeAgentDaemonBridge.ts" ;
1414import { PRIME_MANAGED_TOOL_DIRECTORY } from "./PrimeAgentManagedToolStore.ts" ;
15+ import { PRIME_STOCK_ARTIFACT , verifyPrimeStockArtifactBytes } from "./PrimeAgentStockArtifact.ts" ;
1516
1617const execFile = NodeUtil . promisify ( NodeChildProcess . execFile ) ;
1718const required = process . env . PYLON_PRIME_GRADUATION_REQUIRED === "1" ;
@@ -74,6 +75,7 @@ it.skipIf(!configured)(
7475 try {
7576 const stockRoot = NodePath . resolve ( stockBinaryPath ! , "../../.." ) ;
7677 const stockTarballBefore = await NodeFSP . readFile ( stockTarballPath ! ) ;
78+ verifyPrimeStockArtifactBytes ( stockTarballBefore ) ;
7779 const stockTreeBefore = await treeDigest ( stockRoot ) ;
7880 const harness = await makePrimeArtifactGraduationHarness ( {
7981 stateDir,
@@ -88,7 +90,7 @@ it.skipIf(!configured)(
8890
8991 // eslint-disable-next-line t3code/no-manual-effect-runtime-in-tests -- This one opt-in proof combines the Promise-owned store lifecycle with the bridge Effect.
9092 const stockBridge = await Effect . runPromise ( loadPrimeAgentDaemonBridge ( stockBinaryPath ! ) ) ;
91- expect ( stockBridge . version ) . toBe ( "0.8.1" ) ;
93+ expect ( stockBridge . version ) . toBe ( PRIME_STOCK_ARTIFACT . version ) ;
9294 expect ( stockBridge . negotiatedDaemonSessionCapabilitiesAvailable ) . toBe ( false ) ;
9395
9496 const install = await harness . command ( {
@@ -123,6 +125,7 @@ it.skipIf(!configured)(
123125 let rollbackBuildId = harness . artifacts [ 0 ] ! . publication . buildId ;
124126 if ( harness . artifacts . length === 2 ) {
125127 harness . useArtifact ( 1 ) ;
128+ const secondArtifact = harness . artifacts [ 1 ] ! ;
126129 const update = await harness . command ( {
127130 commandId : "graduation-update-second-preview" ,
128131 action : "update" ,
@@ -132,8 +135,27 @@ it.skipIf(!configured)(
132135 } ) ;
133136 expect ( update ) . toMatchObject ( {
134137 status : "succeeded" ,
135- buildId : harness . artifacts [ 1 ] ! . publication . buildId ,
138+ buildId : secondArtifact . publication . buildId ,
136139 } ) ;
140+ const updatedStatus = await harness . status ( ) ;
141+ const selectedSecondBuild = updatedStatus . availableBuilds . find (
142+ ( build ) => build . buildId === secondArtifact . publication . buildId ,
143+ ) ;
144+ expect ( selectedSecondBuild ) . toBeDefined ( ) ;
145+ expect ( harness . binding ( ) . binaryPath ) . toBe ( selectedSecondBuild ! . binaryPath ) ;
146+ // eslint-disable-next-line t3code/no-manual-effect-runtime-in-tests -- This opt-in proof loads the exact launcher selected by the production managed store.
147+ const secondBridge = await Effect . runPromise (
148+ loadPrimeAgentDaemonBridge ( selectedSecondBuild ! . binaryPath ) ,
149+ ) ;
150+ expect ( secondBridge . version ) . toBe ( secondArtifact . publication . packageVersion ) ;
151+ expect ( secondBridge . negotiatedDaemonSessionCapabilitiesAvailable ) . toBe ( true ) ;
152+ const secondVersion = await execFile ( selectedSecondBuild ! . binaryPath , [ "--version" ] , {
153+ timeout : 30_000 ,
154+ maxBuffer : 256 * 1024 ,
155+ windowsHide : true ,
156+ } ) ;
157+ expect ( secondVersion . stdout ) . toContain ( secondArtifact . publication . packageVersion ) ;
158+ expect ( harness . binding ( ) . binaryPath ) . toBe ( selectedSecondBuild ! . binaryPath ) ;
137159 } else {
138160 const update = await harness . command ( {
139161 commandId : "graduation-update-exact-no-op" ,
@@ -189,8 +211,9 @@ it.skipIf(!configured)(
189211 const result = {
190212 schemaVersion : 1 ,
191213 status : "passed" ,
192- stockVersion : "0.8.1" ,
193- stockSha256 : digest ( stockTarballBefore ) ,
214+ stockVersion : PRIME_STOCK_ARTIFACT . version ,
215+ stockSha256 : PRIME_STOCK_ARTIFACT . sha256 ,
216+ stockSha512 : PRIME_STOCK_ARTIFACT . sha512 ,
194217 preview : harness . artifacts . map ( ( artifact ) => ( {
195218 tag : artifact . publication . buildId ,
196219 sequence : artifact . publication . sequence ,
@@ -204,7 +227,7 @@ it.skipIf(!configured)(
204227 "signed-preview-capability" ,
205228 "side-by-side-install" ,
206229 "preview-start" ,
207- harness . artifacts . length === 2 ? "second-build-update" : "exact-update-no-op" ,
230+ harness . artifacts . length === 2 ? "second-build-update-executed " : "exact-update-no-op" ,
208231 "rollback" ,
209232 "use-stock" ,
210233 "stock-bytes-unchanged" ,
0 commit comments