@loucompanion/forge-bridge 0.1.4-dev.9e8a5b93cbcb → 0.1.4-dev.acacfdecaad2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/README.md +35 -2
  2. package/dist/bridge/bridge.base.d.ts +9 -0
  3. package/dist/bridge/bridge.service.d.ts +84 -2
  4. package/dist/bridge/bridge.service.js +357 -12
  5. package/dist/bridge/bridge.types.d.ts +22 -0
  6. package/dist/bridge/dispatch-result-outbox.d.ts +11 -1
  7. package/dist/bridge/dispatch-result-outbox.js +31 -6
  8. package/dist/bridge/local-yield-flag.d.ts +6 -0
  9. package/dist/bridge/local-yield-flag.js +34 -0
  10. package/dist/bridge/runner-host-capabilities.d.ts +2 -0
  11. package/dist/bridge/runner-host-capabilities.js +4 -0
  12. package/dist/bridge/test-postgres-capability.d.ts +14 -0
  13. package/dist/bridge/test-postgres-capability.js +120 -0
  14. package/dist/cleanup/cleanup.service.d.ts +9 -0
  15. package/dist/cleanup/cleanup.service.js +72 -109
  16. package/dist/cleanup/cleanup.types.d.ts +4 -0
  17. package/dist/cleanup/forge-owned-paths.d.ts +9 -0
  18. package/dist/cleanup/forge-owned-paths.js +53 -0
  19. package/dist/cleanup/host-runtime-ledger.d.ts +5 -0
  20. package/dist/cleanup/host-runtime-ledger.js +109 -0
  21. package/dist/cleanup/managed-branch-sweep.d.ts +27 -0
  22. package/dist/cleanup/managed-branch-sweep.js +111 -0
  23. package/dist/cli/cli.help.js +18 -0
  24. package/dist/cli/cli.service.d.ts +16 -0
  25. package/dist/cli/cli.service.js +142 -16
  26. package/dist/cli/local-config.d.ts +4 -0
  27. package/dist/cli/local-config.js +26 -4
  28. package/dist/runtime/aspnet-runtime-prebuild.js +94 -6
  29. package/dist/runtime/attempt-process-supervisor.d.ts +19 -0
  30. package/dist/runtime/attempt-process-supervisor.js +50 -0
  31. package/dist/runtime/host-database-capability-boundary.d.ts +1 -1
  32. package/dist/runtime/host-database-capability-boundary.js +1 -0
  33. package/dist/runtime/host-facts.d.ts +35 -0
  34. package/dist/runtime/host-facts.js +95 -0
  35. package/dist/runtime/host-load-admission.d.ts +60 -0
  36. package/dist/runtime/host-load-admission.js +99 -0
  37. package/dist/runtime/host-load-child-environment.d.ts +22 -0
  38. package/dist/runtime/host-load-child-environment.js +67 -0
  39. package/dist/runtime/host-load-forge-cgroups.d.ts +49 -0
  40. package/dist/runtime/host-load-forge-cgroups.js +140 -0
  41. package/dist/runtime/host-load-governor-config.d.ts +43 -0
  42. package/dist/runtime/host-load-governor-config.js +76 -0
  43. package/dist/runtime/host-load-governor.d.ts +174 -0
  44. package/dist/runtime/host-load-governor.js +541 -0
  45. package/dist/runtime/host-load-ledger-lock.d.ts +69 -0
  46. package/dist/runtime/host-load-ledger-lock.js +185 -0
  47. package/dist/runtime/host-load-runtime-settings.d.ts +25 -0
  48. package/dist/runtime/host-load-runtime-settings.js +78 -0
  49. package/dist/runtime/host-load-sampler.d.ts +126 -0
  50. package/dist/runtime/host-load-sampler.js +232 -0
  51. package/dist/runtime/host-load-step-class.d.ts +68 -0
  52. package/dist/runtime/host-load-step-class.js +106 -0
  53. package/dist/runtime/host-load-step-reaper.d.ts +27 -0
  54. package/dist/runtime/host-load-step-reaper.js +95 -0
  55. package/dist/runtime/host-load-step-run.d.ts +73 -0
  56. package/dist/runtime/host-load-step-run.js +102 -0
  57. package/dist/runtime/host-load-token-ledger.d.ts +174 -0
  58. package/dist/runtime/host-load-token-ledger.js +421 -0
  59. package/dist/runtime/host-pressure-stall.d.ts +61 -0
  60. package/dist/runtime/host-pressure-stall.js +168 -0
  61. package/dist/runtime/host-runtime-contract.d.ts +4 -0
  62. package/dist/runtime/host-runtime-contract.js +6 -1
  63. package/dist/runtime/host-runtime-lease.d.ts +74 -4
  64. package/dist/runtime/host-runtime-lease.js +334 -19
  65. package/dist/runtime/host-runtime-promotion.js +12 -0
  66. package/dist/runtime/host-runtime-requirements-check.d.ts +17 -0
  67. package/dist/runtime/host-runtime-requirements-check.js +29 -0
  68. package/dist/runtime/host-runtime-requirements.d.ts +36 -0
  69. package/dist/runtime/host-runtime-requirements.js +117 -0
  70. package/dist/runtime/managed-command-teardown.d.ts +62 -0
  71. package/dist/runtime/managed-command-teardown.js +607 -0
  72. package/dist/runtime/playwright-browser-cache.d.ts +39 -0
  73. package/dist/runtime/playwright-browser-cache.js +227 -0
  74. package/dist/runtime/playwright-host-runtime-adapter.d.ts +18 -0
  75. package/dist/runtime/playwright-host-runtime-adapter.js +61 -55
  76. package/dist/runtime/runner-settings.d.ts +100 -0
  77. package/dist/runtime/runner-settings.js +214 -0
  78. package/dist/sandbox/host-capacity-broker.d.ts +107 -0
  79. package/dist/sandbox/host-capacity-broker.js +315 -0
  80. package/dist/sandbox/runtime.d.ts +10 -1
  81. package/dist/sandbox/runtime.js +45 -2
  82. package/dist/sandbox/sandbox-cgroups.d.ts +14 -0
  83. package/dist/sandbox/sandbox-cgroups.js +42 -0
  84. package/dist/session/managed-attempt-tools.d.ts +27 -0
  85. package/dist/session/managed-attempt-tools.js +356 -40
  86. package/dist/session/managed-build-coordinator.d.ts +1 -1
  87. package/dist/session/managed-build-coordinator.js +4 -1
  88. package/dist/session/managed-command-host-load.d.ts +45 -0
  89. package/dist/session/managed-command-host-load.js +82 -0
  90. package/dist/session/mcp-argument-coercion.d.ts +23 -0
  91. package/dist/session/mcp-argument-coercion.js +121 -0
  92. package/dist/session/phase-completion.artifacts.d.ts +7 -0
  93. package/dist/session/phase-completion.artifacts.js +98 -25
  94. package/dist/session/phase-completion.command-validation.d.ts +7 -0
  95. package/dist/session/phase-completion.command-validation.js +77 -0
  96. package/dist/session/phase-completion.d.ts +4 -0
  97. package/dist/session/phase-completion.helpers.js +13 -12
  98. package/dist/session/phase-completion.js +4 -0
  99. package/dist/session/phase-completion.prompts.js +6 -1
  100. package/dist/session/phase-completion.runtime.d.ts +5 -3
  101. package/dist/session/phase-completion.runtime.js +70 -35
  102. package/dist/session/phase-completion.schema-parts.d.ts +19 -0
  103. package/dist/session/phase-completion.schema-parts.js +188 -0
  104. package/dist/session/phase-completion.schemas.d.ts +3 -3
  105. package/dist/session/phase-completion.schemas.js +184 -209
  106. package/dist/session/phase-completion.validation.d.ts +2 -3
  107. package/dist/session/phase-completion.validation.js +46 -92
  108. package/dist/session/pre-publication-host-load.d.ts +27 -0
  109. package/dist/session/pre-publication-host-load.js +111 -0
  110. package/dist/session/pre-publication-process.d.ts +23 -0
  111. package/dist/session/pre-publication-process.js +109 -0
  112. package/dist/session/pre-publication-skipped-tests.d.ts +21 -0
  113. package/dist/session/pre-publication-skipped-tests.js +109 -0
  114. package/dist/session/pre-publication-step-execution.d.ts +11 -0
  115. package/dist/session/pre-publication-step-execution.js +49 -0
  116. package/dist/session/pre-publication-validation.d.ts +9 -9
  117. package/dist/session/pre-publication-validation.js +48 -112
  118. package/dist/session/provider-cli/provider-cli.artifacts.d.ts +2 -1
  119. package/dist/session/provider-cli/provider-cli.artifacts.js +21 -15
  120. package/dist/session/provider-cli/provider-cli.merge-integrity.d.ts +89 -0
  121. package/dist/session/provider-cli/provider-cli.merge-integrity.js +310 -0
  122. package/dist/session/provider-cli/provider-cli.process.d.ts +35 -1
  123. package/dist/session/provider-cli/provider-cli.process.js +189 -19
  124. package/dist/session/provider-cli/provider-cli.prompts.d.ts +5 -0
  125. package/dist/session/provider-cli/provider-cli.prompts.js +20 -2
  126. package/dist/session/provider-cli/provider-cli.service.d.ts +6 -0
  127. package/dist/session/provider-cli/provider-cli.service.js +244 -36
  128. package/dist/session/provider-cli/provider-cli.types.d.ts +30 -0
  129. package/dist/session/provider-cli/provider-in-flight-work.d.ts +6 -0
  130. package/dist/session/provider-cli/provider-in-flight-work.js +47 -0
  131. package/dist/session/provider-cli/provider-output-state.d.ts +6 -0
  132. package/dist/session/provider-cli/provider-output-state.js +9 -0
  133. package/dist/session/publishable-worktree-changes.d.ts +54 -0
  134. package/dist/session/publishable-worktree-changes.js +193 -0
  135. package/dist/session/sandbox-host-capacity-gate.d.ts +30 -0
  136. package/dist/session/sandbox-host-capacity-gate.js +229 -0
  137. package/dist/session/session.base.d.ts +9 -1
  138. package/dist/session/session.service.d.ts +9 -2
  139. package/dist/session/session.service.js +120 -5
  140. package/dist/session/session.types.d.ts +3 -0
  141. package/dist/session/session.types.js +15 -3
  142. package/dist/session/workspace-runtime-fingerprint.d.ts +32 -0
  143. package/dist/session/workspace-runtime-fingerprint.js +138 -0
  144. package/dist/shared/process/host-process-supervisor.d.ts +1 -0
  145. package/dist/shared/process/host-process-supervisor.js +1 -1
  146. package/dist/shared/process/process-tree.d.ts +52 -0
  147. package/dist/shared/process/process-tree.js +144 -0
  148. package/dist/shared/process/process.d.ts +67 -0
  149. package/dist/shared/process/process.js +213 -11
  150. package/dist/version.d.ts +1 -1
  151. package/dist/version.js +1 -1
  152. package/dist/worktree/dependency-warmer.d.ts +25 -0
  153. package/dist/worktree/dependency-warmer.js +46 -10
  154. package/dist/worktree/worktree.service.d.ts +10 -1
  155. package/dist/worktree/worktree.service.js +42 -2
  156. package/dist/worktree/worktree.types.d.ts +7 -0
  157. package/package.json +1 -1
