@senpi/runtime 3.0.232 → 3.0.234
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.
- package/dist/cli/deploy-render.d.ts +0 -2
- package/dist/cli/deploy-render.d.ts.map +1 -1
- package/dist/cli/deploy-render.js +0 -2
- package/dist/cli/deploy-render.js.map +1 -1
- package/dist/cli/guide-commands.d.ts.map +1 -1
- package/dist/cli/guide-commands.js +8 -6
- package/dist/cli/guide-commands.js.map +1 -1
- package/dist/cli/senpi-commands.d.ts.map +1 -1
- package/dist/cli/senpi-commands.js +7 -0
- package/dist/cli/senpi-commands.js.map +1 -1
- package/dist/deploy/box-grow.d.ts +23 -0
- package/dist/deploy/box-grow.d.ts.map +1 -0
- package/dist/deploy/box-grow.js +79 -0
- package/dist/deploy/box-grow.js.map +1 -0
- package/dist/deploy/job.d.ts +2 -0
- package/dist/deploy/job.d.ts.map +1 -1
- package/dist/deploy/job.js +2 -2
- package/dist/deploy/job.js.map +1 -1
- package/dist/deploy/messages.d.ts +4 -12
- package/dist/deploy/messages.d.ts.map +1 -1
- package/dist/deploy/messages.js +17 -56
- package/dist/deploy/messages.js.map +1 -1
- package/dist/deploy/orchestrator.d.ts +9 -16
- package/dist/deploy/orchestrator.d.ts.map +1 -1
- package/dist/deploy/orchestrator.js +94 -97
- package/dist/deploy/orchestrator.js.map +1 -1
- package/dist/deploy/register.d.ts +0 -2
- package/dist/deploy/register.d.ts.map +1 -1
- package/dist/deploy/register.js +32 -14
- package/dist/deploy/register.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/senpi/client.d.ts.map +1 -1
- package/dist/senpi/client.js +8 -0
- package/dist/senpi/client.js.map +1 -1
- package/dist/senpi/types.d.ts +7 -0
- package/dist/senpi/types.d.ts.map +1 -1
- package/dist/strategy/settings.d.ts +25 -0
- package/dist/strategy/settings.d.ts.map +1 -0
- package/dist/strategy/settings.js +127 -0
- package/dist/strategy/settings.js.map +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/dist/deploy/box-cap.d.ts +0 -7
- package/dist/deploy/box-cap.d.ts.map +0 -1
- package/dist/deploy/box-cap.js +0 -13
- package/dist/deploy/box-cap.js.map +0 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { StrategyCloseResult, StrategyLimits, StrategySummary } from "../senpi/types.js";
|
|
2
2
|
import { type StrategyCatalogCopy, type StrategyFacts } from "../strategy/facts.js";
|
|
3
|
+
import { type SimulationGroup, type StrategySettings } from "../strategy/settings.js";
|
|
3
4
|
import { type DeployPackage } from "./package.js";
|
|
4
5
|
import type { MeasureOutcome, ScannerMeasurement, UnmeasuredScanner } from "../validate/index.js";
|
|
5
6
|
import { type ScannerClassMb, type SimulationCost } from "./scanner-class.js";
|
|
7
|
+
import type { BoxGrowOutcome } from "./box-grow.js";
|
|
6
8
|
export type JobPhase = "reconcile" | "preflight" | "create" | "install" | "observe";
|
|
7
9
|
export type StepName = "reconcile" | "preflight" | "create" | "install" | "observe";
|
|
8
10
|
export type StepStatus = "ok" | "skipped" | "pending" | "refused" | "failed" | "unobserved";
|
|
@@ -75,6 +77,9 @@ export interface DeployDeps {
|
|
|
75
77
|
simulation?: boolean;
|
|
76
78
|
cost?: SimulationCost;
|
|
77
79
|
idempotencyKey?: string;
|
|
80
|
+
settings?: StrategySettings;
|
|
81
|
+
fromSimulationId?: string;
|
|
82
|
+
group?: SimulationGroup;
|
|
78
83
|
}): Promise<{
|
|
79
84
|
success: boolean;
|
|
80
85
|
strategyId?: string;
|
|
@@ -97,16 +102,8 @@ export interface DeployDeps {
|
|
|
97
102
|
* without them: strategy-manager still checks every create.
|
|
98
103
|
*/
|
|
99
104
|
getStrategyLimits(): Promise<StrategyLimits>;
|
|
100
|
-
/**
|
|
101
|
-
|
|
102
|
-
* (`MAX_RUNTIMES_PER_BOX`, default 20), and the counted ids with no live runtime (named in the
|
|
103
|
-
* refusal: stopping a strategy does not remove them).
|
|
104
|
-
*/
|
|
105
|
-
boxRuntimes(): Promise<{
|
|
106
|
-
running: number;
|
|
107
|
-
cap: number;
|
|
108
|
-
notRunning?: string[];
|
|
109
|
-
}>;
|
|
105
|
+
/** Ask the orchestrator to grow this box one step (`POST /v1/agents/me/box/grow`). */
|
|
106
|
+
growBox(): Promise<BoxGrowOutcome>;
|
|
110
107
|
/**
|
|
111
108
|
* The box's memory limit (absent when it can't be read) and the scanner classes each registry row
|
|
112
109
|
* holds, summed per row. Live rows hold none.
|
|
@@ -239,6 +236,8 @@ export interface DeployParams {
|
|
|
239
236
|
createKeySeed?: string;
|
|
240
237
|
/** Classes the user raised by scanner name. A raise below the measured class is ignored. */
|
|
241
238
|
raisedClasses?: Record<string, ScannerClassMb>;
|
|
239
|
+
/** The simulation a live deploy is taken from (`simulation-<uuid>`); every live create carries it. */
|
|
240
|
+
fromSimulationId?: string;
|
|
242
241
|
}
|
|
243
242
|
export interface StepOutcome {
|
|
244
243
|
status: StepStatus;
|
|
@@ -332,12 +331,6 @@ export interface DeployReport {
|
|
|
332
331
|
* USER to establish the real figure. Mutually exclusive per wallet by construction.
|
|
333
332
|
*/
|
|
334
333
|
fundedUnreadableNote?: string;
|
|
335
|
-
/**
|
|
336
|
-
* The `[W_BOX_RUNTIME_CAP_ADOPTED]` warn, verbatim: adopted wallets with no runtime on this box
|
|
337
|
-
* take it past its cap. The cap refuses only new wallets; whether it should also refuse these is
|
|
338
|
-
* a pending decision, so this never changes `overall`.
|
|
339
|
-
*/
|
|
340
|
-
boxCapNote?: string;
|
|
341
334
|
/** Simulation only: what this deploy measured for the simulation's size, per instance and scanner. */
|
|
342
335
|
measurements?: (ScannerMeasurement & {
|
|
343
336
|
instance: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/deploy/orchestrator.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,mBAAmB,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AC,MAAM,CAAC,EAC1B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,CAAC,CAAC,CAkBZ;AA+BD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,iBAAiB,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAE5F;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAyxE7F"}
|
|
@@ -27,6 +27,7 @@ import { parse as parseYaml } from "yaml";
|
|
|
27
27
|
import { isSimulationAddress, isSimulationStrategyId, modeOf } from "../senpi/simulation.js";
|
|
28
28
|
import { loadRuntimeConfig } from "../runtime/load-runtime-config.js";
|
|
29
29
|
import { catalogCopy, strategyFacts } from "../strategy/facts.js";
|
|
30
|
+
import { simulationGroup, strategySettings } from "../strategy/settings.js";
|
|
30
31
|
import { buildUniverseNotLiveRefusal, buildUniverseUnavailableDetail, checkPackageUniverse, describeUniverseVerdict, } from "../universe/package-universe.js";
|
|
31
32
|
import { instancesWithoutDslExit, nonLowercasePackageId, renderRuntimeYaml, runtimeUsesLlmDecisions, readRuntimeYaml, runtimeIdFor, scannersDeclaringEnabled, unboundWalletInstances, walletName, } from "./package.js";
|
|
32
33
|
import { DEAD_STATUSES, INITIALIZING_STATUSES, classifyCloseRead, isDead, isInitializing, } from "../senpi/strategy-status.js";
|
|
@@ -40,10 +41,13 @@ import { buildInstanceDirCollisionRefusal, buildProofRefusal, checkPackageProof,
|
|
|
40
41
|
import { readRecord } from "../validate/proof.js";
|
|
41
42
|
import { EXTERNAL_SCANNER_DEFAULT_INTERVAL_SECONDS } from "../runtime-api/intake/intake-mount.js";
|
|
42
43
|
import { BOX_BASE_MEMORY_MB, SCANNER_CLASSES_MB, classesByScanner, createIdempotencyKey, simulationCost, } from "./scanner-class.js";
|
|
43
|
-
import { buildAmbiguousRefusal, buildBindingUnknownRefusal, buildBudgetEscape, buildBudgetNotPositiveRefusal, buildBudgetRequiredRefusal, buildCreateAbandonedDetail, buildCreateDeadDetail, buildCreateNameRetryNotIssuedDetail, buildCreateNotDeployableDetail, buildCreatePendingDetail, buildDecisionModelEnvRefusal, buildDecisionModelRefusal, buildForeignPackageRefusal, buildFundedUnreadableNote, buildInstallGateRefusal, buildInstallGateUnavailableDetail, buildInstallIndeterminateDetail, buildInstallInFlightDetail, buildNoDslExitRefusal, buildNonLowercaseIdRefusal, buildNotDeployableRefusal, buildSimulationCreateUnsupportedRefusal, buildSimulationRoutingUnprovenRefusal, buildSimulationCreateWentLiveDetail, buildPartialFundNote, buildRollbackIncomplete, buildScannerEnabledUnsupportedRefusal,
|
|
44
|
+
import { buildAmbiguousRefusal, buildBindingUnknownRefusal, buildBudgetEscape, buildBudgetNotPositiveRefusal, buildBudgetRequiredRefusal, buildCreateAbandonedDetail, buildCreateDeadDetail, buildCreateNameRetryNotIssuedDetail, buildCreateNotDeployableDetail, buildCreatePendingDetail, buildDecisionModelEnvRefusal, buildDecisionModelRefusal, buildForeignPackageRefusal, buildFundedUnreadableNote, buildInstallGateRefusal, buildInstallGateUnavailableDetail, buildInstallIndeterminateDetail, buildInstallInFlightDetail, buildNoDslExitRefusal, buildNonLowercaseIdRefusal, buildNotDeployableRefusal, buildSimulationCreateUnsupportedRefusal, buildSimulationRoutingUnprovenRefusal, buildSimulationCreateWentLiveDetail, buildPartialFundNote, buildRollbackIncomplete, buildScannerEnabledUnsupportedRefusal, buildBoxFullRefusal, buildBoxMemoryRefusal, buildCostNotTakenNote, buildScannerTooLargeRefusal, buildScannerUnmeasuredRefusal, buildShareOverrunRefusal, buildSoftBudgetNote, buildStrategyLimitRefusal, limitShort, buildUnboundWalletRefusal, buildUnobservedDetail, buildUnreadableWalletRefusal, buildUnwiredInstallDetail, buildRuntimeIdHeldByOtherWorldDetail, buildRuntimeIdHeldByOtherWorldRefusal, buildWalletWorldMismatchDetail, foreignCollisionClause, forwardTense, fundedClause, itsFunded, matchedByClause, reconcileCanMatchByName, rollbackFundedClause, } from "./messages.js";
|
|
44
45
|
/** Stands in for the wallet when rendering a recipe only to read its facts, which never include it. */
|
|
45
46
|
const FACTS_STAND_IN_WALLET = "0x0000000000000000000000000000000000000000";
|
|
46
47
|
const CREATE_POLL_MS = 10_000;
|
|
48
|
+
/** How long a grown box gets to show its larger cgroup limit; the measured lag is 15-16 s. */
|
|
49
|
+
const BOX_GROW_WAIT_MS = 90_000;
|
|
50
|
+
const BOX_GROW_POLL_MS = 5_000;
|
|
47
51
|
const OBSERVE_POLL_MS = 5_000;
|
|
48
52
|
const STEP_ORDER = ["reconcile", "preflight", "create", "install", "observe"];
|
|
49
53
|
/**
|
|
@@ -616,7 +620,6 @@ export async function runDeploy(params, deps) {
|
|
|
616
620
|
* having created, which is not known until the report is assembled.
|
|
617
621
|
*/
|
|
618
622
|
const soft = { min: null, under: [] };
|
|
619
|
-
let boxCapNote;
|
|
620
623
|
const measurements = [];
|
|
621
624
|
const unmeasured = [];
|
|
622
625
|
const classes = [];
|
|
@@ -1449,9 +1452,8 @@ export async function runDeploy(params, deps) {
|
|
|
1449
1452
|
if (!(await refusedOnRuntimeIdHeldByOtherWorld())) {
|
|
1450
1453
|
if (needing.length > 0)
|
|
1451
1454
|
await runPreflight();
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
await refusedOnBoxRuntimeCap().catch((err) => log(`deploy: box cap read failed: ${errorText(err)}`));
|
|
1455
|
+
else if (pkg.simulation)
|
|
1456
|
+
await refusedOnBoxMemory();
|
|
1455
1457
|
}
|
|
1456
1458
|
}
|
|
1457
1459
|
catch (err) {
|
|
@@ -1525,8 +1527,6 @@ export async function runDeploy(params, deps) {
|
|
|
1525
1527
|
}
|
|
1526
1528
|
return;
|
|
1527
1529
|
}
|
|
1528
|
-
if (await refusedOnBoxRuntimeCap())
|
|
1529
|
-
return;
|
|
1530
1530
|
if (pkg.simulation && (await refusedOnBoxMemory()))
|
|
1531
1531
|
return;
|
|
1532
1532
|
if (!(await simulationRoutingProven()))
|
|
@@ -1590,59 +1590,6 @@ export async function runDeploy(params, deps) {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
return true;
|
|
1592
1592
|
}
|
|
1593
|
-
/**
|
|
1594
|
-
* Refuses new wallets past the cap. Adopted wallets that still need a runtime count too, but only
|
|
1595
|
-
* toward a warning ({@link DeployReport.boxCapNote}).
|
|
1596
|
-
*/
|
|
1597
|
-
async function refusedOnBoxRuntimeCap() {
|
|
1598
|
-
const adopted = await adoptedWalletsNeedingRuntime().catch((err) => {
|
|
1599
|
-
log(`deploy: counting adopted wallets for the box cap failed: ${errorText(err)}`);
|
|
1600
|
-
return [];
|
|
1601
|
-
});
|
|
1602
|
-
const needed = needing.length;
|
|
1603
|
-
if (needed === 0 && adopted.length === 0)
|
|
1604
|
-
return false;
|
|
1605
|
-
const box = await deps.boxRuntimes();
|
|
1606
|
-
const replaced = await rowsReplacedByNewWallets();
|
|
1607
|
-
const after = box.running - replaced.length + needed;
|
|
1608
|
-
if (needed === 0 || after <= box.cap) {
|
|
1609
|
-
if (after + adopted.length > box.cap) {
|
|
1610
|
-
boxCapNote = buildAdoptedOverBoxCapNote(adopted, after + adopted.length, box.cap, pkg.simulation);
|
|
1611
|
-
log(`deploy: ${boxCapNote}`);
|
|
1612
|
-
}
|
|
1613
|
-
return false;
|
|
1614
|
-
}
|
|
1615
|
-
refused = true;
|
|
1616
|
-
const detail = buildBoxRuntimeCapRefusal(needed, box, pkg, budget, replaced);
|
|
1617
|
-
for (const run of needing) {
|
|
1618
|
-
record(run, "preflight", {
|
|
1619
|
-
status: "refused",
|
|
1620
|
-
detail,
|
|
1621
|
-
evidence: { needed, ...box, ...(replaced.length > 0 ? { replaced } : {}) },
|
|
1622
|
-
});
|
|
1623
|
-
}
|
|
1624
|
-
return true;
|
|
1625
|
-
}
|
|
1626
|
-
async function refusedOnBoxMemory() {
|
|
1627
|
-
const declaredMb = installing.reduce((sum, run) => sum + classTotal(costs.get(run.inst.name)), 0);
|
|
1628
|
-
if (declaredMb === 0)
|
|
1629
|
-
return false;
|
|
1630
|
-
const box = await deps.boxScannerMemory();
|
|
1631
|
-
if (box.limitMb === undefined) {
|
|
1632
|
-
log("deploy: box memory limit unreadable; the scanner classes were not checked against it");
|
|
1633
|
-
return false;
|
|
1634
|
-
}
|
|
1635
|
-
const ours = new Set(pkg.instances.map((inst) => runtimeIdFor(pkg, inst)));
|
|
1636
|
-
const othersMb = box.runtimes.filter((r) => !ours.has(r.id)).reduce((sum, r) => sum + r.classesMb, 0);
|
|
1637
|
-
if (othersMb + declaredMb <= box.limitMb - BOX_BASE_MEMORY_MB)
|
|
1638
|
-
return false;
|
|
1639
|
-
refused = true;
|
|
1640
|
-
const memory = { limitMb: box.limitMb, baseMb: BOX_BASE_MEMORY_MB, othersMb, declaredMb };
|
|
1641
|
-
const detail = buildBoxMemoryRefusal(memory, pkg, budget);
|
|
1642
|
-
for (const run of needing)
|
|
1643
|
-
record(run, "preflight", { status: "refused", detail, evidence: memory });
|
|
1644
|
-
return true;
|
|
1645
|
-
}
|
|
1646
1593
|
/**
|
|
1647
1594
|
* Read the limits once and refuse the WHOLE package when it needs more new strategies than either
|
|
1648
1595
|
* limit has left. strategy-manager checks each create on its own, so without this a 3-wallet
|
|
@@ -1678,39 +1625,77 @@ export async function runDeploy(params, deps) {
|
|
|
1678
1625
|
}
|
|
1679
1626
|
return true;
|
|
1680
1627
|
}
|
|
1681
|
-
/**
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
*/
|
|
1685
|
-
async function adoptedWalletsNeedingRuntime() {
|
|
1686
|
-
const names = [];
|
|
1628
|
+
/** The fit is checked again only once the cgroup shows the larger limit a grow asked for. */
|
|
1629
|
+
async function refusedOnBoxMemory() {
|
|
1630
|
+
let declaredMb = 0;
|
|
1687
1631
|
for (const run of installing) {
|
|
1688
|
-
if (run
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1632
|
+
if (!(await runtimeAlreadyRunsOnWallet(run)))
|
|
1633
|
+
declaredMb += classTotal(costs.get(run.inst.name));
|
|
1634
|
+
}
|
|
1635
|
+
if (declaredMb === 0)
|
|
1636
|
+
return false;
|
|
1637
|
+
const ours = new Set(pkg.instances.map((inst) => runtimeIdFor(pkg, inst)));
|
|
1638
|
+
for (;;) {
|
|
1639
|
+
const box = await deps.boxScannerMemory();
|
|
1640
|
+
if (box.limitMb === undefined) {
|
|
1641
|
+
log("deploy: box memory limit unreadable; the scanner classes were not checked against it");
|
|
1642
|
+
return false;
|
|
1643
|
+
}
|
|
1644
|
+
const othersMb = box.runtimes.filter((r) => !ours.has(r.id)).reduce((sum, r) => sum + r.classesMb, 0);
|
|
1645
|
+
if (othersMb + declaredMb <= box.limitMb - BOX_BASE_MEMORY_MB)
|
|
1646
|
+
return false;
|
|
1647
|
+
const memory = { limitMb: box.limitMb, baseMb: BOX_BASE_MEMORY_MB, othersMb, declaredMb };
|
|
1648
|
+
const grow = await deps.growBox();
|
|
1649
|
+
if (grow.kind === "grown") {
|
|
1650
|
+
emitPhase("preflight", `Growing your box to ${grow.afterGb} GB to fit this simulation`);
|
|
1651
|
+
const grownLimitMb = await boxLimitAbove(box.limitMb);
|
|
1652
|
+
if (grownLimitMb !== undefined) {
|
|
1653
|
+
log(`deploy: box grown from ${grow.beforeGb} GB to ${grow.afterGb} GB; ` +
|
|
1654
|
+
`memory limit ${box.limitMb} MB -> ${grownLimitMb} MB`);
|
|
1655
|
+
continue;
|
|
1656
|
+
}
|
|
1657
|
+
const waitedSec = BOX_GROW_WAIT_MS / 1000;
|
|
1658
|
+
const reason = `the orchestrator grew it to ${grow.afterGb} GB, but its memory limit still read ` +
|
|
1659
|
+
`${box.limitMb} MB after ${waitedSec} s`;
|
|
1660
|
+
log(`deploy: box grow unconfirmed: ${reason}`);
|
|
1661
|
+
return refuseOnBoxMemory(memory, { reason });
|
|
1662
|
+
}
|
|
1663
|
+
if (grow.kind === "full") {
|
|
1664
|
+
log(`deploy: box is at its largest (${grow.largestGb ?? "?"} GB) at ${box.limitMb} MB`);
|
|
1665
|
+
return refuseOnBoxMemory(memory, { full: grow.largestGb });
|
|
1666
|
+
}
|
|
1667
|
+
log(`deploy: box grow unavailable: ${grow.reason}`);
|
|
1668
|
+
return refuseOnBoxMemory(memory, { reason: grow.reason });
|
|
1697
1669
|
}
|
|
1698
|
-
return names;
|
|
1699
1670
|
}
|
|
1700
|
-
/**
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1671
|
+
/** Install skips such a run, and its row's classes are already among the box's. */
|
|
1672
|
+
async function runtimeAlreadyRunsOnWallet(run) {
|
|
1673
|
+
if (run.needsWallet || !run.report.wallet)
|
|
1674
|
+
return false;
|
|
1675
|
+
const row = await deps.registryFindByWallet(run.report.wallet);
|
|
1676
|
+
return row !== undefined && (await deps.runtimeIsLive(row.id));
|
|
1677
|
+
}
|
|
1678
|
+
async function boxLimitAbove(limitMb) {
|
|
1679
|
+
const deadline = deps.now() + BOX_GROW_WAIT_MS;
|
|
1680
|
+
for (;;) {
|
|
1681
|
+
await deps.sleep(BOX_GROW_POLL_MS);
|
|
1682
|
+
const now = (await deps.boxScannerMemory()).limitMb;
|
|
1683
|
+
if (now !== undefined && now > limitMb)
|
|
1684
|
+
return now;
|
|
1685
|
+
if (deps.now() >= deadline)
|
|
1686
|
+
return undefined;
|
|
1712
1687
|
}
|
|
1713
|
-
|
|
1688
|
+
}
|
|
1689
|
+
function refuseOnBoxMemory(memory, why) {
|
|
1690
|
+
refused = true;
|
|
1691
|
+
for (const run of installing) {
|
|
1692
|
+
const exists = !run.needsWallet;
|
|
1693
|
+
const detail = "full" in why
|
|
1694
|
+
? buildBoxFullRefusal(memory, why.full, pkg, budget, exists)
|
|
1695
|
+
: buildBoxMemoryRefusal(memory, pkg, budget, why.reason, exists);
|
|
1696
|
+
record(run, "preflight", { status: "refused", detail, evidence: { ...memory } });
|
|
1697
|
+
}
|
|
1698
|
+
return true;
|
|
1714
1699
|
}
|
|
1715
1700
|
/**
|
|
1716
1701
|
* The SOFT calculated-minimum tier. The package-level figure is computed over the WHOLE package
|
|
@@ -1832,6 +1817,7 @@ export async function runDeploy(params, deps) {
|
|
|
1832
1817
|
skillVersion: pkg.version,
|
|
1833
1818
|
...(await describeInstance(run.inst)),
|
|
1834
1819
|
...(pkg.simulation ? { simulation: true } : {}),
|
|
1820
|
+
...(!pkg.simulation && params.fromSimulationId ? { fromSimulationId: params.fromSimulationId } : {}),
|
|
1835
1821
|
};
|
|
1836
1822
|
const cost = costs.get(run.inst.name);
|
|
1837
1823
|
const sizing = (attempt) => pkg.simulation
|
|
@@ -2083,22 +2069,34 @@ export async function runDeploy(params, deps) {
|
|
|
2083
2069
|
}
|
|
2084
2070
|
}
|
|
2085
2071
|
/**
|
|
2086
|
-
* What the create carries beside attribution
|
|
2087
|
-
*
|
|
2088
|
-
*
|
|
2089
|
-
*
|
|
2072
|
+
* What the create carries beside attribution: the instance's StrategyFacts and the package's
|
|
2073
|
+
* catalog copy (ticket 125), its flat settings, and for a simulation its group.
|
|
2074
|
+
* Descriptive only, so it never stops a create: whatever cannot be computed is left out. They
|
|
2075
|
+
* never read the wallet, so the recipe is rendered once with a stand-in one (the real wallet does
|
|
2076
|
+
* not exist until this create returns).
|
|
2090
2077
|
*/
|
|
2091
2078
|
async function describeInstance(inst) {
|
|
2092
2079
|
const catalog = catalogCopy(pkg.catalog);
|
|
2093
2080
|
let facts;
|
|
2081
|
+
let settings;
|
|
2082
|
+
let group;
|
|
2094
2083
|
try {
|
|
2095
2084
|
const rendered = renderRuntimeYaml(inst, FACTS_STAND_IN_WALLET, decisionModel && pkg.decisionModelEnv ? { env: pkg.decisionModelEnv, model: decisionModel } : undefined);
|
|
2096
|
-
|
|
2085
|
+
const config = await loadRuntimeConfig(rendered);
|
|
2086
|
+
facts = strategyFacts(config, pkg);
|
|
2087
|
+
settings = strategySettings(config);
|
|
2088
|
+
if (pkg.simulation)
|
|
2089
|
+
group = simulationGroup(config, facts) ?? undefined;
|
|
2097
2090
|
}
|
|
2098
2091
|
catch (err) {
|
|
2099
|
-
log(`deploy: strategy facts for "${inst.name}" not computed (${errorText(err)}); creating without them`);
|
|
2092
|
+
log(`deploy: strategy facts and settings for "${inst.name}" not computed (${errorText(err)}); creating without them`);
|
|
2100
2093
|
}
|
|
2101
|
-
return {
|
|
2094
|
+
return {
|
|
2095
|
+
...(facts ? { facts } : {}),
|
|
2096
|
+
...(catalog ? { catalog } : {}),
|
|
2097
|
+
...(settings ? { settings } : {}),
|
|
2098
|
+
...(group ? { group } : {}),
|
|
2099
|
+
};
|
|
2102
2100
|
}
|
|
2103
2101
|
/** The bounded ACTIVE poll — shared by a freshly created wallet and an adopted initializing one. */
|
|
2104
2102
|
async function pollUntilActive(run, strategyId) {
|
|
@@ -2781,7 +2779,6 @@ export async function runDeploy(params, deps) {
|
|
|
2781
2779
|
...(unreadableFunded.length > 0
|
|
2782
2780
|
? { fundedUnreadableNote: buildFundedUnreadableNote(pkg, unreadableFunded, reassures()) }
|
|
2783
2781
|
: {}),
|
|
2784
|
-
...(boxCapNote ? { boxCapNote } : {}),
|
|
2785
2782
|
...(measurements.length > 0 ? { measurements } : {}),
|
|
2786
2783
|
...(unmeasured.length > 0 ? { unmeasured } : {}),
|
|
2787
2784
|
...(classes.length > 0 ? { classes } : {}),
|