Open History to see the last commit
1import {
2 DEFAULT_SERVER_SETTINGS,
3 ProjectId,
4 ProviderInstanceId,
5 PullRequestOperationError,
6 ThreadId,
7 type OrchestrationCommand,
8 type OrchestrationProjectShell,
9 type OrchestrationShellSnapshot,
10 type OrchestrationThreadShell,
11 type PullRequestDetail,
12 type ServerSettings,
13 type ServerSettingsPatch,
14} from "@t3tools/contracts";
15import { applyServerSettingsPatch } from "@t3tools/shared/serverSettings";
16import { assert, describe, it } from "@effect/vitest";
17import * as Crypto from "effect/Crypto";
18import * as Deferred from "effect/Deferred";
19import * as Effect from "effect/Effect";
20import * as Layer from "effect/Layer";
21import * as PubSub from "effect/PubSub";
22import * as Queue from "effect/Queue";
23import * as Ref from "effect/Ref";
24import * as Stream from "effect/Stream";
25import { TestClock } from "effect/testing";
26
27import { GitManager } from "../git/GitManager.ts";
28import { PullRequestService } from "../pullRequest/PullRequestService.ts";
29import { ServerActivation } from "../serverActivation.ts";
30import { ServerSettingsService } from "../serverSettings.ts";
31import { OrchestrationCommandInvariantError } from "./Errors.ts";
32import {
33 OrchestrationEngineService,
34 type OrchestrationEngineShape,
35} from "./Services/OrchestrationEngine.ts";
36import { ProjectionSnapshotQuery } from "./Services/ProjectionSnapshotQuery.ts";
37import * as ThreadSettlementReactor from "./ThreadSettlementReactor.ts";
38
39const NOW = "2026-08-28T12:00:00.000Z";
40const PROJECT_ID = ProjectId.make("settlement-project");
41const LINKED_PROJECT_ID = ProjectId.make("linked-settlement-project");
42
43type AutoSettleCommand = Extract<OrchestrationCommand, { readonly type: "thread.auto-settle" }>;
44
45const testCrypto = Crypto.make({
46 randomBytes: (size) => new Uint8Array(size).fill(1),
47 digest: (_algorithm, data) => Effect.succeed(data),
48});
49
50function makeProject(
51 id: ProjectId = PROJECT_ID,
52 workspaceRoot = "/workspace/project",
53): OrchestrationProjectShell {
54 return {
55 id,
56 title: `Project ${id}`,
57 workspaceRoot,
58 defaultModelSelection: null,
59 scripts: [],
60 createdAt: "2026-08-01T00:00:00.000Z",
61 updatedAt: NOW,
62 };
63}
64
65function makeThread(
66 id: string,
67 overrides: Partial<OrchestrationThreadShell> = {},
68): OrchestrationThreadShell {
69 return {
70 id: ThreadId.make(id),
71 projectId: PROJECT_ID,
72 title: id,
73 modelSelection: {
74 instanceId: ProviderInstanceId.make("codex"),
75 model: "gpt-5",
76 },
77 runtimeMode: "full-access",
78 interactionMode: "default",
79 branch: null,
80 worktreePath: null,
81 latestTurn: null,
82 createdAt: "2026-08-01T00:00:00.000Z",
83 updatedAt: "2026-08-20T00:00:00.000Z",
84 archivedAt: null,
85 settledOverride: null,
86 settledAt: null,
87 session: null,
88 latestUserMessageAt: "2026-08-20T00:00:00.000Z",
89 hasPendingApprovals: false,
90 hasPendingUserInput: false,
91 hasActionableProposedPlan: false,
92 ...overrides,
93 };
94}
95
96function makeSnapshot(
97 threads: ReadonlyArray<OrchestrationThreadShell>,
98 projects: ReadonlyArray<OrchestrationProjectShell> = [makeProject()],
99): OrchestrationShellSnapshot {
100 return {
101 snapshotSequence: 1,
102 projects,
103 threads,
104 updatedAt: NOW,
105 };
106}
107
108function makePullRequestDetail(input: {
109 readonly projectId: ProjectId;
110 readonly repository: string;
111 readonly number: number;
112 readonly state: "open" | "closed" | "merged";
113 readonly updatedAt?: string;
114}): PullRequestDetail {
115 return {
116 provider: "github",
117 capabilities: {
118 diff: true,
119 comment: true,
120 actions: [],
121 mergeMethods: [],
122 search: true,
123 review: { inlineComment: true, reply: true, resolve: true, verdicts: [] },
124 reviewers: { request: true, listCandidates: true },
125 },
126 viewerPermissions: {
127 actions: [],
128 comment: true,
129 resolve: true,
130 verdicts: [],
131 requestReviewers: true,
132 },
133 projectId: input.projectId,
134 projectTitle: "Linked project",
135 workspaceRoot: "/workspace/linked",
136 repository: input.repository,
137 number: input.number,
138 title: "Pull request",
139 body: "",
140 url: `https://example.test/${input.repository}/pull/${input.number}`,
141 author: null,
142 state: input.state,
143 isDraft: false,
144 mergeability: "mergeable",
145 additions: 0,
146 deletions: 0,
147 changedFiles: 0,
148 headBranch: "feature",
149 baseBranch: "main",
150 createdAt: "2026-08-01T00:00:00.000Z",
151 updatedAt: input.updatedAt ?? NOW,
152 mergedAt: input.state === "merged" ? (input.updatedAt ?? NOW) : null,
153 closedAt: input.state === "closed" ? (input.updatedAt ?? NOW) : null,
154 reviewers: [],
155 labels: [],
156 checks: [],
157 mergeCapabilities: { merge: true, squash: true, rebase: true },
158 };
159}
160
161interface HarnessOptions {
162 readonly snapshot: OrchestrationShellSnapshot;
163 readonly settings?: ServerSettings;
164 readonly branchPullRequest?: GitManager["Service"]["branchPullRequest"];
165 readonly pullRequestDetail?: PullRequestService["Service"]["detail"];
166 readonly onDispatch?: (
167 command: AutoSettleCommand,
168 ) => Effect.Effect<void, OrchestrationCommandInvariantError>;
169}
170
171const makeHarness = Effect.fn("makeThreadSettlementHarness")(function* (options: HarnessOptions) {
172 const activation = yield* Deferred.make<void>();
173 const snapshots = yield* Ref.make(options.snapshot);
174 const snapshotReadCount = yield* Ref.make(0);
175 const snapshotReads = yield* Queue.unbounded<number>();
176 const settings = yield* Ref.make(options.settings ?? DEFAULT_SERVER_SETTINGS);
177 const settingsChanges = yield* PubSub.unbounded<ServerSettings>();
178 const commands = yield* Ref.make<ReadonlyArray<AutoSettleCommand>>([]);
179 const branchCalls = yield* Ref.make<
180 ReadonlyArray<{ readonly cwd: string; readonly branch: string }>
181 >([]);
182 const detailCalls = yield* Ref.make<
183 ReadonlyArray<{
184 readonly projectId: ProjectId;
185 readonly repository: string;
186 readonly number: number;
187 }>
188 >([]);
189
190 const updateSettings = (patch: ServerSettingsPatch) =>
191 Effect.gen(function* () {
192 const next = applyServerSettingsPatch(yield* Ref.get(settings), patch);
193 yield* Ref.set(settings, next);
194 yield* PubSub.publish(settingsChanges, next);
195 return next;
196 });
197
198 const branchPullRequest: GitManager["Service"]["branchPullRequest"] = (input) =>
199 Ref.update(branchCalls, (calls) => [...calls, input]).pipe(
200 Effect.andThen(options.branchPullRequest?.(input) ?? Effect.succeed(null)),
201 );
202
203 const pullRequestDetail: PullRequestService["Service"]["detail"] = (input) =>
204 Ref.update(detailCalls, (calls) => [...calls, input]).pipe(
205 Effect.andThen(
206 options.pullRequestDetail?.(input) ??
207 Effect.succeed(
208 makePullRequestDetail({
209 ...input,
210 state: "open",
211 }),
212 ),
213 ),
214 );
215
216 const dispatch: OrchestrationEngineShape["dispatch"] = (command) => {
217 if (command.type !== "thread.auto-settle") {
218 return Effect.die(new Error(`Unexpected command: ${command.type}`));
219 }
220 return Ref.update(commands, (recorded) => [...recorded, command]).pipe(
221 Effect.andThen(options.onDispatch?.(command) ?? Effect.void),
222 Effect.as({ sequence: 1 }),
223 );
224 };
225
226 const serverSettings = ServerSettingsService.of({
227 start: Effect.void,
228 ready: Effect.void,
229 getSettings: Ref.get(settings),
230 updateSettings,
231 streamChanges: Stream.fromPubSub(settingsChanges),
232 subscribeChanges: PubSub.subscribe(settingsChanges).pipe(
233 Effect.map((subscription) => Stream.fromSubscription(subscription)),
234 ),
235 });
236
237 const dependencies = Layer.mergeAll(
238 Layer.mock(ProjectionSnapshotQuery)({
239 getShellSnapshot: () =>
240 Ref.updateAndGet(snapshotReadCount, (count) => count + 1).pipe(
241 Effect.tap((count) => Queue.offer(snapshotReads, count)),
242 Effect.andThen(Ref.get(snapshots)),
243 ),
244 }),
245 Layer.mock(GitManager)({ branchPullRequest }),
246 Layer.mock(PullRequestService)({ detail: pullRequestDetail }),
247 Layer.mock(OrchestrationEngineService)({
248 readEvents: () => Stream.empty,
249 dispatch,
250 streamDomainEvents: Stream.empty,
251 latestSequence: Effect.succeed(0),
252 }),
253 Layer.succeed(ServerSettingsService, serverSettings),
254 Layer.succeed(ServerActivation, Deferred.await(activation)),
255 Layer.succeed(Crypto.Crypto, testCrypto),
256 );
257
258 return {
259 activation,
260 snapshots,
261 snapshotReadCount,
262 snapshotReads,
263 commands,
264 branchCalls,
265 detailCalls,
266 updateSettings,
267 layer: ThreadSettlementReactor.layer.pipe(Layer.provide(dependencies)),
268 };
269});
270
271const startHarness = Effect.fn("startThreadSettlementHarness")(function* (
272 reactor: ThreadSettlementReactor.ThreadSettlementReactor["Service"],
273 activation: Deferred.Deferred<void>,
274 snapshotReads: Queue.Queue<number>,
275) {
276 yield* reactor.start();
277 yield* Deferred.succeed(activation, undefined);
278 yield* Queue.take(snapshotReads);
279 yield* reactor.drain;
280});
281
282describe("ThreadSettlementReactor", () => {
283 it.effect("starts without clients and skips protected threads before pull request lookup", () =>
284 Effect.scoped(
285 Effect.gen(function* () {
286 yield* TestClock.setTime(Date.parse(NOW));
287 const linkedPullRequest = {
288 projectId: LINKED_PROJECT_ID,
289 repository: "owner/repository",
290 number: 42,
291 url: "https://example.test/owner/repository/pull/42",
292 } as const;
293 const skipped = [
294 makeThread("pending-approval", {
295 branch: "skip-approval",
296 hasPendingApprovals: true,
297 }),
298 makeThread("snoozed", {
299 branch: "skip-snoozed",
300 snoozedUntil: "2026-08-29T00:00:00.000Z",
301 }),
302 ];
303 const fixture = yield* makeHarness({
304 snapshot: makeSnapshot(
305 [
306 makeThread("inactive", { branch: "inactive-feature" }),
307 makeThread("closed-pr", { linkedPullRequest }),
308 ...skipped,
309 ],
310 [makeProject(), makeProject(LINKED_PROJECT_ID, "/workspace/linked")],
311 ),
312 branchPullRequest: () => Effect.succeed(null),
313 pullRequestDetail: (input) =>
314 Effect.succeed(makePullRequestDetail({ ...input, state: "closed" })),
315 });
316
317 yield* Effect.gen(function* () {
318 const reactor = yield* ThreadSettlementReactor.ThreadSettlementReactor;
319 yield* reactor.start();
320 assert.strictEqual(yield* Ref.get(fixture.snapshotReadCount), 0);
321
322 yield* Deferred.succeed(fixture.activation, undefined);
323 yield* Queue.take(fixture.snapshotReads);
324 yield* reactor.drain;
325
326 const commands = yield* Ref.get(fixture.commands);
327 assert.deepStrictEqual(
328 commands
329 .map(({ threadId, snapshotSequence }) => ({ threadId, snapshotSequence }))
330 .sort((left, right) => left.threadId.localeCompare(right.threadId)),
331 [
332 {
333 threadId: ThreadId.make("closed-pr"),
334 snapshotSequence: 1,
335 },
336 {
337 threadId: ThreadId.make("inactive"),
338 snapshotSequence: 1,
339 },
340 ],
341 );
342 assert.deepStrictEqual(yield* Ref.get(fixture.branchCalls), [
343 { cwd: "/workspace/project", branch: "inactive-feature" },
344 ]);
345 assert.deepStrictEqual(yield* Ref.get(fixture.detailCalls), [
346 { projectId: LINKED_PROJECT_ID, repository: "owner/repository", number: 42 },
347 ]);
348 }).pipe(Effect.provide(fixture.layer));
349 }),
350 ),
351 );
352
353 it.effect("reevaluates inactivity and pull request state once per minute", () =>
354 Effect.scoped(
355 Effect.gen(function* () {
356 yield* TestClock.setTime(Date.parse(NOW));
357 const pullRequest = yield* Ref.make<"open" | "merged">("open");
358 const fixture = yield* makeHarness({
359 snapshot: makeSnapshot([
360 makeThread("at-boundary", {
361 latestUserMessageAt: "2026-08-25T12:00:00.000Z",
362 }),
363 makeThread("open-pr", {
364 branch: "saved-feature",
365 latestUserMessageAt: "2026-08-27T00:00:00.000Z",
366 }),
367 ]),
368 branchPullRequest: () =>
369 Ref.get(pullRequest).pipe(Effect.map((state) => ({ state, updatedAt: NOW }))),
370 });
371
372 yield* Effect.gen(function* () {
373 const reactor = yield* ThreadSettlementReactor.ThreadSettlementReactor;
374 yield* startHarness(reactor, fixture.activation, fixture.snapshotReads);
375 assert.deepStrictEqual(yield* Ref.get(fixture.commands), []);
376
377 yield* Ref.set(pullRequest, "merged");
378 yield* TestClock.adjust("1 minute");
379 yield* Queue.take(fixture.snapshotReads);
380 yield* reactor.drain;
381
382 assert.deepStrictEqual(
383 (yield* Ref.get(fixture.commands))
384 .map((command) => command.threadId)
385 .sort((left, right) => left.localeCompare(right)),
386 [ThreadId.make("at-boundary"), ThreadId.make("open-pr")],
387 );
388 assert.strictEqual((yield* Ref.get(fixture.branchCalls)).length, 2);
389 }).pipe(Effect.provide(fixture.layer));
390 }),
391 ),
392 );
393
394 it.effect("uses fresh settlement settings after lookup and ignores unrelated changes", () =>
395 Effect.scoped(
396 Effect.gen(function* () {
397 yield* TestClock.setTime(Date.parse(NOW));
398 const state = yield* Ref.make<"merged" | "closed">("merged");
399 const firstLookupStarted = yield* Deferred.make<void>();
400 const releaseFirstLookup = yield* Deferred.make<void>();
401 const laterLookupStarted = yield* Deferred.make<void>();
402 const releaseLaterLookup = yield* Deferred.make<void>();
403 const lookupCount = yield* Ref.make(0);
404 const fixture = yield* makeHarness({
405 snapshot: makeSnapshot([makeThread("settings-thread", { branch: "saved-feature" })]),
406 settings: {
407 ...DEFAULT_SERVER_SETTINGS,
408 sidebarAutoSettleAfterDays: null,
409 sidebarAutoSettleOnMerge: true,
410 },
411 branchPullRequest: () =>
412 Ref.updateAndGet(lookupCount, (count) => count + 1).pipe(
413 Effect.tap((count) =>
414 count === 1
415 ? Deferred.succeed(firstLookupStarted, undefined)
416 : count === 3
417 ? Deferred.succeed(laterLookupStarted, undefined)
418 : Effect.void,
419 ),
420 Effect.tap((count) =>
421 count === 1
422 ? Deferred.await(releaseFirstLookup)
423 : count === 3
424 ? Deferred.await(releaseLaterLookup)
425 : Effect.void,
426 ),
427 Effect.andThen(Ref.get(state)),
428 Effect.map((pullRequestState) => ({ state: pullRequestState, updatedAt: NOW })),
429 ),
430 });
431
432 yield* Effect.gen(function* () {
433 const reactor = yield* ThreadSettlementReactor.ThreadSettlementReactor;
434 yield* reactor.start();
435 yield* Deferred.succeed(fixture.activation, undefined);
436 yield* Queue.take(fixture.snapshotReads);
437 yield* Deferred.await(firstLookupStarted);
438
439 yield* fixture.updateSettings({ sidebarAutoSettleOnMerge: false });
440 yield* Deferred.succeed(releaseFirstLookup, undefined);
441 yield* Queue.take(fixture.snapshotReads);
442 yield* reactor.drain;
443 assert.deepStrictEqual(yield* Ref.get(fixture.commands), []);
444 assert.strictEqual(yield* Ref.get(fixture.snapshotReadCount), 2);
445
446 yield* Ref.set(state, "closed");
447 yield* fixture.updateSettings({ enableAgentBrowserAccess: false });
448 yield* fixture.updateSettings({ sidebarAutoSettleAfterDays: 1 });
449 yield* Deferred.await(laterLookupStarted);
450 yield* Deferred.succeed(releaseLaterLookup, undefined);
451 yield* reactor.drain;
452
453 assert.strictEqual(yield* Ref.get(fixture.snapshotReadCount), 3);
454 assert.strictEqual(yield* Ref.get(lookupCount), 3);
455 assert.deepStrictEqual(
456 (yield* Ref.get(fixture.commands)).map((command) => command.threadId),
457 [ThreadId.make("settings-thread")],
458 );
459 }).pipe(Effect.provide(fixture.layer));
460 }),
461 ),
462 );
463
464 it.effect("keeps an unknown pull request active and continues with other candidates", () =>
465 Effect.scoped(
466 Effect.gen(function* () {
467 yield* TestClock.setTime(Date.parse(NOW));
468 const fixture = yield* makeHarness({
469 snapshot: makeSnapshot(
470 [
471 makeThread("lookup-failed", {
472 linkedPullRequest: {
473 projectId: LINKED_PROJECT_ID,
474 repository: "owner/repository",
475 number: 9,
476 url: "https://example.test/owner/repository/pull/9",
477 },
478 }),
479 makeThread("inactive-without-pr"),
480 ],
481 [makeProject(), makeProject(LINKED_PROJECT_ID, "/workspace/linked")],
482 ),
483 pullRequestDetail: () =>
484 Effect.fail(
485 new PullRequestOperationError({
486 operation: "detail",
487 detail: "host unavailable",
488 }),
489 ),
490 });
491
492 yield* Effect.gen(function* () {
493 const reactor = yield* ThreadSettlementReactor.ThreadSettlementReactor;
494 yield* startHarness(reactor, fixture.activation, fixture.snapshotReads);
495
496 assert.deepStrictEqual(
497 (yield* Ref.get(fixture.commands)).map((command) => command.threadId),
498 [ThreadId.make("inactive-without-pr")],
499 );
500 assert.strictEqual((yield* Ref.get(fixture.detailCalls)).length, 1);
501 }).pipe(Effect.provide(fixture.layer));
502 }),
503 ),
504 );
505
506 it.effect("keeps threads active when their pull request project is unavailable", () =>
507 Effect.scoped(
508 Effect.gen(function* () {
509 yield* TestClock.setTime(Date.parse(NOW));
510 const linkedPullRequest = {
511 projectId: LINKED_PROJECT_ID,
512 repository: "owner/repository",
513 number: 10,
514 url: "https://example.test/owner/repository/pull/10",
515 } as const;
516 const fixture = yield* makeHarness({
517 snapshot: makeSnapshot(
518 [
519 makeThread("missing-own-project", { linkedPullRequest }),
520 makeThread("missing-branch-project", { branch: "saved-feature" }),
521 ],
522 [makeProject(LINKED_PROJECT_ID, "/workspace/linked")],
523 ),
524 pullRequestDetail: (input) =>
525 Effect.succeed(makePullRequestDetail({ ...input, state: "open" })),
526 });
527
528 yield* Effect.gen(function* () {
529 const reactor = yield* ThreadSettlementReactor.ThreadSettlementReactor;
530 yield* startHarness(reactor, fixture.activation, fixture.snapshotReads);
531
532 assert.deepStrictEqual(yield* Ref.get(fixture.commands), []);
533 assert.deepStrictEqual(yield* Ref.get(fixture.detailCalls), [
534 { projectId: LINKED_PROJECT_ID, repository: "owner/repository", number: 10 },
535 ]);
536 assert.deepStrictEqual(yield* Ref.get(fixture.branchCalls), []);
537 }).pipe(Effect.provide(fixture.layer));
538 }),
539 ),
540 );
541
542 it.effect("deduplicates saved-branch and linked pull request lookups within a sweep", () =>
543 Effect.scoped(
544 Effect.gen(function* () {
545 yield* TestClock.setTime(Date.parse(NOW));
546 const linkedPullRequest = {
547 projectId: LINKED_PROJECT_ID,
548 repository: "owner/repository",
549 number: 77,
550 url: "https://example.test/owner/repository/pull/77",
551 } as const;
552 const fixture = yield* makeHarness({
553 snapshot: makeSnapshot(
554 [
555 makeThread("branch-one", {
556 branch: "saved-feature",
557 worktreePath: "/deleted/worktree-one",
558 }),
559 makeThread("branch-two", {
560 branch: "saved-feature",
561 worktreePath: "/deleted/worktree-two",
562 }),
563 makeThread("linked-one", { linkedPullRequest }),
564 makeThread("linked-two", { linkedPullRequest }),
565 ],
566 [
567 makeProject(PROJECT_ID, "/workspace/project-root"),
568 makeProject(LINKED_PROJECT_ID, "/workspace/linked-root"),
569 ],
570 ),
571 branchPullRequest: () => Effect.succeed({ state: "closed", updatedAt: NOW }),
572 pullRequestDetail: (input) =>
573 Effect.succeed(makePullRequestDetail({ ...input, state: "merged" })),
574 });
575
576 yield* Effect.gen(function* () {
577 const reactor = yield* ThreadSettlementReactor.ThreadSettlementReactor;
578 yield* startHarness(reactor, fixture.activation, fixture.snapshotReads);
579
580 assert.deepStrictEqual(yield* Ref.get(fixture.branchCalls), [
581 { cwd: "/workspace/project-root", branch: "saved-feature" },
582 ]);
583 assert.deepStrictEqual(yield* Ref.get(fixture.detailCalls), [
584 { projectId: LINKED_PROJECT_ID, repository: "owner/repository", number: 77 },
585 ]);
586 assert.deepStrictEqual(
587 new Set((yield* Ref.get(fixture.commands)).map((command) => command.threadId)),
588 new Set([
589 ThreadId.make("branch-one"),
590 ThreadId.make("branch-two"),
591 ThreadId.make("linked-one"),
592 ThreadId.make("linked-two"),
593 ]),
594 );
595 }).pipe(Effect.provide(fixture.layer));
596 }),
597 ),
598 );
599
600 it.effect("carries the snapshot guard and survives a stale dispatch rejection", () =>
601 Effect.scoped(
602 Effect.gen(function* () {
603 yield* TestClock.setTime(Date.parse(NOW));
604 const fixture = yield* makeHarness({
605 snapshot: makeSnapshot([makeThread("stale"), makeThread("next-candidate")]),
606 onDispatch: (command) =>
607 command.threadId === ThreadId.make("stale")
608 ? Effect.fail(
609 new OrchestrationCommandInvariantError({
610 commandType: command.type,
611 detail: "thread changed after settlement evaluation",
612 }),
613 )
614 : Effect.void,
615 });
616
617 yield* Effect.gen(function* () {
618 const reactor = yield* ThreadSettlementReactor.ThreadSettlementReactor;
619 yield* startHarness(reactor, fixture.activation, fixture.snapshotReads);
620
621 const firstSweep = yield* Ref.get(fixture.commands);
622 assert.strictEqual(
623 firstSweep.find((command) => command.threadId === ThreadId.make("stale"))
624 ?.snapshotSequence,
625 1,
626 );
627 assert.strictEqual(
628 firstSweep.some((command) => command.threadId === ThreadId.make("next-candidate")),
629 true,
630 );
631
632 yield* fixture.updateSettings({ sidebarAutoSettleAfterDays: 4 });
633 yield* Queue.take(fixture.snapshotReads);
634 yield* reactor.drain;
635 assert.strictEqual((yield* Ref.get(fixture.commands)).length, 4);
636 }).pipe(Effect.provide(fixture.layer));
637 }),
638 ),
639 );
640});