0xray 4.0.39 → 4.0.41

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 (71) hide show
  1. package/.grok-plugin/plugin.json +1 -1
  2. package/.xray/features.json +1 -1
  3. package/dist/CHANGELOG.md +29 -0
  4. package/dist/integrations/grok/hooks/grok-hook-utils.js +21 -1
  5. package/dist/integrations/grok/hooks/session-start.js +2 -20
  6. package/dist/integrations/hooks/goggles-mcp.mjs +36 -4
  7. package/dist/integrations/hooks/goggles-pipeline.mjs +55 -15
  8. package/dist/integrations/hooks/goggles-planes.json +10 -4
  9. package/dist/integrations/hooks/plates.cjs +22 -0
  10. package/dist/integrations/hooks/session-note-index.cjs +298 -0
  11. package/dist/integrations/hooks/session-note-index.mjs +22 -0
  12. package/dist/integrations/hooks/sleeve.cjs +335 -0
  13. package/dist/integrations/hooks/sleeve.mjs +18 -0
  14. package/dist/integrations/hooks/station-hook-runtime.cjs +205 -9
  15. package/dist/integrations/hooks/wake-cascade.cjs +102 -0
  16. package/dist/integrations/hooks/wake-cascade.mjs +16 -0
  17. package/dist/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
  18. package/dist/memory-routing/plates.d.ts +1 -1
  19. package/dist/memory-routing/plates.js +1 -0
  20. package/docs-site/docs/plates/activity-log.md +1 -1
  21. package/docs-site/docs/plates/boot.md +2 -0
  22. package/docs-site/docs/plates/centrifuge.md +30 -0
  23. package/docs-site/docs/plates/cursor-compact.md +1 -1
  24. package/docs-site/docs/plates/glossary.md +1 -2
  25. package/docs-site/docs/plates/goggles.md +4 -0
  26. package/docs-site/docs/plates/governance.md +2 -0
  27. package/docs-site/docs/plates/grok-compact.md +1 -1
  28. package/docs-site/docs/plates/grokbot.md +1 -1
  29. package/docs-site/docs/plates/host-pack.md +2 -0
  30. package/docs-site/docs/plates/house.md +1 -1
  31. package/docs-site/docs/plates/index.md +4 -2
  32. package/docs-site/docs/plates/inference-files.md +1 -1
  33. package/docs-site/docs/plates/kept-line.md +1 -1
  34. package/docs-site/docs/plates/kits.md +2 -0
  35. package/docs-site/docs/plates/lens-gate.md +1 -1
  36. package/docs-site/docs/plates/lens-page.md +1 -1
  37. package/docs-site/docs/plates/live-mesh.md +41 -0
  38. package/docs-site/docs/plates/memory-recall.md +4 -0
  39. package/docs-site/docs/plates/notes-page.md +2 -1
  40. package/docs-site/docs/plates/orchestration.md +2 -0
  41. package/docs-site/docs/plates/package-face.md +1 -1
  42. package/docs-site/docs/plates/payload-heat.md +1 -1
  43. package/docs-site/docs/plates/pickup-stamp.md +1 -1
  44. package/docs-site/docs/plates/pre-tool.md +1 -1
  45. package/docs-site/docs/plates/processor.md +2 -0
  46. package/docs-site/docs/plates/record-map.md +2 -1
  47. package/docs-site/docs/plates/reflection-page.md +1 -1
  48. package/docs-site/docs/plates/reporting.md +2 -0
  49. package/docs-site/docs/plates/review.md +1 -1
  50. package/docs-site/docs/plates/routing.md +2 -0
  51. package/docs-site/docs/plates/session-capture.md +1 -1
  52. package/docs-site/docs/plates/site-manual.md +1 -1
  53. package/docs-site/docs/plates/stamp-plate.md +1 -1
  54. package/docs-site/docs/plates/station-card.md +4 -1
  55. package/docs-site/docs/plates/station-heat.md +1 -1
  56. package/docs-site/docs/plates/suit-organs.md +1 -1
  57. package/docs-site/docs/plates/suit-settings.md +1 -1
  58. package/docs-site/docs/plates/suit-wear.md +3 -1
  59. package/docs-site/docs/plates/suit.md +2 -0
  60. package/docs-site/docs/plates/trail-state.md +1 -1
  61. package/docs-site/docs/plates/work-fresh.md +1 -1
  62. package/docs-site/docs/plates/write-home.md +1 -1
  63. package/package.json +2 -1
  64. package/scripts/node/bridge-mcp-wiring.cjs +37 -4
  65. package/scripts/node/install-bridges.cjs +172 -19
  66. package/scripts/node/playwright-smoke-server.cjs +27 -0
  67. package/scripts/node/setup.cjs +2 -46
  68. package/src/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
  69. package/vendor/@0xray/repertoire/dist/orchestrator-bridge/RepertoireOrchestratorBridge.js +4 -1
  70. package/vendor/@0xray/repertoire/dist/paths.js +3 -0
  71. package/xray/features.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0xray",
3
- "version": "4.0.39",
3
+ "version": "4.0.41",
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",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "./features.schema.json",
3
- "version": "4.0.39",
3
+ "version": "4.0.41",
4
4
  "description": "0xRay Framework - Unified Feature Configuration",
5
5
  "suit_temperament": {
6
6
  "profile": "auto",
package/dist/CHANGELOG.md CHANGED
@@ -42,6 +42,35 @@ The format is based on [Conventional Commits](https://www.conventionalcommits.or
42
42
  - Archive root `integrations/` costume SKILL dump → `docs/archive/integrations-costume/`. Live wear is `src/integrations`.
43
43
  - Archive root `commands/` stale copy → `docs/archive/commands-copy/`. Live wear is `src/opencode/commands`.
44
44
 
45
+ ## [4.0.41] - 2026-10-07
46
+
47
+ ### 🔄 Changes
48
+
49
+ - Wake cascade. Station and the notes page stay on the station module. Heat writes `Cascade: record-map · notes N current` on the card. A memory-recall look returns that plane, the matched law names, and the current lines from the session-note index beside the laws.
50
+ - Session notes sit in `.xray/state/repertoire/session-notes.json` beside the laws. A replaced note stays history. The short index returns the current line. A stale page does not revive a replaced line.
51
+ - `Sleeve: on` means the previous ticket came back, the worn plate matched the package, the previous ticket matched the working record, and inspect passed. Session start and compact run that check. The card keeps the named plane. Judgement is continue, retry N, stop, or start. The same miss keeps its retry. A different ticket stops. Payments is on only when the ticket is a payment.
52
+ - A fresh wear fastens mill and inspect. The durable copy is staged beside the live wear. Hooks and MCP launchers are not pinned at a temporary checkout.
53
+ - Goggles. A checkout named `0xray` records `scripts/mjs/run-goggles-mcp.mjs`. A consumer records `node_modules/0xray`. An upgrade that removes a self-install no longer leaves the handshake on a missing file.
54
+ - A machine-level Grok plugin does not fail the mill and is not stored in the mill receipt. A change to the worn skills drops that pass until the next session start or compact. When the plate or the mill is the miss, that miss is the plan until the line is on again. A copied role skill whose text was edited still stops wear.
55
+ - A SessionStart event that carries the opening prompt stays a session start, so the check runs before that first card is read.
56
+ - Live page. The mesh plays in the browser, with rewind and seat images. The watch survives a dropped connection. Fleet pushes go out as packets.
57
+ - The Playwright release-gate smoke stays on the Playwright battery. The unit runner does not load that spec.
58
+
59
+ ---
60
+
61
+ ## [4.0.40] - 2026-10-05
62
+
63
+ ### 🔄 Changes
64
+
65
+ ### 🔎 Other Changes
66
+ - house/live-mesh: full loop — feed watch, mesh render, direction, deploy, `/health`, X ledger both ways (#214, #215).
67
+ - house: define Ping-pong in OP-PROC lexicon (#213).
68
+ - house: OP-PROC cadence cleanup — muse-house lock, fleet forge0x1-merge, quiet/budget, sudo-copy seats (#216).
69
+ - house: OP-PROC eng PR coach stack + 2026-10-04 eng state lock (#210, #212).
70
+ - docs/dist: Dist packet note for 0xray 4.0.39 / repertoire 0.2.9 (#211).
71
+
72
+ ---
73
+
45
74
  ## [4.0.39] - 2026-10-03
46
75
 
47
76
  ### 🔄 Changes
@@ -282,6 +282,25 @@ export function loadConferPending(root = workspaceRoot(), sessionId = null) {
282
282
  }
283
283
  }
284
284
 
285
+ export function resolveGrokHookEvent(event = {}, argv = process.argv, env = process.env) {
286
+ if (env && env.GROK_HOOK_EVENT) return env.GROK_HOOK_EVENT;
287
+ const flag = (argv || []).find((arg) => String(arg).startsWith('--hook-event='));
288
+ if (flag) return String(flag).slice('--hook-event='.length);
289
+ const named = String((event && (event.hookEventName || event.hook)) || '')
290
+ .toLowerCase()
291
+ .replace(/[-_\s]/g, '');
292
+ if (named === 'precompact') return 'pre_compact';
293
+ if (named === 'postcompact') return 'post_compact';
294
+ if (named === 'sessionstart') return 'session_start';
295
+ if (
296
+ (event && (event.prompt != null || event.userMessage != null || event.user_prompt != null)) ||
297
+ named === 'userpromptsubmit'
298
+ ) {
299
+ return 'user_prompt_submit';
300
+ }
301
+ return 'session_start';
302
+ }
303
+
285
304
  export function buildSessionBootPayload(root, source = '0xray/grok-session-start', extra = {}) {
286
305
  const features = loadFeatures(root);
287
306
  const blockingTerms = loadBlockingCodexTerms();
@@ -318,6 +337,7 @@ export function buildSessionBootPayload(root, source = '0xray/grok-session-start
318
337
  ...extra,
319
338
  ...heat,
320
339
  ...compactHold,
340
+ arrivedHook: extra && extra.hookEvent ? String(extra.hookEvent) : "",
321
341
  hook: source,
322
342
  source,
323
343
  timestamp: new Date().toISOString(),
@@ -328,8 +348,8 @@ export function writeSessionBoot(root, payload) {
328
348
  try {
329
349
  const stateDir = path.join(root, '.xray', 'state');
330
350
  fs.mkdirSync(stateDir, { recursive: true });
331
- fs.writeFileSync(sessionBootPath(root), JSON.stringify(payload, null, 2));
332
351
  writeStationMarkdown(root, payload);
352
+ fs.writeFileSync(sessionBootPath(root), JSON.stringify(payload, null, 2));
333
353
  const hook = String((payload && (payload.hookEvent || payload.source)) || "");
334
354
  if (!/compact/i.test(hook)) {
335
355
  try {
@@ -9,6 +9,7 @@ import {
9
9
  clearPendingDelegationsForSessionChange,
10
10
  ensureSessionBoot,
11
11
  readStdinJson,
12
+ resolveGrokHookEvent,
12
13
  resolveSessionId,
13
14
  normalizeWorkspaceRoot,
14
15
  workspaceRoot,
@@ -25,25 +26,6 @@ import {
25
26
  import { maintainLens } from '../../hooks/goggles-pipeline.mjs';
26
27
  import { readSavedFreshness, refreshFreshness } from '../../../nucleus/work-freshness.mjs';
27
28
 
28
- function resolveHookEvent(event) {
29
- if (process.env.GROK_HOOK_EVENT) return process.env.GROK_HOOK_EVENT;
30
- const flag = process.argv.find((a) => a.startsWith('--hook-event='));
31
- if (flag) return flag.slice('--hook-event='.length);
32
- const named = event.hookEventName || event.hook;
33
- if (named === 'PreCompact' || named === 'pre_compact') return 'pre_compact';
34
- if (named === 'PostCompact' || named === 'post_compact') return 'post_compact';
35
- if (
36
- event.prompt != null ||
37
- event.userMessage != null ||
38
- event.user_prompt != null ||
39
- named === 'UserPromptSubmit' ||
40
- named === 'user_prompt_submit'
41
- ) {
42
- return 'user_prompt_submit';
43
- }
44
- return 'session_start';
45
- }
46
-
47
29
  function extractIntent(event) {
48
30
  return event.prompt || event.userMessage || event.user_prompt || event.compactContext || null;
49
31
  }
@@ -117,7 +99,7 @@ async function main() {
117
99
  let HOOK_EVENT = 'session_start';
118
100
  try {
119
101
  const event = await readStdinJson();
120
- HOOK_EVENT = resolveHookEvent(event);
102
+ HOOK_EVENT = resolveGrokHookEvent(event);
121
103
  const eventRoot = normalizeWorkspaceRoot(event.workspaceRoot || event.cwd || root);
122
104
  const sessionId = resolveSessionId(event);
123
105
  if (HOOK_EVENT === 'user_prompt_submit' && sessionId) {
@@ -2,8 +2,8 @@
2
2
  * Goggles MCP. Stdio. Server name `goggles`.
3
3
  * Tools: look, status_lens. Same organ as the CLI.
4
4
  */
5
- import { existsSync, readFileSync, realpathSync } from 'node:fs';
6
- import { basename, join, resolve } from 'node:path';
5
+ import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from 'node:fs';
6
+ import { basename, dirname, join, resolve } from 'node:path';
7
7
  import { pathToFileURL, fileURLToPath } from 'node:url';
8
8
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
9
9
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
@@ -162,6 +162,29 @@ function publicCard(view) {
162
162
  if (view.exam) notes.push(view.exam);
163
163
  }
164
164
  const skills = view.skills ? basename(String(view.skills)) : '';
165
+ const cascade = view.cascade
166
+ ? {
167
+ plane: view.cascade.plane,
168
+ station: view.cascade.station,
169
+ notesPage: view.cascade.notesPage,
170
+ index: view.cascade.index,
171
+ laws: Array.isArray(view.cascade.laws) ? view.cascade.laws : [],
172
+ notes: Array.isArray(view.cascade.notes) ? view.cascade.notes : [],
173
+ }
174
+ : null;
175
+ const sleeve = view.sleeve
176
+ ? {
177
+ on: Boolean(view.sleeve.on),
178
+ missing: Array.isArray(view.sleeve.missing) ? view.sleeve.missing : [],
179
+ stitches: Array.isArray(view.sleeve.stitches)
180
+ ? view.sleeve.stitches.map((row) => ({
181
+ name: String(row && row.name || ''),
182
+ on: Boolean(row && row.on),
183
+ at: Array.isArray(row && row.at) ? row.at.map((item) => String(item)) : [],
184
+ }))
185
+ : [],
186
+ }
187
+ : null;
165
188
  if (view.narrow) {
166
189
  return {
167
190
  plane: view.plane,
@@ -169,6 +192,8 @@ function publicCard(view) {
169
192
  digest: view.digest || '',
170
193
  files: Array.isArray(view.files) ? view.files : [],
171
194
  notes,
195
+ ...(cascade ? { cascade } : {}),
196
+ ...(sleeve ? { sleeve } : {}),
172
197
  };
173
198
  }
174
199
  return {
@@ -185,6 +210,8 @@ function publicCard(view) {
185
210
  teardown: view.teardown || '',
186
211
  worn: view.worn || '',
187
212
  notes,
213
+ ...(cascade ? { cascade } : {}),
214
+ ...(sleeve ? { sleeve } : {}),
188
215
  };
189
216
  }
190
217
 
@@ -205,11 +232,16 @@ export async function answerLook(raw, root) {
205
232
  return { ok: true, quiet: false, mode: 'kind0', content: line };
206
233
  }
207
234
  const argv = argvFrom(args);
208
- const text = api.look(argv).text;
235
+ const text = api.look(argv, here).text;
209
236
  if (text === 'Name one plane.') return deny('name_one', 'Name one plane.');
210
- const cards = api.lookCards(argv);
237
+ const cards = api.lookCards(argv, here);
211
238
  if (Array.isArray(cards) && cards.length) {
212
239
  const shown = cards.map(publicCard);
240
+ if (shown.length === 1 && shown[0] && typeof shown[0].plane === 'string') {
241
+ const dest = join(here, '.xray', 'state', 'goggles-plane.json');
242
+ mkdirSync(dirname(dest), { recursive: true });
243
+ writeFileSync(dest, `${JSON.stringify({ plane: shown[0].plane })}\n`);
244
+ }
213
245
  return {
214
246
  ok: true,
215
247
  quiet: false,
@@ -18,7 +18,7 @@ import { fileURLToPath } from 'node:url';
18
18
  const FIELD_ORDER = ['plate', 'entry', 'exit', 'files', 'skills', 'setup', 'teardown', 'worn'];
19
19
  const HERE = dirname(fileURLToPath(import.meta.url));
20
20
  const WORN_PLANES = ['dichotomy', 'syncopate', 'synthesis', 'digest', 'triage', 'loop'];
21
- const CARD_PLANES = ['ground', 'routing', 'house', 'boot', 'governance', 'memory-recall', 'orchestration', 'processor', 'reporting', 'stamp-plate', 'record-map', 'write-home', 'activity-log', 'session-capture', 'suit-wear', 'suit-organs', 'station-card', 'notes-page', 'reflection-page', 'site-manual', 'package-face', 'suit-settings', 'trail-state', 'inference-files', 'grok-compact', 'payload-heat', 'station-heat', 'pickup-stamp', 'cursor-compact', 'work-fresh', 'kept-line', 'lens-gate', 'pre-tool', 'lens-page'];
21
+ const CARD_PLANES = ['ground', 'routing', 'house', 'boot', 'governance', 'memory-recall', 'orchestration', 'processor', 'reporting', 'stamp-plate', 'record-map', 'write-home', 'activity-log', 'session-capture', 'suit-wear', 'suit-organs', 'station-card', 'notes-page', 'reflection-page', 'site-manual', 'package-face', 'suit-settings', 'trail-state', 'inference-files', 'grok-compact', 'payload-heat', 'station-heat', 'pickup-stamp', 'cursor-compact', 'work-fresh', 'kept-line', 'lens-gate', 'pre-tool', 'lens-page', 'centrifuge'];
22
22
  const CARD_FLAVORS = ['digest', 'triage'];
23
23
  const SCOPE_ZOOM = ['ecosystem', 'part', 'one flow', 'one artifact'];
24
24
 
@@ -211,7 +211,7 @@ function namesTheSet(lower) {
211
211
  return planes.length === 1 && planes[0] === 'loop' && findScopes(lower).length === 0;
212
212
  }
213
213
 
214
- function gogglesAnswer(argv) {
214
+ function gogglesAnswer(argv, projectRoot) {
215
215
  const words = [];
216
216
  for (const raw of argv || []) {
217
217
  const arg = String(raw || '').trim();
@@ -234,14 +234,14 @@ function gogglesAnswer(argv) {
234
234
  if (flavors.length === 1) {
235
235
  const others = acceptedPlanes().filter((name) => name !== flavors[0] && lower.includes(name));
236
236
  if (others.length) return none('');
237
- const cards = collectCards(flavors[0], lower);
237
+ const cards = collectCards(flavors[0], lower, projectRoot);
238
238
  if (!cards) return none('');
239
239
  return { text: cards.map((card) => formatCardText(card)).join('\n\n'), cards };
240
240
  }
241
241
  const planes = acceptedPlanes().filter((name) => lower.includes(name));
242
242
  if (planes.length !== 1) {
243
243
  if (!planes.length && cardPlanesNamed(lower).length) {
244
- const cards = collectCards('digest', lower);
244
+ const cards = collectCards('digest', lower, projectRoot);
245
245
  if (cards && cards.length) {
246
246
  return { text: cards.map((card) => formatCardText(card)).join('\n\n'), cards };
247
247
  }
@@ -255,12 +255,12 @@ function gogglesAnswer(argv) {
255
255
  return none(file ? `${line} File: ${file}` : line);
256
256
  }
257
257
 
258
- export function readGoggles(argv) {
259
- return ok(gogglesAnswer(argv).text);
258
+ export function readGoggles(argv, projectRoot) {
259
+ return ok(gogglesAnswer(argv, projectRoot).text);
260
260
  }
261
261
 
262
- export function lookCards(argv) {
263
- return gogglesAnswer(argv).cards;
262
+ export function lookCards(argv, projectRoot) {
263
+ return gogglesAnswer(argv, projectRoot).cards;
264
264
  }
265
265
 
266
266
  function cardPlanesNamed(lower) {
@@ -271,7 +271,22 @@ function listedFiles(plane) {
271
271
  return Array.isArray(plane.files) ? plane.files.map(String) : [];
272
272
  }
273
273
 
274
- function cardView(plane, scope, flavor, root) {
274
+ function cascadeApi() {
275
+ return createRequire(import.meta.url)('./wake-cascade.cjs');
276
+ }
277
+
278
+ function sleeveApi() {
279
+ return createRequire(import.meta.url)('./sleeve.cjs');
280
+ }
281
+
282
+ function appendLining(text, view) {
283
+ let next = text;
284
+ if (view.cascade) next = `${next}\n${cascadeApi().formatCascadeReading(view.cascade)}`;
285
+ if (view.sleeve) next = `${next}\n${sleeveApi().formatSleeveReading(view.sleeve)}`;
286
+ return next;
287
+ }
288
+
289
+ function cardView(plane, scope, flavor, root, cascadeRoot) {
275
290
  const listed = listedFiles(plane);
276
291
  const view = {
277
292
  plane: plane.id,
@@ -290,6 +305,20 @@ function cardView(plane, scope, flavor, root) {
290
305
  worn: plane.worn || '',
291
306
  };
292
307
  view.exam = examinePlane(plane, root).text;
308
+ if (cascadeApi().isCascadePlane(plane.id)) {
309
+ try {
310
+ view.cascade = cascadeApi().readWakeCascade(cascadeRoot || stateRoot());
311
+ } catch {
312
+ view.cascade = null;
313
+ }
314
+ }
315
+ if (sleeveApi().isSleevePlane(plane.id)) {
316
+ try {
317
+ view.sleeve = sleeveApi().readSleeve(cascadeRoot || stateRoot());
318
+ } catch {
319
+ view.sleeve = null;
320
+ }
321
+ }
293
322
  if (flavor === 'triage') {
294
323
  const filled = new Set(filledOf(plane));
295
324
  view.empty = FIELD_ORDER.filter((name) => !filled.has(name));
@@ -328,7 +357,7 @@ function formatCardText(view) {
328
357
  } else if (typeof view.exam === 'string' && view.exam.startsWith('Drift:')) {
329
358
  text = `${text}\n${view.exam}`;
330
359
  }
331
- return text;
360
+ return appendLining(text, view);
332
361
  }
333
362
 
334
363
  export function formatCardPane(view) {
@@ -345,10 +374,11 @@ export function formatCardPane(view) {
345
374
  const top = `┌ ${title} ${'─'.repeat(Math.max(0, width - title.length - 1))}┐`;
346
375
  const mid = body.map((line) => `│ ${line.padEnd(width)} │`);
347
376
  const bot = `└${'─'.repeat(width + 2)}┘`;
348
- return [top, ...mid, bot].join('\n');
377
+ const pane = [top, ...mid, bot].join('\n');
378
+ return appendLining(pane, view);
349
379
  }
350
380
 
351
- function collectCards(flavor, lower) {
381
+ function collectCards(flavor, lower, projectRoot) {
352
382
  const named = cardPlanesNamed(lower);
353
383
  const scopes = findScopes(lower.filter((word) => word !== flavor && !named.includes(word)));
354
384
  if (scopes.length > 1) return null;
@@ -359,7 +389,7 @@ function collectCards(flavor, lower) {
359
389
  const cards = [];
360
390
  for (const id of ids) {
361
391
  const plane = growPlane(id, platesDir, stateRoot());
362
- cards.push(cardView(plane, scope, flavor, root));
392
+ cards.push(cardView(plane, scope, flavor, root, projectRoot));
363
393
  }
364
394
  return cards;
365
395
  }
@@ -929,6 +959,15 @@ function lensPage(root, names) {
929
959
  return parts.join('\n\n');
930
960
  }
931
961
 
962
+
963
+ export function holdPlane(root, id) {
964
+ const plane = String(id || "").trim();
965
+ if (!plane || plane.includes(" ")) return;
966
+ const dest = join(root, ".xray", "state", "goggles-plane.json");
967
+ mkdirSync(dirname(dest), { recursive: true });
968
+ writeFileSync(dest, `${JSON.stringify({ plane })}\n`);
969
+ }
970
+
932
971
  function stampPlane(root, id) {
933
972
  try {
934
973
  const plates = createRequire(import.meta.url)('./plates.cjs');
@@ -953,6 +992,7 @@ export function lensBeforeResearch(root, toolName, text) {
953
992
  if (!research) return null;
954
993
  const names = CARD_PLANES.filter((name) => intentWords(spoken).includes(name));
955
994
  if (names.length === 1) {
995
+ holdPlane(root, names[0]);
956
996
  stampPlane(root, names[0]);
957
997
  rememberOpened(root, spoken);
958
998
  return null;
@@ -1095,8 +1135,8 @@ export function examinePlane(plane, root) {
1095
1135
  }
1096
1136
 
1097
1137
 
1098
- export function look(argv) {
1099
- return readGoggles(argv);
1138
+ export function look(argv, projectRoot) {
1139
+ return readGoggles(argv, projectRoot);
1100
1140
  }
1101
1141
 
1102
1142
 
@@ -8,7 +8,7 @@
8
8
  "src",
9
9
  "grok-bot/OP-PROC.md",
10
10
  "src/opencode/agents",
11
- "Agents.md",
11
+ "AGENTS.md",
12
12
  "src/integrations",
13
13
  "package.json",
14
14
  "scripts/foundry"
@@ -68,7 +68,7 @@
68
68
  "plates": ["review"]
69
69
  },
70
70
  "record-map": {
71
- "files": ["docs-site/docs/plates/record-map.md"],
71
+ "files": ["docs-site/docs/plates/record-map.md", "src/integrations/hooks/wake-cascade.cjs", "src/integrations/hooks/session-note-index.cjs"],
72
72
  "skills": ".agents/skills/record-map/SKILL.md",
73
73
  "plates": ["station-card", "notes-page", "reflection-page", "site-manual", "package-face", "write-home", "activity-log", "session-capture", "lens-page"]
74
74
  },
@@ -103,13 +103,13 @@
103
103
  "plates": ["activity-log", "session-capture", "inference-files", "trail-state"]
104
104
  },
105
105
  "station-card": {
106
- "files": ["src/integrations/hooks/station-hook-runtime.cjs"],
106
+ "files": ["src/integrations/hooks/station-hook-runtime.cjs", "src/integrations/hooks/wake-cascade.cjs"],
107
107
  "mark": "formatStationMarkdown",
108
108
  "skills": ".agents/skills/station-card/SKILL.md",
109
109
  "plates": ["notes-page", "record-map", "kept-line"]
110
110
  },
111
111
  "notes-page": {
112
- "files": ["src/integrations/hooks/station-hook-runtime.cjs"],
112
+ "files": ["src/integrations/hooks/station-hook-runtime.cjs", "src/integrations/hooks/session-note-index.cjs"],
113
113
  "mark": "stampNotesPickup",
114
114
  "skills": ".agents/skills/notes-page/SKILL.md",
115
115
  "plates": ["station-card", "record-map"]
@@ -210,6 +210,12 @@
210
210
  "mark": "export function formatCardPane",
211
211
  "skills": ".agents/skills/lens-page/SKILL.md",
212
212
  "plates": ["record-map", "lens-gate"]
213
+ },
214
+ "centrifuge": {
215
+ "files": ["src/integrations/hooks/station-hook-runtime.cjs"],
216
+ "mark": "function wakeOrder",
217
+ "skills": ".agents/skills/centrifuge/SKILL.md",
218
+ "plates": ["station-card", "goggles"]
213
219
  }
214
220
  }
215
221
 
@@ -46,6 +46,7 @@ const PLATE_IDS = Object.freeze([
46
46
  "lens-gate",
47
47
  "pre-tool",
48
48
  "lens-page",
49
+ "centrifuge",
49
50
  ]);
50
51
 
51
52
  /** Id token, then extra phrases. Equal top scores recall nothing. */
@@ -229,6 +230,11 @@ const CUES = {
229
230
  [/lens page/i, 6],
230
231
  [/plates\/lens-page/i, 6],
231
232
  ],
233
+ centrifuge: [
234
+ [/centrifuge plate/i, 6],
235
+ [/the centrifuge/i, 5],
236
+ [/plates\/centrifuge/i, 6],
237
+ ],
232
238
  };
233
239
 
234
240
  function platesDir() {
@@ -317,6 +323,21 @@ function stampPlateIfMissing(projectRoot, id) {
317
323
  return { id, path, written: true };
318
324
  }
319
325
 
326
+ function ensureWornPlate(projectRoot, id) {
327
+ const path = wornPlatePath(projectRoot, id);
328
+ const source = readFileSync(plateSourcePath(id), "utf8");
329
+ if (existsSync(path)) {
330
+ try {
331
+ if (readFileSync(path, "utf8") === source) return { id, path, written: false };
332
+ } catch {
333
+ /* rewrite a plate the process cannot keep */
334
+ }
335
+ }
336
+ mkdirSync(dirname(path), { recursive: true });
337
+ writeFileSync(path, source);
338
+ return { id, path, written: true };
339
+ }
340
+
320
341
  function organFile(intent) {
321
342
  try {
322
343
  const { suitHint } = require("./goggles-pipeline.mjs");
@@ -342,6 +363,7 @@ module.exports = {
342
363
  loadPlate,
343
364
  recallPlate,
344
365
  stampPlateIfMissing,
366
+ ensureWornPlate,
345
367
  plateStockLine,
346
368
  wornPlatePath,
347
369
  };