@rubytech/create-maxy-code 0.1.147 → 0.1.150

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 (119) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/graph-search/dist/index.d.ts +34 -11
  3. package/payload/platform/lib/graph-search/dist/index.d.ts.map +1 -1
  4. package/payload/platform/lib/graph-search/dist/index.js +42 -13
  5. package/payload/platform/lib/graph-search/dist/index.js.map +1 -1
  6. package/payload/platform/lib/graph-search/src/__tests__/fulltext-coverage.test.ts +75 -40
  7. package/payload/platform/lib/graph-search/src/index.ts +45 -12
  8. package/payload/platform/lib/graph-style/dist/index.d.ts +5 -5
  9. package/payload/platform/lib/graph-style/dist/index.d.ts.map +1 -1
  10. package/payload/platform/lib/graph-style/dist/index.js +11 -9
  11. package/payload/platform/lib/graph-style/dist/index.js.map +1 -1
  12. package/payload/platform/lib/graph-style/src/index.ts +11 -9
  13. package/payload/platform/lib/graph-trash/dist/index.js +6 -6
  14. package/payload/platform/lib/graph-trash/dist/index.js.map +1 -1
  15. package/payload/platform/lib/graph-trash/src/index.ts +6 -6
  16. package/payload/platform/neo4j/edge-annotations.json +4 -4
  17. package/payload/platform/neo4j/schema.cypher +143 -58
  18. package/payload/platform/plugins/admin/PLUGIN.md +1 -2
  19. package/payload/platform/plugins/admin/hooks/__tests__/pre-turn-graph-pass.test.sh +544 -0
  20. package/payload/platform/plugins/admin/hooks/__tests__/session-end-retrospective.test.sh +2 -2
  21. package/payload/platform/plugins/admin/hooks/archive-ingest-surface-gate.sh +2 -2
  22. package/payload/platform/plugins/admin/hooks/{post-turn-graph-pass.sh → pre-turn-graph-pass.sh} +83 -53
  23. package/payload/platform/plugins/admin/hooks/session-end-retrospective.sh +6 -3
  24. package/payload/platform/plugins/docs/references/linkedin-extension.md +1 -1
  25. package/payload/platform/plugins/docs/references/platform.md +1 -1
  26. package/payload/platform/plugins/docs/references/plugins-guide.md +2 -2
  27. package/payload/platform/plugins/linkedin-import/skills/linkedin-import/SKILL.md +5 -5
  28. package/payload/platform/plugins/memory/.claude-plugin/plugin.json +1 -1
  29. package/payload/platform/plugins/memory/PLUGIN.md +4 -4
  30. package/payload/platform/plugins/memory/bin/conversation-archive-ingest.mjs +5 -5
  31. package/payload/platform/plugins/memory/bin/conversation-archive-ingest.sh +1 -1
  32. package/payload/platform/plugins/memory/mcp/dist/index.js +35 -33
  33. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
  34. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-revision.test.js +4 -1
  35. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-revision.test.js.map +1 -1
  36. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts +2 -0
  37. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts.map +1 -0
  38. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js +90 -0
  39. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js.map +1 -0
  40. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts +14 -0
  41. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts.map +1 -1
  42. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js +27 -4
  43. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js.map +1 -1
  44. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-citation-audit.d.ts +1 -1
  45. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-citation-audit.js +2 -2
  46. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-orphans.d.ts +1 -1
  47. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-orphans.js +1 -1
  48. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts +2 -2
  49. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts.map +1 -1
  50. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js +3 -4
  51. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js.map +1 -1
  52. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.d.ts.map +1 -1
  53. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.js +6 -0
  54. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.js.map +1 -1
  55. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights.test.js +2 -2
  56. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights.test.js.map +1 -1
  57. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest.test.js +17 -17
  58. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest.test.js.map +1 -1
  59. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-fields.test.js +1 -0
  60. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-fields.test.js.map +1 -1
  61. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts +2 -0
  62. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts.map +1 -0
  63. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js +329 -0
  64. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js.map +1 -0
  65. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-compiled-truth-rejection.test.d.ts +2 -0
  66. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-compiled-truth-rejection.test.d.ts.map +1 -0
  67. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-compiled-truth-rejection.test.js +39 -0
  68. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-compiled-truth-rejection.test.js.map +1 -0
  69. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.d.ts +3 -3
  70. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.js +6 -6
  71. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.js.map +1 -1
  72. package/payload/platform/plugins/memory/mcp/dist/tools/memory-delete.d.ts +1 -1
  73. package/payload/platform/plugins/memory/mcp/dist/tools/memory-delete.js +9 -3
  74. package/payload/platform/plugins/memory/mcp/dist/tools/memory-delete.js.map +1 -1
  75. package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.d.ts +2 -0
  76. package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.d.ts.map +1 -1
  77. package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.js.map +1 -1
  78. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts +6 -5
  79. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts.map +1 -1
  80. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js +30 -29
  81. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js.map +1 -1
  82. package/payload/platform/plugins/memory/mcp/dist/tools/memory-restore.d.ts +1 -1
  83. package/payload/platform/plugins/memory/mcp/dist/tools/memory-restore.js +4 -1
  84. package/payload/platform/plugins/memory/mcp/dist/tools/memory-restore.js.map +1 -1
  85. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.d.ts.map +1 -1
  86. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js +1 -11
  87. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js.map +1 -1
  88. package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.d.ts +27 -18
  89. package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.d.ts.map +1 -1
  90. package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js +83 -70
  91. package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js.map +1 -1
  92. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
  93. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +27 -0
  94. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
  95. package/payload/platform/plugins/memory/mcp/vitest.config.ts +2 -0
  96. package/payload/platform/plugins/memory/references/schema-base.md +7 -6
  97. package/payload/platform/plugins/memory/skills/conversation-archive/SKILL.md +12 -12
  98. package/payload/platform/plugins/scheduling/skills/daily-prep/SKILL.md +2 -2
  99. package/payload/platform/plugins/whatsapp/PLUGIN.md +1 -1
  100. package/payload/platform/plugins/x-import/PLUGIN.md +3 -3
  101. package/payload/platform/plugins/x-import/skills/x-import/SKILL.md +7 -7
  102. package/payload/platform/scripts/seed-neo4j.sh +3 -3
  103. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  104. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +0 -1
  105. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  106. package/payload/platform/templates/agents/admin/IDENTITY.md +7 -7
  107. package/payload/platform/templates/specialists/agents/database-operator.md +6 -6
  108. package/payload/platform/templates/specialists/agents/librarian.md +2 -2
  109. package/payload/server/public/assets/{admin-_pm0RRTE.js → admin-CQMFJD81.js} +1 -1
  110. package/payload/server/public/assets/{data-b6q64Ot4.js → data-k-sUX-rP.js} +1 -1
  111. package/payload/server/public/assets/{graph-D1SVlBLb.js → graph-By7i71WM.js} +1 -1
  112. package/payload/server/public/assets/{graph-labels-BiDGzVs2.js → graph-labels-DemDBXA3.js} +1 -1
  113. package/payload/server/public/assets/{page-DwFigpyR.js → page-CHBpFW3X.js} +1 -1
  114. package/payload/server/public/assets/{page-BV6E4J2q.js → page-jqA-w9gF.js} +1 -1
  115. package/payload/server/public/data.html +3 -3
  116. package/payload/server/public/graph.html +3 -3
  117. package/payload/server/public/index.html +4 -4
  118. package/payload/server/server.js +29 -20
  119. package/payload/platform/plugins/admin/skills/commitment-followthrough/SKILL.md +0 -60
@@ -4,19 +4,16 @@ import { buildTextRepresentation } from "./memory-write.js";
4
4
  import { checkGraphWriteGate, checkLabelWriteGate, checkPropertyWriteGate, COMPILED_TRUTH_MAX_CHARS, } from "../lib/graph-write-gate.js";
5
5
  import { checkLabelOriginGate } from "../lib/label-origin-gate.js";
6
6
  import { withWriteEvent, pickName } from "../lib/log-ingest.js";
7
- import { rewriteCompiledTruth, } from "../lib/compiled-truth-rewriter.js";
7
+ import { rewriteCompiledTruth, OPERATOR_HINT_MAX_CHARS, } from "../lib/compiled-truth-rewriter.js";
8
8
  import { REVISION_CYPHER_FRAGMENT } from "../lib/compiled-truth-revision.js";
9
9
  /** Stripped silently — operator can't update these via the agent. */
10
10
  const RESTRICTED_KEYS = new Set(["embedding", "accountId", "createdAt", "createdOn"]);
11
11
  /**
12
12
  * Loud-fail keys — write attempts throw rather than silently strip (Task 306,
13
- * extended Task 392). The public-twin timestamp + source are system-managed:
14
- * they are stamped by the rewriter or by the operator-override path. Note
15
- * that `compiledTruthPublic` itself is NOT in this set because the operator
16
- * override path accepts it as a top-level `compiledTruthPublic` argument
17
- * (not via the property bag). Property-bag writes to `compiledTruthPublic`
18
- * are still blocked by being in this set — operators must use the top-level
19
- * argument so the override semantics are explicit.
13
+ * extended Task 392, locked Task 420). All six compiled-truth fields are
14
+ * system-managed: the rewriter is the only writer for both twins.
15
+ * Operator corrections land via `operatorHint` (admin twin) or
16
+ * `publicOperatorHint` (public twin), never via the property bag.
20
17
  */
