fullcourtdefense-cli 1.24.1 → 1.24.2

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.
@@ -32,6 +32,7 @@ export declare function discoverSweepCredentialEnv(credentials?: {
32
32
  shieldKey?: string;
33
33
  apiUrl?: string;
34
34
  }): Record<string, string>;
35
+ export declare function cliVersion(): string | undefined;
35
36
  export type TaskLogonType = 'S4U' | 'InteractiveToken';
36
37
  /** Fully-qualified current user (DOMAIN\\user) for the task principal. */
37
38
  export declare function taskUserId(): string;
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.daemonDiscoverSweepArgs = daemonDiscoverSweepArgs;
37
37
  exports.summarizeDiscoverStderr = summarizeDiscoverStderr;
38
38
  exports.discoverSweepCredentialEnv = discoverSweepCredentialEnv;
39
+ exports.cliVersion = cliVersion;
39
40
  exports.taskUserId = taskUserId;
40
41
  exports.taskLocalTimestamp = taskLocalTimestamp;
41
42
  exports.buildTaskXml = buildTaskXml;
@@ -383,7 +384,15 @@ async function runDaemon(args, config) {
383
384
  // Crash forensics: was the previous daemon killed without a clean shutdown?
384
385
  const postmortem = (0, daemonForensics_1.recordDaemonStart)({ version: cliVersion(), isPidAlive });
385
386
  if (postmortem) {
386
- log(`Previous daemon (v${postmortem.version || '?'}) died UNCLEANLY — last alive ${postmortem.lastAliveAt || 'unknown'}, no shutdown recorded. Likely killed externally (EDR/AV, OOM, or forced termination). Post-mortem recorded; reporting upstream.`);
387
+ const current = cliVersion();
388
+ if (postmortem.version && current && postmortem.version !== current) {
389
+ // The silent updater stops the old daemon forcefully — an unclean death
390
+ // of an OLDER version is the upgrade itself, not something to alarm on.
391
+ log(`Previous daemon (v${postmortem.version}) was replaced by this upgrade to v${current} — the updater's forced stop is expected, not a crash. Post-mortem recorded for the timeline.`);
392
+ }
393
+ else {
394
+ log(`Previous daemon (v${postmortem.version || '?'}) died UNCLEANLY — last alive ${postmortem.lastAliveAt || 'unknown'}, no shutdown recorded. Likely killed externally (EDR/AV, OOM, or forced termination). Post-mortem recorded; reporting upstream.`);
395
+ }
387
396
  }
388
397
  // A fresh daemon runs right after every successful MSI update: if a
389
398
  // previously-reported update loop has been resolved by this version, clear
@@ -37,6 +37,13 @@ export declare function collectEnvironmentDiagnostics(options?: {
37
37
  }): Promise<EnvironmentDiagnostics>;
38
38
  /** One-line human summary for the onboarding journal / MSI screen / daemon log. */
39
39
  export declare function summarizeEnvironmentDiagnostics(diag: EnvironmentDiagnostics): string;
40
+ /**
41
+ * The silent updater stops the old daemon FORCEFULLY, so an upgrade always
42
+ * leaves an "unclean death" post-mortem — of the OLD version. When the dead
43
+ * daemon's version differs from the CLI running now, that death was the
44
+ * upgrade replacing it: routine, expected, and not a health problem.
45
+ */
46
+ export declare function crashLooksLikeUpgradeRestart(crash: DaemonPostmortem): boolean;
40
47
  /**
41
48
  * Verdict for the onboarding journal: healthy unless something on this
42
49
  * machine is actively interfering (daemon killed, PowerShell blocked, or a
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.collectEnvironmentDiagnostics = collectEnvironmentDiagnostics;
4
4
  exports.summarizeEnvironmentDiagnostics = summarizeEnvironmentDiagnostics;
5
+ exports.crashLooksLikeUpgradeRestart = crashLooksLikeUpgradeRestart;
5
6
  exports.environmentLooksHealthy = environmentLooksHealthy;
6
7
  const config_1 = require("./config");
7
8
  const daemon_1 = require("./commands/daemon");
@@ -77,10 +78,23 @@ function summarizeEnvironmentDiagnostics(diag) {
77
78
  parts.push(diag.daemonAlive ? 'daemon alive' : 'daemon not running');
78
79
  }
79
80
  parts.push(diag.watchdogTaskInstalled ? 'watchdog installed' : 'watchdog task missing');
80
- if (diag.lastCrash)
81
- parts.push(`previous daemon died uncleanly at ${diag.lastCrash.lastAliveAt || 'unknown time'}`);
81
+ if (diag.lastCrash) {
82
+ parts.push(crashLooksLikeUpgradeRestart(diag.lastCrash)
83
+ ? `previous daemon (v${diag.lastCrash.version}) was replaced by a CLI upgrade — routine, not a crash`
84
+ : `previous daemon died uncleanly at ${diag.lastCrash.lastAliveAt || 'unknown time'}`);
85
+ }
82
86
  return parts.join('; ');
83
87
  }
88
+ /**
89
+ * The silent updater stops the old daemon FORCEFULLY, so an upgrade always
90
+ * leaves an "unclean death" post-mortem — of the OLD version. When the dead
91
+ * daemon's version differs from the CLI running now, that death was the
92
+ * upgrade replacing it: routine, expected, and not a health problem.
93
+ */
94
+ function crashLooksLikeUpgradeRestart(crash) {
95
+ const current = (0, daemon_1.cliVersion)();
96
+ return Boolean(crash.version && current && crash.version !== current);
97
+ }
84
98
  /**
85
99
  * Verdict for the onboarding journal: healthy unless something on this
86
100
  * machine is actively interfering (daemon killed, PowerShell blocked, or a
@@ -92,7 +106,9 @@ function environmentLooksHealthy(diag) {
92
106
  return false;
93
107
  if (diag.powershellSpawnOk === false)
94
108
  return false;
95
- if (diag.lastCrash)
109
+ // Upgrade restarts are not crashes — only a same-version unclean death
110
+ // (something actually killed the daemon) marks the environment unhealthy.
111
+ if (diag.lastCrash && !crashLooksLikeUpgradeRestart(diag.lastCrash))
96
112
  return false;
97
113
  return true;
98
114
  }
package/dist/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "1.24.1"
2
+ "version": "1.24.2"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fullcourtdefense-cli",
3
- "version": "1.24.1",
3
+ "version": "1.24.2",
4
4
  "description": "Full Court Defense CLI — security scanning for AI agents from your terminal",
5
5
  "main": "dist/index.js",
6
6
  "bin": {