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

Move the accessors out of apps/runtime.ts (appsRuntime, envsFor) so it leaves the boot's static closure #17252

opened this

Merged 32h 26m ago, live in production

mason/forge:mason/17179-move-the-accessors-out-of-apps-runtime-t → main 0 commits fork

  • Merged. mason/17179-move-the-accessors-out-of-apps-runtime-t was merged into main as 5bd09d3.

Review

Sign in to review this change.
86 files changed +161 −132
src/actions/accounts.ts +1 −1
@@ -16,7 +16,7 @@ import type { Database } from "bun:sqlite";
1616 import type { App } from "../app.ts";
1717 import { getAppByRepo } from "../core/apps.ts";
1818 import { listTeams, retireOrg, soleOwnedOrgs } from "../core/orgs.ts";
19 import { appsRuntime } from "../apps/runtime.ts";
19 import { appsRuntime } from "../apps/runtime_registry.ts";
2020 import {
2121 dropCredentials,
2222 listAccounts as readAccounts,
src/actions/app_variants.ts +1 −1
@@ -13,7 +13,7 @@
1313 */
1414
1515 import type { App } from "../app.ts";
16 import { appsRuntime } from "../apps/runtime.ts";
16 import { appsRuntime } from "../apps/runtime_registry.ts";
1717 import { parseValueLines, readLastOutput, VARIANT_FILE, variantFileText, parseVariantFile } from "../apps/variant_file.ts";
1818 import { envDataDir, variantEnv } from "../apps/data.ts";
1919 import { getAppByRepo, type AppRecord } from "../core/apps.ts";
src/actions/apps.ts +2 −1
@@ -24,7 +24,8 @@ import { checkWord, type CheckWord } from "../apps/check_word.ts";
2424 import { openPulls } from "../apps/door_pulls.ts";
2525 import { goldenPath, goldenPathLine } from "../apps/golden_path.ts";
2626 import { appVitals, type AppVitals } from "../apps/vitals.ts";
27 import { appsRuntime, envsFor, type EnvStatus } from "../apps/runtime.ts";
27 import { appsRuntime, envsFor } from "../apps/runtime_registry.ts";
28 import type { EnvStatus } from "../apps/runtime.ts";
2829 import { grantUrl } from "../apps/grants.ts";
2930 import { originFor, sideForViewer, sideReader } from "../apps/proxy.ts";
3031 import { plainLine } from "../apps/side.ts";
src/actions/build.ts +1 −1
@@ -8,7 +8,7 @@
88 */
99
1010 import type { App } from "../app.ts";
11 import { appsRuntime } from "../apps/runtime.ts";
11 import { appsRuntime } from "../apps/runtime_registry.ts";
1212 import { previewEnv } from "../apps/data.ts";
1313 import { offeredTemplates } from "../core/app_templates.ts";
1414 import { type ChatBuild, branchFor, chatBuildOf, setBuildPublished, startChatBuild, unpublishedBuilds } from "../core/chat_build.ts";
src/actions/build_cache.ts +1 −1
@@ -1,7 +1,7 @@
11 /** Clear an app's build cache (#10526): the repository's admins; the next deploy builds fresh. */
22 import type { App } from "../app.ts";
33 import { appCacheSize, clearBuildCache } from "../apps/build_cache.ts";
4 import { appsRuntime } from "../apps/runtime.ts";
4 import { appsRuntime } from "../apps/runtime_registry.ts";
55 import { getAppByRepo, type AppRecord } from "../core/apps.ts";
66 import type { Repo } from "../core/repos.ts";
77 import type { User } from "../core/users.ts";
src/actions/build_preview.ts +1 −1
@@ -15,7 +15,7 @@
1515
1616 import type { App } from "../app.ts";
1717 import { buildEnv, type EnvName } from "../apps/data.ts";
18 import { appsRuntime } from "../apps/runtime.ts";
18 import { appsRuntime } from "../apps/runtime_registry.ts";
1919 import { getAppByRepo } from "../core/apps.ts";
2020 import type { Repo } from "../core/repos.ts";
2121 import type { Run } from "../core/runs.ts";
src/actions/cutover.ts +1 −1
@@ -15,7 +15,7 @@ import { certificateSaid, probeCertificate } from "../apps/certificate.ts";
1515 import type { DnsProvider } from "../apps/dns_provider.ts";
1616 import { compareStatuses, pathsFrom, type PathCheck } from "../apps/parity_probe.ts";
1717 import { readProgress } from "../apps/migration_mode.ts";
18 import { appsRuntime } from "../apps/runtime.ts";
18 import { appsRuntime } from "../apps/runtime_registry.ts";
1919 import { getAppByRepo } from "../core/apps.ts";
2020 import { claimCutOver, getDomain, normalizeHost, setCutOver, setOldRecords, type OldRecord } from "../core/domains.ts";
2121 import type { Repo } from "../core/repos.ts";
src/actions/demo.ts +1 −1
@@ -12,7 +12,7 @@
1212
1313 import type { App } from "../app.ts";
1414 import { DEMO_ENV, DEMO_REF } from "../apps/data.ts";
15 import { appsRuntime } from "../apps/runtime.ts";
15 import { appsRuntime } from "../apps/runtime_registry.ts";
1616 import { getAppByRepo } from "../core/apps.ts";
1717 import type { Repo } from "../core/repos.ts";
1818 import type { Run } from "../core/runs.ts";
src/actions/domain_dns.ts +1 −1
@@ -15,7 +15,7 @@ import {
1515 type ZoneRecord,
1616 } from "../apps/dns_provider.ts";
1717 import { verifyName, verifyValue } from "../apps/domains.ts";
18 import { appsRuntime } from "../apps/runtime.ts";
18 import { appsRuntime } from "../apps/runtime_registry.ts";
1919 import { getAppByRepo } from "../core/apps.ts";
2020 import { getDomain, normalizeHost } from "../core/domains.ts";
2121 import { resolveScoped } from "../core/secret_store.ts";
src/actions/domains.ts +2 −1
@@ -9,7 +9,8 @@ import type { App } from "../app.ts";
99 import { certificateSaid, probeCertificate } from "../apps/certificate.ts";
1010 import { checkClaim, checkDomain, recordsFor, verifyName, verifyValue, type DnsRecord } from "../apps/domains.ts";
1111 import { appHostSuffix } from "../apps/host.ts";
12 import { appsRuntime, type AppsRuntime } from "../apps/runtime.ts";
12 import { appsRuntime } from "../apps/runtime_registry.ts";
13 import type { AppsRuntime } from "../apps/runtime.ts";
1314 import { getAppByRepo, type AppRecord } from "../core/apps.ts";
1415 import {
1516 addDomain,
src/actions/feature_tools.ts +1 −1
@@ -10,7 +10,7 @@ import type { App } from "../app.ts";
1010 import { runRecorded } from "../apps/feature_schedule.ts";
1111 import { identityKey } from "../apps/grants.ts";
1212 import { callTool } from "../apps/feature_tools.ts";
13 import { appsRuntime } from "../apps/runtime.ts";
13 import { appsRuntime } from "../apps/runtime_registry.ts";
1414 import { getAbsorbed } from "../core/features.ts";
1515 import { canWrite } from "../core/repos.ts";
1616 import type { User } from "../core/users.ts";
src/actions/features.ts +1 −1
@@ -24,7 +24,7 @@ import { readFileAt } from "../apps/checkout.ts";
2424 import { checkSetting, featureEnv, parseFeature, settingEnvName, type FeatureSpec } from "../apps/feature.ts";
2525 import { keptSettings as openSettings, sealSetting } from "../apps/feature_env.ts";
2626 import type { ToolSpec } from "../apps/feature_tools.ts";
27 import { appsRuntime } from "../apps/runtime.ts";
27 import { appsRuntime } from "../apps/runtime_registry.ts";
2828 import { getAppByRepo, getAppById, getAppBySlug, listApps, type AppRecord } from "../core/apps.ts";
2929 import {
3030 absorb,
src/actions/front.ts +2 −1
@@ -20,7 +20,8 @@
2020 import type { Database } from "bun:sqlite";
2121 import { provenanceUrl, sourceLabel } from "../core/provenance.ts";
2222 import type { App } from "../app.ts";
23 import { appsRuntime, type EnvState, type EnvStatus } from "../apps/runtime.ts";
23 import { appsRuntime } from "../apps/runtime_registry.ts";
24 import type { EnvState, EnvStatus } from "../apps/runtime.ts";
2425 import { getAppByRepo, listPublicApps, type AppRecord } from "../core/apps.ts";
2526 import {
2627 frontPicks,
src/actions/health.ts +1 −1
@@ -20,7 +20,7 @@
2020 import { askingOf } from "../perf/asking.ts";
2121 import { flakeLine, flakeList, flakeNeedLine, flakeNeedRows, type FlakeRow } from "../checks/flake.ts";
2222 import type { App } from "../app.ts";
23 import { appsRuntime } from "../apps/runtime.ts";
23 import { appsRuntime } from "../apps/runtime_registry.ts";
2424 import { listApps } from "../core/apps.ts";
2525 import { ledgerNeed } from "../core/ledger.ts";
2626 import { overdueSchedules, type ScheduleCounts } from "../core/timers.ts";
src/actions/here.ts +1 −1
@@ -19,7 +19,7 @@ import { sshTellCommand } from "../ssh/command.ts";
1919 import { getAgentStart } from "../settings/agent_start.ts";
2020 import { mcpPointers, TOKEN_FREE_TOOLS } from "../core/mcp_card.ts";
2121 import type { App } from "../app.ts";
22 import { appsRuntime } from "../apps/runtime.ts";
22 import { appsRuntime } from "../apps/runtime_registry.ts";
2323 import { isCrew } from "../core/agents.ts";
2424 import { getAppByRepo } from "../core/apps.ts";
2525 import {
src/actions/journey_walk.ts +1 −1
@@ -13,7 +13,7 @@ import { mkdirSync, renameSync } from "node:fs";
1313 import { dirname, join } from "node:path";
1414 import type { App } from "../app.ts";
1515 import { signGrant } from "../apps/grants.ts";
16 import { appsRuntime } from "../apps/runtime.ts";
16 import { appsRuntime } from "../apps/runtime_registry.ts";
1717 import { getAppByRepo } from "../core/apps.ts";
1818 import { betScopes, listBets, type Bet } from "../core/bets.ts";
1919 import { claimWalk, dropStalePending, finishWalk, listWalks } from "../core/journey_walks.ts";
src/actions/migrate_data.ts +1 −1
@@ -12,7 +12,7 @@
1212 import { readFileSync, statSync } from "node:fs";
1313 import type { App } from "../app.ts";
1414 import { envDataDir } from "../apps/data.ts";
15 import { appsRuntime } from "../apps/runtime.ts";
15 import { appsRuntime } from "../apps/runtime_registry.ts";
1616 import { DUMP_MAX } from "../apps/dump_file.ts";
1717 import type { ImportReport } from "../apps/dump_import.ts";
1818 import { undoImport } from "../apps/dump_undo.ts";
src/actions/repos.ts +1 −1
@@ -17,7 +17,7 @@ import { forkLimitSpent, guestForkRefusal } from "./guests.ts";
1717 import { requireContributor, requireVerified } from "./verify.ts";
1818 import { requireAbility } from "./roles.ts";
1919 import type { App } from "../app.ts";
20 import { appsRuntime } from "../apps/runtime.ts";
20 import { appsRuntime } from "../apps/runtime_registry.ts";
2121 import { getAppByRepo } from "../core/apps.ts";
2222 import { syncEdge } from "../cloud/edge_open.ts";
2323 import { canSeeSealed } from "../core/sealed.ts";
src/actions/secrets.ts +1 −1
@@ -11,7 +11,7 @@ import type { App } from "../app.ts";
1111 import { createLog } from "../kernel/log.ts";
1212 import { getOrg } from "../core/orgs.ts";
1313 import { getRepo, getRepoById } from "../core/repos.ts";
14 import { appsRuntime } from "../apps/runtime.ts";
14 import { appsRuntime } from "../apps/runtime_registry.ts";
1515 import { getAppById, getAppByRepo } from "../core/apps.ts";
1616 import { readerFor } from "../git/read.ts";
1717 import { repoDir } from "../git/repos.ts";
src/actions/start.ts +1 −1
@@ -23,7 +23,7 @@
2323 * hash (`actions/claim.ts` is what opens it).
2424 */
2525 import type { App } from "../app.ts";
26 import { appsRuntime } from "../apps/runtime.ts";
26 import { appsRuntime } from "../apps/runtime_registry.ts";
2727 import { createToken } from "../core/tokens.ts";
2828 import { createUser, discardFreshUser } from "../core/users.ts";
2929 import { inviteOpen, redeemInvite } from "../core/invites.ts";
src/actions/talk_live.ts +1 −1
@@ -8,7 +8,7 @@
88
99 import type { App } from "../app.ts";
1010 import { previewEnv } from "../apps/data.ts";
11 import { appsRuntime } from "../apps/runtime.ts";
11 import { appsRuntime } from "../apps/runtime_registry.ts";
1212 import { getAppByRepo } from "../core/apps.ts";
1313 import { chatBuildOf } from "../core/chat_build.ts";
1414 import { appendTurn, lastExchange } from "../core/conversations.ts";
src/actions/talk_workspace.ts +1 −1
@@ -10,7 +10,7 @@ import type { App } from "../app.ts";
1010 import { previewEnv, type EnvName } from "../apps/data.ts";
1111 import { appsForRepos } from "../core/apps.ts";
1212 import { getRepo, listReposWritableTo, type Repo } from "../core/repos.ts";
13 import { appsRuntime, envsFor } from "../apps/runtime.ts";
13 import { appsRuntime, envsFor } from "../apps/runtime_registry.ts";
1414 import type { User } from "../core/users.ts";
1515 import { requireReader } from "./access.ts";
1616 import { appPreviews, openEnvUrl } from "./apps.ts";
src/apps/dev_launch.ts +1 −1
@@ -19,7 +19,7 @@ import { runLocal } from "../git/local.ts";
1919 import { resolveOid } from "../git/merge.ts";
2020 import { isSafeRef } from "../git/guard.ts";
2121 import { err, ok, type Result } from "../kernel/result.ts";
22 import { appsRuntime } from "./runtime.ts";
22 import { appsRuntime } from "./runtime_registry.ts";
2323 import { identityKey } from "./grants.ts";
2424 import { envDataDir, type EnvName } from "./data.ts";
2525 import { parseManifest } from "./manifest.ts";
src/apps/holding.ts +1 −1
@@ -8,7 +8,7 @@
88 */
99
1010 import type { App } from "../app.ts";
11 import { appsRuntime } from "./runtime.ts";
11 import { appsRuntime } from "./runtime_registry.ts";
1212 import { parseAppHost } from "./proxy.ts";
1313
1414 /** How long a request waits for the apps to load before the holding page. */
src/apps/preview_view.ts +1 −1
@@ -14,7 +14,7 @@ import { mayView, mayViewId } from "../core/sealed.ts";
1414 import { canRead, getRepoById } from "../core/repos.ts";
1515 import { getUserById, type User } from "../core/users.ts";
1616 import { resolveAppHostname } from "./proxy.ts";
17 import { appsRuntime } from "./runtime.ts";
17 import { appsRuntime } from "./runtime_registry.ts";
1818 import { servingWords, type ServingWords } from "./serving_words.ts";
1919
2020 export interface PreviewView {
src/apps/pull_schedule.ts +1 −1
@@ -27,7 +27,7 @@ import { parseAdapter, type AdapterSpec } from "./adapter.ts";
2727 import { readFileAt } from "./checkout.ts";
2828 import { identityHeaders, type GrantWho } from "./grants.ts";
2929 import { parsePullAnswer, PULL_BODY_MAX, recordPull, type PullAnswer } from "./pull.ts";
30 import { appsRuntime } from "./runtime.ts";
30 import { appsRuntime } from "./runtime_registry.ts";
3131 import { during } from "../perf/jobs.ts";
3232
3333 /** How long the forge waits for one `/pull` answer, as for a scheduled tool. */
src/apps/runtime.ts +4 −33
@@ -33,8 +33,7 @@ import { listVariants } from "../core/variants.ts";
3333 import { revokeAppToken } from "./token.ts";
3434 import { requeueAbandonedChecks } from "../checks/abandoned.ts";
3535 import { listPulls } from "../core/pulls.ts";
36 import { canEnterApp, getRepoById, type Repo } from "../core/repos.ts";
37 import type { User } from "../core/users.ts";
36 import { getRepoById, type Repo } from "../core/repos.ts";
3837 import { cancelQueuedDeploys, cancelRun, failAbandonedRuns, STOPPED_SUMMARY } from "../core/runs.ts";
3938 import { Gate } from "../git/env.ts";
4039 import { resolveOid } from "../git/merge.ts";
@@ -50,6 +49,7 @@ import { noteProtection } from "../kernel/protection.ts";
5049 import { cellsAvailable } from "./contain.ts";
5150 import { during } from "../perf/jobs.ts";
5251 import { log, type RuntimeOptions, SWEEP_EVERY_MS, type EnvStatus, type Live, type Environment, RESTART_WINDOW_MS, RESTART_MAX, RESTART_BACKOFF_MS, byEnv, key } from "./runtime_env.ts";
52 import { registerRuntime, unregisterRuntime } from "./runtime_registry.ts";
5353 import * as runtime_status from "./runtime_status.ts";
5454 import * as runtime_events from "./runtime_events.ts";
5555 import * as runtime_deploy from "./runtime_deploy.ts";
@@ -62,35 +62,6 @@ import * as runtime_teardown from "./runtime_teardown.ts";
6262 export { UNOPENED_MS, SLEEP_AFTER_MS, IDLE_PULL_DAYS, TESTS_PASSED_TAIL, NO_TESTS_TAIL, rootFault, BUILD_PREVIEWS_MAX, RESTART_BACKOFF_MS, grantedFor } from "./runtime_env.ts";
6363 export type { RuntimeOptions, EnvState, EnvStatus, LiveEnv } from "./runtime_env.ts";
6464
65 const runtimes = new WeakMap<App, AppsRuntime>();
66
67 /** The runtime serving this forge, if apps are on. */
68 export const appsRuntime = (app: App): AppsRuntime | undefined =>
69 runtimes.get(app);
70
71 /**
72 * An app's environments as `viewer` may see them. A private app's state,
73 * errors and runs are its writers' and crew's (`canEnterApp`, without the
74 * people it only names, who enter the app and nothing behind it); to
75 * anyone else who can read the repository it shows none — a deploy error
76 * can carry paths and configuration (#620). Every surface that shows a
77 * viewer an app's environments reads them here.
78 */
79 export function envsFor(
80 app: App,
81 viewer: User | undefined,
82 record: AppRecord,
83 ): EnvStatus[] {
84 const runtime = runtimes.get(app);
85 if (runtime === undefined) return [];
86 if (record.access === "private") {
87 const repo = getRepoById(app.db, record.repoId);
88 if (repo === undefined || !canEnterApp(app.db, repo, record, viewer, { named: false }))
89 return [];
90 }
91 return runtime.status(record);
92 }
93
9465 export class AppsRuntime {
9566 readonly envs = new Map<string, Environment>();
9667 /** Whether this host can hold an app in a cell (`apps/contain.ts`), asked once at start. */
@@ -110,7 +81,7 @@ export class AppsRuntime {
11081 readonly options: RuntimeOptions,
11182 ) {
11283 this.gate = options.gate ?? new Gate(options.concurrency ?? 2);
113 runtimes.set(app, this);
84 registerRuntime(app, this);
11485 // Closing the forge closes the database next: end every open awake
11586 // interval now, while it can be written, and write nothing after.
11687 app.closing.signal.addEventListener("abort", () => this.closeMeter(), {
@@ -302,7 +273,7 @@ export class AppsRuntime {
302273 }
303274 await Promise.all(stops);
304275 this.metered(() => closeAllAwake(this.app.db, new Date().toISOString()));
305 runtimes.delete(this.app);
276 unregisterRuntime(this.app);
306277 }
307278
308279 /**
src/apps/runtime_registry.ts added +46
@@ -0,0 +1,46 @@
1 /**
2 * Which `AppsRuntime` serves a forge. The service fills this when it starts
3 * (`register`) and empties it when it stops; pages, actions and the server read
4 * it here, so none of them pulls the service's module into the boot's static
5 * closure (#17179).
6 */
7
8 import type { App } from "../app.ts";
9 import type { AppRecord } from "../core/apps.ts";
10 import { canEnterApp, getRepoById } from "../core/repos.ts";
11 import type { User } from "../core/users.ts";
12 import type { AppsRuntime } from "./runtime.ts";
13 import type { EnvStatus } from "./runtime_env.ts";
14
15 const runtimes = new WeakMap<App, AppsRuntime>();
16
17 export const registerRuntime = (app: App, runtime: AppsRuntime): void => void runtimes.set(app, runtime);
18
19 export const unregisterRuntime = (app: App): void => void runtimes.delete(app);
20
21 /** The runtime serving this forge, if apps are on. */
22 export const appsRuntime = (app: App): AppsRuntime | undefined =>
23 runtimes.get(app);
24
25 /**
26 * An app's environments as `viewer` may see them. A private app's state,
27 * errors and runs are its writers' and crew's (`canEnterApp`, without the
28 * people it only names, who enter the app and nothing behind it); to
29 * anyone else who can read the repository it shows none — a deploy error
30 * can carry paths and configuration (#620). Every surface that shows a
31 * viewer an app's environments reads them here.
32 */
33 export function envsFor(
34 app: App,
35 viewer: User | undefined,
36 record: AppRecord,
37 ): EnvStatus[] {
38 const runtime = runtimes.get(app);
39 if (runtime === undefined) return [];
40 if (record.access === "private") {
41 const repo = getRepoById(app.db, record.repoId);
42 if (repo === undefined || !canEnterApp(app.db, repo, record, viewer, { named: false }))
43 return [];
44 }
45 return runtime.status(record);
46 }
src/apps/timer_service.ts +1 −1
@@ -18,7 +18,7 @@ import { identityKey } from "./grants.ts";
1818 import { parseFeature, toolPath } from "./feature.ts";
1919 import { probeSchedules } from "./schedule_probe.ts";
2020 import { parseManifest } from "./manifest.ts";
21 import { appsRuntime } from "./runtime.ts";
21 import { appsRuntime } from "./runtime_registry.ts";
2222 import type { EnvName } from "./data.ts";
2323 import { fireDueTimers, type Reach } from "./timer_fire.ts";
2424 import { repoDir } from "../git/repos.ts";
src/apps/tty.ts +1 −1
@@ -36,7 +36,7 @@ import {
3636 type EnvName,
3737 } from "./data.ts";
3838 import { appEnv, signalGroup } from "./process.ts";
39 import { appsRuntime } from "./runtime.ts";
39 import { appsRuntime } from "./runtime_registry.ts";
4040 import { openAppTty, type AppTtyHandle } from "./tty_registry.ts";
4141 import { shellIdleMs } from "../machines/shell.ts";
4242
src/arcade/carts.ts +1 −1
@@ -19,7 +19,7 @@ import { dirname, join } from "node:path";
1919 import type { App } from "../app.ts";
2020 import { previewBuild, type PreviewBuildError } from "../actions/build_preview.ts";
2121 import { buildEnv } from "../apps/data.ts";
22 import { appsRuntime } from "../apps/runtime.ts";
22 import { appsRuntime } from "../apps/runtime_registry.ts";
2323 import { getAppByRepo } from "../core/apps.ts";
2424 import type { Repo } from "../core/repos.ts";
2525 import type { User } from "../core/users.ts";
src/arcade/host.ts +2 −1
@@ -24,7 +24,8 @@ import { readFileSync } from "node:fs";
2424 import type { App } from "../app.ts";
2525 import { appHostSuffix } from "../apps/host.ts";
2626 import { parseAppHost } from "../apps/proxy.ts";
27 import { appsRuntime, type AppsRuntime } from "../apps/runtime.ts";
27 import { appsRuntime } from "../apps/runtime_registry.ts";
28 import type { AppsRuntime } from "../apps/runtime.ts";
2829 import { canRead, getRepo, ownerInStanding, type Repo } from "../core/repos.ts";
2930 import { arcadeRepoKnown, arcadeRepoOf } from "../display/known.ts";
3031 import { readDisplay, type DisplayConfig } from "../display/config.ts";
src/core/client-apps.ts +1 −1
@@ -6,7 +6,7 @@
66
77 import type { Database } from "bun:sqlite";
88 import type { App } from "../app.ts";
9 import { appsRuntime, envsFor } from "../apps/runtime.ts";
9 import { appsRuntime, envsFor } from "../apps/runtime_registry.ts";
1010 import { appsForRepos } from "./apps.ts";
1111 import { spawnedRepos } from "./next-steps.ts";
1212 import { listReposOwnedBy, repoDatesFor, withoutArchived, type Repo } from "./repos.ts";
src/crew/app_hosts.ts +1 −1
@@ -11,7 +11,7 @@
1111
1212 import type { App } from "../app.ts";
1313 import { previewEnv } from "../apps/data.ts";
14 import { appsRuntime } from "../apps/runtime.ts";
14 import { appsRuntime } from "../apps/runtime_registry.ts";
1515 import { blockedHosts, refusalLine } from "../apps/egress_refused.ts";
1616 import { type AppAccess, getAppByRepo } from "../core/apps.ts";
1717 import { LIST_LIMIT_MAX } from "../core/issues.ts";
src/crew/runner.ts +1 −1
@@ -19,7 +19,7 @@ import { dropBrief } from "../actions/drop.ts";
1919 import { announceRun } from "../actions/runs.ts";
2020 import type { App } from "../app.ts";
2121 import { previewEnv } from "../apps/data.ts";
22 import { appsRuntime } from "../apps/runtime.ts";
22 import { appsRuntime } from "../apps/runtime_registry.ts";
2323 import { Stopwatch } from "../apps/timing.ts";
2424 import { declarationsOf } from "../cloud/declared.ts";
2525 import { bar } from "../cloud/gate.ts";
src/data/spec_scope.ts +1 −1
@@ -13,7 +13,7 @@
1313
1414 import type { App } from "../app.ts";
1515 import { knownSpec, refreshSpec } from "../apps/api_spec.ts";
16 import { appsRuntime } from "../apps/runtime.ts";
16 import { appsRuntime } from "../apps/runtime_registry.ts";
1717 import { narrow, reference, type Area } from "../contract/reference.ts";
1818 import { openapiText, roleOf } from "../contract/served.ts";
1919 import { getAppByRepo } from "../core/apps.ts";
src/http/api.ts +2 −1
@@ -233,7 +233,8 @@ import {
233233 replanLimb,
234234 takeBackLimb,
235235 } from "../actions/limb_replan.ts";
236 import { appsRuntime, envsFor, type AppsRuntime } from "../apps/runtime.ts";
236 import { appsRuntime, envsFor } from "../apps/runtime_registry.ts";
237 import type { AppsRuntime } from "../apps/runtime.ts";
237238 import { isEnvName } from "../apps/data.ts";
238239 import { getAppByRepo } from "../core/apps.ts";
239240 import { isCrew, type Agent } from "../core/agents.ts";
src/http/api/app.ts +1 −1
@@ -14,7 +14,7 @@ import { addAppDomain, claimAppDomain, claimProofRecord, checkAppDomain, keepOld
1414 import { clearDemo, setDemo } from "../../actions/demo.ts";
1515 import { previewBuild, previewBuildRefusalText } from "../../actions/build_preview.ts";
1616 import { SETTING_WORDS } from "../../actions/setting_words.ts";
17 import { appsRuntime } from "../../apps/runtime.ts";
17 import { appsRuntime } from "../../apps/runtime_registry.ts";
1818 import { canAdmin, canRead, getRepo } from "../../core/repos.ts";
1919 import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.ts";
2020 import type { Result } from "../../kernel/result.ts";
src/http/api/pulls.ts +1 −1
@@ -76,7 +76,7 @@ import {
7676 import { capWords, headInContribNamespace, inTurn, pullCapReached } from "../../core/contribute_token.ts";
7777 import { takesOutside } from "../../actions/contribute_token.ts";
7878 import { editIssue } from "../../actions/issues.ts";
79 import { appsRuntime, envsFor } from "../../apps/runtime.ts";
79 import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts";
8080 import { previewEnv } from "../../apps/data.ts";
8181 import { checkWord } from "../../apps/check_word.ts";
8282 import { getAppByRepo } from "../../core/apps.ts";
src/http/mcp/tools/apps.ts +1 −1
@@ -1,4 +1,4 @@
1 import { appsRuntime, envsFor } from "../../../apps/runtime.ts";
1 import { appsRuntime, envsFor } from "../../../apps/runtime_registry.ts";
22 import { listActiveRuns } from "../../../core/runs.ts";
33 import { appsOf } from "../../../web/studio/asks.ts";
44 import { PULL_RUNS_DEFAULT, PULL_RUNS_MAX, pullRunLines } from "../../../apps/pull.ts";
src/http/mcp/tools/here.ts +1 −1
@@ -1,4 +1,4 @@
1 import { appsRuntime } from "../../../apps/runtime.ts";
1 import { appsRuntime } from "../../../apps/runtime_registry.ts";
22 import { hereOf } from "../../../apps/here.ts";
33 import { manifestFor } from "../../../actions/here.ts";
44 import { noticeOf } from "../../../billing/notice.ts";
src/http/mcp/tools/new_app.ts +1 −1
@@ -1,4 +1,4 @@
1 import { appsRuntime } from "../../../apps/runtime.ts";
1 import { appsRuntime } from "../../../apps/runtime_registry.ts";
22 import { listActiveRuns } from "../../../core/runs.ts";
33 import { getUserByName } from "../../../core/users.ts";
44 import { repositoryLimitMessage } from "../../../actions/repos.ts";
src/http/mcp/tools/preview.ts +1 −1
@@ -1,4 +1,4 @@
1 import { appsRuntime } from "../../../apps/runtime.ts";
1 import { appsRuntime } from "../../../apps/runtime_registry.ts";
22 import { previewOf } from "../../../apps/preview_view.ts";
33 import { good, bad, type Tool } from "../shared.ts";
44
src/http/mcp/tools/probe.ts +1 −1
@@ -1,4 +1,4 @@
1 import { appsRuntime } from "../../../apps/runtime.ts";
1 import { appsRuntime } from "../../../apps/runtime_registry.ts";
22 import { getAppByRepo } from "../../../core/apps.ts";
33 import { canWrite } from "../../../core/repos.ts";
44 import { probeApp } from "../../../contract/probes.ts";
src/http/routes/operations.ts +1 −1
@@ -7,7 +7,7 @@ import { keeperAnswer } from "../../web/studio/keeper_row.ts";
77 import { lazyRoutes } from "../lazy_routes.ts";
88 import { flowPage, valveSet, backupRetry, suggestionTake } from "../../web/pages/flow.ts";
99 import { resolveAppHostname } from "../../apps/proxy.ts";
10 import { appsRuntime } from "../../apps/runtime.ts";
10 import { appsRuntime } from "../../apps/runtime_registry.ts";
1111 import { getVerifiedDomain } from "../../core/domains.ts";
1212 import { brokerStart } from "../../spawn/origin_broker.ts";
1313 import { cloudConnectPage, cloudConnectProvider, cloudConnectSubmit, cloudConnectBuild } from "../../web/pages/cloud.ts";
src/http/server.ts +1 −1
@@ -141,7 +141,7 @@ import { RateLimiter, type Verdict } from "../core/ratelimit.ts";
141141 import { MAX_KEY_LENGTH, claimInFlight, joinInFlight, lookupIdempotent, replayedHeaders, requestFingerprint, storeIdempotent, type StoredResponse } from "../core/idempotency.ts";
142142 import { isAdminRoute } from "./route_marks.ts";
143143 import { Router } from "./router.ts";
144 import { appsRuntime } from "../apps/runtime.ts";
144 import { appsRuntime } from "../apps/runtime_registry.ts";
145145 import { holdAppHost } from "../apps/holding.ts";
146146 import { isArcadeHost, serveArcade } from "../arcade/host.ts";
147147 import { appWebSocketWith, type AppSocket, isWebSocketHandshake, proxyApp, resolveAppHost, unknownApp } from "../apps/proxy.ts";
src/looks/service.ts +1 −1
@@ -39,7 +39,7 @@ import { dirname, join } from "node:path";
3939 import type { App } from "../app.ts";
4040 import { envBuild, envPull, isEnvName, previewEnv, type EnvName } from "../apps/data.ts";
4141 import { plainProof, signGrant, type GrantWho } from "../apps/grants.ts";
42 import { appsRuntime } from "../apps/runtime.ts";
42 import { appsRuntime } from "../apps/runtime_registry.ts";
4343 import {
4444 getAppById,
4545 getAppByRepo,
src/metrics/app_sources.ts +1 −1
@@ -4,7 +4,7 @@
44 * watch has already read. It starts nothing and reads no process.
55 */
66 import type { App } from "../app.ts";
7 import { appsRuntime } from "../apps/runtime.ts";
7 import { appsRuntime } from "../apps/runtime_registry.ts";
88 import { listApps } from "../core/apps.ts";
99 import { cellCountersFor } from "../spawn/process_counters.ts";
1010 import type { AppSources } from "./forge.ts";
src/spawn/child-apps.ts +5 −1
@@ -13,7 +13,8 @@ import type { App } from "../app.ts";
1313 import type { ChecksHandle } from "../checks/lane_state.ts";
1414 import { checksFor } from "../checks/handles.ts";
1515 import { listApps } from "../core/apps.ts";
16 import { appsRuntime, AppsRuntime } from "../apps/runtime.ts";
16 import { appsRuntime } from "../apps/runtime_registry.ts";
17 import type { AppsRuntime } from "../apps/runtime.ts";
1718 import { childHost } from "./door.ts";
1819 import { childPublicUrl, parentOrigin } from "./placement.ts";
1920 import { childLabel, hostChild } from "../perf/child_time.ts";
@@ -39,6 +40,9 @@ export function childRuntime(parent: App, name: string): AppsRuntime | undefined
3940 export async function startChildApps(parent: App, child: App, name: string): Promise<void> {
4041 const own = appsRuntime(parent);
4142 if (own === undefined) return;
43 // Imported (before the once-per-child check, so two starts cannot interleave) when a child starts
44 // its apps, not by the boot (#17179).
45 const { AppsRuntime } = await import("../apps/runtime.ts");
4246 // Loaded before the claim below, which must not wait: a parent with checks has loaded it already.
4347 const parentChecks = checksFor(parent);
4448 const startChecks = parentChecks === undefined ? undefined : (await import("../checks/service.ts")).startChecks;
src/spawn/host.ts +2 −1
@@ -8,7 +8,8 @@
88 import { retireLapsedCloud } from "./lapse_cloud.ts";
99 import { childDirOf } from "../actions/spawn.ts";
1010 import { createApp, type App } from "../app.ts";
11 import { appsRuntime, type AppsRuntime } from "../apps/runtime.ts";
11 import { appsRuntime } from "../apps/runtime_registry.ts";
12 import type { AppsRuntime } from "../apps/runtime.ts";
1213 import { resolveAppHost, type AppSocket, type AppTarget } from "../apps/proxy.ts";
1314 import { childAppsSummary, startChildApps, stopChildApps, stopChildAppsOf } from "./child-apps.ts";
1415 import { childHost } from "./door.ts";
src/system/feature_health.ts +2 −1
@@ -11,7 +11,8 @@ import type { Reader } from "../actions/telemetry.ts";
1111 import { getAppById } from "../core/apps.ts";
1212 import { getRepoById } from "../core/repos.ts";
1313 import { listAbsorbed } from "../core/features.ts";
14 import { appsRuntime, type EnvState, type EnvStatus } from "../apps/runtime.ts";
14 import { appsRuntime } from "../apps/runtime_registry.ts";
15 import type { EnvState, EnvStatus } from "../apps/runtime.ts";
1516
1617 export interface FeatureHealth {
1718 readonly slug: string;
src/tui/screens/deploys.ts +1 −1
@@ -110,7 +110,7 @@ import { egressSetting } from "../../core/capacity.ts";
110110 import { listRepoRuns } from "../../actions/runs.ts";
111111 import { carriedByRuns, carriedForRuns, carriesText } from "../../core/carried.ts";
112112 import { repoDir } from "../../git/repos.ts";
113 import { appsRuntime } from "../../apps/runtime.ts";
113 import { appsRuntime } from "../../apps/runtime_registry.ts";
114114 import { getAppByRepo } from "../../core/apps.ts";
115115 import { canAdmin, canWrite, type Repo } from "../../core/repos.ts";
116116 import type { Knock } from "../../contract/probe.ts";
src/tui/screens/newapp.ts +1 −1
@@ -10,7 +10,7 @@
1010 import { appLimitWords } from "../../actions/app_limit.ts";
1111 import { NEW_APP_ERRORS, NO_NAME_ERROR, newAppFromSentence, privateNotice } from "../../actions/apps.ts";
1212 import { repositoryLimitMessage } from "../../actions/repos.ts";
13 import { appsRuntime } from "../../apps/runtime.ts";
13 import { appsRuntime } from "../../apps/runtime_registry.ts";
1414 import { templateChoices } from "../../apps/template_folders.ts";
1515 import { offeredTemplates } from "../../core/app_templates.ts";
1616 import { listOrgsForUser } from "../../core/orgs.ts";
src/tui/screens/pull.ts +2 −3
@@ -66,9 +66,8 @@ import { combinedView, combinedWords, type CombinedView } from "../../core/combi
6666 import { previewEnv } from "../../apps/data.ts";
6767 import { findingsWords, pullPreviewFindings } from "../../core/preview_findings.ts";
6868 import { pullSecrets, secretLine, secretsWords } from "../../checks/pushed_secrets.ts";
69 import {
70 type EnvState,
71 type EnvStatus, envsFor } from "../../apps/runtime.ts";
69 import { envsFor } from "../../apps/runtime_registry.ts";
70 import type { EnvState, EnvStatus } from "../../apps/runtime.ts";
7271 import { proposedByText } from "../../core/proposal_token.ts";
7372 import { attestationLine } from "../../core/attestation.ts";
7473 import { getAppByRepo } from "../../core/apps.ts";
src/tui/ssh-tell.ts +1 −1
@@ -11,7 +11,7 @@
1111 import { tell } from "../actions/tell.ts";
1212 import { SAY_SOMETHING_WORDS } from "../actions/tell_words.ts";
1313 import { appGate, ttyRefusalText } from "../apps/tty.ts";
14 import { appsRuntime } from "../apps/runtime.ts";
14 import { appsRuntime } from "../apps/runtime_registry.ts";
1515 import type { App } from "../app.ts";
1616 import type { AppRecord } from "../core/apps.ts";
1717 import { canRead, getRepo, getRepoById } from "../core/repos.ts";
src/web/layout.ts +1 −1
@@ -20,7 +20,7 @@ import { OPENSEARCH_PATH, OPENSEARCH_TITLE, OPENSEARCH_TYPE } from "./opensearch
2020 import { protectionNotice } from "../kernel/protection.ts";
2121 import { appsForRepos } from "../core/apps.ts";
2222 import { foundryHref } from "../actions/foundry_door.ts";
23 import { appsRuntime } from "../apps/runtime.ts";
23 import { appsRuntime } from "../apps/runtime_registry.ts";
2424 import { doorRepos } from "../actions/front.ts";
2525 import { actionRows, appActionRows, peopleRows, settingsRows } from "./palette_rows.ts";
2626 import { wordClip } from "../text/word_clip.ts";
src/web/page_tag.ts +1 −1
@@ -10,7 +10,7 @@
1010 */
1111
1212 import { doorRepos } from "../actions/front.ts";
13 import { appsRuntime } from "../apps/runtime.ts";
13 import { appsRuntime } from "../apps/runtime_registry.ts";
1414 import { appsForRepos } from "../core/apps.ts";
1515 import type { Ctx } from "../http/context.ts";
1616 import { taggable, unchanged } from "../http/etag.ts";
src/web/pages/api.ts +1 −1
@@ -6,7 +6,7 @@
66 */
77
88 import { knownSpec, refreshSpec } from "../../apps/api_spec.ts";
9 import { appsRuntime } from "../../apps/runtime.ts";
9 import { appsRuntime } from "../../apps/runtime_registry.ts";
1010 import { appView } from "../../actions/apps.ts";
1111 import { narrow, reference, type Area } from "../../contract/reference.ts";
1212 import { openapiText, roleOf } from "../../contract/served.ts";
src/web/pages/apps.ts +2 −1
@@ -45,7 +45,8 @@ import { appNameJs } from "./apps-name.ts";
4545 import { STARTERS, starterFromQuery, starterHref } from "./apps-starters.ts";
4646 import { previewEnv, type EnvName } from "../../apps/data.ts";
4747 import { envRefusalText, redeployedText, stoppedText } from "../../actions/env_words.ts";
48 import { appsRuntime, type EnvState, type EnvStatus, envsFor } from "../../apps/runtime.ts";
48 import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts";
49 import type { EnvState, EnvStatus } from "../../apps/runtime.ts";
4950 import { firstPreviews, goldenPath, goldenPathLine } from "../../apps/golden_path.ts";
5051 import { appHostSuffix } from "../../apps/host.ts";
5152 import { appsForRepos, getAppByRepo, type AppRecord } from "../../core/apps.ts";
src/web/pages/audit.ts +1 −1
@@ -13,7 +13,7 @@
1313 * which are as public as the file in the repository.
1414 */
1515
16 import { appsRuntime } from "../../apps/runtime.ts";
16 import { appsRuntime } from "../../apps/runtime_registry.ts";
1717 import { appsForRepos, getAppByRepo } from "../../core/apps.ts";
1818 import { canWrite, listReposVisibleTo, type Repo } from "../../core/repos.ts";
1919 import type { Ctx } from "../../http/context.ts";
src/web/pages/board.ts +1 −1
@@ -124,7 +124,7 @@ import {
124124 type FigureWords,
125125 type WordCtx,
126126 } from "../studio/words.ts";
127 import { appsRuntime } from "../../apps/runtime.ts";
127 import { appsRuntime } from "../../apps/runtime_registry.ts";
128128 import { lookUrl } from "../../core/looks.ts";
129129 import { thumbLook } from "./looks.ts";
130130 import { milestoneHref } from "./milestones.ts";
src/web/pages/looks.ts +1 −1
@@ -36,7 +36,7 @@ import { mayFetchLook as mayFetchLookFor } from "../../looks/readable.ts";
3636 import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.ts";
3737 import { retryAt } from "../../looks/retries.ts";
3838 import { whyNoPicture } from "../../looks/why.ts";
39 import { appsRuntime } from "../../apps/runtime.ts";
39 import { appsRuntime } from "../../apps/runtime_registry.ts";
4040 import { noPicture } from "../look_none.ts";
4141 import { loadRepo, repoBase } from "../chrome.ts";
4242 import { html, when, type Html } from "../html.ts";
src/web/pages/pull.ts +1 −1
@@ -58,7 +58,7 @@ import { mainLineFor } from "../../checks/red_main_line.ts";
5858 import { runningProgress } from "../../checks/progress.ts";
5959 import { checkStale, checksHold } from "../../checks/stale.ts";
6060 import { isDraft, isTalkDraft, TALK_DRAFT, TALK_DRAFT_LINE } from "../../core/pulls.ts";
61 import { appsRuntime } from "../../apps/runtime.ts";
61 import { appsRuntime } from "../../apps/runtime_registry.ts";
6262 import { checkSummary, runnerSilent, type CheckSummary } from "../../core/runs.ts";
6363 import {
6464 anchorKey,
src/web/pages/search.ts +1 −1
@@ -19,7 +19,7 @@ import { rejoinableParent, severPreview } from "../../actions/sever_undo.ts";
1919 import { DISCONNECT_DETAIL } from "../../actions/origin_words.ts";
2020 import { strangerCodeSearch } from "../../http/strangers.ts";
2121 import { search } from "../../actions/search.ts";
22 import { envsFor } from "../../apps/runtime.ts";
22 import { envsFor } from "../../apps/runtime_registry.ts";
2323 import type { AppRecord } from "../../core/apps.ts";
2424 import { getSnapshot } from "../../core/snapshots.ts";
2525 import { openLabelCounts } from "../../core/issues.ts";
src/web/pages/settings.ts +1 −1
@@ -64,7 +64,7 @@ import {
6464 import { AUTONOMY_SAID, checkAutonomy, isDecisionsBy, isLanding, type Landing } from "../../core/repos.ts";
6565 import { TRANSFER_SAID, TRANSFER_STATUS, renameRepository, transferRepository } from "../../actions/transfer.ts";
6666 import { updateRepoSettings } from "../../actions/repos.ts";
67 import { appsRuntime } from "../../apps/runtime.ts";
67 import { appsRuntime } from "../../apps/runtime_registry.ts";
6868 import { nameFrame, notePhase, takeSessionTime, timePhase, timePhaseAsync } from "../../core/route_timing.ts";
6969 import { appVitals, shiftText, speedText as ms, type AppVitals } from "../../apps/vitals.ts";
7070 import { APP_VISITORS_COUNT } from "../../flow/kpi_words.ts";
src/web/pages/talk_preview.ts +1 −1
@@ -22,7 +22,7 @@ import type { User } from "../../core/users.ts";
2222 import { paneCrew, paneFell, paneInfo, type PaneCrew, type Work } from "../../core/talk_work.ts";
2323 import { mayReadRunLog, mayReadRuns } from "../../actions/runs.ts";
2424 import { getAppByRepo } from "../../core/apps.ts";
25 import { appsRuntime } from "../../apps/runtime.ts";
25 import { appsRuntime } from "../../apps/runtime_registry.ts";
2626 import { originOf } from "../../actions/talk_workspace.ts";
2727 import { workLineHtml } from "../talk_lines.ts";
2828 import type { Ctx } from "../../http/context.ts";
src/web/repo_steps.ts +1 −1
@@ -8,7 +8,7 @@
88
99 import { mayReadRuns, workingNowCount } from "../actions/runs.ts";
1010 import { REPO_TABS } from "./keymap.ts";
11 import { appsRuntime } from "../apps/runtime.ts";
11 import { appsRuntime } from "../apps/runtime_registry.ts";
1212 import { knownSpec, warmSpec } from "../apps/api_spec.ts";
1313 import { getAppByRepo } from "../core/apps.ts";
1414 import { canAdmin, canEnterApp, canWrite, visibleForks, type Repo } from "../core/repos.ts";
src/web/studio/app.ts +1 −1
@@ -21,7 +21,7 @@ import { egressSetting } from "../../core/capacity.ts";
2121 import { egressNote } from "./egress.ts";
2222 import { audit } from "../../contract/audit.ts";
2323 import { latestProbes } from "../../contract/probes.ts";
24 import { appsRuntime, envsFor } from "../../apps/runtime.ts";
24 import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts";
2525 import { TELL_LIMIT_WORDS, TELL_TEXT_MAX } from "../../actions/tell_from.ts";
2626 import { listCrewRoles, type CrewRole } from "../../core/agents.ts";
2727
src/web/studio/change.ts +1 −1
@@ -25,7 +25,7 @@ import { accountsByName, marksByName, marksOf, type Mark } from "../../core/mark
2525 import { waitingFor } from "../../core/waiting_for.ts";
2626 import { mayView } from "../../core/sealed.ts";
2727 import { threadNote } from "../../crew/direct.ts";
28 import { appsRuntime, envsFor } from "../../apps/runtime.ts";
28 import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts";
2929 import { getAppByRepo, type AppRecord } from "../../core/apps.ts";
3030 import {
3131 getPull,
src/web/studio/decisions.ts +1 −1
@@ -22,7 +22,7 @@ import { changeHref } from "./nouns.ts";
2222 import { flatten } from "./note.ts";
2323 import { testsClause } from "./words.ts";
2424 import { greenRunsAt, type Run } from "../../core/runs.ts";
25 import { TESTS_PASSED_TAIL } from "../../apps/runtime.ts";
25 import { TESTS_PASSED_TAIL } from "../../apps/runtime_env.ts";
2626 import { MOVED_SINCE_APPROVAL } from "../../core/approval_at.ts";
2727 import { reviewerPaused } from "../../crew/reviewer_paused.ts";
2828 import { conflictsOf, conflictWords } from "../../crew/stale_asks.ts";
src/web/studio/home.ts +2 −1
@@ -20,7 +20,8 @@ import {
2020 } from "../../actions/front.ts";
2121 import { catalog, refreshCatalogQuietly } from "../../packs/catalog.ts";
2222 import type { Pack } from "../../packs/pack.ts";
23 import { appsRuntime, type EnvState } from "../../apps/runtime.ts";
23 import { appsRuntime } from "../../apps/runtime_registry.ts";
24 import type { EnvState } from "../../apps/runtime.ts";
2425 import { accountsClosedIn } from "../../core/users.ts";
2526 import { plansRow } from "../plans_row.ts";
2627 import { freePlanName, funnelJs, noteHomeVisit } from "../funnel_door.ts";
src/web/studio/lists.ts +1 −1
@@ -12,7 +12,7 @@
1212 import { securityLine } from "../pages/reports.ts";
1313 import { keyOf } from "../keymap.ts";
1414 import { sealedScope } from "../../core/sealed.ts";
15 import { appsRuntime } from "../../apps/runtime.ts";
15 import { appsRuntime } from "../../apps/runtime_registry.ts";
1616 import { getAppByRepo } from "../../core/apps.ts";
1717 import {
1818 labelsForIssues,
src/web/studio/now.ts +1 −1
@@ -10,7 +10,7 @@
1010 import { frontPulls } from "./front_pulls.ts";
1111 import { eventRows, mayView, sealedScope } from "../../core/sealed.ts";
1212 import { envPull, previewEnv } from "../../apps/data.ts";
13 import { appsRuntime, envsFor } from "../../apps/runtime.ts";
13 import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts";
1414 import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.ts";
1515 import { listCrewRoles } from "../../core/agents.ts";
1616 import { getAppByRepo, type AppRecord } from "../../core/apps.ts";
src/web/studio/previews.ts +2 −4
@@ -16,10 +16,8 @@ import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.t
1616 import { terminalFor } from "../../actions/apps.ts";
1717 import { envPull, previewEnv } from "../../apps/data.ts";
1818 import { appOnboardingLine } from "../../apps/onboarding.ts";
19 import {
20 appsRuntime,
21 type AppsRuntime,
22 type EnvStatus, envsFor } from "../../apps/runtime.ts";
19 import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts";
20 import type { AppsRuntime, EnvStatus } from "../../apps/runtime.ts";
2321 import { getAppByRepo, type AppRecord } from "../../core/apps.ts";
2422 import type { Pull } from "../../core/pulls.ts";
2523 import { canAdmin, canSeeOwnerFacts, type Repo } from "../../core/repos.ts";
src/web/studio/run.ts +1 −1
@@ -18,7 +18,7 @@ import { checkSteps, stepWord, type LookVitals } from "../../checks/summary.ts";
1818 import { vitalsTable } from "./vitals.ts";
1919 import { parseTestsRow, testsRowWords } from "../../checks/tests-row.ts";
2020 import { directionNote } from "../../crew/direct.ts";
21 import { appsRuntime } from "../../apps/runtime.ts";
21 import { appsRuntime } from "../../apps/runtime_registry.ts";
2222 import { getAppByRepo } from "../../core/apps.ts";
2323 import { carriedFor } from "../../core/carried.ts";
2424 import { getIssueById } from "../../core/issues.ts";
src/web/studio/shelf.ts +2 −1
@@ -25,7 +25,8 @@
2525 */
2626
2727 import { spanWords } from "../../apps/golden_path.ts";
28 import { appsRuntime, type EnvStatus } from "../../apps/runtime.ts";
28 import { appsRuntime } from "../../apps/runtime_registry.ts";
29 import type { EnvStatus } from "../../apps/runtime.ts";
2930 import { appsForRepos, type AppRecord } from "../../core/apps.ts";
3031 import { reposWithBuilder } from "../../core/agents.ts";
3132 import { getIssuesByIds, reposWithUnclaimedTell } from "../../core/issues.ts";
src/web/studio/tell.ts +1 −1
@@ -18,7 +18,7 @@ import { accountsByName, marksOf } from "../../core/marks.ts";
1818 import { TELL_RUNS_SHOWN, tellStatus } from "../../runs/tell_status.ts";
1919 import { threadNote } from "../../crew/direct.ts";
2020 import { alreadyDone } from "../../core/done_on_main.ts";
21 import { appsRuntime } from "../../apps/runtime.ts";
21 import { appsRuntime } from "../../apps/runtime_registry.ts";
2222 import { getAppByRepo } from "../../core/apps.ts";
2323 import { LATER_TITLED } from "../../core/pillars.ts";
2424 import { deferredOf, linkedIssueIds } from "../../core/dependencies.ts";
src/web/studio/toolbar_side.ts +1 −1
@@ -9,7 +9,7 @@
99
1010 import { sideOf, type Side } from "../../apps/side.ts";
1111 import { envPull } from "../../apps/data.ts";
12 import { appsRuntime, envsFor } from "../../apps/runtime.ts";
12 import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts";
1313 import type { AppRecord } from "../../core/apps.ts";
1414 import { getIssuesByNumbers, numberKey } from "../../core/issues.ts";
1515 import type { Repo } from "../../core/repos.ts";
src/web/studio/words.ts +3 −6
@@ -12,12 +12,9 @@ import { crewFace } from "../pixel.ts";
1212 import { shownState } from "../../runs/state.ts";
1313 import type { Database } from "bun:sqlite";
1414 import { ancestries, type AncestryCache } from "./ancestry.ts";
15 import {
16 NO_TESTS_TAIL,
17 TESTS_PASSED_TAIL,
18 type AppsRuntime,
19 type EnvStatus,
20 } from "../../apps/runtime.ts";
15 import { NO_TESTS_TAIL, TESTS_PASSED_TAIL } from "../../apps/runtime_env.ts";
16 import type { AppsRuntime } from "../../apps/runtime.ts";
17 import type { EnvStatus } from "../../apps/runtime_env.ts";
2118 import type { AppRecord } from "../../core/apps.ts";
2219 import { canEnterApp, getRepoById, type Repo } from "../../core/repos.ts";
2320 import type { User } from "../../core/users.ts";
test/apps-runtime-split.test.ts +4 −3
@@ -11,7 +11,8 @@ import { readdirSync, readFileSync } from "node:fs";
1111 import { tmpdir } from "node:os";
1212 import { join } from "node:path";
1313 import { createApp } from "../src/app.ts";
14 import { AppsRuntime, appsRuntime, envsFor } from "../src/apps/runtime.ts";
14 import { appsRuntime, envsFor } from "../src/apps/runtime_registry.ts";
15 import { AppsRuntime } from "../src/apps/runtime.ts";
1516 import * as status from "../src/apps/runtime_status.ts";
1617
1718 const root = new URL("..", import.meta.url).pathname;
@@ -47,7 +48,7 @@ describe("the runtime's modules", () => {
4748 expect(bootRuns.size).toBe(0);
4849 });
4950
50 test("each module is under 600 lines, and only runtime.ts holds module-level state", () => {
51 test("each module is under 600 lines, and only runtime_registry.ts holds module-level state", () => {
5152 expect(parts.length).toBeGreaterThan(5);
5253 const held: string[] = [];
5354 for (const file of parts) {
@@ -56,7 +57,7 @@ describe("the runtime's modules", () => {
5657 for (const line of text.split("\n"))
5758 if (/^(?:export\s+)?(?:const|let)\s+\w+\s*=\s*new\s+(?:Weak)?(?:Map|Set)\b|^(?:export\s+)?let\s/.test(line)) held.push(`${file}: ${line}`);
5859 }
59 expect(held).toEqual(["runtime.ts: const runtimes = new WeakMap<App, AppsRuntime>();"]);
60 expect(held).toEqual(["runtime_registry.ts: const runtimes = new WeakMap<App, AppsRuntime>();"]);
6061 });
6162 });
6263
test/boot-lazy.test.ts +4 −4
@@ -23,12 +23,12 @@ test("the terminal's server is imported dynamically by the boot", () => {
2323
2424 // #17021: the services only the boot starts are not in its static closure; that each still starts
2525 // is proved on a real boot (boot-production.test.ts, "background service started service=<name>").
26 // The heavier ones are still reached by pages and actions, each its own follow-up: #17179,
27 // #17180, #17181, #17182, #17183 (apps/runtime, checks/service, crew/dispatch,
28 // looks/service, snapshot/service).
26 // The heavier ones are still reached by pages and actions, each its own follow-up: #17180,
27 // #17181, #17182, #17183 (checks/service, crew/dispatch, looks/service).
28 // apps/runtime is out (#17179): its accessors live in apps/runtime_registry.ts.
2929 test("the boot's static imports do not reach the services only it starts", () => {
3030 const closure = [...staticClosure(resolve("src/main.ts"))];
31 const only = ["maintain/runner.ts", "nightly/service.ts", "keeper/keeper.ts", "keeper/wire.ts", "crew/routines.ts", "checks/service.ts", "snapshot/service.ts"];
31 const only = ["maintain/runner.ts", "nightly/service.ts", "keeper/keeper.ts", "keeper/wire.ts", "crew/routines.ts", "checks/service.ts", "snapshot/service.ts", "apps/runtime.ts"];
3232 for (const file of only) expect(closure.some((f) => f.endsWith(`/src/${file}`)), file).toBe(false);
3333 });
3434
test/boundary-secrets-process.test.ts +1 −1
@@ -23,7 +23,7 @@ import {
2323 type EnvName,
2424 } from "../src/apps/data.ts";
2525 import { identityKey, pillWhere } from "../src/apps/proxy.ts";
26 import { appsRuntime } from "../src/apps/runtime.ts";
26 import { appsRuntime } from "../src/apps/runtime_registry.ts";
2727 import { PREVIEW_WAITS, toolbarJs, toolbarTag } from "../src/apps/toolbar.ts";
2828 import { readRunLog } from "../src/runs/log.ts";
2929 import { runAppTty, type TtyHost } from "../src/apps/tty.ts";
test/helpers/apps-forge.ts +2 −1
@@ -11,7 +11,8 @@ import { join } from "node:path";
1111 import { createApp, type App } from "../../src/app.ts";
1212 import { setSsh } from "../../src/settings/ssh.ts";
1313 import { newApp } from "../../src/actions/apps.ts";
14 import { AppsRuntime, appsRuntime as runtimeOf } from "../../src/apps/runtime.ts";
14 import { appsRuntime as runtimeOf } from "../../src/apps/runtime_registry.ts";
15 import { AppsRuntime } from "../../src/apps/runtime.ts";
1516 import { getAppByRepo, type AppRecord } from "../../src/core/apps.ts";
1617 import type { Repo } from "../../src/core/repos.ts";
1718 import { listRuns, type Run } from "../../src/core/runs.ts";
test/private-app.test.ts +2 −1
@@ -16,7 +16,8 @@ import { newApp, openEnvUrl } from "../src/actions/apps.ts";
1616 import { updateRepoSettings } from "../src/actions/repos.ts";
1717 import { createApp, type App } from "../src/app.ts";
1818 import { grantUrl } from "../src/apps/proxy.ts";
19 import { AppsRuntime, envsFor } from "../src/apps/runtime.ts";
19 import { envsFor } from "../src/apps/runtime_registry.ts";
20 import { AppsRuntime } from "../src/apps/runtime.ts";
2021 import { runAppTty, type TtyHost } from "../src/apps/tty.ts";
2122 import type { AppRecord } from "../src/core/apps.ts";
2223 import { getRepoById, type Repo } from "../src/core/repos.ts";
test/probe.test.ts +2 −1
@@ -12,7 +12,8 @@ import { join } from "node:path";
1212 import { createApp, type App } from "../src/app.ts";
1313 import { newApp } from "../src/actions/apps.ts";
1414 import { commitToBranch } from "../src/actions/repos.ts";
15 import { AppsRuntime, appsRuntime } from "../src/apps/runtime.ts";
15 import { appsRuntime } from "../src/apps/runtime_registry.ts";
16 import { AppsRuntime } from "../src/apps/runtime.ts";
1617 import { bakedFiles as scaffoldFiles } from "../src/apps/template.ts";
1718 import { audit } from "../src/contract/audit.ts";
1819 import { probe, type Probed } from "../src/contract/probe.ts";

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs