0xray 2.1.4 → 2.2.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.
Files changed (186) 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/.opencode/init.sh +1 -1
  5. package/AGENTS.md +6 -6
  6. package/README.md +4 -4
  7. package/dist/AGENTS.md +6 -6
  8. package/dist/CHANGELOG.md +39 -0
  9. package/dist/README.md +4 -4
  10. package/dist/agents/code-reviewer.js +1 -1
  11. package/dist/analytics/routing-refiner.js +1 -1
  12. package/dist/cli/commands/govern.d.ts +29 -0
  13. package/dist/cli/commands/govern.js +152 -0
  14. package/dist/cli/index.js +29 -216
  15. package/dist/core/boot-orchestrator.js +2 -2
  16. package/dist/core/features-config.js +1 -1
  17. package/dist/core/framework-logger.d.ts +1 -0
  18. package/dist/core/framework-logger.js +57 -2
  19. package/dist/delegation/index.d.ts +1 -2
  20. package/dist/delegation/index.js +1 -2
  21. package/dist/enforcement/enforcer-tools.js +1 -1
  22. package/dist/execution/proposal-applier.d.ts +1 -9
  23. package/dist/execution/proposal-applier.js +18 -173
  24. package/dist/governance/codex-policy.service.d.ts +7 -25
  25. package/dist/governance/codex-policy.service.js +8 -26
  26. package/dist/governance/governance-core.d.ts +22 -28
  27. package/dist/governance/governance-core.js +31 -101
  28. package/dist/governance/governance-service.d.ts +1 -0
  29. package/dist/governance/governance-service.js +67 -4
  30. package/dist/governance/governance-types.d.ts +5 -2
  31. package/dist/inference/index.d.ts +3 -4
  32. package/dist/inference/inference-accumulator.js +1 -1
  33. package/dist/inference/inference-cycle.d.ts +12 -18
  34. package/dist/inference/inference-cycle.js +120 -335
  35. package/dist/integrations/base/index.d.ts +0 -1
  36. package/dist/integrations/base/index.js +0 -2
  37. package/dist/integrations/grok/hooks/pre-tool-use.js +4 -18
  38. package/dist/integrations/hermes-agent/bridge.mjs +9 -0
  39. package/dist/mcps/config/server-config-registry.js +1 -1
  40. package/dist/mcps/governance.server.js +4 -5
  41. package/dist/mcps/knowledge-skills/api-design.server.js +10 -0
  42. package/dist/mcps/knowledge-skills/architecture-patterns.server.js +10 -0
  43. package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +10 -0
  44. package/dist/mcps/knowledge-skills/code-analyzer.server.js +10 -0
  45. package/dist/mcps/knowledge-skills/code-review.server.js +10 -0
  46. package/dist/mcps/knowledge-skills/content-creator.server.js +10 -0
  47. package/dist/mcps/knowledge-skills/database-design.server.js +10 -0
  48. package/dist/mcps/knowledge-skills/devops-deployment.server.js +10 -0
  49. package/dist/mcps/knowledge-skills/git-workflow.server.js +10 -0
  50. package/dist/mcps/knowledge-skills/growth-strategist.server.js +10 -0
  51. package/dist/mcps/knowledge-skills/log-monitor.server.js +10 -0
  52. package/dist/mcps/knowledge-skills/mobile-development.server.js +10 -0
  53. package/dist/mcps/knowledge-skills/multimodal-looker.server.js +10 -0
  54. package/dist/mcps/knowledge-skills/performance-optimization.server.js +10 -0
  55. package/dist/mcps/knowledge-skills/project-analysis.server.js +10 -0
  56. package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +10 -0
  57. package/dist/mcps/knowledge-skills/security-audit.server.js +10 -0
  58. package/dist/mcps/knowledge-skills/seo-consultant.server.js +10 -0
  59. package/dist/mcps/knowledge-skills/skill-invocation.server.d.ts +4 -0
  60. package/dist/mcps/knowledge-skills/skill-invocation.server.js +33 -14
  61. package/dist/mcps/knowledge-skills/strategist.server.js +10 -0
  62. package/dist/mcps/knowledge-skills/tech-writer.server.js +11 -1
  63. package/dist/mcps/knowledge-skills/testing-strategy.server.js +10 -0
  64. package/dist/mcps/knowledge-skills/ui-ux-design.server.js +10 -0
  65. package/dist/mcps/registry.json +1 -1
  66. package/dist/mcps/simulation/server-simulations.js +1 -1
  67. package/dist/metrics/agent-metrics.d.ts +2 -1
  68. package/dist/nucleus/govern-http.d.ts +59 -0
  69. package/dist/nucleus/govern-http.js +172 -0
  70. package/dist/nucleus/index.d.ts +14 -0
  71. package/dist/nucleus/index.js +9 -0
  72. package/dist/nucleus/kernel.d.ts +51 -0
  73. package/dist/nucleus/kernel.js +62 -0
  74. package/dist/nucleus/plugin-registry.d.ts +104 -0
  75. package/dist/nucleus/plugin-registry.js +147 -0
  76. package/dist/orchestrator/orchestrator.d.ts +0 -1
  77. package/dist/orchestrator/orchestrator.js +0 -21
  78. package/dist/postprocessor/PostProcessor.d.ts +13 -1
  79. package/dist/postprocessor/PostProcessor.js +41 -1
  80. package/dist/postprocessor/autofix/AutoFixEngine.d.ts +0 -8
  81. package/dist/postprocessor/autofix/AutoFixEngine.js +0 -54
  82. package/dist/postprocessor/metamorphosis/MetamorphosisEngine.d.ts +25 -0
  83. package/dist/postprocessor/metamorphosis/MetamorphosisEngine.js +10 -0
  84. package/dist/postprocessor/metamorphosis/SelfProposalEngine.d.ts +68 -0
  85. package/dist/postprocessor/metamorphosis/SelfProposalEngine.js +371 -0
  86. package/dist/skills/orchestrator/SKILL.md +1 -1
  87. package/dist/skills/registry.json +1 -1
  88. package/dist/state/index.d.ts +0 -2
  89. package/package.json +4 -3
  90. package/scripts/node/universal-version-manager.js +9 -9
  91. package/scripts/node/validate-mcp-connectivity.js +1 -1
  92. package/src/mcps/config/__tests__/server-config-registry.test.ts +6 -15
  93. package/src/mcps/config/server-config-registry.ts +1 -1
  94. package/src/mcps/governance.server.ts +4 -6
  95. package/src/mcps/knowledge-skills/api-design.server.ts +9 -0
  96. package/src/mcps/knowledge-skills/architecture-patterns.server.ts +9 -0
  97. package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +9 -0
  98. package/src/mcps/knowledge-skills/code-analyzer.server.ts +9 -0
  99. package/src/mcps/knowledge-skills/code-review.server.ts +9 -0
  100. package/src/mcps/knowledge-skills/content-creator.server.ts +9 -0
  101. package/src/mcps/knowledge-skills/database-design.server.ts +9 -0
  102. package/src/mcps/knowledge-skills/devops-deployment.server.ts +9 -0
  103. package/src/mcps/knowledge-skills/git-workflow.server.ts +9 -0
  104. package/src/mcps/knowledge-skills/growth-strategist.server.ts +9 -0
  105. package/src/mcps/knowledge-skills/log-monitor.server.ts +9 -0
  106. package/src/mcps/knowledge-skills/mobile-development.server.ts +9 -0
  107. package/src/mcps/knowledge-skills/multimodal-looker.server.ts +9 -0
  108. package/src/mcps/knowledge-skills/performance-optimization.server.ts +9 -0
  109. package/src/mcps/knowledge-skills/project-analysis.server.ts +9 -0
  110. package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +9 -0
  111. package/src/mcps/knowledge-skills/security-audit.server.ts +9 -0
  112. package/src/mcps/knowledge-skills/seo-consultant.server.ts +9 -0
  113. package/src/mcps/knowledge-skills/session-management.server.ts +1 -0
  114. package/src/mcps/knowledge-skills/skill-invocation.server.ts +44 -29
  115. package/src/mcps/knowledge-skills/strategist.server.ts +9 -0
  116. package/src/mcps/knowledge-skills/tech-writer.server.ts +10 -1
  117. package/src/mcps/knowledge-skills/testing-strategy.server.ts +9 -0
  118. package/src/mcps/knowledge-skills/ui-ux-design.server.ts +9 -0
  119. package/src/mcps/registry.json +1 -1
  120. package/src/mcps/simulation/server-simulations.ts +1 -1
  121. package/src/opencode/codex.codex +1 -1
  122. package/src/opencode/commands/dependency-audit.md +3 -3
  123. package/src/opencode/enforcer-config.json +2 -2
  124. package/src/skills/orchestrator/SKILL.md +1 -1
  125. package/src/skills/registry.json +1 -1
  126. package/xray/codex.json +1 -1
  127. package/xray/config.json +1 -1
  128. package/xray/features.json +1 -1
  129. package/xray/integrations.json +3 -3
  130. package/.opencode/agents/testing-best-practices.yml +0 -12
  131. package/dist/analytics/consent-manager.d.ts +0 -93
  132. package/dist/analytics/consent-manager.js +0 -258
  133. package/dist/analytics/simple-pattern-analyzer.d.ts +0 -80
  134. package/dist/analytics/simple-pattern-analyzer.js +0 -297
  135. package/dist/cli/commands/analytics-disable.d.ts +0 -9
  136. package/dist/cli/commands/analytics-disable.js +0 -72
  137. package/dist/cli/commands/analytics-enable-action.d.ts +0 -8
  138. package/dist/cli/commands/analytics-enable-action.js +0 -82
  139. package/dist/cli/commands/analytics-preview.d.ts +0 -9
  140. package/dist/cli/commands/analytics-preview.js +0 -106
  141. package/dist/cli/commands/analytics-status.d.ts +0 -9
  142. package/dist/cli/commands/analytics-status.js +0 -68
  143. package/dist/cli/server.d.ts +0 -1
  144. package/dist/cli/server.js +0 -147
  145. package/dist/core/errors.d.ts +0 -3
  146. package/dist/core/errors.js +0 -10
  147. package/dist/core/logging-config.d.ts +0 -11
  148. package/dist/core/logging-config.js +0 -43
  149. package/dist/core/trace-context.d.ts +0 -12
  150. package/dist/core/trace-context.js +0 -33
  151. package/dist/delegation/voting-coordinator.d.ts +0 -49
  152. package/dist/delegation/voting-coordinator.js +0 -375
  153. package/dist/enforcement/test-auto-healing.d.ts +0 -83
  154. package/dist/enforcement/test-auto-healing.js +0 -325
  155. package/dist/integrations/base/ExampleIntegration.d.ts +0 -47
  156. package/dist/integrations/base/ExampleIntegration.js +0 -181
  157. package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +0 -34
  158. package/dist/mcps/knowledge-skills/testing-best-practices.server.js +0 -831
  159. package/dist/mcps/orchestrator.server.d.ts +0 -10
  160. package/dist/mcps/orchestrator.server.js +0 -19
  161. package/dist/orchestrator/self-direction-activation.d.ts +0 -109
  162. package/dist/orchestrator/self-direction-activation.js +0 -245
  163. package/dist/orchestrator/universal-librarian-consultation.d.ts +0 -98
  164. package/dist/orchestrator/universal-librarian-consultation.js +0 -216
  165. package/dist/orchestrator/universal-registry-bridge.d.ts +0 -85
  166. package/dist/orchestrator/universal-registry-bridge.js +0 -247
  167. package/dist/performance/performance-budget-enforcer.d.ts +0 -158
  168. package/dist/performance/performance-budget-enforcer.js +0 -434
  169. package/dist/performance/performance-regression-tester.d.ts +0 -108
  170. package/dist/performance/performance-regression-tester.js +0 -342
  171. package/dist/skills/testing-best-practices/SKILL.md +0 -37
  172. package/dist/state/context-providers.d.ts +0 -4
  173. package/dist/state/context-providers.js +0 -1
  174. package/dist/state/state-types.d.ts +0 -5
  175. package/dist/state/state-types.js +0 -1
  176. package/dist/utils/batch-operations.d.ts +0 -25
  177. package/dist/utils/batch-operations.js +0 -292
  178. package/dist/utils/test-template-generator.d.ts +0 -25
  179. package/dist/utils/test-template-generator.js +0 -178
  180. package/dist/utils/token-manager.d.ts +0 -48
  181. package/dist/utils/token-manager.js +0 -163
  182. package/src/mcps/knowledge-skills/testing-best-practices.server.test.ts +0 -136
  183. package/src/mcps/knowledge-skills/testing-best-practices.server.ts +0 -1183
  184. package/src/mcps/orchestrator.server.ts +0 -34
  185. package/src/opencode/agents/testing-best-practices.yml +0 -12
  186. package/src/skills/testing-best-practices/SKILL.md +0 -37
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.3",
2
+ "version": "2.2.0",
3
3
  "terms": [
4
4
  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68
5
5
  ],
