From 46d891b8410324aa30c86bedb3720d9cb8d511fa Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 13 Sep 2026 14:17:09 +0200 Subject: [PATCH] Remove dead packages/sandbox, unused msgpack dep, duplicate npm alias REC-121 / REC-019 (VoidBot part): - Deleted packages/sandbox (policy-first sandbox scaffolding) and its root tsconfig.json project reference. Removed its two remaining doc mentions in README.md and docs/architecture/overview.md, including the two forward-looking roadmap lines that described expanding it ("Add real constrained sandbox execution...", "Expand sandbox execution from dry-run policy checks...") since there is no longer any scaffolding for them to expand. - Removed the direct `@msgpack/msgpack` dependency from packages/core/package.json; health/CultCache code obtains MessagePack through CultLib instead. - Removed the root npm script `swarm:dashboard`, a byte-identical duplicate of `swarm:render-dashboard`. Updated package-lock.json by deleting it and running `npm install` fresh (a `--package-lock-only` pass alone left stale entries for the removed workspace and dependency). That also dropped @msgpack/msgpack's now-unreferenced-by-core transitive optional deps (@emnapi/*, @napi-rs/wasm-runtime, @snazzah/davey-*, @tybys/wasm-util); vendor/cultcache-ts still declares its own @msgpack/msgpack dependency independently and is unaffected. Kill attempts that failed: none. - `rg -n '@voidbot/sandbox|packages/sandbox' apps packages scripts --glob '!packages/sandbox/**'` -> no matches (repeated the census command against current HEAD). - `rg -n '@msgpack/msgpack' packages/core/src` -> no matches. - `rg -n 'swarm:dashboard\b'` outside its own definition -> no matches. - Cross-repo: `rg -n '@voidbot/sandbox|packages/sandbox'` over all of F:/Projects (Grep tool, respects each repo's .gitignore) -> only this repo's own README/docs/tsconfig/package-lock, now all cleaned. Checks run: initialized the vendor/cultcache-ts submodule (empty in a fresh worktree, unrelated pre-existing gap), `npm install`, then `npx tsc -b --pretty false` across the whole workspace -> clean, no errors (a pre-init run showed 11 `Cannot find module 'cultcache-ts'` errors, all from the uninitialized submodule, none related to this change). Co-Authored-By: Claude Sonnet 5 --- README.md | 3 -- docs/architecture/overview.md | 2 - package-lock.json | 12 ------ package.json | 1 - packages/core/package.json | 1 - packages/sandbox/package.json | 10 ----- packages/sandbox/src/index.ts | 3 -- packages/sandbox/src/policy-runner.ts | 59 --------------------------- packages/sandbox/src/profiles.ts | 32 --------------- packages/sandbox/tsconfig.json | 17 -------- tsconfig.json | 3 -- 11 files changed, 143 deletions(-) delete mode 100644 packages/sandbox/package.json delete mode 100644 packages/sandbox/src/index.ts delete mode 100644 packages/sandbox/src/policy-runner.ts delete mode 100644 packages/sandbox/src/profiles.ts delete mode 100644 packages/sandbox/tsconfig.json diff --git a/README.md b/README.md index d87082c..8b48fc4 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,6 @@ The repo is split into a bot, a worker, and a handful of focused packages: - `packages/rag`: archives, chunking, embedding backends, retrieval, vector stores - `packages/config`: environment-driven configuration - `packages/shared`: shared contracts and types -- `packages/sandbox`: policy-first sandbox scaffolding The durable local state is split on purpose: Postgres holds jobs, audit events, and interaction memory, while `.voidbot/` keeps artifacts, archives, logs, and detached indexing status. @@ -702,7 +701,6 @@ Useful local state and docs: - the Discord-safe owner lane is read-only - the bot does not expose arbitrary shell execution - deeper tasks are handed off instead of turning Discord into a cursed remote terminal -- sandbox support is still policy-first and dry-run only - `manual_package` remains available when you want explicit review points ## Development Roadmap @@ -712,7 +710,6 @@ Reasonable next steps from here: 1. Add a real scheduled restore drill instead of stopping at backup verification and freshness checks. 2. Expand worker processing into richer provider run records, moderation hooks, and admin inspection tools. 3. Replace the remaining scaffolded provider paths with funded, production-grade implementations. -4. Add real constrained sandbox execution instead of policy-only dry runs. ## Related Docs diff --git a/docs/architecture/overview.md b/docs/architecture/overview.md index ab1db34..8a6488b 100644 --- a/docs/architecture/overview.md +++ b/docs/architecture/overview.md @@ -24,7 +24,6 @@ Discord Gateway - `packages/core` contains permissions, context assembly, Postgres-backed state storage, style loading, and the rotating system message catalog. - `packages/providers` isolates provider contracts from Discord code. - `packages/rag` contains the message archive, chunking pipeline, local embedding backends, pluggable vector-store backends, and log import state. -- `packages/sandbox` defines policy profiles and a dry-run policy runner. VoidBot's Verse-facing service contract lives in `docs/architecture/voidbot-verse-service-contract.md`. The short version: @@ -68,4 +67,3 @@ surfaces; Eve/CultUI is the presentation contract. 5. Add a true restore drill path instead of stopping at backup verification plus freshness monitoring. 6. Add moderation, budgeting, and rate limits before enabling `openai_api` for member traffic. 7. Expand worker-side run records and admin tooling around the interaction memory/event stores. -8. Expand sandbox execution from dry-run policy checks to real constrained runners. diff --git a/package-lock.json b/package-lock.json index 985b03e..3b23989 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1177,10 +1177,6 @@ "resolved": "packages/rag", "link": true }, - "node_modules/@voidbot/sandbox": { - "resolved": "packages/sandbox", - "link": true - }, "node_modules/@voidbot/shared": { "resolved": "packages/shared", "link": true @@ -2814,7 +2810,6 @@ "name": "@voidbot/core", "version": "0.1.0", "dependencies": { - "@msgpack/msgpack": "^3.1.3", "@voidbot/shared": "0.1.0", "cultcache-ts": "file:../../vendor/cultcache-ts", "pg": "^8.20.0", @@ -2836,13 +2831,6 @@ "@voidbot/shared": "0.1.0" } }, - "packages/sandbox": { - "name": "@voidbot/sandbox", - "version": "0.1.0", - "dependencies": { - "@voidbot/shared": "0.1.0" - } - }, "packages/shared": { "name": "@voidbot/shared", "version": "0.1.0" diff --git a/package.json b/package.json index 08ad760..41b474f 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "state:check": "powershell -ExecutionPolicy Bypass -File scripts/check-voidbot-operations.ps1", "state:dashboard": "powershell -ExecutionPolicy Bypass -File scripts/render-voidbot-operations-dashboard.ps1 -Open", "state:render-dashboard": "powershell -ExecutionPolicy Bypass -File scripts/render-voidbot-operations-dashboard.ps1", - "swarm:dashboard": "node scripts/render-voidbot-swarm-dashboard.mjs", "swarm:render-dashboard": "node scripts/render-voidbot-swarm-dashboard.mjs", "verse:advertisements": "node scripts/export-voidbot-provider-advertisements.mjs", "verse:advertisements:check": "node scripts/export-voidbot-provider-advertisements.mjs --check", diff --git a/packages/core/package.json b/packages/core/package.json index cf5d6e9..932e59e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -5,7 +5,6 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "dependencies": { - "@msgpack/msgpack": "^3.1.3", "@voidbot/shared": "0.1.0", "cultcache-ts": "file:../../vendor/cultcache-ts", "pg": "^8.20.0", diff --git a/packages/sandbox/package.json b/packages/sandbox/package.json deleted file mode 100644 index 7eaf03d..0000000 --- a/packages/sandbox/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@voidbot/sandbox", - "version": "0.1.0", - "private": true, - "main": "dist/index.js", - "types": "dist/index.d.ts", - "dependencies": { - "@voidbot/shared": "0.1.0" - } -} diff --git a/packages/sandbox/src/index.ts b/packages/sandbox/src/index.ts deleted file mode 100644 index d5b8d21..0000000 --- a/packages/sandbox/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./policy-runner"; -export * from "./profiles"; - diff --git a/packages/sandbox/src/policy-runner.ts b/packages/sandbox/src/policy-runner.ts deleted file mode 100644 index 3608868..0000000 --- a/packages/sandbox/src/policy-runner.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { - type SandboxCommandRequest, - type SandboxExecutionResult, - type SandboxProfileName, -} from "@voidbot/shared"; - -import { defaultSandboxProfiles } from "./profiles"; - -export class PolicySandboxRunner { - public getProfile(profileName: SandboxProfileName) { - return defaultSandboxProfiles[profileName]; - } - - public async run(request: SandboxCommandRequest): Promise { - const profile = this.getProfile(request.profile); - - if (!profile.allowedCommands.includes(request.command)) { - return { - status: "denied", - stdout: "", - stderr: "", - exitCode: 1, - deniedReason: `Command "${request.command}" is not allowed for profile "${request.profile}".`, - dryRun: true, - }; - } - - if (request.networkAccess && !profile.networkAccess) { - return { - status: "denied", - stdout: "", - stderr: "", - exitCode: 1, - deniedReason: `Profile "${request.profile}" does not permit network access.`, - dryRun: true, - }; - } - - if (profile.requiresApproval && !request.approved) { - return { - status: "denied", - stdout: "", - stderr: "", - exitCode: 1, - deniedReason: `Profile "${request.profile}" requires explicit approval before execution.`, - dryRun: true, - }; - } - - return { - status: "planned", - stdout: "", - stderr: "", - exitCode: 0, - dryRun: true, - }; - } -} - diff --git a/packages/sandbox/src/profiles.ts b/packages/sandbox/src/profiles.ts deleted file mode 100644 index 935758a..0000000 --- a/packages/sandbox/src/profiles.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { type SandboxProfile, type SandboxProfileName } from "@voidbot/shared"; - -export const defaultSandboxProfiles: Record = { - read_only_lookup: { - name: "read_only_lookup", - allowedCommands: ["lookup", "search_index"], - networkAccess: false, - timeoutMs: 5000, - requiresApproval: false, - }, - rag_maintenance: { - name: "rag_maintenance", - allowedCommands: ["reindex_channel", "backfill_embeddings"], - networkAccess: false, - timeoutMs: 30000, - requiresApproval: true, - }, - owner_workflow: { - name: "owner_workflow", - allowedCommands: ["prepare_manual_bundle", "publish_owner_reply"], - networkAccess: false, - timeoutMs: 30000, - requiresApproval: true, - }, - public_low_risk: { - name: "public_low_risk", - allowedCommands: ["summarize_channel", "search_history", "search_sources"], - networkAccess: false, - timeoutMs: 10000, - requiresApproval: false, - }, -}; diff --git a/packages/sandbox/tsconfig.json b/packages/sandbox/tsconfig.json deleted file mode 100644 index 2a65163..0000000 --- a/packages/sandbox/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "rootDir": "src", - "outDir": "dist" - }, - "include": [ - "src/**/*.ts" - ], - "references": [ - { - "path": "../shared" - } - ] -} - diff --git a/tsconfig.json b/tsconfig.json index cef896a..ca4ad1b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,9 +16,6 @@ { "path": "./packages/rag" }, - { - "path": "./packages/sandbox" - }, { "path": "./apps/bot" },