@@ -4,9 +4,12 @@ import path from "node:path";
4
4
  import { isAlias, parseDocument, visit } from "yaml";
5
5
  import { readCanonicalSourceFile } from "./canonical-source-file.js";
6
6
  import { isGeneratedOutputDirectoryName } from "./generated-output-reset.js";
7
+ import { parseHostRuntimeRequirements } from "./host-runtime-requirements.js";
7
8
  export const hostRuntimeContractPath = ".forge/forge.runtime.yml";
8
9
  export const hostRuntimeTestPostgresAdminEnvironment = "FORGE_TEST_POSTGRES_ADMIN_CONNECTION_STRING";
9
10
  export const hostRuntimeLegacyTestPostgresEnvironment = "FORGE_TEST_POSTGRES_CONNECTION_STRING";
11
+ // Optional superuser login for operator-run .NET fixtures. Never reaches attempt, validation or provider processes.
12
+ export const hostRuntimeTestPostgresProvisionerEnvironment = "FORGE_TEST_POSTGRES_PROVISIONER_CONNECTION_STRING";
10
13
  const maximumContractBytes = 64 * 1024;
11
14
  const maximumDepth = 12;
12
15
  // Every discovery scan stops after this many directory entries. A monorepo needs a few
@@ -45,7 +48,7 @@ const ignoredDiscoveryDirectories = new Set([
45
48
  "vendor",
46
49
  "venv",
47
50
  ]);
