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

Dead code in src/core: delete eleven exports nothing calls, and prune the allow list (#16269) #16503

opened this From outside

Check · Review · Land · Live — The access wall holds it for a person to decide: a trusted source's pull touches a path a trusted source's work may not change alone. Allow it (merge) or send it back. Next: person, the access wall holds it for a person to decide: a trusted source's pull touches a path a trusted source's work may not change alone. Allow it (merge) or send it back.

Green for 3 days, not landed: it waits for a person: the access wall holds it for a person to decide: a trusted source's pull touches a path a trusted source's work may not change alone. Allow it (merge) or send it back. To unblock: a person who writes the repository merges it or requests changes.

Ready to land

grokbot/forge:fix/16269-dead-exports-core → main 104 commits fork

Combined with main

The preview is built from combined/16503 (f2855a8915): main merged into this pull's head. Merging lands that branch.

The checks line says which commit the check ran on.

Review

Sign in to review this change.
11 files changed +0 −68
scripts/unused-exports-allow.json −13
@@ -26,39 +26,26 @@
2626 "src/core/accounts.ts edgeOnlyAccounts",
2727 "src/core/capacity.ts provideCpusForTest",
2828 "src/core/credit.ts clearCreditCache",
29 "src/core/device_grants.ts appIdOfSlug",
3029 "src/core/device_grants.ts grantedSlugs",
3130 "src/core/feed_chips.ts noChips",
32 "src/core/fence.ts heldIn",
33 "src/core/idempotency.ts clearInFlight",
3431 "src/core/idempotency.ts resetPruneClock",
35 "src/core/issue_teams.ts teamsAnswered",
3632 "src/core/issues.ts countIssues",
3733 "src/core/issues.ts issueRefKey",
3834 "src/core/issues.ts searchIssuesVisibleTo",
3935 "src/core/ledger_git.ts resetBatchClock",
40 "src/core/looks.ts isLookKind",
41 "src/core/meter.ts PLACEMENTS",
4236 "src/core/oidc.ts rotateKeys",
4337 "src/core/oidc.ts verifyIdToken",
4438 "src/core/parent_releases.ts refreshIdle",
4539 "src/core/pulls.ts mergeReadingsSettled",
4640 "src/core/pulls.ts mergedPullClosingScan",
47 "src/core/pulls.ts pullsForIssues",
4841 "src/core/roles.ts rolesTable",
4942 "src/core/route_timing.ts readTiming",
50 "src/core/sealed.ts sealedById",
5143 "src/core/search.ts grepCount",
5244 "src/core/search.ts grepRepo",
5345 "src/core/sessions.ts sessionUser",
5446 "src/core/signin-window.ts signinKeyCount",
55 "src/core/starts.ts startOfAccount",
56 "src/core/subscriptions.ts listAllGrants",
5747 "src/core/team-metrics.ts keptFigures",
58 "src/core/timers.ts pendingTimers",
5948 "src/core/transfer.ts transfersOf",
60 "src/core/usage.ts USAGE_BY",
61 "src/core/usage.ts USAGE_OUTCOMES",
6249 "src/core/v1_proof.ts useProof",
6350 "src/core/webhooks.ts deliveryBusy",
6451 "src/flow/stuck_pile.ts forgetStuckRepos",
src/core/device_grants.ts −3
@@ -58,6 +58,3 @@ export const grantedSlugs = (db: Database, deviceId: number): string[] =>
5858
5959 export const allAppSlugs = (db: Database): string[] =>
6060 db.query<{ slug: string }, []>("SELECT slug FROM app ORDER BY slug").all().map((r) => r.slug);
61
62 export const appIdOfSlug = (db: Database, slug: string): string | undefined =>
63 db.query<{ id: string }, [string]>("SELECT id FROM app WHERE slug = ?1").get(slug)?.id;
src/core/idempotency.ts
Binary file not shown.
src/core/issue_teams.ts −4
@@ -94,10 +94,6 @@ export function teamVerdicts(
9494 });
9595 }
9696
97 /** Whether every named team has a current verdict on the head (vacuously true with no teams). */
98 export const teamsAnswered = (verdicts: readonly TeamVerdict[]): boolean =>
99 verdicts.every((v) => v.state !== undefined && !v.stale);
100
10197 /**
10298 * The named teams that still hold the pull: each has a crew reviewer on the
10399 * pull's repository and no current approval on its head. A stale approval,
src/core/looks.ts −2
@@ -11,8 +11,6 @@ import { id as newId } from "../kernel/id.ts";
1111 /** The three widths a page is pictured at. */
1212 export type LookKind = "phone" | "narrow" | "desktop" | "thumb";
1313 export const LOOK_KINDS: readonly LookKind[] = ["phone", "narrow", "desktop", "thumb"];
14 export const isLookKind = (value: string): value is LookKind =>
15 (LOOK_KINDS as readonly string[]).includes(value);
1614
1715 /**
1816 * The three sizes a picture is kept at, as a person holds them: a phone, a
src/core/meter.ts −1
@@ -27,7 +27,6 @@ import { defect } from "../kernel/error.ts";
2727
2828 /** Where an environment ran: hardware the operator owns, or a cloud's. */
2929 export type Placement = "owned" | "cloud";
30 export const PLACEMENTS: readonly Placement[] = ["owned", "cloud"];
3130
3231 /** How long one storage sample stands for, in milliseconds. */
3332 export const SAMPLE_SPAN_MS = 3_600_000;
src/core/pulls.ts −8
@@ -749,14 +749,6 @@ export function mergedPullCount(
749749 return row?.n ?? 0;
750750 }
751751
752 /** The pull rows for a page of issues, keyed by issue id. */
753 export function pullsForIssues(
754 db: Database,
755 issues: readonly Issue[],
756 ): Map<string, Pull> {
757 return new Map(joinMany(db, issues).map((pull) => [pull.id, pull]));
758 }
759
760752 /**
761753 * Which of these pull numbers have landed.
762754 *
src/core/sealed.ts −5
@@ -85,11 +85,6 @@ export function sealedRowById(
8585 return row ? { sealed: row.sealed === 1, authorId: row.author_id } : undefined;
8686 }
8787
88 /** Whether the issue `issueId` is sealed. */
89 export function sealedById(db: Database, issueId: string): boolean {
90 return sealedRowById(db, issueId)?.sealed === true;
91 }
92
9388 /** Issue `number` in `repoId` as `mayView` reads it. */
9489 export function sealedRowByNumber(
9590 db: Database,
src/core/subscriptions.ts −15
@@ -481,21 +481,6 @@ export function listGrants(db: Database, scopeId: string): Grant[] {
481481 }));
482482 }
483483
484 /** Every grant on this forge, for the page that says where each account goes. */
485 export function listAllGrants(db: Database): Grant[] {
486 return db
487 .query<{ scope_id: string; agent_id: string; subscription_id: string }, []>(
488 `SELECT scope_id, agent_id, subscription_id FROM subscription_grant
489 ORDER BY subscription_id, scope_id, agent_id`,
490 )
491 .all()
492 .map((r) => ({
493 scopeId: r.scope_id,
494 agentId: r.agent_id,
495 subscriptionId: r.subscription_id,
496 }));
497 }
498
499484 /**
500485 * The set of accounts one agent (or everyone) may use at a scope, replaced
501486 * whole. An empty set removes the grant, and the wider one applies again.
src/core/timers.ts −4
@@ -252,10 +252,6 @@ export function pendingOnce(db: Database, appId: string): number {
252252 return db.query<{ n: number }, [string]>("SELECT COUNT(*) AS n FROM timer WHERE app_id = ?1 AND kind = 'once' AND name = ''").get(appId)?.n ?? 0;
253253 }
254254
255 export function pendingTimers(db: Database, appId: string, limit = 100): Timer[] {
256 return db.query<Row, [string, number]>("SELECT * FROM timer WHERE app_id = ?1 AND kind = 'once' AND name = '' ORDER BY due_at LIMIT ?2").all(appId, limit).map(toTimer);
257 }
258
259255 export function setPaused(db: Database, id: number, paused: boolean, now: number): void {
260256 const t = getTimer(db, id);
261257 if (t === undefined) return;
src/core/usage.ts −13
@@ -23,12 +23,6 @@ import type { Database } from "bun:sqlite";
2323
2424 /** How a run ended, as far as spend is concerned. */
2525 export type UsageOutcome = "ok" | "failed" | "paused" | "running";
26 export const USAGE_OUTCOMES: readonly UsageOutcome[] = [
27 "ok",
28 "failed",
29 "paused",
30 "running",
31 ];
3226
3327 /**
3428 * What a run was for: `build` (an issue or a pull's feedback), `plan` (a
@@ -156,13 +150,6 @@ export function issueUsage(
156150
157151 /** What the ledger can be summed by. Each maps to one fixed column. */
158152 export type UsageBy = "subscription" | "repo" | "agent" | "issue" | "kind";
159 export const USAGE_BY: readonly UsageBy[] = [
160 "subscription",
161 "repo",
162 "agent",
163 "issue",
164 "kind",
165 ];
166153 const COLUMN: Readonly<Record<UsageBy, string>> = {
167154 subscription: "subscription_id",
168155 repo: "repo_id",

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs