@rubytech/create-realagent-code 0.1.460 → 0.1.462

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 (205) hide show
  1. package/dist/__tests__/cron-heartbeat-registration.test.js +57 -28
  2. package/dist/__tests__/launchd-plist.test.js +26 -0
  3. package/dist/cron-registration.js +30 -8
  4. package/dist/index.js +50 -9
  5. package/dist/launchd-plist.js +1 -1
  6. package/dist/uninstall.js +9 -3
  7. package/package.json +1 -1
  8. package/payload/platform/lib/graph-mcp/dist/index.d.ts +2 -1
  9. package/payload/platform/lib/graph-mcp/dist/index.d.ts.map +1 -1
  10. package/payload/platform/lib/graph-mcp/dist/index.js +14 -22
  11. package/payload/platform/lib/graph-mcp/dist/index.js.map +1 -1
  12. package/payload/platform/lib/graph-mcp/src/index.ts +15 -22
  13. package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts +8 -7
  14. package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts.map +1 -1
  15. package/payload/platform/lib/mcp-spawn-tee/dist/index.js +19 -19
  16. package/payload/platform/lib/mcp-spawn-tee/dist/index.js.map +1 -1
  17. package/payload/platform/lib/mcp-spawn-tee/src/__tests__/spawn-tee.test.ts +34 -5
  18. package/payload/platform/lib/mcp-spawn-tee/src/index.ts +22 -19
  19. package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts +35 -17
  20. package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts.map +1 -1
  21. package/payload/platform/lib/mcp-stderr-tee/dist/index.js +41 -48
  22. package/payload/platform/lib/mcp-stderr-tee/dist/index.js.map +1 -1
  23. package/payload/platform/lib/mcp-stderr-tee/src/index.ts +42 -51
  24. package/payload/platform/lib/storage-broker/dist/__tests__/audit.test.js +27 -0
  25. package/payload/platform/lib/storage-broker/dist/__tests__/audit.test.js.map +1 -1
  26. package/payload/platform/lib/storage-broker/dist/__tests__/cf-exec.test.js +49 -0
  27. package/payload/platform/lib/storage-broker/dist/__tests__/cf-exec.test.js.map +1 -1
  28. package/payload/platform/lib/storage-broker/dist/audit.d.ts +11 -0
  29. package/payload/platform/lib/storage-broker/dist/audit.d.ts.map +1 -1
  30. package/payload/platform/lib/storage-broker/dist/audit.js +16 -0
  31. package/payload/platform/lib/storage-broker/dist/audit.js.map +1 -1
  32. package/payload/platform/lib/storage-broker/dist/cf-exec.d.ts +18 -0
  33. package/payload/platform/lib/storage-broker/dist/cf-exec.d.ts.map +1 -1
  34. package/payload/platform/lib/storage-broker/dist/cf-exec.js +77 -0
  35. package/payload/platform/lib/storage-broker/dist/cf-exec.js.map +1 -1
  36. package/payload/platform/lib/storage-broker/dist/house-scoped-token.js +3 -0
  37. package/payload/platform/lib/storage-broker/dist/house-scoped-token.js.map +1 -1
  38. package/payload/platform/lib/storage-broker/dist/registry.d.ts +1 -1
  39. package/payload/platform/lib/storage-broker/dist/registry.d.ts.map +1 -1
  40. package/payload/platform/lib/storage-broker/dist/registry.js.map +1 -1
  41. package/payload/platform/lib/storage-broker/src/__tests__/audit.test.ts +32 -1
  42. package/payload/platform/lib/storage-broker/src/__tests__/cf-exec.test.ts +61 -0
  43. package/payload/platform/lib/storage-broker/src/audit.ts +45 -0
  44. package/payload/platform/lib/storage-broker/src/cf-exec.ts +91 -0
  45. package/payload/platform/lib/storage-broker/src/house-scoped-token.ts +3 -0
  46. package/payload/platform/lib/storage-broker/src/registry.ts +5 -1
  47. package/payload/platform/plugins/admin/lib/mcp-spawn-tee/index.js +19 -19
  48. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +22 -11
  49. package/payload/platform/plugins/aeo/lib/mcp-spawn-tee/index.js +19 -19
  50. package/payload/platform/plugins/browser/lib/mcp-spawn-tee/index.js +19 -19
  51. package/payload/platform/plugins/cloudflare/PLUGIN.md +1 -1
  52. package/payload/platform/plugins/cloudflare/bin/portal-enrol.mjs +96 -0
  53. package/payload/platform/plugins/cloudflare/mcp/__tests__/auth-route.test.ts +54 -40
  54. package/payload/platform/plugins/cloudflare/mcp/__tests__/passcode.test.ts +169 -39
  55. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-enrol.test.ts +207 -0
  56. package/payload/platform/plugins/cloudflare/mcp/dist/index.js +5 -5
  57. package/payload/platform/plugins/cloudflare/mcp/dist/index.js.map +1 -1
  58. package/payload/platform/plugins/cloudflare/mcp/package.json +1 -1
  59. package/payload/platform/plugins/cloudflare/references/hosting-sites.md +2 -0
  60. package/payload/platform/plugins/cloudflare/skills/calendar-site/SKILL.md +1 -1
  61. package/payload/platform/plugins/cloudflare/skills/data-portal/SKILL.md +21 -19
  62. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/passcode.mjs +193 -0
  63. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/auth.ts +18 -12
  64. package/payload/platform/plugins/cloudflare/skills/data-portal/template/schema.sql +14 -5
  65. package/payload/platform/plugins/cloudflare/skills/site-deploy/SKILL.md +2 -0
  66. package/payload/platform/plugins/connector/lib/mcp-spawn-tee/index.js +19 -19
  67. package/payload/platform/plugins/contacts/lib/mcp-spawn-tee/index.js +19 -19
  68. package/payload/platform/plugins/docs/references/admin-session.md +3 -3
  69. package/payload/platform/plugins/docs/references/cloudflare.md +2 -0
  70. package/payload/platform/plugins/docs/references/outlook-guide.md +11 -4
  71. package/payload/platform/plugins/docs/references/plugins-guide.md +8 -6
  72. package/payload/platform/plugins/email/lib/mcp-spawn-tee/index.js +19 -19
  73. package/payload/platform/plugins/filesystem/lib/mcp-spawn-tee/index.js +19 -19
  74. package/payload/platform/plugins/graph-viewer/lib/mcp-spawn-tee/index.js +19 -19
  75. package/payload/platform/plugins/memory/PLUGIN.md +1 -1
  76. package/payload/platform/plugins/memory/lib/mcp-spawn-tee/index.js +19 -19
  77. package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.js +2 -2
  78. package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.js.map +1 -1
  79. package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
  80. package/payload/platform/plugins/outlook/PLUGIN.md +2 -2
  81. package/payload/platform/plugins/outlook/lib/mcp-spawn-tee/index.js +19 -19
  82. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.d.ts +2 -0
  83. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.d.ts.map +1 -0
  84. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.js +238 -0
  85. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.js.map +1 -0
  86. package/payload/platform/plugins/outlook/mcp/dist/index.js +9 -5
  87. package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
  88. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts +58 -9
  89. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts.map +1 -1
  90. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js +113 -19
  91. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js.map +1 -1
  92. package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +5 -2
  93. package/payload/platform/plugins/quickbooks/lib/mcp-spawn-tee/index.js +19 -19
  94. package/payload/platform/plugins/replicate/lib/mcp-spawn-tee/index.js +19 -19
  95. package/payload/platform/plugins/scheduling/lib/mcp-spawn-tee/index.js +19 -19
  96. package/payload/platform/plugins/storage-broker/PLUGIN.md +9 -1
  97. package/payload/platform/plugins/storage-broker/lib/mcp-spawn-tee/index.js +19 -19
  98. package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.d.ts.map +1 -1
  99. package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.js +16 -5
  100. package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.js.map +1 -1
  101. package/payload/platform/plugins/storage-broker/mcp/dist/index.js +49 -0
  102. package/payload/platform/plugins/storage-broker/mcp/dist/index.js.map +1 -1
  103. package/payload/platform/plugins/url-get/lib/mcp-spawn-tee/index.js +19 -19
  104. package/payload/platform/plugins/voice-mirror/PLUGIN.md +1 -1
  105. package/payload/platform/plugins/voice-mirror/lib/mcp-spawn-tee/index.js +19 -19
  106. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.d.ts.map +1 -1
  107. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.js +98 -9
  108. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.js.map +1 -1
  109. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-retrieve-conditioning.d.ts.map +1 -1
  110. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-retrieve-conditioning.js +54 -21
  111. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-retrieve-conditioning.js.map +1 -1
  112. package/payload/platform/plugins/voice-mirror/mcp/scripts/smoke.mjs +110 -0
  113. package/payload/platform/plugins/voice-mirror/skills/voice-mirror/SKILL.md +6 -3
  114. package/payload/platform/plugins/web-designer/PLUGIN.md +1 -1
  115. package/payload/platform/plugins/web-designer/commands/website.md +6 -0
  116. package/payload/platform/plugins/web-designer/skills/web-design/references/deploy.md +12 -0
  117. package/payload/platform/plugins/whatsapp/lib/mcp-spawn-tee/index.js +19 -19
  118. package/payload/platform/plugins/work/lib/mcp-spawn-tee/index.js +19 -19
  119. package/payload/platform/plugins/workflows/lib/mcp-spawn-tee/index.js +19 -19
  120. package/payload/platform/scripts/__tests__/logs-rotate.test.sh +260 -0
  121. package/payload/platform/scripts/__tests__/resume-tunnel.test.sh +79 -0
  122. package/payload/platform/scripts/logs-read.sh +31 -0
  123. package/payload/platform/scripts/logs-rotate.sh +207 -0
  124. package/payload/platform/scripts/resume-tunnel.sh +27 -0
  125. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  126. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +2 -0
  127. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  128. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  129. package/payload/platform/services/claude-session-manager/dist/http-server.js +41 -5
  130. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  131. package/payload/platform/services/claude-session-manager/dist/index.d.ts +1 -0
  132. package/payload/platform/services/claude-session-manager/dist/index.d.ts.map +1 -1
  133. package/payload/platform/services/claude-session-manager/dist/index.js +22 -0
  134. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  135. package/payload/platform/services/claude-session-manager/dist/install-start-counter.d.ts +2 -0
  136. package/payload/platform/services/claude-session-manager/dist/install-start-counter.d.ts.map +1 -0
  137. package/payload/platform/services/claude-session-manager/dist/install-start-counter.js +12 -0
  138. package/payload/platform/services/claude-session-manager/dist/install-start-counter.js.map +1 -0
  139. package/payload/platform/services/claude-session-manager/dist/pty-census.d.ts +122 -9
  140. package/payload/platform/services/claude-session-manager/dist/pty-census.d.ts.map +1 -1
  141. package/payload/platform/services/claude-session-manager/dist/pty-census.js +214 -29
  142. package/payload/platform/services/claude-session-manager/dist/pty-census.js.map +1 -1
  143. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  144. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +39 -1
  145. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  146. package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts +5 -3
  147. package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts.map +1 -1
  148. package/payload/platform/services/claude-session-manager/dist/rc-daemon.js +13 -1
  149. package/payload/platform/services/claude-session-manager/dist/rc-daemon.js.map +1 -1
  150. package/payload/platform/services/claude-session-manager/dist/session-memory-cap.d.ts.map +1 -1
  151. package/payload/platform/services/claude-session-manager/dist/session-memory-cap.js +4 -2
  152. package/payload/platform/services/claude-session-manager/dist/session-memory-cap.js.map +1 -1
  153. package/payload/platform/services/claude-session-manager/dist/slice-memory-policy.d.ts +150 -0
  154. package/payload/platform/services/claude-session-manager/dist/slice-memory-policy.d.ts.map +1 -0
  155. package/payload/platform/services/claude-session-manager/dist/slice-memory-policy.js +333 -0
  156. package/payload/platform/services/claude-session-manager/dist/slice-memory-policy.js.map +1 -0
  157. package/payload/platform/services/claude-session-manager/dist/start-counter.d.ts +10 -0
  158. package/payload/platform/services/claude-session-manager/dist/start-counter.d.ts.map +1 -0
  159. package/payload/platform/services/claude-session-manager/dist/start-counter.js +55 -0
  160. package/payload/platform/services/claude-session-manager/dist/start-counter.js.map +1 -0
  161. package/payload/premium-plugins/real-agent/plugins/buyers/lib/mcp-spawn-tee/index.js +19 -19
  162. package/payload/premium-plugins/real-agent/plugins/estate-sales/lib/mcp-spawn-tee/index.js +19 -19
  163. package/payload/premium-plugins/real-agent/plugins/loop/lib/mcp-spawn-tee/index.js +19 -19
  164. package/payload/premium-plugins/real-agent/plugins/property-data/lib/mcp-spawn-tee/index.js +19 -19
  165. package/payload/server/{chunk-JXWFVE5X.js → chunk-BBSPFN45.js} +65 -0
  166. package/payload/server/public/assets/{AdminLoginScreens-BFbpkEUS.js → AdminLoginScreens-Bed8SDxY.js} +1 -1
  167. package/payload/server/public/assets/{AdminShell-CdOGObaZ.js → AdminShell-BLh9O6dn.js} +1 -1
  168. package/payload/server/public/assets/{Checkbox-RFD_F0c0.js → Checkbox-BC_KSbpS.js} +1 -1
  169. package/payload/server/public/assets/{admin-CYGdL-1O.js → admin-DfWgJVI3.js} +1 -1
  170. package/payload/server/public/assets/{browser-DVfa_plj.js → browser-C0vkv-hH.js} +1 -1
  171. package/payload/server/public/assets/{calendar-JC_Dxa4n.js → calendar-_pfHw0Hp.js} +1 -1
  172. package/payload/server/public/assets/chat-CufidiBQ.js +1 -0
  173. package/payload/server/public/assets/chevron-left-BnpVBu51.js +1 -0
  174. package/payload/server/public/assets/data-CR-fbPWr.js +1 -0
  175. package/payload/server/public/assets/{graph-hBUrRSkr.js → graph-BZiudUGr.js} +1 -1
  176. package/payload/server/public/assets/{graph-labels-CHh6zs8t.js → graph-labels-BzmmJwCR.js} +1 -1
  177. package/payload/server/public/assets/{maximize-2-DjxE4rm9.js → maximize-2-Bhdsv0U-.js} +1 -1
  178. package/payload/server/public/assets/{operator-BqU9SQuu.js → operator-Cj0B_usT.js} +1 -1
  179. package/payload/server/public/assets/page-84Fdwiu_.js +32 -0
  180. package/payload/server/public/assets/{page-DiQhU6lD.js → page-8AB3jUa_.js} +1 -1
  181. package/payload/server/public/assets/{public-Cu_eALgY.js → public-BkNW9e9T.js} +1 -1
  182. package/payload/server/public/assets/{rotate-ccw-F9DsSTSJ.js → rotate-ccw-D_5cETGt.js} +1 -1
  183. package/payload/server/public/assets/{tasks-CE-D0f50.js → tasks-EyKLXINi.js} +1 -1
  184. package/payload/server/public/assets/{time-entry-format-D2rsWhov.js → time-entry-format-DAwmmR3i.js} +1 -1
  185. package/payload/server/public/assets/{useCopyFeedback-QxOmoobV.js → useCopyFeedback-rOWd_lzl.js} +1 -1
  186. package/payload/server/public/assets/{useSelectionMode-RIzNqFjV.js → useSelectionMode-DDmLmPph.js} +1 -1
  187. package/payload/server/public/assets/{useSubAccountSwitcher-BW_fK1Nt.css → useSubAccountSwitcher-pu0jjLCz.css} +1 -1
  188. package/payload/server/public/assets/{useVoiceRecorder-WrWurSYI.js → useVoiceRecorder-azG8zSUI.js} +1 -1
  189. package/payload/server/public/browser.html +5 -5
  190. package/payload/server/public/calendar.html +6 -6
  191. package/payload/server/public/chat.html +12 -12
  192. package/payload/server/public/data.html +10 -10
  193. package/payload/server/public/graph.html +11 -11
  194. package/payload/server/public/index.html +13 -13
  195. package/payload/server/public/operator.html +14 -14
  196. package/payload/server/public/public.html +12 -12
  197. package/payload/server/public/tasks.html +5 -5
  198. package/payload/server/server.js +581 -209
  199. package/payload/server/{src-4F37OHLK.js → src-YLGAZY36.js} +5 -1
  200. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/passcode.ts +0 -73
  201. package/payload/server/public/assets/chat-Yf8Nkop8.js +0 -1
  202. package/payload/server/public/assets/chevron-left-CAiAUBxO.js +0 -1
  203. package/payload/server/public/assets/data-hqdYXaEn.js +0 -1
  204. package/payload/server/public/assets/page-B4c4_4HP.js +0 -32
  205. /package/payload/server/public/assets/{useSubAccountSwitcher-wo_qGW-I.js → useSubAccountSwitcher-CU-lOxTd.js} +0 -0
