@twinsearth/ai-prison-dsh-plugin 1.7.6 → 1.7.7

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,17 @@
2
2
 
3
3
  All notable changes to `@twinsearth/ai-prison-dsh-plugin` are recorded here.
4
4
 
5
+ ## [1.7.7] — 2026-11-19
6
+
7
+ ### Fixed
8
+
9
+ - The crash-plan level is recomputed from the crashes inside the 10-minute
10
+ window instead of showing a stale persisted level (a fresh profile with no
11
+ recent crash now shows L0, not yesterday's L2).
12
+ - `ai_prison_watchdog_status` now returns the `crashPlan` object (level, window,
13
+ reset time, next level, steps and last plan), matching the panel.
14
+
15
+ ## [1.7.6] — 2026-11-19
5
16
  ## [1.7.6] — 2026-11-19
6
17
 
7
18
  ### Added — crash degradation plan (crashForensics v2)
package/lib/tools.js CHANGED
@@ -242,6 +242,7 @@ export async function installTools({ ctx, config = {}, logger } = {}) {
242
242
  heap6gRequest: snapshot.heap6gRequest,
243
243
  pendingBoot: snapshot.pendingBoot,
244
244
  memoryTiers: snapshot.memoryTiers,
245
+ crashPlan: snapshot.crashPlan,
245
246
  rss: snapshot.rss,
246
247
  rssAt: snapshot.rssAt,
247
248
  rssError: snapshot.rssError,
@@ -58,12 +58,13 @@ export function watchdogSnapshot() {
58
58
  const esc = s.escalation || {}
59
59
  const now = Date.now()
60
60
  const recentCrashes = Array.isArray(esc.crashes) ? esc.crashes.filter((at) => now - at <= CRASH_WINDOW_MS) : []
61
- const crashLevel = esc.level || (recentCrashes.length >= 3 ? 'L3' : recentCrashes.length >= 2 ? 'L2' : recentCrashes.length >= 1 ? 'L1' : 'L0')
61
+ const crashLevel = recentCrashes.length >= 3 ? 'L3' : recentCrashes.length >= 2 ? 'L2' : recentCrashes.length >= 1 ? 'L1' : 'L0'
62
62
  const nextLevel = crashLevel === 'L0' ? 'L1' : crashLevel === 'L1' ? 'L2' : crashLevel === 'L2' ? 'L3' : null
63
63
  const lastPlan = s.plans && s.plans.length > 0 ? s.plans[s.plans.length - 1] : null
64
64
  const crashPlan = {
65
65
  level: crashLevel,
66
66
  previousLevel: esc.previousLevel || null,
67
+ storedLevel: esc.level || null,
67
68
  crashes: recentCrashes.length,
68
69
  windowMs: CRASH_WINDOW_MS,
69
70
  resetMs: CRASH_RESET_MS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinsearth/ai-prison-dsh-plugin",
3
- "version": "1.7.6",
3
+ "version": "1.7.7",
4
4
  "description": "AI Prison for DSH: eight governance tools wrapping the aiprison CLI (levels, status, watchdog status, 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",