@@ -17,7 +17,8 @@ async function run(mode = "success") {
1717 const targetRepo = mode === "canonical-casing" ? "automattic/build-with-wordpress" : "owner/repo"
1818 const publicationRepo = mode === "canonical-casing"
1919 ? "Automattic/build-with-wordpress"
20- : mode === "different-repo" ? "other/repo" : targetRepo
20+ : targetRepo
21+ const resolvedRepo = mode === "different-repo" ? "other/repo" : publicationRepo
2122 await mkdir ( join ( workspace , ".codebox" ) , { recursive : true } )
2223 await writeFile ( join ( workspace , "README.md" ) , "OPENAI_API_KEY\nbefore\n" )
2324
@@ -139,8 +140,8 @@ export async function publishRunnerWorkspace({ testHook }) {
139140 const gh = join ( temp , "gh" )
140141 await writeFile ( gh , `#!/usr/bin/env node
141142process.stdout.write(JSON.stringify({
142- html_url: ${ JSON . stringify ( `https://github.com/${ publicationRepo } /pull/1` ) } ,
143- base: { repo: { full_name: ${ JSON . stringify ( publicationRepo ) } } },
143+ html_url: ${ JSON . stringify ( `https://github.com/${ resolvedRepo } /pull/1` ) } ,
144+ base: { repo: { full_name: ${ JSON . stringify ( resolvedRepo ) } } },
144145}))
145146` )
146147 await chmod ( gh , 0o755 )
@@ -189,19 +190,23 @@ assert(!durablePatch.includes("OPENAI_API_KEY"), "durable patch artifacts redact
189190assert . match ( durablePatch , / \[ R E D A C T E D \] / )
190191assert . match ( success . order , / r u n t i m e \n v a l i d a t i o n \n v e r i f i c a t i o n \n d r i f t \n p u b l i s h \n / )
191192assert . equal ( success . result . runtime_result . metadata . runner_workspace_publication . pull_request . url , "https://github.com/owner/repo/pull/1" )
193+ assert . deepEqual ( success . result . publication_verification , { valid : true } )
192194assert . equal ( success . result . runtime_result . agent_runtime_diagnostics . prepared_paths . workspaces [ 0 ] . target , "/workspace" )
193195assert . equal ( success . result . runtime_result . agent_runtime_diagnostics . prepared_paths . workspaces [ 0 ] . mode , "readwrite" )
194196assert . equal ( success . result . runtime_result . agent_runtime_diagnostics . sandbox_workspace . mounts [ 0 ] . target , "/workspace" )
195197assert . equal ( success . result . runtime_result . agent_runtime_diagnostics . local_executor_root , "/workspace" )
196198
197199const canonicalCasing = await run ( "canonical-casing" )
198200assert . equal ( canonicalCasing . code , 0 , `${ canonicalCasing . stderr } \n${ JSON . stringify ( canonicalCasing . result ) } ` )
199- assert . equal ( canonicalCasing . result . publication_verification . valid , true )
201+ assert . deepEqual ( canonicalCasing . result . publication_verification , { valid : true } )
200202
201203const differentRepository = await run ( "different-repo" )
202204assert . equal ( differentRepository . code , 1 )
203- assert . equal ( differentRepository . result . publication_verification . valid , false )
204- assert . match ( differentRepository . result . failure . message , / v a l i d c a n o n i c a l p u l l - r e q u e s t r e s u l t / )
205+ assert . deepEqual ( differentRepository . result . publication_verification , {
206+ valid : false ,
207+ error : "Published pull request did not resolve to the target repository." ,
208+ } )
209+ assert . equal ( differentRepository . result . failure . message , "Published pull request did not resolve to the target repository." )
205210
206211const failedVerification = await run ( "verify-fail" )
207212assert . equal ( failedVerification . code , 1 )
0 commit comments