@twinsearth/ai-prison-dsh-plugin 1.4.7 → 1.5.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,62 @@
2
2
 
3
3
  All notable changes to `@twinsearth/ai-prison-dsh-plugin` are recorded here.
4
4
 
5
+ ## [1.5.1] — 2026-11-18
6
+
7
+ ### Fixed — Top5 v2 child RSS attribution never matched
8
+
9
+ - The scanner filtered process command lines by the profile path, which matched
10
+ the host and the local subprocess runner but not plugin children, and it built
11
+ Windows needles from `@scope/name` without converting the scope separator.
12
+ - It now scans every process with a command line, skips the host itself and
13
+ `dsh-desktop-host` children, and matches
14
+ `node_modules\\@scope\\name` / `node_modules/@scope/name` for each enabled
15
+ plugin, so `xray-core`, the w2m runner and similar children are attributed.
16
+ - `rssAt` is written even when nothing matches, and `rssScan: false` disables the
17
+ scan.
18
+
19
+ ## [1.5.0] — 2026-11-18
20
+ ## [1.5.0] — 2026-11-18
21
+
22
+ ### Changed — profile tamper monitor is dry-run (observe) by default
23
+
24
+ - `tamperPolicy` now accepts `observe` (default), `alert` and `restore`. In
25
+ `observe` the monitor still snapshots the five critical files, backs up the
26
+ drifted bytes to `tampered/` and records an L1 plan/incident, but **never
27
+ restores the file, never quarantines and never closes a plugin** — the
28
+ dry-run stage requested before turning the guard on.
29
+ - `alert` records only as well; only an explicit `tamperPolicy: "restore"`
30
+ restores the bytes and applies L1 enforcement.
31
+ - The panel line now shows the active policy, and the tool snapshot carries it.
32
+
33
+ ### Added — Top5 v2 (child RSS, EWMA, stable order)
34
+
35
+ - Every 60 s the watchdog scans the process table (Windows) and attributes the
36
+ working set of processes whose command line references
37
+ `profiles/desktop/node_modules/<plugin>` to that plugin (`rssMB`).
38
+ - Top5 scores `module-load/operation estimate + child RSS`, smooths RSS with an
39
+ EWMA (alpha 0.35) and only reorders when a score moved more than 20 %, which
40
+ stops the list from jumping on every sample.
41
+ - The panel Top5 table gained a child-RSS column; the tool snapshot exposes
42
+ `rss` and `rssAt`.
43
+ - A pre-freeze heap snapshot is intentionally not taken: at 4.5 GB of a 6 GB
44
+ heap the snapshot's ~2x temporary cost would OOM the host, so freeze keeps
45
+ using the measured/estimate/RSS data.
46
+
47
+ ### Added — optional desktop notifications
48
+
49
+ - `config: { notify: true }` turns on a Windows tray-balloon notification for
50
+ freeze, pause, quarantine, tamper, crash-enforcement and budget incidents
51
+ (rate limited per kind, 60 s; disabled by default). The watchdog does not
52
+ depend on it: failures are ignored.
53
+
54
+ ### Notes
55
+ - The monitor stays a module inside the watchdog row rather than a separate
56
+ loader row: it runs in the same host process either way, and keeping it in
57
+ the row avoids a second loader entry whose failure would silently remove the
58
+ status API as well. It can already be disabled with `tamperMonitor: false`.
59
+
60
+ ## [1.4.7] — 2026-11-18
5
61
  ## [1.4.7] — 2026-11-18
6
62
 
7
63
  ### Added — panel/remote operations roll back while paused or frozen
