@twinsearth/ai-prison-dsh-plugin 1.5.0 → 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,21 @@
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
5
20
  ## [1.5.0] — 2026-11-18
6
21
 
7
22
  ### Changed — profile tamper monitor is dry-run (observe) by default
@@ -221,19 +221,14 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
221
221
  const manager = refs.manager
222
222
  if (!manager || typeof manager.listBundles !== 'function') return
223
223
  rssScanning = true
224
- const profileLiteral = String(profileDir).replace(/'/g, "''")
225
224
  const script = [
226
225
  "$ErrorActionPreference='SilentlyContinue'",
227
- "Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -and $_.CommandLine -like '*node_modules*' -and $_.CommandLine -like '*" + profileLiteral + "*' } | ForEach-Object { ($_.ProcessId.ToString() + '|' + [string]$_.WorkingSetSize + '|' + $_.CommandLine) }",
226
+ "Get-CimInstance Win32_Process | Where-Object { $_.CommandLine } | ForEach-Object { ($_.ProcessId.ToString() + '|' + [string]$_.WorkingSetSize + '|' + $_.CommandLine) }",
228
227
  ].join('; ')
229
228
  let output = ''
230
229
  const child = spawn('powershell.exe', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', script], { windowsHide: true, stdio: ['ignore', 'pipe', 'ignore'] })
231
- child.stdout.on('data', (chunk) => {
232
- output += String(chunk)
233
- })
234
- child.on('error', () => {
235
- rssScanning = false
236
- })
230
+ child.stdout.on('data', (chunk) => { output += String(chunk) })
231
+ child.on('error', () => { rssScanning = false })
237
232
  child.on('exit', () => {
238
233
  rssScanning = false
239
234
  void manager
@@ -244,10 +239,14 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
244
239
  for (const line of output.split('\n')) {
245
240
  const parts = line.trim().split('|')
246
241
  if (parts.length < 3) continue
242
+ const pid = Number(parts[0])
247
243
  const bytes = Number(parts[1]) || 0
248
244
  const commandLine = parts.slice(2).join('|')
245
+ if (pid === process.pid || commandLine.includes('dsh-desktop-host')) continue
249
246
  for (const name of enabled) {
250
- if (commandLine.includes('node_modules' + path.sep + name) || commandLine.includes('node_modules/' + name)) {
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)) {
251
250
  totals.set(name, (totals.get(name) || 0) + bytes)
252
251
  break
253
252
  }
@@ -263,7 +262,7 @@ export function createWatchdog(ctx, config = {}, logger = {}) {
263
262
  }
264
263
 
265
264
  function startRssScanner() {
266
- if (rssTimer || process.platform !== 'win32') return
265
+ if (rssTimer || process.platform !== 'win32' || watchdogState.config.rssScan === false) return
267
266
  const timer = setTimeout(scanChildRss, 5000)
268
267
  if (typeof timer.unref === 'function') timer.unref()
269
268
  rssTimer = setInterval(scanChildRss, RSS_INTERVAL_MS)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinsearth/ai-prison-dsh-plugin",
3
- "version": "1.5.0",
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",