0xray 2.1.1 → 2.1.3

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 (254) hide show
  1. package/.opencode/codex.codex +1 -1
  2. package/.opencode/commands/dependency-audit.md +3 -3
  3. package/.opencode/enforcer-config.json +2 -2
  4. package/AGENTS.md +3 -2
  5. package/README.md +12 -11
  6. package/dist/AGENTS.md +3 -2
  7. package/dist/CHANGELOG.md +26 -0
  8. package/dist/README.md +12 -11
  9. package/dist/agents/code-reviewer.js +1 -1
  10. package/dist/analytics/routing-refiner.js +1 -1
  11. package/dist/cli/index.js +11 -1
  12. package/dist/cli/server.js +3 -3
  13. package/dist/core/activity-logger.d.ts +2 -2
  14. package/dist/core/activity-logger.js +4 -4
  15. package/dist/core/boot-orchestrator.d.ts +1 -1
  16. package/dist/core/boot-orchestrator.js +13 -28
  17. package/dist/core/bridge.mjs +3 -3
  18. package/dist/core/codex-formatter.js +2 -2
  19. package/dist/core/codex-injector.d.ts +0 -1
  20. package/dist/core/codex-injector.js +2 -3
  21. package/dist/core/config-loader.d.ts +1 -1
  22. package/dist/core/config-loader.js +1 -1
  23. package/dist/core/config-paths.d.ts +0 -2
  24. package/dist/core/config-paths.js +7 -8
  25. package/dist/core/context-loader.d.ts +1 -1
  26. package/dist/core/context-loader.js +1 -1
  27. package/dist/core/errors.d.ts +3 -0
  28. package/dist/core/errors.js +10 -0
  29. package/dist/core/features-config.js +1 -1
  30. package/dist/core/framework-logger.d.ts +3 -3
  31. package/dist/core/framework-logger.js +17 -9
  32. package/dist/core/index.d.ts +2 -2
  33. package/dist/core/index.js +4 -2
  34. package/dist/core/logging-config.d.ts +2 -1
  35. package/dist/core/logging-config.js +7 -7
  36. package/dist/enforcement/loaders/codex-loader.js +1 -1
  37. package/dist/execution/opencode-cli-invoker.js +5 -5
  38. package/dist/governance/governance-service.js +1 -1
  39. package/dist/index.d.ts +3 -3
  40. package/dist/index.js +3 -3
  41. package/dist/inference/inference-cycle.d.ts +1 -1
  42. package/dist/inference/inference-cycle.js +10 -10
  43. package/dist/integrations/base/Integration.js +1 -1
  44. package/dist/integrations/base/registry.js +19 -19
  45. package/dist/integrations/grok/grok-cli.js +17 -17
  46. package/dist/integrations/grok/hooks/pre-tool-use.js +1 -1
  47. package/dist/integrations/hermes-agent/bridge.mjs +1 -1
  48. package/dist/integrations/openclaw/api-server.d.ts +0 -1
  49. package/dist/integrations/openclaw/api-server.js +7 -10
  50. package/dist/integrations/openclaw/client.d.ts +0 -1
  51. package/dist/integrations/openclaw/client.js +22 -24
  52. package/dist/integrations/openclaw/hooks/xray-hooks.d.ts +0 -1
  53. package/dist/integrations/openclaw/hooks/xray-hooks.js +17 -18
  54. package/dist/integrations/plugins/plugin-registry.js +5 -5
  55. package/dist/mcps/architect-tools.server.d.ts +2 -4
  56. package/dist/mcps/architect-tools.server.js +112 -195
  57. package/dist/mcps/auto-format.server.d.ts +2 -4
  58. package/dist/mcps/auto-format.server.js +49 -95
  59. package/dist/mcps/boot-orchestrator.server.d.ts +2 -4
  60. package/dist/mcps/boot-orchestrator.server.js +73 -105
  61. package/dist/mcps/config/server-config-registry.js +3 -3
  62. package/dist/mcps/enforcer-tools.server.d.ts +2 -4
  63. package/dist/mcps/enforcer-tools.server.js +202 -285
  64. package/dist/mcps/estimation.server.d.ts +2 -4
  65. package/dist/mcps/estimation.server.js +63 -107
  66. package/dist/mcps/framework-compliance-audit.server.d.ts +2 -4
  67. package/dist/mcps/framework-compliance-audit.server.js +53 -82
  68. package/dist/mcps/framework-help.server.d.ts +2 -4
  69. package/dist/mcps/framework-help.server.js +63 -101
  70. package/dist/mcps/governance.server.js +2 -2
  71. package/dist/mcps/knowledge-skills/api-design.server.d.ts +2 -4
  72. package/dist/mcps/knowledge-skills/api-design.server.js +35 -67
  73. package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -10
  74. package/dist/mcps/knowledge-skills/architecture-patterns.server.js +35 -74
  75. package/dist/mcps/knowledge-skills/bug-triage-specialist.server.d.ts +2 -4
  76. package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +143 -162
  77. package/dist/mcps/knowledge-skills/code-analyzer.server.d.ts +3 -4
  78. package/dist/mcps/knowledge-skills/code-analyzer.server.js +20 -45
  79. package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -4
  80. package/dist/mcps/knowledge-skills/code-review.server.js +109 -143
  81. package/dist/mcps/knowledge-skills/content-creator.server.d.ts +2 -4
  82. package/dist/mcps/knowledge-skills/content-creator.server.js +205 -226
  83. package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -4
  84. package/dist/mcps/knowledge-skills/database-design.server.js +117 -151
  85. package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -4
  86. package/dist/mcps/knowledge-skills/devops-deployment.server.js +71 -160
  87. package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -4
  88. package/dist/mcps/knowledge-skills/git-workflow.server.js +36 -68
  89. package/dist/mcps/knowledge-skills/growth-strategist.server.d.ts +2 -4
  90. package/dist/mcps/knowledge-skills/growth-strategist.server.js +303 -324
  91. package/dist/mcps/knowledge-skills/log-monitor.server.d.ts +2 -4
  92. package/dist/mcps/knowledge-skills/log-monitor.server.js +141 -160
  93. package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -4
  94. package/dist/mcps/knowledge-skills/mobile-development.server.js +92 -209
  95. package/dist/mcps/knowledge-skills/multimodal-looker.server.d.ts +2 -4
  96. package/dist/mcps/knowledge-skills/multimodal-looker.server.js +123 -159
  97. package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -5
  98. package/dist/mcps/knowledge-skills/performance-optimization.server.js +155 -296
  99. package/dist/mcps/knowledge-skills/project-analysis.server.d.ts +2 -4
  100. package/dist/mcps/knowledge-skills/project-analysis.server.js +75 -226
  101. package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -4
  102. package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +63 -156
  103. package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -4
  104. package/dist/mcps/knowledge-skills/security-audit.server.js +102 -136
  105. package/dist/mcps/knowledge-skills/seo-consultant.server.d.ts +2 -4
  106. package/dist/mcps/knowledge-skills/seo-consultant.server.js +80 -203
  107. package/dist/mcps/knowledge-skills/session-management.server.d.ts +2 -4
  108. package/dist/mcps/knowledge-skills/session-management.server.js +50 -203
  109. package/dist/mcps/knowledge-skills/skill-invocation.server.d.ts +2 -4
  110. package/dist/mcps/knowledge-skills/skill-invocation.server.js +168 -347
  111. package/dist/mcps/knowledge-skills/strategist.server.d.ts +2 -11
  112. package/dist/mcps/knowledge-skills/strategist.server.js +72 -122
  113. package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -4
  114. package/dist/mcps/knowledge-skills/tech-writer.server.js +87 -300
  115. package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -4
  116. package/dist/mcps/knowledge-skills/testing-best-practices.server.js +147 -182
  117. package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -4
  118. package/dist/mcps/knowledge-skills/testing-strategy.server.js +78 -153
  119. package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -5
  120. package/dist/mcps/knowledge-skills/ui-ux-design.server.js +90 -399
  121. package/dist/mcps/lint.server.d.ts +2 -4
  122. package/dist/mcps/lint.server.js +51 -92
  123. package/dist/mcps/mcp-client.js +2 -2
  124. package/dist/mcps/model-health-check.server.d.ts +2 -4
  125. package/dist/mcps/model-health-check.server.js +32 -60
  126. package/dist/mcps/performance-analysis.server.d.ts +2 -4
  127. package/dist/mcps/performance-analysis.server.js +57 -88
  128. package/dist/mcps/processor-pipeline.server.d.ts +2 -4
  129. package/dist/mcps/processor-pipeline.server.js +69 -100
  130. package/dist/mcps/registry.json +1 -1
  131. package/dist/mcps/researcher.server.d.ts +3 -5
  132. package/dist/mcps/researcher.server.js +81 -154
  133. package/dist/mcps/security-scan.server.d.ts +2 -4
  134. package/dist/mcps/security-scan.server.js +54 -96
  135. package/dist/mcps/shared/knowledge-skill-base.d.ts +14 -0
  136. package/dist/mcps/shared/knowledge-skill-base.js +45 -0
  137. package/dist/{security → mcps/shared}/security-scanner.js +1 -1
  138. package/dist/mcps/state-manager.server.d.ts +2 -4
  139. package/dist/mcps/state-manager.server.js +115 -160
  140. package/dist/orchestrator/orchestrator.d.ts +1 -1
  141. package/dist/orchestrator/orchestrator.js +1 -1
  142. package/dist/orchestrator/universal-registry-bridge.js +1 -1
  143. package/dist/plugin/xray-codex-injection.d.ts +1 -1
  144. package/dist/plugin/xray-codex-injection.js +1 -1
  145. package/dist/postprocessor/PostProcessor.d.ts +4 -44
  146. package/dist/postprocessor/PostProcessor.js +39 -553
  147. package/dist/postprocessor/analysis/CodeChangeAnalyzer.d.ts +11 -0
  148. package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +50 -0
  149. package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.d.ts +11 -0
  150. package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.js +356 -0
  151. package/dist/postprocessor/config/ProcessorConfigLoader.d.ts +44 -0
  152. package/dist/postprocessor/config/ProcessorConfigLoader.js +21 -0
  153. package/dist/postprocessor/reporting/PostProcessorReporter.d.ts +19 -0
  154. package/dist/postprocessor/reporting/PostProcessorReporter.js +96 -0
  155. package/dist/postprocessor/triggers/GitHookTrigger.js +11 -11
  156. package/dist/processors/implementations/refactoring-logging-processor-wrapper.d.ts +32 -0
  157. package/dist/processors/implementations/refactoring-logging-processor-wrapper.js +95 -1
  158. package/dist/processors/processor-manager.js +346 -314
  159. package/dist/reporting/report-formatter.js +1 -1
  160. package/dist/security/security-hardener.d.ts +69 -2
  161. package/dist/security/security-hardener.js +129 -1
  162. package/dist/skills/registry.json +1 -1
  163. package/dist/state/index.d.ts +3 -5
  164. package/dist/state/index.js +1 -7
  165. package/dist/state/state-manager.d.ts +1 -1
  166. package/dist/state/state-manager.js +2 -3
  167. package/package.json +14 -10
  168. package/scripts/node/setup.cjs +32 -0
  169. package/scripts/node/universal-version-manager.js +11 -11
  170. package/src/mcps/architect-tools.server.ts +112 -215
  171. package/src/mcps/auto-format.server.ts +50 -110
  172. package/src/mcps/boot-orchestrator.server.ts +75 -121
  173. package/src/mcps/config/__tests__/server-config-registry.test.ts +21 -12
  174. package/src/mcps/config/server-config-registry.ts +3 -3
  175. package/src/mcps/enforcer-tools.server.ts +212 -310
  176. package/src/mcps/estimation.server.ts +62 -122
  177. package/src/mcps/framework-compliance-audit.server.ts +52 -97
  178. package/src/mcps/framework-help.server.ts +64 -114
  179. package/src/mcps/governance.server.ts +2 -2
  180. package/src/mcps/knowledge-skills/api-design.server.ts +32 -77
  181. package/src/mcps/knowledge-skills/architecture-patterns.server.ts +31 -87
  182. package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +165 -193
  183. package/src/mcps/knowledge-skills/code-analyzer.server.ts +20 -55
  184. package/src/mcps/knowledge-skills/code-review.server.ts +114 -161
  185. package/src/mcps/knowledge-skills/content-creator.server.ts +218 -255
  186. package/src/mcps/knowledge-skills/database-design.server.ts +118 -165
  187. package/src/mcps/knowledge-skills/devops-deployment.server.ts +67 -172
  188. package/src/mcps/knowledge-skills/git-workflow.server.ts +32 -77
  189. package/src/mcps/knowledge-skills/growth-strategist.server.ts +324 -361
  190. package/src/mcps/knowledge-skills/log-monitor.server.ts +160 -187
  191. package/src/mcps/knowledge-skills/mobile-development.server.ts +89 -223
  192. package/src/mcps/knowledge-skills/multimodal-looker.server.ts +128 -175
  193. package/src/mcps/knowledge-skills/performance-optimization.server.ts +156 -329
  194. package/src/mcps/knowledge-skills/project-analysis.server.ts +72 -248
  195. package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +59 -171
  196. package/src/mcps/knowledge-skills/security-audit.server.ts +104 -151
  197. package/src/mcps/knowledge-skills/seo-consultant.server.ts +80 -220
  198. package/src/mcps/knowledge-skills/session-management.server.ts +51 -232
  199. package/src/mcps/knowledge-skills/skill-invocation.server.ts +165 -372
  200. package/src/mcps/knowledge-skills/strategist.server.ts +72 -143
  201. package/src/mcps/knowledge-skills/tech-writer.server.ts +85 -350
  202. package/src/mcps/knowledge-skills/testing-best-practices.server.ts +146 -195
  203. package/src/mcps/knowledge-skills/testing-strategy.server.ts +75 -161
  204. package/src/mcps/knowledge-skills/ui-ux-design.server.ts +93 -487
  205. package/src/mcps/lint.server.ts +53 -107
  206. package/src/mcps/mcp-client.ts +2 -2
  207. package/src/mcps/model-health-check.server.ts +34 -71
  208. package/src/mcps/performance-analysis.server.ts +60 -104
  209. package/src/mcps/processor-pipeline.server.ts +72 -110
  210. package/src/mcps/registry.json +1 -1
  211. package/src/mcps/researcher.server.ts +88 -177
  212. package/src/mcps/security-scan.server.ts +55 -104
  213. package/src/mcps/shared/knowledge-skill-base.ts +62 -0
  214. package/src/mcps/shared/prompt-security-validator.ts +199 -0
  215. package/src/mcps/shared/security-scanner.ts +599 -0
  216. package/src/mcps/state-manager.server.ts +117 -175
  217. package/src/opencode/codex.codex +1 -1
  218. package/src/opencode/commands/dependency-audit.md +3 -3
  219. package/src/opencode/enforcer-config.json +2 -2
  220. package/src/skills/registry.json +1 -1
  221. package/xray/agents_template.md +109 -0
  222. package/xray/codex.json +598 -0
  223. package/xray/config.json +26 -0
  224. package/xray/features.json +132 -0
  225. package/xray/integrations.json +23 -0
  226. package/xray/routing-mappings.json +752 -0
  227. package/xray/workflow_state.json +28 -0
  228. package/dist/integrations/hermes-agent/__pycache__/__init__.cpython-313.pyc +0 -0
  229. package/dist/integrations/hermes-agent/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
  230. package/dist/integrations/hermes-agent/__pycache__/schemas.cpython-313.pyc +0 -0
  231. package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313-pytest-9.0.2.pyc +0 -0
  232. package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313.pyc +0 -0
  233. package/dist/integrations/hermes-agent/__pycache__/tools.cpython-313.pyc +0 -0
  234. package/dist/integrations/hermes-agent/conftest.py +0 -14
  235. package/dist/integrations/hermes-agent/test_plugin.py +0 -1103
  236. package/dist/processors/implementations/refactoring-logging-processor.d.ts +0 -31
  237. package/dist/processors/implementations/refactoring-logging-processor.js +0 -96
  238. package/dist/processors/implementations/session-capture-processor.d.ts +0 -14
  239. package/dist/processors/implementations/session-capture-processor.js +0 -37
  240. package/dist/scripts/activate-kernel-pipeline.d.ts +0 -7
  241. package/dist/scripts/activate-kernel-pipeline.js +0 -101
  242. package/dist/security/index.d.ts +0 -13
  243. package/dist/security/index.js +0 -13
  244. package/dist/security/security-agent-coordinator.d.ts +0 -72
  245. package/dist/security/security-agent-coordinator.js +0 -204
  246. package/dist/security/security-auditor.d.ts +0 -56
  247. package/dist/security/security-auditor.js +0 -584
  248. package/dist/security/security-hardening-system.d.ts +0 -239
  249. package/dist/security/security-hardening-system.js +0 -727
  250. package/dist/security/security-orchestration-layer.d.ts +0 -119
  251. package/dist/security/security-orchestration-layer.js +0 -496
  252. /package/dist/{security → mcps/shared}/prompt-security-validator.d.ts +0 -0
  253. /package/dist/{security → mcps/shared}/prompt-security-validator.js +0 -0
  254. /package/dist/{security → mcps/shared}/security-scanner.d.ts +0 -0