21
18
  const SYSTEM_MANAGED_KEYS = new Set([
22
19
  "compiledTruth",
@@ -55,24 +52,41 @@ export async function memoryUpdate(params) {
55
52
  return withWriteEvent({ tool: "memory-update", accountId: params.accountId, name: nameHint }, () => memoryUpdateImpl(params), (r) => ({ elementId: r.nodeId, labels: r.labels, name: nameHint }));
56
53
  }
57
54
  async function memoryUpdateImpl(params) {
58
- const { nodeId, properties, accountId, createdBy, rewriteCompiledTruth: doRewrite, forceRewrite, compiledTruthPublic: operatorPublicOverride, } = params;
59
- // Loud-fail on system-managed keys (Task 306, extended Task 392). Silent
60
- // strip is a known failure classthe caller thinks the update landed,
61
- // agents lose track of writer identity, compiled-truth integrity breaks.
62
- // The public-twin fields are included so a property-bag write to
63
- // `compiledTruthPublic` is rejected; the explicit `compiledTruthPublic`
64
- // top-level argument is the only operator-override path.
55
+ const { nodeId, properties, accountId, createdBy, rewriteCompiledTruth: doRewrite, forceRewrite, operatorHint, publicOperatorHint, } = params;
56
+ // Task 413 / Task 420: operator hints are only valid alongside
57
+ // rewriteCompiledTruth. Throw rather than silently ignorea caller that
58
+ // expected the hint to shape the write would otherwise see a regular
59
+ // rewriter-source pass and believe the operator correction landed.
60
+ for (const [name, value] of [
61
+ ["operatorHint", operatorHint],
62
+ ["publicOperatorHint", publicOperatorHint],
63
+ ]) {
64
+ if (value === undefined)
65
+ continue;
66
+ if (!doRewrite) {
67
+ throw new Error(`${name} requires rewriteCompiledTruth:true — the hint can only land via the rewriter.`);
68
+ }
69
+ if (typeof value !== "string" || value.trim() === "") {
70
+ throw new Error(`${name} must be a non-empty string.`);
71
+ }
72
+ if (value.length > OPERATOR_HINT_MAX_CHARS) {
73
+ throw new Error(`${name} length ${value.length} exceeds cap of ${OPERATOR_HINT_MAX_CHARS} chars.`);
74
+ }
75
+ }
76
+ // Loud-fail on system-managed keys (Task 306, extended Task 392, locked
77
+ // Task 420). Silent strip is a known failure class — the caller thinks the
78
+ // update landed, agents lose track of writer identity, compiled-truth
79
+ // integrity breaks. All six compiled-truth fields are rewriter-only;
80
+ // operator corrections land via operatorHint / publicOperatorHint.
65
81
  for (const key of Object.keys(properties)) {
66
82
  if (SYSTEM_MANAGED_KEYS.has(key)) {
67
83
  throw new Error(`Update blocked (system-managed-key): '${key}' cannot be set via the properties bag. ` +
68
- `Use rewriteCompiledTruth:true to recompute, or the top-level compiledTruthPublic argument for an operator override.`);
84
+ `Use rewriteCompiledTruth:true (optionally with operatorHint or publicOperatorHint) to recompute.`);
69
85
  }
70
86
  }
71
- const wantsAnyWrite = Object.keys(properties).length > 0 ||
72
- doRewrite ||
73
- typeof operatorPublicOverride === "string";
87
+ const wantsAnyWrite = Object.keys(properties).length > 0 || doRewrite;
74
88
  if (!wantsAnyWrite) {
75
- throw new Error("No properties to update — provide at least one property, rewriteCompiledTruth:true, or compiledTruthPublic.");
89
+ throw new Error("No properties to update — provide at least one property or rewriteCompiledTruth:true.");
76
90
  }
77
91
  // Property-level cap. compiledTruth direct-write is blocked above; this
78
92
  // covers the case where a future property carries the same cap doctrine.
@@ -86,9 +100,7 @@ async function memoryUpdateImpl(params) {
86
100
  if (!RESTRICTED_KEYS.has(key))
87
101
  safeProps[key] = value;
88
102
  }
89
- if (Object.keys(safeProps).length === 0 &&
90
- !doRewrite &&
91
- typeof operatorPublicOverride !== "string") {
103
+ if (Object.keys(safeProps).length === 0 && !doRewrite) {
92
104
  throw new Error("All provided properties are restricted and cannot be updated.");
93
105
  }
94
106
  const session = getSession();
@@ -131,7 +143,6 @@ async function memoryUpdateImpl(params) {
131
143
  }
132
144
  let rewriterOutcome;
133
145
  let publicRewriterOutcome;
134
- let publicOverrideOutcome;
135
146
  // ----- Property update branch -----
136
147
  let updatedNodeId = nodeId;
137
148
  let nodeLabels = targetLabels;
@@ -182,15 +193,27 @@ async function memoryUpdateImpl(params) {
182
193
  throw new Error(`rewriteCompiledTruth is only valid on :Person / :Organization / :Concept / :Project / :LocalBusiness. ` +
183
194
  `Got labels: [${targetLabels.join(", ")}]`);
184
195
  }
196
+ // Task 420: publicOperatorHint requires a public-twin label. :Person
197
+ // carries no public twin; refusing here is preferable to silently
198
+ // dropping the hint after the admin pass runs.
199
+ if (publicOperatorHint && !pickPublicTwinLabel(targetLabels)) {
200
+ throw new Error(`publicOperatorHint requires a public-twin label (:Organization / :Concept / :Project / :LocalBusiness). ` +
201
+ `Got labels: [${targetLabels.join(", ")}]`);
202
+ }
185
203
  // Operator cooldown: if compiledTruthSource = 'operator' and the last
186
204
  // update is within 7 days, refuse unless forceRewrite is set. The
187
205
  // cooldown protects an operator-authored summary from being overwritten
188
206
  // by the next backfill / dream-cycle pass.
207
+ //
208
+ // Task 413: an operatorHint is itself operator-driven, so it bypasses
209
+ // the cooldown — the operator must be free to refine their own prior
210
+ // correction without waiting seven days.
189
211
  const currentSource = labelRecord.get("compiledTruthSource");
190
212
  const currentUpdated = labelRecord.get("compiledTruthUpdatedAt");
191
213
  if (currentSource === "operator" &&
192
214
  currentUpdated &&
193
- !forceRewrite) {
215
+ !forceRewrite &&
216
+ !operatorHint) {
194
217
  const updatedMs = new Date(String(currentUpdated)).getTime();
195
218
  const elapsed = Date.now() - updatedMs;
196
219
  if (!Number.isNaN(updatedMs) && elapsed < OPERATOR_COOLDOWN_MS) {
@@ -232,7 +255,12 @@ async function memoryUpdateImpl(params) {
232
255
  subjectName,
233
256
  currentTruth,
234
257
  events,
258
+ operatorHint,
235
259
  });
260
+ // Task 413: an operator-hint pass attributes the write to the operator;
261
+ // a hint-less pass remains rewriter-attributed. This drives both the
262
+ // live property stamp and the :CompiledTruthRevision row source.
263
+ const rewriteSource = operatorHint ? "operator" : "rewriter";
236
264
  if (rewrite.kind === "ok") {
237
265
  // Validate the rewriter output against the cap before writing.
238
266
  const writeCheck = checkPropertyWriteGate({
@@ -250,32 +278,41 @@ async function memoryUpdateImpl(params) {
250
278
  await session.run(`MATCH (n) WHERE elementId(n) = $nodeId AND n.accountId = $accountId
251
279
  SET n.compiledTruth = $truth,
252
280
  n.compiledTruthUpdatedAt = datetime(),
253
- n.compiledTruthSource = 'rewriter'
281
+ n.compiledTruthSource = $source
254
282
  ${REVISION_CYPHER_FRAGMENT}`, {
255
283
  nodeId,
256
284
  accountId,
257
285
  truth: rewrite.compiledTruth,
258
- source: "rewriter",
286
+ source: rewriteSource,
259
287
  });
260
288
  rewriterOutcome = {
261
289
  kind: "ok",
262
290
  charsBefore: currentTruth.length,
263
291
  charsAfter: rewrite.compiledTruth.length,
292
+ source: rewriteSource,
264
293
  };
265
- // ----- Public-twin pass (Task 392) -----
266
- // Auto-fire when (a) the label is in the public-twin set,
267
- // (b) the admin rewrite actually changed the truth string (string-
268
- // identical no-op skips the public pass to avoid spending an LLM
269
- // call producing the same public summary), (c) the public-cooldown
270
- // for an operator-authored override has not been violated.
294
+ // ----- Public-twin pass (Task 392, locked Task 420) -----
295
+ // Trigger conditions, in order:
296
+ // 1. The label carries a public twin.
297
+ // 2. EITHER the operator supplied `publicOperatorHint` (explicit
298
+ // public-side correction fires regardless of whether the admin
299
+ // pass changed the truth) OR the admin rewrite actually changed
300
+ // the truth string AND no admin `operatorHint` was set (admin-
301
+ // side corrections must not leak unreviewed to the public surface).
302
+ // 3. Public-cooldown is not in effect, unless `publicOperatorHint`
303
+ // is set (operator-driven passes bypass their own cooldown).
271
304
  const publicLabel = pickPublicTwinLabel(targetLabels);
272
305
  const adminChanged = rewrite.compiledTruth !== currentTruth;
273
- if (publicLabel && adminChanged) {
306
+ const publicTrigger = !!publicOperatorHint || (adminChanged && !operatorHint);
307
+ if (publicLabel && publicTrigger) {
274
308
  const publicSource = labelRecord.get("compiledTruthPublicSource");
275
309
  const publicUpdated = labelRecord.get("compiledTruthPublicUpdatedAt");
276
310
  let inCooldown = false;
277
311
  let publicCooldownDaysRemaining = 0;
278
- if (publicSource === "operator" && publicUpdated && !forceRewrite) {
312
+ if (publicSource === "operator" &&
313
+ publicUpdated &&
314
+ !forceRewrite &&
315
+ !publicOperatorHint) {
279
316
  const ms = new Date(String(publicUpdated)).getTime();
280
317
  const elapsed = Date.now() - ms;
281
318
  if (!Number.isNaN(ms) && elapsed < OPERATOR_COOLDOWN_MS) {
@@ -300,7 +337,11 @@ async function memoryUpdateImpl(params) {
300
337
  subjectName,
301
338
  currentTruth: currentPublic,
302
339
  events,
340
+ operatorHint: publicOperatorHint,
303
341
  });
342
+ const publicSourceStamp = publicOperatorHint
343
+ ? "operator"
344
+ : "rewriter";
304
345
  if (publicRewrite.kind === "ok") {
305
346
  const publicWriteCheck = checkPropertyWriteGate({
306
347
  properties: { compiledTruthPublic: publicRewrite.compiledTruth },
@@ -311,11 +352,17 @@ async function memoryUpdateImpl(params) {
311
352
  await session.run(`MATCH (n) WHERE elementId(n) = $nodeId AND n.accountId = $accountId
312
353
  SET n.compiledTruthPublic = $truth,
313
354
  n.compiledTruthPublicUpdatedAt = datetime(),
314
- n.compiledTruthPublicSource = 'rewriter'`, { nodeId, accountId, truth: publicRewrite.compiledTruth });
355
+ n.compiledTruthPublicSource = $source`, {
356
+ nodeId,
357
+ accountId,
358
+ truth: publicRewrite.compiledTruth,
359
+ source: publicSourceStamp,
360
+ });
315
361
  publicRewriterOutcome = {
316
362
  kind: "ok",
317
363
  charsBefore: currentPublic.length,
318
364
  charsAfter: publicRewrite.compiledTruth.length,
365
+ source: publicSourceStamp,
319
366
  };
320
367
  }
321
368
  else if (publicRewrite.kind === "refused") {
@@ -340,46 +387,12 @@ async function memoryUpdateImpl(params) {
340
387
  rewriterOutcome = { kind: "llm-failure", cause: rewrite.fallback.cause };
341
388
  }
342
389
  }
343
- // ----- Operator direct-write of compiledTruthPublic (Task 392) -----
344
- // Independent of the rewriter branch. Validates the label is in the
345
- // public-twin set, runs the length cap, stamps source='operator' and
346
- // resets the public-cooldown timer. Always writes (no cooldown on the
347
- // operator-edit side itself; cooldown only blocks the auto-rewriter
348
- // from overwriting operator edits later).
349
- if (typeof operatorPublicOverride === "string") {
350
- const publicLabel = pickPublicTwinLabel(targetLabels);
351
- if (!publicLabel) {
352
- publicOverrideOutcome = { kind: "refused", reason: "wrong-label" };
353
- console.log(`[memory-update] public-override refused nodeId=${nodeId.slice(0, 12)} ` +
354
- `reason=wrong-label labels=[${targetLabels.join(",")}]`);
355
- }
356
- else {
357
- const overrideCheck = checkPropertyWriteGate({
358
- properties: { compiledTruthPublic: operatorPublicOverride },
359
- });
360
- if (!overrideCheck.ok) {
361
- publicOverrideOutcome = { kind: "refused", reason: "too-long" };
362
- console.log(`[memory-update] public-override refused nodeId=${nodeId.slice(0, 12)} ` +
363
- `reason=too-long len=${operatorPublicOverride.length}`);
364
- }
365
- else {
366
- await session.run(`MATCH (n) WHERE elementId(n) = $nodeId AND n.accountId = $accountId
367
- SET n.compiledTruthPublic = $truth,
368
- n.compiledTruthPublicUpdatedAt = datetime(),
369
- n.compiledTruthPublicSource = 'operator'`, { nodeId, accountId, truth: operatorPublicOverride });
370
- publicOverrideOutcome = { kind: "applied", chars: operatorPublicOverride.length };
371
- console.log(`[memory-update] public-override applied nodeId=${nodeId.slice(0, 12)} ` +
372
- `label=${publicLabel} chars=${operatorPublicOverride.length}`);
373
- }
374
- }
375
- }
376
390
  return {
377
391
  nodeId: updatedNodeId,
378
392
  labels: nodeLabels,
379
393
  updated: Object.keys(safeProps).length > 0,
380
394
  rewriter: rewriterOutcome,
381
395
  publicRewriter: publicRewriterOutcome,
382
- publicOverride: publicOverrideOutcome,
383
396
  };
384
397
  }
385
398
  finally {
@@ -1 +1 @@
1
- {"version":3,"file":"memory-update.js","sourceRoot":"","sources":["../../src/tools/memory-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EACL,oBAAoB,GAIrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAm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,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6HAA6H;IAC7H,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,+EAA+E;IAC/E,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;OAMG;IACH,SAAS,EAAE,YAAY,CAAC;IACxB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAqCD,wBAAsB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAS3E;AAsUD,wFAAwF;AACxF,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,GACd;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAKhD;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EAAE,EAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,CAUR"}
@@ -25,6 +25,22 @@ const PUBLIC_TWIN_LABELS = [
25
25
  ];
26
26
  /** Default `compiledTruthUpdatedAt` on first write — epoch makes stale-detection trivial. */
27
27
  const COMPILED_TRUTH_EPOCH = "1970-01-01T00:00:00Z";
28
+ /**
29
+ * Loud-fail keys (Task 413). The six compiled-truth fields are system-managed
30
+ * on both admin and public twins; the only sanctioned writers are the rewriter
31
+ * library (via memory-update with `rewriteCompiledTruth: true`, optionally
32
+ * carrying `operatorHint` to attribute the pass to the operator) and the
33
+ * defaults block below for first writes. A caller supplying any of these
34
+ * keys in the properties bag is bypassing the audit chain — refuse loudly.
35
+ */
36
+ const SYSTEM_MANAGED_COMPILED_TRUTH_KEYS = [
37
+ "compiledTruth",
38
+ "compiledTruthUpdatedAt",
39
+ "compiledTruthSource",
40
+ "compiledTruthPublic",
41
+ "compiledTruthPublicUpdatedAt",
42
+ "compiledTruthPublicSource",
43
+ ];
28
44
  export async function memoryWrite(params) {
29
45
  const { labels, properties, accountId, scope, relationships, createdBy, validator, producedByTaskId } = params;
30
46
  const nameHint = pickName(properties);
@@ -35,6 +51,17 @@ async function memoryWriteImpl(params) {
35
51
  if (!scope) {
36
52
  throw new Error("scope is required — valid values: 'public', 'shared', 'admin', 'user:{identifier}'");
37
53
  }
54
+ // Task 413: refuse operator-supplied compiled-truth fields in the
55
+ // properties bag. Defaults stamped below remain the only path that sets
56
+ // these on a first write; mutations land via memory-update's rewriter
57
+ // branch (with `operatorHint` for operator-attributed passes).
58
+ for (const key of SYSTEM_MANAGED_COMPILED_TRUTH_KEYS) {
59
+ if (key in properties) {
60
+ throw new Error(`Write blocked (system-managed-key): '${key}' cannot be set via the properties bag. ` +
61
+ `Compiled-truth fields are written only by the rewriter — use memory-update with rewriteCompiledTruth:true ` +
62
+ `(optionally with operatorHint for operator-attributed passes).`);
63
+ }
64
+ }
38
65
  const session = getSession();
39
66
  const labelStr = labels.map((l) => `\`${l}\``).join(":");
40
67
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"memory-write.js","sourceRoot":"","sources":["../../src/tools/memory-write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAqB,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EA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AM,WAAW,CAAC;gBACpB,CAAC;gBACD,OAAO,CAAC,KAAK,CAAC,mDAAmD,EAAE,WAAW,CAAC,CAAC;gBAChF,0EAA0E;YAC5E,CAAC;QACH,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,uBAAuB,CACrC,OAAe;IAEf,mFAAmF;IACnF,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAClE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,MAAgB,EAChB,UAAmC;IAEnC,MAAM,KAAK,GAAa,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEnD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACtD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YACjE,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
@@ -33,6 +33,8 @@ export default defineConfig({
33
33
  "src/lib/__tests__/phase-prune-revisions.test.ts",
34
34
  // Task 390 — relative-date parser shared by extractor + datetime skill.
35
35
  "src/lib/__tests__/relative-date.test.ts",
36
+ // Task 413 — operator-hint folding in the compiled-truth rewriter.
37
+ "src/lib/__tests__/compiled-truth-rewriter-operator-hint.test.ts",
36
38
  ],
37
39
  testTimeout: 10_000,
38
40
  },
@@ -61,7 +61,7 @@ When loading this reference, confirm which schema files were consulted by noting
61
61
 
62
62
  **Position** carries a single role held by a `UserProfile` at an `Organization` — its title, dates, and per-role properties (e.g. achievement bullets in `description`, `endDate` for a finished role). Each role is its own node so it can carry its own structure; multiple Positions per UserProfile (career history); one Organization may host many Positions across many UserProfiles. Written by the `document-ingest` skill when a CV section classifies as `Position`. The natural pattern is `(:UserProfile)-[:HAS_POSITION]->(:Position)-[:AT]->(:Organization)` — never set the employer name as a property on Position; always create the AT edge to the (MERGEd) Organization.
63
63
 
64
- **`authorshipMode` on content labels (Task 356).** Every `:KnowledgeDocument` (including email-source threads), `:Message`, `:SocialPost`, and conversation-document `:Section` write carries an `authorshipMode` enum drawn from `human-only | human-led-agent-assisted | agent-led-human-reviewed | agent-only | unknown`. The value records who actually wrote the content body, not who triggered the write. `human-only` means every word of the body came from the operator; `human-led-agent-assisted` is operator-authored with light agent polish (the operator chose every claim and structure); `agent-led-human-reviewed` is agent-drafted then operator-edited before send; `agent-only` is pure agent output the operator did not touch. The voice-mirror distillation walks the corpus where `authorshipMode IN ['human-only', 'human-led-agent-assisted']` — both modes carry voice signal. Conversation-document `:Section` chunks (WhatsApp / Telegram / Signal / Granola / Otter / Circleback exports ingested under `:KnowledgeDocument`-[:HAS_SECTION]->`, where the parent carries `conversationIdentity`) are first-class voice corpus and the highest-leverage signal source because chat captures the unguarded voice in a way email rarely does. Legacy nodes default to `unknown` until reclassified via the voice-mirror backfill flow. The per-label authorshipMode index on `:Section` covers conversation-document chunks without a secondary label. Writers that cannot determine the mode (e.g. bulk archive imports) write `unknown` rather than guessing.
64
+ **`authorshipMode` on content labels (Task 356).** Every `:KnowledgeDocument` (including email-source threads), `:ConversationArchive` (Task 397 — every chat transcript parent), `:Message`, `:SocialPost`, and `:Section` write carries an `authorshipMode` enum drawn from `human-only | human-led-agent-assisted | agent-led-human-reviewed | agent-only | unknown`. The value records who actually wrote the content body, not who triggered the write. `human-only` means every word of the body came from the operator; `human-led-agent-assisted` is operator-authored with light agent polish (the operator chose every claim and structure); `agent-led-human-reviewed` is agent-drafted then operator-edited before send; `agent-only` is pure agent output the operator did not touch. The voice-mirror distillation walks the corpus where `authorshipMode IN ['human-only', 'human-led-agent-assisted']` — both modes carry voice signal. `:ConversationArchive` `:Section` chunks (WhatsApp / Telegram / Signal / Granola / Otter / Circleback exports ingested under `(:ConversationArchive)-[:HAS_SECTION]->(:Section)` Task 397) are first-class voice corpus and the highest-leverage signal source because chat captures the unguarded voice in a way email rarely does. Legacy nodes default to `unknown` until reclassified via the voice-mirror backfill flow. The per-label authorshipMode index on `:Section` covers transcript chunks without a secondary label. Writers that cannot determine the mode (e.g. bulk archive imports) write `unknown` rather than guessing.
65
65
 
66
66
  **Voice profile pattern (Task 356).** `(:AdminUser)-[:HAS_VOICE_PROFILE]->(:VoiceProfile)`. The styleCard is YAML serialized to a string property containing sentence-length distribution, register, favoured/avoided constructions and words, taboos, opening/closing patterns, and exemplar sentences. `(:VoiceProfile)-[:LEARNED_FROM]->(:KnowledgeDocument|:Message|:SocialPost|:Section)` links the profile to every node in its source corpus so the operator can audit what drove the distillation. Each operator edit on an agent draft becomes `(:VoiceEdit)-[:FEEDBACK_FOR]->(:VoiceProfile)` with the original/edited bodies plus a Haiku-summarised `intent` so the next distillation knows what to adjust.
67
67
 
@@ -79,13 +79,14 @@ Every `:Person`, `:Organization`, and `:Concept` carries a two-part knowledge sh
79
79
  |---|---|---|
80
80
  | `compiledTruth` | string ≤2000 chars | The current summary. Empty on first write. |
81
81
  | `compiledTruthUpdatedAt` | datetime | Last rewriter or operator write. Epoch on first write. |
82
- | `compiledTruthSource` | `'rewriter' \| 'operator'` | Last writer. Operator edits get a 7-day cooldown that the rewriter respects unless `forceRewrite=true` is passed. |
82
+ | `compiledTruthSource` | `'rewriter' \| 'operator'` | Last writer. `'operator'` marks passes shaped by an operator hint from chat; the rewriter respects a 7-day cooldown against further auto-rewriter passes unless `forceRewrite=true` is set. |
83
83
 
84
- The compiled truth is system-managed: direct writes to any of the three properties via `memory-update` are **rejected loudly**. The only paths to mutate are:
84
+ The compiled truth is system-managed: direct writes to any of the three properties via `memory-update` or `memory-write` are **rejected loudly** (Task 413). The rewriter is the only writer, and it is invoked only through one of these paths:
85
85
 
86
- - `memory-update(nodeId, {}, rewriteCompiledTruth: true)` — invokes the OAuth-LLM rewriter against the most recent 10 `:TimelineEvent` rows.
86
+ - `memory-update(nodeId, {}, rewriteCompiledTruth: true)` — invokes the OAuth-LLM rewriter against the most recent 10 `:TimelineEvent` rows. Resulting write is stamped `compiledTruthSource = 'rewriter'`.
87
87
  - `memory-update(nodeId, {}, rewriteCompiledTruth: true, forceRewrite: true)` — same, but bypasses the 7-day operator cooldown.
88
- - The graph UI's per-property edit surface stamps `compiledTruthSource: 'operator'` so the rewriter honours the cooldown.
88
+ - `memory-update(nodeId, {}, rewriteCompiledTruth: true, operatorHint: "<correction in operator's own words>")` — Task 413 chat-triggered operator nudge for the admin twin. Folds the hint into the rewriter prompt with precedence over the timeline, stamps `compiledTruthSource = 'operator'` (and the `:CompiledTruthRevision` row mirrors that source), skips the 7-day cooldown (the operator is driving), and skips the public-twin auto-fire so admin-side corrections do not leak unreviewed to the public surface. Hint cap: 1000 chars. There is no operator direct-edit surface — the LLM stays in the per-step path.
89
+ - `memory-update(nodeId, {}, rewriteCompiledTruth: true, publicOperatorHint: "<correction in operator's own words>")` — Task 420 chat-triggered operator nudge for the public twin. Only valid on `:Organization` / `:Concept` / `:Project` / `:LocalBusiness` (the public-twin label set; `:Person` has no public twin and is refused). Folds the hint into the public-mode rewriter prompt with precedence over the timeline, stamps `compiledTruthPublicSource = 'operator'`, bypasses the public-cooldown (the operator is driving), and fires regardless of whether the admin pass changed `compiledTruth`. The admin pass still runs normally; admin and public hints are independent and may be supplied together. Hint cap: 1000 chars. No public direct-edit surface exists — the public rewriter is always in the path.
89
90
 
90
91
  ### Revision history (Task 391)
91
92
 
@@ -234,7 +235,7 @@ The closed enumeration:
234
235
 
235
236
  `Preface`, `Abstract` (alias for Summary / ExecutiveSummary), `Introduction`, `TableOfContents`, `Chapter`, `Conclusion`, `Appendix`, `Bibliography` (alias for References), `Glossary`, `Acknowledgments` — each becomes `:Section:<Kind>` linked to the document via `(:KnowledgeDocument)-[:HAS_SECTION]->` and chained to siblings via `(:Section)-[:NEXT]->(:Section)` in reading order.
236
237
 
237
- `Conversation` — chat-mode chunks emitted by `memory-classify` with `mode='chat'`. Becomes `:Section` linked via `(:KnowledgeDocument)-[:HAS_SECTION]->` exactly as document-mode sections are. The parent `:KnowledgeDocument` is distinguished by carrying `conversationIdentity` (and `source`) rather than `attachmentId`; readers that need conversation-vs-document filtering query that property at the parent. Properties beyond the base section shape: `summary`, `keywords`, `firstMessageAt`, `lastMessageAt`, `participantNames`, `messageCount`, `archiveSha256`. The `:Section` validator rules (embedding, body, position) apply uniformly.
238
+ `Conversation` — chat-mode chunks emitted by `memory-classify` with `mode='chat'`. Becomes `:Section` linked via `(:ConversationArchive)-[:HAS_SECTION]->` (Task 397) — same Section shape as document-mode, only the parent label differs. The parent `:ConversationArchive` carries `conversationIdentity` (and `source`); readers that need conversation-vs-document filtering match on the parent label rather than a property heuristic. Properties beyond the base section shape: `summary`, `keywords`, `firstMessageAt`, `lastMessageAt`, `participantNames`, `messageCount`, `archiveSha256`. The `:Section` validator rules (embedding, body, position) apply uniformly.
238
239
 
239
240
  **Contract-clause kinds (HAS_SECTION + NEXT, plus special-case extras for two kinds):**
240
241
 
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: conversation-archive
3
- description: Source-agnostic ingest for conversation transcripts. One skill for WhatsApp `_chat.txt`, Telegram, Signal, LinkedIn DMs, Zoom transcript, meeting minutes, iMessage, Slack, and any future source — `source` is a property on `:KnowledgeDocument`, never a separate skill or plugin. Confirms the owner + every distinct sender against existing `:AdminUser` / `:Person` nodes (no auto-creation), then invokes the deterministic Bash entry `conversation-archive-ingest.sh` with `--source <enum>`. The script normalises the source (per-source pluggable function), sessionizes at gap-hours boundaries, classifies each session via Haiku (mode='chat') into `:Section` chunks with summary + topic keywords, and writes them under a parent `:KnowledgeDocument` MERGEd on `conversationIdentity = sha256(accountId + ":" + sortedParticipantElementIds)`. Re-imports are delta-append: prior chunks are never touched; only messages after `lastIngestedMessageHash` flow through the pipeline. Triggers when the operator drops any conversation export (file or directory) into chat.
3
+ description: Source-agnostic ingest for conversation transcripts. One skill for WhatsApp `_chat.txt`, Telegram, Signal, LinkedIn DMs, Zoom transcript, meeting minutes, iMessage, Slack, and any future source — `source` is a property on the parent `:ConversationArchive`, never a separate skill or plugin. Confirms the owner + every distinct sender against existing `:AdminUser` / `:Person` nodes (no auto-creation), then invokes the deterministic Bash entry `conversation-archive-ingest.sh` with `--source <enum>`. The script normalises the source (per-source pluggable function), sessionizes at gap-hours boundaries, classifies each session via Haiku (mode='chat') into `:Section` chunks with summary + topic keywords, and writes them under a parent `:ConversationArchive` MERGEd on `conversationIdentity = sha256(accountId + ":" + sortedParticipantElementIds)`. Re-imports are delta-append: prior chunks are never touched; only messages after `lastIngestedMessageHash` flow through the pipeline. Triggers when the operator drops any conversation export (file or directory) into chat.
4
4
  ---
5
5
 
6
6
  # Conversation Archive — source-agnostic transcript ingestion
7
7
 
8
8
  **Invoked from `specialists:librarian`** — the admin agent dispatches the librarian when the operator drops a conversation transcript; the librarian loads this skill.
9
9
 
10
- **Default parent.** Every `:KnowledgeDocument` is anchored to the operator-confirmed owner (`:AdminUser` for the account owner, `:Person` for a third-party archive). The owner's elementId is derived inside the bash entry from `(ACCOUNT_ID, USER_ID)` env (see Identity below) and becomes the containment parent for the archive node. Per-session `:Section` chunks attach to the archive via `:PART_OF`. Participant cross-edges from the archive to each distinct sender (`:Person` / `:AdminUser`) are added alongside the containment edge — they describe the conversation, they do not substitute for the parent.
10
+ **Default parent.** Every `:ConversationArchive` (Task 397 — previously a `:KnowledgeDocument` carrying `conversationIdentity`) is anchored to the operator-confirmed owner (`:AdminUser` for the account owner, `:Person` for a third-party archive). The owner's elementId is derived inside the bash entry from `(ACCOUNT_ID, USER_ID)` env (see Identity below) and becomes the containment parent for the archive node. Per-session `:Section` chunks attach to the archive via `:HAS_SECTION`, chained in reading order by `:NEXT`. Participant cross-edges from the archive to each distinct sender (`:Person` / `:AdminUser`) attach via `:PARTICIPANT_IN` — they describe the conversation, they do not substitute for the parent.
11
11
 
12
12
  One skill, one bash entry, one writer. The pipeline is identical for every conversation source. The only source-specific code is the per-source normaliser (a pluggable function under [`platform/plugins/memory/mcp/src/lib/conversation-normalisers/`](../../mcp/src/lib/conversation-normalisers/)). New sources = a new normaliser file + an enum entry, never a new skill.
13
13
 
@@ -127,11 +127,11 @@ Forbidden: blind-reissue without reading the progress file first.
127
127
  - Picks the normaliser for `--source`. WhatsApp: locates `_chat.txt` (zip / dir / direct file), parses deterministically, computes `archiveSha256`. Other sources interpret the path according to their own format.
128
128
  - Verifies the operator-supplied participant elementIds exist in the graph under this `accountId` with the right label (`:AdminUser` / `:Person`). The script does NOT bind parsed senderNames back to those elementIds — any line authored by a sender outside the confirmed set lands under the archive's `:Section` chunks unchecked, and `:PARTICIPANT_IN` reflects only the confirmed owner + participants. Closing that gap is its own task ([Task 396](../../../../../.tasks/396-conversation-archive-sendername-binding.md)).
129
129
  - Computes `conversationIdentity` from accountId + sorted participant elementIds.
130
- - **Without `--rebuild`** (default): looks up any prior `:KnowledgeDocument` carrying that identity → reads `lastIngestedMessageHash`. If found, slices parsed lines after the cursor (delta-append). Cursor not found → `FAIL delta-cursor-missing`. Cursor at last line → empty-delta noop (exit 0, no writes; existing chunk count surfaced in JSON summary). **With `--rebuild`**: skips the prior-cursor lookup entirely; every line is treated as first-ingest delta; the first session's `memory-ingest` deletes prior chunks for THIS `archiveSha256` and the new cursor overwrites the stale one in the same MERGE.
130
+ - **Without `--rebuild`** (default): looks up any prior `:ConversationArchive` carrying that identity → reads `lastIngestedMessageHash`. If found, slices parsed lines after the cursor (delta-append). Cursor not found → `FAIL delta-cursor-missing`. Cursor at last line → empty-delta noop (exit 0, no writes; existing chunk count surfaced in JSON summary). **With `--rebuild`**: skips the prior-cursor lookup entirely; every line is treated as first-ingest delta; the first session's `memory-ingest` deletes prior chunks for THIS `archiveSha256` and the new cursor overwrites the stale one in the same MERGE.
131
131
  - Sessionizes the delta lines at the fixed 8h gap (code constant, no flag).
132
132
  - Computes the stable archive `title` once: `<source> · <owner> ↔ <others> · <YYYY-MM-DD>→<YYYY-MM-DD>`.
133
133
  - For each session: renders as turn-attributed text (`[ts] Sender: body\n…`) and calls `memory-classify` with `mode='chat'`. Oversize sessions dispatch to the chunked-chat path internally — sessionize size is no longer an operator concern. Returns one or more `:Section` chunk specs.
134
- - **Per-session checkpoint:** immediately after each successful classify, calls `memory-ingest` for THAT session's chunks AND advances `lastIngestedMessageHash` / `lastIngestedMessageAt` on the parent `:KnowledgeDocument` to the last message of that session — atomic (chunk writes + cursor advance happen inside one Cypher transaction). A kill mid-loop leaves the cursor at session N-1's last message; re-issuing with the same argv and `--session-id` resumes from session N onward without re-classifying prior sessions.
134
+ - **Per-session checkpoint:** immediately after each successful classify, calls `memory-ingest` for THAT session's chunks AND advances `lastIngestedMessageHash` / `lastIngestedMessageAt` on the parent `:ConversationArchive` to the last message of that session — atomic (chunk writes + cursor advance happen inside one Cypher transaction). A kill mid-loop leaves the cursor at session N-1's last message; re-issuing with the same argv and `--session-id` resumes from session N onward without re-classifying prior sessions.
135
135
  - Server MERGEs the parent on `conversationIdentity` (writing `title` ON CREATE and COALESCE-on-MATCH so a stable title is never overwritten), MERGEs `:PARTICIPANT_IN` edges, CREATEs new chunks, extends the `:NEXT` chain from its tail. The cleanup-by-`archiveSha256` step runs ONLY when `--rebuild` is set AND only on the FIRST per-session call of a run. Every node and edge stamps `source=<enum>` and `createdByAgent='conversation-archive'`.
136
136
 
137
137
  NO insight pass runs. Phase 2 (operator-driven `:Observation` / `:Task` / `:Preference` derivation against chunks) is its own follow-up task — and applies uniformly to every source once chunks exist.
@@ -142,7 +142,7 @@ After the script succeeds, formulate the three operator-facing messages from the
142
142
 
143
143
  1. **Parse summary.** `Parsed <archiveSourceFile> (source=<enum>): <parsed> messages across <sessions> sessions, date range <dateRange.first> → <dateRange.last>. Participants: <senderHistogram[i].name (count), …>.`
144
144
  2. **Classify summary.** `Classified into <chunks> chunks, covering: <topicKeywords[0], topicKeywords[1], …>.`
145
- 3. **Write summary.** `Created :KnowledgeDocument <archiveElementId> with <chunks> :Section chunks (NEXT chain length <chunks - 1>). Participants linked via :PARTICIPANT_IN: <participantsLinked>.`
145
+ 3. **Write summary.** `Created :ConversationArchive <archiveElementId> with <chunks> :Section chunks (NEXT chain length <chunks - 1>). Participants linked via :PARTICIPANT_IN: <participantsLinked>.`
146
146
 
147
147
  For an empty-delta re-import (`delta.kind === "empty-delta"`): emit only message 1 + a noop line `noop reason="no new messages since <priorLastIngestedMessageAt>"`.
148
148
 
@@ -180,7 +180,7 @@ For an empty-delta re-import (`delta.kind === "empty-delta"`): emit only message
180
180
  - **Re-running the same export bytes is a no-op by default.** The bin reports the existing chunk count and exits 0; cursor and chunks are unchanged. An earlier contract that ran cleanup-by-`archiveSha256` on every same-bytes re-run was the destructive primitive that combined with `--session-gap-hours` to silently destroy 138 chunks (Adam Mackay incident, 2026-05-04) — that path is closed.
181
181
  - **Re-running with appended messages** (a fresh export from the same chat with new messages at the tail): cursor lookup finds the prior `lastIngestedMessageHash`, slices new messages, sessionizes only those, and appends new chunks at the tail of the existing `:NEXT` chain. Pre-existing chunks are never touched.
182
182
  - **Destructive rebuild** requires the explicit `--rebuild` flag — and only the operator may pass it (see Doctrine below). With `--rebuild`, the bin treats the run as first-ingest, the FIRST session's writer cleans prior chunks for the matching `archiveSha256`, the cursor is overwritten by that session's MERGE, and the heartbeat surfaces a WARN line so the destructive action is operator-visible.
183
- - **Re-ingesting into a previously-trashed archive** revives the parent before MERGE. If the operator drag-trashed a conversation-document `:KnowledgeDocument` and then re-runs ingest (delta or `--rebuild`), `memory-ingest`'s `ingestConversationDocument` strips `:Trashed` from the matching `conversationIdentity` so the MERGE binds to a non-trashed parent — otherwise the chunks would land under a `:Trashed` parent the graph UI hides, making the entire archive (and every freshly-written chunk under it) invisible until something else clears the label. Same revival shape as the document-path KnowledgeDocument.
183
+ - **Re-ingesting into a previously-trashed archive** revives the parent before MERGE. If the operator drag-trashed a `:ConversationArchive` and then re-runs ingest (delta or `--rebuild`), `memory-ingest`'s `ingestConversationDocument` strips `:Trashed` from the matching `conversationIdentity` so the MERGE binds to a non-trashed parent — otherwise the chunks would land under a `:Trashed` parent the graph UI hides, making the entire archive (and every freshly-written chunk under it) invisible until something else clears the label. Same revival shape as the document-path `:KnowledgeDocument`.
184
184
 
185
185
  ## Doctrine
186
186
 
@@ -191,16 +191,16 @@ For an empty-delta re-import (`delta.kind === "empty-delta"`): emit only message
191
191
 
192
192
  Run via `mcp__graph__maxy-graph-read_neo4j_cypher`:
193
193
 
194
- - `MATCH (a:KnowledgeDocument { conversationIdentity: $cid }) RETURN elementId(a), a.source, a.lastIngestedMessageAt, a.lastIngestedMessageHash` — `source` matches `--source`; counters agree with the JSON summary.
195
- - `MATCH (a:KnowledgeDocument { conversationIdentity: $cid })-[:HAS_SECTION]->(c:Section) RETURN count(c)` — equals `chunks`.
196
- - `MATCH (a:KnowledgeDocument { source: $source }) RETURN count(a)` — uses the `(accountId, source)` index.
197
- - `MATCH (p)-[:PARTICIPANT_IN]->(:KnowledgeDocument { conversationIdentity: $cid }) RETURN count(p)` — equals `participantsLinked` after a first-ingest.
198
- - Phase 1 wrote ZERO observations: `MATCH (o:Observation)-[:OBSERVED_IN]->(:KnowledgeDocument { conversationIdentity: $cid }) RETURN count(o)` — should be 0 today (Phase 2 deferred).
194
+ - `MATCH (a:ConversationArchive { conversationIdentity: $cid }) RETURN elementId(a), a.source, a.lastIngestedMessageAt, a.lastIngestedMessageHash` — `source` matches `--source`; counters agree with the JSON summary.
195
+ - `MATCH (a:ConversationArchive { conversationIdentity: $cid })-[:HAS_SECTION]->(c:Section) RETURN count(c)` — equals `chunks`.
196
+ - `MATCH (a:ConversationArchive { source: $source }) RETURN count(a)` — uses the `(accountId, source)` index.
197
+ - `MATCH (p)-[:PARTICIPANT_IN]->(:ConversationArchive { conversationIdentity: $cid }) RETURN count(p)` — equals `participantsLinked` after a first-ingest.
198
+ - Phase 1 wrote ZERO observations: `MATCH (o:Observation)-[:OBSERVED_IN]->(:ConversationArchive { conversationIdentity: $cid }) RETURN count(o)` — should be 0 today (Phase 2 deferred).
199
199
 
200
200
  ## What this is not
201
201
 
202
202
  - **Not** the live `whatsapp` plugin. That plugin (Baileys QR pairing) holds messages in an in-memory store cleared on restart. This skill imports historical exports into Neo4j as persistent graph nodes.
203
203
  - **Not** a media-transcription pipeline. Voice notes, photos, PDFs are skipped at parse with a counter logged.
204
204
  - **Not** an insight-extraction pass. Phase 2 (`:Observation` / `:Task` / `:Preference` / `:MENTIONS` derivation, anchored to chunks) ships in its own task and applies uniformly to every source.
205
- - **Not** an archive-wide importer. Flat datasets (LinkedIn connections, CRM exports) are first-class entities + natural edges, not `:KnowledgeDocument` — `feedback_archives_are_not_documents.md` stands.
205
+ - **Not** an archive-wide importer. Flat datasets (LinkedIn connections, CRM exports) are first-class entities + natural edges, not `:ConversationArchive` and not `:KnowledgeDocument` — `feedback_archives_are_not_documents.md` stands.
206
206
  - **Not** automatic. The owner + all-participants confirmation gate is mandatory before any line is written.
@@ -21,7 +21,7 @@ Run when the owner asks for a per-meeting brief for today. The trigger phrases a
21
21
  2. **For each event, list the attendees.** Read the event's `attendees` field or the `SCHEDULED_FOR` relationships in the graph. If the event has no attendees recorded, mark it as "solo or unspecified".
22
22
  3. **For each attendee, look up the graph.** Call `memory-search` with the attendee's name. Take the highest-confidence `:Person` node. From the node and its neighbours, pull:
23
23
  - Role and current company (one line).
24
- - The most recent conversation-document `:KnowledgeDocument` (carries `conversationIdentity` and `source`) or live `:Conversation` involving them, with the conversation's last-message timestamp.
24
+ - The most recent `:ConversationArchive` (carries `conversationIdentity` and `source`) or live `:Conversation` involving them, with the conversation's last-message timestamp.
25
25
  - Open `:Task` nodes that name them.
26
26
  - Open commitments the owner made to them (tasks with status `open` and the attendee in `SCHEDULED_FOR`).
27
27
  4. **Compose one context block per event.** Keep each block to three short sentences: who is attending, what the latest contact was, what is open between the owner and them.
@@ -44,7 +44,7 @@ When `memory-search` returns no `:Person` node for an attendee, say "no record y
44
44
  CFO at Acme Corp since 2024. Last conversation 11 days ago, where she asked for a referral introduction. One open task: send the intro to Sam Webber.
45
45
 
46
46
  ### Pricing review with the team
47
- Three attendees: Mark Lee, Priya Singh, Jordan Lee. No active commitments between the owner and any of them this week. Standing recurring meeting; last week's notes are in the graph as :Section nodes under the team's conversation-document :KnowledgeDocument.
47
+ Three attendees: Mark Lee, Priya Singh, Jordan Lee. No active commitments between the owner and any of them this week. Standing recurring meeting; last week's notes are in the graph as :Section nodes under the team's :ConversationArchive.
48
48
 
49
49
  ### Call with Daniel Park
50
50
  No record yet. The event was created from a calendar invite three days ago. The owner may want to add a one-line note on the meeting's purpose before joining.