Public: anyone can read this; the crew can change it.

The type check refuses unused imports and locals: `noUnusedLocals` is on in tsconfig.json and test/ is clean #4774

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/4741-the-type-check-refuses-unused-imports-an → main 2 commits fork

  • Merged. mason/4741-the-type-check-refuses-unused-imports-an was merged into main as 977514d.

Review

Sign in to review this change.
44 files changed +28 −131
CLAUDE.md +1 −1
@@ -60,7 +60,7 @@ canAdmin`), token scope (`readForm` floor + `minScope`), and branch
6060
6161 ```sh
6262 bun test # full suite — must stay green
63 bun x tsc --noEmit # zero type errors is the standard (strict, exact-optional)
63 bun x tsc --noEmit # zero type errors is the standard (strict, exact-optional; an unused import or local fails it)
6464 bun run src/main.ts # boots on :3000, data in ./data
6565 ```
6666
src/ssh/server.ts +1 −1
@@ -75,7 +75,7 @@ class Connection {
7575 constructor(
7676 private readonly socket: Socket,
7777 private readonly options: SshServerOptions,
78 private readonly hostKey: ReturnType<typeof loadOrCreateHostKey>,
78 hostKey: ReturnType<typeof loadOrCreateHostKey>,
7979 private readonly onGone: (connection: Connection) => void,
8080 ) {
8181 const log = options.log;
test/apps-adversarial-grants.test.ts +1 −1
@@ -11,7 +11,7 @@ import { tmpdir } from "node:os";
1111 import { join } from "node:path";
1212 import { createApp, type App } from "../src/app.ts";
1313 import { AppsRuntime } from "../src/apps/runtime.ts";
14 import { parseAppHost, signGrant, verifyGrant } from "../src/apps/proxy.ts";
14 import { signGrant, verifyGrant } from "../src/apps/proxy.ts";
1515 import { newApp, updateAppSettings, type NewAppResult } from "../src/actions/apps.ts";
1616 import { listRuns, type Run } from "../src/core/runs.ts";
1717 import { createUser, type User } from "../src/core/users.ts";
test/apps-adversarial.test.ts −23
@@ -60,33 +60,10 @@ import {
6060 runLogListenerCount,
6161 subscribeRunLog,
6262 } from "../src/runs/log.ts";
63 import { gitClientEnv } from "./helpers/git-client.ts";
6463 import { portInsteadOfSocket } from "../src/git/hook-address.ts";
6564
6665 const testBySocket = portInsteadOfSocket() ? test.skip : test;
6766
68 const clientEnv = gitClientEnv({
69 GIT_AUTHOR_NAME: "Agent",
70 GIT_AUTHOR_EMAIL: "[email protected]",
71 GIT_COMMITTER_NAME: "Agent",
72 GIT_COMMITTER_EMAIL: "[email protected]",
73 });
74
75 async function sh(args: string[], cwd: string) {
76 const proc = Bun.spawn(args, {
77 cwd,
78 env: clientEnv,
79 stdout: "pipe",
80 stderr: "pipe",
81 });
82 const [out, err, code] = await Promise.all([
83 new Response(proc.stdout).text(),
84 new Response(proc.stderr).text(),
85 proc.exited,
86 ]);
87 return { code, out: out.trim(), err: err.trim() };
88 }
89
9067 // ---------------------------------------------------------------------------
9168 // Pure units: no server, no filesystem beyond what the function itself does.
9269 // ---------------------------------------------------------------------------
test/apps-identity.test.ts +1 −1
@@ -17,7 +17,7 @@ import { listEvents } from "../src/core/events.ts";
1717 import type { Repo } from "../src/core/repos.ts";
1818 import type { Run } from "../src/core/runs.ts";
1919 import type { User } from "../src/core/users.ts";
20 import { serve, type Servers } from "../src/http/server.ts";
20 import type { Servers } from "../src/http/server.ts";
2121
2222 import { identityKey } from "../src/apps/proxy.ts";
2323 /** The scaffold's suites that boot its real `serve`: a test that swaps in a toy server drops them. */
test/apps-open-host.test.ts +1 −8
@@ -12,13 +12,10 @@ import { mkdtemp, rm } from "node:fs/promises";
1212 import { tmpdir } from "node:os";
1313 import { join } from "node:path";
1414 import { createApp, type App } from "../src/app.ts";
15 import { newApp, updateAppSettings } from "../src/actions/apps.ts";
15 import { newApp } from "../src/actions/apps.ts";
1616 import { AppsRuntime } from "../src/apps/runtime.ts";
17 import { createToken } from "../src/core/tokens.ts";
1817 import { createUser, type User } from "../src/core/users.ts";
1918 import { serve, type Servers } from "../src/http/server.ts";
20 import type { Repo } from "../src/core/repos.ts";
21 import type { AppRecord } from "../src/core/apps.ts";
2219 import { quietLogs } from "./helpers/globals.ts";
2320
2421 quietLogs();
@@ -31,8 +28,6 @@ describe("/apps/open sends a grant only to a host that reads one way", () => {
3128 let servers: Servers;
3229 let runtime: AppsRuntime;
3330 let alice: User;
34 let repo: Repo;
35 let record: AppRecord;
3631 let aliceCookie = "";
3732
3833 const signIn = async (username: string): Promise<string> => {
@@ -72,8 +67,6 @@ describe("/apps/open sends a grant only to a host that reads one way", () => {
7267 visibility: "public",
7368 });
7469 if (!made.ok) throw new Error(String(made.error));
75 repo = made.value.repo;
76 record = made.value.app;
7770 }, 120_000);
7871
7972 afterAll(async () => {
test/apps-slow-test.test.ts −1
@@ -7,7 +7,6 @@
77 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
88 import type { App } from "../src/app.ts";
99 import { AppsRuntime } from "../src/apps/runtime.ts";
10 import { seconds } from "../src/apps/timing.ts";
1110 import { mergePull, openPull } from "../src/actions/pulls.ts";
1211 import { commitToBranch } from "../src/actions/repos.ts";
1312 import type { AppRecord } from "../src/core/apps.ts";
test/apps.test.ts −1
@@ -49,7 +49,6 @@ import { createUser, type User } from "../src/core/users.ts";
4949 import { serve, type Servers } from "../src/http/server.ts";
5050 import { readRunLog } from "../src/runs/log.ts";
5151 import { grantedCookie } from "./helpers/identity.ts";
52 import { identityKey } from "../src/apps/proxy.ts";
5352 import {
5453 APPS_DOMAIN,
5554 deploySettled,
test/asks.test.ts −4
@@ -18,15 +18,11 @@ import { createIssue } from "../src/core/issues.ts";
1818 import type { Repo } from "../src/core/repos.ts";
1919 import { claimRun, createRun, finishRun } from "../src/core/runs.ts";
2020 import { getUserByName } from "../src/core/users.ts";
21 import { markVerified } from "../src/core/verify.ts";
2221 import type { Ctx } from "../src/http/context.ts";
2322 import { serve, type Servers } from "../src/http/server.ts";
2423 import { setCapacity, storedCapacity } from "../src/core/capacity.ts";
25 import { createOrigin } from "../src/core/origins.ts";
26 import { hunt } from "../src/crew/sentinel.ts";
2724 import { decisionsFor } from "../src/web/studio/asks.ts";
2825 import { quietLogs } from "./helpers/globals.ts";
29 import { promote } from "./helpers/members.ts";
3026 import { adminCookie } from "./helpers/admin.ts";
3127
3228 quietLogs();
test/chain-timing.test.ts +1 −1
@@ -1,5 +1,5 @@
11 /** `/:owner/:name/following` names session, repo, chain, parent, upstream and render in Server-Timing (#3461). */
2 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
2 import { afterAll, beforeAll, expect, test } from "bun:test";
33 import { mkdtemp, rm } from "node:fs/promises";
44 import { tmpdir } from "node:os";
55 import { join } from "node:path";
test/crew-check-failed.test.ts +2 −8
@@ -7,14 +7,12 @@
77 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
88 import { readFileSync } from "node:fs";
99 import type { App } from "../src/app.ts";
10 import type { Repo } from "../src/core/repos.ts";
1110 import type { User } from "../src/core/users.ts";
1211 import { addToCrew } from "../src/actions/crew.ts";
1312 import { assignIssue, openIssue } from "../src/actions/issues.ts";
1413 import { commitToBranch, createRepo } from "../src/actions/repos.ts";
15 import { listRuns, type Run } from "../src/core/runs.ts";
14 import { listRuns } from "../src/core/runs.ts";
1615 import {
17 agentRunSettled,
1816 startStandInCrew,
1917 stopStandInCrew,
2018 type StandInCrew,
@@ -25,15 +23,11 @@ describe("the crew, with a stand-in Claude Code: a failing check", () => {
2523 let app: App;
2624 let alice: User;
2725 let bot: User;
28 let repo: Repo;
2926 let promptFile: string;
3027
31 const settled = (where: (run: Run) => boolean, timeoutMs?: number) =>
32 agentRunSettled(app, repo, where, timeoutMs);
33
3428 beforeAll(async () => {
3529 standIn = await startStandInCrew({ tickMs: 50 });
36 ({ app, alice, bot, repo, promptFile } = standIn);
30 ({ app, alice, bot, promptFile } = standIn);
3731 }, 30_000);
3832
3933 afterAll(() => stopStandInCrew(standIn));
test/crew-direction-autonomy.test.ts −1
@@ -62,7 +62,6 @@ import {
6262 import { struckOut } from "../src/crew/parks.ts";
6363 import { serve, type Servers } from "../src/http/server.ts";
6464 import { mapJson, marksFor } from "../src/web/pages/map.ts";
65 import { listEvents } from "../src/core/events.ts";
6665 import { quietLogs } from "./helpers/globals.ts";
6766 import { promote } from "./helpers/members.ts";
6867
test/crew-direction-cap.test.ts −1
@@ -28,7 +28,6 @@ describe("the direction is paced, not capped", () => {
2828 let repo: Repo;
2929 let direction: Issue;
3030 const fresh = () => getRepoById(app.db, repo.id)!;
31 const hour = 60 * 60_000;
3231
3332 /** A finished planning pass, `ago` ms before now. */
3433 function pass(ago: number, state: "ok" | "failed" = "ok"): void {
test/crew-early.test.ts +1 −3
@@ -17,7 +17,6 @@ import {
1717 setIssueState,
1818 } from "../src/actions/issues.ts";
1919 import { pullOfBranch, watchForPull } from "../src/crew/early.ts";
20 import type { CrewHandle } from "../src/crew/dispatch.ts";
2120 import { resolveOid } from "../src/git/merge.ts";
2221 import { abortAgentRun } from "../src/crew/running.ts";
2322 import { getAgentByName } from "../src/core/agents.ts";
@@ -39,7 +38,6 @@ describe("the crew, with a stand-in Claude Code: the early pull", () => {
3938 let standIn: StandInCrew;
4039 let dataDir: string;
4140 let app: App;
42 let crew: CrewHandle;
4341 let alice: User;
4442 let bot: User;
4543 let repo: Repo;
@@ -49,7 +47,7 @@ describe("the crew, with a stand-in Claude Code: the early pull", () => {
4947
5048 beforeAll(async () => {
5149 standIn = await startStandInCrew();
52 ({ dataDir, app, crew, alice, bot, repo } = standIn);
50 ({ dataDir, app, alice, bot, repo } = standIn);
5351 }, 30_000);
5452
5553 afterAll(() => stopStandInCrew(standIn));
test/decide.test.ts +1 −4
@@ -11,13 +11,10 @@ import { join } from "node:path";
1111 import { createApp, type App } from "../src/app.ts";
1212 import { addToCrew, createAgent } from "../src/actions/crew.ts";
1313 import { openIssue } from "../src/actions/issues.ts";
14 import { openPull } from "../src/actions/pulls.ts";
15 import { commitToBranch, createRepo } from "../src/actions/repos.ts";
14 import { createRepo } from "../src/actions/repos.ts";
1615 import { listCrewRoles, setCrewRole } from "../src/core/agents.ts";
1716 import { getIssueById } from "../src/core/issues.ts";
18 import type { Pull } from "../src/core/pulls.ts";
1917 import type { Repo } from "../src/core/repos.ts";
20 import { claimRun, createRun, finishRun } from "../src/core/runs.ts";
2118 import { createUser, getUserByName, type User } from "../src/core/users.ts";
2219 import {
2320 certain,
test/edit-words.test.ts +1 −1
@@ -23,7 +23,7 @@ import { commitToBranch, createRepo } from "../src/actions/repos.ts";
2323 import { createApp, type App } from "../src/app.ts";
2424 import { listEvents } from "../src/core/events.ts";
2525 import { getIssueById, type Issue } from "../src/core/issues.ts";
26 import { getPull, openPullsClosing, type Pull } from "../src/core/pulls.ts";
26 import { openPullsClosing, type Pull } from "../src/core/pulls.ts";
2727 import type { Repo } from "../src/core/repos.ts";
2828 import { submitReview } from "../src/core/reviews.ts";
2929 import { createToken } from "../src/core/tokens.ts";
test/file-modes.test.ts +1 −1
@@ -1,6 +1,6 @@
11 /** Host keys and database files are 0600; too-open ones are refused or named (#3025). */
22
3 import { afterAll, beforeAll, expect, test } from "bun:test";
3 import { afterAll, expect, test } from "bun:test";
44 import { chmodSync, mkdtempSync, rmSync, statSync, writeFileSync } from "node:fs";
55 import { tmpdir } from "node:os";
66 import { join } from "node:path";
test/finishing.test.ts +1 −2
@@ -16,7 +16,7 @@ import { commitToBranch, createRepo } from "../src/actions/repos.ts";
1616 import { setCrewRole } from "../src/core/agents.ts";
1717 import { getIssueById, listComments, type Issue } from "../src/core/issues.ts";
1818 import type { Pull } from "../src/core/pulls.ts";
19 import { getRepoById, type Repo } from "../src/core/repos.ts";
19 import type { Repo } from "../src/core/repos.ts";
2020 import { submitReview } from "../src/core/reviews.ts";
2121 import { claimRun, finishRun, listRuns } from "../src/core/runs.ts";
2222 import { createUser, getUserByName, type User } from "../src/core/users.ts";
@@ -33,7 +33,6 @@ let mason: User;
3333 let repo: Repo;
3434 let pull: Pull;
3535 let ready: Issue;
36 const fresh = () => getRepoById(app.db, repo.id)!;
3736 const conflicts = () =>
3837 listRuns(app.db, repo.id, { kind: "agent" }).filter((r) => r.issueId === pull.id && r.reason === "conflict");
3938 const picked = () => listRuns(app.db, repo.id, { kind: "agent" }).filter((r) => r.issueId === ready.id);
test/following.test.ts −1
@@ -24,7 +24,6 @@ import { mergePull, openPull } from "../src/actions/pulls.ts";
2424 import { commitToBranch, createRepo, forkRepo } from "../src/actions/repos.ts";
2525 import { relationOf, takeUpdates } from "../src/actions/forks.ts";
2626 import {
27 convergeFork,
2827 convergeState,
2928 convergeTitle,
3029 followDivergence,
test/front.test.ts +1 −1
@@ -569,7 +569,7 @@ describe("the front page", () => {
569569 });
570570
571571 test("never a letter tile: a pin without a stranger's picture, or one that is down, waits; the sweep wakes a pinned app asleep to picture it", async () => {
572 const bare = await make(admin, "pinned-bare", { picture: false });
572 await make(admin, "pinned-bare", { picture: false });
573573 const down = await make(admin, "pinned-down");
574574 states.set(down.record.id, "failed");
575575 const sleepy = await make(admin, "pinned-sleepy", { picture: false });
test/hand-decider.test.ts +1 −1
@@ -329,7 +329,7 @@ describe("let the decider answer a hand-over", () => {
329329 test("the terminal's door: a parked row is on the On you card, D hands it over, U takes it back", async () => {
330330 app.config.decider = standIn;
331331 says = 0.9;
332 const issue = parked("tui card");
332 parked("tui card");
333333 const terminal = headlessTerminal(140, 40);
334334 const { app: ui } = createForgeApp(
335335 app,
test/looks.test.ts +3 −3
@@ -22,13 +22,13 @@ import { commitToBranch, createRepo } from "../src/actions/repos.ts";
2222 import { envDataDir, previewEnv } from "../src/apps/data.ts";
2323 import { readGrant } from "../src/apps/proxy.ts";
2424 import { AppsRuntime } from "../src/apps/runtime.ts";
25 import { getAppByRepo, type AppRecord } from "../src/core/apps.ts";
25 import type { AppRecord } from "../src/core/apps.ts";
2626 import { listEvents } from "../src/core/events.ts";
2727 import { lookSlot, lookUrl, looksForEnv, recordLook, type Look } from "../src/core/looks.ts";
2828 import { decodePng, encodePng } from "../src/design/image/png.ts";
2929 import { setAppMembers } from "../src/core/app_members.ts";
30 import { listPulls, type Pull } from "../src/core/pulls.ts";
31 import { getRepo, type Repo } from "../src/core/repos.ts";
30 import type { Pull } from "../src/core/pulls.ts";
31 import type { Repo } from "../src/core/repos.ts";
3232 import { createRun, listRuns, type Run } from "../src/core/runs.ts";
3333 import { readLooks } from "../src/checks/looks.ts";
3434 import { vitalsRows } from "../src/checks/summary.ts";
test/mcp-upstream.test.ts −2
@@ -73,8 +73,6 @@ describe("MCP proposes to the parent forge and lists proposals", () => {
7373 return opened.value;
7474 };
7575
76 const forgeCount = (): number =>
77 child.db.query<{ n: number }, []>("SELECT COUNT(*) AS n FROM upstream_proposal").get()!.n;
7876 const parentPull = (number: number) => getPull(parent.db, lib.id, number)!;
7977
8078 beforeAll(async () => {
test/og-png.test.ts −2
@@ -184,7 +184,6 @@ describe("og cards with a look", () => {
184184 let servers: Servers;
185185 let base: string;
186186 let appId = "";
187 let owner: { id: string };
188187
189188 /** A 1280×800 page-like picture: bands and blocks, so it compresses as a screenshot does. */
190189 const screenshot = (hue: number): Uint8Array => {
@@ -224,7 +223,6 @@ describe("og cards with a look", () => {
224223 adminIfFirst: true,
225224 });
226225 if (!u.ok) throw new Error(u.error);
227 owner = u.value;
228226 const made = await createRepo(app, u.value, { name: "peek", visibility: "public" });
229227 if (!made.ok) throw new Error(String(made.error));
230228 const rec = createApp(app.db, { repoId: made.value.id, slug: "peek-app", access: "public" });
test/onboarding.test.ts +1 −2
@@ -195,7 +195,6 @@ describe("a forge booted from a relative data dir still accepts pushes", () => {
195195 let app: App;
196196 let servers: Servers;
197197 let port = 0;
198 let cookie = "";
199198
200199 async function git(args: string[], cwd: string): Promise<number> {
201200 const p = Bun.spawn(["git", ...args], {
@@ -218,7 +217,7 @@ describe("a forge booted from a relative data dir still accepts pushes", () => {
218217 app = createApp({ dataDir, port: 0 });
219218 servers = await serve(app);
220219 port = servers.port;
221 cookie = await adminCookie(app, {
220 await adminCookie(app, {
222221 username: "rel",
223222 email: "[email protected]",
224223 password: "rel-secret",
test/preview-spec.test.ts +1 −1
@@ -6,7 +6,7 @@ import { tmpdir } from "node:os";
66 import { join } from "node:path";
77 import { createApp, type App } from "../src/app.ts";
88 import { AppsRuntime } from "../src/apps/runtime.ts";
9 import { checkPreview, previewSpec } from "../src/apps/preview_spec.ts";
9 import { previewSpec } from "../src/apps/preview_spec.ts";
1010 import { newApp } from "../src/actions/apps.ts";
1111 import { openPull } from "../src/actions/pulls.ts";
1212 import { commitToBranch } from "../src/actions/repos.ts";
test/probes.test.ts +1 −1
@@ -21,7 +21,7 @@ import {
2121 untilNightly,
2222 type ProbesHandle,
2323 } from "../src/contract/probes.ts";
24 import { getAppByRepo, type AppRecord } from "../src/core/apps.ts";
24 import type { AppRecord } from "../src/core/apps.ts";
2525 import { listIssues } from "../src/core/issues.ts";
2626 import { getRepoById, type Repo } from "../src/core/repos.ts";
2727 import { listRuns } from "../src/core/runs.ts";
test/pull-variants.test.ts −24
@@ -48,30 +48,6 @@ describe("a pull says its variant group and siblings", () => {
4848 ...init,
4949 headers: { ...auth, "content-type": "application/json" },
5050 })).json() as Promise<any>;
51 const mcp = async (name: string, args: unknown, as?: string) => {
52 const res = await fetch(`${base}/mcp`, {
53 method: "POST",
54 headers: {
55 "content-type": "application/json",
56 accept: "application/json, text/event-stream",
57 ...auth,
58 ...(as ? { authorization: `Bearer ${as}` } : {}),
59 },
60 body: JSON.stringify({
61 jsonrpc: "2.0",
62 id: 1,
63 method: "tools/call",
64 params: { name, arguments: args },
65 }),
66 });
67 const body = (await res.json()) as any;
68 const text = body.result.content[0].text as string;
69 try {
70 return JSON.parse(text);
71 } catch {
72 return { error: text };
73 }
74 };
7551 const write = async (text: string, message: string) => {
7652 await Bun.write(join(dir, "code.txt"), text);
7753 await gitOk(["commit", "-am", message]);
test/quotas-running.test.ts +2 −2
@@ -7,7 +7,7 @@
77 * for a named state or a flag file, never a guess at timing.
88 */
99
10 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
10 import { describe, expect, test } from "bun:test";
1111 import { chmodSync, existsSync, writeFileSync } from "node:fs";
1212 import { mkdtemp, rm } from "node:fs/promises";
1313 import { tmpdir } from "node:os";
@@ -25,7 +25,7 @@ import { getRepo, type Repo } from "../src/core/repos.ts";
2525 import { createRun, listRuns, type Run } from "../src/core/runs.ts";
2626 import { createUser, type User } from "../src/core/users.ts";
2727 import { startCrew } from "../src/crew/dispatch.ts";
28 import { serve, type Servers } from "../src/http/server.ts";
28 import { serve } from "../src/http/server.ts";
2929 import { readRunLog } from "../src/runs/log.ts";
3030 import { QUOTA_KEYS, getQuota, runningLimitSentence, setQuota } from "../src/settings/quotas.ts";
3131 import { promote } from "./helpers/members.ts";
test/review-page.test.ts +1 −1
@@ -9,7 +9,7 @@ import { addComment as addRawComment } from "../src/core/issues.ts";
99 import { addCrew, createAgentRow, setCrewRole } from "../src/core/agents.ts";
1010 import { createRepo as createRepoRow } from "../src/core/repos.ts";
1111 import { submitReview } from "../src/core/reviews.ts";
12 import { createUser, getUserByName } from "../src/core/users.ts";
12 import { createUser } from "../src/core/users.ts";
1313 import { BREAKER_NOTE } from "../src/crew/breaker.ts";
1414 import { serve, type Servers } from "../src/http/server.ts";
1515 import { id } from "../src/kernel/id.ts";
test/sentinel.test.ts −3
@@ -7,7 +7,6 @@ import { afterAll, beforeAll, describe, expect, test } from "bun:test";
77 import { mkdtemp, rm } from "node:fs/promises";
88 import { tmpdir } from "node:os";
99 import { join } from "node:path";
10 import keptIsAPersons from "../src/core/migrations/20261016120000-kept-is-a-person-s.ts";
1110 import { quietLogs } from "./helpers/globals.ts";
1211 import { createApp, type App } from "../src/app.ts";
1312 import { createRepo } from "../src/actions/repos.ts";
@@ -764,7 +763,6 @@ describe("a degraded incident whose issue closed as done", () => {
764763 describe("a degraded finding whose cause has stayed closed", () => {
765764 let hdir: string;
766765 let happ: App;
767 let hrepo: Repo;
768766 let halice: User;
769767 const T0 = Date.parse("2026-10-18T12:00:00.000Z");
770768 const plant = (cause: string, closedAt: number): void => {
@@ -782,7 +780,6 @@ describe("a degraded finding whose cause has stayed closed", () => {
782780 halice = a.value;
783781 const made = await createRepo(happ, halice, { name: "forge", visibility: "private" });
784782 if (!made.ok) throw new Error(String(made.error));
785 hrepo = made.value;
786783 // Two incidents, both closed at T0; one will get a person's comment.
787784 plant("drill", T0);
788785 plant("disk", T0);
test/share.test.ts −2
@@ -35,7 +35,6 @@ describe("share", () => {
3535 let alice: User;
3636 let bob: User;
3737 let carol: User;
38 let bot: User;
3938 let aliceToken: string;
4039 let open: Repo;
4140 let secret: Repo;
@@ -71,7 +70,6 @@ describe("share", () => {
7170 carol = await mk("carol");
7271 const made = await createAgent(app, root, { username: "bot", brief: "Be brief." });
7372 if (!made.ok) throw new Error(String(made.error));
74 bot = made.value.user;
7573 aliceToken = createToken(app.db, alice.id, "t", "rw").token;
7674 const o = await createRepo(app, alice, { name: "open", visibility: "public" });
7775 const s = await createRepo(app, alice, { name: "secret", visibility: "private" });
test/signin-password-doors.test.ts −3
@@ -19,20 +19,17 @@ const PASSWORD = "a-long-family-passphrase";
1919 const TRIES = 3;
2020
2121 let dir = "";
22 let app: App | undefined;
2322 let servers: Servers | undefined;
2423
2524 afterEach(async () => {
2625 servers?.stop();
2726 servers = undefined;
28 app = undefined;
2927 await rm(dir, { recursive: true, force: true });
3028 });
3129
3230 async function forge(): Promise<{ app: App; url: string }> {
3331 dir = await mkdtemp(join(tmpdir(), "signin-doors-"));
3432 const made = createApp({ dataDir: dir, port: 0 });
35 app = made;
3633 servers = await serve(made);
3734 const pat = await seedAdmin(made, { username: "pat", email: "[email protected]", password: PASSWORD });
3835 if (!pat.ok) throw new Error("setup");
test/signins.test.ts +1 −1
@@ -273,7 +273,7 @@ describe("sign-ins: tokens and browsers, seen and ended", () => {
273273 // `DELETE /api/v1/users/:username/tokens/:id`; this pull adds the browsers.
274274 test("the owner does the same over the API, with an admin token", async () => {
275275 const ownerToken = createToken(app.db, owner.id, "o", "admin").token;
276 const token = createToken(app.db, bo.id, "phone", "ro");
276 createToken(app.db, bo.id, "phone", "ro");
277277 const browser = cookieFor(bo);
278278 const seen = (await (await api("/api/v1/users/bo/signins", ownerToken)).json()) as {
279279 tokens: { id: string; name: string }[];
test/studio-changes.test.ts −7
@@ -49,13 +49,6 @@ describe("the studio, continued", () => {
4949 headers: { cookie: `${cookie}; forge_mode=studio`, ...extra },
5050 redirect: "manual",
5151 });
52 const post = (path: string, body: Record<string, string>, extra = "") =>
53 fetch(`${base}${path}`, {
54 method: "POST",
55 headers: { cookie: `${cookie}${extra}`, origin: base },
56 body: new URLSearchParams(body),
57 redirect: "manual",
58 });
5952
6053 beforeAll(async () => {
6154 dataDir = await mkdtemp(join(tmpdir(), "forge-studio-"));
test/studio-runs.test.ts −1
@@ -57,7 +57,6 @@ import {
5757 } from "../src/web/studio/words.ts";
5858 import { repoDir } from "../src/git/repos.ts";
5959 import { appendRunLog } from "../src/runs/log.ts";
60 import { serving } from "./helpers/studio.ts";
6160
6261 describe("the studio's slot count", () => {
6362 let dataDir: string;
test/studio-search.test.ts −1
@@ -37,7 +37,6 @@ import {
3737 } from "../src/core/runs.ts";
3838 import { createUser, getUserByName, type User } from "../src/core/users.ts";
3939 import { serve, type Servers } from "../src/http/server.ts";
40 import { serving } from "./helpers/studio.ts";
4140 import { promote } from "./helpers/members.ts";
4241
4342 describe("finding things in the studio: /search", () => {
test/studio-shipping.test.ts −3
@@ -29,7 +29,6 @@ import {
2929 updateRepoSettings,
3030 } from "../src/actions/repos.ts";
3131 import { recordDecision } from "../src/core/decisions.ts";
32 import type { Issue } from "../src/core/issues.ts";
3332 import { getPull, mergedPullCount, type Pull } from "../src/core/pulls.ts";
3433 import { getRepo, type Repo } from "../src/core/repos.ts";
3534 import {
@@ -37,7 +36,6 @@ import {
3736 claimRun,
3837 createRun,
3938 finishRun,
40 listRuns,
4139 markServing,
4240 previewLatency,
4341 STOPPED_SUMMARY,
@@ -47,7 +45,6 @@ import { createUser, getUserByName, type User } from "../src/core/users.ts";
4745 import { serve, type Servers } from "../src/http/server.ts";
4846 import { NOBODY_ON_CREW } from "../src/web/studio/words.ts";
4947 import { servedPhrase } from "../src/web/ui.ts";
50 import { serving } from "./helpers/studio.ts";
5148
5249 describe("a stranger sees the app, not the owner's books", () => {
5350 let dataDir: string;
test/studio.test.ts −1
@@ -34,7 +34,6 @@ import {
3434 createRun,
3535 finishRun,
3636 noteRunProgress,
37 type Run,
3837 } from "../src/core/runs.ts";
3938 import { createUser, getUserByName, type User } from "../src/core/users.ts";
4039 import { CHECK_FAILED_LIMIT } from "../src/crew/dispatch.ts";
test/surfaces-adversarial.test.ts −2
@@ -41,7 +41,6 @@ import { adminCookie } from "./helpers/admin.ts";
4141
4242 quietLogs();
4343
44 const words = (html: string): string => html.replace(/\s+/g, " ");
4544
4645 // ============================================================================
4746 // Web
@@ -54,7 +53,6 @@ describe("surfaces adversarial: web", () => {
5453 let base = "";
5554 let alice = "";
5655 let alicePassword = "alice-adversarial-pass";
57 let hello: { id: string; ownerName: string; name: string };
5856
5957 const web = (
6058 cookie: string,
test/system-telemetry.test.ts +1 −1
@@ -382,7 +382,7 @@ describe("telemetry:read: the owner grants it, an agent reads with it, nobody el
382382 app.db.query("UPDATE user SET is_admin = 1 WHERE id = ?1").run(made.value.user.id);
383383 const adminbot = getUserByName(app.db, "zadminbot")!;
384384 expect(adminbot.isAdmin).toBe(true);
385 const token = createToken(app.db, adminbot.id, "t", "admin").token;
385 createToken(app.db, adminbot.id, "t", "admin");
386386 const flowCommand = () => {
387387 const ctx = { push: () => {}, pop: () => {}, toast: () => {} } as unknown as Ctx;
388388 const session = new Session(app, { sshUsername: "zadminbot", remoteAddress: "127.0.0.1", fingerprint: "SHA256:t", user: adminbot });
test/tui-widgets.test.ts +1 −1
@@ -4,7 +4,7 @@ import { chord, binding, matches } from "../src/tui/app/keys.ts";
44 import { rank, score } from "../src/tui/app/palette.ts";
55 import type { KeyEvent } from "../src/tui/term/input.ts";
66 import { Screen } from "../src/tui/term/screen.ts";
7 import { PLAIN, style, UNDERLINE } from "../src/tui/term/style.ts";
7 import { style, UNDERLINE } from "../src/tui/term/style.ts";
88 import { renderDiff, renderFileDiff } from "../src/tui/ui/diff.ts";
99 import {
1010 center,
test/view-source.test.ts −1
@@ -15,7 +15,6 @@ import {
1515 } from "../src/view/cache.ts";
1616 import { sourceFor, type RepoSource } from "../src/view/source.ts";
1717 import {
18 mirrorAndWait,
1918 newFakeState,
2019 serveFakeForge,
2120 type FakeForge,
tsconfig.json +1
@@ -12,6 +12,7 @@
1212 "exactOptionalPropertyTypes": true,
1313 "noFallthroughCasesInSwitch": true,
1414 "noImplicitOverride": true,
15 "noUnusedLocals": true,
1516 "verbatimModuleSyntax": true,
1617 "skipLibCheck": true,
1718 "noEmit": true

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs