docs: audit AMS global-singleton state for tenant-leak risk - #5758
Conversation
Enumerate every module in packages/loopover-miner/lib and packages/loopover-engine/src/miner holding process-wide or file-scoped singleton state (default stores, the global kill-switch, caches, lifecycle registries), each with a leaks-across-tenants / needs-redesign / safe-as-is risk rating and file:line references, as the AMS counterpart to ORB's JSONbored#4885-JSONbored#4893 sweep. Audit and documentation only; no fixes here. Closes JSONbored#5218
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-14 12:02:45 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Closes #5218.
Enumerates every module in
packages/loopover-miner/libandpackages/loopover-engine/src/minerthat holds process-wide or file-scoped singleton state, and rates the risk each would pose if AMS ran as a shared hosted service across tenants — the AMS counterpart to ORB's #4885–#4893 sweep.Audit and documentation only — no fixes (each confirmed leak gets its own follow-up issue, per the issue boundary).
Deliverable
A findings doc at
packages/loopover-miner/docs/global-singleton-tenant-audit.mdwith the requested risk rating per item (leaks across tenants / needs redesign / safe as-is) andfile:linereferences throughout.Findings in brief
default*store singletons (portfolio-queue,claim-ledger,event-ledger,governor-state/-ledger,run-state,ranked-candidates,attempt-log,plan-store,prediction-ledger,replay-snapshot,policy-*-cache,worktree-allocator). Each keeps a module-scopedlet default* = nullreused process-wide viagetDefault*()/closeDefault*(), backed by one SQLite file whose path (resolveLocalStoreDbPath,local-store.js:16) has no tenant key — so two tenants in one process share the handle and file.LOOPOVER_MINER_KILL_SWITCHglobal boolean (the seed example; enginegovernor/kill-switch.ts:19,31): no per-tenant dimension. Flagged maintainer-owned trust/safety, like ORB Redesign the global agent-controls table for per-tenant scoping #4885.processLogger, the process-lifecycle cleanup registry, tree-sitter/module-resolution caches, and the immutable validation Sets (no tenant data).Every
file:linereference was verified against the currentmain. Follow-up seeds that touch the tenancy boundary are explicitly marked maintainer-review-required.