Files
dsh_shenxian/package.json
T
admin f6d4ad9b15 fix(mem): 统一实例内存配额口径 + status 暴露真值(消灭「388 MiB」误报)
用户问「实例内存大小是不是调整过了,为什么功能设置中还是显示 388 多」。
实测:guest 真实 MemoryMax = 672 MiB、admin = 384 MiB(都真调整过);
而「功能管理」显示的是插件**自建的第二套模型**(基线 285 / univer 64 / mcn 39,
且把 clamp 下限 384 当硬上限)⇒ 全勾显示 388 并报「⚠ 将超出上限」,纯误报。
根因:档案 81 R1 把「写死 384」改为「按插件集合推导」时**只改了编排器**,
插件那份副本原地漂移,此后 univer 384→512、mcn-suite 128 都没同步。

平台侧(把已算好的真值透出来,零新增计算):
- spawner.ts 新增可选 quotaInfo?(userId)(照 breakerInfo 模式)
- orchestrator.ts 实现 quotaInfo(),走**同一个** instanceMemMb()/heapMbFor()
- /api/dsh/status 返回 quota: {memMb, heapMb}

防漂(根因是「同一事实两处副本」,必须让它不可能再漂):
- 新增 scripts/verify-mem-model.mjs,逐项交叉断言常量/成本表/clamp 算式/接线点,
  接进 npm run verify —— 任一处漂移即构建失败(已做反向验证:改回 285 即 exit 1)

验证:build 零报错;verify 全绿(含新增 15 项断言);服务端 md5 与本机编译产物一致;
GET /api/dsh/status → quota {memMb:384,heapMb:256} 与实测 402653184 吻合。

注:poc/business-plugins/**(0.3.6)与其 package.json 未在此提交 —— 该文件被并行会话
连续改过两轮(0.3.4/0.3.5,0.3.5 已上线但未 commit),刻意留给他们一起提交。
2026-09-13 21:38:04 +08:00

87 lines
2.6 KiB
JSON

{
"name": "dshs",
"version": "0.1.0",
"description": "面向公网的多租户 DSH 托管平台:登录审核、每用户隔离的 DSH 环境(主 + 按需守护)、桌面与域名访问。",
"type": "module",
"main": "./lib/index.js",
"exports": {
".": "./lib/index.js",
"./runtime": "./lib/runtime.js"
},
"bin": {
"dshs": "./lib/cli.js"
},
"files": [
"lib",
"web",
"cordis.patch.yml",
"README.md"
],
"scripts": {
"build": "tsc -p tsconfig.json",
"prepare": "npm run build",
"dev": "node lib/cli.js",
"typecheck": "tsc -p tsconfig.json --noEmit",
"verify": "npm run build && node --test test/db.test.mjs test/k8s-spawner.test.mjs test/leader.test.mjs test/local-user-fs.test.mjs test/crash-policy.test.mjs && node scripts/verify-inject.cjs lib/supervisor/proxy.js && node scripts/verify-static.mjs && node scripts/verify-platform-admin-section.mjs && node scripts/verify-mem-model.mjs",
"test": "npm run build && node --test test/db.test.mjs test/k8s-spawner.test.mjs test/leader.test.mjs test/local-user-fs.test.mjs test/crash-policy.test.mjs && node scripts/verify-inject.cjs lib/supervisor/proxy.js",
"smoke": "node scripts/smoke.mjs",
"smoke:admin": "node scripts/smoke-admin.mjs",
"smoke:auth": "node scripts/smoke-auth.mjs",
"smoke:fs": "node scripts/smoke-fs.mjs",
"smoke:file-service": "node scripts/smoke-file-service.mjs",
"smoke:dsh": "node scripts/smoke-dsh.mjs",
"smoke:domain": "node scripts/smoke-domain.mjs",
"smoke:isolation": "node scripts/smoke-isolation.mjs",
"smoke:subdomain": "node scripts/smoke-subdomain.mjs"
},
"dsh": {
"plugin": true,
"kind": "server",
"bundle": {
"patch": "./cordis.patch.yml"
}
},
"disclosure": {
"cloud": true,
"network": [
"https://api.deepseek.com"
],
"apiKeys": [
{
"env": "DEEPSEEK_API_KEY",
"storage": "sqlite-encrypted-ref"
}
],
"permissions": {
"filesystem": "per-user-0700",
"network": "egress",
"env": "read-listed"
},
"jurisdiction": [
"PIPL(CN)"
],
"retention": "server"
},
"dependencies": {
"@fastify/rate-limit": "^10.0.0",
"@fastify/static": "^10.1.3",
"@kubernetes/client-node": "^2.0.0",
"better-sqlite3": "^11.10.0",
"fastify": "^5.0.0",
"pg": "^8.23.0"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.11",
"@types/node": "^22.10.0",
"@types/pg": "^8.23.1",
"typescript": "^5.7.0"
},
"engines": {
"node": "^22.19.0 || >=24"
},
"repository": {
"type": "git",
"url": "https://work.alotbuy.com/maogeigei/dsh_shenxian.git"
}
}