import { afterEach, beforeEach, describe, it } from "@std/testing/bdd"; import { expect } from "@std/expect"; import { getPatternIdentityRef, resolveEntryIdentity, resolveSystemPatternSource, Runtime, } from "@commonfabric/runner"; import { StorageManager } from "@commonfabric/runner/storage/cache.deno"; import { createSession, Identity } from "@commonfabric/identity"; import { HOME_PATTERN_SOURCE, PiecesController, } from "../src/ops/pieces-controller.ts"; import { reconcilePieceSource } from "../src/ops/piece-origin.ts"; // The route that ref expands to — what the toolshed serves, and what the // worker names the module by when it compiles the pattern over HTTP. const HOME_PATTERN_PATH = resolveSystemPatternSource( HOME_PATTERN_SOURCE, )!; // Golden replay for the HOME root — the higher-stakes sibling of // default-app-golden-replay.test.ts. // // The home root (home.tsx) carries the user's REAL durable data — favorites, // journal, spaces — where losing data on an update would be unrecoverable. // This test is the state-survival evidence that lets home follow its origin // like every other piece: seed representative // home data, roll the home root N→N+1 in place, and prove every list survives // intact and the new code runs over it. // // It is deliberately faithful to how real home OWNS its state. home.tsx does: // const favorites = new Writable([]).for("favorites"); // const journal = new Writable([]).for("journal"); // const spaces = new Writable([]).for("spaces"); // The `.for(