@coreplane/switchboard 1.233.0 → 1.235.0
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/assets/deploy/cloudflare-resident/gc.ts +6 -9
- package/dist/assets/deploy/cloudflare-resident/worker.ts +310 -277
- package/dist/assets/deploy/cloudflare-sandbox/worker.ts +82 -13
- package/dist/assets/package-lock.json +3 -3
- package/dist/assets/package.json +1 -1
- package/dist/assets/source.json +3 -3
- package/dist/assets/src/agents/registry.ts +13 -7
- package/dist/assets/src/core/provider.ts +9 -6
- package/dist/assets/src/core/runEvents.ts +25 -0
- package/dist/assets/src/execution/residentCleanliness.ts +69 -5
- package/dist/assets/src/execution/residentDiskBudget.ts +7 -6
- package/dist/assets/src/execution/residentRebind.ts +92 -77
- package/dist/assets/src/execution/residentReuse.ts +7 -18
- package/dist/assets/src/execution/residentSteps.ts +0 -1
- package/dist/assets/src/execution/sandboxErrors.ts +5 -0
- package/dist/assets/src/execution/sandboxIdle.ts +220 -0
- package/dist/assets/web/dist/.vite/manifest.json +68 -28
- package/dist/assets/web/dist/assets/{ResidentDetailPage-V4K35SYX.js → ResidentDetailPage-DSpsye5e.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentsIndexPage-3HuYaDwD.js → ResidentsIndexPage-CT8fI1M3.js} +1 -1
- package/dist/assets/web/dist/assets/RunFoldRow-Cqh8pTXC.js +9 -0
- package/dist/assets/web/dist/assets/RunRoutePage-oN9GkVEA.js +6 -0
- package/dist/assets/web/dist/assets/RunsIndexPage-sjXr8iCV.js +1 -0
- package/dist/assets/web/dist/assets/{ScheduledPage-dfrjQ5E9.js → ScheduledPage-Tz__zLzi.js} +1 -1
- package/dist/assets/web/dist/assets/{StatusDot-DexKtvUC.js → StatusDot-D14iJMy7.js} +1 -1
- package/dist/assets/web/dist/assets/{Tooltip-DGQ2gu9M.js → Tooltip-B0Ob5MQ4.js} +1 -1
- package/dist/assets/web/dist/assets/UnitRoutePage-CbKCL58v.js +1 -0
- package/dist/assets/web/dist/assets/{dist-boTdDLF4.js → dist-pOdUzj6D.js} +1 -1
- package/dist/assets/web/dist/assets/favicon-BQsePYv5.js +1 -0
- package/dist/assets/web/dist/assets/indexRow-Bnj883ii.js +1 -0
- package/dist/assets/web/dist/assets/{main-BHhLVMQh.js → main-D3lG-yQ9.js} +2 -2
- package/dist/assets/web/dist/assets/main-Dm11o0hc.css +1 -0
- package/dist/cli.js +1231 -586
- package/package.json +1 -1
- package/dist/assets/web/dist/assets/RunRoutePage-Dr867-Ha.js +0 -13
- package/dist/assets/web/dist/assets/RunsIndexPage-D_lpXsr8.js +0 -1
- package/dist/assets/web/dist/assets/favicon-CWPcvWvp.js +0 -1
- package/dist/assets/web/dist/assets/main-CAVqMbiX.css +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Residency garbage collection — the PURE decision logic, kept free of
|
|
2
2
|
// the Sandbox SDK and DO storage so it runs under plain-Node vitest
|
|
3
3
|
// (gc.test.ts). worker.ts feeds it what it observed (mirror refs, the GitHub
|
|
4
|
-
// pulls list,
|
|
4
|
+
// pulls list, ops in flight, live views) and acts on the answers.
|
|
5
5
|
//
|
|
6
6
|
// Two mechanisms:
|
|
7
7
|
// 1. Event-triggered reclamation: after every refresh-cycle `fetch --prune`,
|
|
@@ -79,9 +79,6 @@ export interface ReclaimInput {
|
|
|
79
79
|
isDefaultRef: boolean;
|
|
80
80
|
/** Thread exec/read/write currently running on this binding. */
|
|
81
81
|
busy: number;
|
|
82
|
-
/** Tree cleanliness as the thread user; `null` = the runtime is down, so
|
|
83
|
-
* the tree is already gone with the disk and there is nothing to preserve. */
|
|
84
|
-
clean: boolean | null;
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
/** The PR that decided the fate (for the audit trail): the open one, else the
|
|
@@ -97,13 +94,14 @@ export type ReclaimWhy =
|
|
|
97
94
|
| "fate-unknown"
|
|
98
95
|
| "busy"
|
|
99
96
|
| "re-attached"
|
|
100
|
-
| "dirty"
|
|
101
97
|
| Extract<RefFate, "gone" | "merged" | "closed">;
|
|
102
98
|
|
|
103
99
|
/** Evict this binding now? A finished ref (gone/merged/closed) is reclaimed
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
100
|
+
* when nothing runs on it — and nothing else is asked. What its tree holds
|
|
101
|
+
* is never a reason to keep it: a run starts from a clean tree, so dirt in a
|
|
102
|
+
* tree no run is using protects nothing (the next attach wipes it); the
|
|
103
|
+
* Worker measures and records what it removes instead. Keeps are named so
|
|
104
|
+
* the pass is auditable. */
|
|
107
105
|
export function reclaimDecision(input: ReclaimInput): { reclaim: boolean; why: ReclaimWhy } {
|
|
108
106
|
if (input.isDefaultRef) return { reclaim: false, why: "default-ref" };
|
|
109
107
|
switch (input.fate) {
|
|
@@ -115,7 +113,6 @@ export function reclaimDecision(input: ReclaimInput): { reclaim: boolean; why: R
|
|
|
115
113
|
return { reclaim: false, why: "fate-unknown" };
|
|
116
114
|
}
|
|
117
115
|
if (input.busy > 0) return { reclaim: false, why: "busy" };
|
|
118
|
-
if (input.clean === false) return { reclaim: false, why: "dirty" };
|
|
119
116
|
return { reclaim: true, why: input.fate };
|
|
120
117
|
}
|
|
121
118
|
|