@@ -13,14 +13,15 @@
13
13
  *
14
14
  * Claude Code CLI → shim (this file) = node running <real-entry> in-process
15
15
  * stdin/stdout : untouched (JSON-RPC channel)
16
- * stderr : process.stderr.write teed → per-date + per-session + passthrough
16
+ * stderr : process.stderr.write teed → raw sink + passthrough
17
17
  *
18
- * Destinations (Task 706) — unchanged:
19
- * - `${LOG_DIR}/mcp-<name>-stderr-<date>.log` per-date raw (back-compat;
20
- * the in-process mcp-stderr-tee and the [mcp-init-error] probe read it).
21
- * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — per-session raw + lifecycle
22
- * lines. Authoritative sink. Absent when SESSION_ID is unset (enumeration
23
- * spawn)then the per-date file is the fallback.
18
+ * Destinations:
19
+ * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — raw stderr + lifecycle lines.
20
+ * The sole raw sink. Task 1721 retired the per-date twin: its date was
21
+ * pinned at spawn, no reader ever parsed it, and mcp-stderr-tee wrote the
22
+ * same file, so every line landed twice.
23
+ * - `${LOG_DIR}/mcp-<name>-nosession.log` — the same, for a spawn with
24
+ * no SESSION_ID (enumeration). One fixed file per server.
24
25
  * - `server.log` via the loopback log-ingest route — best-effort mirror of
25
26
  * the [mcp-helper] lifecycle lines.
26
27
  *
@@ -49,13 +50,13 @@ const PLATFORM_PORT = process.env.PLATFORM_PORT;
49
50
  const ENTRY = process.argv[2];
50
51
  const SESSION_ID8 = SESSION_ID ? SESSION_ID.slice(0, 8) : "—";
51
52
  const spawnStamp = Date.now();
52
- // Per-session raw + lifecycle log (Task 706). Empty SESSION_ID (enumeration
53
- // spawn) undefined, and the per-date file is the fallback.
54
- const perSessionPath = LOG_DIR && SESSION_ID
55
- ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-${SESSION_ID}.log`)
56
- : undefined;
57
- const perDatePath = LOG_DIR
58
- ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-stderr-${new Date(spawnStamp).toISOString().slice(0, 10)}.log`)
53
+ // The one raw sink (Task 1721). A sessionless spawn (rc-daemon stamps
54
+ // SESSION_ID='' rc-daemon.ts:513 while still stamping LOG_DIR) shares one
55
+ // fixed file per server rather than a date-named one: the date was never read
56
+ // by any reader and named a process lifetime, not a day. Interleaved spawns in
57
+ // the nosession file are separated by the [mcp-helper] op=spawn pid= lines.
58
+ const rawSinkPath = LOG_DIR
59
+ ? (0, node_path_1.resolve)(LOG_DIR, SESSION_ID ? `mcp-${SERVER_NAME}-${SESSION_ID}.log` : `mcp-${SERVER_NAME}-nosession.log`)
59
60
  : undefined;
60
61
  // Rolling tail of entry stderr for op=exit. Capped so a chatty server cannot
61
62
  // grow the buffer without bound.
@@ -66,7 +67,7 @@ let exitEmitted = false;
66
67
  let exitSignal;
67
68
  // The real stderr writer, captured before the tee replaces it. Lifecycle lines
68
69
  // and stderr passthrough both go through this so they are never re-teed into
69
- // the per-date sink nor recursed back into the patched writer.
70
+ // the raw sink nor recursed back into the patched writer.
70
71
  const rawStderrWrite = process.stderr.write.bind(process.stderr);
71
72
  // LOG_DIR is created once, lazily, on the first successful append — not per
72
73
  // chunk. teeWrite runs on the server's own stderr hot path now, so a per-call
@@ -115,7 +116,7 @@ function postToServerLog(suffix, level) {
115
116
  // log-ingest route rejects newlines).
116
117
  function emitLifecycle(suffix, level) {
117
118
  const line = `[mcp-helper] ${suffix}\n`;
118
- appendSafe(perSessionPath, line);
119
+ appendSafe(rawSinkPath, line);
119
120
  try {
120
121
  rawStderrWrite(line);
121
122
  }
@@ -127,12 +128,11 @@ if (!ENTRY) {
127
128
  process.exit(2);
128
129
  }
129
130
  // Replace process.stderr.write with a tee: mirror every server stderr byte to
130
- // the per-date and per-session sinks, keep a rolling tail for op=exit, emit
131
+ // the raw sink, keep a rolling tail for op=exit, emit
131
132
  // op=boot on the first bytes, then pass the write through to the real stderr.
132
133
  const teeWrite = ((...args) => {
133
134
  const chunk = args[0];
134
- appendSafe(perDatePath, chunk); // per-date raw (back-compat)
135
- appendSafe(perSessionPath, chunk); // per-session raw (Task 706)
135
+ appendSafe(rawSinkPath, chunk); // raw sink (Task 1721)
136
136
  const text = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
137
137
  stderrTail = (stderrTail + text).slice(-TAIL_CAP);
138
138
  if (!bootEmitted) {
@@ -59,7 +59,7 @@ Voice mirror introduces five deterministic plugin tools. They write to the graph
59
59
  |------|---------|
60
60
  | `voice-tag-content` | Stamp `authorshipMode ∈ {human-only, human-led-agent-assisted, agent-led-human-reviewed, agent-only, unknown}`, `format ∈ {text, email, social-post, article, note, marketing-copy}`, and `voiceAuthor` on one or many `:KnowledgeDocument | :Message | :SocialPost` nodes (email threads live as `:KnowledgeDocument {source:'email'}`). Bulk-mode for backfill batches. `format` is required. `author` is optional — omit to attribute to the tagging operator. The resolved `voiceAuthor` must name an `:AdminUser` on the calling account or the tag is refused and nothing is written (see [Identity](#identity)). |
61
61
  | `voice-distil-profile` | Three modes, scope-aware (`scope='personal'` default walks one author; `scope='org'` walks the whole account onto the business). `mode='sample'` (default) walks the `human-only` corpus for the given `format`/`scope` and returns exemplars + recent edit intents for the agent to compose a style card; cadence-guarded (≥20% growth or ≥30 days). `mode='amend'` reads only `nodeIds` plus the existing `:VoiceProfile.styleCard` so the agent can decide whether named documents move the profile — operator-initiated, no cadence guard. `mode='write'` persists the YAML card; supply `amendedFromNodeIds` to attribute the write to specific documents (bypasses cadence + corpus walk). Trashed nodes are excluded from every walk. Omit `format` on `'sample'` to enumerate all formats in that scope's corpus and distil each. |
62
- | `voice-retrieve-conditioning` | Return `{styleCard, exemplars[], status}` for a drafting brief. Requires `brief.format` (one of the six corpus formats). `brief.scope` (default `personal`) picks personal vs org voice; a personal request with no personal profile falls back to the org profile (`status='fallback-org'`). K=5 short-form (`brief.length:'short'`), K=15 long-form (`brief.length:'long'`). Token-budget bounded. `status ∈ {ok, fallback-org, no-data, error}`. Identity is not gated here: retrieval writes nothing, and a personal request that resolves no personal voice falls back to the org voice by design. |
62
+ | `voice-retrieve-conditioning` | Return `{styleCard, exemplars[], status}` for a drafting brief. Requires `brief.format` (one of the six corpus formats). `brief.scope` (default `personal`) picks personal vs org voice; a personal request with no personal profile falls back to the org profile (`status='fallback-org'`). K=5 short-form (`brief.length:'short'`), K=15 long-form (`brief.length:'long'`). Token-budget bounded. `brief.topic` is optional and **ranks** the exemplar walk — its terms order the corpus by how many they hit, recency breaks the tie, and a topic that matches nothing still returns the K most recent. `status ∈ {ok, fallback-org, no-data, error}`; `ok` means the query ran, not that exemplars came back — read `exemplars.length` for that. Identity is not gated here: retrieval writes nothing, and a personal request that resolves no personal voice falls back to the org voice by design. |
63
63
  | `voice-record-feedback` | Capture an operator edit on an agent draft as a `:VoiceEdit {format, scope}` with a Haiku-summarised `intent`, linked back to the scoped per-format `:VoiceProfile` via `:FEEDBACK_FOR` (org edits → org profile; editor preserved via `:AUTHORED`). Requires `format`. |
64
64
  | `voice-ingest-session-text` | Write operator turns from the current session as `:Message {format:'text', authorshipMode:'human-only'}` corpus nodes. The agent reads its own operator turns from context and passes them as `turns`. Deduplicates via SHA256 `contentHash`. Invoked on demand by the voice-mirror skill when the operator asks to capture this session's voice. |
65
65
 
@@ -13,14 +13,15 @@
13
13
  *
14
14
  * Claude Code CLI → shim (this file) = node running <real-entry> in-process
15
15
  * stdin/stdout : untouched (JSON-RPC channel)
16
- * stderr : process.stderr.write teed → per-date + per-session + passthrough
16
+ * stderr : process.stderr.write teed → raw sink + passthrough
17
17
  *
18
- * Destinations (Task 706) — unchanged:
19
- * - `${LOG_DIR}/mcp-<name>-stderr-<date>.log` per-date raw (back-compat;
20
- * the in-process mcp-stderr-tee and the [mcp-init-error] probe read it).
21
- * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — per-session raw + lifecycle
22
- * lines. Authoritative sink. Absent when SESSION_ID is unset (enumeration
23
- * spawn)then the per-date file is the fallback.
18
+ * Destinations:
19
+ * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — raw stderr + lifecycle lines.
20
+ * The sole raw sink. Task 1721 retired the per-date twin: its date was
21
+ * pinned at spawn, no reader ever parsed it, and mcp-stderr-tee wrote the
22
+ * same file, so every line landed twice.
23
+ * - `${LOG_DIR}/mcp-<name>-nosession.log` — the same, for a spawn with
24
+ * no SESSION_ID (enumeration). One fixed file per server.
24
25
  * - `server.log` via the loopback log-ingest route — best-effort mirror of
25
26
  * the [mcp-helper] lifecycle lines.
26
27
  *
@@ -49,13 +50,13 @@ const PLATFORM_PORT = process.env.PLATFORM_PORT;
49
50
  const ENTRY = process.argv[2];
50
51
  const SESSION_ID8 = SESSION_ID ? SESSION_ID.slice(0, 8) : "—";
51
52
  const spawnStamp = Date.now();
52
- // Per-session raw + lifecycle log (Task 706). Empty SESSION_ID (enumeration
53
- // spawn) undefined, and the per-date file is the fallback.
54
- const perSessionPath = LOG_DIR && SESSION_ID
55
- ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-${SESSION_ID}.log`)
56
- : undefined;
57
- const perDatePath = LOG_DIR
58
- ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-stderr-${new Date(spawnStamp).toISOString().slice(0, 10)}.log`)
53
+ // The one raw sink (Task 1721). A sessionless spawn (rc-daemon stamps
54
+ // SESSION_ID='' rc-daemon.ts:513 while still stamping LOG_DIR) shares one
55
+ // fixed file per server rather than a date-named one: the date was never read
56
+ // by any reader and named a process lifetime, not a day. Interleaved spawns in
57
+ // the nosession file are separated by the [mcp-helper] op=spawn pid= lines.
58
+ const rawSinkPath = LOG_DIR
59
+ ? (0, node_path_1.resolve)(LOG_DIR, SESSION_ID ? `mcp-${SERVER_NAME}-${SESSION_ID}.log` : `mcp-${SERVER_NAME}-nosession.log`)
59
60
  : undefined;
60
61
  // Rolling tail of entry stderr for op=exit. Capped so a chatty server cannot
61
62
  // grow the buffer without bound.
@@ -66,7 +67,7 @@ let exitEmitted = false;
66
67
  let exitSignal;
67
68
  // The real stderr writer, captured before the tee replaces it. Lifecycle lines
68
69
  // and stderr passthrough both go through this so they are never re-teed into
69
- // the per-date sink nor recursed back into the patched writer.
70
+ // the raw sink nor recursed back into the patched writer.
70
71
  const rawStderrWrite = process.stderr.write.bind(process.stderr);
71
72
  // LOG_DIR is created once, lazily, on the first successful append — not per
72
73
  // chunk. teeWrite runs on the server's own stderr hot path now, so a per-call
@@ -115,7 +116,7 @@ function postToServerLog(suffix, level) {
115
116
  // log-ingest route rejects newlines).
116
117
  function emitLifecycle(suffix, level) {
117
118
  const line = `[mcp-helper] ${suffix}\n`;
118
- appendSafe(perSessionPath, line);
119
+ appendSafe(rawSinkPath, line);
119
120
  try {
120
121
  rawStderrWrite(line);
121
122
  }
@@ -127,12 +128,11 @@ if (!ENTRY) {
127
128
  process.exit(2);
128
129
  }
129
130
  // Replace process.stderr.write with a tee: mirror every server stderr byte to
130
- // the per-date and per-session sinks, keep a rolling tail for op=exit, emit
131
+ // the raw sink, keep a rolling tail for op=exit, emit
131
132
  // op=boot on the first bytes, then pass the write through to the real stderr.
132
133
  const teeWrite = ((...args) => {
133
134
  const chunk = args[0];
134
- appendSafe(perDatePath, chunk); // per-date raw (back-compat)
135
- appendSafe(perSessionPath, chunk); // per-session raw (Task 706)
135
+ appendSafe(rawSinkPath, chunk); // raw sink (Task 1721)
136
136
  const text = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
137
137
  stderrTail = (stderrTail + text).slice(-TAIL_CAP);
138
138
  if (!bootEmitted) {
@@ -1 +1 @@
1
- {"version":3,"file":"voice-distil-profile.d.ts","sourceRoot":"","sources":["../../src/tools/voice-distil-profile.ts"],"names":[],"mappings":"AA4BA,OAAO,E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,IAAI,CAAC;IAClC,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnD;AA6jBD,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,wBAAwB,GAAG,wBAAwB,EAAE,CAAC,CAqHhE"}
1
+ {"version":3,"file":"voice-distil-profile.d.ts","sourceRoot":"","sources":["../../src/tools/voice-distil-profile.ts"],"names":[],"mappings":"AA4BA,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AAsFhC,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;IACpC,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EACP,iBAAiB,GACjB,QAAQ,GACR,cAAc,GACd,oBAAoB,GACpB,0BAA0B,GAC1B,6BAA6B,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8FAA8F;IAC9F,SAAS,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAClC,yGAAyG;IACzG,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnD;AA6nBD,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,wBAAwB,GAAG,wBAAwB,EAAE,CAAC,CAqHhE"}
@@ -53,6 +53,46 @@ function toJsNumber(value) {
53
53
  const SAMPLE_CHAR_CAP = 120_000;
54
54
  const RE_RUN_GROWTH_FRACTION = 0.2;
55
55
  const RE_RUN_AGE_DAYS = 30;
56
+ /**
57
+ * The write merged the profile but linked no sources, because no sampled node
58
+ * carried readable text.
59
+ *
60
+ * `VOICE_CORPUS_WHERE` has no body predicate, so a node holding no body,
61
+ * abstract, subject, title or summary still counts toward `corpusSize`, still
62
+ * clears the empty-corpus guard, and is then dropped by the body walk. Reaching
63
+ * this needs nothing deleted: one caption-less `:SocialPost` is enough. It is
64
+ * the reachable half of the zero-record write, which is why it does not share
65
+ * wording with the vanished-samples case below.
66
+ *
67
+ * `walked` and `corpusSize` are reported separately and are not the same number.
68
+ * `corpusSize` counts the whole corpus; the body walk is capped at 500, most
69
+ * recent first. So a zero sample proves only that the walked window held no
70
+ * text, never that the whole corpus does, and the message must not claim it.
71
+ */
72
+ function noSampleTextMessage(profileUserId, format, corpusSize, walked) {
73
+ return (`voice-distil-profile: the ${format} voice profile for '${profileUserId}' was written, but no ` +
74
+ `source links were recorded. The corpus holds ${corpusSize} ${format} item(s) for this key; the ` +
75
+ `write walked ${walked} of them, most recent first, and none carried readable text to sample. ` +
76
+ `The style card was saved with no sources attached. This is a content condition, not an identity one.`);
77
+ }
78
+ /**
79
+ * The write merged the profile but linked no sources, because none of the ids it
80
+ * attempted still resolved. `phase` names the read the ids came from, so the
81
+ * message points at the window they went stale in.
82
+ *
83
+ * Only a hard delete produces this. The write resolves with a bare
84
+ * `MATCH (s) WHERE elementId(s) = sid`, which carries no trash predicate, so a
85
+ * node trashed by either signal `notTrashed` recognises (the `:Trashed` label or
86
+ * a `deletedAt` stamp) still resolves and still takes its edge. Naming trashing
87
+ * here would send the operator to look in a trash that cannot hold the cause.
88
+ */
89
+ function noSourcesResolvedMessage(profileUserId, format, attempted, phase) {
90
+ return (`voice-distil-profile: the ${format} voice profile for '${profileUserId}' was written, but none ` +
91
+ `of the ${attempted} item(s) it sampled could be linked as sources. They stopped resolving ` +
92
+ `between the ${phase} and the write, which happens when content is deleted from the graph ` +
93
+ `mid-run. The style card was saved with no sources attached. This is a content condition, not ` +
94
+ `an identity one.`);
95
+ }
56
96
  // The agent produces a YAML style card with at minimum these keys:
57
97
  // sentenceLengthDistribution, register, favoured, avoided, taboos,
58
98
  // openingPattern, closingPattern, exemplarSentences
@@ -241,10 +281,14 @@ async function distilForFormat(params) {
241
281
  p.feedbackEntries = $feedbackEntries,
242
282
  p.updatedAt = $now
243
283
  WITH p
244
- UNWIND $sampleIds AS sid
245
- MATCH (s) WHERE elementId(s) = sid
246
- MERGE (p)-[:LEARNED_FROM]->(s)
247
- RETURN elementId(p) AS profileId`, {
284
+ CALL {
285
+ WITH p
286
+ UNWIND $sampleIds AS sid
287
+ MATCH (s) WHERE elementId(s) = sid
288
+ MERGE (p)-[:LEARNED_FROM]->(s)
289
+ RETURN count(*) AS learned
290
+ }
291
+ RETURN elementId(p) AS profileId, learned`, {
248
292
  accountId,
249
293
  profileUserId,
250
294
  format,
@@ -255,12 +299,38 @@ async function distilForFormat(params) {
255
299
  feedbackEntries: feedbackIntents.length,
256
300
  sampleIds: samples.map((s) => s.id),
257
301
  });
302
+ // Zero records now means only that the anchor MATCH found nothing. The
303
+ // sample link sits in a CALL subquery whose bare aggregation returns a row
304
+ // over empty input, so an empty or all-stale sample set no longer collapses
305
+ // the result and no longer reads as an identity failure.
258
306
  if (writeResult.records.length === 0) {
259
307
  throw new Error(scope === "org"
260
308
  ? `voice-mirror: :LocalBusiness {accountId='${accountId}'} not found. The account org node must exist before an org distil (created at onboarding alongside :AdminUser).`
261
309
  : unknownAdminUserMessage("voice-distil-profile", profileUserId, accountId));
262
310
  }
263
311
  const profileId = writeResult.records[0].get("profileId");
312
+ // Only the zero test is load-bearing. `count(*)` counts subquery rows, not
313
+ // distinct nodes, so a duplicated id would inflate it above the edge count
314
+ // that MERGE actually wrote. Never surface this as a source count without
315
+ // switching it to count(DISTINCT s).
316
+ const learned = toJsNumber(writeResult.records[0].get("learned")) ?? 0;
317
+ // The profile merged and the style card committed; only the source links
318
+ // are missing. Which of the two causes applies is decided by how many ids
319
+ // the write actually attempted, never by the anchor.
320
+ if (learned === 0) {
321
+ const attempted = samples.length;
322
+ // `sampled` is capped at 500, so it can be smaller than corpusSize. Both
323
+ // are logged: attempted=0 with sampled<corpusSize means the walked window
324
+ // held no text, which is not the same claim as the whole corpus holding
325
+ // none.
326
+ const walked = sampled.records.length;
327
+ process.stderr.write(`[voice-distil] scope=${scope} userId=${profileUserId} anchor=${anchorLabel} format=${format} ` +
328
+ `mode=write sources=none attempted=${attempted} resolved=0 sampled=${walked} ` +
329
+ `corpusSize=${corpusSize}\n`);
330
+ throw new Error(attempted === 0
331
+ ? noSampleTextMessage(profileUserId, format, corpusSize, walked)
332
+ : noSourcesResolvedMessage(profileUserId, format, attempted, "corpus walk"));
333
+ }
264
334
  process.stderr.write(`[voice-distil] scope=${scope} userId=${profileUserId} anchor=${anchorLabel} format=${format} corpusSize=${corpusSize} generatedAt=${nowIso} feedbackEntries=${feedbackIntents.length}${scope === "org" ? " sentinel=__org__" : ""}\n`);
265
335
  return {
266
336
  profileId,
@@ -486,11 +556,14 @@ async function amendWriteForFormat(params) {
486
556
  p.feedbackEntries = $feedbackEntries,
487
557
  p.updatedAt = $now
488
558
  WITH p
489
- UNWIND $amendIds AS sid
490
- MATCH (s) WHERE elementId(s) = sid
491
- MERGE (p)-[:LEARNED_FROM]->(s)
492
- WITH p
493
- RETURN elementId(p) AS profileId, p.corpusSize AS corpusSize`, {
559
+ CALL {
560
+ WITH p
561
+ UNWIND $amendIds AS sid
562
+ MATCH (s) WHERE elementId(s) = sid
563
+ MERGE (p)-[:LEARNED_FROM]->(s)
564
+ RETURN count(*) AS learned
565
+ }
566
+ RETURN elementId(p) AS profileId, p.corpusSize AS corpusSize, learned`, {
494
567
  accountId,
495
568
  profileUserId,
496
569
  format,
@@ -500,6 +573,8 @@ async function amendWriteForFormat(params) {
500
573
  feedbackEntries,
501
574
  amendIds: resolvedAmendIds,
502
575
  });
576
+ // As in distilForFormat: zero records now means only that the anchor MATCH
577
+ // found nothing.
503
578
  if (result.records.length === 0) {
504
579
  throw new Error(scope === "org"
505
580
  ? `voice-mirror: :LocalBusiness {accountId='${accountId}'} not found. The account org node must exist before an org amend-write.`
@@ -507,6 +582,20 @@ async function amendWriteForFormat(params) {
507
582
  }
508
583
  const profileId = result.records[0].get("profileId");
509
584
  const corpusSize = toJsNumber(result.records[0].get("corpusSize")) ?? 0;
585
+ const learned = toJsNumber(result.records[0].get("learned")) ?? 0;
586
+ // `amendIds` is the pre-resolved list and the step-1 guard already refused
587
+ // an empty one, so a zero here is always a mid-call race, never an empty
588
+ // input. That is why this path has no empty-sample wording: it cannot reach
589
+ // it.
590
+ //
591
+ // The window named is the step-1 resolve, not the operator's earlier
592
+ // eligibility check. Step 1 proved these ids live milliseconds ago in this
593
+ // same call, so that is the window they died in and the one worth naming.
594
+ if (learned === 0) {
595
+ process.stderr.write(`[voice-distil] scope=${scope} mode=write userId=${profileUserId} anchor=${anchorLabel} ` +
596
+ `format=${format} amended=true sources=none attempted=${resolvedAmendIds.length} resolved=0\n`);
597
+ throw new Error(noSourcesResolvedMessage(profileUserId, format, resolvedAmendIds.length, "id resolve"));
598
+ }
510
599
  process.stderr.write(`[voice-distil] scope=${scope} mode=write userId=${profileUserId} anchor=${anchorLabel} format=${format} amended=true ` +
511
600
  `amendedFromNodeIds=${amendedFromNodeIds.length} corpusSize=${corpusSize} ` +
512
601
  `generatedAt=${nowIso} feedbackEntries=${feedbackEntries}\n`);
@@ -1 +1 @@
1
- {"version":3,"file":"voice-distil-profile.js","sourceRoot":"","sources":["../../src/tools/voice-distil-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,mCAAmC,EACnC,qBAAqB,EACrB,aAAa,GAGd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;GAQG;AACH,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,OAAQ,KAAoC,CAAC,QAAQ,EAAE,CAAC;IAChF,IAAI,OAAO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3,"file":"voice-retrieve-conditioning.d.ts","sourceRoot":"","sources":["../../src/tools/voice-retrieve-conditioning.ts"],"names":[],"mappings":"AA+BA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AAMhC,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;;WAGG;QACH,MAAM,EAAE,WAAW,CAAC;QACpB;;;;WAIG;QACH,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;;;WAKG;QACH,KAAK,CAAC,EAAE,UAAU,CAAC;KACpB,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9E,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,+BAA+B,CAAC,CA8J1C"}
1
+ {"version":3,"file":"voice-retrieve-conditioning.d.ts","sourceRoot":"","sources":["../../src/tools/voice-retrieve-conditioning.ts"],"names":[],"mappings":"AAwCA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AAMhC,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;;WAGG;QACH,MAAM,EAAE,WAAW,CAAC;QACpB;;;;WAIG;QACH,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;;;WAKG;QACH,KAAK,CAAC,EAAE,UAAU,CAAC;KACpB,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9E,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAgBD,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,+BAA+B,CAAC,CAuL1C"}
@@ -10,9 +10,18 @@
10
10
  * - All callers updated in the same commit.
11
11
  *
12
12
  * Retrieval order (best to worst):
13
- * 1. If brief.topic is provided AND keyword search on the per-format corpus
14
- * returns ≥K matches use those (ordered by recency).
15
- * 2. Otherwise, return the K most-recent per-format corpus nodes.
13
+ * 1. Corpus nodes whose body carries the most `brief.topic` terms.
14
+ * 2. Within an equal term count, the most recent.
15
+ *
16
+ * `brief.topic` ranks; it never excludes. Until Task 1719 it was applied as
17
+ * `WHERE toLower(body) CONTAINS toLower($topic)` — a single literal
18
+ * whole-phrase match — so a multi-word topic ('programme outline training')
19
+ * matched no body and the walk returned zero exemplars over a non-empty
20
+ * corpus, while `status` still read "ok" because a style card alone satisfies
21
+ * `hasData`. Ranking honours this header's original intent (topic hits first,
22
+ * K backfilled by recency) in one pass: a voice profile conditions on how the
23
+ * operator writes, not what about, so an off-topic exemplar still carries the
24
+ * signal and is always worth more than nothing.
16
25
  *
17
26
  * Embeddings are not used in v1: the corpus is small (single operator's
18
27
  * personal writing — typically <500 docs), and recency-with-keyword-filter
@@ -36,6 +45,16 @@ const CHARS_PER_TOKEN = 4;
36
45
  function errorResult(error) {
37
46
  return { styleCard: null, exemplars: [], status: "error", error };
38
47
  }
48
+ /**
49
+ * Cypher `size()` arrives as a driver Integer, not a JS number, and an Integer
50
+ * is truthy at zero — so comparing the raw value would count every row as a
51
+ * topic hit. Narrow it before any arithmetic.
52
+ */
53
+ function toNumber(value) {
54
+ if (neo4j.isInt(value))
55
+ return value.toNumber();
56
+ return typeof value === "number" ? value : 0;
57
+ }
39
58
  export async function voiceRetrieveConditioning(params) {
40
59
  const { accountId, userId, brief } = params;
41
60
  const scope = brief.scope ?? "personal";
@@ -55,12 +74,18 @@ export async function voiceRetrieveConditioning(params) {
55
74
  (length === "long" ? DEFAULT_TOKEN_BUDGET_LONG : DEFAULT_TOKEN_BUDGET_SHORT);
56
75
  const charBudget = tokenBudget * CHARS_PER_TOKEN;
57
76
  const format = brief.format;
58
- const topic = (brief.topic ?? "").trim();
59
- const usesTopic = topic.length > 0;
77
+ // Distinct lowercased topic terms. Lowercasing happens here, once, so the
78
+ // Cypher compares term-to-body without a per-row toLower on the term. An
79
+ // absent/blank topic yields [], which scores every row 0 and leaves the
80
+ // ordering to recency alone — the same walk, no branch.
81
+ const topicTerms = Array.from(new Set((brief.topic ?? "")
82
+ .toLowerCase()
83
+ .split(/\s+/)
84
+ .filter((t) => t.length > 0)));
60
85
  // Body resolution (Task 471): for :KnowledgeDocument with HAS_SECTION
61
86
  // children, concatenate child :Section bodies in `position` order (KD.body is
62
87
  // null after Task 465 server-slicing); other labels read n.body via the
63
- // COALESCE chain. The topic filter runs against the computed body.
88
+ // COALESCE chain. Topic ranking scores against the computed body.
64
89
  const bodyComputeBlock = `WITH n, coalesce(n.dateSent, n.datePublished, n.firstMessageAt, n.dateCreated, n.createdAt) AS ts
65
90
  OPTIONAL MATCH (n)-[:HAS_SECTION]->(s:Section)
66
91
  WHERE ${notTrashed("s")}
@@ -86,30 +111,29 @@ export async function voiceRetrieveConditioning(params) {
86
111
  const profile = await session.run(`OPTIONAL MATCH (p:VoiceProfile {accountId: $accountId, userId: $profileUserId, format: $format})
87
112
  RETURN p.styleCard AS styleCard`, { accountId, profileUserId, format });
88
113
  const styleCard = profile.records[0]?.get("styleCard") ?? null;
89
- const cypher = usesTopic
90
- ? `MATCH (n)
91
- WHERE ${exemplarWhere}
92
- ${bodyComputeBlock}
93
- WHERE toLower(body) CONTAINS toLower($topic)
94
- RETURN elementId(n) AS id, labels(n) AS labels, body,
95
- coalesce(n.subject, n.title, n.name, '') AS source, ts
96
- ORDER BY ts IS NULL, ts DESC
97
- LIMIT $k`
98
- : `MATCH (n)
114
+ // `topicScore` counts how many distinct topic terms the body carries and
115
+ // orders on it. It is a rank, not a predicate: a row scoring 0 stays in
116
+ // the result set and is simply ordered behind the hits, so the walk
117
+ // returns up to K exemplars whenever the corpus holds any, whatever the
118
+ // topic. `ts IS NULL` keeps undated nodes last within an equal score.
119
+ const cypher = `MATCH (n)
99
120
  WHERE ${exemplarWhere}
100
121
  ${bodyComputeBlock}
122
+ WITH n, ts, body,
123
+ size([t IN $topicTerms WHERE toLower(body) CONTAINS t]) AS topicScore
101
124
  RETURN elementId(n) AS id, labels(n) AS labels, body,
102
- coalesce(n.subject, n.title, n.name, '') AS source, ts
103
- ORDER BY ts IS NULL, ts DESC
125
+ coalesce(n.subject, n.title, n.name, '') AS source, ts, topicScore
126
+ ORDER BY topicScore DESC, ts IS NULL, ts DESC
104
127
  LIMIT $k`;
105
128
  const result = await session.run(cypher, {
106
129
  ...exemplarParams,
107
- topic,
130
+ topicTerms,
108
131
  // neo4j-driver serializes a plain JS number as a Cypher float (15 →
109
132
  // 15.0), which LIMIT rejects. Send a Neo4j integer.
110
133
  k: neo4j.int(k),
111
134
  });
112
135
  let charsUsed = 0;
136
+ let topicHits = 0;
113
137
  const exemplars = [];
114
138
  for (const r of result.records) {
115
139
  const body = r.get("body") ?? "";
@@ -128,8 +152,10 @@ export async function voiceRetrieveConditioning(params) {
128
152
  source: (r.get("source") ?? "").slice(0, 200),
129
153
  });
130
154
  charsUsed += truncated.length;
155
+ if (toNumber(r.get("topicScore")) > 0)
156
+ topicHits += 1;
131
157
  }
132
- return { styleCard, exemplars };
158
+ return { styleCard, exemplars, topicHits };
133
159
  };
134
160
  const hasData = (r) => (r.styleCard !== null && r.styleCard.length > 0) || r.exemplars.length > 0;
135
161
  const orgLookup = () => lookup(ORG_USER_ID, voiceCorpusWhereWithFormat(format), { accountId, format });
@@ -154,8 +180,15 @@ export async function voiceRetrieveConditioning(params) {
154
180
  result = org;
155
181
  status = hasData(org) ? "ok" : "no-data";
156
182
  }
183
+ // `topicTerms`/`topicHits` are the pair that makes a thin result legible
184
+ // without reproducing it: exemplarCount=0 says the scope's corpus is empty,
185
+ // and topicHits=0 with topicTerms>0 says the exemplars are recency-picked
186
+ // rather than topic-matched. Before Task 1719 the two were indistinguishable
187
+ // — a topic that matched nothing and an absent corpus both logged
188
+ // exemplarCount=0, and only the first was a defect.
157
189
  process.stderr.write(`[voice-retrieve] scope=${scope} format=${format} status=${status} ` +
158
- `styleCardBytes=${result.styleCard?.length ?? 0} exemplarCount=${result.exemplars.length} tokenBudget=${tokenBudget}\n`);
190
+ `styleCardBytes=${result.styleCard?.length ?? 0} exemplarCount=${result.exemplars.length} ` +
191
+ `topicTerms=${topicTerms.length} topicHits=${result.topicHits} tokenBudget=${tokenBudget}\n`);
159
192
  return { styleCard: result.styleCard, exemplars: result.exemplars, status };
160
193
  }
161
194
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"voice-retrieve-conditioning.js","sourceRoot":"","sources":["../../src/tools/voice-retrieve-conditioning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAuB,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EACL,0BAA0B,EAC1B,mCAAmC,EACnC,WAAW,GAGZ,MAAM,wBAAwB,CAAC;AAEhC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAC1C,MAAM,yBAAyB,GAAG,MAAM,CAAC;AACzC,MAAM,eAAe,GAAG,CAAC,CAAC;AAgE1B,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACpE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAuC;IAEvC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAC5C,MAAM,KAAK,GAAe,KAAK,CAAC,KAAK,IAAI,UAAU,CAAC;IACpD,6EAA6E;IAC7E,4EAA4E;IAC5E,8EAA8E;IAC9E,8EAA8E;IAC9E,6EAA6E;IAC7E,gFAAgF;IAChF,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/C,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,kDAAkD,KAAK,cAAc,OAAO,CAAC,SAAS,CAAC,WAAW,OAAO,CAAC,MAAM,CAAC,IAAI,CACtH,CAAC;QACF,OAAO,WA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