0xray 4.0.26 → 4.0.27

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0xray",
3
- "version": "4.0.26",
3
+ "version": "4.0.27",
4
4
  "description": "0xRay suit for Grok, Hermes, OpenClaw, OpenCode: mill+inspect, Codex, 7 MCP servers. Costume 45/42 is opt-in foundry, not the default wear.",
5
5
  "author": {
6
6
  "name": "0xRay AI",
@@ -62,7 +62,7 @@ Config: `features.json` → `multi_agent_orchestration.lead_dev_mode`
62
62
 
63
63
  ## Lead cadence (syncopation)
64
64
 
65
- The seven rules are the engine. The cadence is the time signature. Disk SSOT: `grok-bot/ops/LEAD-CADENCE.md`.
65
+ The seven rules are the engine. The cadence is the time signature. Disk SSOT: `grok-bot/OP-PROC.md` (team specifics live in `house/`).
66
66
 
67
67
  Jargon is not the job. Review and cadence ask whether the change works. Do not spend the loop reciting dest names, mill liturgy, or host mantras.
68
68
 
@@ -76,8 +76,8 @@ Jargon is not the job. Review and cadence ask whether the change works. Do not s
76
76
  - **Peer boot:** four-line dispatch. They Read Station + this cadence and install without a command novel. Not a twin critic.
77
77
  - **Live tick, not pacer:** `/loop` runs work now. Keep workstreams moving. Do not idle-wait 12 minutes. **Clean ticks every cycle** — unsubscribe then resubscribe so the prompt matches metal. Name-dedupe does not rewrite. A stale prompt (waiting URL after live, Hold after strip) is dirty: rewrite, do not act. **If the card and WAVEBOARD are idle, unsubscribe and do not resubscribe.**
78
78
  - **Board clock:** PR events + resume the same critic. Not two idle pacers. Merge after PASS+CI (gate A). Publish only after mill-gate D + `foundry gate`.
79
- - **Dispatch:** ticket + PR URLs + “Wear, then review.” The critic Reads `SEATS.md` Reviewer. Do not paste a command novel. When a law is spoken twice, encode it this wake.
80
- - **Cascade:** Chat is not the brain. A cascade that must survive compaction is a named repertoire signal on the stack overlay, hydrated onto the project law list. NOTES holds the same cascade for the second Read. Station stays the ticket. A reflection is not this capture. Capture priority: a law is an invariant you would otherwise re-read the source to relearn. One law per subsystem bone. Heat touches last_seen and does not append a confidence sample, so more hits do not raise conviction. Heat touches last_seen when the diary contains that signal's name or a local clause of four definition content words; two definition words are not a hit; the same words scattered through a long diary are not a hit; a weak session score is not lifted to 0.55 and a sample below 0.55 is not recorded. Constructing the organ does not append workspace samples. Hero names: `heat-is-not-conviction`, `inference-cycle-invariant`, `governance-vote-invariant`, `thin-dispatch-invariant`. Repertoire mergeStackOverlay refreshes a changed stack definition and keeps observation stats. A floor observation count does not change a route. Feedback moves conviction by a tenth, and a failure can leave 0.55. learned-conviction.json beside dest restores that average when a wake flattens it to 0.55. It does not store the observation count.
79
+ - **Dispatch:** ticket + PR URLs + “Wear, then review.” The critic Reads `grok-bot/OP-PROC.md` (team specifics live in `house/`). Do not paste a command novel. When a law is spoken twice, encode it this wake.
80
+ - **Cascade:** Chat is not the brain. A cascade that must survive compaction is a named repertoire signal on the stack overlay, hydrated onto the project law list. NOTES holds the same cascade for the second Read. Station stays the ticket. A reflection is not this capture. Memory scoring rules: [docs/memory-scoring.md](https://github.com/0xRayAI/xray/blob/main/docs/memory-scoring.md).
81
81
  - **Cold brief:** a new critic or any new subagent that does not already have this thread gets the latest commit SHA on the branch under review (fetch it; do not reuse an earlier SHA from a previous pass) and the Station card (`.xray/state/STATION.md`: intent, plan, git). If the card is missing, give branch + HEAD + what just changed. If the branch moves after you brief them, send the new SHA before they verdict.
82
82
  - **Control:** The lead keeps control. Do not assume the subagent has the context. Give the duty, the latest SHA, the Station card, and the laws that apply. The subagent wears the applicable 0xRay suit before it works: the tree under review, built and installed. An older published package is not that suit. The lead checks the result.
83
83
 
@@ -96,7 +96,7 @@ This suite is the engine that builds the engine. When a seat sees OP-PROC, write
96
96
 
97
97
  Operating planes: code, OP-PROC, model, suit, mill, host, and test/ship. Test/ship is the critical OP-PROC plane. Test then ship is the hero. Ship without that proof is the catastrophe. Long-term memory is the project law list. Each wake refreshes a changed stack definition and keeps observation stats. Heat writes the matched names onto Station, the short-term card that survives compaction. Reactive decisions move out of TypeScript into OP-PROC as the model improves. That move is why the mill and the suit exist. It is not fully proved. Once a version is live, the stamper strips every present-tense patch pin from shipped guides and shipped OP-PROC, or reconcile advances the next cut. The stamper does not edit Station, NOTES, dest, or node_modules. It does not publish. Do not freeze the live cut.
98
98
  - **Close:** loop until Station is done. Compact: Station survives the cut. Overlay dest names are OP-PROC — reload `repertoire-working.json` `opProcNames`, not Station.
99
- - **Board:** critic Strict comments; forge implements; lead stays main thread.
99
+ - **Board:** critic Strict comments; the implementer implements; lead stays main thread.
100
100
  - **Codex 69:** rewire this skill and existing ops. Do not add a new `SKILL.md` to hold the cadence.
101
- - **Ship matrix:** `LEAD-CADENCE.md` Decision matrix — A PR+CI · B pack · C `release:docs-check` (`reconcile --check`; no patch stamps on guides) · D `foundry release --i-mean-it`. Green CI is not ship. Spend / credentials stay Ask-first. Patch number lives in `package.json` + CHANGELOG.
101
+ - **Ship matrix:** `grok-bot/OP-PROC.md` Decision matrix (team specifics live in `house/`) — A PR+CI · B pack · C `release:docs-check` (`reconcile --check`; no patch stamps on guides) · D `foundry release --i-mean-it`. Green CI is not ship. Spend / credentials stay Ask-first. Patch number lives in `package.json` + CHANGELOG.
102
102
  - **Metamorphosis:** LLM → OP-PROC is in-context worn seats (same critic, same dummy, resume only). Not more bots.
@@ -96,7 +96,7 @@ codex_terms: [5, 7, 32] # Related Codex term numbers
96
96
  ```markdown
97
97
  ## What Next?
98
98
 
99
- - Related Codex terms: [codex.json](../../../../.xray/codex.json)
99
+ - Related Codex terms: [codex.json](../../../.xray/codex.json)
100
100
  - Next story to write: [suggestion]
101
101
  ```
102
102
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "./features.schema.json",
3
- "version": "4.0.26",
3
+ "version": "4.0.27",
4
4
  "description": "0xRay Framework - Unified Feature Configuration",
5
5
  "suit_temperament": {
6
6
  "profile": "auto",
package/AGENTS.md CHANGED
@@ -12,7 +12,7 @@ Quick reference for the xray AI orchestration framework (**4.0**).
12
12
 
13
13
  Before other work, Read `.xray/state/STATION.md`. Compaction and host change are the same cut. Continue the card. Do not restart the job. Grok does not inject the card (OpenCode does) — this Read is the Grok contract. Do not thicken the Grok exo.
14
14
 
15
- **Lead cadence:** a peer wearing this file + Station + Repertoire continues without a command stream. Dummy bodies test `SKILLS.md`. Same-sess bodies wear the suit and keep a Station card. Always branch + worktree + PR. Ship when mill-gate D + `foundry gate` PASS (`LEAD-CADENCE.md` Decision matrix) — green CI is not ship. npm OTP in a browser, then poll the new version before moving on. Loop until Station is done. Live ticks and moving workstreams — not idle pacers. Same critic (resume only). Disk SSOT: `grok-bot/ops/LEAD-CADENCE.md`. Playbook: `orchestrator` skill.
15
+ **Lead cadence:** a peer wearing this file + Station + Repertoire continues without a command stream. Dummy bodies test `SKILLS.md`. Same-sess bodies wear the suit and keep a Station card. Always branch + worktree + PR. Ship when mill-gate D + `foundry gate` PASS (`grok-bot/OP-PROC.md` Decision matrix) — green CI is not ship. npm OTP in a browser, then poll the new version before moving on. Loop until Station is done. Live ticks and moving workstreams — not idle pacers. Same critic (resume only). Disk SSOT: `grok-bot/OP-PROC.md` (team specifics live in `house/`). Playbook: `orchestrator` skill.
16
16
 
17
17
  ## What is xray?
18
18
 
package/README.md CHANGED
@@ -52,6 +52,7 @@ Docs: [guides/autonomy-command](docs-site/docs/guides/autonomy-command.md) · Sk
52
52
  | Version | Highlights |
53
53
  |---------|------------|
54
54
  | **Unreleased** | Fasten is **foundry-plant/0**: builtin plant is mill+inspect only. `foundry.json` `"plant": "@0xray/blip"` (aliases `"plant": "blip"` / `"plant": "sound"`) fastens whatever that mill declares (looker / vibe / mixer live in the mill). Nested mill `@0xray/foundry@0.1.12`. CLI shims `foundry blip\|sound` remain (0.1.11+). Shop plant first-class (`shop-extract`, `shop-witness`, `shop-pin` + `foundry.json` `shopPlant`). |
55
+ | **4.0.27** | Host compact proof needs a generation id and a numeric usage percent, and the same preCompact receipt is mirrored to nested consumer wear roots. Memory scoring: [docs/memory-scoring.md](docs/memory-scoring.md) (orchestrator links it). Companion `@0xray/grok-bot` 0.1.6: general page vs `house/` overlay, `templates/house/`, `grok-bot house init`, doctor `GROK_BOT_HOUSE` or walk-up. Not published. |
55
56
  | **4.0.9** | Mill target: postinstall does not mill npm global prefix or `_npx` as a consumer. Isolated HOME skips machine `~/.grok`. |
56
57
  | **4.0.0** | Exo + temperament. Constitution always on; ceremony by host. Repertoire organ on (vendored 0.2). Station card survives compact/host-swap. **On npm.** [vision](docs-site/docs/architecture/v4-vision.md) · [now](docs-site/docs/architecture/v4-now.md) |
57
58
  | **3.4.1** | Unified `install-bridges.cjs` on postinstall — OpenCode, Grok, Hermes, OpenClaw in one pass. All 7 MCPs servers via `npx -y 0xray mcp <cmd>` (no `dist/` paths). Canonical `release.mjs` pipeline. |
package/SKILLS.md CHANGED
@@ -76,7 +76,7 @@ xray ships 45 knowledge skills (`src/skills/<name>/SKILL.md`) as the **costume /
76
76
 
77
77
  | Skill | Agent | Description |
78
78
  |-------|-------|-------------|
79
- | `orchestrator` | @orchestrator | Multi-agent coordination + **lead-dev mode** (codex 67–68) + lead cadence (dispatch four lines; critic Reads SEATS; ship matrix A–D in `LEAD-CADENCE.md`) |
79
+ | `orchestrator` | @orchestrator | Multi-agent coordination + **lead-dev mode** (codex 67–68) + lead cadence (dispatch four lines; critic Reads `grok-bot/OP-PROC.md`; ship matrix A–D in `grok-bot/OP-PROC.md`; team specifics live in `house/`) |
80
80
  | `xray-orchestrator` | — | xray orchestration skill (MCP orchestrator surface) |
81
81
  | `processor-pipeline` | — | Data processing pipeline management |
82
82
  | `boot-orchestrator` | — | Framework boot orchestration |
package/dist/AGENTS.md CHANGED
@@ -12,7 +12,7 @@ Quick reference for the xray AI orchestration framework (**4.0**).
12
12
 
13
13
  Before other work, Read `.xray/state/STATION.md`. Compaction and host change are the same cut. Continue the card. Do not restart the job. Grok does not inject the card (OpenCode does) — this Read is the Grok contract. Do not thicken the Grok exo.
14
14
 
15
- **Lead cadence:** a peer wearing this file + Station + Repertoire continues without a command stream. Dummy bodies test `SKILLS.md`. Same-sess bodies wear the suit and keep a Station card. Always branch + worktree + PR. Ship when mill-gate D + `foundry gate` PASS (`LEAD-CADENCE.md` Decision matrix) — green CI is not ship. npm OTP in a browser, then poll the new version before moving on. Loop until Station is done. Live ticks and moving workstreams — not idle pacers. Same critic (resume only). Disk SSOT: `grok-bot/ops/LEAD-CADENCE.md`. Playbook: `orchestrator` skill.
15
+ **Lead cadence:** a peer wearing this file + Station + Repertoire continues without a command stream. Dummy bodies test `SKILLS.md`. Same-sess bodies wear the suit and keep a Station card. Always branch + worktree + PR. Ship when mill-gate D + `foundry gate` PASS (`grok-bot/OP-PROC.md` Decision matrix) — green CI is not ship. npm OTP in a browser, then poll the new version before moving on. Loop until Station is done. Live ticks and moving workstreams — not idle pacers. Same critic (resume only). Disk SSOT: `grok-bot/OP-PROC.md` (team specifics live in `house/`). Playbook: `orchestrator` skill.
16
16
 
17
17
  ## What is xray?
18
18
 
package/dist/CHANGELOG.md CHANGED
@@ -41,6 +41,32 @@ The format is based on [Conventional Commits](https://www.conventionalcommits.or
41
41
  - Archive root `integrations/` costume SKILL dump → `docs/archive/integrations-costume/`. Live wear is `src/integrations`.
42
42
  - Archive root `commands/` stale copy → `docs/archive/commands-copy/`. Live wear is `src/opencode/commands`.
43
43
 
44
+ ## [4.0.27] - 2026-09-25
45
+
46
+ Next patch after npm `4.0.26`. Released 2026-09-26.
47
+
48
+ A counted host compact needs a non-empty generation id and a numeric `context_usage_percent`. That hook line and per-session receipt are written on the suit mill and mirrored onto nested consumer wear roots. Memory scoring rules live in `docs/memory-scoring.md`. The orchestrator links that file and does not copy the rules. Companion package `@0xray/grok-bot@0.1.6`: one general operating page, a `house/` overlay that is not in that npm pack, `templates/house/` in the pack, `grok-bot house init` (copy, refuse to overwrite), and doctor lookup via `GROK_BOT_HOUSE` or a walk-up for `house/HOUSE.md`.
49
+
50
+ ### 🔄 Changes
51
+
52
+ ### 🐛 Bug Fixes
53
+ - fix: a host compact proof requires a non-empty generation id and a numeric context_usage_percent (d869cbf79)
54
+ - fix: mirror preCompact proof to nested consumer wear roots (16b7481af)
55
+
56
+ ### 📚 Documentation
57
+ - feat(grok-bot): house init and shared house lookup (#128) (0f93687f2)
58
+ - General operating page for grok-bot, with a fill-in house (#124) (17e02c5a7)
59
+ - docs: orchestrator links memory-scoring (#127) (bca04dba8)
60
+ - docs: add ben-proof suited compaction bench harness (13284b9d8)
61
+ - docs: core audit fixes and a readable memory-scoring doc (#126) (23b370d1e)
62
+ - docs: point 0xray at grok-bot/OP-PROC.md (#125) (53b1889dc)
63
+
64
+ ### 🔎 Other Changes
65
+ - docs(grok-bot): OP-PROC amendment (Blaze 10:31) + moltbook push allow (#123) (a2abed78c)
66
+ - docs(grok-bot): OP-PROC one-page front door + WAVEBOARD/ATTENTION_STATE mirror (#122) (519b2dae0)
67
+
68
+ ---
69
+
44
70
  ## [4.0.26] - 2026-09-25
45
71
 
46
72
  ### 🔄 Changes
package/dist/README.md CHANGED
@@ -52,6 +52,7 @@ Docs: [guides/autonomy-command](docs-site/docs/guides/autonomy-command.md) · Sk
52
52
  | Version | Highlights |
53
53
  |---------|------------|
54
54
  | **Unreleased** | Fasten is **foundry-plant/0**: builtin plant is mill+inspect only. `foundry.json` `"plant": "@0xray/blip"` (aliases `"plant": "blip"` / `"plant": "sound"`) fastens whatever that mill declares (looker / vibe / mixer live in the mill). Nested mill `@0xray/foundry@0.1.12`. CLI shims `foundry blip\|sound` remain (0.1.11+). Shop plant first-class (`shop-extract`, `shop-witness`, `shop-pin` + `foundry.json` `shopPlant`). |
55
+ | **4.0.27** | Host compact proof needs a generation id and a numeric usage percent, and the same preCompact receipt is mirrored to nested consumer wear roots. Memory scoring: [docs/memory-scoring.md](docs/memory-scoring.md) (orchestrator links it). Companion `@0xray/grok-bot` 0.1.6: general page vs `house/` overlay, `templates/house/`, `grok-bot house init`, doctor `GROK_BOT_HOUSE` or walk-up. Not published. |
55
56
  | **4.0.9** | Mill target: postinstall does not mill npm global prefix or `_npx` as a consumer. Isolated HOME skips machine `~/.grok`. |
56
57
  | **4.0.0** | Exo + temperament. Constitution always on; ceremony by host. Repertoire organ on (vendored 0.2). Station card survives compact/host-swap. **On npm.** [vision](docs-site/docs/architecture/v4-vision.md) · [now](docs-site/docs/architecture/v4-now.md) |
57
58
  | **3.4.1** | Unified `install-bridges.cjs` on postinstall — OpenCode, Grok, Hermes, OpenClaw in one pass. All 7 MCPs servers via `npx -y 0xray mcp <cmd>` (no `dist/` paths). Canonical `release.mjs` pipeline. |
package/dist/SKILLS.md CHANGED
@@ -76,7 +76,7 @@ xray ships 45 knowledge skills (`src/skills/<name>/SKILL.md`) as the **costume /
76
76
 
77
77
  | Skill | Agent | Description |
78
78
  |-------|-------|-------------|
79
- | `orchestrator` | @orchestrator | Multi-agent coordination + **lead-dev mode** (codex 67–68) + lead cadence (dispatch four lines; critic Reads SEATS; ship matrix A–D in `LEAD-CADENCE.md`) |
79
+ | `orchestrator` | @orchestrator | Multi-agent coordination + **lead-dev mode** (codex 67–68) + lead cadence (dispatch four lines; critic Reads `grok-bot/OP-PROC.md`; ship matrix A–D in `grok-bot/OP-PROC.md`; team specifics live in `house/`) |
80
80
  | `xray-orchestrator` | — | xray orchestration skill (MCP orchestrator surface) |
81
81
  | `processor-pipeline` | — | Data processing pipeline management |
82
82
  | `boot-orchestrator` | — | Framework boot orchestration |
@@ -25,7 +25,7 @@ Copy the consumer template from `src/integrations/cursor/hooks/hooks.json` and t
25
25
 
26
26
  `preCompact` labels `event_class`:
27
27
 
28
- - `cursor-host-precompact` — Cursor actually fired the hook
28
+ - `cursor-host-precompact` — Cursor actually fired the hook. The event must carry a non-empty `generation_id` and a numeric `context_usage_percent`, plus the hook name or trigger. A token count or `trigger: auto` alone stays synthetic and does not write `cursor-hook.log` or `cursor-receipts/<sessionId>.json`.
29
29
  - `cursor-precompact-synthetic` — script invoked with `--event-class=cursor-precompact-synthetic` (Path C fallback)
30
30
  - `cursor-host-precompact-FAIL` — HOST-FIRE fill ran; host did not spawn `preCompact` (see `RECEIPT-HOST-PRECOMPACT.md`, `-2.md`, `-3.md`)
31
31
  - First live host fire (Arm S): `examples/killer-dual/RECEIPT-HOST-PRECOMPACT.md`
@@ -44,6 +44,8 @@ Host `preCompact` fire is counted from `.xray/state/cursor-hook-invoke.log` (`ev
44
44
 
45
45
  A cut counts only when `.xray/state/cursor-receipts/<sessionId>.json` exists **and** `.xray/state/cursor-hook.log` contains a line with that same session id (timestamp, `context_tokens`, `context_usage_percent`, `context_window_size`, `generation_id`). `probeLogExists` is true only when that append succeeded. `.xray/state/cursor-usage-receipt.json` and `cursor-precompact.json` keep only the newest event. That single latest json is not enough — the next arm overwrites it.
46
46
 
47
+ Nested consumer benches under `examples/` (e.g. `examples/ben-proof/suited` with local `node_modules/0xray`) receive the same hook log line and per-session receipt as the mill — `preCompact` has no Read paths, so those wear roots are discovered from the suit mill at compact time.
48
+
47
49
  Arm S landscape + receipt: `examples/killer-dual/`.
48
50
 
49
51
  ## Friend test
@@ -187,6 +187,73 @@ export function cursorHeatRoots(event = {}) {
187
187
  return out;
188
188
  }
189
189
 
190
+ function isNestedConsumerWearRoot(root, millRoot) {
191
+ if (!root || !millRoot) return false;
192
+ const resolved = path.resolve(String(root));
193
+ const millResolved = path.resolve(String(millRoot));
194
+ if (resolved === millResolved) return false;
195
+ if (!heatRootHasCard(resolved) || !isHeatRootWritable(resolved)) return false;
196
+ const wornRay = path.join(resolved, 'node_modules', '0xray', 'package.json');
197
+ if (!fs.existsSync(wornRay)) return false;
198
+ if (!resolved.startsWith(millResolved + path.sep)) return false;
199
+ return true;
200
+ }
201
+
202
+ /**
203
+ * Nested consumer benches (e.g. examples/ben-proof/suited) wear 0xray locally.
204
+ * preCompact stdin has no Read paths, so cursorHeatRoots never visits those dirs.
205
+ */
206
+ export function discoverNestedConsumerWearRoots(millRoot) {
207
+ const millResolved = path.resolve(String(millRoot));
208
+ if (packageNameAt(millResolved) !== '0xray') return [];
209
+ const out = [];
210
+ const seen = new Set();
211
+ const queue = [path.join(millResolved, 'examples')];
212
+ let steps = 0;
213
+ while (queue.length > 0 && steps < 500) {
214
+ steps += 1;
215
+ const dir = queue.shift();
216
+ if (!dir || !fs.existsSync(dir)) continue;
217
+ let entries;
218
+ try {
219
+ entries = fs.readdirSync(dir, { withFileTypes: true });
220
+ } catch {
221
+ continue;
222
+ }
223
+ for (const ent of entries) {
224
+ if (!ent.isDirectory()) continue;
225
+ if (ent.name === 'node_modules' || ent.name === '.git' || ent.name === 'dist') continue;
226
+ const full = path.join(dir, ent.name);
227
+ if (isNestedConsumerWearRoot(full, millResolved) && !seen.has(full)) {
228
+ seen.add(full);
229
+ out.push(full);
230
+ }
231
+ queue.push(full);
232
+ }
233
+ }
234
+ return out;
235
+ }
236
+
237
+ /** Mill heat roots plus nested consumer wear sites that share the same compact proof. */
238
+ export function cursorCompactProofRoots(event = {}) {
239
+ const seen = new Set();
240
+ const out = [];
241
+ for (const root of cursorHeatRoots(event)) {
242
+ const resolved = path.resolve(String(root));
243
+ if (seen.has(resolved)) continue;
244
+ seen.add(resolved);
245
+ out.push(resolved);
246
+ if (packageNameAt(resolved) !== '0xray') continue;
247
+ for (const worn of discoverNestedConsumerWearRoots(resolved)) {
248
+ const wornResolved = path.resolve(String(worn));
249
+ if (seen.has(wornResolved)) continue;
250
+ seen.add(wornResolved);
251
+ out.push(wornResolved);
252
+ }
253
+ }
254
+ return out;
255
+ }
256
+
190
257
  function packageNameAt(root) {
191
258
  try {
192
259
  const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
@@ -209,6 +276,7 @@ export function cursorGateRoot(heatRoots, eventRoot) {
209
276
  export function cursorSessionId(event = {}) {
210
277
  return (
211
278
  event.conversation_id ||
279
+ event.conversationId ||
212
280
  event.session_id ||
213
281
  event.sessionId ||
214
282
  process.env.CURSOR_CONVERSATION_ID ||
@@ -263,13 +331,15 @@ export function classifyPreCompactEvent(event = {}, argv = process.argv) {
263
331
  if (fromEvent) return fromEvent;
264
332
 
265
333
  const named = event.hook_event_name || event.hookEventName || event.hook;
266
- const looksHost =
267
- named === 'preCompact' ||
268
- named === 'pre_compact' ||
269
- event.trigger === 'auto' ||
270
- event.trigger === 'manual' ||
271
- typeof event.context_tokens === 'number' ||
272
- typeof event.context_usage_percent === 'number';
334
+ const hookNamed = named === 'preCompact' || named === 'pre_compact';
335
+ const triggerNamed = event.trigger === 'auto' || event.trigger === 'manual';
336
+ const generation = event.generation_id || event.generationId;
337
+ const hasGeneration = typeof generation === 'string' && generation.trim().length > 0;
338
+ const hasPercent = typeof event.context_usage_percent === 'number';
339
+ // A token count or trigger alone is not a host fire. The 2026-09-25 20:28
340
+ // line had context_tokens 120000 and window 200000 with no generation id,
341
+ // no usage percent, and no preCompact invoke.
342
+ const looksHost = (hookNamed || triggerNamed) && hasGeneration && hasPercent;
273
343
  return looksHost ? EVENT_CLASS_HOST : EVENT_CLASS_SYNTHETIC;
274
344
  }
275
345
 
@@ -10,8 +10,9 @@ import {
10
10
  buildSessionBootPayload,
11
11
  classifyPreCompactEvent,
12
12
  cursorGenerationId,
13
- cursorHeatRoots,
13
+ cursorCompactProofRoots,
14
14
  cursorSessionId,
15
+ EVENT_CLASS_HOST,
15
16
  cursorWorkspaceRoot,
16
17
  readStdinJson,
17
18
  writeCursorPrecompactReceipt,
@@ -124,7 +125,7 @@ async function main() {
124
125
  } catch {
125
126
  plates = null;
126
127
  }
127
- for (const root of cursorHeatRoots(event)) {
128
+ for (const root of cursorCompactProofRoots(event)) {
128
129
  const payload = buildSessionBootPayload(root, '0xray/cursor-compact', {
129
130
  host: 'cursor',
130
131
  hookEvent: 'pre_compact',
@@ -135,16 +136,19 @@ async function main() {
135
136
  bootPath = writeSessionBoot(root, payload);
136
137
  stationLine = payload.stationLine;
137
138
  const stampedAt = new Date().toISOString();
138
- const proofLogged = appendCursorCompactProofLog(root, {
139
- sessionId,
140
- timestamp: stampedAt,
141
- context_tokens: typeof event.context_tokens === 'number' ? event.context_tokens : null,
142
- context_usage_percent:
143
- typeof event.context_usage_percent === 'number' ? event.context_usage_percent : null,
144
- context_window_size:
145
- typeof event.context_window_size === 'number' ? event.context_window_size : null,
146
- generation_id: generationId,
147
- });
139
+ const hostProof = eventClass === EVENT_CLASS_HOST;
140
+ const proofLogged = hostProof
141
+ ? appendCursorCompactProofLog(root, {
142
+ sessionId,
143
+ timestamp: stampedAt,
144
+ context_tokens: typeof event.context_tokens === 'number' ? event.context_tokens : null,
145
+ context_usage_percent:
146
+ typeof event.context_usage_percent === 'number' ? event.context_usage_percent : null,
147
+ context_window_size:
148
+ typeof event.context_window_size === 'number' ? event.context_window_size : null,
149
+ generation_id: generationId,
150
+ })
151
+ : false;
148
152
  receiptPath = writeCursorPrecompactReceipt(root, {
149
153
  event_class: eventClass,
150
154
  hookEvent: 'pre_compact',
@@ -166,10 +170,12 @@ async function main() {
166
170
  probeLogExists: proofLogged,
167
171
  usage: hostUsageFromPreCompactEvent(event),
168
172
  });
169
- writeCursorSessionReceipt(root, sessionId, {
170
- precompactPath: receiptPath,
171
- usagePath,
172
- });
173
+ if (hostProof) {
174
+ writeCursorSessionReceipt(root, sessionId, {
175
+ precompactPath: receiptPath,
176
+ usagePath,
177
+ });
178
+ }
173
179
  if (plates) {
174
180
  try {
175
181
  const named = plates.recallPlate(payload.intent || intent || '');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xray-pre-tool",
3
- "version": "4.0.26",
3
+ "version": "4.0.27",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "0xRay constitution + temperament PreToolUse for OpenClaw",
@@ -62,7 +62,7 @@ Config: `features.json` → `multi_agent_orchestration.lead_dev_mode`
62
62
 
63
63
  ## Lead cadence (syncopation)
64
64
 
65
- The seven rules are the engine. The cadence is the time signature. Disk SSOT: `grok-bot/ops/LEAD-CADENCE.md`.
65
+ The seven rules are the engine. The cadence is the time signature. Disk SSOT: `grok-bot/OP-PROC.md` (team specifics live in `house/`).
66
66
 
67
67
  Jargon is not the job. Review and cadence ask whether the change works. Do not spend the loop reciting dest names, mill liturgy, or host mantras.
68
68
 
@@ -76,8 +76,8 @@ Jargon is not the job. Review and cadence ask whether the change works. Do not s
76
76
  - **Peer boot:** four-line dispatch. They Read Station + this cadence and install without a command novel. Not a twin critic.
77
77
  - **Live tick, not pacer:** `/loop` runs work now. Keep workstreams moving. Do not idle-wait 12 minutes. **Clean ticks every cycle** — unsubscribe then resubscribe so the prompt matches metal. Name-dedupe does not rewrite. A stale prompt (waiting URL after live, Hold after strip) is dirty: rewrite, do not act. **If the card and WAVEBOARD are idle, unsubscribe and do not resubscribe.**
78
78
  - **Board clock:** PR events + resume the same critic. Not two idle pacers. Merge after PASS+CI (gate A). Publish only after mill-gate D + `foundry gate`.
79
- - **Dispatch:** ticket + PR URLs + “Wear, then review.” The critic Reads `SEATS.md` Reviewer. Do not paste a command novel. When a law is spoken twice, encode it this wake.
80
- - **Cascade:** Chat is not the brain. A cascade that must survive compaction is a named repertoire signal on the stack overlay, hydrated onto the project law list. NOTES holds the same cascade for the second Read. Station stays the ticket. A reflection is not this capture. Capture priority: a law is an invariant you would otherwise re-read the source to relearn. One law per subsystem bone. Heat touches last_seen and does not append a confidence sample, so more hits do not raise conviction. Heat touches last_seen when the diary contains that signal's name or a local clause of four definition content words; two definition words are not a hit; the same words scattered through a long diary are not a hit; a weak session score is not lifted to 0.55 and a sample below 0.55 is not recorded. Constructing the organ does not append workspace samples. Hero names: `heat-is-not-conviction`, `inference-cycle-invariant`, `governance-vote-invariant`, `thin-dispatch-invariant`. Repertoire mergeStackOverlay refreshes a changed stack definition and keeps observation stats. A floor observation count does not change a route. Feedback moves conviction by a tenth, and a failure can leave 0.55. learned-conviction.json beside dest restores that average when a wake flattens it to 0.55. It does not store the observation count.
79
+ - **Dispatch:** ticket + PR URLs + “Wear, then review.” The critic Reads `grok-bot/OP-PROC.md` (team specifics live in `house/`). Do not paste a command novel. When a law is spoken twice, encode it this wake.
80
+ - **Cascade:** Chat is not the brain. A cascade that must survive compaction is a named repertoire signal on the stack overlay, hydrated onto the project law list. NOTES holds the same cascade for the second Read. Station stays the ticket. A reflection is not this capture. Memory scoring rules: [docs/memory-scoring.md](https://github.com/0xRayAI/xray/blob/main/docs/memory-scoring.md).
81
81
  - **Cold brief:** a new critic or any new subagent that does not already have this thread gets the latest commit SHA on the branch under review (fetch it; do not reuse an earlier SHA from a previous pass) and the Station card (`.xray/state/STATION.md`: intent, plan, git). If the card is missing, give branch + HEAD + what just changed. If the branch moves after you brief them, send the new SHA before they verdict.
82
82
  - **Control:** The lead keeps control. Do not assume the subagent has the context. Give the duty, the latest SHA, the Station card, and the laws that apply. The subagent wears the applicable 0xRay suit before it works: the tree under review, built and installed. An older published package is not that suit. The lead checks the result.
83
83
 
@@ -96,7 +96,7 @@ This suite is the engine that builds the engine. When a seat sees OP-PROC, write
96
96
 
97
97
  Operating planes: code, OP-PROC, model, suit, mill, host, and test/ship. Test/ship is the critical OP-PROC plane. Test then ship is the hero. Ship without that proof is the catastrophe. Long-term memory is the project law list. Each wake refreshes a changed stack definition and keeps observation stats. Heat writes the matched names onto Station, the short-term card that survives compaction. Reactive decisions move out of TypeScript into OP-PROC as the model improves. That move is why the mill and the suit exist. It is not fully proved. Once a version is live, the stamper strips every present-tense patch pin from shipped guides and shipped OP-PROC, or reconcile advances the next cut. The stamper does not edit Station, NOTES, dest, or node_modules. It does not publish. Do not freeze the live cut.
98
98
  - **Close:** loop until Station is done. Compact: Station survives the cut. Overlay dest names are OP-PROC — reload `repertoire-working.json` `opProcNames`, not Station.
99
- - **Board:** critic Strict comments; forge implements; lead stays main thread.
99
+ - **Board:** critic Strict comments; the implementer implements; lead stays main thread.
100
100
  - **Codex 69:** rewire this skill and existing ops. Do not add a new `SKILL.md` to hold the cadence.
101
- - **Ship matrix:** `LEAD-CADENCE.md` Decision matrix — A PR+CI · B pack · C `release:docs-check` (`reconcile --check`; no patch stamps on guides) · D `foundry release --i-mean-it`. Green CI is not ship. Spend / credentials stay Ask-first. Patch number lives in `package.json` + CHANGELOG.
101
+ - **Ship matrix:** `grok-bot/OP-PROC.md` Decision matrix (team specifics live in `house/`) — A PR+CI · B pack · C `release:docs-check` (`reconcile --check`; no patch stamps on guides) · D `foundry release --i-mean-it`. Green CI is not ship. Spend / credentials stay Ask-first. Patch number lives in `package.json` + CHANGELOG.
102
102
  - **Metamorphosis:** LLM → OP-PROC is in-context worn seats (same critic, same dummy, resume only). Not more bots.
@@ -96,7 +96,7 @@ codex_terms: [5, 7, 32] # Related Codex term numbers
96
96
  ```markdown
97
97
  ## What Next?
98
98
 
99
- - Related Codex terms: [codex.json](../../../../.xray/codex.json)
99
+ - Related Codex terms: [codex.json](../../../.xray/codex.json)
100
100
  - Next story to write: [suggestion]
101
101
  ```
102
102
 
package/llms.txt CHANGED
@@ -8,7 +8,10 @@ Default consumer wear is **mill plant** (`mill` + `inspect`), not a 45-skill / 4
8
8
 
9
9
  ## Wear (what a stranger gets)
10
10
 
11
- - `npm install 0xray` — postinstall fastens mill+inspect, writes 7 MCP `.mcp.json`, four host bridges (OpenCode, Grok, Hermes, OpenClaw) plus Cursor `.cursor/hooks.json`, overlays their plant. Grok last-mile dest is project `.grok/plugins/0xray`. Shared HOME does not last-wins clobber machine `~/.grok/plugins/0xray`. Isolated HOME must not write the machine plugin. Does **not** write consumer-root `SKILLS.md`. Lead cadence: `grok-bot/ops/LEAD-CADENCE.md` — a peer continues from Station + Repertoire; dummy tests `SKILLS.md`; same-sess wear; branch/PR; OTP then poll; loop until Station; live ticks, not idle pacers.
11
+ - `npm install 0xray` — postinstall fastens mill+inspect, writes 7 MCP `.mcp.json`, four host bridges (OpenCode, Grok, Hermes, OpenClaw) plus Cursor `.cursor/hooks.json`, overlays their plant. Grok last-mile dest is project `.grok/plugins/0xray`. Shared HOME does not last-wins clobber machine `~/.grok/plugins/0xray`. Isolated HOME must not write the machine plugin. Does **not** write consumer-root `SKILLS.md`. Lead cadence: `grok-bot/OP-PROC.md` (team specifics live in `house/`) — a peer continues from Station + Repertoire; dummy tests `SKILLS.md`; same-sess wear; branch/PR; OTP then poll; loop until Station; live ticks, not idle pacers.
12
+ - Memory scoring rules: [docs/memory-scoring.md](docs/memory-scoring.md). The orchestrator links that file. It does not copy the rules.
13
+ - Host `preCompact` writes the hook line and per-session receipt on the suit mill and on nested consumer wear roots (a bench with local `node_modules/0xray`). A counted cut needs a non-empty generation id and a numeric usage percent.
14
+ - `@0xray/grok-bot`: the general page is `grok-bot/OP-PROC.md`. The team overlay is `house/` and is not in that npm pack. `templates/house/` ships. `grok-bot house init` copies the template and refuses to overwrite. Doctor uses `GROK_BOT_HOUSE` when set, otherwise walks up from the working directory for `house/HOUSE.md`.
12
15
 
13
16
  - `npx @0xray/foundry mint --skip-live` — re-fasten mill plant, then inspect.
14
17
  - `npx @0xray/foundry inspect --skip-live` — plant-vs-worn, receipt, CI. Chat is not a receipt.
@@ -58,5 +61,6 @@ Not an 8th `xray-*` server. **Repertoire is preferred** — vendored 0.2.8 ships
58
61
  - [SKILLS.md](SKILLS.md) — catalog (costume / self-plant, not default sync)
59
62
  - [Foundry](docs-site/docs/architecture/v4-foundry.md) — mill vs exo, foundry-plant/0, shopPlant
60
63
  - [Features since 3.1](docs-site/docs/guides/features-since-3.1.md)
64
+ - [Memory scoring](docs/memory-scoring.md)
61
65
 
62
66
  Playwright / UI: n/a. This mill is CLI.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0xray",
3
- "version": "4.0.26",
3
+ "version": "4.0.27",
4
4
  "description": "Multi-agent orchestration and Codex governance for OpenCode, Hermes, Grok Build, and OpenClaw",
5
5
  "readme": "README.md",
6
6
  "license": "MIT",
@@ -80,8 +80,9 @@
80
80
  "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",
81
81
  "test:processors": "npm test -- src/__tests__/unit/processor-activation.test.ts src/__tests__/unit/typescript-compilation-processor.test.ts",
82
82
  "test:miscellaneous": "npm test -- src/__tests__/unit/blocked-test.test.ts",
83
+ "test:grok-bot": "npm test -- src/__tests__/unit/grok-bot-seat-doctor.test.ts src/__tests__/unit/grok-bot-op-proc-map.test.ts src/__tests__/unit/lead-cadence.test.ts src/__tests__/unit/grok-bot-auto-review-policy.test.ts",
83
84
  "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",
84
- "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 && npm test -- src/__tests__/unit/llm-governance-provider.test.ts src/__tests__/unit/mcp-server-smoke.test.ts src/__tests__/unit/cursor-hooks.test.ts src/__tests__/unit/host-vs-mill-score.test.ts",
85
+ "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 && npm test -- src/__tests__/unit/llm-governance-provider.test.ts src/__tests__/unit/mcp-server-smoke.test.ts src/__tests__/unit/cursor-hooks.test.ts src/__tests__/unit/host-vs-mill-score.test.ts && npm run test:grok-bot",
85
86
  "test:integration-all": "npm test -- src/__tests__/integration/",
86
87
  "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",
87
88
  "test:agents-all": "echo 'Legacy agents test entry retired'",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xray-pre-tool",
3
- "version": "4.0.26",
3
+ "version": "4.0.27",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "0xRay constitution + temperament PreToolUse for OpenClaw",
@@ -62,7 +62,7 @@ Config: `features.json` → `multi_agent_orchestration.lead_dev_mode`
62
62
 
63
63
  ## Lead cadence (syncopation)
64
64
 
65
- The seven rules are the engine. The cadence is the time signature. Disk SSOT: `grok-bot/ops/LEAD-CADENCE.md`.
65
+ The seven rules are the engine. The cadence is the time signature. Disk SSOT: `grok-bot/OP-PROC.md` (team specifics live in `house/`).
66
66
 
67
67
  Jargon is not the job. Review and cadence ask whether the change works. Do not spend the loop reciting dest names, mill liturgy, or host mantras.
68
68
 
@@ -76,8 +76,8 @@ Jargon is not the job. Review and cadence ask whether the change works. Do not s
76
76
  - **Peer boot:** four-line dispatch. They Read Station + this cadence and install without a command novel. Not a twin critic.
77
77
  - **Live tick, not pacer:** `/loop` runs work now. Keep workstreams moving. Do not idle-wait 12 minutes. **Clean ticks every cycle** — unsubscribe then resubscribe so the prompt matches metal. Name-dedupe does not rewrite. A stale prompt (waiting URL after live, Hold after strip) is dirty: rewrite, do not act. **If the card and WAVEBOARD are idle, unsubscribe and do not resubscribe.**
78
78
  - **Board clock:** PR events + resume the same critic. Not two idle pacers. Merge after PASS+CI (gate A). Publish only after mill-gate D + `foundry gate`.
79
- - **Dispatch:** ticket + PR URLs + “Wear, then review.” The critic Reads `SEATS.md` Reviewer. Do not paste a command novel. When a law is spoken twice, encode it this wake.
80
- - **Cascade:** Chat is not the brain. A cascade that must survive compaction is a named repertoire signal on the stack overlay, hydrated onto the project law list. NOTES holds the same cascade for the second Read. Station stays the ticket. A reflection is not this capture. Capture priority: a law is an invariant you would otherwise re-read the source to relearn. One law per subsystem bone. Heat touches last_seen and does not append a confidence sample, so more hits do not raise conviction. Heat touches last_seen when the diary contains that signal's name or a local clause of four definition content words; two definition words are not a hit; the same words scattered through a long diary are not a hit; a weak session score is not lifted to 0.55 and a sample below 0.55 is not recorded. Constructing the organ does not append workspace samples. Hero names: `heat-is-not-conviction`, `inference-cycle-invariant`, `governance-vote-invariant`, `thin-dispatch-invariant`. Repertoire mergeStackOverlay refreshes a changed stack definition and keeps observation stats. A floor observation count does not change a route. Feedback moves conviction by a tenth, and a failure can leave 0.55. learned-conviction.json beside dest restores that average when a wake flattens it to 0.55. It does not store the observation count.
79
+ - **Dispatch:** ticket + PR URLs + “Wear, then review.” The critic Reads `grok-bot/OP-PROC.md` (team specifics live in `house/`). Do not paste a command novel. When a law is spoken twice, encode it this wake.
80
+ - **Cascade:** Chat is not the brain. A cascade that must survive compaction is a named repertoire signal on the stack overlay, hydrated onto the project law list. NOTES holds the same cascade for the second Read. Station stays the ticket. A reflection is not this capture. Memory scoring rules: [docs/memory-scoring.md](https://github.com/0xRayAI/xray/blob/main/docs/memory-scoring.md).
81
81
  - **Cold brief:** a new critic or any new subagent that does not already have this thread gets the latest commit SHA on the branch under review (fetch it; do not reuse an earlier SHA from a previous pass) and the Station card (`.xray/state/STATION.md`: intent, plan, git). If the card is missing, give branch + HEAD + what just changed. If the branch moves after you brief them, send the new SHA before they verdict.
82
82
  - **Control:** The lead keeps control. Do not assume the subagent has the context. Give the duty, the latest SHA, the Station card, and the laws that apply. The subagent wears the applicable 0xRay suit before it works: the tree under review, built and installed. An older published package is not that suit. The lead checks the result.
83
83
 
@@ -96,7 +96,7 @@ This suite is the engine that builds the engine. When a seat sees OP-PROC, write
96
96
 
97
97
  Operating planes: code, OP-PROC, model, suit, mill, host, and test/ship. Test/ship is the critical OP-PROC plane. Test then ship is the hero. Ship without that proof is the catastrophe. Long-term memory is the project law list. Each wake refreshes a changed stack definition and keeps observation stats. Heat writes the matched names onto Station, the short-term card that survives compaction. Reactive decisions move out of TypeScript into OP-PROC as the model improves. That move is why the mill and the suit exist. It is not fully proved. Once a version is live, the stamper strips every present-tense patch pin from shipped guides and shipped OP-PROC, or reconcile advances the next cut. The stamper does not edit Station, NOTES, dest, or node_modules. It does not publish. Do not freeze the live cut.
98
98
  - **Close:** loop until Station is done. Compact: Station survives the cut. Overlay dest names are OP-PROC — reload `repertoire-working.json` `opProcNames`, not Station.
99
- - **Board:** critic Strict comments; forge implements; lead stays main thread.
99
+ - **Board:** critic Strict comments; the implementer implements; lead stays main thread.
100
100
  - **Codex 69:** rewire this skill and existing ops. Do not add a new `SKILL.md` to hold the cadence.
101
- - **Ship matrix:** `LEAD-CADENCE.md` Decision matrix — A PR+CI · B pack · C `release:docs-check` (`reconcile --check`; no patch stamps on guides) · D `foundry release --i-mean-it`. Green CI is not ship. Spend / credentials stay Ask-first. Patch number lives in `package.json` + CHANGELOG.
101
+ - **Ship matrix:** `grok-bot/OP-PROC.md` Decision matrix (team specifics live in `house/`) — A PR+CI · B pack · C `release:docs-check` (`reconcile --check`; no patch stamps on guides) · D `foundry release --i-mean-it`. Green CI is not ship. Spend / credentials stay Ask-first. Patch number lives in `package.json` + CHANGELOG.
102
102
  - **Metamorphosis:** LLM → OP-PROC is in-context worn seats (same critic, same dummy, resume only). Not more bots.
@@ -96,7 +96,7 @@ codex_terms: [5, 7, 32] # Related Codex term numbers
96
96
  ```markdown
97
97
  ## What Next?
98
98
 
99
- - Related Codex terms: [codex.json](../../../../.xray/codex.json)
99
+ - Related Codex terms: [codex.json](../../../.xray/codex.json)
100
100
  - Next story to write: [suggestion]
101
101
  ```
102
102
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "./features.schema.json",
3
- "version": "4.0.26",
3
+ "version": "4.0.27",
4
4
  "description": "0xRay Framework - Unified Feature Configuration",
5
5
  "suit_temperament": {
6
6
  "profile": "auto",