48
- const topLevelKeys = new Set(["schemaVersion", "runtime"]);
51
+ const topLevelKeys = new Set(["schemaVersion", "runtime", "requires", "costHints"]);
49
52
  const runtimeKeys = new Set(["hostConcurrency", "ports", "playwright", "browserProfile", "singletonResources"]);
50
53
  const portKeys = new Set(["adapter", "launch", "env", "baseUrlEnv", "format"]);
51
54
  const launchKeys = new Set(["command", "args", "workingDirectory", "environment"]);
@@ -547,6 +550,7 @@ export function validateHostRuntimeContract(source) {
547
550
  throw new Error("runtime_contract_invalid: runtime.browserProfile must be isolated.");
548
551
  }
549
552
  const ports = parsePorts(runtime.ports);
553
+ const requires = parseHostRuntimeRequirements(root.requires, root.costHints);
550
554
  return {
551
555
  schemaVersion: 1,
552
556
  runtime: {
@@ -556,6 +560,7 @@ export function validateHostRuntimeContract(source) {
556
560
  browserProfile,
557
561
  singletonResources: parseSingletonResources(runtime.singletonResources),
558
562
  },
563
+ ...(requires ? { requires } : {}),
559
564
  };
560
565
  }
561
566
  function parsePlaywright(value, ports) {
@@ -1,4 +1,5 @@
1
- import type { RunOnceDispatchPacket } from "../session/session.types.js";
1
+ import type { HostRequirementsCheck } from "./host-runtime-requirements-check.js";
2
+ import { type RunOnceDispatchPacket } from "../session/session.types.js";
2
3
  import { type ProviderProcessRunner } from "../session/provider-cli/provider-cli.process.js";
3
4
  import { type RuntimeIsolationLease } from "./runtime-isolation-lease.js";
4
5
  import { type LoadedHostRuntimeContract } from "./host-runtime-contract.js";
@@ -12,6 +13,9 @@ import { type MemoryAdmissionDiagnostics } from "./memory-capacity.js";
12
13
  import { PlaywrightHostRuntimeAdapter } from "./playwright-host-runtime-adapter.js";
13
14
  import { HostParallelPromotionStore } from "./host-runtime-promotion.js";
14
15
  import { type HostProcessRecovery } from "../shared/process/host-process-recovery.js";
16
+ import { HostLoadGovernor } from "./host-load-governor.js";
17
+ import { type HostLoadGovernorSource } from "./host-load-sampler.js";
18
+ import type { RunnerHostDefaults } from "./runner-settings.js";
15
19
  export interface HostRuntimeLeaseStart {
16
20
  readonly lease: RuntimeIsolationLease;
17
21
  readonly environment: Readonly<Record<string, string>>;
@@ -25,7 +29,7 @@ export interface HostRuntimeAdmissionCheckpoint {
25
29
  }
26
30
  export type HostRuntimeAdmissionCheckpointHandler = (checkpoint: HostRuntimeAdmissionCheckpoint) => void | Promise<void>;
27
31
  export interface HostRuntimeProjectCheckpoint {
28
- readonly code: "host_runtime_build_started" | "host_runtime_build_cached" | "host_runtime_build_completed" | "host_runtime_database_provisioned";
32
+ readonly code: "host_runtime_build_started" | "host_runtime_build_waiting_for_host_capacity" | "host_runtime_build_cached" | "host_runtime_build_completed" | "host_runtime_database_provisioned";
29
33
  readonly message: string;
30
34
  readonly data?: Readonly<Record<string, unknown>>;
31
35
  }
@@ -92,10 +96,21 @@ export interface HostNodeRuntimeLaunch<T> extends NodeRuntimeAdapterLaunch<T> {
92
96
  readonly runtimeLease: RuntimeIsolationLease;
93
97
  }
94
98
  export interface HostRuntimeLeaseRuntime {
99
+ setRequirementsCheck?(check: HostRequirementsCheck | null): void;
100
+ /** Decision 0014: today's max attempts and memory reserve defaults, before env bounds. */
101
+ capacityLimitDefaults?(): RunnerHostDefaults;
102
+ /** Decision 0014: the effective max attempts and memory reserve, from the next attempt admission. */
103
+ applyCapacityLimits?(limits: HostCapacityLimits): void;
95
104
  acquirePreparation?(dispatch: RunOnceDispatchPacket, signal?: AbortSignal): Promise<readonly string[]>;
96
105
  acquire(dispatch: RunOnceDispatchPacket, signal?: AbortSignal): Promise<readonly string[]>;
97
106
  start(dispatch: RunOnceDispatchPacket, worktreePath: string, signal?: AbortSignal, onAdmissionCheckpoint?: HostRuntimeAdmissionCheckpointHandler): Promise<HostRuntimeLeaseStart>;
98
107
  startConfiguredProject(dispatchAttemptId: string, fencingToken: string, signal?: AbortSignal, onProjectCheckpoint?: HostRuntimeProjectCheckpointHandler): Promise<HostRuntimeLeaseStart>;
108
+ /**
109
+ * Stops the attempt's configured project processes, releases their ports, and
110
+ * starts them again (rebuilding when sources changed) so the stack serves the
111
+ * current workspace. Returns the environment with the newly assigned URLs.
112
+ */
113
+ restartConfiguredProject?(dispatchAttemptId: string, fencingToken: string, signal?: AbortSignal, onProjectCheckpoint?: HostRuntimeProjectCheckpointHandler): Promise<HostRuntimeLeaseStart>;
99
114
  updateLease(dispatchAttemptId: string, fencingToken: string, expiresAt: string): Promise<void>;
100
115
  providerProcessRunner?(dispatchAttemptId: string, fencingToken: string): ProviderProcessRunner | null;
101
116
  providerMemoryTelemetry?(dispatchAttemptId: string, fencingToken: string): AttemptProcessTreeMemoryTelemetry | null;
@@ -104,7 +119,10 @@ export interface HostRuntimeLeaseRuntime {
104
119
  hasForegroundDemand?(): boolean;
105
120
  reap?(options: HostRuntimeReapOptions): Promise<HostRuntimeReapReport>;
106
121
  snapshot?(): HostRuntimeCapacitySnapshot;
122
+ /** Variables that let the completion MCP server share this host's load governor. */
123
+ hostLoadChildEnvironment?(): Readonly<Record<string, string>>;
107
124
  }
125
+ export type HostRuntimeAdmissionPriority = "foreground" | "background";
108
126
  export interface HostCapacityResourceSample {
109
127
  readonly totalMemoryBytes: number;
110
128
  readonly availableMemoryBytes: number;
@@ -140,10 +158,26 @@ export declare class HostRuntimeLeaseManager implements HostRuntimeLeaseRuntime
140
158
  private workspaceAvailableBytes;
141
159
  private readonly portBroker;
142
160
  private readonly nodeAdapter;
143
- private readonly capacityConfiguration;
161
+ /** Rebuilt by applyCapacityLimits (decision 0014); every admission reads the current one. */
162
+ private capacityConfiguration;
144
163
  private readonly memoryAvailability;
145
164
  private readonly executionRoot;
146
- constructor(stateRoot: string, portBroker?: HostPortBroker, nodeAdapter?: NodeHostRuntimeAdapter, processSupervisors?: AttemptProcessSupervisorRegistry, processRunner?: ProviderProcessRunner, listenerInspector?: HostListenerInspector, promotionStore?: HostParallelPromotionStore, playwrightAdapter?: PlaywrightHostRuntimeAdapter, processRecovery?: HostProcessRecovery, capacityResourceSample?: HostCapacityResourceSample | undefined, executionRoot?: string, databaseBroker?: AttemptDatabaseBroker | null);
165
+ /** Host-wide admission for heavy steps (decision 0013); inert unless FORGE_HOST_LOAD_GOVERNOR=on. */
166
+ readonly hostLoadGovernor: HostLoadGovernor;
167
+ private requirementsCheck;
168
+ /** Installs the decision 0013 accept-time requirements recheck for host attempts. */
169
+ setRequirementsCheck(check: HostRequirementsCheck | null): void;
170
+ constructor(stateRoot: string, portBroker?: HostPortBroker, nodeAdapter?: NodeHostRuntimeAdapter, processSupervisors?: AttemptProcessSupervisorRegistry, processRunner?: ProviderProcessRunner, listenerInspector?: HostListenerInspector, promotionStore?: HostParallelPromotionStore, playwrightAdapter?: PlaywrightHostRuntimeAdapter, processRecovery?: HostProcessRecovery, capacityResourceSample?: HostCapacityResourceSample | undefined, executionRoot?: string, databaseBroker?: AttemptDatabaseBroker | null, hostLoad?: HostLoadGovernorSource | null);
171
+ /** Today's defaults for the limits the server can push, before any env bound (decision 0014). */
172
+ capacityLimitDefaults(): RunnerHostDefaults;
173
+ /**
174
+ * Decision 0014: the bridge's effective max attempts and memory reserve. They
175
+ * apply from the next attempt admission; admitted attempts keep their
176
+ * reservations and are never preempted, even when the new limit is lower than
177
+ * what already runs. The idle reserve follows the reserve as at startup.
178
+ */
179
+ applyCapacityLimits(limits: HostCapacityLimits): void;
180
+ hostLoadChildEnvironment(): Readonly<Record<string, string>>;
147
181
  reap(options: HostRuntimeReapOptions): Promise<HostRuntimeReapReport>;
148
182
  snapshot(): HostRuntimeCapacitySnapshot;
149
183
  hasForegroundDemand(): boolean;
@@ -165,6 +199,24 @@ export declare class HostRuntimeLeaseManager implements HostRuntimeLeaseRuntime
165
199
  start(dispatch: RunOnceDispatchPacket, worktreePath: string, signal?: AbortSignal, onAdmissionCheckpoint?: HostRuntimeAdmissionCheckpointHandler): Promise<HostRuntimeLeaseStart>;
166
200
  updateLease(dispatchAttemptId: string, fencingToken: string, expiresAt: string): Promise<void>;
167
201
  startConfiguredProject(dispatchAttemptId: string, fencingToken: string, signal?: AbortSignal, onProjectCheckpoint?: HostRuntimeProjectCheckpointHandler): Promise<HostRuntimeLeaseStart>;
202
+ /**
203
+ * Launches the configured project. Only the first launch, from the admitted commit's clean
204
+ * source, may record parallel-safety proof: a restart serves the workspace after the provider
205
+ * edited it, and a proof observed there would be stored under the admitted commit and could
206
+ * move this or a later attempt at that commit into shared admission for source it never ran.
207
+ */
208
+ private launchConfiguredProject;
209
+ /**
210
+ * Relaunches the configured project so it serves the current workspace. Every
211
+ * configured process stops (the API port changes, so the dev server's proxy target
212
+ * must change with it), its port reservation is released and dropped from the
213
+ * persisted lease, and the regular start path runs again, including the ASP.NET
214
+ * prebuild, whose receipt rebuilds only when the sources changed.
215
+ */
216
+ restartConfiguredProject(dispatchAttemptId: string, fencingToken: string, signal?: AbortSignal, onProjectCheckpoint?: HostRuntimeProjectCheckpointHandler): Promise<HostRuntimeLeaseStart>;
217
+ private runConfiguredProjectRestart;
218
+ /** Stops configured project processes in reverse launch order and releases their ports. */
219
+ private stopConfiguredProject;
168
220
  providerProcessRunner(dispatchAttemptId: string, fencingToken: string): ProviderProcessRunner | null;
169
221
  private markCapacityReservationRunning;
170
222
  providerMemoryTelemetry(dispatchAttemptId: string, fencingToken: string): AttemptProcessTreeMemoryTelemetry | null;
@@ -215,3 +267,21 @@ export declare class HostRuntimeCapacityRequestImpossibleError extends Error {
215
267
  }
216
268
  export declare function hostRuntimeEventResources(lease: RuntimeIsolationLease, runtimeContract?: LoadedHostRuntimeContract, executionClass?: HostRuntimeExecutionClass): Record<string, unknown>;
217
269
  export declare function hostRuntimeSingletonKeys(dispatch: RunOnceDispatchPacket): readonly string[];
270
+ /**
271
+ * Every environment key `hostRuntimeEnvironment` and the Playwright overlay derive from the
272
+ * configured project's assigned ports. They name a live stack, so they are withheld while the
273
+ * stack is down: after its ports are released another attempt may be assigned them.
274
+ */
275
+ export declare function hostRuntimeStackEnvironmentKeys(runtimeContract: LoadedHostRuntimeContract): readonly string[];
276
+ export declare function runtimeAdmissionPriority(dispatch: RunOnceDispatchPacket): HostRuntimeAdmissionPriority;
277
+ /** The pushed attempt limits (decision 0014), already resolved against host env bounds. */
278
+ export interface HostCapacityLimits {
279
+ readonly maxConcurrentAttempts: number;
280
+ readonly memoryReserveBytes: number;
281
+ }
282
+ /**
283
+ * Today's max attempts and adaptive memory reserve for this host, before
284
+ * FORGE_HOST_MAX_CONCURRENT_ATTEMPTS and FORGE_HOST_MEMORY_RESERVE_BYTES
285
+ * (decision 0014 treats those as bounds on the server's values).
286
+ */
287
+ export declare function hostCapacityLimitDefaults(capacityResourceSample?: HostCapacityResourceSample): RunnerHostDefaults;