shieldcortex 3.4.23 → 3.4.25

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.
Files changed (35) hide show
  1. package/dashboard/.next/standalone/dashboard/.next/BUILD_ID +1 -1
  2. package/dashboard/.next/standalone/dashboard/.next/build-manifest.json +2 -2
  3. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.html +2 -2
  4. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.rsc +1 -1
  5. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  6. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  7. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  8. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  9. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.html +1 -1
  11. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.rsc +1 -1
  12. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  13. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  14. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  15. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  16. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  17. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  18. package/dashboard/.next/standalone/dashboard/.next/server/app/index.html +1 -1
  19. package/dashboard/.next/standalone/dashboard/.next/server/app/index.rsc +2 -2
  20. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  21. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_full.segment.rsc +2 -2
  22. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
  23. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_index.segment.rsc +1 -1
  24. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  25. package/dashboard/.next/standalone/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  26. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_3051539d._.js +1 -1
  27. package/dashboard/.next/standalone/dashboard/.next/server/pages/404.html +1 -1
  28. package/dashboard/.next/standalone/dashboard/.next/server/pages/500.html +2 -2
  29. package/dashboard/.next/standalone/dashboard/.next/static/chunks/{7eae8665a0fe51b7.js → 900074da91600bf4.js} +1 -1
  30. package/dist/database/init.d.ts +2 -0
  31. package/dist/database/init.js +11 -2
  32. package/package.json +1 -1
  33. /package/dashboard/.next/standalone/dashboard/.next/static/{P20PnYVkcKuhHSzq3K9zh → WOwuTcn7Fh75TANpV0Hxf}/_buildManifest.js +0 -0
  34. /package/dashboard/.next/standalone/dashboard/.next/static/{P20PnYVkcKuhHSzq3K9zh → WOwuTcn7Fh75TANpV0Hxf}/_clientMiddlewareManifest.json +0 -0
  35. /package/dashboard/.next/standalone/dashboard/.next/static/{P20PnYVkcKuhHSzq3K9zh → WOwuTcn7Fh75TANpV0Hxf}/_ssgManifest.js +0 -0
@@ -20,6 +20,7 @@ declare function resolveRuntimeInfo(): RuntimeInfo;
20
20
  declare function enforceSafeRuntimePath(expandedPath: string, explicitDbPath: boolean): void;
21
21
  declare function inspectDatabaseFile(dbPath: string): DatabaseInspection;
22
22
  declare function listHealthyBackups(dbPath: string): BackupCandidate[];
23
+ declare function acquireStartupLock(dbPath: string): void;
23
24
  declare function isLikelyFtsIntegrityIssue(integrityResult: string): boolean;
24
25
  declare function attemptFtsRecovery(database: Database.Database): boolean;
25
26
  declare function verifyOnDiskIntegrity(dbPath: string): string;
@@ -31,6 +32,7 @@ export declare const __databaseTestUtils: {
31
32
  listHealthyBackups: typeof listHealthyBackups;
32
33
  resolveRuntimeInfo: typeof resolveRuntimeInfo;
33
34
  enforceSafeRuntimePath: typeof enforceSafeRuntimePath;
35
+ acquireStartupLock: typeof acquireStartupLock;
34
36
  };
35
37
  /**
36
38
  * Initialize the database connection
@@ -182,9 +182,11 @@ function acquireStartupLock(dbPath) {
182
182
  }
183
183
  catch {
184
184
  let activeProcessError = null;
185
+ let existingPid = null;
185
186
  try {
186
187
  const existing = JSON.parse(readFileSync(lockFilePath, 'utf-8'));
187
188
  if (typeof existing.pid === 'number') {
189
+ existingPid = existing.pid;
188
190
  try {
189
191
  process.kill(existing.pid, 0);
190
192
  activeProcessError = new Error(`[database] Refusing startup because ShieldCortex PID ${existing.pid} is already using ${dbPath}` +
@@ -201,7 +203,11 @@ function acquireStartupLock(dbPath) {
201
203
  // Stale or unreadable lock file — remove and retry.
202
204
  }
203
205
  if (activeProcessError) {
204
- throw activeProcessError;
206
+ console.error(`[database] Another ShieldCortex process (PID ${existingPid ?? 'unknown'}) is using ${dbPath} — ` +
207
+ `continuing anyway (SQLite WAL handles concurrency)`);
208
+ lockFilePath = null;
209
+ lockFileFd = null;
210
+ return;
205
211
  }
206
212
  try {
207
213
  unlinkSync(lockFilePath);
@@ -346,6 +352,7 @@ export const __databaseTestUtils = {
346
352
  listHealthyBackups,
347
353
  resolveRuntimeInfo,
348
354
  enforceSafeRuntimePath,
355
+ acquireStartupLock,
349
356
  };
350
357
  /**
351
358
  * Initialize the database connection
@@ -809,7 +816,7 @@ export function closeDatabase() {
809
816
  if (db) {
810
817
  try {
811
818
  // Checkpoint WAL before closing to flush all changes
812
- db.pragma('wal_checkpoint(TRUNCATE)');
819
+ db.pragma('wal_checkpoint(PASSIVE)');
813
820
  }
814
821
  catch {
815
822
  // Ignore checkpoint errors on close
@@ -914,6 +921,8 @@ let shutdownRegistered = false;
914
921
  function registerShutdownHandlers() {
915
922
  if (shutdownRegistered)
916
923
  return;
924
+ if (process.env.NODE_ENV === 'test' || process.env.JEST_WORKER_ID)
925
+ return;
917
926
  shutdownRegistered = true;
918
927
  const cleanup = () => {
919
928
  closeDatabase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shieldcortex",
3
- "version": "3.4.23",
3
+ "version": "3.4.25",
4
4
  "description": "Trustworthy memory and security for AI agents. Recall debugging, review queue, OpenClaw session capture, and memory poisoning defence for Claude Code, Codex, OpenClaw, LangChain, and MCP agents.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",