@@ -69,7 +69,7 @@ Comprehensive dependency analysis and security audit for all project dependencie
69
69
  "vulnerabilities": [
70
70
  {
71
71
  "package": "lodash",
72
- "version": "2.1.3",
72
+ "version": "2.2.0",
73
73
  "severity": "high",
74
74
  "cve": "CVE-2021-23337",
75
75
  "description": "Command injection vulnerability"
@@ -85,14 +85,14 @@ Security-focused format for CI/CD integration:
85
85
 
86
86
  ```json
87
87
  {
88
- "version": "2.1.3",
88
+ "version": "2.2.0",
89
89
  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
90
90
  "runs": [
91
91
  {
92
92
  "tool": {
93
93
  "driver": {
94
94
  "name": "Dependency Audit",
95
- "version": "2.1.3"
95
+ "version": "2.2.0"
96
96
  }
97
97
  },
98
98
  "results": [...]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "framework": "xray 2.0",
3
- "version": "2.1.3",
3
+ "version": "2.2.0",
4
4
  "description": "Codex-compliant framework configuration for Credible UI project",
5
5
  "thresholds": {
6
6
  "bundleSize": {
@@ -220,7 +220,7 @@
220
220
  }
221
221
  },
222
222
  "codex": {
223
- "version": "2.1.3",
223
+ "version": "2.2.0",
224
224
  "terms": [
225
225
  1,
226
226
  2,
package/.opencode/init.sh CHANGED
@@ -70,7 +70,7 @@ echo -e "${PURPLE}// ╚█████╔╝██╔╝ ██╗██
70
70
  echo -e "${PURPLE}// ╚════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ //${NC}" && sleep 0.1
71
71
  echo -e "${PURPLE}// //${NC}" && sleep 0.1
72
72
  echo -e "${PURPLE}// ⚡ 0xRay: Self-Healing AI Governance OS //${NC}" && sleep 0.1
73
- echo -e "${PURPLE}// 42 agents · 44 skills · 41 MCP servers //${NC}" && sleep 0.1
73
+ echo -e "${PURPLE}// 42 agents · 44 skills · 39 MCP servers //${NC}" && sleep 0.1
74
74
  echo -e "${PURPLE}//═══════════════════════════════════════════════════════//${NC}" && sleep 0.2
75
75
  echo -e "${PURPLE}// 🚀 Initializing... //${NC}" && sleep 0.3
76
76
  echo -e "${PURPLE}//═══════════════════════════════════════════════════════//${NC}" && sleep 0.2
package/AGENTS.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # xray Agents
2
2
 
3
- Quick reference for xray AI orchestration framework (v16 MCPs-centric three-subsystem).
3
+ Quick reference for xray AI orchestration framework (v15 MCPs-centric three-subsystem).
4
4
 
5
5
  ## What is xray?
6
6
 
7
7
  xray provides intelligent multi-agent orchestration with automatic delegation and Codex compliance validation under the pure v2 three-subsystem model (Inference + External Governance via Dynamo + Autonomous Engine via thinDispatch 7-flow in MCP orchestrator). Agents operate via `.opencode/agents/*.yml` YML surfaces and 3 dedicated MCP skill servers — no manual setup needed.
8
8
 
9
- ## v16 MCPs-Centric Architecture
9
+ ## v15 MCPs-Centric Architecture
10
10
 
11
11
  The v2 release centers on **MCP (Model Context Protocol)** as the primary surface for agent skills. Three agent MCP servers handle governance deliberation:
12
12
 
@@ -84,14 +84,14 @@ The Autonomous Engine routes via complexity:
84
84
 
85
85
  xray enforces the Universal Development Codex (60 terms) via Dynamo governance. The codex lives in `.opencode/xray/codex.json`.
86
86
 
87
- Pure v16 MCPs. Clean. Complete.
87
+ Pure v15 MCPs. Clean. Complete.
88
88
 
89
89
  ## Session: v2.1.2 Release Polish
90
90
 
91
91
  - Package: `0xray` (npm), `github.com/0xRayAI/xray`. Version `2.0.0`.
92
92
  - Renamed `strray-ai` → `0xray` across 60+ source files, CLI help text, grok plugin, hermes-agent bridge (Python + JS), docusaurus config.
93
93
  - **12 stale docs git-rm'd**: AGENTS-consumer.md, AGENTS-full.md, CHANGELOG-v1.15.x.md, 7 docs/ files.
94
- - **AGENTS.md + README.md**: Rewritten v16 MCPs-centric.
94
+ - **AGENTS.md + README.md**: Rewritten v15 MCPs-centric.
95
95
  - **CLI help text**: `npx 0xray` — removed dead `dashboard` command, stale examples.
96
96
  - `.npmignore`: removed `src/` (conflicted with `files` field — was silently dropping published sources).
97
97
  - `.gitignore`: cleaned stale `.strray/` entries, `strray-ai-*.tgz` → `0xray-*.tgz`.
@@ -107,5 +107,5 @@ Pure v16 MCPs. Clean. Complete.
107
107
  - `status.ts` CLI command wired into `index.ts`
108
108
  - Orphaned files analyzed (not deleted): `security-audit.ts`, `src/security/` (11 files), `session-capture-processor.ts`, `activate-kernel-pipeline.ts`
109
109
  - **Hermes-agent bridge backward compat**: all JS/Python bridge files check for both `strray-ai` (old) and `0xray` (new). Default paths updated to `0xray`.
110
- - **Test suite**: 162 files, 2282 tests (+ 44 skipped), 0 failures. Build passes clean.
111
- - **OpenClaw e2e**: Phase 13 validates `logs/framework/activity.log` via agent tool event → hooks → frameworkLogger pipeline — 2282 tests, 0 failures.
110
+ - **Test suite**: 162 files, 2196 tests (+ 44 skipped), 0 failures. Build passes clean.
111
+ - **OpenClaw e2e**: Phase 13 validates `logs/framework/activity.log` via agent tool event → hooks → frameworkLogger pipeline — 2196 tests, 0 failures.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 0xRay — Self-Healing AI Governance OS
2
2
 
3
- **v2.1.3** — 42 agents · 46 skills · 16 MCPs servers · 5 codex terms · ~2,2282 tests
3
+ **v2.1.3** — 42 agents · 46 skills · 15 MCPs servers · 9 codex terms · ~2,2196 tests
4
4
 
5
5
  [![Docs](https://img.shields.io/badge/docs-0xRayAI.github.io/xray-10b981?style=flat-square)](https://0xrayai.github.io/xray/)
6
6
 
@@ -62,7 +62,7 @@ AI coding assistants are powerful but unreliable. They hallucinate APIs, introdu
62
62
  ├─────────────────────────────────────────────────┤
63
63
  │ External Governance (Dynamo) │
64
64
  │ Codex enforcement · Multi-agent review · SSOT │
65
- │ 16 MCPs servers (governance + knowledge skills) deliberate proposals │
65
+ │ 15 MCPs servers (governance + knowledge skills) deliberate proposals │
66
66
  ├─────────────────────────────────────────────────┤
67
67
  │ Autonomous Engine (thinDispatch) │
68
68
  │ Task routing · Multi-agent coordination │
@@ -179,7 +179,7 @@ Every subsystem is configurable via `features.json` (located at `.opencode/xray/
179
179
 
180
180
  ```json
181
181
  {
182
- "version": "2.1.3",
182
+ "version": "2.2.0",
183
183
  "token_optimization": {
184
184
  "enabled": true,
185
185
  "max_context_tokens": 20000,
@@ -277,7 +277,7 @@ Install more skills anytime: `npx 0xray skill:install`
277
277
 
278
278
  ## Testing & Reliability
279
279
 
280
- 0xRay is battle-tested with **~2,2282 tests** across every subsystem:
280
+ 0xRay is battle-tested with **~2,2196 tests** across every subsystem:
281
281
 
282
282
  | Suite | Tests | Status |
283
283
  |-------|-------|--------|
package/dist/AGENTS.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # xray Agents
2
2
 
3
- Quick reference for xray AI orchestration framework (v16 MCPs-centric three-subsystem).
3
+ Quick reference for xray AI orchestration framework (v15 MCPs-centric three-subsystem).
4
4
 
5
5
  ## What is xray?
6
6
 
7
7
  xray provides intelligent multi-agent orchestration with automatic delegation and Codex compliance validation under the pure v2 three-subsystem model (Inference + External Governance via Dynamo + Autonomous Engine via thinDispatch 7-flow in MCP orchestrator). Agents operate via `.opencode/agents/*.yml` YML surfaces and 3 dedicated MCP skill servers — no manual setup needed.
8
8
 
9
- ## v16 MCPs-Centric Architecture
9
+ ## v15 MCPs-Centric Architecture
10
10
 
11
11
  The v2 release centers on **MCP (Model Context Protocol)** as the primary surface for agent skills. Three agent MCP servers handle governance deliberation:
12
12
 
@@ -84,14 +84,14 @@ The Autonomous Engine routes via complexity:
84
84
 
85
85
  xray enforces the Universal Development Codex (60 terms) via Dynamo governance. The codex lives in `.opencode/xray/codex.json`.
86
86
 
87
- Pure v16 MCPs. Clean. Complete.
87
+ Pure v15 MCPs. Clean. Complete.
88
88
 
89
89
  ## Session: v2.1.2 Release Polish
90
90
 
91
91
  - Package: `0xray` (npm), `github.com/0xRayAI/xray`. Version `2.0.0`.
92
92
  - Renamed `strray-ai` → `0xray` across 60+ source files, CLI help text, grok plugin, hermes-agent bridge (Python + JS), docusaurus config.
93
93
  - **12 stale docs git-rm'd**: AGENTS-consumer.md, AGENTS-full.md, CHANGELOG-v1.15.x.md, 7 docs/ files.
94
- - **AGENTS.md + README.md**: Rewritten v16 MCPs-centric.
94
+ - **AGENTS.md + README.md**: Rewritten v15 MCPs-centric.
95
95
  - **CLI help text**: `npx 0xray` — removed dead `dashboard` command, stale examples.
96
96
  - `.npmignore`: removed `src/` (conflicted with `files` field — was silently dropping published sources).
97
97
  - `.gitignore`: cleaned stale `.strray/` entries, `strray-ai-*.tgz` → `0xray-*.tgz`.
@@ -107,5 +107,5 @@ Pure v16 MCPs. Clean. Complete.
107
107
  - `status.ts` CLI command wired into `index.ts`
108
108
  - Orphaned files analyzed (not deleted): `security-audit.ts`, `src/security/` (11 files), `session-capture-processor.ts`, `activate-kernel-pipeline.ts`
109
109
  - **Hermes-agent bridge backward compat**: all JS/Python bridge files check for both `strray-ai` (old) and `0xray` (new). Default paths updated to `0xray`.
110
- - **Test suite**: 162 files, 2282 tests (+ 44 skipped), 0 failures. Build passes clean.
111
- - **OpenClaw e2e**: Phase 13 validates `logs/framework/activity.log` via agent tool event → hooks → frameworkLogger pipeline — 2282 tests, 0 failures.
110
+ - **Test suite**: 162 files, 2196 tests (+ 44 skipped), 0 failures. Build passes clean.
111
+ - **OpenClaw e2e**: Phase 13 validates `logs/framework/activity.log` via agent tool event → hooks → frameworkLogger pipeline — 2196 tests, 0 failures.
package/dist/CHANGELOG.md CHANGED
@@ -4,6 +4,45 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Conventional Commits](https://www.conventionalcommits.org/).
6
6
 
7
+ ## [2.2.1] - 2026-06-10
8
+
9
+ ### 🔄 Changes
10
+
11
+ - Version bump
12
+
13
+ ---
14
+
15
+ ## [2.2.0] - 2026-06-10
16
+
17
+ ### 🚀 Features
18
+ - feat: add Codex terms 69-72 covering self-evolution constraints (proposal governance, metamorphosis threshold, safety controls, traceability) (codex.json)
19
+ - feat: long-running governed agent session verification E2E (11 tests, self-evolution-e2e.test.ts)
20
+ - feat: Plugin API documentation — SkillPlugin, MetamorphosisEngine, SelfProposalEngine interfaces (docs/api/plugin-api.md)
21
+ - feat: SelfProposalEngine with unit + E2E tests (postprocessor/metamorphosis/SelfProposalEngine.ts)
22
+ - feat: nucleus kernel facade — handleGovernRequest, governViaNucleus, pluginRegistry (src/nucleus/)
23
+ - feat: CLI govern command — status, audit, proposals, MCP management, storyteller (src/cli/commands/govern.ts)
24
+ - feat: consumer verification script (scripts/verify-consumer.sh)
25
+
26
+ ### ♻️ Refactoring
27
+ - refactor: 12-review subtract pass across all subsystems — ~16k LOC removed (Core, Nucleus, Governance, MCP, Inference, Orchestration, Delegation, Processors, Postprocessor, Enforcement, Integrations, CLI, Supporting)
28
+ - refactor: delete trace-context.ts, errors.ts, logging-config.ts (inlined into framework-logger)
29
+ - refactor: delete applyDecisionMatrix dead PHI/TAU matrix from governance-core
30
+ - refactor: delete testing-best-practices.server.ts (1,183 LOC unregistered MCP bloat), orchestrator.server.ts shim
31
+ - refactor: delete 4 dead orchestrator/delegation files (universal-registry-bridge, universal-librarian-consultation, self-direction-activation, task-skill-router.d.ts)
32
+ - refactor: delete RetryHandler.ts, ComprehensiveValidator.ts from postprocessor
33
+ - refactor: delete test-auto-healing.ts, cross-language-bridge.ts
34
+ - refactor: delete 5 CLI dead files (4 analytics commands, server.ts)
35
+ - refactor: delete 19 dead source + 6 stale test files across analytics, infrastructure, performance, reporting, utils, validation, state
36
+ - refactor: delete dead expertise barrel exports (getAgentsWithExpertiseDomain, getTopExpertsForDomain)
37
+ - refactor: update Codex references from 68 to 72 terms across docs
38
+ - refactor: clean dead test script references in package.json
39
+
40
+ ### 🐛 Bug Fixes
41
+ - fix: repair syntax from STRRAY_ cleanup (setup.ts, hermes bridge) so tests and release guard pass (87f3613ad)
42
+ - fix: E2E test references to applyDecisionMatrix updated to mergeVotes
43
+
44
+ ---
45
+
7
46
  ## [2.1.4] - 2026-06-09
8
47
 
9
48
  ### 🔄 Changes
package/dist/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 0xRay — Self-Healing AI Governance OS
2
2
 
3
- **v2.1.3** — 42 agents · 46 skills · 16 MCPs servers · 5 codex terms · ~2,2282 tests
3
+ **v2.1.3** — 42 agents · 46 skills · 15 MCPs servers · 9 codex terms · ~2,2196 tests
4
4
 
5
5
  [![Docs](https://img.shields.io/badge/docs-0xRayAI.github.io/xray-10b981?style=flat-square)](https://0xrayai.github.io/xray/)
6
6
 
@@ -62,7 +62,7 @@ AI coding assistants are powerful but unreliable. They hallucinate APIs, introdu
62
62
  ├─────────────────────────────────────────────────┤
63
63
  │ External Governance (Dynamo) │
64
64
  │ Codex enforcement · Multi-agent review · SSOT │
65
- │ 16 MCPs servers (governance + knowledge skills) deliberate proposals │
65
+ │ 15 MCPs servers (governance + knowledge skills) deliberate proposals │
66
66
  ├─────────────────────────────────────────────────┤
67
67
  │ Autonomous Engine (thinDispatch) │
68
68
  │ Task routing · Multi-agent coordination │
@@ -179,7 +179,7 @@ Every subsystem is configurable via `features.json` (located at `.opencode/xray/
179
179
 
180
180
  ```json
181
181
  {
182
- "version": "2.1.3",
182
+ "version": "2.2.0",
183
183
  "token_optimization": {
184
184
  "enabled": true,
185
185
  "max_context_tokens": 20000,
@@ -277,7 +277,7 @@ Install more skills anytime: `npx 0xray skill:install`
277
277
 
278
278
  ## Testing & Reliability
279
279
 
280
- 0xRay is battle-tested with **~2,2282 tests** across every subsystem:
280
+ 0xRay is battle-tested with **~2,2196 tests** across every subsystem:
281
281
 
282
282
  | Suite | Tests | Status |
283
283
  |-------|-------|--------|
@@ -15,7 +15,7 @@ export const codeReviewer = {
15
15
 
16
16
  ## Framework Context
17
17
  - Universal Development Codex v1.2.0
18
- - Validate against all 5 codex terms
18
+ - Validate against all 9 codex terms
19
19
 
20
20
  ## Rules (STRICT)
21
21
  - MAX 3 file reads, then review
@@ -36,7 +36,7 @@ class RoutingRefiner {
36
36
  const optimizations = this.suggestMappingOptimizations(promptAnalysis, performanceReport);
37
37
  const warnings = this.generateWarnings(newMappings, optimizations);
38
38
  return {
39
- version: "2.1.3",
39
+ version: "2.2.0",
40
40
  generatedAt: new Date(),
41
41
  summary: {
42
42
  newMappings: newMappings.length,
@@ -0,0 +1,29 @@
1
+ /**
2
+ * xray govern — the primary CLI command for the v3 nucleus
3
+ *
4
+ * Usage:
5
+ * xray govern [options]
6
+ *
7
+ * All existing direct commands still work (backward compat with deprecation notice).
8
+ */
9
+ interface GovernOptions {
10
+ status?: boolean;
11
+ audit?: boolean;
12
+ mcp?: string;
13
+ pluginInstall?: string;
14
+ proposals?: string;
15
+ skillInstall?: string;
16
+ skillRegistry?: string;
17
+ storyteller?: string;
18
+ mcpList?: boolean;
19
+ mcpStatus?: boolean;
20
+ mcpInstall?: string;
21
+ mcpRemove?: string;
22
+ publishAgent?: boolean;
23
+ archiveLogs?: boolean;
24
+ credibleInit?: string;
25
+ antigravityStatus?: boolean;
26
+ [key: string]: unknown;
27
+ }
28
+ export declare function governCommand(options: GovernOptions): Promise<void>;
29
+ export {};
@@ -0,0 +1,152 @@
1
+ /**
2
+ * xray govern — the primary CLI command for the v3 nucleus
3
+ *
4
+ * Usage:
5
+ * xray govern [options]
6
+ *
7
+ * All existing direct commands still work (backward compat with deprecation notice).
8
+ */
9
+ import { resolve, join } from 'path';
10
+ import { readFileSync, existsSync } from 'fs';
11
+ import { spawn } from 'child_process';
12
+ export async function governCommand(options) {
13
+ if (options.status) {
14
+ const { statusCommand } = await import('./status.js');
15
+ await statusCommand();
16
+ return;
17
+ }
18
+ if (options.audit) {
19
+ const { securityAuditCommand } = await import('./security-audit.js');
20
+ await securityAuditCommand();
21
+ return;
22
+ }
23
+ if (options.mcp) {
24
+ const serverMap = {
25
+ governance: 'dist/mcps/governance.server.js',
26
+ skills: 'dist/mcps/knowledge-skills/skill-invocation.server.js',
27
+ };
28
+ const relPath = serverMap[options.mcp];
29
+ if (!relPath) {
30
+ console.error(`Unknown MCP server: ${options.mcp}. Use: governance, skills`);
31
+ process.exit(1);
32
+ }
33
+ const packageJsonPath = resolve(import.meta.url.replace(/^file:/, ''), '..', '..', 'package.json');
34
+ const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
35
+ const packageRoot = resolve(packageJsonPath, '..', pkg.xray?.dist ? join('', pkg.xray.dist) : 'dist', '..');
36
+ const serverPath = resolve(join(packageRoot, relPath));
37
+ if (!existsSync(serverPath)) {
38
+ console.error(`MCP server not found at ${serverPath}. Is xray installed correctly?`);
39
+ process.exit(1);
40
+ }
41
+ const env = { ...process.env };
42
+ if (options.mcp === 'governance') {
43
+ env.XRAY_FORCE_MCP_GOVERNANCE = 'true';
44
+ }
45
+ const child = spawn(process.execPath, [serverPath], { stdio: 'inherit', env });
46
+ child.on('exit', (code) => process.exit(code ?? 0));
47
+ return;
48
+ }
49
+ if (options.pluginInstall) {
50
+ const { pluginInstallCommand } = await import('./plugin-commands.js');
51
+ await pluginInstallCommand(options.pluginInstall);
52
+ return;
53
+ }
54
+ if (options.proposals) {
55
+ const { handleGovernRequest } = await import('../../nucleus/index.js');
56
+ let proposals;
57
+ try {
58
+ proposals = JSON.parse(options.proposals);
59
+ }
60
+ catch {
61
+ console.error('Invalid JSON in --proposals. Expected a JSON string with a "proposals" array.');
62
+ console.error('Example: xray govern --proposals \'[{"type":"fix","title":"Test","description":"A test"}]\'');
63
+ process.exit(1);
64
+ }
65
+ const result = await handleGovernRequest(proposals);
66
+ console.log(JSON.stringify(result, null, 2));
67
+ return;
68
+ }
69
+ if (options.skillInstall !== undefined) {
70
+ const { skillInstallCommand } = await import('./skill-install.js');
71
+ await skillInstallCommand(options.skillInstall || undefined);
72
+ return;
73
+ }
74
+ if (options.skillRegistry !== undefined) {
75
+ const { skillRegistryCommand } = await import('./skill-install.js');
76
+ await skillRegistryCommand(options.skillRegistry || undefined);
77
+ return;
78
+ }
79
+ if (options.storyteller) {
80
+ const { storytellerCommand } = await import('./storyteller.js');
81
+ await storytellerCommand(options.storyteller);
82
+ return;
83
+ }
84
+ if (options.mcpList) {
85
+ const { listMCPsCommand } = await import('./mcp-install.js');
86
+ listMCPsCommand();
87
+ return;
88
+ }
89
+ if (options.mcpStatus) {
90
+ const { showMCPStatusCommand } = await import('./mcp-install.js');
91
+ showMCPStatusCommand();
92
+ return;
93
+ }
94
+ if (options.mcpInstall) {
95
+ const { installMCPCommand } = await import('./mcp-install.js');
96
+ await installMCPCommand(options.mcpInstall);
97
+ return;
98
+ }
99
+ if (options.mcpRemove) {
100
+ const { removeMCPCommand } = await import('./mcp-install.js');
101
+ removeMCPCommand(options.mcpRemove);
102
+ return;
103
+ }
104
+ if (options.publishAgent) {
105
+ const { publishAgentCommand } = await import('./publish-agent.js');
106
+ await publishAgentCommand();
107
+ return;
108
+ }
109
+ if (options.archiveLogs) {
110
+ const { archiveLogFiles } = await import('./archive-logs.js');
111
+ const result = await archiveLogFiles(undefined, `govern-${Date.now()}`);
112
+ console.log(`\nResults:`);
113
+ console.log(` Archived: ${result.archived} files`);
114
+ if (result.errors.length > 0) {
115
+ console.log(` Errors: ${result.errors.length}`);
116
+ result.errors.forEach((e) => console.log(` - ${e}`));
117
+ process.exit(1);
118
+ }
119
+ return;
120
+ }
121
+ if (options.credibleInit !== undefined) {
122
+ const { credibleInitCommand } = await import('./credible-init.js');
123
+ await credibleInitCommand();
124
+ return;
125
+ }
126
+ if (options.antigravityStatus) {
127
+ const { antigravityStatusCommand } = await import('./antigravity-status.js');
128
+ await antigravityStatusCommand();
129
+ return;
130
+ }
131
+ console.log('xray govern — the governance kernel\n');
132
+ console.log('Usage: xray govern [options]\n');
133
+ console.log('Options:');
134
+ console.log(' --status Show framework status');
135
+ console.log(' --audit Run security audit');
136
+ console.log(' --mcp <server> Run an MCP server (governance, skills)');
137
+ console.log(' --plugin-install <name> Install a plugin');
138
+ console.log(' --proposals <json> Run governance on JSON proposals');
139
+ console.log(' --skill-install [source] Install skills from registry');
140
+ console.log(' --skill-registry [action] Manage skill registry sources');
141
+ console.log(' --storyteller <type> Write a story (reflection, saga, journey, narrative)');
142
+ console.log(' --mcp-list List available MCP servers');
143
+ console.log(' --mcp-status Show installed MCP servers');
144
+ console.log(' --mcp-install <name> Install an MCP server');
145
+ console.log(' --mcp-remove <name> Remove an MCP server');
146
+ console.log(' --publish-agent Publish an agent to AgentStore');
147
+ console.log(' --archive-logs Archive log files');
148
+ console.log(' --credible-init [name] Initialize Credible Pod');
149
+ console.log(' --antigravity-status Show installed skills status');
150
+ console.log(' -h, --help Show this help\n');
151
+ console.log('All existing commands still work: xray status, xray security-audit, etc.');
152
+ }