@@ -155,6 +155,73 @@ export function createPtyHarness() {
155155 return { dir, before, after, agentContext } ;
156156 }
157157
158+ function createAgentNavigationRepoFixture ( ) {
159+ const alphaBeforeLines = createNumberedExportLines ( 1 , 80 ) . split ( "\n" ) ;
160+ const alphaAfterLines = [ ...alphaBeforeLines ] ;
161+ alphaAfterLines [ 0 ] = "export const line01 = 1001;" ;
162+ alphaAfterLines [ 59 ] = "export const line60 = 6000;" ;
163+
164+ const betaBeforeLines = createNumberedExportLines ( 81 , 20 ) . split ( "\n" ) ;
165+ const betaAfterLines = [ ...betaBeforeLines ] ;
166+ betaAfterLines [ 0 ] = "export const line81 = 8100;" ;
167+
168+ const gammaBeforeLines = createNumberedExportLines ( 101 , 80 ) . split ( "\n" ) ;
169+ const gammaAfterLines = [ ...gammaBeforeLines ] ;
170+ gammaAfterLines [ 0 ] = "export const line101 = 10100;" ;
171+ gammaAfterLines [ 59 ] = "export const line160 = 16000;" ;
172+
173+ const fixture = createGitRepoFixture ( [
174+ {
175+ path : "alpha.ts" ,
176+ before : `${ alphaBeforeLines . join ( "\n" ) } \n` ,
177+ after : `${ alphaAfterLines . join ( "\n" ) } \n` ,
178+ } ,
179+ {
180+ path : "beta.ts" ,
181+ before : `${ betaBeforeLines . join ( "\n" ) } \n` ,
182+ after : `${ betaAfterLines . join ( "\n" ) } \n` ,
183+ } ,
184+ {
185+ path : "gamma.ts" ,
186+ before : `${ gammaBeforeLines . join ( "\n" ) } \n` ,
187+ after : `${ gammaAfterLines . join ( "\n" ) } \n` ,
188+ } ,
189+ ] ) ;
190+ const agentContext = join ( fixture . dir , "agent-context.json" ) ;
191+
192+ writeText (
193+ agentContext ,
194+ JSON . stringify ( {
195+ version : 1 ,
196+ summary : "Agent navigation notes" ,
197+ files : [
198+ {
199+ path : "alpha.ts" ,
200+ annotations : [
201+ {
202+ newRange : [ 60 , 60 ] ,
203+ summary : "Alpha note for navigation." ,
204+ rationale : "Used to prove comment navigation can leave an earlier note." ,
205+ } ,
206+ ] ,
207+ } ,
208+ {
209+ path : "gamma.ts" ,
210+ annotations : [
211+ {
212+ newRange : [ 60 , 60 ] ,
213+ summary : "Gamma note for navigation." ,
214+ rationale : "Used to prove comment navigation resumes after an unannotated hunk." ,
215+ } ,
216+ ] ,
217+ } ,
218+ ] ,
219+ } ) ,
220+ ) ;
221+
222+ return { ...fixture , agentContext } ;
223+ }
224+
158225 function createMultiHunkFilePair ( ) {
159226 const dir = makeTempDir ( "hunk-tuistory-hunks-" ) ;
160227 const before = join ( dir , "before.ts" ) ;
@@ -515,6 +582,7 @@ export function createPtyHarness() {
515582 cleanup,
516583 countMatches,
517584 createAgentFilePair,
585+ createAgentNavigationRepoFixture,
518586 createBottomClampedRepoFixture,
519587 createCollapsedTopRepoFixture,
520588 createCrossFileHunkNavigationRepoFixture,
0 commit comments