TypeScript
test(server): prune low-value tests in apps/server (second pass) (#22592)
Julius Marmingea2f4df041238
diff --git a/apps/server/scripts/migrate-dev-db.test.ts b/apps/server/scripts/migrate-dev-db.test.tsindex d8bf059852b..27c52f3fb4e 100644--- a/apps/server/scripts/migrate-dev-db.test.ts+++ b/apps/server/scripts/migrate-dev-db.test.ts@@ -194,33 +194,6 @@ it.layer(NodeServices.layer)("migrate-dev-db", (it) => {}),);- it.effect("fails loudly on a migration slot collision", () =>- Effect.gen(function* () {- const fs = yield* FileSystem.FileSystem;- const sourceDir = yield* fs.makeTempDirectoryScoped({ prefix: "migrate-dev-db-slot-" });- const destDir = yield* fs.makeTempDirectoryScoped({ prefix: "migrate-dev-db-slot-dest-" });- const source = yield* createFixtureSource(sourceDir);- yield* withDatabase(- source,- Effect.gen(function* () {- const sql = yield* SqlClient.SqlClient;- yield* sql`UPDATE effect_sql_migrations- SET name = 'SomebodyElsesMigration' WHERE migration_id = 1`;- }),- );-- const error = yield* runMigrateDevDb(- { baseDir: destDir, source, projects: 5, threadsPerProject: 10 },- { sharedHome: sourceDir },- ).pipe(Effect.flip);- assert.equal(error._tag, "MigrateDevDbSlotCollisionError");- if (error._tag === "MigrateDevDbSlotCollisionError") {- assert.equal(error.slot, 1);- assert.equal(error.appliedName, "SomebodyElsesMigration");- }- }),- );-it.effect("refuses while a dev server holds the destination", () =>Effect.gen(function* () {const fs = yield* FileSystem.FileSystem;diff --git a/apps/server/src/assets/AssetAccess.test.ts b/apps/server/src/assets/AssetAccess.test.tsindex d5312e6b0d1..a5d0a2f6616 100644--- a/apps/server/src/assets/AssetAccess.test.ts+++ b/apps/server/src/assets/AssetAccess.test.ts@@ -163,6 +163,7 @@ describe("AssetAccess", () => {}).pipe(Effect.provide(NodeServices.layer)),);+ // regression: #17026 apply host color scheme to saved MCP appsit.effect("preserves filesystem failures instead of reporting oversized HTML", () =>Effect.gen(function* () {const fileSystem = yield* FileSystem.FileSystem;@@ -684,40 +685,6 @@ describe("AssetAccess", () => {}).pipe(Effect.provide(layerTest)),);- it.effect("issues draft workspace URLs without a thread", () =>- Effect.gen(function* () {- const fileSystem = yield* FileSystem.FileSystem;- const path = yield* Path.Path;- const root = yield* fileSystem.makeTempDirectoryScoped({- prefix: "t3-asset-draft-",- });- const htmlPath = path.join(root, "report.html");- const cssPath = path.join(root, "report.css");- yield* fileSystem.writeFileString(htmlPath, '<link rel="stylesheet" href="report.css">');- yield* fileSystem.writeFileString(cssPath, "body { color: red; }");- const canonicalHtmlPath = yield* fileSystem.realPath(htmlPath);- const canonicalCssPath = yield* fileSystem.realPath(cssPath);-- const result = yield* issueAssetUrl({- resource: { _tag: "draft-workspace-file", cwd: root, path: "report.html" },- workspaceRoot: root,- });- const suffix = result.relativeUrl.slice(`${ASSET_ROUTE_PREFIX}/`.length);- const separatorIndex = suffix.indexOf("/");- const token = suffix.slice(0, separatorIndex);-- expect(yield* resolveAsset(token, "report.html")).toEqual({- kind: "file",- path: canonicalHtmlPath,- });- expect(yield* resolveAsset(token, "report.css")).toEqual({- kind: "file",- path: canonicalCssPath,- });- expect(yield* resolveAsset(token, "../secret.txt")).toBeNull();- }).pipe(Effect.provide(layerTest)),- );-it.effect("previews workspace files with literal fragment characters in their paths", () =>Effect.gen(function* () {const fileSystem = yield* FileSystem.FileSystem;diff --git a/apps/server/src/attachmentStore.test.ts b/apps/server/src/attachmentStore.test.tsindex 1136d5194bb..2c416bf70ac 100644--- a/apps/server/src/attachmentStore.test.ts+++ b/apps/server/src/attachmentStore.test.ts@@ -13,7 +13,6 @@ import {parseAttachmentUuid,planAttachmentClaim,parseThreadSegmentFromAttachmentId,- resolveAttachmentPathById,sweepStalePendingAttachments,threadHtmlRenderAttachmentIds,} from "./attachmentStore.ts";@@ -60,21 +59,6 @@ describe("attachmentStore", () => {expect(dashed && parseThreadSegmentFromAttachmentId(dashed)).toBe("thread-a");});- it("sanitizes thread ids when creating attachment ids", () => {- const attachmentId = createAttachmentId("thread.folder/unsafe space");- expect(attachmentId).toBeTruthy();- if (!attachmentId) {- return;- }-- const threadSegment = parseThreadSegmentFromAttachmentId(attachmentId);- expect(threadSegment).toBeTruthy();- expect(threadSegment).toMatch(/^[a-z0-9_-]+$/i);- expect(threadSegment).not.toContain(".");- expect(threadSegment).not.toContain("%");- expect(threadSegment).not.toContain("/");- });-it("parses exact thread segments from attachment ids without prefix collisions", () => {const fooId = "foo-00000000-0000-4000-8000-000000000001";const fooBarId = "foo-bar-00000000-0000-4000-8000-000000000002";@@ -93,25 +77,6 @@ describe("attachmentStore", () => {);});- it("resolves attachment path by id using the extension that exists on disk", () => {- const attachmentsDir = NodeFS.mkdtempSync(- NodePath.join(NodeOS.tmpdir(), "t3code-attachment-store-"),- );- try {- const attachmentId = "thread-1-attachment";- const pngPath = NodePath.join(attachmentsDir, `${attachmentId}.png`);- NodeFS.writeFileSync(pngPath, Buffer.from("hello"));-- const resolved = resolveAttachmentPathById({- attachmentsDir,- attachmentId,- });- expect(resolved).toBe(pngPath);- } finally {- NodeFS.rmSync(attachmentsDir, { recursive: true, force: true });- }- });-it("plans pending attachment claims with direct filename lookups", () => {const attachmentsDir = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3code-attachment-claim-"),diff --git a/apps/server/src/auth/EnvironmentAuth.test.ts b/apps/server/src/auth/EnvironmentAuth.test.tsindex c43e626823d..aa702b6bfbe 100644--- a/apps/server/src/auth/EnvironmentAuth.test.ts+++ b/apps/server/src/auth/EnvironmentAuth.test.ts@@ -255,26 +255,6 @@ it.layer(NodeServices.layer)("EnvironmentAuth.layer", (it) => {),);- it.effect("issues standard pairing credentials by default", () =>- Effect.gen(function* () {- const serverAuth = yield* EnvironmentAuth.EnvironmentAuth;- const sessions = yield* SessionStore.SessionStore;-- const pairingCredential = yield* serverAuth.issuePairingCredential();- const exchanged = yield* serverAuth.createBrowserSession(- pairingCredential.credential,- requestMetadata,- );- const verified = yield* serverAuth.authenticateHttpRequest(- makeCookieRequest(sessions.cookieName, exchanged.sessionToken),- );-- expect(verified.sessionId.length).toBeGreaterThan(0);- expect(verified.scopes).toEqual(AuthStandardClientScopes);- expect(verified.subject).toBe("one-time-token");- }).pipe(Effect.provide(layerEnvironmentAuth())),- );-it.effect("prefers a bearer token over a stale legacy cookie", () =>Effect.gen(function* () {const serverAuth = yield* EnvironmentAuth.EnvironmentAuth;diff --git a/apps/server/src/auth/EnvironmentAuthPolicy.test.ts b/apps/server/src/auth/EnvironmentAuthPolicy.test.tsindex 23e5c2bd7dc..06189cc5333 100644--- a/apps/server/src/auth/EnvironmentAuthPolicy.test.ts+++ b/apps/server/src/auth/EnvironmentAuthPolicy.test.ts@@ -79,23 +79,4 @@ it.layer(NodeServices.layer)("EnvironmentAuthPolicy.layer", (it) => {),),);-- it.effect("isolates wildcard-bound web development sessions", () =>- Effect.gen(function* () {- const policy = yield* EnvironmentAuthPolicy.EnvironmentAuthPolicy;- const descriptor = yield* policy.getDescriptor();-- expect(descriptor.policy).toBe("remote-reachable");- expect(descriptor.sessionCookieName).toMatch(/^t3_session_5775_[a-f0-9]{12}$/);- }).pipe(- Effect.provide(- layerEnvironmentAuthPolicy({- mode: "web",- host: "0.0.0.0",- port: 5775,- devUrl: new URL("http://127.0.0.1:5736"),- }),- ),- ),- );});diff --git a/apps/server/src/auth/PairingGrantStore.test.ts b/apps/server/src/auth/PairingGrantStore.test.tsindex 63d5cba3166..561633d3524 100644--- a/apps/server/src/auth/PairingGrantStore.test.ts+++ b/apps/server/src/auth/PairingGrantStore.test.ts@@ -124,27 +124,6 @@ it.layer(NodeServices.layer)("PairingGrantStore.layer", (it) => {}).pipe(Effect.provide(layerPairingGrantStore())),);- it.effect("seeds the desktop bootstrap credential as a reusable grant", () =>- Effect.gen(function* () {- const bootstrapCredentials = yield* PairingGrantStore.PairingGrantStore;- const first = yield* bootstrapCredentials.consume("desktop-bootstrap-token");- const second = yield* bootstrapCredentials.consume("desktop-bootstrap-token");- const third = yield* bootstrapCredentials.consume("desktop-bootstrap-token");-- expect(first.method).toBe("desktop-bootstrap");- expect(first.scopes).toEqual(AuthStandardClientScopes);- expect(first.subject).toBe("desktop-bootstrap");- expect(second.method).toBe("desktop-bootstrap");- expect(third.method).toBe("desktop-bootstrap");- }).pipe(- Effect.provide(- layerPairingGrantStore({- desktopBootstrapToken: "desktop-bootstrap-token",- }),- ),- ),- );-it.effect("reports seeded desktop bootstrap credentials as expired after their ttl", () =>Effect.gen(function* () {const bootstrapCredentials = yield* PairingGrantStore.PairingGrantStore;@@ -228,31 +207,4 @@ it.layer(NodeServices.layer)("PairingGrantStore.layer", (it) => {}}).pipe(Effect.scoped, Effect.provide(layerPairingGrantStore())),);-- it.effect("lists and revokes active pairing links", () =>- Effect.gen(function* () {- const bootstrapCredentials = yield* PairingGrantStore.PairingGrantStore;- const first = yield* bootstrapCredentials.issueOneTimeToken();- const second = yield* bootstrapCredentials.issueOneTimeToken({- scopes: ["orchestration:read", "access:write"],- });-- const activeBeforeRevoke = yield* bootstrapCredentials.listActive();- expect(activeBeforeRevoke.map((entry) => entry.id)).toContain(first.id);- expect(activeBeforeRevoke.map((entry) => entry.id)).toContain(second.id);- for (const entry of activeBeforeRevoke) {- expect(entry).not.toHaveProperty("credential");- }-- const revoked = yield* bootstrapCredentials.revoke(first.id);- const activeAfterRevoke = yield* bootstrapCredentials.listActive();- const revokedConsume = yield* Effect.flip(bootstrapCredentials.consume(first.credential));-- expect(revoked).toBe(true);- expect(activeAfterRevoke.map((entry) => entry.id)).not.toContain(first.id);- expect(activeAfterRevoke.map((entry) => entry.id)).toContain(second.id);- expect(revokedConsume.message).toContain("no longer available");- expect(revokedConsume._tag).toBe("UnavailableBootstrapCredentialError");- }).pipe(Effect.provide(layerPairingGrantStore())),- );});diff --git a/apps/server/src/auth/RpcAuthorization.test.ts b/apps/server/src/auth/RpcAuthorization.test.tsindex 390e33aa422..581517de719 100644--- a/apps/server/src/auth/RpcAuthorization.test.ts+++ b/apps/server/src/auth/RpcAuthorization.test.ts@@ -8,12 +8,8 @@ import {ProviderInstanceId,ThreadId,AuthOrchestrationOperateScope,- ORCHESTRATION_V2_WS_METHODS,AuthOrchestrationReadScope,AuthSourceControlWriteScope,- AuthPreviewOperateScope,- AuthRelayReadScope,- AuthRelayWriteScope,AuthTerminalReadScope,AuthTerminalOperateScope,WS_METHODS,@@ -37,27 +33,6 @@ describe("RPC authorization scopes", () => {expect(new Set(Object.keys(RPC_REQUIRED_SCOPES))).toEqual(new Set(WsRpcGroup.requests.keys()));});- it("requires operate access to stop a workflow", () => {- expect(requiredScopeForRpcMethod(ORCHESTRATION_V2_WS_METHODS.stopWorkflow)).toBe(- AuthOrchestrationOperateScope,- );- });-- it("authorizes background policy reporting and observation deliberately", () => {- expect(requiredScopeForRpcMethod(WS_METHODS.serverReportClientActivity)).toBe(- AuthOrchestrationReadScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.serverReportHostPowerState)).toBe(- AuthEnvironmentMaintainScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.serverGetBackgroundPolicy)).toBe(- AuthOrchestrationReadScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.subscribeBackgroundPolicy)).toBe(- AuthOrchestrationReadScope,- );- });-it("keeps webhook delivery logs, which hold request bodies, behind operate scope", () => {for (const method of [WS_METHODS.scheduledTasksListWebhookDeliveries,@@ -68,109 +43,6 @@ describe("RPC authorization scopes", () => {}});- it("allows relay status reads without granting relay installation access", () => {- expect(requiredScopeForRpcMethod(WS_METHODS.cloudGetRelayClientStatus)).toBe(- AuthRelayReadScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.cloudInstallRelayClient)).toBe(AuthRelayWriteScope);- });-- it("requires permission to operate on a thread before uploading feedback", () => {- expect(requiredScopeForRpcMethod(WS_METHODS.providerUploadFeedback)).toBe(- AuthOrchestrationOperateScope,- );- });-- it("requires write access to import agent session history", () => {- expect(requiredScopeForRpcMethod(WS_METHODS.agentSessionsScan)).toBe(- AuthOrchestrationReadScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.agentSessionsImport)).toBe(- AuthOrchestrationOperateScope,- );- });-- it("separates ACP Registry discovery from provisioning", () => {- expect(requiredScopeForRpcMethod(WS_METHODS.serverSearchAcpRegistry)).toBe(- AuthOrchestrationReadScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.serverPrepareAcpRegistryAgent)).toBe(- AuthProvidersManageScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.serverUninstallAcpRegistryManagedBinary)).toBe(- AuthProvidersManageScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.serverAcceptAcpRegistryUrlAuth)).toBe(- AuthProvidersManageScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.serverListAcpRegistrySessions)).toBe(- AuthOrchestrationReadScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.serverImportAcpRegistrySession)).toBe(- AuthOrchestrationOperateScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.serverLogoutAcpRegistry)).toBe(- AuthProvidersManageScope,- );- });-- it("reads the reviewer menu under the same scope as the pull request it belongs to", () => {- expect(requiredScopeForRpcMethod(WS_METHODS.pullRequestsChecks)).toBe(- AuthOrchestrationReadScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.pullRequestsReviewerCandidates)).toBe(- requiredScopeForRpcMethod(WS_METHODS.pullRequestsDetail),- );- expect(requiredScopeForRpcMethod(WS_METHODS.pullRequestsRequestReviewers)).toBe(- requiredScopeForRpcMethod(WS_METHODS.pullRequestsComment),- );- });-- it("requires source control writes to start, retry, or cancel project clones", () => {- for (const method of [- WS_METHODS.projectCloneStart,- WS_METHODS.projectCloneRetry,- WS_METHODS.projectCloneCancel,- ]) {- expect(requiredScopeForRpcMethod(method)).toBe(AuthSourceControlWriteScope);- }- expect(requiredScopeForRpcMethod(WS_METHODS.subscribeProjectClones)).toBe(- AuthOrchestrationReadScope,- );- });-- it("separates viewing pull request file progress from writing it", () => {- expect(requiredScopeForRpcMethod(WS_METHODS.pullRequestsFilesViewed)).toBe(- AuthOrchestrationReadScope,- );- expect(requiredScopeForRpcMethod(WS_METHODS.pullRequestsSetFilesViewed)).toBe(- AuthSourceControlWriteScope,- );- });-- it("separates preview control from observation", () => {- for (const method of [- WS_METHODS.previewOpen,- WS_METHODS.previewNavigate,- WS_METHODS.previewResize,- WS_METHODS.previewRefresh,- WS_METHODS.previewClose,- WS_METHODS.previewReportStatus,- WS_METHODS.previewAdjust,- WS_METHODS.previewClearProfile,- WS_METHODS.previewReportProfiles,- ]) {- expect(requiredScopeForRpcMethod(method)).toBe(AuthPreviewOperateScope);- }- for (const method of [- WS_METHODS.previewList,- WS_METHODS.subscribePreviewEvents,- WS_METHODS.subscribeDiscoveredLocalServers,- ]) {- expect(requiredScopeForRpcMethod(method)).toBe(AuthOrchestrationReadScope);- }- });-it("separates passive terminal observation from operations that can change a shell", () => {for (const method of [WS_METHODS.terminalObserve,@@ -230,10 +102,6 @@ describe("RPC scope middleware", () => {scopes: [AuthOrchestrationReadScope, AuthEnvironmentMaintainScope],missing: AuthDiagnosticsReadScope,},- {- scopes: [AuthOrchestrationReadScope, AuthDiagnosticsReadScope],- missing: AuthEnvironmentMaintainScope,- },])("rejects telemetry retry without $missing before its handler runs", ({ scopes, missing }) =>Effect.gen(function* () {const handled: Array<string> = [];@@ -377,7 +245,7 @@ describe("thread context authorization", () => {),);- it.effect.each(["commit", "push", "commit_push", "create_pr", "commit_push_pr"] as const)(+ it.effect.each(["commit", "create_pr", "commit_push_pr"] as const)("%s needs thread read permission only when generating a PR from a thread",(action) =>Effect.gen(function* () {diff --git a/apps/server/src/auth/ServerSecretStore.test.ts b/apps/server/src/auth/ServerSecretStore.test.tsindex 9c167928b95..b3dd615c8d4 100644--- a/apps/server/src/auth/ServerSecretStore.test.ts+++ b/apps/server/src/auth/ServerSecretStore.test.ts@@ -118,16 +118,6 @@ const layerConcurrentCreateSecretStore = () =>);it.layer(NodeServices.layer)("ServerSecretStore.layer", (it) => {- it.effect("returns Option.none when a secret file does not exist", () =>- Effect.gen(function* () {- const secretStore = yield* ServerSecretStore.ServerSecretStore;-- const secret = yield* secretStore.get("missing-secret");-- assert.isTrue(Option.isNone(secret));- }).pipe(Effect.provide(layerServerSecretStore())),- );-it.effect("reuses an existing secret instead of regenerating it", () =>Effect.gen(function* () {const secretStore = yield* ServerSecretStore.ServerSecretStore;@@ -158,45 +148,6 @@ it.layer(NodeServices.layer)("ServerSecretStore.layer", (it) => {}).pipe(Effect.provide(layerConcurrentCreateSecretStore())),);- it.effect("uses restrictive permissions for the secret directory and files", () =>- Effect.gen(function* () {- const chmodCalls: Array<{ readonly path: string; readonly mode: number }> = [];- const layerRecordingFileSystem = Layer.effect(- FileSystem.FileSystem,- Effect.gen(function* () {- const fileSystem = yield* FileSystem.FileSystem;-- return {- ...fileSystem,- makeDirectory: () => Effect.void,- writeFile: () => Effect.void,- rename: () => Effect.void,- chmod: (path, mode) =>- Effect.sync(() => {- chmodCalls.push({ path: String(path), mode });- }),- } satisfies FileSystem.FileSystem;- }),- ).pipe(Layer.provide(NodeServices.layer));-- const secretStore = yield* Effect.service(ServerSecretStore.ServerSecretStore).pipe(- Effect.provide(- ServerSecretStore.layer.pipe(- Layer.provide(layerServerConfig()),- Layer.provideMerge(layerRecordingFileSystem),- ),- ),- );-- yield* secretStore.set("session-signing-key", Uint8Array.from([1, 2, 3]));-- assert.isTrue(- chmodCalls.some((call) => call.mode === 0o700 && /[\\/]secrets$/.test(call.path)),- );- assert.isAtLeast(chmodCalls.filter((call) => call.mode === 0o600).length, 2);- }).pipe(Effect.provide(NodeServices.layer)),- );-it.effect("propagates read failures other than missing-file errors", () =>Effect.gen(function* () {const secretStore = yield* ServerSecretStore.ServerSecretStore;diff --git a/apps/server/src/auth/SessionStore.test.ts b/apps/server/src/auth/SessionStore.test.tsindex 87f55b578c6..41c4d6b7437 100644--- a/apps/server/src/auth/SessionStore.test.ts+++ b/apps/server/src/auth/SessionStore.test.ts@@ -1,5 +1,5 @@import * as NodeServices from "@effect/platform-node/NodeServices";-import { AuthStandardClientScopes, EnvironmentId } from "@t3tools/contracts";+import { EnvironmentId } from "@t3tools/contracts";import { expect, it } from "@effect/vitest";import * as Duration from "effect/Duration";import * as Effect from "effect/Effect";@@ -14,10 +14,8 @@ import * as SqlClient from "effect/sql/SqlClient";import * as ServerConfig from "../config.ts";import * as ServerEnvironment from "../environment/ServerEnvironment.ts";-import { PersistenceSqlError } from "../persistence/Errors.ts";import * as SqlitePersistence from "../persistence/Sqlite.ts";-import * as AuthSessions from "../persistence/AuthSessions.ts";import * as SessionStore from "./SessionStore.ts";import * as ServerSecretStore from "./ServerSecretStore.ts";import { base64UrlDecodeUtf8, base64UrlEncode, signPayload } from "./utils.ts";@@ -84,34 +82,6 @@ const makeDiskSessionStoreLayer = Effect.fn("makeDiskSessionStoreLayer")(functio);});-const repositoryFailure = new PersistenceSqlError({- operation: "AuthSessionRepository.getById:query",- detail: "sqlite is unavailable",-});--const layerFailingSessionLookupRepository = Layer.succeed(AuthSessions.AuthSessionRepository, {- create: () => Effect.void,- createReplacingActive: () => Effect.succeed([]),- createIfAbsent: () => Effect.void,- getById: () => Effect.fail(repositoryFailure),- listActive: () => Effect.succeed([]),- revoke: () => Effect.fail(repositoryFailure),- revokeAllExcept: () => Effect.fail(repositoryFailure),- setLastConnectedAt: () => Effect.void,- setClientConnection: () => Effect.void,-});--const layerFailingSessionLookupCredential = Layer.effect(- SessionStore.SessionStore,- SessionStore.make,-).pipe(- Layer.provide(layerFailingSessionLookupRepository),- Layer.provide(ServerSecretStore.layer),- Layer.provide(SqlitePersistence.layerMemory),- Layer.provide(layerServerEnvironment(EnvironmentId.make("test-environment"))),- Layer.provide(layerServerConfig()),-);-it.layer(NodeServices.layer)("SessionStore.layer", (it) => {it.effect.each(["revoke", "revokeAllExcept", "replace"] as const)("invalidates every connection for a session on %s and leaves other sessions active",@@ -277,30 +247,6 @@ it.layer(NodeServices.layer)("SessionStore.layer", (it) => {}),);- it.effect("issues and verifies signed browser session tokens", () =>- Effect.gen(function* () {- const sessions = yield* SessionStore.SessionStore;- const issued = yield* sessions.issue({- subject: "desktop-bootstrap",- scopes: ["orchestration:read", "access:write"],- client: {- label: "Desktop app",- deviceType: "desktop",- os: "macOS",- browser: "Electron",- ipAddress: "127.0.0.1",- },- });- const verified = yield* sessions.verify(issued.token);-- expect(verified.method).toBe("browser-session-cookie");- expect(verified.subject).toBe("desktop-bootstrap");- expect(verified.scopes).toEqual(["orchestration:read", "access:write"]);- expect(verified.client.label).toBe("Desktop app");- expect(verified.client.browser).toBe("Electron");- expect(verified.expiresAt?.toString()).toBe(issued.expiresAt.toString());- }).pipe(Effect.provide(layerSessionStore())),- );it.effect("carries a runtime-mode ceiling only on sessions issued with one", () =>Effect.gen(function* () {const sessions = yield* SessionStore.SessionStore;@@ -342,66 +288,6 @@ it.layer(NodeServices.layer)("SessionStore.layer", (it) => {),);- it.effect("rejects malformed session tokens", () =>- Effect.gen(function* () {- const sessions = yield* SessionStore.SessionStore;- const error = yield* Effect.flip(sessions.verify("not-a-session-token"));-- expect(error._tag).toBe("MalformedSessionTokenError");- expect(error.message).toContain("Malformed session token");- }).pipe(Effect.provide(layerSessionStore())),- );- it.effect("preserves repository failures while verifying session and websocket credentials", () =>- Effect.gen(function* () {- const sessions = yield* SessionStore.SessionStore;- const issued = yield* sessions.issue({- method: "bearer-access-token",- subject: "repository-failure",- });- const websocket = yield* sessions.issueWebSocketToken(issued.sessionId);-- const sessionError = yield* Effect.flip(sessions.verify(issued.token));- const websocketError = yield* Effect.flip(sessions.verifyWebSocketToken(websocket.token));- const revokeError = yield* Effect.flip(sessions.revoke(issued.sessionId));- const revokeOthersError = yield* Effect.flip(sessions.revokeAllExcept(issued.sessionId));-- expect(sessionError._tag).toBe("SessionCredentialVerificationError");- expect(websocketError._tag).toBe("WebSocketTokenVerificationError");- expect(sessionError.cause).toBe(repositoryFailure);- expect(websocketError.cause).toBe(repositoryFailure);- if (sessionError._tag === "SessionCredentialVerificationError") {- expect(sessionError.sessionId).toBe(issued.sessionId);- }- if (websocketError._tag === "WebSocketTokenVerificationError") {- expect(websocketError.sessionId).toBe(issued.sessionId);- }- expect(revokeError).toMatchObject({- _tag: "SessionRevocationError",- sessionId: issued.sessionId,- cause: repositoryFailure,- });- expect(revokeOthersError).toMatchObject({- _tag: "OtherSessionsRevocationError",- currentSessionId: issued.sessionId,- cause: repositoryFailure,- });- }).pipe(Effect.provide(layerFailingSessionLookupCredential)),- );- it.effect("verifies session tokens against the Effect clock", () =>- Effect.gen(function* () {- const sessions = yield* SessionStore.SessionStore;- const issued = yield* sessions.issue({- method: "bearer-access-token",- subject: "test-clock",- });- const verified = yield* sessions.verify(issued.token);-- expect(verified.method).toBe("bearer-access-token");- expect(verified.subject).toBe("test-clock");- expect(verified.scopes).toEqual(AuthStandardClientScopes);- }).pipe(Effect.provide(Layer.merge(layerSessionStore(), TestClock.layer()))),- );-it.effect("atomically replaces active sessions with the same subject and method", () =>Effect.gen(function* () {const sessions = yield* SessionStore.SessionStore;@@ -539,44 +425,6 @@ it.layer(NodeServices.layer)("SessionStore.layer", (it) => {}).pipe(Effect.provide(Layer.merge(layerSessionStore(), TestClock.layer()))),);- it.effect("includes expiry context when session and websocket tokens expire", () =>- Effect.gen(function* () {- const sessions = yield* SessionStore.SessionStore;- const issued = yield* sessions.issue({- method: "bearer-access-token",- subject: "short-lived-token",- ttl: Duration.seconds(1),- });- const websocket = yield* sessions.issueWebSocketToken(issued.sessionId, {- ttl: Duration.seconds(1),- });-- yield* TestClock.adjust(Duration.seconds(2));-- const sessionError = yield* Effect.flip(sessions.verify(issued.token));- const websocketError = yield* Effect.flip(sessions.verifyWebSocketToken(websocket.token));-- expect(sessionError._tag).toBe("SessionTokenExpiredError");- if (sessionError._tag === "SessionTokenExpiredError") {- expect(sessionError.sessionId).toBe(issued.sessionId);- expect(sessionError.expiresAt.epochMilliseconds).toBe(issued.expiresAt.epochMilliseconds);- expect(sessionError.observedAt.epochMilliseconds).toBeGreaterThan(- sessionError.expiresAt.epochMilliseconds,- );- }- expect(websocketError._tag).toBe("WebSocketTokenExpiredError");- if (websocketError._tag === "WebSocketTokenExpiredError") {- expect(websocketError.sessionId).toBe(issued.sessionId);- expect(websocketError.expiresAt.epochMilliseconds).toBe(- websocket.expiresAt.epochMilliseconds,- );- expect(websocketError.observedAt.epochMilliseconds).toBeGreaterThan(- websocketError.expiresAt.epochMilliseconds,- );- }- }).pipe(Effect.provide(Layer.merge(layerSessionStore(), TestClock.layer()))),- );-it.effect("lists active sessions, tracks connectivity, and revokes other sessions", () =>Effect.gen(function* () {const sessions = yield* SessionStore.SessionStore;diff --git a/apps/server/src/auth/SessionStore.ts b/apps/server/src/auth/SessionStore.tsindex 5c08e978f91..1f4ad752d2b 100644--- a/apps/server/src/auth/SessionStore.ts+++ b/apps/server/src/auth/SessionStore.ts@@ -482,7 +482,7 @@ function toAuthClientSession(input: Omit<AuthClientSession, "current">): AuthCli};}-export const make = Effect.gen(function* () {+const make = Effect.gen(function* () {const crypto = yield* Crypto.Crypto;const serverConfig = yield* ServerConfig.ServerConfig;const serverEnvironment = yield* ServerEnvironment.ServerEnvironmentIdentity;diff --git a/apps/server/src/auth/utils.test.ts b/apps/server/src/auth/utils.test.tsindex 47b23a495f2..63336b29c90 100644--- a/apps/server/src/auth/utils.test.ts+++ b/apps/server/src/auth/utils.test.ts@@ -77,6 +77,7 @@ describe("session cookie isolation", () => {expect(first).not.toBe(second);});+ // regression: #8085 isolate remote web session cookiesit("isolates remote web servers by server state", () => {const first = resolveSessionCookieName({mode: "web",diff --git a/apps/server/src/background/BackgroundPolicy.test.ts b/apps/server/src/background/BackgroundPolicy.test.tsindex d9500322bc3..87da22e6cd4 100644--- a/apps/server/src/background/BackgroundPolicy.test.ts+++ b/apps/server/src/background/BackgroundPolicy.test.ts@@ -256,23 +256,6 @@ describe("BackgroundPolicy", () => {}).pipe(Effect.provide(layerFor(nominalHostPower))),);- it.effect(- "performance profile allows background scoped work while a scoped lease is active",- () =>- Effect.gen(function* () {- const policy = yield* BackgroundPolicy.BackgroundPolicy;- yield* policy.reportClientActivity(- AuthSessionId.make("session-1"),- RpcClientId.make(1),- makeReport({ focused: false, visible: false }),- );-- assert.equal(yield* policy.shouldRunScopeWork({ type: "vcs-status", cwd: "/repo" }), true);- }).pipe(- Effect.provide(layerFor(nominalHostPower, { backgroundActivityProfile: "performance" })),- ),- );-it.effect("battery saver profile pauses scoped work on battery", () =>Effect.gen(function* () {const policy = yield* BackgroundPolicy.BackgroundPolicy;diff --git a/apps/server/src/checkpointing/CheckpointDiffQuery.test.ts b/apps/server/src/checkpointing/CheckpointDiffQuery.test.tsindex b0b443d5b00..aae4a4a38b6 100644--- a/apps/server/src/checkpointing/CheckpointDiffQuery.test.ts+++ b/apps/server/src/checkpointing/CheckpointDiffQuery.test.ts@@ -68,26 +68,6 @@ function layerFor(input: {);}-it.effect("preserves the typed unavailable-range error contract", () => {- const layer = layerFor({ projection: Effect.succeed(makeProjection()) });-- return Effect.gen(function* () {- const query = yield* CheckpointDiffQuery.CheckpointDiffQuery;- const error = yield* query- .getTurnDiff({ threadId, fromTurnCount: 0, toTurnCount: 3 })- .pipe(Effect.flip);-- assert.instanceOf(error, CheckpointTurnRangeUnavailableError);- assert.deepEqual(- {- requestedTurnCount: error.requestedTurnCount,- availableTurnCount: error.availableTurnCount,- },- { requestedTurnCount: 3, availableTurnCount: 2 },- );- }).pipe(Effect.provide(layer));-});-it.effect("excludes ready checkpoints from rolled-back runs", () => {const projection = makeProjection();const layer = layerFor({diff --git a/apps/server/src/cli/app.test.ts b/apps/server/src/cli/app.test.tsindex 9c5380bc085..b4184663625 100644--- a/apps/server/src/cli/app.test.ts+++ b/apps/server/src/cli/app.test.ts@@ -215,24 +215,6 @@ describe("t3 server command safety", () => {});describe("t3 app", () => {- it.effect("does not create state when only a server or no desktop app is running", () =>- withTempDirectory("t3-app-missing-test-", (root) =>- Effect.gen(function* () {- const baseDir = NodePath.join(root, "missing-t3-home");- const error = yield* runCli(["app", "--base-dir", baseDir]).pipe(Effect.flip);-- expect(error).toMatchObject({- _tag: "DesktopAppUnreachableError",- candidateAddresses: [expect.any(String)],- workspaceRoot: yield* HostProcess.WorkingDirectory,- message: expect.stringContaining("Could not reach the T3 Code desktop app."),- cause: { code: "ENOENT" },- });- expect(yield* pathExists(baseDir)).toBe(false);- }),- ),- );-it.effect("uses T3CODE_HOME or --base-dir and sends the default or explicit path", () =>withTempDirectory("t3-app-command-test-", (root) =>Effect.gen(function* () {diff --git a/apps/server/src/cli/config.test.ts b/apps/server/src/cli/config.test.tsindex 72b38cea03e..7b7d6bf7522 100644--- a/apps/server/src/cli/config.test.ts+++ b/apps/server/src/cli/config.test.ts@@ -592,49 +592,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => {}),);- it.effect("decodes percent-encoded OTLP headers from env", () =>- Effect.gen(function* () {- const { join } = yield* Path.Path;- const baseDir = join(NodeOS.tmpdir(), "t3-cli-config-otlp-headers-base");-- const resolved = yield* resolveServerConfig(- {- mode: Option.some("web"),- port: Option.some(3773),- host: Option.none(),- baseDir: Option.some(baseDir),- cwd: Option.none(),- devUrl: Option.none(),- noBrowser: Option.none(),- bootstrapFd: Option.none(),- autoBootstrapProjectFromCwd: Option.none(),- logWebSocketEvents: Option.none(),- tailscaleServeEnabled: Option.none(),- tailscaleServePort: Option.none(),- },- Option.none(),- ).pipe(- Effect.provide(- Layer.mergeAll(- ConfigProvider.layer(- ConfigProvider.fromEnv({- env: {- T3CODE_OTLP_HEADERS: "authorization=Basic%20abc%3D%3D,x-tenant=t3",- },- }),- ),- NetService.layer,- ),- ),- );-- expect(resolved.otlpTracesExport.headers).toEqual({- authorization: "Basic abc==",- "x-tenant": "t3",- });- }),- );-it.effect("keeps whitespace-separated pairs and literal equals signs in OTLP headers", () =>Effect.gen(function* () {const { join } = yield* Path.Path;diff --git a/apps/server/src/cli/connect.test.ts b/apps/server/src/cli/connect.test.tsindex ca8264de325..6693d214fab 100644--- a/apps/server/src/cli/connect.test.ts+++ b/apps/server/src/cli/connect.test.ts@@ -1,14 +1,9 @@import * as RelayClient from "@t3tools/shared/relayClient";import { assert, it } from "@effect/vitest";-import * as Cause from "effect/Cause";-import * as Console from "effect/Console";import * as Effect from "effect/Effect";-import * as Exit from "effect/Exit";-import * as Logger from "effect/Logger";import * as Option from "effect/Option";-import * as References from "effect/References";-import { acquireRelayClientForLink, reportCloudDisconnectResults } from "./connect.ts";+import { acquireRelayClientForLink } from "./connect.ts";const managedExecutable = {status: "available",@@ -45,51 +40,3 @@ it.effect("does not install the relay client when the user declines the managedassert.equal(installCalls, 0);}),);--it.effect("keeps disconnect causes in structured logs and out of console warnings", () => {- const warnings: ReadonlyArray<unknown>[] = [];- const logs: Readonly<Record<string, unknown>>[] = [];- const testConsole = {- ...globalThis.console,- warn: (...args: ReadonlyArray<unknown>) => {- warnings.push(args);- },- } satisfies Console.Console;- const logger = Logger.make(({ fiber }) => {- logs.push(fiber.getRef(References.CurrentLogAnnotations));- });- const liveFailure = "live unlink private diagnostic";- const relayFailure = "relay revoke private diagnostic";-- return reportCloudDisconnectResults({- clearAuthorization: true,- liveResult: {- status: "failed",- cause: Cause.fail(new Error(liveFailure)),- },- relayResult: Exit.failCause(Cause.die(new Error(relayFailure))),- }).pipe(- Effect.provideService(Console.Console, testConsole),- Effect.provide(Logger.layer([logger], { mergeWithExisting: false })),- Effect.tap(() =>- Effect.sync(() => {- assert.lengthOf(warnings, 2);- const warningText = warnings.flat().map(String).join("\n");- assert.include(warningText, "running server could not stop its tunnel");- assert.include(warningText, "Could not revoke the relay-side environment record");- assert.notInclude(warningText, liveFailure);- assert.notInclude(warningText, relayFailure);- assert.deepEqual(- logs.map(({ operation, clearAuthorization }) => ({ operation, clearAuthorization })),- [- { operation: "live-server-unlink", clearAuthorization: true },- { operation: "relay-environment-unlink", clearAuthorization: true },- ],- );- const loggedCauses = logs.map((log) => String(log.cause)).join("\n");- assert.include(loggedCauses, liveFailure);- assert.include(loggedCauses, relayFailure);- }),- ),- );-});diff --git a/apps/server/src/cli/connect.ts b/apps/server/src/cli/connect.tsindex 4ac5a73a650..76644be57e1 100644--- a/apps/server/src/cli/connect.ts+++ b/apps/server/src/cli/connect.ts@@ -441,7 +441,7 @@ const unlinkRelayEnvironment = Effect.fn("cloud.cli.unlink_relay_environment")(f* A missing CLI login or a failed relay DELETE leaves that record registered, so* those outcomes warn to deregister it from the T3 Connect account page.*/-export const reportCloudDisconnectResults = Effect.fn("cloud.cli.report_disconnect_results")(+const reportCloudDisconnectResults = Effect.fn("cloud.cli.report_disconnect_results")(function* (input: {readonly clearAuthorization: boolean;readonly liveResult: LiveCloudActionResult;diff --git a/apps/server/src/cli/pair.test.ts b/apps/server/src/cli/pair.test.tsindex 667134631f9..1eeeee4aaba 100644--- a/apps/server/src/cli/pair.test.ts+++ b/apps/server/src/cli/pair.test.ts@@ -287,29 +287,6 @@ describe("t3 pair", () => {).pipe(Effect.provide(NodeServices.layer)),);- it.effect("ignores stale runtime state pointing at a dead server", () =>- Effect.gen(function* () {- const baseDir = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-pair-stale-test-"));- const statePath = NodePath.join(baseDir, "userdata", "server-runtime.json");- yield* persistServerRuntimeState({- path: statePath,- state: yield* makePersistedServerRuntimeState({- config: { host: "127.0.0.1", devUrl: undefined },- port: 1,- }),- });-- const error = yield* provideCliTestLayers(- runCli(["pair", "--base-dir", baseDir]).pipe(Effect.flip),- );-- const rendered = String(- typeof error === "object" && error !== null && "cause" in error ? error.cause : error,- );- assert.include(rendered, "No running T3 Code server found.");- }).pipe(Effect.provide(NodeServices.layer)),- );-// Without the capability `tailscale serve` blocks on an enablement URL, so// pairing must stop at status instead of spawning it.it.effect("explains a tailnet without HTTPS serve instead of running tailscale serve", () =>diff --git a/apps/server/src/cli/project.test.ts b/apps/server/src/cli/project.test.tsindex 5abffbb5307..40a7ab71138 100644--- a/apps/server/src/cli/project.test.ts+++ b/apps/server/src/cli/project.test.ts@@ -39,10 +39,6 @@ import * as RepositoryIdentityResolver from "../project/RepositoryIdentityResolvimport * as T3ProjectFileLoader from "../project/T3ProjectFileLoader.ts";import * as ServerSettings from "../serverSettings.ts";import * as WorkspacePaths from "../workspace/WorkspacePaths.ts";-import {- ProjectLiveServerRequestError,- projectCommandErrorFromLiveServerRequest,-} from "./project.ts";const layerCliRuntime = Layer.mergeAll(NodeServices.layer, NetService.layer);const runCli = (args: ReadonlyArray<string>) =>@@ -105,17 +101,6 @@ const readProjects = (baseDir: string) =>);});-it("preserves unexpected server failures without deriving the message from them", () => {- const cause = new Error("credential abc123 was rejected");-- const error = projectCommandErrorFromLiveServerRequest(cause);-- assert.instanceOf(error, ProjectLiveServerRequestError);- assert.strictEqual(error.operation, "callLiveServer");- assert.strictEqual(error.message, "Failed to call the running server.");- assert.strictEqual(error.cause, cause);-});-it.effect("adds, renames, and removes projects through the V2 project CLI domain", () =>Effect.gen(function* () {const baseDir = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-v2-project-cli-"));@@ -234,12 +219,6 @@ const readNativeThreadState = Effect.fn("ProjectCliTest.readNativeThreadState")(it.layer(NodeServices.layer)("project deletion with native V2 threads", (it) => {it.effect.each([{ label: "an active thread", archived: false, missing: false },- { label: "an archived thread", archived: true, missing: false },- {- label: "an active thread after its workspace disappears",- archived: false,- missing: true,- },{label: "an archived thread after its workspace disappears",archived: true,diff --git a/apps/server/src/cli/project.ts b/apps/server/src/cli/project.tsindex b567a7d4d3d..a5c8aa532ff 100644--- a/apps/server/src/cli/project.ts+++ b/apps/server/src/cli/project.ts@@ -169,7 +169,7 @@ export const ProjectCommandError = Schema.Union([]);export type ProjectCommandError = typeof ProjectCommandError.Type;-export function projectCommandErrorFromLiveServerRequest(cause: unknown): ProjectCommandError {+function projectCommandErrorFromLiveServerRequest(cause: unknown): ProjectCommandError {if (isEnvironmentHttpCommonError(cause)) {return new ProjectLiveServerDeclaredResponseError({operation: "callLiveServer",diff --git a/apps/server/src/cli/service.test.ts b/apps/server/src/cli/service.test.tsindex 5e8bbc48e55..904fb87a1c6 100644--- a/apps/server/src/cli/service.test.ts+++ b/apps/server/src/cli/service.test.ts@@ -112,6 +112,7 @@ it.effect("leaves a newer service unchanged during onboarding without prompting"}),);+// regression: #9602 diagnose incomplete headless server setupit.effect("keeps the manual-server fallback when background prerequisites fail", () =>Effect.gen(function* () {const ready = yield* recoverServiceOnboardingOffer(diff --git a/apps/server/src/cli/theme.test.ts b/apps/server/src/cli/theme.test.tsindex 0650ef1fd2c..f28548fe0bc 100644--- a/apps/server/src/cli/theme.test.ts+++ b/apps/server/src/cli/theme.test.ts@@ -112,23 +112,6 @@ describe("t3 theme", () => {}),);- it.effect("publishes nothing when the settings file cannot be used", () =>- Effect.gen(function* () {- const baseDir = makeBaseDir();- NodeFS.mkdirSync(NodePath.dirname(settingsPathFor(baseDir)), { recursive: true });- NodeFS.writeFileSync(settingsPathFor(baseDir), "{ not json");- const themeFile = NodePath.join(baseDir, "nightfall.json");- NodeFS.writeFileSync(themeFile, NIGHTFALL_THEME_JSON);-- const failure = yield* runCli(["theme", "set", themeFile, "--base-dir", baseDir]).pipe(- Effect.flip,- );-- assert.include(String(failure), "not a JSON object");- assert.equal(NodeFS.existsSync(NodePath.join(baseDir, "userdata", "themes")), false);- }),- );-it.effect.skipIf(!symlinksSupported)("never writes through a symlink at the staging path", () =>Effect.gen(function* () {const baseDir = makeBaseDir();@@ -171,20 +154,6 @@ describe("t3 theme", () => {}),);- it.effect("rejects a path that does not exist instead of storing it as an id", () =>- Effect.gen(function* () {- const baseDir = makeBaseDir();- const failure = yield* runCli([- "theme",- "set",- `${baseDir}/missing.json`,- "--base-dir",- baseDir,- ]).pipe(Effect.flip);- assert.include(String(failure), "Could not read");- }),- );-it.effect.skipIf(windowsHost)("refuses to write when the settings file cannot be read", () =>Effect.gen(function* () {const baseDir = makeBaseDir();@@ -201,48 +170,4 @@ describe("t3 theme", () => {assert.equal(Object.hasOwn(readSettings(baseDir), "defaultTheme"), false);}),);-- it.effect("accepts an id a published file provides", () =>- Effect.gen(function* () {- const baseDir = makeBaseDir();- const themeFile = NodePath.join(baseDir, "nightfall.json");- NodeFS.writeFileSync(themeFile, NIGHTFALL_THEME_JSON);- yield* runCli(["theme", "set", themeFile, "--base-dir", baseDir]);-- yield* runCli(["theme", "clear", "--base-dir", baseDir]);- yield* runCli(["theme", "set", "nightfall", "--base-dir", baseDir]);- assert.equal(readSettings(baseDir).defaultTheme, "nightfall");- }),- );-- it.effect("rejects an id whose published file the watcher would skip", () =>- Effect.gen(function* () {- const baseDir = makeBaseDir();- const themesDir = NodePath.join(baseDir, "userdata", "themes");- NodeFS.mkdirSync(themesDir, { recursive: true });- NodeFS.writeFileSync(NodePath.join(themesDir, "broken.json"), "{ not json\n");-- const failure = yield* runCli(["theme", "set", "broken", "--base-dir", baseDir]).pipe(- Effect.flip,- );- assert.include(String(failure), "No theme named");- }),- );-- it.effect("rejects a theme file larger than the watcher will read", () =>- Effect.gen(function* () {- const baseDir = makeBaseDir();- const themeFile = NodePath.join(baseDir, "huge.json");- const padding = "x".repeat(40 * 1024);- NodeFS.writeFileSync(- themeFile,- `{ "name": "Huge", "appearance": "dark", "canvas": "#1a1b26", "accent": "#7aa2f7", "note": "${padding}" }\n`,- );-- const failure = yield* runCli(["theme", "set", themeFile, "--base-dir", baseDir]).pipe(- Effect.flip,- );- assert.include(String(failure), "larger than");- }),- );});diff --git a/apps/server/src/cloud/CliTokenManager.test.ts b/apps/server/src/cloud/CliTokenManager.test.tsindex c9fa7b82578..c64ca01e81b 100644--- a/apps/server/src/cloud/CliTokenManager.test.ts+++ b/apps/server/src/cloud/CliTokenManager.test.ts@@ -213,9 +213,7 @@ it.effect(it.effect.each([{ status: 400, code: "invalid_grant", requiresLogin: true, diagnostic: true },{ status: 403, code: "private-provider-secret", requiresLogin: true, diagnostic: false },- { status: 408, code: "invalid_grant", requiresLogin: false, diagnostic: false },{ status: 429, code: "invalid_grant", requiresLogin: false, diagnostic: false },- { status: 500, code: "invalid_grant", requiresLogin: false, diagnostic: false },])("refresh HTTP $status exposes only a safe login diagnostic",({ status, code, requiresLogin, diagnostic }) =>diff --git a/apps/server/src/cloud/CloudLink.lifecycle.test.ts b/apps/server/src/cloud/CloudLink.lifecycle.test.tsindex 1880b2cd665..7264afd6a45 100644--- a/apps/server/src/cloud/CloudLink.lifecycle.test.ts+++ b/apps/server/src/cloud/CloudLink.lifecycle.test.ts@@ -97,89 +97,6 @@ describe("consumeCloudReplayGuards", () => {expect(consumed).toBe(false);}),);-- it.effect("preserves replay-store availability failures", () =>- Effect.gen(function* () {- const failure = storeFailure("PermissionDenied");- const error = yield* Effect.flip(- consumeCloudReplayGuards({- secrets: makeSecretStore(() => Effect.fail(failure)),- names: ["cloud-jti", "cloud-nonce"],- value: new Uint8Array(),- }),- );-- expect(error).toBe(failure);- }),- );-});--describe("reconcileDesiredCloudLink", () => {- it.effect("requires stored CLI authorization without exposing an HTTP endpoint", () =>- Effect.gen(function* () {- const link = yield* CloudLink.CloudLink;- const error = yield* Effect.flip(link.reconcileDesiredLink("http://127.0.0.1:3774"));-- expect(error._tag).toBe("CloudLinkAuthorizationMissingError");- }).pipe(- Effect.provide(CloudLink.layer),- Effect.provideService(- ConnectReachability.ConnectReachability,- ConnectReachability.ConnectReachability.of({- check: Effect.die("unused"),- latest: Effect.succeed(Option.none()),- }),- ),- Effect.provideService(HttpServer.HttpServer, idleHttpServer),- Effect.provideService(- ServerConfigModule.ServerConfig,- ServerConfigModule.ServerConfig.of({} as ServerConfigModule.ServerConfig["Service"]),- ),- Effect.provideService(- ServerSecretStore.ServerSecretStore,- makeSecretStore(unusedSecretStoreOperation),- ),- Effect.provideService(- ServerEnvironment.ServerEnvironment,- ServerEnvironment.ServerEnvironment.of({- getEnvironmentId: unusedSecretStoreOperation(),- getDescriptor: unusedSecretStoreOperation(),- }),- ),- Effect.provideService(- ManagedEndpointRuntime.CloudManagedEndpointRuntime,- ManagedEndpointRuntime.CloudManagedEndpointRuntime.of({- applyConfig: unusedSecretStoreOperation,- recoveryRequests: Stream.empty,- requestRecovery: () => Effect.void,- tunnelConnected: Stream.empty,- inspectConnector: Effect.succeed(null),- readinessChanged: Stream.empty,- withLinkStateLock: (effect) => effect,- } satisfies ManagedEndpointRuntime.CloudManagedEndpointRuntime["Service"]),- ),- Effect.provideService(- EnvironmentAuth.EnvironmentAuth,- EnvironmentAuth.EnvironmentAuth.of({} as EnvironmentAuth.EnvironmentAuth["Service"]),- ),- Effect.provideService(- CliTokenManager.CloudCliTokenManager,- CliTokenManager.CloudCliTokenManager.of({- get: unusedSecretStoreOperation(),- getExisting: Effect.succeedNone,- hasCredential: unusedSecretStoreOperation(),- store: () => unusedSecretStoreOperation(),- clear: unusedSecretStoreOperation(),- }),- ),- Effect.provideService(- HttpClient.HttpClient,- HttpClient.make(() => unusedSecretStoreOperation()),- ),- Effect.provideService(AgentAwarenessRelay.AgentAwarenessRelay, idleAwarenessRelay),- Effect.provide(NodeServices.layer),- ),- );});describe("releaseManagedTunnelOnShutdown", () => {@@ -389,26 +306,6 @@ describe("releaseManagedTunnelOnShutdown", () => {}).pipe(provideReleaseHarness({ store, applyConfigCalls, requests }));});- it.effect("leaves the tunnel of a publish-only desired link untouched", () => {- const { store, values } = makeMemorySecretStore([- [CLOUD_ENDPOINT_RUNTIME_CONFIG, "runtime-config"],- [RELAY_URL_SECRET, "https://relay.example.test"],- [CLOUD_CLI_DESIRED_LINK_SECRET, "publish_only"],- ]);- const applyConfigCalls: Array<unknown> = [];- const requests: Array<HttpClientRequest.HttpClientRequest> = [];-- return Effect.gen(function* () {- const link = yield* CloudLink.CloudLink;- const released = yield* link.releaseManagedTunnelOnShutdown();-- expect(released).toBe(false);- expect(applyConfigCalls).toEqual([]);- expect(requests).toEqual([]);- expect(values.has(CLOUD_ENDPOINT_RUNTIME_CONFIG)).toBe(true);- }).pipe(provideReleaseHarness({ store, applyConfigCalls, requests }));- });-it.effect("keeps the tunnel when shutdown hands off to a pending update", () => {const { store, values } = makeMemorySecretStore(managedLinkSecrets);const applyConfigCalls: Array<unknown> = [];@@ -461,6 +358,7 @@ describe("releaseManagedTunnelOnShutdown", () => {}).pipe(provideReleaseHarness({ store, applyConfigCalls, requests }));});+ // regression: 808d6853555 keep the managed tunnel across remote update restartsit.effect("still releases when the recorded update already settled", () => {const { store, values } = makeMemorySecretStore(managedLinkSecrets);const applyConfigCalls: Array<unknown> = [];@@ -531,29 +429,6 @@ describe("releaseManagedTunnelOnShutdown", () => {);});- it.effect("keeps the stored connector token when the relay release request fails", () => {- const { store, values } = makeMemorySecretStore(managedLinkSecrets);- const applyConfigCalls: Array<unknown> = [];- const requests: Array<HttpClientRequest.HttpClientRequest> = [];-- return Effect.gen(function* () {- const link = yield* CloudLink.CloudLink;- const result = yield* Effect.result(link.releaseManagedTunnelOnShutdown());-- expect(result._tag).toBe("Failure");- expect(requests).toHaveLength(1);-- expect(values.has(CLOUD_ENDPOINT_RUNTIME_CONFIG)).toBe(true);- }).pipe(- provideReleaseHarness({- store,- applyConfigCalls,- requests,- respond: () => Response.json({ ok: false }, { status: 503 }),- }),- );- });-it.effect("registers an existing tunnel and starts the confirmed connector", () => {const { store } = makeMemorySecretStore([[@@ -808,6 +683,7 @@ describe("releaseManagedTunnelOnShutdown", () => {}).pipe(provideReleaseHarness({ store, applyConfigCalls, requests }));});+ // regression: #9386 remove tunnels after hosts go offlineit.effect("starts the stored connector without a marker when confirmation is not required",() => {@@ -1007,7 +883,6 @@ describe("releaseManagedTunnelOnShutdown", () => {});it.effect.each([- { status: 401, body: {}, rejection: "unauthorized" },{status: 401,body: {diff --git a/apps/server/src/cloud/CloudLink.test.ts b/apps/server/src/cloud/CloudLink.test.tsindex 917213ccc65..743ec8bc7a1 100644--- a/apps/server/src/cloud/CloudLink.test.ts+++ b/apps/server/src/cloud/CloudLink.test.ts@@ -185,19 +185,6 @@ it.effect("keeps both settings unchanged when the relay refuses the hold change"),);-it.effect("changes nothing when the current activity setting can't be read", () =>- withService({ failActivityRead: true, relayFails: true }, ({ preferences, stored, relayCalls }) =>- Effect.gen(function* () {- const error = yield* preferences- .update({ publishAgentActivity: true, holdWebhooksWhileOffline: true })- .pipe(Effect.flip);- assert.deepInclude(error, { _tag: "CloudLinkInternalError", operation: "read-preferences" });- assert.deepEqual(relayCalls, []);- assert.equal(new TextDecoder().decode(stored.get(PUBLISH_AGENT_ACTIVITY_SECRET)), "false");- }),- ),-);-it.effect("two overlapping updates are applied one after the other", () => {let release!: () => void;let started!: () => void;diff --git a/apps/server/src/cloud/ConnectReachability.test.ts b/apps/server/src/cloud/ConnectReachability.test.tsindex a1f042089f5..28735b87378 100644--- a/apps/server/src/cloud/ConnectReachability.test.ts+++ b/apps/server/src/cloud/ConnectReachability.test.ts@@ -19,23 +19,9 @@ const facts = (overrides: Partial<ReachabilityFacts>): ReachabilityFacts => ({});describe("classifyReachability", () => {- it("names a generic blocker when no exit node is on", () => {- const result = classifyReachability(- facts({ connector: notConnected, edgeReachable: false }),- checkedAt,- );-- expect(result).toMatchObject({- cause: "edge_unreachable",- hint: "A VPN, proxy, or firewall may block it.",- });- });-it.each([[{ kind: "status", status: 502 }, "origin_unreachable"],[{ kind: "status", status: 530 }, "no_connector"],- [{ kind: "status", status: 404 }, "unexpected_response"],- [{ kind: "dns_failed" }, "dns_failed"],[{ kind: "network_error" }, "timeout"],] as const)("maps endpoint result %o to %s", (endpoint, cause) => {expect(classifyReachability(facts({ endpoint, edgeReachable: true }), checkedAt)).toMatchObject(diff --git a/apps/server/src/cloud/bootService.test.ts b/apps/server/src/cloud/bootService.test.tsindex 65b33877912..d3a8af2320c 100644--- a/apps/server/src/cloud/bootService.test.ts+++ b/apps/server/src/cloud/bootService.test.ts@@ -65,26 +65,9 @@ it.each([).toBe(program);});-const macRuntime = "/Users/theo/.t3/runtime/versions/1.2.3/t3";-const macPlan = {- program: [macRuntime, "__service-launcher"],- baseDir: "/Users/theo/.t3",- logPath: "/Users/theo/.t3/userdata/logs/boot-service.log",- unitPath: "/Users/theo/Library/LaunchAgents/com.t3tools.t3code.service.plist",-};const macInstallerPath ="/opt/homebrew/bin:/Users/theo/.npm-global/bin:/Users/theo/.nvm/versions/node/v22.16.0/bin:/usr/bin:/bin";-it("escapes XML in host paths", () => {- const plist = BootService.renderBootServicePlist(- { ...macPlan, baseDir: "/Users/theo/T3 & <Co>" },- { homeDir: "/Users/theo", environmentPath: "/Users/theo/Tools & <Scripts>:/usr/bin" },- );-- expect(plist).toContain("<string>/Users/theo/T3 & <Co></string>");- expect(plist).toContain("<string>/Users/theo/Tools & <Scripts>:/usr/bin</string>");-});-const makeHarness = Effect.fn("test.make_boot_service_harness")(function* (platform: NodeJS.Platform = "linux",installerPath = macInstallerPath,@@ -372,6 +355,7 @@ it.layer(NodeServices.layer)("boot service install", (it) => {}),);+ // regression: #5302 prevent accidental service downgradesit.effect("reports an unknown version for invalid service state", () =>Effect.gen(function* () {const { service, fs, statePath } = yield* makeHarness();@@ -427,6 +411,7 @@ it.layer(NodeServices.layer)("boot service install", (it) => {}),);+ // regression: #5302 prevent accidental service downgradesit.effect("allows an explicit downgrade", () =>Effect.gen(function* () {const { service, fs, statePath } = yield* makeHarness();@@ -797,6 +782,7 @@ it.layer(NodeServices.layer)("boot service install", (it) => {}),);+ // regression: #8173 keep provider CLIs available in the macOS serviceit.effect("reconstructs a launch agent search path when the installer has no PATH", () =>Effect.gen(function* () {const { service, fs } = yield* makeHarness("darwin", "");diff --git a/apps/server/src/cloud/publicConfig.test.ts b/apps/server/src/cloud/publicConfig.test.tsindex 6d0f9157e5a..ca1d86b8dda 100644--- a/apps/server/src/cloud/publicConfig.test.ts+++ b/apps/server/src/cloud/publicConfig.test.ts@@ -55,27 +55,6 @@ it.effect("derives direct Clerk OAuth endpoints from statically injected public}),);-it.effect("reports malformed Clerk publishable keys as typed configuration failures", () =>- Effect.gen(function* () {- const result = yield* makeCloudCliOAuthConfig({- clerkPublishableKeyFallback: "pk_test_not-base64!!",- clerkCliOAuthClientIdFallback: "oauth_client_embedded",- }).pipe(provideEnv({}), Effect.result);-- assert.isTrue(Result.isFailure(result));- if (Result.isFailure(result)) {- assert.equal(result.failure.cause._tag, "SourceError");- if (result.failure.cause._tag === "SourceError") {- assert.equal(- result.failure.cause.message,- "Failed to derive Clerk Frontend API URL from the publishable key.",- );- assert.instanceOf(result.failure.cause.cause, Error);- }- }- }),-);-it("product opt-out disables relay tracing with either built-in or runtime credentials", () => {const fallback = {tracesUrl: "https://embedded.example.test/v1/traces",diff --git a/apps/server/src/cloud/selfUpdate.test.ts b/apps/server/src/cloud/selfUpdate.test.tsindex 806603de3e0..ad7c6d4a353 100644--- a/apps/server/src/cloud/selfUpdate.test.ts+++ b/apps/server/src/cloud/selfUpdate.test.ts@@ -285,6 +285,7 @@ it.layer(NodeServices.layer)("server self update", (it) => {}),);+ // regression: #5181 make remote updates rollback-safeit.effect("rejects invalid versions and desktop-managed servers before staging", () =>Effect.gen(function* () {const web = yield* makeHarness();diff --git a/apps/server/src/device/DeviceHubProxy.test.ts b/apps/server/src/device/DeviceHubProxy.test.tsindex 6e728f2fb79..07b45737f67 100644--- a/apps/server/src/device/DeviceHubProxy.test.ts+++ b/apps/server/src/device/DeviceHubProxy.test.ts@@ -231,14 +231,11 @@ it.each([expect(requests).toEqual([]);});-it.each(["/panel/2/stream.avcc", "/panel/1/webrtc/offer", "/panel/3/exec"])(- "rejects unsupported Duo route %s",- async (route) => {- const { handler, requests } = fixture([AuthOrchestrationReadScope]);- const response = await handler(- new Request(`http://t3.test/api/device-hub/vendor/serve-sim/helper/duo${route}`),- );- expect(response.status).toBe(404);- expect(requests).toEqual([]);- },-);+it("rejects unsupported Duo routes", async () => {+ const { handler, requests } = fixture([AuthOrchestrationReadScope]);+ const response = await handler(+ new Request("http://t3.test/api/device-hub/vendor/serve-sim/helper/duo/panel/1/webrtc/offer"),+ );+ expect(response.status).toBe(404);+ expect(requests).toEqual([]);+});diff --git a/apps/server/src/device/DeviceService.test.ts b/apps/server/src/device/DeviceService.test.tsindex 8b1147285a2..53eaa6bb26c 100644--- a/apps/server/src/device/DeviceService.test.ts+++ b/apps/server/src/device/DeviceService.test.ts@@ -541,6 +541,7 @@ it.effect.each([}).pipe(Effect.scoped),);+// regression: #22012 report Android emulator boot failuresit.effect("includes nested hub boot diagnostics and bounds them to 2,000 characters", () =>Effect.gen(function* () {const diagnostic = "Error: emulator binary missing\n" + "diagnostic output\n".repeat(200);@@ -886,19 +887,6 @@ it.effect("retry keeps device and agent consent unchanged", () =>}).pipe(Effect.scoped),);-it.effect("version discovery does not grant consent or start device tools", () =>- Effect.gen(function* () {- const { service, starts, agentStarts, requests } = yield* fixture();- const state = yield* service.inspect;- expect(state.supportsToolInspection).toBe(true);- expect(state.hostStatus).toBe("disabled");- expect(state.hosts).toHaveLength(1);- expect(starts).toEqual([]);- expect(agentStarts).toEqual([]);- expect(requests).toEqual([]);- }).pipe(Effect.scoped),-);-it.effect("failed read-only discovery preserves lifecycle status and installed inventory", () =>Effect.gen(function* () {const { service, starts } = yield* fixture(Effect.void, undefined, false, undefined, true);diff --git a/apps/server/src/device/EasDeviceHost.test.ts b/apps/server/src/device/EasDeviceHost.test.tsindex e97cf9b8810..31b0ed0b129 100644--- a/apps/server/src/device/EasDeviceHost.test.ts+++ b/apps/server/src/device/EasDeviceHost.test.ts@@ -472,23 +472,4 @@ describe("EAS Simulator host", () => {expect((yield* ready.devices.list).devices.map((device) => device.id)).toEqual(["eas-ios"]);}).pipe(Effect.scoped, Effect.provide(layer)),);-- it.effect("holds the slot when a failed create’s session is listed but its stop fails", () =>- Effect.gen(function* () {- let stopFails = true;- // Create fails, Expo lists the session by name, and stopping it fails too.- const expo = fakeExpo({ failCreate: true, failStop: () => stopFails });- const host = yield* makeHost(expo, config({ maxConcurrentSessions: 1 }), yield* Scope.make());- const ready = yield* host.ensureReady(() => Effect.void);- const [catalogDevice] = (yield* ready.devices.list).devices;- yield* ready.devices.boot(catalogDevice!).pipe(Effect.flip);- const refused = yield* ready.devices.boot(catalogDevice!).pipe(Effect.flip);- expect(refused.message).toContain("still being cleaned up");- stopFails = false;- yield* ready.devices.list;- expect(expo.stopped()).toContain("orphan");- expo.allowCreate();- expect(yield* ready.devices.boot(catalogDevice!)).toBe("session-1");- }).pipe(Effect.scoped, Effect.provide(layer)),- );});diff --git a/apps/server/src/device/LocalDeviceHost.test.ts b/apps/server/src/device/LocalDeviceHost.test.tsindex 3f0fb746ca5..bffd912a398 100644--- a/apps/server/src/device/LocalDeviceHost.test.ts+++ b/apps/server/src/device/LocalDeviceHost.test.ts@@ -279,6 +279,7 @@ describe("Android SDK availability", () => {}),);+ // regression: #12017 detect unsupported legacy Android command-line toolsit.effect("explains how to upgrade legacy command-line tools in the standard macOS SDK", () =>Effect.gen(function* () {const root = "/test/home/Library/Android/sdk";diff --git a/apps/server/src/device/deviceToolMaintenance.test.ts b/apps/server/src/device/deviceToolMaintenance.test.tsindex 67da025672f..dec86beb6bb 100644--- a/apps/server/src/device/deviceToolMaintenance.test.ts+++ b/apps/server/src/device/deviceToolMaintenance.test.ts@@ -97,6 +97,7 @@ describe.each([false, true])("device tool cleanup, flat=%s", (flat) => {});});+// regression: #12819 safely reclaim obsolete managed tool versionsit.effect("maintenance failures retain safe context and the original process result", () =>Effect.gen(function* () {const output = {diff --git a/apps/server/src/device/easProjectId.test.ts b/apps/server/src/device/easProjectId.test.tsindex 38f16179846..42139f4eff1 100644--- a/apps/server/src/device/easProjectId.test.ts+++ b/apps/server/src/device/easProjectId.test.ts@@ -88,16 +88,6 @@ it.effect.each([},expected: Option.none(),},- {- case: "gives no answer for a config naming two projects, even with app.json",- files: {- "app.config.js": `export default () => ({- extra: { eas: { projectId: process.env.PROD ? "${ID_A}" : "${ID_B}" } },- });`,- "app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),- },- expected: Option.none(),- },{case: "gives no answer when one app sets its project from a variable",files: {@@ -121,37 +111,6 @@ it.effect.each([},expected: Option.none(),},- {- case: "gives no answer when a config joins the project id from pieces",- files: {- "apps/mobile/app.config.ts": `export default {- extra: { eas: { projectId: "${ID_A.slice(0, 9)}" + "${ID_A.slice(9)}" } },- };`,- "apps/kiosk/app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_B } } } }),- },- expected: Option.none(),- },- {- case: "reads a project id a comment follows",- files: {- "app.config.ts": `export default {- extra: { eas: { projectId: "${ID_A}" /* production */ // the only one- } },- };`,- },- expected: Option.some(ID_A),- },- {- case: "gives no answer when a separator inside a comment precedes the rest of the id",- files: {- "apps/mobile/app.config.ts": `export default {- extra: { eas: { projectId: "${ID_A.slice(0, 9)}" // prefix, continued (below)- + "${ID_A.slice(9)}" } },- };`,- "apps/kiosk/app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_B } } } }),- },- expected: Option.none(),- },{case: "gives no answer when a spread after the project id may replace it",files: {@@ -160,14 +119,6 @@ it.effect.each([},expected: Option.none(),},- {- case: "gives no answer when a spread at the top of the config may replace the project id",- files: {- "apps/mobile/app.config.js": `import { brand } from "./app.shared.js";- export default { extra: { eas: { projectId: "${ID_A}" } }, ...brand };`,- },- expected: Option.none(),- },{case: "gives no answer when the config is assigned over after naming the project id",files: {@@ -179,16 +130,6 @@ it.effect.each([},expected: Option.none(),},- {- case: "gives no answer when the config is assigned over from defaults that name the project id",- files: {- "app.config.js": `module.exports = Object.assign(- { name: "Mobile", extra: { eas: { projectId: "${ID_A}" } } },- require("./app.config.local.js"),- );`,- },- expected: Option.none(),- },{case: "gives no answer when a config spreads another file over app.json's project id",files: {@@ -205,35 +146,6 @@ it.effect.each([},expected: Option.none(),},- {- case: "does not let a sibling win over an app whose config returns app.json's config changed",- files: {- "apps/mobile/app.config.js": `module.exports = ({ config }) => {- config.name = "Mobile";- return config;- };`,- "apps/mobile/app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),- "apps/kiosk/app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_B } } } }),- },- expected: Option.none(),- },- {- case: "gives no answer when a spread of an identifier starting with config may replace app.json's id",- files: {- "app.config.js": `const config$ = require("./app.local.js");- module.exports = ({ config }) => ({ ...config, ...config$ });`,- "app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),- },- expected: Option.none(),- },- {- case: "gives no answer when a config spreads the config but replaces extra",- files: {- "app.config.js": `module.exports = ({ config }) => ({ ...config, extra: {} });`,- "app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),- },- expected: Option.none(),- },{case: "gives no answer when a config has more extra entries than are read",files: {@@ -242,44 +154,6 @@ it.effect.each([},expected: Option.none(),},- {- case: "gives no answer when a config assigns extra in brackets after a literal id",- files: {- "app.config.js": `module.exports = ({ config }) => {- const c = { ...config, extra: { eas: { projectId: "${ID_A}" } } };- c["extra"] = other();- return c;- };`,- },- expected: Option.none(),- },- {- case: "gives no answer when a config deletes from the config it spreads",- files: {- "app.config.js": `module.exports = ({ config }) => {- delete config.extra;- return { ...config };- };`,- "app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),- },- expected: Option.none(),- },- {- case: "gives no answer when a config spreads part of the config over it",- files: {- "app.config.js": `module.exports = ({ config }) => ({ ...config, ...config.extra.preview });`,- "app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),- },- expected: Option.none(),- },- {- case: "gives no answer when an extra entry spreads the whole config, not its extra",- files: {- "app.config.js": `module.exports = ({ config }) => ({ ...config, extra: { ...config } });`,- "app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),- },- expected: Option.none(),- },{case: "reads app.json's id through extra and eas entries that spread their own",files: {@@ -291,15 +165,6 @@ it.effect.each([},expected: Option.some(ID_A),},- {- case: "gives no answer when a config may return another file's config on some builds",- files: {- "app.config.js": `module.exports = process.env.PROD- ? { extra: { eas: { projectId: "${ID_A}" } } }- : require("./app.config.staging.js");`,- },- expected: Option.none(),- },{case: "reads a project id that follows spreads",files: {@@ -329,14 +194,6 @@ it.effect.each([},expected: Option.none(),},- {- case: "reads a static config that is not wrapped in `expo`",- files: {- "apps/mobile/app.config.json": JSON.stringify({ extra: { eas: { projectId: ID_A } } }),- "apps/README.md": "one app",- },- expected: Option.some(ID_A),- },{case: "does not guess between an unwrapped static config and a wrapped one",files: {@@ -359,14 +216,14 @@ it.effect.each([}).pipe(Effect.scoped, Effect.provide(layer)),);-it.effect.each(["\r", "\u2028", "\u2029"])(- "gives no answer when a comment ending in %o precedes the rest of a joined id",- (terminator) =>+it.effect(+ "gives no answer when a comment ending in a non-LF line terminator precedes the rest of a joined id",+ () =>Effect.gen(function* () {// A line comment ends at any ECMAScript line terminator, not only LF.const root = yield* workspace({"apps/mobile/app.config.ts":- `export default { extra: { eas: { projectId: "${ID_A.slice(0, 9)}" // prefix${terminator}` ++ `export default { extra: { eas: { projectId: "${ID_A.slice(0, 9)}" // prefix\u2028` +`+ "${ID_A.slice(9)}" } } };`,"apps/kiosk/app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_B } } } }),});diff --git a/apps/server/src/git/GitManager.test.ts b/apps/server/src/git/GitManager.test.tsindex f845f01c64e..d7b39efde3c 100644--- a/apps/server/src/git/GitManager.test.ts+++ b/apps/server/src/git/GitManager.test.ts@@ -12,10 +12,8 @@ import * as Deferred from "effect/Deferred";import * as Fiber from "effect/Fiber";import * as FileSystem from "effect/FileSystem";import * as Layer from "effect/Layer";-import * as Logger from "effect/Logger";import * as Option from "effect/Option";import * as PlatformError from "effect/PlatformError";-import * as References from "effect/References";import * as Result from "effect/Result";import * as Schema from "effect/Schema";import * as Scope from "effect/Scope";@@ -1677,6 +1675,7 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {}),);+ // regression: #8600 settle threads server-sideit.effect("branch PR lookup propagates provider failures", () =>Effect.gen(function* () {const repoDir = yield* makeTempDir("t3code-git-manager-");@@ -2428,75 +2427,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {}),);- it.effect("status is resilient to gh lookup failures and returns pr null", () =>- Effect.gen(function* () {- const repoDir = yield* makeTempDir("t3code-git-manager-");- yield* initRepo(repoDir);- yield* runGit(repoDir, ["checkout", "-b", "feature/status-no-gh"]);- const remoteDir = yield* createBareRemote();- yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);- yield* runGit(repoDir, ["push", "-u", "origin", "feature/status-no-gh"]);-- const { manager } = yield* makeManager({- ghScenario: {- failWith:- "No GitHub credential on the server. Set GH_TOKEN, or install the GitHub CLI and run `gh auth login`.",- },- });-- const status = yield* manager.status({ cwd: repoDir });- expect(status.refName).toBe("feature/status-no-gh");- expect(status.pr).toBeNull();- }),- );-- it.effect("status logs actionable provider detail without exposing the upstream cause", () =>- Effect.gen(function* () {- const repoDir = yield* makeTempDir("t3code-git-manager-");- yield* initRepo(repoDir);- yield* runGit(repoDir, ["checkout", "-b", "feature/status-rate-limited"]);- const remoteDir = yield* createBareRemote();- yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);- yield* runGit(repoDir, ["push", "-u", "origin", "feature/status-rate-limited"]);-- const upstreamCause = "GraphQL rate limit for user ID 51714798 and token secret-value";- const { manager } = yield* makeManager({- ghScenario: {- failWith: "GitHub API rate limit exceeded. Requests resume when the limit resets.",- failCause: new Error(upstreamCause),- },- });- const logs: Array<{ message: string; annotations: Record<string, unknown> }> = [];- const logger = Logger.make<unknown, void>(({ fiber, message }) => {- logs.push({- message: String(message),- annotations: { ...fiber.getRef(References.CurrentLogAnnotations) },- });- });-- const status = yield* manager- .status({ cwd: repoDir })- .pipe(Effect.provide(Logger.layer([logger], { mergeWithExisting: false })));-- expect(status.pr).toBeNull();- const warning = logs.find((entry) => entry.message.includes("PR lookup failed"));- expect(warning?.annotations).toMatchObject({- operation: "lookupStatusPr",- branch: "feature/status-rate-limited",- errorTag: "SourceControlProviderError",- provider: SourceControlProviderKind.make("github"),- providerOperation: "listChangeRequests",- errorDetail: "GitHub API rate limit exceeded. Requests resume when the limit resets.",- });- const loggedText = [- warning?.message ?? "",- ...Object.values(warning?.annotations ?? {}).map(String),- ].join("\n");- expect(loggedText).not.toContain(upstreamCause);- expect(loggedText).not.toContain("secret-value");- }),- );-it.effect("status keeps the last known PR when a later lookup fails", () =>Effect.gen(function* () {const repoDir = yield* makeTempDir("t3code-git-manager-");@@ -2577,45 +2507,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {}),);- it.effect("status drops the last known PR when the tracked remote is repointed", () =>- Effect.gen(function* () {- const repoDir = yield* makeTempDir("t3code-git-manager-");- yield* initRepo(repoDir);- yield* runGit(repoDir, ["checkout", "-b", "feature/pr-repointed"]);- const originalRemoteDir = yield* createBareRemote();- yield* runGit(repoDir, ["remote", "add", "origin", originalRemoteDir]);- yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-repointed"]);-- const existingPr = {- number: 216,- title: "Old remote PR",- url: "https://github.com/pingdotgg/codething-mvp/pull/216",- baseRefName: "main",- headRefName: "feature/pr-repointed",- };- const { manager } = yield* makeManager({- ghScenario: {- prListSequence: [JSON.stringify([existingPr])],- failWith:- "No GitHub credential on the server. Set GH_TOKEN, or install the GitHub CLI and run `gh auth login`.",- failAfterCalls: 1,- },- });-- const first = yield* manager.status({ cwd: repoDir });- expect(first.pr?.number).toBe(216);-- const replacementRemoteDir = yield* createBareRemote();- yield* runGit(repoDir, ["remote", "add", "replacement", replacementRemoteDir]);- yield* runGit(repoDir, ["push", "replacement", "feature/pr-repointed"]);- yield* runGit(repoDir, ["remote", "set-url", "origin", replacementRemoteDir]);- yield* manager.invalidateStatus(repoDir);-- const second = yield* manager.status({ cwd: repoDir });- expect(second.pr).toBeNull();- }),- );-it.effect("creates a commit when working tree is dirty", () =>Effect.gen(function* () {const repoDir = yield* makeTempDir("t3code-git-manager-");@@ -2846,56 +2737,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {}),);- it.effect("uses custom commit message when provided", () =>- Effect.gen(function* () {- const repoDir = yield* makeTempDir("t3code-git-manager-");- yield* initRepo(repoDir);- // Patch generation would invoke this unavailable converter. A supplied- // message must commit without generating a patch it will not use.- NodeFS.writeFileSync(- NodePath.join(repoDir, ".git/info/attributes"),- "README.md diff=probe\n",- );- yield* runGit(repoDir, ["config", "diff.probe.textconv", "t3-missing-textconv-for-test"]);- NodeFS.writeFileSync(NodePath.join(repoDir, "README.md"), "hello\ncustom\n");- let generatedCount = 0;-- const { manager } = yield* makeManager({- textGeneration: {- generateCommitMessage: (input) =>- Effect.sync(() => {- generatedCount += 1;- return {- subject: "this should not be used",- body: "",- ...(input.includeBranch ? { branch: "feature/unused" } : {}),- };- }),- },- });- const result = yield* runStackedAction(manager, {- cwd: repoDir,- action: "commit",- commitMessage: "feat: custom summary line\n\n- details from user",- });-- expect(result.branch.status).toBe("skipped_not_requested");- expect(result.commit.status).toBe("created");- expect(result.commit.subject).toBe("feat: custom summary line");- expect(generatedCount).toBe(0);- expect(- yield* runGit(repoDir, ["log", "-1", "--pretty=%s"]).pipe(- Effect.map((result) => result.stdout.trim()),- ),- ).toBe("feat: custom summary line");- expect(- yield* runGit(repoDir, ["log", "-1", "--pretty=%b"]).pipe(- Effect.map((result) => result.stdout.trim()),- ),- ).toContain("- details from user");- }),- );-it.effect("commits only selected files when filePaths is provided", () =>Effect.gen(function* () {const repoDir = yield* makeTempDir("t3code-git-manager-");@@ -3024,33 +2865,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {}),);- it.effect("commits and pushes with upstream auto-setup when needed", () =>- Effect.gen(function* () {- const repoDir = yield* makeTempDir("t3code-git-manager-");- yield* initRepo(repoDir);- yield* runGit(repoDir, ["checkout", "-b", "feature/stacked-flow"]);- const remoteDir = yield* createBareRemote();- yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);- NodeFS.writeFileSync(NodePath.join(repoDir, "feature.txt"), "feature\n");-- const { manager } = yield* makeManager();- const result = yield* runStackedAction(manager, {- cwd: repoDir,- action: "commit_push",- });-- expect(result.branch.status).toBe("skipped_not_requested");- expect(result.commit.status).toBe("created");- expect(result.push.status).toBe("pushed");- expect(result.push.setUpstream).toBe(true);- expect(- yield* runGit(repoDir, ["rev-parse", "--abbrev-ref", "@{upstream}"]).pipe(- Effect.map((result) => result.stdout.trim()),- ),- ).toBe("origin/feature/stacked-flow");- }),- );-it.effect("pushes and creates PR from a no-upstream branch when local commits are ahead of base",() =>diff --git a/apps/server/src/git/linkCreatedPullRequest.test.ts b/apps/server/src/git/linkCreatedPullRequest.test.tsindex d81d4aa288f..23af74c8ba2 100644--- a/apps/server/src/git/linkCreatedPullRequest.test.ts+++ b/apps/server/src/git/linkCreatedPullRequest.test.ts@@ -162,33 +162,6 @@ describe("linkCreatedPullRequest", () => {]);}),);-- it.effect("swallows an already-linked rejection and other dispatch failures", () =>- Effect.gen(function* () {- const rejecting: Orchestrator.OrchestratorV2Shape["dispatch"] = (command) =>- Effect.fail(- new Orchestrator.OrchestratorDispatchError({- commandId: command.commandId,- commandType: command.type,- cause: "already linked",- }),- );- const result = prResult({- status: "opened_existing",- number: 7,- url: "https://github.com/t3tools/t3code/pull/7",- });- yield* linkCreatedPullRequest({ threadId: THREAD_ID, result, commandId }).pipe(- Effect.provide(layerDependenciesFor(rejecting)),- );- yield* linkCreatedPullRequest({ threadId: THREAD_ID, result, commandId }).pipe(- Effect.provide(layerDependenciesFor(() => Effect.die(new Error("engine down")))),- );- yield* linkCreatedPullRequest({ threadId: THREAD_ID, result, commandId }).pipe(- Effect.provide(layerDependenciesFor(() => Effect.die(new Error("unreachable")), null)),- );- }),- );});it.effect(diff --git a/apps/server/src/http.test.ts b/apps/server/src/http.test.tsindex 2a5d9422ebb..48c75a12403 100644--- a/apps/server/src/http.test.ts+++ b/apps/server/src/http.test.ts@@ -26,12 +26,7 @@ import { ORCHESTRATION_PROTOCOL_HEADER } from "@t3tools/contracts";import * as ServerConfig from "./config.ts";-import {- assetResponseHeaders,- assetFileResponse,- downloadContentDisposition,- resolveDevRedirectUrl,-} from "./http.ts";+import { assetResponseHeaders, assetFileResponse, downloadContentDisposition } from "./http.ts";import * as ServerHttp from "./http.ts";describe("MCP app asset responses", () => {@@ -698,17 +693,6 @@ describe("video asset byte ranges", () => {);});-describe("http dev routing", () => {- it("preserves path and query when redirecting to the dev server", () => {- const devUrl = new URL("http://127.0.0.1:5173/");- const requestUrl = new URL("http://127.0.0.1:3774/pair?token=test-token");-- expect(resolveDevRedirectUrl(devUrl, requestUrl)).toBe(- "http://127.0.0.1:5173/pair?token=test-token",- );- });-});-describe("assetResponseHeaders", () => {it("sandboxes SVG assets", () => {expect(assetResponseHeaders("/attachments/user-image.svg")).toMatchObject({@@ -732,14 +716,6 @@ describe("assetResponseHeaders", () => {"Content-Security-Policy": "sandbox allow-scripts allow-forms allow-popups allow-downloads",});});- it("serves HTML assets as utf-8 inside a sandboxed origin", () => {- for (const path of ["/workspace/page.html", "/workspace/PAGE.HTM", "/tmp/report.html"]) {- expect(assetResponseHeaders(path)).toMatchObject({- "Content-Type": "text/html; charset=utf-8",- "Content-Security-Policy": "sandbox allow-scripts allow-forms allow-popups allow-downloads",- });- }- });it("downloads uploaded documents without executing their content", () => {expect(assetResponseHeaders("/attachments/upload.html", { download: true })).toMatchObject({diff --git a/apps/server/src/http.ts b/apps/server/src/http.tsindex 189c2b5b289..6ba9579f04b 100644--- a/apps/server/src/http.ts+++ b/apps/server/src/http.ts@@ -283,7 +283,7 @@ function isLoopbackHostname(hostname: string): boolean {return LOOPBACK_HOSTNAMES.has(normalizedHostname);}-export function resolveDevRedirectUrl(devUrl: URL, requestUrl: URL): string {+function resolveDevRedirectUrl(devUrl: URL, requestUrl: URL): string {const redirectUrl = new URL(devUrl.toString());redirectUrl.pathname = requestUrl.pathname;redirectUrl.search = requestUrl.search;diff --git a/apps/server/src/imageMime.test.ts b/apps/server/src/imageMime.test.tsindex 67207eb00ea..5d427b95726 100644--- a/apps/server/src/imageMime.test.ts+++ b/apps/server/src/imageMime.test.ts@@ -10,14 +10,6 @@ describe("imageMime", () => {});});- it("rejects non-base64 data URL", () => {- expect(parseBase64DataUrl("data:image/png;charset=utf-8,hello")).toBeNull();- });-- it("rejects missing mime type", () => {- expect(parseBase64DataUrl("data:;base64,SGVsbG8=")).toBeNull();- });-it("parses base64 data URL with spaces in payload", () => {expect(parseBase64DataUrl("data:image/png;base64,SGVs bG8=\n")).toEqual({mimeType: "image/png",@@ -30,6 +22,7 @@ describe("imageMime", () => {expect(parseBase64DataUrl("data:image/png;base64,SGVs,bG8=")).toBeNull();});+ // regression: #3952 image upload crashed dispatchCommand with a stack overflowit("rejects structurally malformed base64", () => {expect(parseBase64DataUrl("data:image/png;base64,AB=CD===")).toBeNull();expect(parseBase64DataUrl("data:image/png;base64,SGV=bG8=")).toBeNull();diff --git a/apps/server/src/keybindings.test.ts b/apps/server/src/keybindings.test.tsindex 6c9784cc922..80d4a52625e 100644--- a/apps/server/src/keybindings.test.ts+++ b/apps/server/src/keybindings.test.ts@@ -484,28 +484,6 @@ it.layer(NodeServices.layer)("keybindings", (it) => {}).pipe(Effect.provide(layerKeybindings())),);- it.effect("updates cached resolved config after upsert", () =>- Effect.gen(function* () {- const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;- yield* writeKeybindingsConfig(keybindingsConfigPath, [- { key: "mod+j", command: "terminal.toggle" },- ]);-- const loadedAfterUpsert = yield* Effect.gen(function* () {- const keybindings = yield* Keybindings.Keybindings;- yield* keybindings.loadConfigState;- yield* keybindings.upsertKeybindingRule({- key: "mod+shift+r",- command: "script.run-tests.run",- });- return (yield* keybindings.loadConfigState).keybindings;- });-- assert.isTrue(loadedAfterUpsert.some((entry) => entry.command === "script.run-tests.run"));- assert.isTrue(loadedAfterUpsert.some((entry) => entry.command === "terminal.toggle"));- }).pipe(Effect.provide(layerKeybindings())),- );-it.effect("serializes concurrent upserts to avoid lost updates", () =>Effect.gen(function* () {const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;diff --git a/apps/server/src/mcp/McpHttpServer.test.ts b/apps/server/src/mcp/McpHttpServer.test.tsindex 72d84dff8b9..6e54be84ef8 100644--- a/apps/server/src/mcp/McpHttpServer.test.ts+++ b/apps/server/src/mcp/McpHttpServer.test.ts@@ -495,6 +495,7 @@ it.effect("keeps the snapshot text under the agent's output ceiling", () =>).pipe(Effect.provide(layerTest)),);+// regression: #10501 keep preview snapshots usable by the agentit.effect("bounds the snapshot text even when nothing but logs and the title are large", () =>Effect.scoped(Effect.gen(function* () {@@ -527,6 +528,7 @@ it.effect("bounds the snapshot text even when nothing but logs and the title are).pipe(Effect.provide(layerTest)),);+// regression: #13558 preview snapshots overflowed the agent's tool outputit.effect("bounds page text made of wide characters before dropping locators", () =>Effect.scoped(Effect.gen(function* () {diff --git a/apps/server/src/mcp/McpSessionRegistry.test.ts b/apps/server/src/mcp/McpSessionRegistry.test.tsindex 59087cdcbb8..282c3dffd6d 100644--- a/apps/server/src/mcp/McpSessionRegistry.test.ts+++ b/apps/server/src/mcp/McpSessionRegistry.test.ts@@ -102,6 +102,7 @@ it.effect("always grants pull-requests and gates browser and device access indep}),);+// regression: #3114 use bound host for MCP endpointit.effect("builds MCP endpoints from the bound server host", () =>Effect.gen(function* () {const cases = [diff --git a/apps/server/src/mcp/PreviewAutomationBroker.test.ts b/apps/server/src/mcp/PreviewAutomationBroker.test.tsindex a75bbe66ad5..7ae8bfbefea 100644--- a/apps/server/src/mcp/PreviewAutomationBroker.test.ts+++ b/apps/server/src/mcp/PreviewAutomationBroker.test.ts@@ -3,7 +3,6 @@ import { expect, it } from "@effect/vitest";import {EnvironmentId,PreviewAutomationClientDisconnectedError,- PreviewAutomationInvalidSelectorError,PreviewAutomationMalformedResponseError,PreviewAutomationNoAvailableHostError,PreviewTabId,@@ -288,69 +287,6 @@ it.effect("announces a live replacement stream before delivering requests", () =),);-it.effect("preserves bounded request and remote selector diagnostics", () => {- const locator = "role=button[name='request-secret']";- const remoteMessage = "Unexpected token near remote-secret.";- const remoteError = {- _tag: "PreviewAutomationInvalidSelectorError",- message: remoteMessage,- detail: { selector: "role=button[name='remote-secret']" },- } as const;-- return Effect.scoped(- Effect.gen(function* () {- const broker = yield* makeBroker;- const requests = requestsFrom(yield* broker.connect(makeHost()));- yield* Stream.runForEach(requests, (request) =>- broker.respond({- clientId: "client-1",- connectionId: request.connectionId,- requestId: request.requestId,- ok: false,- error: remoteError,- }),- ).pipe(Effect.forkScoped);- yield* Effect.yieldNow;-- const error = yield* broker- .invoke<void>({- scope,- operation: "click",- input: { locator },- tabId: PreviewTabId.make("tab-1"),- timeoutMs: 1_234,- })- .pipe(Effect.flip);-- expect(error).toBeInstanceOf(PreviewAutomationInvalidSelectorError);- expect(error).toMatchObject({- operation: "click",- environmentId: scope.environmentId,- threadId: scope.thread.threadId,- providerSessionId: scope.thread.providerSessionId,- providerInstanceId: scope.thread.providerInstanceId,- clientId: "client-1",- requestId: "preview-0",- tabId: "tab-1",- timeoutMs: 1_234,- selectorKind: "locator",- selectorLength: locator.length,- remoteTag: "PreviewAutomationInvalidSelectorError",- remoteMessageLength: remoteMessage.length,- remoteDetailKind: "object",- });- expect(error.message).toBe(- `Preview automation click received an invalid locator (${locator.length} characters).`,- );- expect(error.message).not.toContain("secret");- expect(error.cause).toBe(remoteError);- expect("selector" in error).toBe(false);- expect("remoteMessage" in error).toBe(false);- expect("remoteDetail" in error).toBe(false);- }),- );-});-it.effect.each([{ clientId: SERVER_BROWSER_AUTOMATION_CLIENT_ID, shown: true },{ clientId: "client-1", shown: false },diff --git a/apps/server/src/mcp/WorktreeMcpService.test.ts b/apps/server/src/mcp/WorktreeMcpService.test.tsindex 40138040e4d..3902068894d 100644--- a/apps/server/src/mcp/WorktreeMcpService.test.ts+++ b/apps/server/src/mcp/WorktreeMcpService.test.ts@@ -470,42 +470,6 @@ describe("t3_worktree_handoff", () => {});});- it.effect("fails when the thread does not exist", () => {- const harness = makeHarness({ thread: null });- return Effect.gen(function* () {- const exit = yield* Effect.exit(runHandoff(harness, { branch: "feature/missing" }));- expectTypedFailure(exit, { _tag: "WorktreeMcpFailure", code: "thread_not_found" });- expect(harness.createWorktree).not.toHaveBeenCalled();- });- });-- it.effect("treats a soft-deleted thread as not found", () => {- const harness = makeHarness({ thread: { deletedAt: "2026-01-02T00:00:00.000Z" } });- return Effect.gen(function* () {- const exit = yield* Effect.exit(runHandoff(harness, { branch: "feature/deleted" }));- expectTypedFailure(exit, { _tag: "WorktreeMcpFailure", code: "thread_not_found" });- expect(harness.createWorktree).not.toHaveBeenCalled();- });- });-- it.effect("fails when the project does not exist", () => {- const harness = makeHarness({ projectMissing: true });- return Effect.gen(function* () {- const exit = yield* Effect.exit(runHandoff(harness, { branch: "feature/no-project" }));- expectTypedFailure(exit, { _tag: "WorktreeMcpFailure", code: "project_not_found" });- expect(harness.createWorktree).not.toHaveBeenCalled();- });- });-- it.effect("fails when the project workspace is not a git repository", () => {- const harness = makeHarness({ notARepo: true });- return Effect.gen(function* () {- const exit = yield* Effect.exit(runHandoff(harness, { branch: "feature/no-repo" }));- expectTypedFailure(exit, { _tag: "WorktreeMcpFailure", code: "invalid_request" });- expect(harness.createWorktree).not.toHaveBeenCalled();- });- });-it.effect("rejects an existing branch with an actionable error naming its checkout", () => {const harness = makeHarness({ existingBranchWorktreePath: "/elsewhere/checkout" });return Effect.gen(function* () {@@ -546,16 +510,6 @@ describe("t3_worktree_handoff", () => {});});- it.effect("maps a worktree creation failure to operation_failed", () => {- const harness = makeHarness({ createWorktreeFails: true });- return Effect.gen(function* () {- const exit = yield* Effect.exit(runHandoff(harness, { branch: "feature/create-fails" }));- expectTypedFailure(exit, { _tag: "WorktreeMcpFailure", code: "operation_failed" });- expect(harness.dispatch).not.toHaveBeenCalled();- expect(harness.removeWorktree).not.toHaveBeenCalled();- });- });-it.effect("falls back to the local base when no remote holds it", () => {const harness = makeHarness({ worktreeBaseMissing: true });return Effect.gen(function* () {@@ -632,15 +586,6 @@ describe("t3_worktree_handoff", () => {});});- it.effect("rejects a handoff for an archived thread", () => {- const harness = makeHarness({ thread: { archivedAt: "2026-01-02T00:00:00.000Z" } });- return Effect.gen(function* () {- const exit = yield* Effect.exit(runHandoff(harness, { branch: "feature/archived" }));- expectTypedFailure(exit, { _tag: "WorktreeMcpFailure", code: "invalid_request" });- expect(harness.createWorktree).not.toHaveBeenCalled();- });- });-it.effect("queues the continuation even when interrupted during the binding dispatch", () =>Effect.gen(function* () {const gate = yield* Deferred.make<void>();@@ -665,16 +610,6 @@ describe("t3_worktree_handoff", () => {}),);- it.effect("still fails with a typed error when the rollback removal also fails", () => {- const harness = makeHarness({ dispatchFails: true, removeWorktreeFails: true });- return Effect.gen(function* () {- const exit = yield* Effect.exit(runHandoff(harness, { branch: "feature/rollback-fails" }));- expectTypedFailure(exit, { _tag: "WorktreeMcpFailure", code: "operation_failed" });- expect(harness.removeWorktree).toHaveBeenCalledTimes(1);- expect(harness.deleteLocalBranch).not.toHaveBeenCalled();- });- });-it.effect("creates the worktree in the managed directory even when a call names a path", () => {const harness = makeHarness();return Effect.gen(function* () {@@ -706,14 +641,6 @@ describe("t3_worktree_handoff", () => {});});- it.effect("fails when the worktree capability is missing", () => {- const harness = makeHarness({ capabilities: new Set(["preview"]) });- return Effect.gen(function* () {- const exit = yield* Effect.exit(runHandoff(harness, { branch: "feature/no-capability" }));- expectTypedFailure(exit, { _tag: "WorktreeMcpFailure", code: "capability_denied" });- });- });-it.effect("serializes concurrent handoffs for the same thread", () =>Effect.gen(function* () {const gate = yield* Deferred.make<void>();@@ -738,14 +665,6 @@ describe("t3_worktree_handoff", () => {}),);- it.effect("fails when baseRef is omitted and HEAD is detached", () => {- const harness = makeHarness({ currentBranch: null });- return Effect.gen(function* () {- const exit = yield* Effect.exit(runHandoff(harness, { branch: "feature/detached" }));- expectTypedFailure(exit, { _tag: "WorktreeMcpFailure", code: "invalid_request" });- });- });-it.effect("reports a setup script defect without failing the handoff", () => {const harness = makeHarness({ setupScript: "dies" });return Effect.gen(function* () {diff --git a/apps/server/src/mcp/toolkits/preview/handlers.test.ts b/apps/server/src/mcp/toolkits/preview/handlers.test.tsindex 6ec4d50ce1f..c46e3585180 100644--- a/apps/server/src/mcp/toolkits/preview/handlers.test.ts+++ b/apps/server/src/mcp/toolkits/preview/handlers.test.ts@@ -11,15 +11,7 @@ import {parseThreadSegmentFromAttachmentId,} from "../../../attachmentStore.ts";import * as ServerConfig from "../../../config.ts";-import { claimPreviewRecording, normalizePreviewOpenInput } from "./handlers.ts";--describe("normalizePreviewOpenInput", () => {- it("leaves an unstated visibility for the client preference to decide", () => {- // Filling `open` in here would outrank `browserAutoShowFloatingPreview`,- // which is desktop-local and cannot be read from the server.- expect(normalizePreviewOpenInput({})).toEqual({ reuseExistingTab: true });- });-});+import { claimPreviewRecording } from "./handlers.ts";describe("claimPreviewRecording", () => {it.effect("overlapping and repeated claims return the same retained recording", () =>diff --git a/apps/server/src/mcp/toolkits/preview/handlers.ts b/apps/server/src/mcp/toolkits/preview/handlers.tsindex cf9423ed5a7..37b4e047078 100644--- a/apps/server/src/mcp/toolkits/preview/handlers.ts+++ b/apps/server/src/mcp/toolkits/preview/handlers.ts@@ -38,9 +38,7 @@ import { PreviewSnapshotToolkit, PreviewStandardToolkit, PreviewToolkit } from "* preference, which is desktop-local and unreadable from here — filling in* `true` would silently override it for every `preview_open`.*/-export function normalizePreviewOpenInput(- input: PreviewAutomationOpenInput,-): PreviewAutomationOpenInput {+function normalizePreviewOpenInput(input: PreviewAutomationOpenInput): PreviewAutomationOpenInput {const open = input.open ?? input.show;return {...input,diff --git a/apps/server/src/mcp/toolkits/pullRequests/handlers.test.ts b/apps/server/src/mcp/toolkits/pullRequests/handlers.test.tsindex ba696192ff1..e9ee5a05ad9 100644--- a/apps/server/src/mcp/toolkits/pullRequests/handlers.test.ts+++ b/apps/server/src/mcp/toolkits/pullRequests/handlers.test.ts@@ -447,24 +447,6 @@ describe("pull request toolkit handlers", () => {}),);- it.effect("rejects a target that names neither a URL nor repository and number", () =>- Effect.gen(function* () {- const harness = yield* makeHarness();- const error = yield* harness- .call("link_pull_request", { repository: "x/y" })- .pipe(Effect.flip);- expect(error).toMatchObject({ _tag: "PullRequestTargetIncompleteError" });- const unknown = yield* harness- .call("link_pull_request", {- url: "https://github.com/t3tools/t3code/issues/1?token=private-value",- })- .pipe(Effect.flip);- expect(unknown).toMatchObject({ _tag: "PullRequestUrlInvalidError" });- expect(unknown.message).not.toContain("private-value");- expect(yield* Ref.get(harness.commands)).toEqual([]);- }),- );-it.effect("treats a duplicate link as alreadyLinked rather than an error", () =>Effect.gen(function* () {const harness = yield* makeHarness({diff --git a/apps/server/src/mcpApps/McpAppRequests.test.ts b/apps/server/src/mcpApps/McpAppRequests.test.tsindex e98f824d608..1fde091c064 100644--- a/apps/server/src/mcpApps/McpAppRequests.test.ts+++ b/apps/server/src/mcpApps/McpAppRequests.test.ts@@ -251,26 +251,4 @@ describe("McpAppRequests", () => {assert.isTrue(storedContext.has(`${deepForkId(70)}/${itemId}`));}).pipe(Effect.provide(makeLayer({ item: appItem({ t3McpApp: app }), live: false }))),);-- it.effect("reports why a request cannot run", () =>- Effect.gen(function* () {- const run = (layer: ReturnType<typeof makeLayer>) =>- Effect.gen(function* () {- const requests = yield* McpAppRequests.McpAppRequests;- return yield* reason(requests.readResource({ threadId, itemId, uri: "ui://weather/x" }));- }).pipe(Effect.provide(layer));- assert.equal(- yield* run(makeLayer({ item: appItem({ result: "plain" }), mcpApps })),- "not-an-app",- );- assert.equal(- yield* run(makeLayer({ item: appItem({ t3McpApp: app }), mcpApps, live: false })),- "session-stopped",- );- assert.equal(- yield* run(makeLayer({ item: appItem({ t3McpApp: app }) })),- "provider-unsupported",- );- }),- );});diff --git a/apps/server/src/persistence/OrchestrationEventStore.test.ts b/apps/server/src/persistence/OrchestrationEventStore.test.tsindex 3803bac4c20..baad3d5c52a 100644--- a/apps/server/src/persistence/OrchestrationEventStore.test.ts+++ b/apps/server/src/persistence/OrchestrationEventStore.test.ts@@ -295,58 +295,6 @@ layer("OrchestrationEventStore", (it) => {}),);- it.effect("fails with PersistenceDecodeError when stored json is invalid", () =>- Effect.gen(function* () {- const eventStore = yield* OrchestrationEventStore.OrchestrationEventStore;- const sql = yield* SqlClient.SqlClient;- const now = "2026-01-01T00:00:00.000Z";-- yield* sql`- INSERT INTO orchestration_events (- event_id,- aggregate_kind,- stream_id,- stream_version,- event_type,- occurred_at,- command_id,- causation_event_id,- correlation_id,- actor_kind,- payload_json,- metadata_json- )- VALUES (- ${EventId.make("evt-store-invalid-json")},- ${"project"},- ${ProjectId.make("project-invalid-json")},- ${0},- ${"project.created"},- ${now},- ${CommandId.make("cmd-store-invalid-json")},- ${null},- ${null},- ${"server"},- ${"{"},- ${"{}"}- )- `;-- const replayResult = yield* Effect.result(- Stream.runCollect(- eventStore.readApplicationEvents({- afterSequence: 0,- throughSequence: Number.MAX_SAFE_INTEGER,- }),- ),- );- assert.equal(replayResult._tag, "Failure");- if (replayResult._tag === "Failure") {- assert.ok(isPersistenceDecodeError(replayResult.failure));- }- }),- );-it.effect("orders project and V2 agent events in the retained application event source", () =>Effect.gen(function* () {const eventStore = yield* OrchestrationEventStore.OrchestrationEventStore;diff --git a/apps/server/src/preview/Manager.test.ts b/apps/server/src/preview/Manager.test.tsindex adf91224b40..a3b058de1c7 100644--- a/apps/server/src/preview/Manager.test.ts+++ b/apps/server/src/preview/Manager.test.ts@@ -2,7 +2,6 @@ import * as NodeCrypto from "@effect/platform-node/NodeCrypto";import * as NodeServices from "@effect/platform-node/NodeServices";import { it } from "@effect/vitest";import { type PreviewEvent, ThreadId } from "@t3tools/contracts";-import { PreviewUrlNormalizationError } from "@t3tools/shared/preview";import * as Effect from "effect/Effect";import * as Layer from "effect/Layer";import * as PubSub from "effect/PubSub";@@ -158,27 +157,6 @@ it.layer(layer)("PreviewManager", (it) => {}),);- it.effect("preserves URL parser failures as the invalid URL cause chain", () =>- Effect.gen(function* () {- const threadId = freshThreadId();- const manager = yield* PreviewManager.PreviewManager;- const rawUrl = "https://user:[email protected]:bad/path?access_token=secret#fragment";- const error = yield* Effect.flip(manager.open({ threadId, url: rawUrl }));-- expect(error).toMatchObject({- inputLength: rawUrl.length,- reason: "parse",- protocol: "https:",- });- expect(error).not.toHaveProperty("rawUrl");- expect(error.cause).toBeInstanceOf(PreviewUrlNormalizationError);- const normalizationError = error.cause as PreviewUrlNormalizationError;- expect(normalizationError.cause).toBeInstanceOf(Error);- expect(error.message).not.toContain((normalizationError.cause as Error).message);- expect(error.message).not.toMatch(/user|password|access_token|secret|fragment/);- }),- );-it.effect("resizes a tab and preserves its viewport across navigation reports", () =>Effect.gen(function* () {const threadId = freshThreadId();diff --git a/apps/server/src/processRunner.test.ts b/apps/server/src/processRunner.test.tsindex c84289eebca..29d6dbd8365 100644--- a/apps/server/src/processRunner.test.ts+++ b/apps/server/src/processRunner.test.ts@@ -117,44 +117,6 @@ describe("runProcess", () => {);});- it.effect("preserves resolved spawn context and cause", () =>- Effect.gen(function* () {- const cause = PlatformError.systemError({- _tag: "PermissionDenied",- module: "ChildProcessSpawner",- method: "spawn",- pathOrDescriptor: "/actual/fake",- });- const spawner = makeSpawner(() => Effect.fail(cause));-- const error = yield* runWith(spawner)({- command: "fake",- args: ["--flag", "secret-token-value"],- cwd: "/logical",- spawnCwd: "/actual",- }).pipe(Effect.flip);-- expect(error._tag).toBe("ProcessSpawnError");- if (error._tag !== "ProcessSpawnError") {- return expect.fail("Expected ProcessSpawnError");- }- expect(error).toMatchObject({- command: "fake",- argumentCount: 2,- cwd: "/logical",- spawnCwd: "/actual",- resolvedCommand: "fake",- resolvedArgumentCount: 2,- shell: false,- });- expect(error.cause).toBe(cause);- expect(error.message).toBe("Failed to spawn process 'fake' in '/actual'");- expect(error).not.toHaveProperty("args");- expect(error).not.toHaveProperty("resolvedArgs");- expect(error.message).not.toContain("secret-token-value");- }),- );-it.effect("types spawn failures that the platform spawner throws synchronously", () =>Effect.gen(function* () {// A non-directory entry on PATH makes node's spawn throw ENOTDIRdiff --git a/apps/server/src/project/AgentSessionScanner.test.ts b/apps/server/src/project/AgentSessionScanner.test.tsindex 7772523d4cf..29a55ec22ba 100644--- a/apps/server/src/project/AgentSessionScanner.test.ts+++ b/apps/server/src/project/AgentSessionScanner.test.ts@@ -2152,53 +2152,6 @@ describe("parseAgentSessionTranscript", () => {]);});- it("preserves a canonical Codex event that starts with context markup", () => {- const prompt =- "<environment_context>\n<cwd>/tmp/project</cwd>\n</environment_context>\n\nCreate a useful project.";- const thread = AgentSessionScanner.parseAgentSessionTranscript({- contents: [- encodeTranscriptRecord({ type: "session_meta", payload: { id: "codex-session" } }),- encodeTranscriptRecord({- type: "event_msg",- payload: {- type: "user_message",- message: prompt,- },- }),- ].join("\n"),- source: "codex",- providerInstanceId: ProviderInstanceId.make("codex"),- fallbackSessionId: "fallback",- lastActiveAtMs: Date.parse("2026-08-25T08:00:00.000Z"),- });-- expect(thread?.title).toBe("Create a useful project.");- expect(thread?.messages.map((message) => message.text)).toEqual([prompt]);- });-- it("preserves a Codex request heading in a canonical event", () => {- const prompt = "\n ## My request for Codex:\n\nFix the visible bug";- const thread = AgentSessionScanner.parseAgentSessionTranscript({- contents: [- encodeTranscriptRecord({ type: "session_meta", payload: { id: "codex-session" } }),- encodeTranscriptRecord({- type: "event_msg",- payload: {- type: "user_message",- message: prompt,- },- }),- ].join("\n"),- source: "codex",- providerInstanceId: ProviderInstanceId.make("codex"),- fallbackSessionId: "fallback",- lastActiveAtMs: Date.parse("2026-08-25T08:00:00.000Z"),- });-- expect(thread?.title).toBe("Fix the visible bug");- expect(thread?.messages.map((message) => message.text)).toEqual([prompt]);- });-it("titles a Codex event after the request that follows injected setup blocks", () => {const prompt = ["<recommended_plugins>\nGitHub\n</recommended_plugins>",@@ -2224,26 +2177,6 @@ describe("parseAgentSessionTranscript", () => {expect(thread?.messages.map((message) => message.text)).toEqual([prompt]);});- it("keeps context markup quoted inside visible Codex user text", () => {- const quoted =- "Do not remove this example:\n<environment_context>\n<cwd>/tmp/example</cwd>\n</environment_context>";- const thread = AgentSessionScanner.parseAgentSessionTranscript({- contents: [- encodeTranscriptRecord({ type: "session_meta", payload: { id: "codex-session" } }),- encodeTranscriptRecord({- type: "event_msg",- payload: { type: "user_message", message: quoted },- }),- ].join("\n"),- source: "codex",- providerInstanceId: ProviderInstanceId.make("codex"),- fallbackSessionId: "fallback",- lastActiveAtMs: Date.parse("2026-08-25T08:00:00.000Z"),- });-- expect(thread?.messages.map((message) => message.text)).toEqual([quoted]);- });-it("skips sessions without a visible user message", () => {const thread = AgentSessionScanner.parseAgentSessionTranscript({contents: JSON.stringify({diff --git a/apps/server/src/project/ProjectFaviconResolver.test.ts b/apps/server/src/project/ProjectFaviconResolver.test.tsindex 5766bef86a2..5877662f46b 100644--- a/apps/server/src/project/ProjectFaviconResolver.test.ts+++ b/apps/server/src/project/ProjectFaviconResolver.test.ts@@ -207,6 +207,7 @@ it.layer(layerTest)("ProjectFaviconResolverLive", (it) => {}),);+ // regression: #5538 favicon resolution pinned the event loopit.effect("skips icon metadata without an href and keeps scanning", () =>Effect.gen(function* () {const resolver = yield* ProjectFaviconResolver.ProjectFaviconResolver;diff --git a/apps/server/src/project/T3ProjectFileLoader.test.ts b/apps/server/src/project/T3ProjectFileLoader.test.tsindex f051999ce6f..5abc7809886 100644--- a/apps/server/src/project/T3ProjectFileLoader.test.ts+++ b/apps/server/src/project/T3ProjectFileLoader.test.ts@@ -28,29 +28,6 @@ const writeProjectFile = Effect.fn("writeProjectFile")(function* (cwd: string, cit.layer(layerTest)("T3ProjectFileLoader", (it) => {describe("load", () => {- it.effect("loads and decodes a valid t3.json", () =>- Effect.gen(function* () {- const loader = yield* T3ProjectFileLoader.T3ProjectFileLoader;- const cwd = yield* makeTempDir;- yield* writeProjectFile(- cwd,- `{- // JSONC is tolerated- "iconPath": "assets/logo.svg",- "scripts": [{ "name": "Dev", "command": "pnpm dev" }],- }`,- );-- const loaded = yield* loader.load(cwd);-- expect(Option.isSome(loaded)).toBe(true);- if (Option.isSome(loaded)) {- expect(loaded.value.iconPath).toBe("assets/logo.svg");- expect(loaded.value.scripts).toEqual([{ name: "Dev", command: "pnpm dev" }]);- }- }),- );-it.effect("returns none for malformed JSON without failing", () =>Effect.gen(function* () {const loader = yield* T3ProjectFileLoader.T3ProjectFileLoader;diff --git a/apps/server/src/provider/AcpRegistryProbe.test.ts b/apps/server/src/provider/AcpRegistryProbe.test.tsindex d8b8181d29a..bc7c14d3b3c 100644--- a/apps/server/src/provider/AcpRegistryProbe.test.ts+++ b/apps/server/src/provider/AcpRegistryProbe.test.ts@@ -374,50 +374,6 @@ describe("ACP Registry probe", () => {);});- it.effect("preserves the ACP method error for unsupported session management", () => {- const catalog = AcpRegistrySupport.AcpRegistryCatalog.of({- search: () => Effect.die("unused search"),- prepare: () => Effect.die("unused prepare"),- inspect: () => Effect.die("unused inspect"),- uninstallManagedBinary: () => Effect.die("unused uninstall"),- resolve: () =>- Effect.succeed({- agent: {- id: "mock-agent",- name: "Mock Agent",- version: "1.0.0",- description: "ACP unsupported management test agent",- distribution: { npx: { package: "[email protected]" } },- },- distribution: "npx" as const,- spawn: {- command: "node",- args: [mockAgentPath],- env: { ...process.env, T3_ACP_OMIT_SESSION_LIST_HANDLER: "1" },- },- }),- });-- return Effect.gen(function* () {- const failure = yield* listAcpRegistrySessions({- instanceId,- settings: decodeSettings({ agentId: "mock-agent" }),- cwd: process.cwd(),- environment: process.env,- }).pipe(Effect.flip);-- expect(failure).toMatchObject({- reason: "session_list_unsupported",- message: "The ACP agent does not advertise session listing.",- cause: { _tag: "AcpRequestError", code: -32601 },- });- }).pipe(- Effect.provideService(AcpRegistrySupport.AcpRegistryCatalog, catalog),- Effect.provide(NodeServices.layer),- Effect.scoped,- );- });-it("distinguishes authentication failures from generic probe failures", () => {const advertised = normalizeAcpRegistryAuthMethods([{ id: "grok-login", name: "Log in with Grok" },diff --git a/apps/server/src/provider/CodexMcpElicitation.test.ts b/apps/server/src/provider/CodexMcpElicitation.test.tsindex 208da6904e0..66dd7ddb6e7 100644--- a/apps/server/src/provider/CodexMcpElicitation.test.ts+++ b/apps/server/src/provider/CodexMcpElicitation.test.ts@@ -60,6 +60,7 @@ describe("Codex MCP elicitation approvals", () => {});});+ // regression: #8058 show Codex app access approval promptsit("returns persistent approval in the MCP response", () => {NodeAssert.deepStrictEqual(toMcpElicitationResponse(request, "acceptAlways"), {action: "accept",diff --git a/apps/server/src/provider/Drivers/ClaudeSkillDispatch.test.ts b/apps/server/src/provider/Drivers/ClaudeSkillDispatch.test.tsindex 99875512f8c..975eb841b67 100644--- a/apps/server/src/provider/Drivers/ClaudeSkillDispatch.test.ts+++ b/apps/server/src/provider/Drivers/ClaudeSkillDispatch.test.ts@@ -10,6 +10,7 @@ const skillMap = (names: Iterable<string>) =>const SKILLS = skillMap(["2spec", "implement", "review", "re-release-version"]);describe("planClaudeSkillDispatch", () => {+ // regression: #9128 skills picked from the composer did not runit("leaves a prompt without a known skill untouched", () => {expect(planClaudeSkillDispatch("fix the build", SKILLS)).toBeUndefined();expect(planClaudeSkillDispatch("echo $HOME then $unknown", SKILLS)).toBeUndefined();diff --git a/apps/server/src/provider/Drivers/ClaudeSkills.test.ts b/apps/server/src/provider/Drivers/ClaudeSkills.test.tsindex e4be612de81..62c322cabf1 100644--- a/apps/server/src/provider/Drivers/ClaudeSkills.test.ts+++ b/apps/server/src/provider/Drivers/ClaudeSkills.test.ts@@ -807,6 +807,7 @@ it.layer(NodeServices.layer)("discoverClaudeSkills", (it) => {}),);+ // regression: #9128 skills picked from the composer did not runit.effect("switches a skill off by its directory name", () =>Effect.gen(function* () {const fs = yield* FileSystem.FileSystem;diff --git a/apps/server/src/provider/Drivers/claudeUsage.test.ts b/apps/server/src/provider/Drivers/claudeUsage.test.tsindex 4efcda6d631..1db2197a53e 100644--- a/apps/server/src/provider/Drivers/claudeUsage.test.ts+++ b/apps/server/src/provider/Drivers/claudeUsage.test.ts@@ -86,9 +86,4 @@ describe("parseClaudeLine", () => {expect(claudeUsageFormat.parseLine(JSON.stringify(synthetic), undefined)).toEqual([]);expect(claudeUsageFormat.parseProjected(synthetic, undefined)).toEqual([]);});-- it("ignores records that are not assistant messages", () => {- expect(parseClaudeLine(JSON.stringify({ type: "user", message: {} }))).toBeNull();- expect(parseClaudeLine("not json")).toBeNull();- });});diff --git a/apps/server/src/provider/EventNdjsonLogger.test.ts b/apps/server/src/provider/EventNdjsonLogger.test.tsindex 360d9cfd7d3..c932ac2fa5e 100644--- a/apps/server/src/provider/EventNdjsonLogger.test.ts+++ b/apps/server/src/provider/EventNdjsonLogger.test.ts@@ -338,39 +338,6 @@ it.layer(NodeServices.layer)("EventNdjsonLogger", (it) => {}),);- it.effect("contains hostile event accessors inside guarded serialization", () =>- Effect.gen(function* () {- const tempDir = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-provider-log-"));- const basePath = NodePath.join(tempDir, "events.log");-- try {- const logger = yield* makeEventNdjsonLogger(basePath, {- stream: "canonical",- batchWindowMs: 0,- });- assert.exists(logger);- if (!logger) return;- const hostile = new Proxy(- { id: "hostile" },- {- get(_target, property) {- if (property === "type") throw new Error("blocked");- return undefined;- },- },- );-- yield* logger.write(hostile, ThreadId.make("thread-hostile"));- yield* logger.close();-- const contents = NodeFS.readFileSync(ownedLogPath(basePath, "thread-hostile"), "utf8");- assert.notInclude(contents, "blocked");- } finally {- NodeFS.rmSync(tempDir, { recursive: true, force: true });- }- }),- );-it.effect("serializes concurrent first writes for the same segment", () =>Effect.gen(function* () {const tempDir = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-provider-log-"));diff --git a/apps/server/src/provider/GrokProvider.test.ts b/apps/server/src/provider/GrokProvider.test.tsindex 87dbdc30169..373d9773280 100644--- a/apps/server/src/provider/GrokProvider.test.ts+++ b/apps/server/src/provider/GrokProvider.test.ts@@ -425,6 +425,7 @@ describe("Grok usage limits", () => {}});+ // regression: #17061 show zero-use Grok billing periodsit("rejects impossible calendar dates at either period boundary", () => {for (const [start, end] of [["2026-02-30T00:00:00.000Z", "2026-03-09T00:00:00.000Z"],diff --git a/apps/server/src/provider/ProviderRegistry.test.ts b/apps/server/src/provider/ProviderRegistry.test.tsindex f284eb827d7..a278470c286 100644--- a/apps/server/src/provider/ProviderRegistry.test.ts+++ b/apps/server/src/provider/ProviderRegistry.test.ts@@ -2287,32 +2287,5 @@ it.layer(),),);-- it.effect("returns error when version check fails with non-zero exit code", () => {- const secretStderr = "Something went wrong: secret-token-value";- return Effect.gen(function* () {- const status = yield* checkClaudeProviderStatus(- defaultClaudeSettings,- claudeCapabilities(),- );- assert.strictEqual(status.status, "error");- assert.strictEqual(status.installed, true);- assert.strictEqual(status.message, "Claude Agent CLI is installed but failed to run.");- assert.ok(!(status.message ?? "").includes(secretStderr));- }).pipe(- Effect.provide(- layerMockSpawner((args) => {- const joined = args.join(" ");- if (joined === "--version")- return {- stdout: "",- stderr: secretStderr,- code: 1,- };- throw new Error(`Unexpected args: ${joined}`);- }),- ),- );- });});});diff --git a/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts b/apps/server/src/provider/acp/AcpJsonRpcConnection.test.tsindex 7332a030838..36fee6411d7 100644--- a/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts+++ b/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts@@ -1009,6 +1009,7 @@ describe("AcpSessionRuntime", () => {),);+ // regression: #3156 harden ACP resume with replay-idle load readinessit.effect("fails session startup when session/load returns an error", () =>Effect.gen(function* () {const runtime = yield* AcpSessionRuntime.AcpSessionRuntime;diff --git a/apps/server/src/provider/acp/AntigravityAcpSupport.test.ts b/apps/server/src/provider/acp/AntigravityAcpSupport.test.tsindex 7b5170c1d4e..b36c4afe915 100644--- a/apps/server/src/provider/acp/AntigravityAcpSupport.test.ts+++ b/apps/server/src/provider/acp/AntigravityAcpSupport.test.ts@@ -485,21 +485,4 @@ it.layer(NodeServices.layer)("buildAntigravityPrompt", (it) => {});}),);-- it.effect("rejects an empty turn", () =>- Effect.gen(function* () {- const fixture = yield* makeAttachmentFixture();- const error = yield* buildAntigravityPrompt({- input: " ",- attachments: [],- attachmentsDir: fixture.attachmentsDir,- }).pipe(Effect.flip);-- expect(error).toMatchObject({- _tag: "AcpRequestError",- code: -32602,- errorMessage: "A turn requires text or supported attachments.",- });- }),- );});diff --git a/apps/server/src/provider/antigravityAuthSupport.test.ts b/apps/server/src/provider/antigravityAuthSupport.test.tsindex 0098e686588..9138a28dab5 100644--- a/apps/server/src/provider/antigravityAuthSupport.test.ts+++ b/apps/server/src/provider/antigravityAuthSupport.test.ts@@ -211,16 +211,6 @@ describe("Antigravity process environment", () => {});describe("Antigravity authorization URL", () => {- it.effect("returns the official Google URL and its owned loopback target", () =>- Effect.gen(function* () {- expect(yield* parseAntigravityAuthorizationUrl(authorizationUrl)).toEqual({- authorizationUrl,- redirectUri: "http://127.0.0.1:46353/",- state: "test-opaque-state",- });- }),- );-it.effect("rejects other origins, ambiguous state, and non-loopback redirects without retaining them",() =>@@ -304,17 +294,6 @@ describe("Antigravity stdout compatibility", () => {}),);- it.effect("handles an auth line without a final newline", () =>- Effect.gen(function* () {- const urls: string[] = [];- const result = yield* makeAntigravityStdoutTransform({- onAuthorizationUrl: (url) => Effect.sync(() => void urls.push(url)),- })(Stream.make(encode(authLine.slice(0, -1)))).pipe(Stream.runCollect);- expect(result).toEqual([]);- expect(urls).toEqual([authorizationUrl]);- }),- );-it.effect("ends normal work with a safe sign-in error instead of waiting for OAuth", () =>Effect.gen(function* () {const result = yield* makeAntigravityStdoutTransform()(Stream.make(encode(authLine))).pipe(diff --git a/apps/server/src/provider/providerStatusCache.test.ts b/apps/server/src/provider/providerStatusCache.test.tsindex fb933b71134..79cb0bfbf5f 100644--- a/apps/server/src/provider/providerStatusCache.test.ts+++ b/apps/server/src/provider/providerStatusCache.test.ts@@ -7,15 +7,8 @@ import {} from "@t3tools/contracts";import { createModelCapabilities } from "@t3tools/shared/model";import { assert, it } from "@effect/vitest";-import * as Effect from "effect/Effect";-import * as FileSystem from "effect/FileSystem";-import * as Logger from "effect/Logger";-import {- hydrateCachedProvider,- isCachedProviderCorrelated,- readProviderStatusCache,-} from "./providerStatusCache.ts";+import { hydrateCachedProvider, isCachedProviderCorrelated } from "./providerStatusCache.ts";const emptyCapabilities = createModelCapabilities({ optionDescriptors: [] });const CODEX_DRIVER = ProviderDriverKind.make("codex");@@ -39,39 +32,6 @@ const makeProvider = (});it.layer(NodeServices.layer)("providerStatusCache", (it) => {- it.effect("logs structural diagnostics without retaining invalid cache contents", () => {- const messages: Array<unknown> = [];- const logger = Logger.make<unknown, void>((options) => {- if (Array.isArray(options.message)) {- messages.push(...options.message);- } else {- messages.push(options.message);- }- });-- return Effect.gen(function* () {- const fs = yield* FileSystem.FileSystem;- const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-provider-cache-invalid-" });- const cachePath = `${tempDir}/provider.json`;- const secretCacheValue = "secret-cache-value";- yield* fs.writeFileString(cachePath, `{ "token": "${secretCacheValue}" }`);-- const result = yield* readProviderStatusCache(cachePath);-- assert.strictEqual(result, undefined);- const failure = messages.find(- (message): message is Record<string, unknown> =>- typeof message === "object" && message !== null && "path" in message,- );- assert.exists(failure);- assert.strictEqual(failure.path, cachePath);- assert.strictEqual(typeof failure.errorTag, "string");- assert.ok(!("cause" in failure));- assert.ok(!("issues" in failure));- assert.ok(!Object.values(failure).map(String).join("\n").includes(secretCacheValue));- }).pipe(Effect.provide(Logger.layer([logger], { mergeWithExisting: false })));- });-it("hydrates cached provider status while preserving current settings-derived models", () => {const cachedCodex = makeProvider(CODEX_DRIVER, {checkedAt: "2026-04-10T12:00:00.000Z",diff --git a/apps/server/src/pullRequest/PullRequestService.test.ts b/apps/server/src/pullRequest/PullRequestService.test.tsindex 619cd31c8ec..d270636c401 100644--- a/apps/server/src/pullRequest/PullRequestService.test.ts+++ b/apps/server/src/pullRequest/PullRequestService.test.ts@@ -477,31 +477,6 @@ it.effect("says where each repository carries on, and from nothing it has run ou}),);-it.effect("offers no continuation for a host that cannot be carried on from", () =>- Effect.gen(function* () {- const service = yield* makeService({- projects: [- project({ id: "p1", title: "t3code", workspaceRoot: "/a", repository: "pingdotgg/t3code" }),- ],- providers: [- fakeProvider(SourceControlProviderKind.make("github"), {- listChangeRequests: () =>- Effect.succeed({- items: [changeRequest(1, "2026-07-02T00:00:00Z")],- truncated: true,- continues: false,- }),- }),- ],- });-- const result = yield* service.list({ state: "open" });-- assert.isTrue(result.truncated);- assert.deepStrictEqual(result.nextCursors, {});- }),-);-it.effect("uses a provider's raw cursor advance when it consumed malformed rows", () =>Effect.gen(function* () {const service = yield* makeService({@@ -1827,6 +1802,7 @@ it.effect("prefers a matching checkout over a non-repository project's directory}),);+// regression: #17167 refresh linked PRs without a checkoutit.effect("requires an explicit host for a non-repository project's linked PR", () =>Effect.gen(function* () {const service = yield* makeService({@@ -2160,29 +2136,6 @@ it.effect("close and reopen notify subscribed readers after invalidating their c),);-it.effect("does not cache a failed listing", () =>- Effect.gen(function* () {- let hostCalls = 0;- const service = yield* makeService({- projects: [project({ id: "p1", title: "web", workspaceRoot: "/a", repository: "acme/web" })],- providers: [- fakeProvider(SourceControlProviderKind.make("github"), {- getViewer: () => {- hostCalls += 1;- return hostCalls === 1 ? Effect.fail(requestFailed) : Effect.succeed("bilal");- },- }),- ],- });-- const error = yield* Effect.flip(service.list({ state: "open" }));- assert.strictEqual(error._tag, "PullRequestOperationError");- const second = yield* service.list({ state: "open" });- assert.strictEqual(hostCalls, 2);- assert.strictEqual(second.providers[0]?.configured, true);- }),-);-it.effect("reads a host's repositories in one search, and files the rows back under each", () =>Effect.gen(function* () {const asked: Array<ReadonlyArray<string>> = [];diff --git a/apps/server/src/pullRequest/pullRequestReviewGuideNormalize.test.ts b/apps/server/src/pullRequest/pullRequestReviewGuideNormalize.test.tsindex 233013ac714..69479b1ccfe 100644--- a/apps/server/src/pullRequest/pullRequestReviewGuideNormalize.test.ts+++ b/apps/server/src/pullRequest/pullRequestReviewGuideNormalize.test.ts@@ -121,18 +121,6 @@ describe("normalizeReviewGuide", () => {expect(result.stops).toHaveLength(1);});- it("keeps a long excerpt to its first 25 lines", () => {- const long = parseReviewGuideChange(- "big.ts\0",- "--- a/big.ts\n+++ b/big.ts\n@@ -0,0 +1,100 @@\n",- );- const result = normalizeReviewGuide(- guide({ stops: [stop({ excerpts: [excerpt("big.ts", 1, 100)] })] }),- long,- );- expect(result.stops[0]?.excerpts).toEqual([excerpt("big.ts", 1, 25)]);- });-it("drops notes outside the stop's remaining excerpts", () => {const result = normalizeReviewGuide(guide({diff --git a/apps/server/src/resourceTelemetry/ResourceMonitorBinary.test.ts b/apps/server/src/resourceTelemetry/ResourceMonitorBinary.test.tsindex e053f617fd9..c79b7f466f1 100644--- a/apps/server/src/resourceTelemetry/ResourceMonitorBinary.test.ts+++ b/apps/server/src/resourceTelemetry/ResourceMonitorBinary.test.ts@@ -65,6 +65,7 @@ describe("ResourceMonitorBinary", () => {}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),);+ // regression: #16838 a directory resolved as the resource monitor binaryit.effect("rejects a directory override", () =>Effect.gen(function* () {const fileSystem = yield* FileSystem.FileSystem;diff --git a/apps/server/src/scheduledTasks/ScheduledTaskService.webhook.test.ts b/apps/server/src/scheduledTasks/ScheduledTaskService.webhook.test.tsindex 2a41fcf9c61..65cecbcf432 100644--- a/apps/server/src/scheduledTasks/ScheduledTaskService.webhook.test.ts+++ b/apps/server/src/scheduledTasks/ScheduledTaskService.webhook.test.ts@@ -566,27 +566,6 @@ it.effect("a save without a secret keeps a secret changed after it was read", ()),);-it.effect("logs a body's first 64 KiB by bytes, not characters", () =>- withService(({ service }) =>- Effect.gen(function* () {- const { task } = yield* service.upsert(yield* webhookTaskInput({ enabled: false }));- const text = "界".repeat(30_000);- const body = new TextEncoder().encode(text);- yield* service.triggerWebhook(requestFor(task, { body, bodyText: text }));- const [summary] = (yield* service.listWebhookDeliveries({- id: task.id,- acceptAnyOutcome: true,- })).deliveries;- const { delivery } = yield* service.getWebhookDelivery({- id: task.id,- deliveryId: summary!.id,- });- assert.isTrue(delivery.bodyTruncated);- assert.isAtMost(new TextEncoder().encode(delivery.body).byteLength, 64 * 1024 + 3);- }),- ),-);-it.effect("a held request already delivered directly runs only once", () =>withService(({ service, launches }) =>Effect.gen(function* () {@@ -1024,26 +1003,6 @@ it.effect("rolls back replay and pending state when recording a delivery fails",);});-it.effect("a partially missing key is empty even with a literal prefix", () =>- withService(({ service, launches }) =>- Effect.gen(function* () {- const { task } = yield* service.upsert(- yield* webhookTaskInput({- schedule: {- type: "webhook",- dedupe: { replayKey: "gh:{{headers.absent}}", coalesceKey: "pr:{{body.absent}}" },- },- }),- );- for (let i = 0; i < 2; i++) {- const result = yield* service.triggerWebhook(requestFor(task, { headers: { absent: "" } }));- assert.equal(result._tag === "accepted" && result.outcome, "accepted");- yield* Queue.take(launches);- }- }),- ),-);-it.effect("queue-full deliveries release replay keys so a later retry runs", () =>Effect.gen(function* () {const gate = yield* Deferred.make<void>();diff --git a/apps/server/src/scheduledTasks/webhookRoute.test.ts b/apps/server/src/scheduledTasks/webhookRoute.test.tsindex d0f8deaae08..5ef605be0ab 100644--- a/apps/server/src/scheduledTasks/webhookRoute.test.ts+++ b/apps/server/src/scheduledTasks/webhookRoute.test.ts@@ -113,35 +113,6 @@ const post = () => new Request(`http://env.local${path}`, { method: "POST", body, headers });describe("webhook route", () => {- it("passes the raw request to the service and answers 202 with the delivery id", async () => {- let received: WebhookTriggerRequest | undefined;- const { handler, dispose } = handlerFor((request) => {- received = request;- return Effect.succeed({- _tag: "accepted",- deliveryId: ScheduledTaskWebhookDeliveryId.make("delivery:1"),- outcome: "accepted",- });- });- try {- const response = await handler(- post("/api/hooks/scheduled-task%3Ahook/tok?x=1", '{"a":1}', {- "Content-Type": "application/json",- "X-GitHub-Event": "push",- }),- );- expect(response.status).toBe(202);- expect(await response.json()).toEqual({ deliveryId: "delivery:1" });- expect(received?.hookId).toBe("scheduled-task:hook");- expect(received?.token).toBe("tok");- expect(received?.query).toBe("x=1");- expect(received?.headers["x-github-event"]).toBe("push");- expect(received?.bodyText).toBe('{"a":1}');- } finally {- await dispose();- }- });-it.live("trusts the relay's delivery id and receive time only with its signed proof", () =>Effect.gen(function* () {const received: Array<WebhookTriggerRequest> = [];diff --git a/apps/server/src/serverLogger.test.ts b/apps/server/src/serverLogger.test.tsindex e7554fa8cfd..75c35a61b03 100644--- a/apps/server/src/serverLogger.test.ts+++ b/apps/server/src/serverLogger.test.ts@@ -165,6 +165,7 @@ describe("ServerLoggerLive", () => {}),);+ // regression: #16642 logs printed causes as [Object]it.effect("leaves getters uncalled while printing a cause field", () =>Effect.gen(function* () {const output = yield* printThroughConsole({diff --git a/apps/server/src/serverRuntimeState.test.ts b/apps/server/src/serverRuntimeState.test.tsindex 59e681425d6..abafbc7e24f 100644--- a/apps/server/src/serverRuntimeState.test.ts+++ b/apps/server/src/serverRuntimeState.test.ts@@ -4,12 +4,9 @@ import * as HostProcess from "@t3tools/shared/HostProcess";import * as Effect from "effect/Effect";import * as FileSystem from "effect/FileSystem";import * as Layer from "effect/Layer";-import * as Logger from "effect/Logger";import * as Option from "effect/Option";import * as Path from "effect/Path";-import * as References from "effect/References";import * as Runtime from "effect/Runtime";-import * as Schema from "effect/Schema";import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";import { renderBootServicePlist, renderBootServiceUnit } from "./cloud/bootService.ts";@@ -19,8 +16,6 @@ import * as ProcessRunner from "./processRunner.ts";import * as ServerOwnership from "./serverOwnership.ts";import * as ServerRuntimeState from "./serverRuntimeState.ts";-const isServerRuntimeStateError = Schema.is(ServerRuntimeState.ServerRuntimeStateError);-const startBesideBootService = Effect.fn("test.startBesideBootService")(function* (input: {readonly platform: "darwin" | "linux";readonly outputs: Readonly<Record<string, { readonly code: number; readonly stdout?: string }>>;@@ -132,11 +127,6 @@ const startBesideBootService = Effect.fn("test.startBesideBootService")(functionreturn { result, t3Home };});-interface CapturedLog {- readonly message: unknown;- readonly annotations: Readonly<Record<string, unknown>>;-}-describe("server ownership", () => {// An empty home, so no boot service unit installed on this machine is read.const layerOwnership = Layer.mergeAll(@@ -407,42 +397,3 @@ describe("server ownership", () => {);});});--describe("serverRuntimeState", () => {- it.effect("preserves malformed state decode failures", () => {- const logs: CapturedLog[] = [];- const logger = Logger.make(({ fiber, message }) => {- logs.push({- message,- annotations: fiber.getRef(References.CurrentLogAnnotations),- });- });-- return Effect.gen(function* () {- const fileSystem = yield* FileSystem.FileSystem;- const path = yield* Path.Path;- const root = yield* fileSystem.makeTempDirectoryScoped({- prefix: "t3-server-runtime-state-test-",- });- const statePath = path.join(root, "server.json");- yield* fileSystem.writeFileString(statePath, "{not json");-- const restored = yield* ServerRuntimeState.readPersistedServerRuntimeState(statePath);-- assert.isTrue(Option.isNone(restored));- assert.equal(logs[0]?.message, `Failed to decode server runtime state at ${statePath}.`);- const error = logs[0]?.annotations.cause;- assert.isTrue(isServerRuntimeStateError(error));- if (isServerRuntimeStateError(error)) {- assert.equal(error.operation, "decode");- assert.equal(error.statePath, statePath);- assert.equal(error.message, `Failed to decode server runtime state at ${statePath}.`);- assert.deepInclude(error.cause, { _tag: "SchemaError" });- }- }).pipe(- Effect.provide(- Layer.merge(NodeServices.layer, Logger.layer([logger], { mergeWithExisting: false })),- ),- );- });-});diff --git a/apps/server/src/serverSettings.test.ts b/apps/server/src/serverSettings.test.tsindex 8e90ecff252..a23d44fc282 100644--- a/apps/server/src/serverSettings.test.ts+++ b/apps/server/src/serverSettings.test.ts@@ -234,51 +234,6 @@ it.layer(NodeServices.layer)("server settings", (it) => {}).pipe(Effect.provide(layerServerSettings())),);- it.effect("preserves context when reading a provider environment secret fails", () => {- const platformCause = PlatformError.systemError({- _tag: "PermissionDenied",- module: "FileSystem",- method: "readFile",- pathOrDescriptor: "provider environment secret",- description: "Secret backend unavailable.",- });- const cause = new ServerSecretStore.SecretStoreReadError({- resource: "provider environment secret",- cause: platformCause,- });- const layerConfig = Layer.fresh(- ServerConfig.layerTest(process.cwd(), {- prefix: "t3code-server-settings-secret-failure-test-",- }),- );- const layerSettings = ServerSettingsModule.layer.pipe(- Layer.provide(layerFailingSecretStore(cause)),- Layer.provideMerge(Layer.fresh(SqlitePersistence.layerMemory)),- Layer.provideMerge(layerConfig),- );-- return Effect.gen(function* () {- const serverConfig = yield* ServerConfig.ServerConfig;- const fileSystem = yield* FileSystem.FileSystem;- const serverSettings = yield* ServerSettingsModule.ServerSettingsService;- yield* fileSystem.writeFileString(- serverConfig.settingsPath,- '{"providerInstances":{"codex_personal":{"driver":"codex","environment":[{"name":"OPENROUTER_API_KEY","value":"","sensitive":true,"valueRedacted":true}],"config":{}}}}',- );-- const error = yield* Effect.flip(serverSettings.getSettings);-- assert.deepInclude(error, {- _tag: "ServerSettingsError",- operation: "read-secret",- providerInstanceId: "codex_personal",- environmentVariable: "OPENROUTER_API_KEY",- });- assert.strictEqual(error.cause, cause);- assert.notInclude(error.message, cause.message);- }).pipe(Effect.provide(layerSettings));- });-it.effect("retries a failed settings read instead of keeping the failure", () =>Effect.gen(function* () {const serverConfig = yield* ServerConfig.ServerConfig;diff --git a/apps/server/src/sourceControl/BitbucketApi.test.ts b/apps/server/src/sourceControl/BitbucketApi.test.tsindex 78fcc6ce5c9..38a5f112c38 100644--- a/apps/server/src/sourceControl/BitbucketApi.test.ts+++ b/apps/server/src/sourceControl/BitbucketApi.test.ts@@ -424,57 +424,6 @@ it.effect(},);-it.effect(- "falls back to the repository main branch when the Bitbucket branching model is unavailable",- () => {- const { layer } = makeLayer({- response: (request) =>- request.url.endsWith("/branching-model")- ? Response.json({ error: { message: "Not found" } }, { status: 404 })- : Response.json(repositoryJson),- });-- return Effect.gen(function* () {- const bitbucket = yield* BitbucketApi.BitbucketApi;- const defaultBranch = yield* bitbucket.getDefaultBranch({ cwd: "/repo" });-- assert.strictEqual(defaultBranch, "main");- }).pipe(Effect.provide(layer));- },-);--it.effect("creates repositories through the Bitbucket REST API", () => {- const { execute, layer } = makeLayer({- response: () => Response.json(repositoryJson),- });-- return Effect.gen(function* () {- const bitbucket = yield* BitbucketApi.BitbucketApi;- const cloneUrls = yield* bitbucket.createRepository({- cwd: "/repo",- repository: "pingdotgg/t3code",- visibility: "private",- });-- assert.deepStrictEqual(cloneUrls, {- nameWithOwner: "pingdotgg/t3code",- url: "https://bitbucket.org/pingdotgg/t3code.git",- sshUrl: "[email protected]:pingdotgg/t3code.git",- });-- const request = execute.mock.calls[0]?.[0];- assert.strictEqual(request?.url, "https://api.test.local/2.0/repositories/pingdotgg/t3code");- assert.strictEqual(request?.method, "POST");- assert.ok(request);- const rawBody = (request.body as { readonly body?: Uint8Array }).body;- assert.ok(rawBody);- assert.deepStrictEqual(JSON.parse(new TextDecoder().decode(rawBody)), {- scm: "git",- is_private: true,- });- }).pipe(Effect.provide(layer));-});-it.effect("creates pull requests using the official REST payload shape", () => {const { execute, layer } = makeLayer({response: () => Response.json(bitbucketPullRequest),diff --git a/apps/server/src/sourceControl/SourceControlRepositoryService.test.ts b/apps/server/src/sourceControl/SourceControlRepositoryService.test.tsindex 09ea2eafd12..3620555b30d 100644--- a/apps/server/src/sourceControl/SourceControlRepositoryService.test.ts+++ b/apps/server/src/sourceControl/SourceControlRepositoryService.test.ts@@ -431,6 +431,7 @@ it.effect("explains a rejected SSH push after creating the repository", () =>}).pipe(Effect.provide(layer({ git: failingPush("authentication_failed") }))),);+// regression: #19219 publishing did not explain why the first push failedit.effect("says the repository exists when an unclassified publish push fails", () =>Effect.gen(function* () {const service = yield* SourceControlRepositoryService.SourceControlRepositoryService;diff --git a/apps/server/src/terminal/Manager.test.ts b/apps/server/src/terminal/Manager.test.tsindex 718d6a4018a..413436ea452 100644--- a/apps/server/src/terminal/Manager.test.ts+++ b/apps/server/src/terminal/Manager.test.ts@@ -8,7 +8,6 @@ import {type TerminalRestartInput,ProviderDriverKind,ProviderInstanceId,- ServerSettingsError,TerminalProviderInstanceNotFoundError,} from "@t3tools/contracts";import * as HostProcess from "@t3tools/shared/HostProcess";@@ -561,14 +560,6 @@ it.layer(}),);- const makeDirectory = (filePath: string) =>- Effect.flatMap(Effect.service(FileSystem.FileSystem), (fs) =>- fs.makeDirectory(filePath, { recursive: true }),- );-- const chmod = (filePath: string, mode: number) =>- Effect.flatMap(Effect.service(FileSystem.FileSystem), (fs) => fs.chmod(filePath, mode));-const pathExists = (filePath: string) =>Effect.flatMap(Effect.service(FileSystem.FileSystem), (fs) => fs.exists(filePath));@@ -580,32 +571,6 @@ it.layer(fs.writeFileString(filePath, contents),);- it.effect("preserves non-notFound cwd stat failures", () =>- Effect.gen(function* () {- if ((yield* HostProcess.Platform) === "win32") return;-- const path = yield* Path.Path;-- const { manager, baseDir } = yield* createManager();- const blockedRoot = path.join(baseDir, "blocked-root");- const blockedCwd = path.join(blockedRoot, "cwd");- yield* makeDirectory(blockedCwd);- yield* chmod(blockedRoot, 0o000);-- const error = yield* Effect.flip(manager.open(openInput({ cwd: blockedCwd }))).pipe(- Effect.ensuring(chmod(blockedRoot, 0o755).pipe(Effect.ignore)),- );-- expect(error).toMatchObject({- _tag: "TerminalCwdStatError",- cwd: blockedCwd,- cause: {- _tag: "PlatformError",- },- });- }),- );-it.effect("handles an exit replayed during subscription after publishing startup", () =>Effect.gen(function* () {const ptyAdapter = new FakePtyAdapter();@@ -636,60 +601,6 @@ it.layer(}),);- it.effect("preserves structured context and causes for PTY I/O failures", () =>- Effect.gen(function* () {- const { manager, ptyAdapter } = yield* createManager();- yield* manager.open(openInput());- const process = ptyAdapter.processes[0];- expect(process).toBeDefined();- if (!process) return;-- const writeCause = new Error("PTY input handle is unavailable");- process.writeFailure = writeCause;- const writeError = yield* Effect.flip(- manager.write({- threadId: "thread-1",- terminalId: DEFAULT_TERMINAL_ID,- data: "secret input that must not be attached to the error",- }),- );-- expect(writeError).toMatchObject({- _tag: "TerminalWriteError",- threadId: "thread-1",- terminalId: DEFAULT_TERMINAL_ID,- terminalPid: process.pid,- });- expect(writeError.cause).toBe(writeCause);- expect(writeError).not.toHaveProperty("data");-- const resizeCause = new Error("PTY resize handle is unavailable");- process.resizeFailure = resizeCause;- const resizeError = yield* Effect.flip(- manager.resize({- threadId: "thread-1",- terminalId: DEFAULT_TERMINAL_ID,- cols: 132,- rows: 40,- }),- );-- expect(resizeError).toMatchObject({- _tag: "TerminalResizeError",- threadId: "thread-1",- terminalId: DEFAULT_TERMINAL_ID,- terminalPid: process.pid,- cols: 132,- rows: 40,- });- expect(resizeError.cause).toBe(resizeCause);-- process.resizeFailure = undefined;- yield* manager.open(openInput({ cols: 132, rows: 40 }));- expect(process.resizeCalls).toEqual([{ cols: 132, rows: 40 }]);- }),- );-it.effect("supports multiple terminals per thread independently", () =>Effect.gen(function* () {const { manager, ptyAdapter } = yield* createManager();@@ -1293,46 +1204,6 @@ it.layer(}),);- it.effect("preserves the settings failure when provider environment resolution fails", () =>- Effect.gen(function* () {- const path = yield* Path.Path;- const providerInstanceId = ProviderInstanceId.make("codex_work");- const settingsCause = new Error("secret store read failed");- const settingsError = new ServerSettingsError({- settingsPath: "/test/settings.json",- operation: "read-secret",- providerInstanceId,- environmentVariable: "OPENROUTER_API_KEY",- cause: settingsCause,- });- const serverSettings = ServerSettings.ServerSettingsService.of({- start: Effect.void,- ready: Effect.void,- getSettings: Effect.fail(settingsError),- updateSettings: () => Effect.fail(settingsError),- updateProviderInstance: () => Effect.fail(settingsError),- withSettingsSnapshot: () => Effect.fail(settingsError),- streamChanges: Stream.empty,- subscribeChanges: Effect.succeed(Stream.empty),- });-- const error = yield* TerminalManager.resolveProviderInstanceTerminalEnvironment({- serverSettings,- path,- rawProviderInstanceId: providerInstanceId,- env: undefined,- }).pipe(Effect.flip);-- expect(error).toMatchObject({- _tag: "TerminalProviderEnvironmentError",- providerInstanceId,- });- expect(error.cause).toBe(settingsError);- expect(error.message).not.toContain(settingsError.message);- expect(error.message).not.toContain("OPENROUTER_API_KEY");- }),- );-it.effect.each([{name: "Codex home",diff --git a/apps/server/src/terminal/nodePtyConsoleList.test.ts b/apps/server/src/terminal/nodePtyConsoleList.test.tsindex b412f3c8502..be538491877 100644--- a/apps/server/src/terminal/nodePtyConsoleList.test.ts+++ b/apps/server/src/terminal/nodePtyConsoleList.test.ts@@ -61,6 +61,7 @@ describe("node-pty console process list helper", () => {expect(list).toEqual([SHELL_PID]);});+ // regression: #18519 Windows terminal kill waited on timeoutsit("falls back to the shell PID when the helper fails to spawn", async () => {const list = await getConsoleProcessList((helper) => {helper.emit("error", Object.assign(new Error("spawn ENOENT"), { code: "ENOENT" }));diff --git a/apps/server/src/textGeneration/GrokTextGeneration.test.ts b/apps/server/src/textGeneration/GrokTextGeneration.test.tsindex 71f515025ff..c74f77db4d0 100644--- a/apps/server/src/textGeneration/GrokTextGeneration.test.ts+++ b/apps/server/src/textGeneration/GrokTextGeneration.test.ts@@ -132,24 +132,4 @@ it.layer(layerGrokTextGenerationTest)("GrokTextGeneration", (it) => {}),),);-- it.effect("fails with TextGenerationError when output is unparseable JSON", () =>- withFakeAcpGrok(- {- T3_ACP_PROMPT_RESPONSE_TEXT: "totally not json output from a confused model",- },- (textGeneration) =>- Effect.gen(function* () {- const error = yield* Effect.flip(- textGeneration.generateThreadTitle({- cwd: process.cwd(),- message: "anything",- modelSelection: createModelSelection(ProviderInstanceId.make("grok"), "grok-build"),- }),- );- expect(error._tag).toBe("TextGenerationError");- expect(error.detail).toMatch(/invalid structured output/i);- }),- ),- );});diff --git a/apps/server/src/textGeneration/TextGeneration.test.ts b/apps/server/src/textGeneration/TextGeneration.test.tsdeleted file mode 100644index 9c207654451..00000000000--- a/apps/server/src/textGeneration/TextGeneration.test.ts+++ /dev/null@@ -1,107 +0,0 @@-import { it } from "@effect/vitest";-import * as Effect from "effect/Effect";-import * as PubSub from "effect/PubSub";-import * as Stream from "effect/Stream";-import { describe, expect } from "vite-plus/test";--import { ProviderInstanceId } from "@t3tools/contracts";-import { createModelSelection } from "@t3tools/shared/model";--import type { ProviderInstance } from "@t3tools/provider-core/server/driver";-import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts";-import * as TextGeneration from "./TextGeneration.ts";-import * as SourceControlProviderRegistry from "../sourceControl/SourceControlProviderRegistry.ts";-import * as Layer from "effect/Layer";--const makeStubTextGeneration = (- overrides: Partial<TextGeneration.TextGeneration["Service"]>,-): TextGeneration.TextGeneration["Service"] =>- TextGeneration.TextGeneration.of({- generateCommitMessage: () =>- Effect.die("generateCommitMessage stub not configured for this test"),- generatePrContent: () => Effect.die("generatePrContent stub not configured for this test"),- generateBranchName: () => Effect.die("generateBranchName stub not configured for this test"),- generateThreadTitle: () => Effect.die("generateThreadTitle stub not configured for this test"),- generateReviewGuide: () => Effect.die("generateReviewGuide stub not configured for this test"),- ...overrides,- });--const makeStubInstance = (- instanceId: ProviderInstanceId,- textGeneration: TextGeneration.TextGeneration["Service"],-): ProviderInstance =>- ({- instanceId,- driverKind: instanceId as unknown as ProviderInstance["driverKind"],- continuationIdentity: {- driverKind: instanceId as unknown as ProviderInstance["driverKind"],- continuationKey: `${instanceId}:test`,- },- displayName: undefined,- enabled: true,- snapshot: {} as ProviderInstance["snapshot"],- orchestrationAdapter: {} as ProviderInstance["orchestrationAdapter"],- textGeneration,- }) satisfies ProviderInstance;--const makeStubRegistry = (- instances: ReadonlyArray<ProviderInstance>,-): ProviderInstanceRegistry.ProviderInstanceRegistry["Service"] => {- const byId = new Map(instances.map((instance) => [instance.instanceId, instance] as const));- return {- getInstance: (id) => Effect.succeed(byId.get(id)),- listInstances: Effect.succeed(instances),- listUnavailable: Effect.succeed([]),- streamChanges: Stream.empty,- subscribeChanges: Effect.flatMap(PubSub.unbounded<void>(), (pubsub) =>- PubSub.subscribe(pubsub),- ),- };-};--describe("TextGeneration.make", () => {- it.effect("delegates to the matching instance's textGeneration closure", () =>- Effect.gen(function* () {- const personalId = ProviderInstanceId.make("codex_personal");- const personalCalls: string[] = [];- const personal = makeStubInstance(- personalId,- makeStubTextGeneration({- generateBranchName: (input) => {- personalCalls.push(input.message);- return Effect.succeed({ branch: "personal-branch" });- },- }),- );-- const workId = ProviderInstanceId.make("codex_work");- const work = makeStubInstance(- workId,- makeStubTextGeneration({- generateBranchName: () => Effect.succeed({ branch: "work-branch" }),- }),- );-- const tg = yield* TextGeneration.make.pipe(- Effect.provideService(- ProviderInstanceRegistry.ProviderInstanceRegistry,- makeStubRegistry([personal, work]),- ),- Effect.provide(- Layer.mock(SourceControlProviderRegistry.SourceControlProviderRegistry)({- resolveLink: () => Effect.die("No link lookup expected"),- }),- ),- );-- const result = yield* tg.generateBranchName({- cwd: process.cwd(),- message: "Refactor the routing layer",- modelSelection: createModelSelection(ProviderInstanceId.make("codex_personal"), "gpt-5"),- });-- expect(result.branch).toBe("personal-branch");- expect(personalCalls).toEqual(["Refactor the routing layer"]);- }),- );-});diff --git a/apps/server/src/usage/cliproxyApi.test.ts b/apps/server/src/usage/cliproxyApi.test.tsindex 06b81924933..ba7f5de41ac 100644--- a/apps/server/src/usage/cliproxyApi.test.ts+++ b/apps/server/src/usage/cliproxyApi.test.ts@@ -156,6 +156,7 @@ describe("CLIProxyAPI hub failures", () => {}),);+ // regression: #18168 Limits hub failures name their TLS, HTTP, or timeout causeit.effect("ignores a transport code that is not a short Node error code", () =>Effect.gen(function* () {const api = yield* unreachableHub(diff --git a/apps/server/src/usage/usageScanCache.test.ts b/apps/server/src/usage/usageScanCache.test.tsindex ebbb693a703..78770e1e646 100644--- a/apps/server/src/usage/usageScanCache.test.ts+++ b/apps/server/src/usage/usageScanCache.test.ts@@ -2,7 +2,6 @@ import { describe, expect, it } from "@effect/vitest";import {decodeScanCache,- dedupeWithinFile,encodeScanCache,makeScanCacheWriter,type CachedFile,@@ -253,15 +252,6 @@ describe("scan cache round trip", () => {expect(document.sources).toEqual(sources);});- it("interns repeated model and session strings", () => {- const encoded = encodeScanCache(- cacheWith([["/a.jsonl", 100, [record(), record({ dedupeKey: "msg_2:" }), record()]]]),- );-- expect(encoded.models).toEqual(["claude-fable-5"]);- expect(encoded.sessions).toEqual(["session-a"]);- });-it("treats a corrupt or foreign document as an empty cache", () => {expect(decodeScanCache(null, TEST_FORMAT_MAP).size).toBe(0);expect(decodeScanCache("nonsense", TEST_FORMAT_MAP).size).toBe(0);@@ -300,16 +290,3 @@ describe("scan cache round trip", () => {expect(restored.has("/a.jsonl")).toBe(false);});});--describe("dedupeWithinFile", () => {- it("keeps the first record per dedupe key", () => {- const kept = dedupeWithinFile([- record({ totals: { ...record().totals, outputTokens: 1 } }),- record({ totals: { ...record().totals, outputTokens: 999 } }),- record({ dedupeKey: "msg_2:" }),- ]);-- expect(kept).toHaveLength(2);- expect(kept[0]?.totals.outputTokens).toBe(1);- });-});diff --git a/apps/server/src/vcs/GitVcsDriverCore.test.ts b/apps/server/src/vcs/GitVcsDriverCore.test.tsindex c41166d3f6e..cda722720ed 100644--- a/apps/server/src/vcs/GitVcsDriverCore.test.ts+++ b/apps/server/src/vcs/GitVcsDriverCore.test.ts@@ -837,6 +837,7 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {}),);+ // regression: #8645 name the cause of a failed git commandit.effect("names the branch conflict behind a failed worktree add", () =>Effect.gen(function* () {const parent = yield* makeTmpDir();@@ -868,6 +869,7 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {}),);+ // regression: #8645 name the cause of a failed git commandit.effect("names a missing repository behind a failed command", () =>Effect.gen(function* () {const cwd = yield* makeTmpDir();@@ -3408,6 +3410,7 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {}),);+ // regression: #12485 explain fetch failures without exposing remote outputit.effect("explains a real fetch failure for a missing local remote", () =>Effect.gen(function* () {const cwd = yield* makeTmpDir();@@ -4269,6 +4272,7 @@ describe("Windows long path configuration", () => {}});+ // regression: #14917 Windows worktrees with long paths failed or strandedit("leaves a count Git would reject for Git to report", () => {for (const count of ["nope", "2x", "-1", "1.5", " ", "1 "]) {assert.deepStrictEqual(diff --git a/apps/server/src/vcs/VcsProcess.test.ts b/apps/server/src/vcs/VcsProcess.test.tsindex e5bee8a2c83..c781bd5c6da 100644--- a/apps/server/src/vcs/VcsProcess.test.ts+++ b/apps/server/src/vcs/VcsProcess.test.ts@@ -363,38 +363,6 @@ describe("VcsProcess.run", () => {}).pipe(provideLive),);- it.effect("fails with VcsProcessExitError for non-zero exits by default", () =>- Effect.gen(function* () {- const secretArgument = "--token=super-secret-token";- const secretStderr = "remote rejected super-secret-token";- const error = yield* run({- operation: "test.exit",- command: "node",- args: [- "-e",- "process.stderr.write(process.argv[1]); process.exit(2)",- secretStderr,- secretArgument,- ],- cwd: process.cwd(),- }).pipe(Effect.flip);-- expect(error).toBeInstanceOf(VcsProcessExitError);- expect(error).toMatchObject({- operation: "test.exit",- command: "node",- argumentCount: 4,- exitCode: 2,- detail: "Process exited with a non-zero status.",- failureKind: "command-failed",- stderrLength: secretStderr.length,- stderrTruncated: false,- });- expect(error.message).not.toContain(secretArgument);- expect(error.message).not.toContain(secretStderr);- }).pipe(provideLive),- );-it.effect("classifies authentication failures without retaining stderr", () =>Effect.gen(function* () {const secretStderr = "authentication failed for token super-secret-token";@@ -466,53 +434,6 @@ describe("VcsProcess.run", () => {}).pipe(provideLive),);- it.effect("preserves real boundary causes without manufacturing structural ones", () =>- Effect.gen(function* () {- const cause = new Error("secret stdin failure");- const error = yield* captureProcessResult(- Effect.fail(- new ProcessRunner.ProcessStdinError({- command: baseInput.command,- argumentCount: baseInput.args.length,- cwd: baseInput.cwd,- stdinBytes: 47,- cause,- }),- ),- );-- expect(error).toMatchObject({- _tag: "VcsProcessStdinWriteError",- operation: baseInput.operation,- stdinBytes: 47,- cause,- });- expect(error.message).not.toContain(cause.message);-- const missingExitCodeError = yield* captureProcessResult(- Effect.succeed({- stdout: "",- stderr: "",- code: null,- timedOut: false,- stdoutTruncated: false,- stderrTruncated: false,- stdoutInvalidUtf8: false,- stderrInvalidUtf8: false,- }),- );-- expect(missingExitCodeError).toMatchObject({- _tag: "VcsProcessMissingExitCodeError",- operation: baseInput.operation,- command: baseInput.command,- cwd: baseInput.cwd,- argumentCount: baseInput.args.length,- });- expect(missingExitCodeError).not.toHaveProperty("cause");- }),- );-it.effect("truncates output and appends the marker when requested", () =>Effect.gen(function* () {const result = yield* run({diff --git a/apps/server/src/vcs/VcsStatusBroadcaster.test.ts b/apps/server/src/vcs/VcsStatusBroadcaster.test.tsindex e2d394326da..334c0d4747b 100644--- a/apps/server/src/vcs/VcsStatusBroadcaster.test.ts+++ b/apps/server/src/vcs/VcsStatusBroadcaster.test.ts@@ -1,7 +1,6 @@import { SourceControlProviderKind } from "@t3tools/contracts";import { assert, it, describe } from "@effect/vitest";import * as NodeServices from "@effect/platform-node/NodeServices";-import * as Cause from "effect/Cause";import * as Deferred from "effect/Deferred";import * as DateTime from "effect/DateTime";import * as Duration from "effect/Duration";@@ -506,27 +505,6 @@ describe("VcsStatusBroadcaster", () => {}).pipe(Effect.provide(layerTestFor(state)));});- it("summarizes refresh causes without exposing nested failure details", () => {- const nestedCause = new Error("private nested failure detail");- const failure = new GitManagerError({- operation: "VcsStatusBroadcaster.remoteStatus",- cwd: "/private/user/workspace/repo",- detail: "private Git failure detail",- cause: nestedCause,- });- const cause = Cause.combine(Cause.fail(failure), Cause.die(new TypeError("private defect")));-- assert.deepStrictEqual(VcsStatusBroadcaster.remoteRefreshFailureDiagnostics(cause), {- reasonCount: 2,- failureCount: 1,- failureTags: ["GitManagerError"],- failureOperations: ["VcsStatusBroadcaster.remoteStatus"],- defectCount: 1,- defectTags: ["TypeError"],- interruptionCount: 0,- });- });-it.effect("releases remote demand while passive observers remain", () => {const state = {currentLocalStatus: baseLocalStatus,diff --git a/apps/server/src/vcs/VcsStatusBroadcaster.ts b/apps/server/src/vcs/VcsStatusBroadcaster.tsindex f91dc3cf1b7..41859b9dd90 100644--- a/apps/server/src/vcs/VcsStatusBroadcaster.ts+++ b/apps/server/src/vcs/VcsStatusBroadcaster.ts@@ -86,7 +86,7 @@ function addUniqueDiagnosticValue(values: Array<string>, value: string | undefin}}-export function remoteRefreshFailureDiagnostics(cause: Cause.Cause<unknown>) {+function remoteRefreshFailureDiagnostics(cause: Cause.Cause<unknown>) {const failureTags: Array<string> = [];const failureOperations: Array<string> = [];const defectTags: Array<string> = [];diff --git a/apps/server/src/workspace/WorkspaceEntries.test.ts b/apps/server/src/workspace/WorkspaceEntries.test.tsindex 619f5da5289..150ac2c6913 100644--- a/apps/server/src/workspace/WorkspaceEntries.test.ts+++ b/apps/server/src/workspace/WorkspaceEntries.test.ts@@ -548,26 +548,6 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceEntries", (it) => {}),);- it.effect("preserves invalid regex errors during case-insensitive searches", () =>- Effect.gen(function* () {- const cwd = yield* makeTempDir({ prefix: "t3code-workspace-content-invalid-regex-" });- yield* writeTextFile(cwd, "src/shapes.ts", "foobar\n");-- const workspaceEntries = yield* WorkspaceEntries.WorkspaceEntries;- const result = yield* workspaceEntries.searchContents({- cwd,- query: "foo)bar(",- limit: 100,- caseSensitive: false,- wholeWord: false,- useRegex: true,- });-- expect(result.regexFallbackError).toBeDefined();- expect(result.matches).toEqual([]);- }),- );-it.effect("maps multi-byte lines to string-indexed ranges", () =>Effect.gen(function* () {const cwd = yield* makeTempDir({ prefix: "t3code-workspace-content-multibyte-" });diff --git a/apps/server/src/workspace/WorkspacePaths.test.ts b/apps/server/src/workspace/WorkspacePaths.test.tsindex a281fc20a52..574904b3435 100644--- a/apps/server/src/workspace/WorkspacePaths.test.ts+++ b/apps/server/src/workspace/WorkspacePaths.test.ts@@ -4,7 +4,6 @@ import * as Effect from "effect/Effect";import * as FileSystem from "effect/FileSystem";import * as Layer from "effect/Layer";import * as Path from "effect/Path";-import * as PlatformError from "effect/PlatformError";import * as WorkspacePaths from "./WorkspacePaths.ts";@@ -39,39 +38,6 @@ it.layer(layerTest)("WorkspacePathsLive", (it) => {expect(stat.type).toBe("Directory");}),);-- it.effect("preserves non-NotFound stat failures while validating the root", () =>- Effect.gen(function* () {- const fileSystem = yield* FileSystem.FileSystem;- const workspacePaths = yield* WorkspacePaths.make.pipe(- Effect.provideService(FileSystem.FileSystem, {- ...fileSystem,- stat: (path) =>- Effect.fail(- PlatformError.systemError({- _tag: "PermissionDenied",- module: "FileSystem",- method: "stat",- pathOrDescriptor: String(path),- description: "Test PermissionDenied stat failure.",- }),- ),- }),- );- const path = yield* Path.Path;- const workspaceRoot = " ./permission-denied ";- const normalizedWorkspaceRoot = path.resolve(workspaceRoot.trim());-- const error = yield* workspacePaths.normalizeWorkspaceRoot(workspaceRoot).pipe(Effect.flip);-- expect(error).toBeInstanceOf(WorkspacePaths.WorkspaceRootStatFailedError);- expect(error).toMatchObject({- workspaceRoot,- normalizedWorkspaceRoot,- phase: "validate-existing",- });- }),- );});describe("resolveRelativePathWithinRoot", () => {diff --git a/apps/server/src/workspace/WorkspacePaths.ts b/apps/server/src/workspace/WorkspacePaths.tsindex 2c61bbe7650..6b748e19396 100644--- a/apps/server/src/workspace/WorkspacePaths.ts+++ b/apps/server/src/workspace/WorkspacePaths.ts@@ -107,7 +107,7 @@ function toPosixRelativePath(input: string): string {return input.replaceAll("\\", "/");}-export const make = Effect.gen(function* () {+const make = Effect.gen(function* () {const fileSystem = yield* FileSystem.FileSystem;const path = yield* Path.Path;diff --git a/apps/server/src/workspace/WorkspaceSearchIndex.test.ts b/apps/server/src/workspace/WorkspaceSearchIndex.test.tsindex bb2ca65351b..2c41e4ed0b3 100644--- a/apps/server/src/workspace/WorkspaceSearchIndex.test.ts+++ b/apps/server/src/workspace/WorkspaceSearchIndex.test.ts@@ -63,71 +63,6 @@ it.effect("filters image searches before applying the result limit", () =>),);-it.effect("preserves search and refresh failures with operation context", () =>- Effect.scoped(- Effect.gen(function* () {- const searchCause = new Error("native search failed");- const refreshCause = new Error("native scan failed");- const contentSearchCause = new Error("native grep failed");- const finder = {- destroy: vi.fn(),- waitForIndexReady: vi.fn(async () => ({ ok: true as const, value: true })),- mixedSearch: vi.fn(() => {- throw searchCause;- }),- grep: vi.fn(() => {- throw contentSearchCause;- }),- scanFiles: vi.fn(() => {- throw refreshCause;- }),- } as unknown as FileFinder;- vi.spyOn(FileFinder, "create").mockReturnValueOnce({ ok: true, value: finder });-- const searchIndex = yield* WorkspaceSearchIndex.make("/workspace/project");- const query = "authorization: Bearer secret-token";- const searchError = yield* Effect.flip(searchIndex.search(query, 3));- const contentSearchError = yield* Effect.flip(- searchIndex.searchContents({- query,- limit: 3,- caseSensitive: false,- wholeWord: false,- useRegex: false,- }),- );- const refreshError = yield* Effect.flip(searchIndex.refresh());-- expect(searchError).toMatchObject({- _tag: "WorkspaceSearchIndexSearchFailed",- cwd: "/workspace/project",- queryLength: query.length,- pageSize: 4,- reason: "FileFinder.mixedSearch threw unexpectedly.",- cause: searchCause,- });- expect(searchError).not.toHaveProperty("query");- expect(searchError.message).not.toMatch(/Bearer|secret-token/);- expect(contentSearchError).toMatchObject({- _tag: "WorkspaceSearchIndexSearchFailed",- cwd: "/workspace/project",- queryLength: query.length,- pageSize: 3,- reason: "FileFinder.grep threw unexpectedly.",- cause: contentSearchCause,- });- expect(contentSearchError).not.toHaveProperty("query");- expect(contentSearchError.message).not.toMatch(/Bearer|secret-token/);- expect(refreshError).toMatchObject({- _tag: "WorkspaceSearchIndexRefreshFailed",- cwd: "/workspace/project",- reason: "FileFinder.scanFiles threw unexpectedly.",- cause: refreshCause,- });- }),- ),-);-it.effect("continues whole-word searches after a filtered grep page", () =>Effect.scoped(Effect.gen(function* () {