@@ -144,9 +144,10 @@ interface HarnessOptions {
144144 /** What the guide service answers for a pull request it is asked to write. */
145145 readonly generate ?: (
146146 input : PullRequestRef ,
147- ) => Effect . Effect < PullRequestReviewGuideResult , PullRequestOperationError > ;
148- /** A run already going when the tool asks, which a write joins. */
149- readonly running ?: PullRequestReviewGuideResult [ "run" ] ;
147+ ) => Effect . Effect <
148+ PullRequestReviewGuideResult & { started : boolean } ,
149+ PullRequestOperationError
150+ > ;
150151}
151152
152153const NO_GUIDE : PullRequestReviewGuideResult = { guide : null , run : null , currentHeadSha : "head-1" } ;
@@ -176,7 +177,7 @@ const makeHarness = Effect.fn("makePullRequestsToolkitHarness")(function* (
176177 listShells : ( ) => Effect . succeed ( options . projects ?? ( project ? [ project ] : [ ] ) ) ,
177178 } ) ,
178179 Layer . mock ( PullRequestReviewGuideService . PullRequestReviewGuideService ) ( {
179- get : ( ) => Effect . succeed ( { ... NO_GUIDE , run : options . running ?? null } ) ,
180+ get : ( ) => Effect . succeed ( NO_GUIDE ) ,
180181 generate : ( input ) =>
181182 Ref . update ( guideRequests , ( recorded ) => [ ...recorded , input ] ) . pipe (
182183 Effect . andThen (
@@ -188,6 +189,7 @@ const makeHarness = Effect.fn("makePullRequestsToolkitHarness")(function* (
188189 headSha : "head-1" ,
189190 startedAt : "2026-10-11T00:00:00.000Z" ,
190191 } ,
192+ started : true ,
191193 } ) ,
192194 ) ,
193195 ) ,
@@ -642,6 +644,7 @@ describe("pull request guide tools", () => {
642644 headSha : "head-1" ,
643645 startedAt : "2026-10-11T00:00:00.000Z" ,
644646 } ,
647+ started : true ,
645648 } ) ,
646649 } ) ;
647650 const result = yield * harness . call ( "write_pull_request_guides" , {
@@ -674,10 +677,15 @@ describe("pull request guide tools", () => {
674677 } ) ,
675678 ) ;
676679
677- it . effect ( "joins a run already going rather than reporting a new one" , ( ) =>
680+ it . effect ( "reports a run the service joined as running, not as a new one" , ( ) =>
678681 Effect . gen ( function * ( ) {
679682 const harness = yield * makeHarness ( {
680- running : { _tag : "Running" , headSha : "head-1" , startedAt : "2026-10-11T00:00:00.000Z" } ,
683+ generate : ( ) =>
684+ Effect . succeed ( {
685+ ...NO_GUIDE ,
686+ run : { _tag : "Running" , headSha : "head-1" , startedAt : "2026-10-11T00:00:00.000Z" } ,
687+ started : false ,
688+ } ) ,
681689 } ) ;
682690 const result = yield * harness . call ( "write_pull_request_guides" , {
683691 pullRequests : [ { repository : "t3tools/t3code" , number : 4 } ] ,
@@ -686,18 +694,6 @@ describe("pull request guide tools", () => {
686694 } ) ,
687695 ) ;
688696
689- it . effect ( "reports a run for a new head as started, not as the older run it replaced" , ( ) =>
690- Effect . gen ( function * ( ) {
691- const harness = yield * makeHarness ( {
692- running : { _tag : "Running" , headSha : "head-old" , startedAt : "2026-10-11T00:00:00.000Z" } ,
693- } ) ;
694- const result = yield * harness . call ( "write_pull_request_guides" , {
695- pullRequests : [ { repository : "t3tools/t3code" , number : 6 } ] ,
696- } ) ;
697- expect ( result . guides . map ( ( guide ) => guide . outcome ) ) . toEqual ( [ "started" ] ) ;
698- } ) ,
699- ) ;
700-
701697 it . effect ( "finds an Azure DevOps checkout for a pull request named by its full path" , ( ) =>
702698 Effect . gen ( function * ( ) {
703699 const azure = {
0 commit comments