Open History to see the last commit
1import {
2 CheckpointId,
3 CheckpointRef,
4 CheckpointScopeId,
5 NodeId,
6 RunId,
7 ThreadId,
8 type OrchestrationV2Checkpoint,
9 type OrchestrationV2CheckpointScope,
10} from "@t3tools/contracts";
11import * as DateTime from "effect/DateTime";
12import { describe, expect, it } from "vite-plus/test";
13
14import { deriveThreadCheckpointSummaries } from "./threadCheckpoints.ts";
15import {
16 addableTaskFolderRepositories,
17 deriveTurnRepositoryChanges,
18 pinnableThreadRepositories,
19 pinThreadRepository,
20 repositoryCheckpointScopeIds,
21 repositoryFilePath,
22 repositorySectionForPath,
23 resolveWorktreeRepositorySelection,
24 rewindFileRestore,
25 THREAD_REPOSITORY_SECTIONS_VISIBLE,
26 isRelativePathInsideFolder,
27 threadChangedRepositories,
28 threadGitRepositories,
29 threadRepositoryScopes,
30 threadRepositorySections,
31 unpinThreadRepository,
32 turnChanges,
33 turnDiffSections,
34 turnHasChanges,
35 worktreeRepositoryChoices,
36} from "./threadRepositories.ts";
37
38const now = DateTime.makeUnsafe("2026-11-10T00:00:00.000Z");
39const rootScopeId = CheckpointScopeId.make("scope-root");
40
41function scope(
42 id: string,
43 cwd: string,
44 repository?: { readonly label?: string; readonly path?: string },
45): OrchestrationV2CheckpointScope {
46 return {
47 id: CheckpointScopeId.make(id),
48 threadId: ThreadId.make("thread"),
49 runId: null,
50 nodeId: NodeId.make("node"),
51 parentScopeId: repository === undefined ? null : rootScopeId,
52 providerThreadId: null,
53 kind: repository === undefined ? "root_run" : "manual",
54 ordinalWithinParent: 0,
55 advancesAppRunCount: repository === undefined,
56 cwd,
57 ...(repository?.label === undefined ? {} : { label: repository.label }),
58 ...(repository === undefined ? {} : { repositoryPath: repository.path ?? cwd }),
59 createdAt: now,
60 };
61}
62
63function checkpoint(
64 id: string,
65 scopeId: string,
66 ordinal: number,
67 overrides: Partial<OrchestrationV2Checkpoint> = {},
68): OrchestrationV2Checkpoint {
69 return {
70 id: CheckpointId.make(id),
71 threadId: ThreadId.make("thread"),
72 scopeId: CheckpointScopeId.make(scopeId),
73 runId: RunId.make(`run-${ordinal}`),
74 nodeId: NodeId.make("node"),
75 parentCheckpointId: null,
76 ordinalWithinScope: ordinal,
77 appRunOrdinal: null,
78 ref: CheckpointRef.make(`refs/t3/${id}`),
79 status: "ready",
80 files: [],
81 capturedAt: now,
82 ...overrides,
83 };
84}
85
86const file = (path: string, additions = 1, deletions = 0) => ({
87 path,
88 kind: "modified",
89 additions,
90 deletions,
91});
92
93const scopes = [
94 scope("scope-root", "/work/wrapper"),
95 scope("scope-web", "/work/wrapper/web", { label: "web" }),
96 scope("scope-api", "/work/wrapper/services/api", { label: "api" }),
97 scope("scope-shared", "/work/shared", { label: "api" }),
98];
99
100// A plain wrapper folder: the thread's own checkpoint is missing on every turn.
101const checkpoints = [
102 checkpoint("root-1", "scope-root", 1, { status: "missing", appRunOrdinal: 1 }),
103 checkpoint("api-0", "scope-api", 0, { runId: null }),
104 checkpoint("api-1", "scope-api", 1, { files: [file("src/index.ts", 4, 2)] }),
105 checkpoint("web-0", "scope-web", 0, { runId: null, status: "missing" }),
106 checkpoint("web-1", "scope-web", 1),
107 checkpoint("root-2", "scope-root", 2, { status: "missing", appRunOrdinal: 2 }),
108 checkpoint("shared-1", "scope-shared", 1, { runId: null }),
109 checkpoint("shared-2", "scope-shared", 2, {
110 files: [file("a.ts")],
111 filesTotal: { count: 300, additions: 900, deletions: 30 },
112 }),
113];
114
115describe("threadRepositoryScopes", () => {
116 it("lists repository scopes by name, then path, relative to the thread's folder", () => {
117 expect(
118 threadRepositoryScopes({ checkpointScopes: scopes }).map((entry) => [
119 entry.name,
120 entry.relativePath,
121 entry.cwd,
122 ]),
123 ).toEqual([
124 ["api", "../shared", "/work/shared"],
125 ["api", "services/api", "/work/wrapper/services/api"],
126 ["web", "web", "/work/wrapper/web"],
127 ]);
128 expect([...repositoryCheckpointScopeIds(scopes)]).toEqual([
129 "scope-web",
130 "scope-api",
131 "scope-shared",
132 ]);
133 });
134
135 it("names an unlabelled repository after its folder and handles Windows paths", () => {
136 const [repository] = threadRepositoryScopes({
137 checkpointScopes: [
138 scope("scope-root", "C:\\Work\\Wrapper"),
139 scope("scope-api", "c:\\work\\wrapper\\api", {}),
140 ],
141 });
142 expect(repository).toMatchObject({ name: "api", relativePath: "api" });
143 expect(
144 threadRepositoryScopes({
145 checkpointScopes: [scope("scope-root", "C:\\work"), scope("scope-api", "D:\\api", {})],
146 })[0],
147 ).not.toHaveProperty("relativePath");
148 });
149});
150
151describe("threadRepositorySections", () => {
152 const changed = threadChangedRepositories({ checkpoints, checkpointScopes: scopes });
153
154 it("orders changed repositories by their latest turn, newest first", () => {
155 expect(changed.map((entry) => entry.cwd)).toEqual([
156 "/work/shared",
157 "/work/wrapper/services/api",
158 "/work/wrapper/web",
159 ]);
160 // A loaded snapshot lists checkpoints by scope, not in the order they were captured.
161 expect(
162 threadChangedRepositories({
163 checkpoints: [
164 checkpoint("api-3", "scope-api", 3),
165 checkpoint("shared-1", "scope-shared", 1),
166 checkpoint("web-2", "scope-web", 2),
167 checkpoint("web-1", "scope-web", 1),
168 ],
169 checkpointScopes: scopes,
170 }).map((entry) => entry.cwd),
171 ).toEqual(["/work/wrapper/services/api", "/work/wrapper/web", "/work/shared"]);
172 // A baseline alone is no change: without a turn the repository sorts last, by name.
173 expect(
174 threadChangedRepositories({
175 checkpoints: [
176 checkpoint("web-0", "scope-web", 0, { runId: null }),
177 checkpoint("api-1", "scope-api", 1),
178 ],
179 checkpointScopes: scopes,
180 }).map((entry) => entry.cwd),
181 ).toEqual(["/work/wrapper/services/api", "/work/shared", "/work/wrapper/web"]);
182 });
183
184 it("puts pins first, drops the thread's own folder, and folds the rest away", () => {
185 const pinned = [
186 { repositoryPath: "/work/wrapper/docs", name: "docs" },
187 { repositoryPath: "/work/wrapper/web", name: "web" },
188 { repositoryPath: "/work/wrapper", name: "wrapper" },
189 ];
190 const sections = threadRepositorySections({
191 changed,
192 pinned,
193 threadCwd: "/work/wrapper",
194 showAll: false,
195 });
196 expect(sections.visible.map((section) => [section.key, section.origin])).toEqual([
197 ["/work/wrapper/docs", "pinned"],
198 ["/work/wrapper/web", "pinned"],
199 ["/work/shared", "changed"],
200 ["/work/wrapper/services/api", "changed"],
201 ]);
202 expect(sections.hidden).toEqual([]);
203 // A thread that reaches no tracked repository lists what it changed, and no pin.
204 expect(
205 threadRepositorySections({
206 changed,
207 pinned,
208 threadCwd: "/work/wrapper",
209 showAll: false,
210 reachesTracked: false,
211 }).visible.map((section) => section.origin),
212 ).toEqual(["changed", "changed", "changed"]);
213
214 const many = Array.from({ length: THREAD_REPOSITORY_SECTIONS_VISIBLE + 2 }, (_, index) => ({
215 repositoryPath: `/work/extra-${index}`,
216 name: `extra-${index}`,
217 }));
218 const folded = threadRepositorySections({
219 changed: [],
220 pinned: many,
221 threadCwd: null,
222 showAll: false,
223 });
224 expect(folded.visible).toHaveLength(THREAD_REPOSITORY_SECTIONS_VISIBLE);
225 expect(folded.hidden.map((section) => section.name)).toEqual(["extra-4", "extra-5"]);
226 expect(
227 threadRepositorySections({ changed: [], pinned: many, threadCwd: null, showAll: true })
228 .visible,
229 ).toHaveLength(many.length);
230 });
231
232 it("pins once, unpins, and offers only Git folders that are not shown", () => {
233 const docs = { repositoryPath: "/work/wrapper/docs", name: "docs" };
234 const pinned = pinThreadRepository([], docs);
235 expect(pinThreadRepository(pinned, { ...docs, name: "renamed" })).toBe(pinned);
236 expect(unpinThreadRepository(pinned, "/work/elsewhere")).toBe(pinned);
237 expect(unpinThreadRepository(pinned, docs.repositoryPath)).toEqual([]);
238
239 const sections = threadRepositorySections({
240 changed,
241 pinned,
242 threadCwd: "/work/wrapper",
243 showAll: false,
244 });
245 expect(
246 pinnableThreadRepositories({
247 sections,
248 threadCwd: "/work/wrapper",
249 folders: [
250 { path: "/work/wrapper", name: "wrapper", state: "git" },
251 { path: "/work/wrapper/docs", name: "docs", state: "git" },
252 { path: "/work/wrapper/web", name: "web", state: "git" },
253 { path: "/work/wrapper/notes", name: "notes", state: "plain" },
254 { path: "/work/wrapper/gone", name: "gone", state: "missing" },
255 { path: "/work/wrapper/cli", name: "cli", state: "git" },
256 ],
257 }),
258 ).toEqual([{ repositoryPath: "/work/wrapper/cli", name: "cli" }]);
259 });
260
261 it("offers Git changes of every repository a thread reaches, changed ones first", () => {
262 const changed = [{ repositoryPath: "/work/web", name: "web", cwd: "/work/web" }];
263 const folders = [
264 { path: "/work", name: "work", state: "git" as const },
265 { path: "/work/api", name: "api", state: "git" as const },
266 { path: "/work/web", name: "web", state: "git" as const },
267 { path: "/work/notes", name: "notes", state: "plain" as const },
268 ];
269 expect(
270 threadGitRepositories({ changed, taskFolder: null, folders, threadCwd: "/work" }),
271 ).toEqual([...changed, { repositoryPath: "/work/api", name: "api", cwd: "/work/api" }]);
272 // A worktree thread reads its own checkouts, never the shared ones.
273 expect(
274 threadGitRepositories({
275 changed: [{ repositoryPath: "/work/api", name: "api", cwd: "/work/api" }],
276 taskFolder: {
277 repositories: [{ repositoryPath: "/work/api", worktreePath: "/wt/api", name: "api" }],
278 },
279 folders,
280 threadCwd: "/wt",
281 }),
282 ).toEqual([{ repositoryPath: "/work/api", name: "api", cwd: "/wt/api" }]);
283 });
284
285 it("lists a task folder's worktrees, changed first, and never a shared checkout", () => {
286 const taskFolder = {
287 root: "/wt/task",
288 projectRoot: "/work/wrapper",
289 repositories: [
290 { repositoryPath: "/work/wrapper/docs", worktreePath: "/wt/task/docs", name: "docs" },
291 { repositoryPath: "/work/wrapper/web", worktreePath: "/wt/task/web", name: "web" },
292 {
293 repositoryPath: "/work/wrapper/services/api",
294 worktreePath: "/wt/task/services/api",
295 name: "api",
296 },
297 ],
298 };
299 const submodule = {
300 scopeId: CheckpointScopeId.make("scope:lib"),
301 name: "lib",
302 repositoryPath: "/work/wrapper/web/vendor/lib",
303 cwd: "/wt/task/web/vendor/lib",
304 };
305 const sections = threadRepositorySections({
306 // `/work/shared` is changed but has no worktree in the task folder.
307 changed: [...changed, submodule],
308 pinned: [{ repositoryPath: "/work/wrapper/cli", name: "cli" }],
309 threadCwd: "/wt/task",
310 showAll: false,
311 taskFolder,
312 });
313 expect(sections.visible.map((section) => [section.key, section.cwd, section.origin])).toEqual([
314 ["/work/wrapper/services/api", "/wt/task/services/api", "worktree"],
315 ["/work/wrapper/web", "/wt/task/web", "worktree"],
316 ["/work/wrapper/docs", "/wt/task/docs", "worktree"],
317 // A submodule the thread changed inside one of its worktrees.
318 ["/work/wrapper/web/vendor/lib", "/wt/task/web/vendor/lib", "changed"],
319 ]);
320 expect(
321 threadRepositorySections({
322 changed,
323 pinned: [],
324 threadCwd: "/wt/task",
325 showAll: false,
326 taskFolder: { root: "/wt/task", repositories: [] },
327 }).visible,
328 ).toEqual([]);
329
330 expect(
331 addableTaskFolderRepositories({
332 taskFolder,
333 folders: [
334 { path: "/work/wrapper", name: "wrapper", state: "git" },
335 { path: "/work/wrapper/docs", name: "docs", state: "git" },
336 { path: "/work/wrapper/notes", name: "notes", state: "plain" },
337 { path: "/work/shared", name: "shared", state: "git" },
338 ],
339 }),
340 ).toEqual([{ repositoryPath: "/work/shared", name: "shared" }]);
341 });
342});
343
344describe("rewindFileRestore", () => {
345 const projection = { checkpointScopes: scopes, checkpoints };
346 const missingRoot = (appRunOrdinal: number | null) =>
347 ({ status: "missing", appRunOrdinal }) as const;
348 const linkedProjectFolder = { projectIsWorktree: false };
349
350 it.each([
351 {
352 why: "a ready snapshot restores every file",
353 checkpoint: { status: "ready", appRunOrdinal: 1 } as const,
354 taskFolder: null,
355 restores: "files",
356 },
357 {
358 why: "a linked project folder restores a repository's own checkpoint",
359 checkpoint: missingRoot(1),
360 taskFolder: linkedProjectFolder,
361 restores: "repositories",
362 },
363 {
364 why: "the thread start restores a repository's baseline",
365 checkpoint: missingRoot(null),
366 taskFolder: linkedProjectFolder,
367 restores: "repositories",
368 },
369 {
370 why: "no repository changed after the target",
371 checkpoint: missingRoot(3),
372 taskFolder: linkedProjectFolder,
373 restores: null,
374 },
375 {
376 why: "a worktree project folder needs its own snapshot",
377 checkpoint: missingRoot(1),
378 taskFolder: { projectIsWorktree: true },
379 restores: null,
380 },
381 {
382 why: "a thread outside a task folder has only its own snapshot",
383 checkpoint: missingRoot(1),
384 taskFolder: null,
385 restores: null,
386 },
387 {
388 why: "a stale snapshot restores nothing",
389 checkpoint: { status: "stale", appRunOrdinal: 1 } as const,
390 taskFolder: linkedProjectFolder,
391 restores: null,
392 },
393 { why: "no target", checkpoint: undefined, taskFolder: linkedProjectFolder, restores: null },
394 ])("$why", ({ checkpoint: target, taskFolder, restores }) => {
395 expect(rewindFileRestore({ projection, checkpoint: target, taskFolder })).toBe(restores);
396 });
397
398 it("ignores the thread's own scope when looking for repository snapshots", () => {
399 expect(
400 rewindFileRestore({
401 projection: {
402 checkpointScopes: [scope("scope-root", "/work/wrapper")],
403 checkpoints: [checkpoint("root-1", "scope-root", 1, { appRunOrdinal: 1 })],
404 },
405 checkpoint: missingRoot(1),
406 taskFolder: linkedProjectFolder,
407 }),
408 ).toBe(null);
409 });
410});
411
412describe("isRelativePathInsideFolder", () => {
413 it.each([
414 ["api", true],
415 ["..api", true],
416 ["../api", false],
417 ["..", false],
418 ["D:/api", false],
419 ])("%j is inside: %j", (relativePath, inside) => {
420 expect(isRelativePathInsideFolder(relativePath)).toBe(inside);
421 });
422});
423
424describe("worktree repository selection", () => {
425 const folders = [
426 { path: "/work/wrapper/web", name: "web", state: "git" },
427 { path: "/work/wrapper/services/api", name: "api", state: "git" },
428 { path: "/work/wrapper/notes", name: "notes", state: "plain" },
429 { path: "/work/shared", name: "shared", state: "git" },
430 ] as const;
431 const choices = worktreeRepositoryChoices({ folders, projectRoot: "/work/wrapper" });
432
433 it("offers tracked Git folders with their place inside the project folder", () => {
434 expect(choices).toEqual([
435 { repositoryPath: "/work/wrapper/web", name: "web", relativePath: "web" },
436 { repositoryPath: "/work/wrapper/services/api", name: "api", relativePath: "services/api" },
437 { repositoryPath: "/work/shared", name: "shared" },
438 ]);
439 });
440
441 it("takes every repository by default and sends nothing until the user chooses", () => {
442 expect(resolveWorktreeRepositorySelection({ choices, chosen: undefined })).toEqual({
443 selected: ["/work/wrapper/web", "/work/wrapper/services/api", "/work/shared"],
444 label: "All repositories",
445 needsChoice: false,
446 strategyRepositories: undefined,
447 });
448 });
449
450 it("sends the chosen repositories the project still tracks, and an empty choice as none", () => {
451 expect(
452 resolveWorktreeRepositorySelection({
453 choices,
454 chosen: ["/work/shared", "/work/untracked", "/work/wrapper/web"],
455 }),
456 ).toMatchObject({
457 label: "2 repositories",
458 strategyRepositories: [{ path: "/work/wrapper/web" }, { path: "/work/shared" }],
459 });
460 expect(resolveWorktreeRepositorySelection({ choices, chosen: [] })).toMatchObject({
461 label: "No repositories",
462 needsChoice: false,
463 strategyRepositories: [],
464 });
465 });
466
467 it("takes none by default above the server's limit and asks for a choice", () => {
468 const many = Array.from({ length: 9 }, (_, index) => ({
469 repositoryPath: `/work/wrapper/repo-${index}`,
470 name: `repo-${index}`,
471 }));
472 expect(resolveWorktreeRepositorySelection({ choices: many, chosen: undefined })).toEqual({
473 selected: [],
474 label: "Choose repositories",
475 needsChoice: true,
476 strategyRepositories: undefined,
477 });
478 expect(
479 resolveWorktreeRepositorySelection({ choices: many.slice(0, 8), chosen: undefined }).selected,
480 ).toHaveLength(8);
481 });
482
483 it("sends a stored choice as it is while the tracked folders are still loading", () => {
484 expect(
485 resolveWorktreeRepositorySelection({ choices: null, chosen: ["/work/shared"] }),
486 ).toMatchObject({ needsChoice: false, strategyRepositories: [{ path: "/work/shared" }] });
487 expect(
488 resolveWorktreeRepositorySelection({ choices: null, chosen: undefined }).strategyRepositories,
489 ).toBeUndefined();
490 });
491});
492
493describe("deriveTurnRepositoryChanges", () => {
494 it("groups each run's repository checkpoints and marks a repository without a baseline", () => {
495 const byRun = deriveTurnRepositoryChanges({ checkpoints, checkpointScopes: scopes });
496 expect([...byRun.keys()]).toEqual(["run-1", "run-2"]);
497 expect(byRun.get(RunId.make("run-1"))).toEqual([
498 {
499 scopeId: "scope-api",
500 name: "api",
501 repositoryPath: "/work/wrapper/services/api",
502 cwd: "/work/wrapper/services/api",
503 relativePath: "services/api",
504 files: [file("src/index.ts", 4, 2)],
505 baselineMissing: false,
506 },
507 {
508 scopeId: "scope-web",
509 name: "web",
510 repositoryPath: "/work/wrapper/web",
511 cwd: "/work/wrapper/web",
512 relativePath: "web",
513 files: [],
514 baselineMissing: true,
515 },
516 ]);
517 });
518
519 it("leaves out a repository checkpoint with no files and a recorded baseline", () => {
520 const byRun = deriveTurnRepositoryChanges({
521 checkpoints: [
522 checkpoint("api-0", "scope-api", 0, { runId: null }),
523 checkpoint("api-1", "scope-api", 1),
524 ],
525 checkpointScopes: scopes,
526 });
527 expect(byRun.size).toBe(0);
528 });
529
530 it("keeps an unchanged turn's repositories when a later turn adds checkpoints", () => {
531 const before = deriveTurnRepositoryChanges({
532 checkpoints: checkpoints.slice(0, 5),
533 checkpointScopes: scopes,
534 });
535 const after = deriveTurnRepositoryChanges({ checkpoints, checkpointScopes: scopes });
536 expect(after.get(RunId.make("run-1"))).toBe(before.get(RunId.make("run-1")));
537 });
538
539 it("gives nothing for a thread without repository scopes", () => {
540 expect(
541 deriveTurnRepositoryChanges({
542 checkpoints: [checkpoint("root-1", "scope-root", 1, { files: [file("a.ts")] })],
543 checkpointScopes: [scopes[0]!],
544 }).size,
545 ).toBe(0);
546 });
547});
548
549describe("turn changes", () => {
550 const summaries = deriveThreadCheckpointSummaries({
551 checkpoints,
552 checkpointScopes: scopes,
553 messages: [],
554 });
555
556 it("attaches repositories to the thread's own turn summary and no summary of their own", () => {
557 expect(summaries.map((summary) => [summary.runId, summary.status])).toEqual([
558 ["run-1", "missing"],
559 ["run-2", "missing"],
560 ]);
561 expect(summaries[0]!.repositories?.map((repository) => repository.name)).toEqual([
562 "api",
563 "web",
564 ]);
565 });
566
567 it("shows a turn whose own checkpoint is missing when repositories changed", () => {
568 expect(summaries.map(turnHasChanges)).toEqual([true, true]);
569 expect(turnHasChanges({ files: [] })).toBe(false);
570 expect(turnHasChanges({ files: [file("a.ts")] })).toBe(true);
571 });
572
573 it("totals the thread folder and every repository, honoring truncated file lists", () => {
574 expect(turnChanges(summaries[0]!).totals).toEqual({ count: 1, additions: 4, deletions: 2 });
575 expect(
576 turnChanges({ files: [file("root.ts", 2, 1)], repositories: summaries[1]!.repositories })
577 .totals,
578 ).toEqual({ count: 301, additions: 902, deletions: 31 });
579 expect(turnChanges({ files: [file("root.ts")] })).toEqual({
580 rootFiles: [file("root.ts")],
581 repositories: [],
582 totals: { count: 1, additions: 1, deletions: 0 },
583 });
584 });
585});
586
587describe("turnDiffSections", () => {
588 const sections = turnDiffSections(
589 {
590 diff: "diff --git a/README.md b/README.md\n",
591 repositories: [
592 { name: "api", repositoryPath: "/work/api", relativePath: "api", diff: "diff api\n" },
593 { name: "empty", repositoryPath: "/work/empty", relativePath: "empty", diff: "" },
594 {
595 name: "api-client",
596 repositoryPath: "/work/api/client",
597 relativePath: "api/client",
598 diff: "diff client\n",
599 },
600 { name: "shared", repositoryPath: "/shared", relativePath: "../shared", diff: "diff s\n" },
601 ],
602 },
603 "wrapper",
604 );
605
606 it("puts the thread folder first and drops empty patches", () => {
607 expect(sections.map(({ key, name, relativePath }) => [key, name, relativePath])).toEqual([
608 [".", "wrapper", ""],
609 ["/work/api", "api", "api"],
610 ["/work/api/client", "api-client", "api/client"],
611 ["/shared", "shared", "../shared"],
612 ]);
613 expect(turnDiffSections({ diff: "" }, "wrapper")).toEqual([]);
614 expect(turnDiffSections({ diff: "", repositories: [] }, "wrapper")).toEqual([]);
615 });
616
617 it("maps a thread-relative path back to the innermost repository", () => {
618 expect(repositoryFilePath("api/client", "src/a.ts")).toBe("api/client/src/a.ts");
619 expect(repositoryFilePath("", "src/a.ts")).toBe("src/a.ts");
620 const match = repositorySectionForPath(sections, "api/client/src/a.ts");
621 expect([match?.section.name, match?.path]).toEqual(["api-client", "src/a.ts"]);
622 expect(repositorySectionForPath(sections, "../shared/x.ts")?.path).toBe("x.ts");
623 expect(repositorySectionForPath(sections, "README.md")).toBeNull();
624 expect(repositorySectionForPath(sections, "apiary/x.ts")).toBeNull();
625 });
626});