package/client.js CHANGED
@@ -460,9 +460,16 @@ window.__ModuleLoader__.load({
460
460
  topFive.length === 0 ? null : h('div', null,
461
461
  h('div', { style: { ...C.key, marginBottom: 4 } }, t('watchdog.topFive', { n: topFive.length })),
462
462
  h('table', { style: C.table },
463
+ h('thead', null, h('tr', null,
464
+ h('th', { style: C.th }, t('prison.plugin')),
465
+ h('th', { style: C.th }, t('prison.estimate')),
466
+ h('th', { style: C.th }, t('prison.rss')),
467
+ h('th', { style: C.th }, ''),
468
+ )),
463
469
  h('tbody', null, topFive.map((row) => h('tr', { key: row.target },
464
470
  h('td', { style: { ...C.td, ...C.mono, fontSize: 11.5, wordBreak: 'break-all' } }, row.target),
465
471
  h('td', { style: C.td }, row.estimateMB + ' MB'),
472
+ h('td', { style: C.td }, (row.rssMB || 0) + ' MB'),
466
473
  h('td', { style: C.td }, h('button', { style: button, onClick: () => act('close', row.target, '立即关闭 ' + row.target + ' ?') }, t('watchdog.close'))),
467
474
  ))),
468
475
  ),
@@ -473,7 +480,7 @@ window.__ModuleLoader__.load({
473
480
  plan.at + ' · ' + plan.level + ' · ' + (plan.target || 'unattributed') + (plan.inFlight ? ' (in-flight)' : '') + (plan.crash ? ' · ' + (plan.crash.oom ? 'OOM' : 'exit ' + plan.crash.hostExitCode) : ''))),
474
481
  ),
475
482
  watchdog.baseline ? h('p', { style: { ...C.muted, fontSize: 11.5, margin: '10px 0 0' } }, t('watchdog.baseline', { at: watchdog.baseline.at })) : null,
476
- watchdog.tamper ? h('p', { style: { ...C.muted, fontSize: 11.5, margin: '6px 0 0' } }, t('watchdog.tamper', { n: (watchdog.tamper.files || []).length, at: watchdog.tamper.lastCheckAt || '—' })) : null,
483
+ watchdog.tamper ? h('p', { style: { ...C.muted, fontSize: 11.5, margin: '6px 0 0' } }, t('watchdog.tamper', { n: (watchdog.tamper.files || []).length, at: watchdog.tamper.lastCheckAt || '—', policy: watchdog.tamper.policy || '' })) : null,
477
484
  h('div', { style: { marginTop: 10, display: 'flex', gap: 8, alignItems: 'center', flexWrap: 'wrap' } },
478
485
  h('button', { style: { ...button, padding: '5px 10px', opacity: frozen ? 0.5 : 1 }, disabled: frozen, title: frozen ? t('watchdog.measureBlocked') : undefined, onClick: () => { if (!frozen) act('probe') } }, t('watchdog.measure')),
479
486
  watchdog.probeProgress ? h('span', { style: { ...C.mono, fontSize: 11.5 } }, `${watchdog.probeProgress.done || 0}/${watchdog.probeProgress.total || 0}`) : null,
@@ -0,0 +1,80 @@
1
+ import { spawn } from 'node:child_process'
2
+
3
+ /**
4
+ * Optional desktop notification for enforcement events. Uses the Windows tray
5
+ * balloon through PowerShell so no extra dependency is needed. Disabled by
6
+ * default; enable with `config: { notify: true }` on the watchdog row.
7
+ */
8
+ const KIND_LABELS = {
9
+ freeze: '内存冻结',
10
+ pause: '内存暂停',
11
+ quarantine: '插件隔离',
12
+ tamper: '配置篡改',
13
+ 'crash-enforced': '崩溃隔离',
14
+ budget: '内存超限',
15
+ }
16
+
17
+ let lastAt = 0
18
+ let lastKind = ''
19
+
20
+ export function shouldNotify(kind, now = Date.now(), cooldownMs = 60_000) {
21
+ if (!KIND_LABELS[kind]) return false
22
+ if (kind === lastKind && now - lastAt < cooldownMs) return false
23
+ lastKind = kind
24
+ lastAt = now
25
+ return true
26
+ }
27
+
28
+ export function notificationFor(incident) {
29
+ const kind = incident && incident.kind
30
+ const label = KIND_LABELS[kind]
31
+ if (!label) return null
32
+ const target = incident.target ? ` ${incident.target}` : ''
33
+ const title = `AI Prison · ${label}`
34
+ const body = String(incident.detail || incident.evidence || target || '').slice(0, 180) || label
35
+ return { title, body }
36
+ }
37
+
38
+ function powershellScript(title, body) {
39
+ const safeTitle = String(title).replace(/'/g, "''")
40
+ const safeBody = String(body).replace(/'/g, "''")
41
+ return [
42
+ 'Add-Type -AssemblyName System.Windows.Forms | Out-Null',
43
+ 'Add-Type -AssemblyName System.Drawing | Out-Null',
44
+ '$n = New-Object System.Windows.Forms.NotifyIcon',
45
+ '$n.Icon = [System.Drawing.SystemIcons]::Warning',
46
+ '$n.Visible = $true',
47
+ `$n.ShowBalloonTip(8000, '${safeTitle}', '${safeBody}', [System.Windows.Forms.ToolTipIcon]::Warning)`,
48
+ 'Start-Sleep -Seconds 9',
49
+ '$n.Visible = $false',
50
+ '$n.Dispose()',
51
+ ].join('; ')
52
+ }
53
+
54
+ /** Fire one tray notification (best effort, detached). */
55
+ export function notify(incident, { cooldownMs = 60_000 } = {}) {
56
+ const message = notificationFor(incident)
57
+ if (!message) return { ok: false, reason: 'unsupported-kind' }
58
+ if (process.platform !== 'win32') return { ok: false, reason: 'platform' }
59
+ const now = Date.now()
60
+ if (!shouldNotify(incident.kind, now, cooldownMs)) return { ok: false, reason: 'rate-limited' }
61
+ lastAt = now
62
+ lastKind = incident.kind
63
+ try {
64
+ const child = spawn('powershell.exe', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', powershellScript(message.title, message.body)], {
65
+ detached: true,
66
+ stdio: 'ignore',
67
+ windowsHide: true,
68
+ })
69
+ child.unref()
70
+ return { ok: true, title: message.title }
71
+ } catch (error) {
72
+ return { ok: false, reason: String((error && error.message) || error) }
73
+ }
74
+ }
75
+
76
+ /** Test hook. */
77
+ export function resetNotifierState() {
78
+ lastAt = 0
79
+ lastKind = ''
80
+ }
@@ -222,6 +222,53 @@ export function topOperations(operations, limit = 5) {
222
222
  return rows.slice(0, Math.max(1, limit))
223
223
  }
224
224
 
225
+ /**
226
+ * Top5 v2: combine measured module-load MB, operation estimates and the RSS of
227
+ * child processes attributed to a plugin. The ranking is smoothed and stable:
228
+ * an item only changes rank when its score moved by more than 20%.
229
+ */
230
+ export function rankTopPlugins({ operations = [], budgets = {}, rss = {}, previous = {}, alpha = 0.35, limit = 5 } = {}) {
231
+ const rows = new Map()
232
+ for (const row of operations) {
233
+ rows.set(row.target, { target: row.target, operationMB: Number(row.estimateMB) || 0, count: Number(row.count) || 0, version: row.version || null, source: row.source || 'estimate', measuredAt: row.measuredAt || null })
234
+ }
235
+ for (const [target, entry] of Object.entries(budgets)) {
236
+ if (!entry || entry.error || entry.moduleLoadMB === undefined) continue
237
+ const current = rows.get(target) || { target, operationMB: 0, count: 0, version: entry.version || null, source: 'measured', measuredAt: entry.measuredAt || null }
238
+ current.moduleLoadMB = Number(entry.moduleLoadMB) || 0
239
+ current.source = 'measured'
240
+ current.measuredAt = entry.measuredAt || current.measuredAt
241
+ current.version = entry.version || current.version
242
+ rows.set(target, current)
243
+ }
244
+ for (const [target, bytes] of Object.entries(rss)) {
245
+ const current = rows.get(target) || { target, operationMB: 0, count: 0, version: null, source: 'estimate', measuredAt: null }
246
+ const previousRss = Number(previous[target] && previous[target].rssMB) || 0
247
+ current.rssMB = previousRss > 0 ? Math.round(previousRss * (1 - alpha) + (Number(bytes) / (1024 * 1024)) * alpha) : Math.round((Number(bytes) || 0) / (1024 * 1024))
248
+ rows.set(target, current)
249
+ }
250
+ const ranked = [...rows.values()].map((row) => ({
251
+ ...row,
252
+ rssMB: row.rssMB || 0,
253
+ score: Math.round((row.moduleLoadMB || row.operationMB || 0) + (row.rssMB || 0)),
254
+ }))
255
+ ranked.sort((a, b) => b.score - a.score)
256
+ const changed = ranked.some((row) => {
257
+ const before = previous[row.target]
258
+ if (!before || !Number.isFinite(before.score)) return true
259
+ const delta = Math.abs(row.score - before.score)
260
+ return delta / Math.max(1, before.score) > 0.2
261
+ })
262
+ const next = {}
263
+ for (const row of ranked) next[row.target] = { score: row.score, rssMB: row.rssMB }
264
+ if (!changed) {
265
+ // keep the last order while scores are stable
266
+ const order = Object.keys(previous)
267
+ ranked.sort((a, b) => order.indexOf(a.target) - order.indexOf(b.target))
268
+ }
269
+ return { rows: ranked.slice(0, Math.max(1, limit)), nextRanking: next }
270
+ }
271
+
225
272
  /** Named byte formatting used by the panel/tool text. */
226
273
  export function formatBytes(bytes) {
227
274
  const value = Number(bytes)
@@ -3,10 +3,12 @@ import os from 'node:os'
3
3
  import path from 'node:path'
4
4
  import v8 from 'node:v8'
5
5
  import crypto from 'node:crypto'
6
+ import { spawn } from 'node:child_process'
6
7
  import { watchdogState, MAX_SAMPLES, MAX_INCIDENTS } from './watchdog-state.js'
7
8
  import { probeBudget } from './budget-probe.js'
8
9
  import { createTamperMonitor } from './tamper-monitor.js'
9
10
  import { remediationFor } from './remediation.js'
11
+ import { notify } from './notifier.js'
10
12
  import {
11
13
  attributeCrash,
12
14
  classifyWaterline,
@@ -19,6 +21,7 @@ import {
19
21
  operationWeight,
20
22
  parseCrashLog,
21
23
  thresholdsFor,
24
+ rankTopPlugins,
22
25
  topOperations,
23
26
  } from './watchdog-policy.js'
24
27
 
@@ -155,7 +158,7 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
155
158
  tamper = createTamperMonitor({
156
159
  profileDir,
157
160
  dataDir,
158
- policy: config.tamperPolicy === 'alert' ? 'alert' : 'restore',
161
+ policy: config.tamperPolicy === 'restore' ? 'restore' : config.tamperPolicy === 'alert' ? 'alert' : 'observe',
159
162
  graceMs: Number(config.tamperGraceMs) >= 0 ? Number(config.tamperGraceMs) : 15_000,
160
163
  intervalMs: Number(config.tamperIntervalMs) > 0 ? Number(config.tamperIntervalMs) : 30_000,
161
164
  shouldIgnore: () => Date.now() < operationWindowUntil || Date.now() - lastOperationAt < 120000,
@@ -181,7 +184,8 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
181
184
  function handleTamper(result) {
182
185
  if (!result || !Array.isArray(result.diffs) || result.diffs.length === 0) return
183
186
  const files = result.diffs.map((diff) => diff.file)
184
- appendIncident({ kind: 'tamper', files, policy: result.policy, restored: result.restored, detail: '配置漂移:' + files.join(', ') })
187
+ const policy = (watchdogState.tamper && watchdogState.tamper.policy) || 'observe'
188
+ appendIncident({ kind: 'tamper', files, policy, restored: result.restored, detail: '配置漂移:' + files.join(', ') + (policy === 'observe' ? '(observe:仅记录,不恢复不关闭)' : '') })
185
189
  let target = null
186
190
  let evidence = []
187
191
  try {
@@ -195,7 +199,7 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
195
199
  } catch {
196
200
  target = null
197
201
  }
198
- const applied = Boolean(watchdogState.enforce && target)
202
+ const applied = Boolean(watchdogState.enforce && target && policy === 'restore')
199
203
  const plan = { at: new Date().toISOString(), level: 'L1', crash: null, reason: 'tamper', remediation: remediationFor('tamper'), target, inFlight: false, evidence: { files: result.diffs, candidates: evidence }, applied }
200
204
  watchdogState.plans.push(plan)
201
205
  if (watchdogState.plans.length > 20) watchdogState.plans = watchdogState.plans.slice(-20)
@@ -208,6 +212,62 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
208
212
  persist(true)
209
213
  }
210
214
 
215
+ const RSS_INTERVAL_MS = 60_000
216
+ let rssTimer = null
217
+ let rssScanning = false
218
+
219
+ function scanChildRss() {
220
+ if (process.platform !== 'win32' || rssScanning) return
221
+ const manager = refs.manager
222
+ if (!manager || typeof manager.listBundles !== 'function') return
223
+ rssScanning = true
224
+ const script = [
225
+ "$ErrorActionPreference='SilentlyContinue'",
226
+ "Get-CimInstance Win32_Process | Where-Object { $_.CommandLine } | ForEach-Object { ($_.ProcessId.ToString() + '|' + [string]$_.WorkingSetSize + '|' + $_.CommandLine) }",
227
+ ].join('; ')
228
+ let output = ''
229
+ const child = spawn('powershell.exe', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', script], { windowsHide: true, stdio: ['ignore', 'pipe', 'ignore'] })
230
+ child.stdout.on('data', (chunk) => { output += String(chunk) })
231
+ child.on('error', () => { rssScanning = false })
232
+ child.on('exit', () => {
233
+ rssScanning = false
234
+ void manager
235
+ .listBundles()
236
+ .then((rows) => {
237
+ const enabled = rows.filter((row) => row.enabled && !EXEMPT_TARGETS.has(row.name)).map((row) => row.name)
238
+ const totals = new Map()
239
+ for (const line of output.split('\n')) {
240
+ const parts = line.trim().split('|')
241
+ if (parts.length < 3) continue
242
+ const pid = Number(parts[0])
243
+ const bytes = Number(parts[1]) || 0
244
+ const commandLine = parts.slice(2).join('|')
245
+ if (pid === process.pid || commandLine.includes('dsh-desktop-host')) continue
246
+ for (const name of enabled) {
247
+ const winNeedle = 'node_modules' + path.sep + name.split('/').join(path.sep)
248
+ const posixNeedle = 'node_modules/' + name
249
+ if (commandLine.includes(winNeedle) || commandLine.includes(posixNeedle)) {
250
+ totals.set(name, (totals.get(name) || 0) + bytes)
251
+ break
252
+ }
253
+ }
254
+ }
255
+ const rss = { ...(watchdogState.rss || {}) }
256
+ for (const [name, bytes] of totals) rss[name] = bytes
257
+ watchdogState.rss = rss
258
+ watchdogState.rssAt = new Date().toISOString()
259
+ })
260
+ .catch(() => {})
261
+ })
262
+ }
263
+
264
+ function startRssScanner() {
265
+ if (rssTimer || process.platform !== 'win32' || watchdogState.config.rssScan === false) return
266
+ const timer = setTimeout(scanChildRss, 5000)
267
+ if (typeof timer.unref === 'function') timer.unref()
268
+ rssTimer = setInterval(scanChildRss, RSS_INTERVAL_MS)
269
+ if (typeof rssTimer.unref === 'function') rssTimer.unref()
270
+ }
211
271
  function persist(force = false) {
212
272
  const now = Date.now()
213
273
  if (!force && now - lastFlush < FLUSH_MS) return
@@ -259,6 +319,13 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
259
319
 
260
320
  function appendIncident(incident) {
261
321
  const record = { at: new Date().toISOString(), mode: watchdogState.mode, ...incident }
322
+ if (watchdogState.config && watchdogState.config.notify === true && ['freeze', 'pause', 'quarantine', 'tamper', 'crash-enforced', 'budget'].includes(record.kind)) {
323
+ try {
324
+ notify(record)
325
+ } catch {
326
+ // notifications are best effort
327
+ }
328
+ }
262
329
  watchdogState.incidents.push(record)
263
330
  if (watchdogState.incidents.length > MAX_INCIDENTS) watchdogState.incidents = watchdogState.incidents.slice(-MAX_INCIDENTS)
264
331
  try {
@@ -739,6 +806,7 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
739
806
  refs.manager = child.pluginManager || (typeof child.get === 'function' ? child.get('pluginManager') : null)
740
807
  if (refs.manager) {
741
808
  void reapplyQuarantine()
809
+ startRssScanner()
742
810
  const probeTimer = setTimeout(() => {
743
811
  void scheduleProbe()
744
812
  }, Number(config.probeDelayMs) > 0 ? Number(config.probeDelayMs) : 30_000)
@@ -873,6 +941,8 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
873
941
  disableTarget,
874
942
  releaseTarget,
875
943
  dispose() {
944
+ if (rssTimer) clearInterval(rssTimer)
945
+ rssTimer = null
876
946
  while (cleanups.length > 0) {
877
947
  const disposer = cleanups.pop()
878
948
  try {
@@ -885,29 +955,28 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
885
955
  }
886
956
  }
887
957
 
888
- /** Merge live operation estimates with measured module-load budgets (measured wins). */
958
+ /** Top5 v2: measured + estimate + child RSS with EWMA smoothing and rank hysteresis. */
889
959
  function mergedTop(state, limit) {
890
960
  const operations = topOperations(state.operations, 50)
891
- const measured = []
892
- for (const [target, entry] of Object.entries(state.budgets || {})) {
893
- if (!entry || entry.error || entry.moduleLoadMB === undefined) continue
894
- const existing = operations.find((row) => row.target === target)
895
- measured.push({
896
- target,
897
- count: existing ? existing.count : 0,
898
- estimateMB: entry.moduleLoadMB,
899
- lastAt: entry.measuredAt || (existing ? existing.lastAt : null),
900
- version: entry.version || (existing ? existing.version : null),
901
- source: 'measured',
902
- measuredAt: entry.measuredAt || null,
903
- })
904
- }
905
- const others = operations
906
- .filter((row) => !measured.some((entry) => entry.target === row.target))
907
- .map((row) => ({ ...row, source: 'estimate' }))
908
- return [...measured, ...others].sort((a, b) => b.estimateMB - a.estimateMB || b.count - a.count).slice(0, Math.max(1, limit))
961
+ const { rows, nextRanking } = rankTopPlugins({
962
+ operations,
963
+ budgets: state.budgets || {},
964
+ rss: state.rss || {},
965
+ previous: state.ranking || {},
966
+ limit,
967
+ })
968
+ state.ranking = nextRanking
969
+ return rows.map((row) => ({
970
+ target: row.target,
971
+ count: row.count || 0,
972
+ estimateMB: row.moduleLoadMB || row.operationMB || 0,
973
+ rssMB: row.rssMB || 0,
974
+ totalMB: row.score,
975
+ lastAt: row.measuredAt || null,
976
+ version: row.version || null,
977
+ source: row.source,
978
+ }))
909
979
  }
910
-
911
980
  /** Serialisable snapshot shared by the tool and the panel route. */
912
981
  export function watchdogSnapshot() {
913
982
  const s = watchdogState
@@ -941,6 +1010,8 @@ export function watchdogSnapshot() {
941
1010
  baseline: s.baseline ? { at: s.baseline.at, runId: s.baseline.runId, bundles: s.baseline.bundles } : null,
942
1011
  budgets: s.budgets,
943
1012
  tamper: s.tamper || null,
1013
+ rss: s.rss || {},
1014
+ rssAt: s.rssAt || null,
944
1015
  incidents: s.incidents.slice(-20),
945
1016
  generatedAt: new Date().toISOString(),
946
1017
  }
package/locale/en.json CHANGED
@@ -17,7 +17,9 @@
17
17
  "watchdog.plans": "Crash plans (dry-run)",
18
18
  "watchdog.noPlans": "No crash attribution plans.",
19
19
  "watchdog.baseline": "Clean baseline: {at}",
20
- "watchdog.tamper": "Profile watch: {n} critical file(s), last check {at}",
20
+ "watchdog.tamper": "Profile watch: {n} critical file(s) · policy {policy} · last check {at}",
21
21
  "watchdog.measure": "Measure plugin budgets now",
22
- "watchdog.measureBlocked": "Heap is frozen: measuring spawns child processes, so it stays disabled until the heap recovers."
22
+ "watchdog.measureBlocked": "Heap is frozen: measuring spawns child processes, so it stays disabled until the heap recovers.",
23
+ "prison.rss": "Child RSS",
24
+ "prison.plugin": "Plugin"
23
25
  }
package/locale/zh.json CHANGED
@@ -17,7 +17,9 @@
17
17
  "watchdog.plans": "崩溃降级计划(dry-run)",
18
18
  "watchdog.noPlans": "暂无崩溃归因计划。",
19
19
  "watchdog.baseline": "干净基线:{at}",
20
- "watchdog.tamper": "配置监控:{n} 个关键文件,最近检查 {at}",
20
+ "watchdog.tamper": "配置监控:{n} 个关键文件 · 策略 {policy} · 最近检查 {at}",
21
21
  "watchdog.measure": "立即测量插件预算",
22
- "watchdog.measureBlocked": "堆已冻结:测量会启动子进程,恢复前暂停测量。"
22
+ "watchdog.measureBlocked": "堆已冻结:测量会启动子进程,恢复前暂停测量。",
23
+ "prison.rss": "子进程 RSS",
24
+ "prison.plugin": "插件"
23
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinsearth/ai-prison-dsh-plugin",
3
- "version": "1.4.7",
3
+ "version": "1.5.1",
4
4
  "description": "AI Prison for DSH: six governance tools wrapping the aiprison CLI (levels, demo, drill, inspect, verify, repair-tail) plus a panel for the L0–L5 matrix and the audit-chain state. The CLI ships bundled for Windows, macOS and Linux; every capability-removal backend stays simulated.",
5
5
  "type": "module",
6
6
  "main": "index.js",