@@ -98,7 +98,7 @@ ${data.recommendations.map((rec) => `- ${rec}`).join("\n")}
98
98
  4. **Performance Monitoring**: Track rule enforcement effectiveness metrics
99
99
 
100
100
  ---
101
- *Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .xray fallbacks)*
101
+ *Consumer runtime compat (XRAY_ env + .xray fallbacks)*
102
102
  *Framework Status: Operational*
103
103
  `;
104
104
  }
@@ -3,11 +3,29 @@
3
3
  *
4
4
  * Implements additional security measures and hardening for the framework.
5
5
  * Addresses vulnerabilities identified during security audit.
6
+ * Includes AES-256-GCM encryption, scrypt password hashing, and event tracking.
6
7
  *
7
- * @version 1.0.0
8
+ * @version 2.0.0
8
9
  * @since 2026-01-07
9
10
  */
10
- import { SecurityIssue } from "./security-auditor.js";
11
+ export interface SecurityIssue {
12
+ severity: "critical" | "high" | "medium" | "low" | "info";
13
+ category: string;
14
+ file: string;
15
+ line?: number;
16
+ description: string;
17
+ recommendation: string;
18
+ cwe?: string;
19
+ }
20
+ interface SecurityEvent {
21
+ id: string;
22
+ type: string;
23
+ severity: "low" | "medium" | "high" | "critical";
24
+ message: string;
25
+ source: string;
26
+ timestamp: number;
27
+ metadata?: Record<string, unknown>;
28
+ }
11
29
  export interface SecurityHardeningConfig {
12
30
  enableInputValidation: boolean;
13
31
  enableRateLimiting: boolean;
@@ -19,7 +37,55 @@ export interface SecurityHardeningConfig {
19
37
  }
20
38
  export declare class SecurityHardener {
21
39
  private config;
40
+ private encryptionKey;
41
+ private securityEvents;
42
+ private readonly maxSecurityEvents;
22
43
  constructor(config?: Partial<SecurityHardeningConfig>);
44
+ /**
45
+ * Initialize encryption with an optional key.
46
+ * Generates a random key if none provided.
47
+ */
48
+ initEncryption(secret?: string): void;
49
+ /**
50
+ * AES-256-GCM encrypt data.
51
+ * Returns Base64 string with IV + ciphertext + auth tag.
52
+ */
53
+ encryptData(data: string): string;
54
+ /**
55
+ * AES-256-GCM decrypt data.
56
+ * Returns null on auth failure (tampered key or data).
57
+ */
58
+ decryptData(encryptedData: string): string | null;
59
+ /**
60
+ * Hash password with scrypt and unique salt.
61
+ */
62
+ hashPassword(password: string): Promise<{
63
+ hash: string;
64
+ salt: string;
65
+ }>;
66
+ /**
67
+ * Verify password against a scrypt hash.
68
+ */
69
+ verifyPassword(password: string, hash: string, salt: string): Promise<boolean>;
70
+ /**
71
+ * Generate a cryptographically secure random hex token.
72
+ */
73
+ generateSecureToken(length?: number): string;
74
+ /**
75
+ * Record a security event for tracking and stats.
76
+ */
77
+ recordSecurityEvent(event: Omit<SecurityEvent, "id" | "timestamp">): void;
78
+ /**
79
+ * Get recent security events.
80
+ */
81
+ getSecurityEvents(limit?: number): SecurityEvent[];
82
+ /**
83
+ * Get security event statistics.
84
+ */
85
+ getSecurityStats(): {
86
+ totalEvents: number;
87
+ eventsBySeverity: Record<string, number>;
88
+ };
23
89
  /**
24
90
  * Apply security hardening based on audit results
25
91
  */
@@ -60,3 +126,4 @@ export declare class SecurityHardener {
60
126
  }): void;
61
127
  }
62
128
  export declare const securityHardener: SecurityHardener;
129
+ export {};
@@ -3,13 +3,22 @@
3
3
  *
4
4
  * Implements additional security measures and hardening for the framework.
5
5
  * Addresses vulnerabilities identified during security audit.
6
+ * Includes AES-256-GCM encryption, scrypt password hashing, and event tracking.
6
7
  *
7
- * @version 1.0.0
8
+ * @version 2.0.0
8
9
  * @since 2026-01-07
9
10
  */
10
11
  import { promises as fs } from "fs";
12
+ import * as crypto from "crypto";
13
+ import { frameworkLogger } from "../core/framework-logger.js";
14
+ const ENCRYPTION_ALGORITHM = "aes-256-gcm";
15
+ const KEY_LENGTH = 32;
16
+ const IV_LENGTH = 16;
11
17
  export class SecurityHardener {
12
18
  config;
19
+ encryptionKey = null;
20
+ securityEvents = [];
21
+ maxSecurityEvents = 1000;
13
22
  constructor(config = {}) {
14
23
  this.config = {
15
24
  enableInputValidation: true,
@@ -22,6 +31,125 @@ export class SecurityHardener {
22
31
  ...config,
23
32
  };
24
33
  }
34
+ /**
35
+ * Initialize encryption with an optional key.
36
+ * Generates a random key if none provided.
37
+ */
38
+ initEncryption(secret) {
39
+ if (this.encryptionKey)
40
+ return;
41
+ this.encryptionKey = secret
42
+ ? crypto.scryptSync(secret, "salt", KEY_LENGTH)
43
+ : crypto.randomBytes(KEY_LENGTH);
44
+ }
45
+ /**
46
+ * AES-256-GCM encrypt data.
47
+ * Returns Base64 string with IV + ciphertext + auth tag.
48
+ */
49
+ encryptData(data) {
50
+ this.initEncryption();
51
+ const iv = crypto.randomBytes(IV_LENGTH);
52
+ const cipher = crypto.createCipheriv(ENCRYPTION_ALGORITHM, this.encryptionKey, iv);
53
+ let encrypted = cipher.update(data, "utf8", "binary");
54
+ encrypted += cipher.final("binary");
55
+ const authTag = cipher.getAuthTag();
56
+ const combined = Buffer.concat([iv, Buffer.from(encrypted, "binary"), authTag]);
57
+ return combined.toString("base64");
58
+ }
59
+ /**
60
+ * AES-256-GCM decrypt data.
61
+ * Returns null on auth failure (tampered key or data).
62
+ */
63
+ decryptData(encryptedData) {
64
+ this.initEncryption();
65
+ try {
66
+ const combined = Buffer.from(encryptedData, "base64");
67
+ const iv = combined.subarray(0, IV_LENGTH);
68
+ const authTag = combined.subarray(combined.length - 16);
69
+ const encrypted = combined.subarray(IV_LENGTH, combined.length - 16);
70
+ const decipher = crypto.createDecipheriv(ENCRYPTION_ALGORITHM, this.encryptionKey, iv);
71
+ decipher.setAuthTag(authTag);
72
+ return Buffer.concat([decipher.update(encrypted), decipher.final()]).toString("utf8");
73
+ }
74
+ catch {
75
+ return null;
76
+ }
77
+ }
78
+ /**
79
+ * Hash password with scrypt and unique salt.
80
+ */
81
+ async hashPassword(password) {
82
+ return new Promise((resolve, reject) => {
83
+ const salt = crypto.randomBytes(32).toString("hex");
84
+ crypto.scrypt(password, salt, KEY_LENGTH, { N: 16384, r: 8, p: 1 }, (err, derivedKey) => {
85
+ if (err)
86
+ reject(err);
87
+ else
88
+ resolve({ hash: derivedKey.toString("hex"), salt });
89
+ });
90
+ });
91
+ }
92
+ /**
93
+ * Verify password against a scrypt hash.
94
+ */
95
+ async verifyPassword(password, hash, salt) {
96
+ return new Promise((resolve) => {
97
+ crypto.scrypt(password, salt, KEY_LENGTH, { N: 16384, r: 8, p: 1 }, (err, derivedKey) => {
98
+ if (err)
99
+ return resolve(false);
100
+ try {
101
+ resolve(crypto.timingSafeEqual(Buffer.from(derivedKey.toString("hex"), "hex"), Buffer.from(hash, "hex")));
102
+ }
103
+ catch {
104
+ resolve(false);
105
+ }
106
+ });
107
+ });
108
+ }
109
+ /**
110
+ * Generate a cryptographically secure random hex token.
111
+ */
112
+ generateSecureToken(length = 32) {
113
+ return crypto.randomBytes(length).toString("hex");
114
+ }
115
+ /**
116
+ * Record a security event for tracking and stats.
117
+ */
118
+ recordSecurityEvent(event) {
119
+ const entry = {
120
+ id: this.generateSecureToken(16),
121
+ timestamp: Date.now(),
122
+ ...event,
123
+ };
124
+ this.securityEvents.push(entry);
125
+ if (this.securityEvents.length > this.maxSecurityEvents) {
126
+ this.securityEvents.shift();
127
+ }
128
+ if (event.severity === "high" || event.severity === "critical") {
129
+ frameworkLogger.log("security-hardener", "security-event", "error", {
130
+ severity: event.severity,
131
+ type: event.type,
132
+ message: event.message,
133
+ source: event.source,
134
+ });
135
+ }
136
+ }
137
+ /**
138
+ * Get recent security events.
139
+ */
140
+ getSecurityEvents(limit = 100) {
141
+ return this.securityEvents.slice(-limit);
142
+ }
143
+ /**
144
+ * Get security event statistics.
145
+ */
146
+ getSecurityStats() {
147
+ const eventsBySeverity = { low: 0, medium: 0, high: 0, critical: 0 };
148
+ this.securityEvents.forEach((e) => {
149
+ eventsBySeverity[e.severity] = (eventsBySeverity[e.severity] || 0) + 1;
150
+ });
151
+ return { totalEvents: this.securityEvents.length, eventsBySeverity };
152
+ }
25
153
  /**
26
154
  * Apply security hardening based on audit results
27
155
  */
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.1",
2
+ "version": "2.1.1",
3
3
  "description": "0xRay Skills Registry - recommended skill sources for consumers",
4
4
  "sources": [
5
5
  {
@@ -1,5 +1,3 @@
1
- export * from "./state-manager.js";
2
- export * from "./context-providers.js";
3
- export * from "./state-types.js";
4
- export { XrayStateManager } from "./state-manager.js";
5
- export { XrayStateManager as StringRayStateManager } from "./state-manager.js";
1
+ export { StateManager, XrayStateManager, XrayStateManager as StrRayStateManager } from "./state-manager.js";
2
+ export type { StateValue, StateTypes } from "./state-types.js";
3
+ export type { ContextProviders } from "./context-providers.js";
@@ -1,8 +1,2 @@
1
1
  // 0xRay Framework State Management
2
- // Export all state management utilities and providers
3
- export * from "./state-manager.js";
4
- export * from "./context-providers.js";
5
- export * from "./state-types.js";
6
- // Re-export commonly used state utilities
7
- export { XrayStateManager } from "./state-manager.js";
8
- export { XrayStateManager as StringRayStateManager } from "./state-manager.js";
2
+ export { XrayStateManager, XrayStateManager as StrRayStateManager } from "./state-manager.js";
@@ -39,4 +39,4 @@ export declare class XrayStateManager implements StateManager {
39
39
  value2: unknown;
40
40
  }): unknown;
41
41
  }
42
- export { XrayStateManager as StringRayStateManager, XrayStateManager as StrRayStateManager };
42
+ export { XrayStateManager as StrRayStateManager };
@@ -204,6 +204,5 @@ export class XrayStateManager {
204
204
  return conflict.value2; // Prefer the second value as newer
205
205
  }
206
206
  }
207
- // Export alias for scripts expecting XrayStateManager
208
- // Backward compat: StringRayStateManager and StrRayStateManager aliases
209
- export { XrayStateManager as StringRayStateManager, XrayStateManager as StrRayStateManager };
207
+ // Keep StrRayStateManager for internal backward compat
208
+ export { XrayStateManager as StrRayStateManager };
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "0xray",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "Multi-agent orchestration and Codex governance for OpenCode, Hermes, Grok Build, and OpenClaw",
5
- "readme": "README.md",
6
5
  "license": "MIT",
7
6
  "repository": {
8
7
  "type": "git",
9
- "url": "https://github.com/0xRayAI/xray.git"
8
+ "url": "git+https://github.com/0xRayAI/xray.git"
10
9
  },
11
10
  "homepage": "https://github.com/0xRayAI/xray#readme",
12
11
  "bugs": {
@@ -46,13 +45,13 @@
46
45
  "mcps": "./dist/mcps/"
47
46
  },
48
47
  "scripts": {
49
- "prepublishOnly": "npm run prepare-consumer && npm run build:all && find dist -name '*.d.ts' -o -name '*.d.ts.map' -o -name '*.js.map' | xargs rm -f",
48
+ "prepublishOnly": "npm run prepare-consumer && npm run build:all && find dist -name '*.d.ts' -o -name '*.d.ts.map' -o -name '*.js.map' | xargs rm -f && echo 'Checking for stale STRRAY_ references...' && ! grep -rn 'STRRAY_' dist/ --include='*.js' --include='*.mjs' 2>/dev/null | grep -v '//.*STRRAY_' || { echo 'ERROR: Stale STRRAY_ references found in dist/'; exit 1; }",
50
49
  "version:bump": "node scripts/node/version-manager.mjs",
51
50
  "version": "node scripts/node/version-manager.mjs",
52
51
  "postinstall": "node scripts/node/postinstall.cjs",
53
52
  "prepare": "npm run build",
54
53
  "prebuild": "rm -rf dist tsconfig.tsbuildinfo tsconfig.*.tsbuildinfo",
55
- "build": "tsc && mkdir -p dist/public dist/scripts && cp -r public/* dist/public/ && cp scripts/hooks/pre-command dist/scripts/ && cp scripts/hooks/pre-command.mjs dist/scripts/ && cp README.md AGENTS.md CHANGELOG.md LICENSE dist/ && find src -name '*.mjs' ! -path '*/__tests__/*' | while read f; do tgt=\"dist/${f#src/}\"; mkdir -p \"$(dirname $tgt)\"; cp \"$f\" \"$tgt\"; done && for dir in skills integrations mcps; do find src/$dir -type f ! -name '*.ts' ! -path '*/.pytest_cache/*' | while read f; do tgt=\"dist/${f#src/}\"; mkdir -p \"$(dirname $tgt)\"; cp \"$f\" \"$tgt\"; done; done && mkdir -p dist/plugin && (find dist/plugin -name '*codex-injection*.js' -exec cp {} dist/plugin/xray-codex-injection.js \\; 2>/dev/null || true) && cp -r src/opencode/ .opencode/ && rm -rf .opencode/xray 2>/dev/null; mkdir -p .opencode/xray && cp xray/codex.json .opencode/xray/codex.json 2>/dev/null || true",
54
+ "build": "tsc && mkdir -p dist/public dist/scripts && cp -r public/* dist/public/ && cp scripts/hooks/pre-command dist/scripts/ && cp scripts/hooks/pre-command.mjs dist/scripts/ && cp README.md AGENTS.md CHANGELOG.md LICENSE dist/ && find src -name '*.mjs' ! -path '*/__tests__/*' | while read f; do tgt=\"dist/${f#src/}\"; mkdir -p \"$(dirname $tgt)\"; cp \"$f\" \"$tgt\"; done && for dir in skills integrations mcps; do find src/$dir -type f ! -name '*.ts' ! -path '*/.pytest_cache/*' | while read f; do tgt=\"dist/${f#src/}\"; mkdir -p \"$(dirname $tgt)\"; cp \"$f\" \"$tgt\"; done; done && mkdir -p dist/plugin && (find dist/plugin -name '*codex-injection*.js' -exec cp {} dist/plugin/xray-codex-injection.js \\; 2>/dev/null || true) && cp -r src/opencode/ .opencode/ && echo 'build artifacts in .opencode/xray/ removed runtime reads from xray/ directly'",
56
55
  "build:all": "npm run build",
57
56
  "ci-install": "npm ci",
58
57
  "clean": "rm -rf dist tsconfig.tsbuildinfo tsconfig.*.tsbuildinfo",
@@ -60,13 +59,14 @@
60
59
  "test:batch": "npm test",
61
60
  "test:unit": "npm test -- src/__tests__/unit/config-loader.test.ts src/__tests__/unit/state-manager.test.ts src/__tests__/unit/state-manager-persistence.test.ts src/__tests__/unit/context-loader.test.ts src/__tests__/unit/pattern-analyzer.test.ts src/__tests__/unit/complexity-calibrator.test.ts",
62
61
  "test:core-framework": "npm test -- src/__tests__/unit/self-direction-activation.test.ts src/__tests__/unit/ast-code-parser.test.ts src/__tests__/unit/v2-deletion-protection.test.ts",
63
- "test:security": "npm test -- src/__tests__/unit/security/security-hardener.test.ts src/__tests__/unit/security/security-headers.test.ts src/__tests__/unit/security/security-auditor.test.ts",
62
+ "test:security": "npm test -- src/__tests__/unit/security/security-hardener.test.ts src/__tests__/unit/security/security-headers.test.ts",
64
63
  "test:performance": "npm test -- src/__tests__/unit/monitoring.test.ts src/__tests__/unit/benchmark.test.ts src/__tests__/unit/analytics.test.ts",
65
64
  "test:session-management": "npm test -- src/__tests__/unit/session-state-manager.test.ts src/__tests__/unit/session-security-validator.test.ts src/__tests__/unit/session-coordination-validator.test.ts src/__tests__/unit/session-migration-validator.test.ts src/__tests__/unit/session-migration-logic.test.ts",
66
65
  "test:code-analysis": "npm test -- src/__tests__/unit/codebase-context-analyzer.test.ts src/__tests__/unit/dependency-graph-builder.test.ts src/__tests__/unit/rule-enforcer.test.ts src/__tests__/unit/codex-parser.test.ts src/__tests__/unit/codex-injector.test.ts",
67
66
  "test:processors": "npm test -- src/__tests__/unit/processor-activation.test.ts src/__tests__/unit/typescript-compilation-processor.test.ts",
68
67
  "test:miscellaneous": "npm test -- src/__tests__/unit/blocked-test.test.ts",
69
68
  "test:quick": "npm test -- src/__tests__/integration/boot-orchestrator.integration.test.ts src/__tests__/unit/config-loader.test.ts src/__tests__/unit/state-manager.test.ts",
69
+ "analyze:size": "find src -name '*.ts' ! -path '*/__tests__/*' ! -path '*/node_modules/*' | xargs wc -l | sort -rn | awk '{if(NR==1)print \"Total source LOC: \" $1; else if($1>1000)print $0}' && echo '' && echo 'Files 600-1000 LOC:' && find src -name '*.ts' ! -path '*/__tests__/*' ! -path '*/node_modules/*' | xargs wc -l | sort -rn | awk '$1>600 && $1<=1000' && echo '' && echo 'Source file count:' && find src -name '*.ts' ! -path '*/__tests__/*' ! -path '*/node_modules/*' | wc -l",
70
70
  "test:comprehensive": "npm run typecheck && npm run test:unit && npm run test:core-framework && npm run test:security && npm run test:performance && npm run test:session-management && npm run test:code-analysis && npm run test:processors && npm run test:miscellaneous",
71
71
  "test:integration-all": "npm test -- src/__tests__/integration/",
72
72
  "test:performance-all": "npm test -- src/__tests__/performance/ src/__tests__/unit/performance-system.test.ts src/__tests__/unit/benchmark.test.ts src/__tests__/unit/analytics.test.ts",
@@ -130,6 +130,7 @@
130
130
  "src/integrations/grok/plugin/0xray/",
131
131
  "src/skills/",
132
132
  "src/mcps/",
133
+ "xray/",
133
134
  ".opencode/agents/",
134
135
  ".opencode/commands/",
135
136
  ".opencode/hooks/",
@@ -148,16 +149,13 @@
148
149
  ],
149
150
  "dependencies": {
150
151
  "@modelcontextprotocol/sdk": "^1.0.4",
151
- "0xray": "^2.0.1",
152
152
  "commander": "^11.1.0",
153
153
  "express": "^5.2.1",
154
- "jsonwebtoken": "^9.0.3",
155
154
  "ws": "^8.16.0"
156
155
  },
157
156
  "devDependencies": {
158
157
  "@eslint/js": "^9.39.2",
159
158
  "@types/express": "^5.0.0",
160
- "@types/jsonwebtoken": "^9.0.7",
161
159
  "@types/node": "^22.10.2",
162
160
  "@types/ws": "^8.5.13",
163
161
  "@typescript-eslint/eslint-plugin": "^8.18.0",
@@ -167,5 +165,11 @@
167
165
  "ts-node": "^10.9.2",
168
166
  "typescript": "^5.7.2",
169
167
  "vitest": "^4.1.8"
170
- }
168
+ },
169
+ "directories": {
170
+ "doc": "docs",
171
+ "example": "examples",
172
+ "test": "tests"
173
+ },
174
+ "author": ""
171
175
  }
@@ -37,6 +37,38 @@ if (hasHermes) {
37
37
  * Extended header for next high-value package (code-review). src/skills/code-review/SKILL.md canonical SSOT; .opencode/skills/code-review/ built mirror of this sync logic. See paired guarded fw log "P3-SKILLS-FOLLOW-02-code-review-ssot-preferred" in status.ts getSkillsList (inserted after researcher block) + rich append docs/reflections/p3-skills-follow-02-code-review-2026-05-27.md (per AGENTS) + CGT/Governance-visible for YML @ harness-codex verification + 0 hot + 3-hot re-establish + all ties to spawn command + deep ref + pivot + Term 61 + 6/6+7/7 + YML + ps 0 + this P3-SKILLS-FOLLOW-02 full work (2-file surgical, harness post green tsc 0 new on touched, mapping append after latest, todo advance exactly 1, spawn replacement to maintain 3-hot, self-audit 100%) + verification + "the box contains its builders. The relay is hot.". 2 files max total for this follow-02. Highly modular (100% prior P3-SKILLS/YML/7th pattern reuse exactly inside existing sync logic). Fully reversible (targeted delete of notes restores exact prior). fw/echo discipline. AGENTS org (scripts/ for sh/cjs). Term 61 surgical forward motion held (no bloat, pure on actual dedup). "the box contains its builders". Green + ready. Subagent ID for resume.
38
38
  */
39
39
 
40
+ /* 0. Deploy xray/ config files (features.json, codex.json, etc.) to consumer .xray/ */
41
+ const xrayConfigSource = path.join(packageRoot, "xray");
42
+ const xrayConfigDest = path.join(targetDir, ".xray");
43
+ if (fs.existsSync(xrayConfigSource)) {
44
+ try {
45
+ if (!fs.existsSync(xrayConfigDest)) fs.mkdirSync(xrayConfigDest, { recursive: true });
46
+ const entries = fs.readdirSync(xrayConfigSource);
47
+ let copied = 0;
48
+ for (const entry of entries) {
49
+ const srcPath = path.join(xrayConfigSource, entry);
50
+ const dstPath = path.join(xrayConfigDest, entry);
51
+ if (fs.statSync(srcPath).isFile()) {
52
+ if (!fs.existsSync(dstPath) || fs.statSync(srcPath).mtime > fs.statSync(dstPath).mtime) {
53
+ fs.copyFileSync(srcPath, dstPath);
54
+ copied++;
55
+ }
56
+ }
57
+ }
58
+ if (copied > 0) console.log(`✅ .xray/: ${copied} config files deployed`);
59
+ else console.log(`ℹ️ .xray/: up to date`);
60
+ } catch (e) { console.warn(`⚠️ .xray/ deploy: ${e.message}`); }
61
+ }
62
+
63
+ // 0b. Ensure logs/framework/ directory exists
64
+ const logsDir = path.join(targetDir, "logs", "framework");
65
+ try {
66
+ if (!fs.existsSync(logsDir)) {
67
+ fs.mkdirSync(logsDir, { recursive: true });
68
+ console.log("✅ logs/framework/: created");
69
+ }
70
+ } catch (e) { console.warn(`⚠️ logs/framework/: ${e.message}`); }
71
+
40
72
  /* 1. Sync core skills from src/skills/ (dev) or dist/skills/ (consumer) → .opencode/skills/ [P3-SKILLS-DE-DUP-SCOPE-AND-EXEC-01: orchestrator package SSOT canonical src/skills/orchestrator/SKILL.md; mirror .opencode/skills/orchestrator/ is built output of this logic; see paired guarded fw in status.ts getSkillsList + mapping append + deep ref 2026-05-26 authority for one-package dedup under pivoted surgical plan]
41
73
  [P3-SKILLS-DE-DUP-RESEARCHER-FOLLOW-01: researcher package SSOT canonical src/skills/researcher/SKILL.md (high-value per deep ref + YML precedent + playbook P3-SKILLS-FOLLOW-01); mirror .opencode/skills/researcher/ is built output of this logic; see paired guarded fw in status.ts + rich append + YML @ harness-codex verification (FORCE exercised P3-YML + codex-enforcement + 100/60/0 + 3 subagents tracked + 0 hot + 3-hot re-establish + all prior green) + deep ref 2026-05-26 + Phase 3 Pivot + Term 61 + user's "create a todo list. spawn subagents..." + 6/6+7/7 + YML. Governance-visible hook for skills SSOT at install layer. Silent, additive, reversible, no behavior change, fw/echo only.]
42
74
  [P3-SKILLS-FOLLOW-02: code-review package SSOT canonical src/skills/code-review/SKILL.md (next high-value per deep ref "parallel small batches" + @architect scoping rec 2 + YML @ "Ready for next" + this P3-SKILLS-FOLLOW-02 on user's spawn command); mirror .opencode/skills/code-review/ is built output of this logic; see paired guarded fw "P3-SKILLS-FOLLOW-02-code-review-ssot-preferred" in status.ts (after researcher) + rich append docs/reflections/p3-skills-follow-02-code-review-2026-05-27.md + YML @ harness-codex verification + 0 hot + 3-hot + all ties + ps 0 + this work (2-file surgical edit, harness post, mapping append after latest ~17099+, todo advance 1, spawn replacement, self-audit 100%, green + ready) + deep ref 2026-05-26 + Phase 3 Pivot + Term 61 + 6/6+7/7 + YML. Governance-visible hook for skills SSOT at install layer for code-review. Silent, additive, reversible, no behavior change, fw/echo only. "The box contains its builders. The relay is hot."] */
@@ -147,7 +147,7 @@ function detectCodexInfo() {
147
147
  return { version: cver.startsWith("v") ? cver : `v${cver}`, termsCount: termCount, lastUpdated: new Date().toISOString().split("T")[0] };
148
148
  } catch {}
149
149
  }
150
- return { version: "v2.0.0", termsCount: 68, lastUpdated: new Date().toISOString().split("T")[0] };
150
+ return { version: "v2.1.1", termsCount: 68, lastUpdated: new Date().toISOString().split("T")[0] };
151
151
  }
152
152
 
153
153
  const detectedCodex = detectCodexInfo();
@@ -155,9 +155,9 @@ const detectedCodex = detectCodexInfo();
155
155
  const OFFICIAL_VERSIONS = {
156
156
  // Framework version
157
157
  framework: {
158
- version: "2.1.1",
158
+ version: "2.1.3",
159
159
  displayName: "xray: Self-Healing AI Governance OS",
160
- lastUpdated: "2026-06-08",
160
+ lastUpdated: "2026-06-09",
161
161
  // Counts (auto-calculated, but can be overridden)
162
162
  ...CALCULATED_COUNTS,
163
163
  },
@@ -346,29 +346,29 @@ const UPDATE_PATTERNS = [
346
346
  },
347
347
 
348
348
  // === BADGE AND COUNT PATTERNS ===
349
- // Test count in docs badge (e.g., tests-2290-brightgreen)
349
+ // Test count in docs badge (e.g., tests-2282-brightgreen)
350
350
  {
351
351
  pattern: /tests-[0-9]+(?=-brightgreen)/g,
352
352
  replacement: `tests-${OFFICIAL_VERSIONS.framework.tests}`,
353
353
  },
354
- // Test count in npm badge (e.g., tests-2290%20passed-brightgreen)
354
+ // Test count in npm badge (e.g., tests-2282%20passed-brightgreen)
355
355
  {
356
356
  pattern: /tests-[0-9,]+%20passed/g,
357
357
  replacement: `tests-${OFFICIAL_VERSIONS.framework.tests}%20passed`,
358
358
  },
359
- // Test count in prose (e.g., "2,2290 Tests" or "2290 Tests" but NOT in badge URLs)
359
+ // Test count in prose (e.g., "2,2282 Tests" or "2282 Tests" but NOT in badge URLs)
360
360
  {
361
361
  pattern: /(\*\s*✅\s*)([0-9]{1,3},?[0-9]{3})(\s*Tests)/g,
362
362
  replacement: (match, p1, p2, p3) => {
363
363
  return `${p1}${OFFICIAL_VERSIONS.framework.tests}${p3}`;
364
364
  },
365
365
  },
366
- // Test count in feature bullets (e.g., "✅ 2290 Tests")
366
+ // Test count in feature bullets (e.g., "✅ 2282 Tests")
367
367
  {
368
368
  pattern: /[0-9]+ Tests/g,
369
369
  replacement: `${OFFICIAL_VERSIONS.framework.tests} Tests`,
370
370
  },
371
- // Test count in config tree (e.g., "2290 tests")
371
+ // Test count in config tree (e.g., "2282 tests")
372
372
  {
373
373
  pattern: /[0-9]+ tests/g,
374
374
  replacement: `${OFFICIAL_VERSIONS.framework.tests} tests`,
@@ -403,7 +403,7 @@ const UPDATE_PATTERNS = [
403
403
  pattern: /xray AI v[0-9]+\.[0-9]+\.[0-9]+/g,
404
404
  replacement: `xray AI v${OFFICIAL_VERSIONS.framework.version}`,
405
405
  },
406
- // Footer bare version (e.g., "**Version**: 2.0.1")
406
+ // Footer bare version (e.g., "**Version**: 2.1.1")
407
407
  {
408
408
  pattern: /\*\*Version\*\*:\s*[0-9]+\.[0-9]+\.[0-9]+/g,
409
409
  replacement: `**Version**: ${OFFICIAL_VERSIONS.framework.version}`,
@@ -438,7 +438,7 @@ const UPDATE_PATTERNS = [
438
438
  async function createBackup() {
439
439
  try {
440
440
  const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
441
- backupDir = `backups/version-manager-backup-${timestamp}`;
441
+ backupDir = `docs/reflections/backups/version-manager-${timestamp}`;
442
442
 
443
443
  // Create backup directory
444
444
  fs.mkdirSync(backupDir, { recursive: true });
@@ -1014,7 +1014,7 @@ const UPDATE_PATTERNS = [
1014
1014
  * - No files reference old versions
1015
1015
  *
1016
1016
  * 💾 BACKUP LOCATION:
1017
- * - Created in 'backups/version-manager-backup-[timestamp]/'
1017
+ * - Created in 'docs/reflections/backups/version-manager-[timestamp]/'
1018
1018
  * - Includes changelog.md with all changes
1019
1019
  *
1020
1020
  * 📝 TO ROLLBACK: