0xray 3.5.0 → 3.5.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.
- package/.gitignore.default +8 -0
- package/.opencode/hooks/post-commit +7 -27
- package/.xray/features.json +6 -0
- package/.xray/features.schema.json +17 -0
- package/AGENTS-consumer.md +1 -1
- package/AGENTS.md +1 -1
- package/README.md +1 -1
- package/SKILLS.md +1 -1
- package/dist/.gitignore.default +8 -0
- package/dist/AGENTS.md +1 -1
- package/dist/CHANGELOG.md +32 -0
- package/dist/README.md +1 -1
- package/dist/SKILLS.md +1 -1
- package/dist/core/bridge.mjs +10 -32
- package/dist/core/features-config.d.ts +16 -0
- package/dist/core/features-config.js +24 -0
- package/dist/integrations/grok/hooks/grok-hook-utils.js +32 -385
- package/dist/integrations/grok/hooks/post-tool-use.js +1 -1
- package/dist/integrations/grok/hooks/pre-tool-use.js +23 -32
- package/dist/integrations/grok/hooks/session-start.js +20 -1
- package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +2 -1
- package/dist/integrations/hermes-agent/__init__.py +50 -3
- package/dist/integrations/hermes-agent/bridge.mjs +71 -30
- package/dist/integrations/hooks/delegation-gate-runtime.mjs +75 -0
- package/dist/integrations/hooks/synthesis-hook-runtime.mjs +50 -0
- package/dist/mcps/orchestrator/handlers/complexity-handler.d.ts +3 -0
- package/dist/mcps/orchestrator/handlers/complexity-handler.js +25 -10
- package/dist/mcps/orchestrator/server.js +124 -4
- package/dist/memory-routing/types.d.ts +7 -0
- package/dist/nucleus/autonomy-kernel.d.ts +3 -0
- package/dist/nucleus/autonomy-kernel.js +40 -0
- package/dist/nucleus/delegation-gate.d.ts +88 -0
- package/dist/nucleus/delegation-gate.js +347 -0
- package/dist/nucleus/lead-dev-plan-persistence.d.ts +3 -0
- package/dist/nucleus/lead-dev-plan-persistence.js +47 -4
- package/dist/nucleus/synthesis-completion.d.ts +6 -0
- package/dist/nucleus/synthesis-completion.js +29 -0
- package/dist/nucleus/synthesis-context.d.ts +31 -0
- package/dist/nucleus/synthesis-context.js +86 -0
- package/dist/nucleus/synthesis.d.ts +54 -0
- package/dist/nucleus/synthesis.js +196 -0
- package/dist/plugin/xray-codex-injection.js +50 -0
- package/package.json +11 -2
- package/scripts/helpers/find-project-root.mjs +92 -0
- package/scripts/hooks/install-hooks.cjs +136 -36
- package/scripts/hooks/run-hook.js +46 -9
- package/scripts/mjs/delegation-gate-fixture.mjs +121 -0
- package/scripts/mjs/verify-delegation-gate-core.mjs +99 -0
- package/scripts/mjs/verify-grok-delegation-gate.mjs +9 -69
- package/scripts/mjs/verify-hermes-delegation-gate.mjs +89 -0
- package/scripts/node/auto-reflection-generator.mjs +7 -0
- package/scripts/node/consumer-gitignore.cjs +101 -0
- package/scripts/node/load-reflection-config.mjs +77 -0
- package/scripts/node/postinstall.cjs +9 -6
- package/scripts/node/universal-version-manager.js +1 -1
- package/src/integrations/grok/plugin/0xray/hooks/hooks.json +2 -1
- package/src/mcps/orchestrator/handlers/complexity-handler.ts +33 -8
- package/src/mcps/orchestrator/server.ts +181 -5
- package/xray/features.json +6 -0
- package/xray/features.schema.json +17 -0
package/.gitignore.default
CHANGED
|
@@ -20,6 +20,13 @@ credentials.json
|
|
|
20
20
|
*.pem
|
|
21
21
|
*.key
|
|
22
22
|
|
|
23
|
+
# 0xray suit artifacts (postinstall / bridge install)
|
|
24
|
+
.grok/
|
|
25
|
+
.mcp.json
|
|
26
|
+
opencode.json
|
|
27
|
+
AGENTS.md
|
|
28
|
+
SKILLS.md
|
|
29
|
+
|
|
23
30
|
# Runtime state (xray inference workflows, session state)
|
|
24
31
|
.xray/
|
|
25
32
|
.strray/
|
|
@@ -41,6 +48,7 @@ xray/inference/
|
|
|
41
48
|
|
|
42
49
|
# Logs
|
|
43
50
|
logs/
|
|
51
|
+
logs/framework/
|
|
44
52
|
*.log
|
|
45
53
|
|
|
46
54
|
# OS files
|
|
@@ -20,39 +20,19 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
|
20
20
|
fi
|
|
21
21
|
) &
|
|
22
22
|
|
|
23
|
-
# Load
|
|
24
|
-
CONFIG_FILE="$PROJECT_ROOT/.xray/features.json"
|
|
23
|
+
# Load reflection config — synthesis.reflection SSOT, fallback auto_reflection
|
|
25
24
|
MODE="minimal"
|
|
26
25
|
COMMIT_THRESHOLD=25
|
|
27
26
|
DAYS_THRESHOLD=14
|
|
28
27
|
AUTO_GENERATE=true
|
|
29
28
|
PROMPT_USER=true
|
|
30
29
|
|
|
31
|
-
if
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
full)
|
|
38
|
-
COMMIT_THRESHOLD=10
|
|
39
|
-
DAYS_THRESHOLD=5
|
|
40
|
-
AUTO_GENERATE=true
|
|
41
|
-
PROMPT_USER=true
|
|
42
|
-
;;
|
|
43
|
-
minimal)
|
|
44
|
-
COMMIT_THRESHOLD=25
|
|
45
|
-
DAYS_THRESHOLD=14
|
|
46
|
-
AUTO_GENERATE=true
|
|
47
|
-
PROMPT_USER=true
|
|
48
|
-
;;
|
|
49
|
-
off)
|
|
50
|
-
COMMIT_THRESHOLD=999
|
|
51
|
-
DAYS_THRESHOLD=365
|
|
52
|
-
AUTO_GENERATE=false
|
|
53
|
-
PROMPT_USER=false
|
|
54
|
-
;;
|
|
55
|
-
esac
|
|
30
|
+
if command -v node >/dev/null 2>&1; then
|
|
31
|
+
LOAD_SCRIPT="$PROJECT_ROOT/scripts/node/load-reflection-config.mjs"
|
|
32
|
+
if [ -f "$LOAD_SCRIPT" ]; then
|
|
33
|
+
export PROJECT_ROOT="$PROJECT_ROOT"
|
|
34
|
+
eval "$(node "$LOAD_SCRIPT")"
|
|
35
|
+
fi
|
|
56
36
|
fi
|
|
57
37
|
|
|
58
38
|
# Check if this was a significant commit - prompt for reflection
|
package/.xray/features.json
CHANGED
|
@@ -141,6 +141,12 @@
|
|
|
141
141
|
"module_path": "",
|
|
142
142
|
"config": {}
|
|
143
143
|
},
|
|
144
|
+
"synthesis": {
|
|
145
|
+
"enabled": false,
|
|
146
|
+
"every_n_gates": 12,
|
|
147
|
+
"every_n_turns": 0,
|
|
148
|
+
"every_n_todos_completed": 0
|
|
149
|
+
},
|
|
144
150
|
"inference_governance": {
|
|
145
151
|
"enabled": false,
|
|
146
152
|
"request_timeout_ms": 10000,
|
|
@@ -27,6 +27,23 @@
|
|
|
27
27
|
"then": {
|
|
28
28
|
"required": ["module_path"]
|
|
29
29
|
}
|
|
30
|
+
},
|
|
31
|
+
"synthesis": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"properties": {
|
|
34
|
+
"enabled": { "type": "boolean" },
|
|
35
|
+
"every_n_gates": { "type": "integer", "minimum": 0 },
|
|
36
|
+
"every_n_turns": { "type": "integer", "minimum": 0 },
|
|
37
|
+
"every_n_todos_completed": { "type": "integer", "minimum": 0 },
|
|
38
|
+
"reflection": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"properties": {
|
|
41
|
+
"mode": { "type": "string", "enum": ["full", "minimal", "off"] },
|
|
42
|
+
"triggers": { "type": "object" },
|
|
43
|
+
"thresholds": { "type": "object" }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
30
47
|
}
|
|
31
48
|
},
|
|
32
49
|
"additionalProperties": true
|
package/AGENTS-consumer.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Quick reference for the 0xRay AI orchestration framework (shipped to your project on `npm install 0xray`).
|
|
6
6
|
|
|
7
|
-
**v3.5.
|
|
7
|
+
**v3.5.2** — 7 MCP servers · 45 skills · 68 codex terms · 4 platform bridges
|
|
8
8
|
|
|
9
9
|
## Postinstall (automatic)
|
|
10
10
|
|
package/AGENTS.md
CHANGED
package/README.md
CHANGED
package/SKILLS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 0xray Skills
|
|
2
2
|
|
|
3
|
-
**v3.5.
|
|
3
|
+
**v3.5.2** — **45 skills** · invoked via `xray-skills` MCP · synced on postinstall
|
|
4
4
|
|
|
5
5
|
xray ships 45 knowledge skills (`src/skills/<name>/SKILL.md`) across the full software lifecycle. Lead-dev operating model lives in **`orchestrator`** skill + `multi_agent_orchestration.lead_dev_mode` in features.json. Skills load on demand via the **xray-skills** MCP server (`npx -y 0xray mcp skills`), agent `@mentions`, or platform skill directories after postinstall.
|
|
6
6
|
|
package/dist/.gitignore.default
CHANGED
|
@@ -20,6 +20,13 @@ credentials.json
|
|
|
20
20
|
*.pem
|
|
21
21
|
*.key
|
|
22
22
|
|
|
23
|
+
# 0xray suit artifacts (postinstall / bridge install)
|
|
24
|
+
.grok/
|
|
25
|
+
.mcp.json
|
|
26
|
+
opencode.json
|
|
27
|
+
AGENTS.md
|
|
28
|
+
SKILLS.md
|
|
29
|
+
|
|
23
30
|
# Runtime state (xray inference workflows, session state)
|
|
24
31
|
.xray/
|
|
25
32
|
.strray/
|
|
@@ -41,6 +48,7 @@ xray/inference/
|
|
|
41
48
|
|
|
42
49
|
# Logs
|
|
43
50
|
logs/
|
|
51
|
+
logs/framework/
|
|
44
52
|
*.log
|
|
45
53
|
|
|
46
54
|
# OS files
|
package/dist/AGENTS.md
CHANGED
package/dist/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,38 @@ 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
|
+
## [3.5.2] - 2026-06-19
|
|
8
|
+
|
|
9
|
+
### 🐛 Bug Fixes
|
|
10
|
+
- **Grok synthesis gate** — `pre-tool-use.js` wires `evaluatePreToolGate` SSOT (synthesis deny, gate slices, `govern-and-apply` block); fail-closed on hook errors
|
|
11
|
+
- **Consumer bridge root** — `findProjectRoot` git-root + devDependency detection; `findGitRoot` applies `normalizePath`
|
|
12
|
+
- **Consumer hooks** — stale xray pre-commit reinstall; post-commit hook installed; pre-commit fails closed when runner missing; non-xray hooks backed up before overwrite
|
|
13
|
+
- **Consumer `.gitignore`** — idempotent suit block merge on postinstall; preserves orphan tail on incomplete marker
|
|
14
|
+
- **`bridge.mjs`** — `handleGetConfig` fixes undeclared `envDir` ReferenceError
|
|
15
|
+
- **Post-commit reflection** — `load-reflection-config.mjs` mode whitelist + `--json` output (no shell `eval`); macOS/BSD `stat` support
|
|
16
|
+
|
|
17
|
+
### ✅ Tests
|
|
18
|
+
- `verify-grok-synthesis-gate.mjs` (4/4 live Grok hook); chained in `verify:grok-delegation-gate` and `verify:delegation-gate`
|
|
19
|
+
- `verify-consumer-gitignore` incomplete-marker fixture; `verify:find-project-root` 3/3
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## [3.5.1] - 2026-06-19
|
|
24
|
+
|
|
25
|
+
### ✨ Features
|
|
26
|
+
- **Multi-host delegation gates** — `src/nucleus/delegation-gate.ts` SSOT; `evaluatePreToolGate` / `evaluatePostToolSpawn` shared across Grok, Hermes, OpenCode
|
|
27
|
+
- **Hermes** — `pre_tool_call` returns `{"action":"block"}` via bridge `delegation-gate`; `post_tool_call` clears pending on `delegate_task`
|
|
28
|
+
- **OpenCode** — `tool.execute.before` / `after` enforce delegation gate + post-spawn clear
|
|
29
|
+
|
|
30
|
+
### ✅ Tests
|
|
31
|
+
- `delegation-gate.test.ts`; `verify-delegation-gate-core.mjs`; `verify-hermes-delegation-gate.mjs`; shared `delegation-gate-fixture.mjs`
|
|
32
|
+
- Grok hook-utils deduped — re-exports nucleus SSOT via `delegation-gate-runtime.mjs`
|
|
33
|
+
|
|
34
|
+
### 📋 Deferred
|
|
35
|
+
- **OpenClaw host veto** — no consumer tool-block API; observability-only until platform supports pre-tool deny
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
7
39
|
## [3.5.0] - 2026-06-19
|
|
8
40
|
|
|
9
41
|
### ✨ Features
|
package/dist/README.md
CHANGED
package/dist/SKILLS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 0xray Skills
|
|
2
2
|
|
|
3
|
-
**v3.5.
|
|
3
|
+
**v3.5.2** — **45 skills** · invoked via `xray-skills` MCP · synced on postinstall
|
|
4
4
|
|
|
5
5
|
xray ships 45 knowledge skills (`src/skills/<name>/SKILL.md`) across the full software lifecycle. Lead-dev operating model lives in **`orchestrator`** skill + `multi_agent_orchestration.lead_dev_mode` in features.json. Skills load on demand via the **xray-skills** MCP server (`npx -y 0xray mcp skills`), agent `@mentions`, or platform skill directories after postinstall.
|
|
6
6
|
|
package/dist/core/bridge.mjs
CHANGED
|
@@ -51,6 +51,7 @@ import { join, dirname, resolve, relative } from "path";
|
|
|
51
51
|
import { fileURLToPath } from "url";
|
|
52
52
|
import { homedir } from "os";
|
|
53
53
|
import { createServer } from "http";
|
|
54
|
+
import { findProjectRoot } from "../../scripts/helpers/find-project-root.mjs";
|
|
54
55
|
|
|
55
56
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
56
57
|
|
|
@@ -63,35 +64,11 @@ let CodexFormatterModule = null;
|
|
|
63
64
|
let frameworkReady = false;
|
|
64
65
|
let frameworkLoadAttempted = false;
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const envHome = process.env.XRAY_HOME;
|
|
72
|
-
if (envHome && existsSync(join(envHome, "package.json"))) return envHome;
|
|
73
|
-
|
|
74
|
-
const candidates = [
|
|
75
|
-
process.cwd(),
|
|
76
|
-
join(homedir(), "dev", "xray"),
|
|
77
|
-
join(dirname(__dirname), "..", ".."), // core/ -> project root
|
|
78
|
-
join(dirname(__dirname), "..", "..", ".."), // integrations/ -> project root
|
|
79
|
-
];
|
|
80
|
-
|
|
81
|
-
for (const dir of candidates) {
|
|
82
|
-
try {
|
|
83
|
-
const pkgPath = join(dir, "package.json");
|
|
84
|
-
if (existsSync(pkgPath)) {
|
|
85
|
-
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
86
|
-
if (pkg.name === "0xray" || pkg.dependencies?.["0xray"]) {
|
|
87
|
-
return dir;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
} catch {
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return process.cwd();
|
|
67
|
+
function resolveBridgeProjectRoot() {
|
|
68
|
+
return findProjectRoot([
|
|
69
|
+
join(dirname(__dirname), "..", ".."),
|
|
70
|
+
join(dirname(__dirname), "..", "..", ".."),
|
|
71
|
+
]);
|
|
95
72
|
}
|
|
96
73
|
|
|
97
74
|
// ============================================================================
|
|
@@ -184,7 +161,7 @@ const BRIDGE_CODEX_FALLBACK = {
|
|
|
184
161
|
// ============================================================================
|
|
185
162
|
|
|
186
163
|
async function handleHealth(input) {
|
|
187
|
-
const projectRoot =
|
|
164
|
+
const projectRoot = resolveBridgeProjectRoot();
|
|
188
165
|
const loaded = await loadFramework(projectRoot);
|
|
189
166
|
|
|
190
167
|
const pkgPath = join(projectRoot, "package.json");
|
|
@@ -313,6 +290,7 @@ async function handleGetCodexPrompt(input, projectRoot, logDir) {
|
|
|
313
290
|
|
|
314
291
|
async function handleGetConfig(input, projectRoot, logDir) {
|
|
315
292
|
logToActivity(logDir, "get-config");
|
|
293
|
+
const envDir = process.env.XRAY_CONFIG_DIR;
|
|
316
294
|
|
|
317
295
|
const result = {
|
|
318
296
|
status: "ok",
|
|
@@ -374,7 +352,7 @@ async function handleStats() {
|
|
|
374
352
|
codexFormatterAvailable: !!CodexFormatterModule,
|
|
375
353
|
qualityGateAvailable: !!QualityGateModule,
|
|
376
354
|
nodeVersion: process.version,
|
|
377
|
-
projectRoot:
|
|
355
|
+
projectRoot: resolveBridgeProjectRoot(),
|
|
378
356
|
};
|
|
379
357
|
}
|
|
380
358
|
|
|
@@ -893,7 +871,7 @@ async function main() {
|
|
|
893
871
|
}
|
|
894
872
|
}
|
|
895
873
|
|
|
896
|
-
const projectRoot =
|
|
874
|
+
const projectRoot = resolveBridgeProjectRoot();
|
|
897
875
|
const logDir = ensureLogDir(projectRoot);
|
|
898
876
|
|
|
899
877
|
// Lazy-load framework
|
|
@@ -66,6 +66,21 @@ export interface MultiAgentOrchestrationConfig {
|
|
|
66
66
|
/** 3.5.0 — PreToolUse gate after delegate-deferred (default true when lead_dev_mode) */
|
|
67
67
|
auto_chain_delegations?: boolean;
|
|
68
68
|
}
|
|
69
|
+
/** Reflection triggers merged from legacy auto_reflection when synthesis is configured */
|
|
70
|
+
export interface SynthesisReflectionConfig {
|
|
71
|
+
mode?: AutoReflectionConfig['mode'];
|
|
72
|
+
triggers?: AutoReflectionConfig['triggers'];
|
|
73
|
+
thresholds?: AutoReflectionConfig['thresholds'];
|
|
74
|
+
}
|
|
75
|
+
/** 3.6.0 — periodic reflect & realign checkpoint (Synthesis PR1) */
|
|
76
|
+
export interface SynthesisConfig {
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
every_n_gates: number;
|
|
79
|
+
every_n_turns: number;
|
|
80
|
+
every_n_todos_completed: number;
|
|
81
|
+
/** SSOT for reflection triggers when synthesis enabled; seeded from auto_reflection */
|
|
82
|
+
reflection?: SynthesisReflectionConfig;
|
|
83
|
+
}
|
|
69
84
|
export interface AutonomousReportingConfig {
|
|
70
85
|
enabled: boolean;
|
|
71
86
|
interval_minutes: number;
|
|
@@ -369,6 +384,7 @@ export interface FeaturesConfig {
|
|
|
369
384
|
auto_reflection?: AutoReflectionConfig;
|
|
370
385
|
inference?: InferenceConfig;
|
|
371
386
|
memory_routing?: MemoryRoutingConfig;
|
|
387
|
+
synthesis: SynthesisConfig;
|
|
372
388
|
kernel?: KernelConfig;
|
|
373
389
|
processors?: ProcessorsConfig;
|
|
374
390
|
enforcement?: EnforcementConfig;
|
|
@@ -278,6 +278,24 @@ export class FeaturesConfigLoader {
|
|
|
278
278
|
...defaults.caching,
|
|
279
279
|
...configData.caching,
|
|
280
280
|
},
|
|
281
|
+
synthesis: (() => {
|
|
282
|
+
const merged = {
|
|
283
|
+
...defaults.synthesis,
|
|
284
|
+
...configData.synthesis,
|
|
285
|
+
};
|
|
286
|
+
const reflection = configData.synthesis?.reflection ??
|
|
287
|
+
(configData.auto_reflection
|
|
288
|
+
? {
|
|
289
|
+
mode: configData.auto_reflection.mode,
|
|
290
|
+
triggers: configData.auto_reflection.triggers,
|
|
291
|
+
thresholds: configData.auto_reflection.thresholds,
|
|
292
|
+
}
|
|
293
|
+
: undefined);
|
|
294
|
+
if (reflection) {
|
|
295
|
+
merged.reflection = reflection;
|
|
296
|
+
}
|
|
297
|
+
return merged;
|
|
298
|
+
})(),
|
|
281
299
|
};
|
|
282
300
|
}
|
|
283
301
|
/**
|
|
@@ -391,6 +409,12 @@ export class FeaturesConfigLoader {
|
|
|
391
409
|
cache_ttl_seconds: 300,
|
|
392
410
|
max_cache_size_mb: 50,
|
|
393
411
|
},
|
|
412
|
+
synthesis: {
|
|
413
|
+
enabled: false,
|
|
414
|
+
every_n_gates: 12,
|
|
415
|
+
every_n_turns: 0,
|
|
416
|
+
every_n_todos_completed: 0,
|
|
417
|
+
},
|
|
394
418
|
};
|
|
395
419
|
}
|
|
396
420
|
/**
|