@remnic/core 9.33.0 → 9.34.0

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 (106) hide show
  1. package/dist/access-admin-ops-surface.js +15 -15
  2. package/dist/access-authorization-probe.js +16 -16
  3. package/dist/access-boundary.js +15 -15
  4. package/dist/access-cli.js +35 -34
  5. package/dist/access-cli.js.map +1 -1
  6. package/dist/access-extraction-force-flush.js +15 -15
  7. package/dist/access-http.js +25 -25
  8. package/dist/access-identity-continuity-surface.js +15 -15
  9. package/dist/access-lcm-surface.js +15 -15
  10. package/dist/access-mcp.js +20 -20
  11. package/dist/access-namespace-preflight.js +15 -15
  12. package/dist/access-observe-write-surface.js +15 -15
  13. package/dist/access-operations-batch.js +17 -17
  14. package/dist/access-operations.js +19 -19
  15. package/dist/access-recall-concurrency.js +15 -15
  16. package/dist/access-recall-response.js +15 -15
  17. package/dist/access-recall-surface.js +15 -15
  18. package/dist/access-schema.js +3 -3
  19. package/dist/access-service.js +15 -15
  20. package/dist/adapters/index.js +4 -4
  21. package/dist/adapters/registry.js +2 -2
  22. package/dist/{capsule-crypto-YO5QJ6L3.js → capsule-crypto-GWVG7LGC.js} +2 -2
  23. package/dist/{chunk-VDX2J7OX.js → chunk-5W7CTZ2E.js} +4 -4
  24. package/dist/{chunk-J6BYDVPL.js → chunk-6HXQ2YO5.js} +2 -2
  25. package/dist/{chunk-6NPZ3FP2.js → chunk-7CCVK67W.js} +5 -5
  26. package/dist/{chunk-77CNV7DY.js → chunk-BLAKS3CP.js} +4 -4
  27. package/dist/{chunk-YFQMW2TH.js → chunk-DG2R7M7K.js} +11 -11
  28. package/dist/{chunk-PTN6UAUA.js → chunk-ES36HTSC.js} +4 -4
  29. package/dist/{chunk-ATUURSST.js → chunk-FL3AM5KE.js} +3 -3
  30. package/dist/{chunk-I5DQ6KZK.js → chunk-FYO2GAZJ.js} +2 -2
  31. package/dist/{chunk-MPH263X2.js → chunk-HULSU7PS.js} +2 -2
  32. package/dist/{chunk-N2B56SIS.js → chunk-KJT3PZAR.js} +2 -2
  33. package/dist/chunk-KWMXR7XS.js +138 -0
  34. package/dist/chunk-KWMXR7XS.js.map +1 -0
  35. package/dist/{chunk-7RZJWZ46.js → chunk-LEPOP46W.js} +5 -5
  36. package/dist/{chunk-TITQYVKD.js → chunk-LRYAQGDR.js} +11 -11
  37. package/dist/{chunk-BXLOS5AJ.js → chunk-OWHERGF2.js} +2 -2
  38. package/dist/{chunk-6JE3HGS4.js → chunk-OXBPHIKH.js} +5 -5
  39. package/dist/{chunk-SIKCTPRK.js → chunk-QEPNZBBC.js} +3 -3
  40. package/dist/{chunk-2QSZNTDO.js → chunk-RKNJBZ55.js} +4 -4
  41. package/dist/{chunk-C4PEMCP4.js → chunk-RLOVRJZN.js} +7 -7
  42. package/dist/{chunk-EHNENZHZ.js → chunk-RQBF54FC.js} +3 -3
  43. package/dist/{chunk-SPPL77NI.js → chunk-RSFWAI4D.js} +49 -29
  44. package/dist/chunk-RSFWAI4D.js.map +1 -0
  45. package/dist/{chunk-RYHWZ52A.js → chunk-S2BBISHU.js} +4 -4
  46. package/dist/{chunk-V2MVDDJF.js → chunk-SUZI6BHQ.js} +2 -2
  47. package/dist/{chunk-DQEMWVMT.js → chunk-UVYI6VIX.js} +1 -1
  48. package/dist/{chunk-YJ7PWEWI.js → chunk-WFYWGDM6.js} +2 -2
  49. package/dist/{chunk-SFW2NABJ.js → chunk-Y6XRTQMV.js} +5 -5
  50. package/dist/{chunk-6NNNURLK.js → chunk-Z54EM5YZ.js} +4 -4
  51. package/dist/cli.js +29 -29
  52. package/dist/contradiction/index.js +4 -4
  53. package/dist/conversation-index/backend.js +2 -2
  54. package/dist/corpus-watermark.js +10 -10
  55. package/dist/index.d.ts +1 -1
  56. package/dist/index.js +51 -50
  57. package/dist/lcm/engine.js +2 -2
  58. package/dist/lcm/index.js +2 -2
  59. package/dist/namespaces/migrate.js +9 -9
  60. package/dist/namespaces/search.js +8 -8
  61. package/dist/operator-doctor-corpus.js +11 -11
  62. package/dist/operator-toolkit.js +12 -12
  63. package/dist/orchestrator.js +35 -34
  64. package/dist/search/factory.js +7 -7
  65. package/dist/search/index.js +7 -7
  66. package/dist/search/lancedb-backend.js +2 -2
  67. package/dist/search/meilisearch-backend.js +2 -2
  68. package/dist/search/orama-backend.js +2 -2
  69. package/dist/tool-scoped-memory.d.ts +47 -0
  70. package/dist/tool-scoped-memory.js +12 -0
  71. package/dist/tool-scoped-memory.js.map +1 -0
  72. package/dist/transfer/backup.js +2 -2
  73. package/dist/transfer/capsule-export.js +2 -2
  74. package/dist/transfer/capsule-import.js +2 -2
  75. package/package.json +2 -2
  76. package/src/extraction-redaction-rules.test.ts +53 -0
  77. package/src/index.ts +1 -1
  78. package/src/orchestration/extraction-persist.ts +31 -32
  79. package/src/tool-scoped-memory.test.ts +199 -0
  80. package/src/tool-scoped-memory.ts +190 -0
  81. package/dist/chunk-SPPL77NI.js.map +0 -1
  82. /package/dist/{capsule-crypto-YO5QJ6L3.js.map → capsule-crypto-GWVG7LGC.js.map} +0 -0
  83. /package/dist/{chunk-VDX2J7OX.js.map → chunk-5W7CTZ2E.js.map} +0 -0
  84. /package/dist/{chunk-J6BYDVPL.js.map → chunk-6HXQ2YO5.js.map} +0 -0
  85. /package/dist/{chunk-6NPZ3FP2.js.map → chunk-7CCVK67W.js.map} +0 -0
  86. /package/dist/{chunk-77CNV7DY.js.map → chunk-BLAKS3CP.js.map} +0 -0
  87. /package/dist/{chunk-YFQMW2TH.js.map → chunk-DG2R7M7K.js.map} +0 -0
  88. /package/dist/{chunk-PTN6UAUA.js.map → chunk-ES36HTSC.js.map} +0 -0
  89. /package/dist/{chunk-ATUURSST.js.map → chunk-FL3AM5KE.js.map} +0 -0
  90. /package/dist/{chunk-I5DQ6KZK.js.map → chunk-FYO2GAZJ.js.map} +0 -0
  91. /package/dist/{chunk-MPH263X2.js.map → chunk-HULSU7PS.js.map} +0 -0
  92. /package/dist/{chunk-N2B56SIS.js.map → chunk-KJT3PZAR.js.map} +0 -0
  93. /package/dist/{chunk-7RZJWZ46.js.map → chunk-LEPOP46W.js.map} +0 -0
  94. /package/dist/{chunk-TITQYVKD.js.map → chunk-LRYAQGDR.js.map} +0 -0
  95. /package/dist/{chunk-BXLOS5AJ.js.map → chunk-OWHERGF2.js.map} +0 -0
  96. /package/dist/{chunk-6JE3HGS4.js.map → chunk-OXBPHIKH.js.map} +0 -0
  97. /package/dist/{chunk-SIKCTPRK.js.map → chunk-QEPNZBBC.js.map} +0 -0
  98. /package/dist/{chunk-2QSZNTDO.js.map → chunk-RKNJBZ55.js.map} +0 -0
  99. /package/dist/{chunk-C4PEMCP4.js.map → chunk-RLOVRJZN.js.map} +0 -0
  100. /package/dist/{chunk-EHNENZHZ.js.map → chunk-RQBF54FC.js.map} +0 -0
  101. /package/dist/{chunk-RYHWZ52A.js.map → chunk-S2BBISHU.js.map} +0 -0
  102. /package/dist/{chunk-V2MVDDJF.js.map → chunk-SUZI6BHQ.js.map} +0 -0
  103. /package/dist/{chunk-DQEMWVMT.js.map → chunk-UVYI6VIX.js.map} +0 -0
  104. /package/dist/{chunk-YJ7PWEWI.js.map → chunk-WFYWGDM6.js.map} +0 -0
  105. /package/dist/{chunk-SFW2NABJ.js.map → chunk-Y6XRTQMV.js.map} +0 -0
  106. /package/dist/{chunk-6NNNURLK.js.map → chunk-Z54EM5YZ.js.map} +0 -0
@@ -0,0 +1,138 @@
1
+ // src/tool-scoped-memory.ts
2
+ var BT = "`";
3
+ var GENERIC_TOOL_NAMES = [
4
+ "read",
5
+ "write",
6
+ "search",
7
+ "fetch",
8
+ "browser",
9
+ "exec",
10
+ "shell",
11
+ "memory",
12
+ "edit",
13
+ "bash",
14
+ "glob",
15
+ "webfetch",
16
+ "task",
17
+ "remnic"
18
+ ];
19
+ var KNOWN_CLI_NAMES = [
20
+ "grep",
21
+ "curl",
22
+ "git",
23
+ "npm",
24
+ "pnpm",
25
+ "sed",
26
+ "awk",
27
+ "jq",
28
+ "cat",
29
+ "ssh",
30
+ "docker",
31
+ "kubectl",
32
+ "make",
33
+ "rg",
34
+ "ls",
35
+ "cd"
36
+ ];
37
+ var GENERIC_NAMES_ALT = GENERIC_TOOL_NAMES.join("|");
38
+ var KNOWN_NAMES_ALT = [...GENERIC_TOOL_NAMES, ...KNOWN_CLI_NAMES].join("|");
39
+ var CLI_NAMES_ALT = KNOWN_CLI_NAMES.join("|");
40
+ var FLAG = "(?:--|-)[A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)*\\b";
41
+ var FLAG_NAKED = "(?:--|-)[A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)*";
42
+ var OPCODE = "[A-Za-z0-9_./-]{1,20}";
43
+ var NO_SLASH_TOKEN = "[A-Za-z0-9_.-]{1,60}";
44
+ var SLASH_CMD_TOKEN = "/(?:" + GENERIC_NAMES_ALT + ")\\b";
45
+ var QUOTED_CONTENT = "(?:" + NO_SLASH_TOKEN + "|" + SLASH_CMD_TOKEN + ")";
46
+ var QUOTED_PERMISSIVE = "(?:" + BT + QUOTED_CONTENT + BT + '|"' + QUOTED_CONTENT + `"|'` + QUOTED_CONTENT + "')";
47
+ var SNAKE_NON_DATA = "(?:[a-z][a-z0-9]*(?:_[a-z0-9]+)*(?:_(?!id\\b|name\\b|flag\\b|count\\b|at\\b|url\\b|key\\b|type\\b)[a-z0-9]+))\\b";
48
+ var SNAKE_KEBAB = "(?:[a-z][a-z0-9]*(?:[_-][a-z0-9]+)+)\\b";
49
+ var KNOWN_NAMES_CI = "\\b(?:" + KNOWN_NAMES_ALT + ")\\b";
50
+ var CLI_NAMES_CI = "\\b(?:" + CLI_NAMES_ALT + ")\\b";
51
+ var KEYWORD = "\\b(?:mcp[ _]tool|slash[ _]command|cli[ _]flag|subcommand|tool|command)\\b";
52
+ var IDENT = "(?:" + QUOTED_PERMISSIVE + "|" + KNOWN_NAMES_CI + "|" + SNAKE_KEBAB + "|" + FLAG + ")";
53
+ var IMM = `[\\s'"` + BT + "]{1,4}";
54
+ var CONN = "\\s+(?:named|called|aka)\\s+";
55
+ var VERB = "\\b(?:use|run|call|invoke)\\b";
56
+ var SLASH_GENERIC = "/(?:" + GENERIC_NAMES_ALT + ")\\b";
57
+ var CLAUSE_BOUNDARY = "(?:$|[.,;(:]|(?:when|before|after|to|with|for|on|in|if|unless|whenever)\\b)";
58
+ var ARGS = "(?:\\s+" + FLAG + "(?:\\s+" + OPCODE + "){0,4})?";
59
+ var CLI_ARG_TOKEN = "(?:[a-z][a-z0-9-]{0,15}|" + FLAG_NAKED + "|" + OPCODE + ")";
60
+ var CLI_ARG_RUN = "(?:\\s+" + CLI_ARG_TOKEN + "){1,4}";
61
+ var CMD_WITH_ARGS = "(?:(?:" + CLI_NAMES_CI + "|" + SLASH_GENERIC + ")" + CLI_ARG_RUN + ")";
62
+ var QSTRICT_CONTENT = "(?:" + KNOWN_NAMES_ALT + "|[a-z][a-z0-9]*(?:[_-][a-z0-9]+)+|" + FLAG_NAKED + "|" + SLASH_CMD_TOKEN + "|" + CMD_WITH_ARGS + "|(?:" + KNOWN_NAMES_ALT + ")" + CLI_ARG_RUN + ")";
63
+ var QUOTED_STRICT = "(?:" + BT + QSTRICT_CONTENT + BT + '|"' + QSTRICT_CONTENT + `"|'` + QSTRICT_CONTENT + "')";
64
+ var INVOCATION_FLAG_ARGS = VERB + "\\s+(?:" + QUOTED_STRICT + "|" + KNOWN_NAMES_CI + "|" + SNAKE_NON_DATA + "|" + SLASH_GENERIC + "|" + FLAG + ")" + ARGS + "(?=\\s*" + CLAUSE_BOUNDARY + ")";
65
+ var INVOCATION_CLI_ARGS = VERB + "\\s+" + CMD_WITH_ARGS + "(?=\\s*" + CLAUSE_BOUNDARY + ")";
66
+ var INVOCATION = "(?:" + INVOCATION_FLAG_ARGS + "|" + INVOCATION_CLI_ARGS + ")";
67
+ var TOOL_REFERENCE_CI = new RegExp(
68
+ "(?:" + IDENT + IMM + KEYWORD + "|" + KEYWORD + IMM + IDENT + "|" + KEYWORD + CONN + IDENT + "|" + IDENT + CONN + KEYWORD + "|" + INVOCATION + ")",
69
+ "i"
70
+ );
71
+ function hasCapitalisedToolName(content) {
72
+ for (const re of [
73
+ /(?:the|a|an|this|that|these|those|use|run|call|invoke)\s+([A-Za-z][A-Za-z0-9]+)\b[\s'`<>]{0,4}\b(?:tool|command|subcommand)\b/gi,
74
+ /\b(?:tool|command|subcommand)\b\s+(?:named|called|aka)\s+([A-Za-z][A-Za-z0-9]+)\b/gi
75
+ ]) {
76
+ re.lastIndex = 0;
77
+ let match;
78
+ while ((match = re.exec(content)) !== null) {
79
+ const w = match[1];
80
+ if (w && w[0] >= "A" && w[0] <= "Z") return true;
81
+ }
82
+ }
83
+ return false;
84
+ }
85
+ function hasCamelCaseToolName(content) {
86
+ const camelRe = /\b([a-z]{3,}[a-z0-9]*[A-Z][a-z][A-Za-z0-9]*)\b/g;
87
+ let m;
88
+ while ((m = camelRe.exec(content)) !== null) {
89
+ const token = m[1];
90
+ const start = m.index;
91
+ const end = start + token.length;
92
+ const before = content.slice(Math.max(0, start - 20), start);
93
+ const after = content.slice(end);
94
+ if (/(?:^|\s)(?:use|run|call|invoke)\s*$/i.test(before) && /^(?:\s*(?:$|[.,;(:]|(?:when|before|after|to|with|for|on|in|if|unless|whenever)\b))/i.test(after)) {
95
+ return true;
96
+ }
97
+ if (/^(?:\s*(?:tool|command|subcommand)\b)/i.test(after) || /(?:tool|command|subcommand)\s*$/i.test(before)) {
98
+ return true;
99
+ }
100
+ }
101
+ return false;
102
+ }
103
+ function referencesAgentSpecificTool(content) {
104
+ if (typeof content !== "string" || content.length === 0) return false;
105
+ return TOOL_REFERENCE_CI.test(content) || hasCapitalisedToolName(content) || hasCamelCaseToolName(content);
106
+ }
107
+ function withholdToolScopedFromSharedNamespace({
108
+ content,
109
+ sourceConnector,
110
+ procedureSteps
111
+ }) {
112
+ if (typeof sourceConnector !== "string" || sourceConnector.trim().length === 0) return false;
113
+ if (referencesAgentSpecificTool(content)) return true;
114
+ if (procedureSteps?.some((s) => {
115
+ const kind = s.toolCall?.kind;
116
+ if (typeof kind === "string" && kind.trim().length > 0) return true;
117
+ const stepText = [s.intent, s.expectedOutcome].filter((t) => typeof t === "string" && t.length > 0).join(" ");
118
+ return stepText.length > 0 && referencesAgentSpecificTool(stepText);
119
+ })) {
120
+ return true;
121
+ }
122
+ return false;
123
+ }
124
+ function shouldPromoteGlobalFactToShared(inputs) {
125
+ if (inputs.scope !== "global") return false;
126
+ return !withholdToolScopedFromSharedNamespace({
127
+ content: inputs.content,
128
+ sourceConnector: inputs.sourceConnector,
129
+ procedureSteps: inputs.procedureSteps
130
+ });
131
+ }
132
+
133
+ export {
134
+ referencesAgentSpecificTool,
135
+ withholdToolScopedFromSharedNamespace,
136
+ shouldPromoteGlobalFactToShared
137
+ };
138
+ //# sourceMappingURL=chunk-KWMXR7XS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tool-scoped-memory.ts"],"sourcesContent":["/**\n * Tool-scoped memory guard (issue #2183).\n *\n * A tool-related fact extracted from a specific agent integration carries an\n * UNQUALIFIED tool name — \"use the search tool\" — with no agent identity\n * attached (the conversation handed to the extraction LLM is rendered as\n * `[role] content` only). Promoting such a fact to the shared namespace lets a\n * DIFFERENT integration that exposes a same-named but incompatible tool (Pi\n * `search` = repo code search vs OpenClaw `search` = web search) consume it.\n *\n * `referencesAgentSpecificTool` flags fact text that references a specific\n * tool/command invocation rather than portable knowledge. The promotion guard\n * in `orchestration/extraction-persist.ts` uses it — when the producing\n * integration is known (`sourceConnector`) — to keep such a fact in that\n * integration's own namespace.\n *\n * Tuning bias: a FALSE POSITIVE is cheap — the fact stays in the narrower\n * namespace, the documented safe default. A FALSE NEGATIVE is the actual\n * cross-integration collision bug, so detection leans permissive — but it must\n * not fire on ordinary prose.\n */\n\nconst BT = \"`\";\n\n// Generic tool names + host-tool names emitted by the agent adapters.\n// Evidence: \"edit\" — Pi messages.test.ts:43 ({ type: \"toolCall\", name: \"edit\" }).\n// \"bash\" — Pi messages.test.ts:70 (bashExecution tool rendering). \"glob\",\n// \"webfetch\", \"task\" — standard Claude Code tools (Pi wraps Claude Code).\nconst GENERIC_TOOL_NAMES = [\n \"read\", \"write\", \"search\", \"fetch\", \"browser\", \"exec\", \"shell\", \"memory\",\n \"edit\", \"bash\", \"glob\", \"webfetch\", \"task\",\n \"remnic\",\n];\nconst KNOWN_CLI_NAMES = [\n \"grep\", \"curl\", \"git\", \"npm\", \"pnpm\", \"sed\", \"awk\", \"jq\", \"cat\", \"ssh\",\n \"docker\", \"kubectl\", \"make\", \"rg\", \"ls\", \"cd\",\n];\nconst GENERIC_NAMES_ALT = GENERIC_TOOL_NAMES.join(\"|\");\nconst KNOWN_NAMES_ALT = [...GENERIC_TOOL_NAMES, ...KNOWN_CLI_NAMES].join(\"|\");\nconst CLI_NAMES_ALT = KNOWN_CLI_NAMES.join(\"|\");\n\nconst FS_ROOTS = \"(?:etc|var|usr|tmp|home|opt|srv|proc|dev)\";\nconst FLAG = \"(?:--|-)[A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)*\\\\b\";\nconst FLAG_NAKED = \"(?:--|-)[A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)*\";\nconst OPCODE = \"[A-Za-z0-9_./-]{1,20}\";\n\nconst NO_SLASH_TOKEN = \"[A-Za-z0-9_.-]{1,60}\";\nconst SLASH_CMD_TOKEN = \"/(?:\" + GENERIC_NAMES_ALT + \")\\\\b\";\nconst QUOTED_CONTENT = \"(?:\" + NO_SLASH_TOKEN + \"|\" + SLASH_CMD_TOKEN + \")\";\nconst QUOTED_PERMISSIVE =\n \"(?:\" + BT + QUOTED_CONTENT + BT + \"|\\\"\" + QUOTED_CONTENT + \"\\\"|'\" + QUOTED_CONTENT + \"')\";\n\nconst SNAKE = \"(?:[a-z][a-z0-9]*(?:_[a-z0-9]+)+)\\\\b\";\nconst SNAKE_NON_DATA = \"(?:[a-z][a-z0-9]*(?:_[a-z0-9]+)*(?:_(?!id\\\\b|name\\\\b|flag\\\\b|count\\\\b|at\\\\b|url\\\\b|key\\\\b|type\\\\b)[a-z0-9]+))\\\\b\";\nconst SNAKE_KEBAB = \"(?:[a-z][a-z0-9]*(?:[_-][a-z0-9]+)+)\\\\b\";\n\nconst KNOWN_NAMES_CI = \"\\\\b(?:\" + KNOWN_NAMES_ALT + \")\\\\b\";\nconst CLI_NAMES_CI = \"\\\\b(?:\" + CLI_NAMES_ALT + \")\\\\b\";\nconst KEYWORD = \"\\\\b(?:mcp[ _]tool|slash[ _]command|cli[ _]flag|subcommand|tool|command)\\\\b\";\n\nconst IDENT = \"(?:\" + QUOTED_PERMISSIVE + \"|\" + KNOWN_NAMES_CI + \"|\" + SNAKE_KEBAB + \"|\" + FLAG + \")\";\n\nconst IMM = \"[\\\\s'\\\"\" + BT + \"]{1,4}\";\nconst CONN = \"\\\\s+(?:named|called|aka)\\\\s+\";\nconst VERB = \"\\\\b(?:use|run|call|invoke)\\\\b\";\nconst SLASH_GENERIC = \"/(?:\" + GENERIC_NAMES_ALT + \")\\\\b\";\nconst CLAUSE_BOUNDARY = \"(?:$|[.,;(:]|(?:when|before|after|to|with|for|on|in|if|unless|whenever)\\\\b)\";\nconst ARGS = \"(?:\\\\s+\" + FLAG + \"(?:\\\\s+\" + OPCODE + \"){0,4})?\";\nconst CLI_ARG_TOKEN = \"(?:[a-z][a-z0-9-]{0,15}|\" + FLAG_NAKED + \"|\" + OPCODE + \")\";\nconst CLI_ARG_RUN = \"(?:\\\\s+\" + CLI_ARG_TOKEN + \"){1,4}\";\n\n// Shared: a CLI tool or slash command optionally followed by a bounded\n// argument run. Used by BOTH the quoted and unquoted invocation arms so\n// quoting cannot diverge from unquoted again (#2183 round 20).\nconst CMD_WITH_ARGS = \"(?:(?:\" + CLI_NAMES_CI + \"|\" + SLASH_GENERIC + \")\" + CLI_ARG_RUN + \")\";\nconst QSTRICT_CONTENT =\n \"(?:\" + KNOWN_NAMES_ALT + \"|[a-z][a-z0-9]*(?:[_-][a-z0-9]+)+\" + \"|\" + FLAG_NAKED + \"|\" + SLASH_CMD_TOKEN +\n \"|\" + CMD_WITH_ARGS + \"|(?:\" + KNOWN_NAMES_ALT + \")\" + CLI_ARG_RUN + \")\";\nconst QUOTED_STRICT =\n \"(?:\" + BT + QSTRICT_CONTENT + BT + \"|\\\"\" + QSTRICT_CONTENT + \"\\\"|'\" + QSTRICT_CONTENT + \"')\";\n\nconst INVOCATION_FLAG_ARGS =\n VERB + \"\\\\s+(?:\" + QUOTED_STRICT + \"|\" + KNOWN_NAMES_CI + \"|\" + SNAKE_NON_DATA + \"|\" + SLASH_GENERIC + \"|\" + FLAG + \")\" + ARGS + \"(?=\\\\s*\" + CLAUSE_BOUNDARY + \")\";\nconst INVOCATION_CLI_ARGS =\n VERB + \"\\\\s+\" + CMD_WITH_ARGS + \"(?=\\\\s*\" + CLAUSE_BOUNDARY + \")\";\nconst INVOCATION = \"(?:\" + INVOCATION_FLAG_ARGS + \"|\" + INVOCATION_CLI_ARGS + \")\";\n\nconst TOOL_REFERENCE_CI = new RegExp(\n \"(?:\" +\n IDENT + IMM + KEYWORD + \"|\" + KEYWORD + IMM + IDENT + \"|\" +\n KEYWORD + CONN + IDENT + \"|\" + IDENT + CONN + KEYWORD + \"|\" +\n INVOCATION +\n \")\",\n \"i\",\n);\n\nfunction hasCapitalisedToolName(content: string): boolean {\n // Structural discriminator: a capitalised identifier beside a tool/command\n // keyword qualifies ONLY when preceded by an article or invocation verb (not\n // sentence-initial), or connected via named/called/aka. This replaces the\n // blocklist approach — a structural rule beats a growing STOP_WORDS set.\n for (const re of [\n /(?:the|a|an|this|that|these|those|use|run|call|invoke)\\s+([A-Za-z][A-Za-z0-9]+)\\b[\\s'`<>]{0,4}\\b(?:tool|command|subcommand)\\b/gi,\n /\\b(?:tool|command|subcommand)\\b\\s+(?:named|called|aka)\\s+([A-Za-z][A-Za-z0-9]+)\\b/gi,\n ]) {\n re.lastIndex = 0;\n let match;\n while ((match = re.exec(content)) !== null) {\n const w = match[1];\n if (w && w[0] >= \"A\" && w[0] <= \"Z\") return true;\n }\n }\n return false;\n}\n\nfunction hasCamelCaseToolName(content: string): boolean {\n // Case-sensitive: camelCase (lowercase start, interior uppercase) is a common\n // host-tool naming convention (bashExecution, memoryStore, webFetch). Ordinary\n // English words are never camelCase, and PascalCase (PostgreSQL, TypeScript)\n // starts uppercase so is handled by hasCapitalisedToolName instead.\n const camelRe = /\\b([a-z]{3,}[a-z0-9]*[A-Z][a-z][A-Za-z0-9]*)\\b/g;\n let m;\n while ((m = camelRe.exec(content)) !== null) {\n const token = m[1];\n const start = m.index!;\n const end = start + token.length;\n const before = content.slice(Math.max(0, start - 20), start);\n const after = content.slice(end);\n // Invocation: preceded by a verb, followed by a clause boundary or call syntax.\n if (/(?:^|\\s)(?:use|run|call|invoke)\\s*$/i.test(before) &&\n /^(?:\\s*(?:$|[.,;(:]|(?:when|before|after|to|with|for|on|in|if|unless|whenever)\\b))/i.test(after)) {\n return true;\n }\n // Keyword-adjacent: camelCase beside a tool/command keyword.\n if (/^(?:\\s*(?:tool|command|subcommand)\\b)/i.test(after) ||\n /(?:tool|command|subcommand)\\s*$/i.test(before)) {\n return true;\n }\n }\n return false;\n}\n\nexport function referencesAgentSpecificTool(content: string): boolean {\n if (typeof content !== \"string\" || content.length === 0) return false;\n return TOOL_REFERENCE_CI.test(content) || hasCapitalisedToolName(content) || hasCamelCaseToolName(content);\n}\n\nexport interface ToolScopeWithholdInputs {\n content: string;\n sourceConnector?: string;\n procedureSteps?: ReadonlyArray<{ intent?: string; expectedOutcome?: string; toolCall?: { kind?: string } }>;\n}\n\nexport function withholdToolScopedFromSharedNamespace({\n content,\n sourceConnector,\n procedureSteps,\n}: ToolScopeWithholdInputs): boolean {\n if (typeof sourceConnector !== \"string\" || sourceConnector.trim().length === 0) return false;\n if (referencesAgentSpecificTool(content)) return true;\n if (\n procedureSteps?.some((s) => {\n const kind = s.toolCall?.kind;\n if (typeof kind === \"string\" && kind.trim().length > 0) return true;\n const stepText = [s.intent, s.expectedOutcome]\n .filter((t): t is string => typeof t === \"string\" && t.length > 0)\n .join(\" \");\n return stepText.length > 0 && referencesAgentSpecificTool(stepText);\n })\n ) {\n return true;\n }\n return false;\n}\n\nexport interface GlobalFactPromotionInputs {\n scope: string | null | undefined;\n content: string;\n sourceConnector?: string;\n procedureSteps?: ReadonlyArray<{ toolCall?: { kind?: string } }>;\n}\n\nexport function shouldPromoteGlobalFactToShared(inputs: GlobalFactPromotionInputs): boolean {\n if (inputs.scope !== \"global\") return false;\n return !withholdToolScopedFromSharedNamespace({\n content: inputs.content,\n sourceConnector: inputs.sourceConnector,\n procedureSteps: inputs.procedureSteps,\n });\n}\n"],"mappings":"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","names":[]}
@@ -1,3 +1,7 @@
1
+ import {
2
+ rebuildConversationChunksFailOpen,
3
+ upsertConversationChunksFailOpen
4
+ } from "./chunk-72A4L5JJ.js";
1
5
  import {
2
6
  searchConversationIndex,
3
7
  searchConversationIndexFaissFailOpen
@@ -5,10 +9,6 @@ import {
5
9
  import {
6
10
  failOpenFaissHealth
7
11
  } from "./chunk-ET356KSB.js";
8
- import {
9
- rebuildConversationChunksFailOpen,
10
- upsertConversationChunksFailOpen
11
- } from "./chunk-72A4L5JJ.js";
12
12
 
13
13
  // src/conversation-index/backend.ts
14
14
  function createConversationIndexBackend(options) {
@@ -235,4 +235,4 @@ function createFaissBackend(getFaiss) {
235
235
  export {
236
236
  createConversationIndexBackend
237
237
  };
238
- //# sourceMappingURL=chunk-7RZJWZ46.js.map
238
+ //# sourceMappingURL=chunk-LEPOP46W.js.map
@@ -13,6 +13,9 @@ import {
13
13
  import {
14
14
  importSqlite
15
15
  } from "./chunk-PYHOAXTI.js";
16
+ import {
17
+ backupMemoryDir
18
+ } from "./chunk-OWHERGF2.js";
16
19
  import {
17
20
  exportJsonBundle
18
21
  } from "./chunk-UP6MOYCB.js";
@@ -25,9 +28,6 @@ import {
25
28
  import {
26
29
  importJsonBundle
27
30
  } from "./chunk-2DL3OFLD.js";
28
- import {
29
- backupMemoryDir
30
- } from "./chunk-BXLOS5AJ.js";
31
31
  import {
32
32
  exportMarkdownBundle
33
33
  } from "./chunk-765K3SAT.js";
@@ -123,7 +123,7 @@ import {
123
123
  runOperatorInventory,
124
124
  runOperatorRepair,
125
125
  runOperatorSetup
126
- } from "./chunk-EHNENZHZ.js";
126
+ } from "./chunk-RQBF54FC.js";
127
127
  import {
128
128
  analyzeSessionIntegrity,
129
129
  applySessionRepair,
@@ -200,7 +200,7 @@ import {
200
200
  import {
201
201
  EngramAccessHttpServer,
202
202
  MeetingsInputError
203
- } from "./chunk-C4PEMCP4.js";
203
+ } from "./chunk-RLOVRJZN.js";
204
204
  import {
205
205
  WearablesInputError
206
206
  } from "./chunk-V7IZKJI3.js";
@@ -213,13 +213,13 @@ import {
213
213
  createProductionChatLlmAdapter,
214
214
  loadChatSession,
215
215
  sessionBelongsToPrincipal
216
- } from "./chunk-ATUURSST.js";
216
+ } from "./chunk-FL3AM5KE.js";
217
217
  import {
218
218
  getAbstractionNodeStoreStatus
219
219
  } from "./chunk-OADWQ5CR.js";
220
220
  import {
221
221
  EngramAccessService
222
- } from "./chunk-YFQMW2TH.js";
222
+ } from "./chunk-DG2R7M7K.js";
223
223
  import {
224
224
  WorkStorage
225
225
  } from "./chunk-GDB4J2H3.js";
@@ -250,7 +250,7 @@ import {
250
250
  listNamespaces,
251
251
  runNamespaceMigration,
252
252
  verifyNamespaces
253
- } from "./chunk-N2B56SIS.js";
253
+ } from "./chunk-KJT3PZAR.js";
254
254
  import {
255
255
  analyzeGraphHealth
256
256
  } from "./chunk-L2DPF4DF.js";
@@ -4575,7 +4575,7 @@ function registerCli(api, orchestrator, registerOptions = {}) {
4575
4575
  }
4576
4576
  }
4577
4577
  if (sourceArchive.endsWith(".enc")) {
4578
- const { isEncryptedCapsuleFile } = await import("./capsule-crypto-YO5QJ6L3.js");
4578
+ const { isEncryptedCapsuleFile } = await import("./capsule-crypto-GWVG7LGC.js");
4579
4579
  const encDetected = await isEncryptedCapsuleFile(sourceArchive).catch(() => true);
4580
4580
  if (encDetected) {
4581
4581
  throw new Error(
@@ -4738,7 +4738,7 @@ function registerCli(api, orchestrator, registerOptions = {}) {
4738
4738
  const { parseExportBundle } = await import("./transfer/types.js");
4739
4739
  let decryptedBuf;
4740
4740
  try {
4741
- const { decryptCapsuleFileInMemory } = await import("./capsule-crypto-YO5QJ6L3.js");
4741
+ const { decryptCapsuleFileInMemory } = await import("./capsule-crypto-GWVG7LGC.js");
4742
4742
  decryptedBuf = await decryptCapsuleFileInMemory(archivePath, memoryDir);
4743
4743
  } catch (decErr) {
4744
4744
  const msg = decErr instanceof Error ? decErr.message : String(decErr);
@@ -7981,4 +7981,4 @@ export {
7981
7981
  listMemoryMarkdownFilePaths,
7982
7982
  registerCli
7983
7983
  };
7984
- //# sourceMappingURL=chunk-TITQYVKD.js.map
7984
+ //# sourceMappingURL=chunk-LRYAQGDR.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-765K3SAT.js";
4
4
  import {
5
5
  encryptCapsuleFile
6
- } from "./chunk-DQEMWVMT.js";
6
+ } from "./chunk-UVYI6VIX.js";
7
7
  import {
8
8
  computeTransferOutputRel,
9
9
  isTransferPathExcluded
@@ -109,4 +109,4 @@ async function enforceRetention(outDirAbs, retentionDays) {
109
109
  export {
110
110
  backupMemoryDir
111
111
  };
112
- //# sourceMappingURL=chunk-BXLOS5AJ.js.map
112
+ //# sourceMappingURL=chunk-OWHERGF2.js.map
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  normalizeDreamsStatusWindowHours
6
6
  } from "./chunk-EQWEIIKQ.js";
7
- import {
8
- runContradictionScan
9
- } from "./chunk-UTRO5UJU.js";
10
7
  import {
11
8
  executeResolution,
12
9
  isValidResolutionVerb
13
10
  } from "./chunk-WG5HSQ4P.js";
11
+ import {
12
+ runContradictionScan
13
+ } from "./chunk-UTRO5UJU.js";
14
14
  import {
15
15
  isDefaultReviewNamespace,
16
16
  listPairs,
@@ -28,7 +28,7 @@ import {
28
28
  defineOperation,
29
29
  parseNamespacePreflightWriteOp,
30
30
  resolveAuthorizedNamespaceWritablePreflight
31
- } from "./chunk-YFQMW2TH.js";
31
+ } from "./chunk-DG2R7M7K.js";
32
32
  import {
33
33
  projectTagProjectId
34
34
  } from "./chunk-BUE5E2HL.js";
@@ -485,4 +485,4 @@ defineOperation({ name: "graph_events", description: "SSE graph events.", schema
485
485
  defineOperation({ name: "chat_message", description: "Chat message.", schema: strictSchema({ message: S.str, chatSessionId: S.str }), handler: async (_i, _ctx) => ({ result: { ok: true } }) });
486
486
  defineOperation({ name: "chat_events", description: "SSE chat events.", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { stream: "sse" } }) });
487
487
  defineOperation({ name: "adapters_status", description: "Adapter registry metadata (issue #1850 round 5). Marker op: the HTTP transport builds the response from its own adapterRegistry, but the op still must be registered so it appears in listRegisteredOperations and enforceTokenOp can gate it for scoped tokens.", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { ok: true } }) });
488
- //# sourceMappingURL=chunk-6JE3HGS4.js.map
488
+ //# sourceMappingURL=chunk-OXBPHIKH.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  memoryStoreRequestSchema
3
- } from "./chunk-I5DQ6KZK.js";
3
+ } from "./chunk-FYO2GAZJ.js";
4
4
  import {
5
5
  CorrectionContractError,
6
6
  DECISION_SUBCOMMANDS,
7
7
  DELTA_SUBCOMMANDS,
8
8
  defineOperation,
9
9
  isCodegraphToolName
10
- } from "./chunk-YFQMW2TH.js";
10
+ } from "./chunk-DG2R7M7K.js";
11
11
  import {
12
12
  serializeMutations,
13
13
  withHeldFileLock
@@ -1805,4 +1805,4 @@ export {
1805
1805
  codegraphIngestTracesOperation,
1806
1806
  REGISTERED_OPERATIONS
1807
1807
  };
1808
- //# sourceMappingURL=chunk-SIKCTPRK.js.map
1808
+ //# sourceMappingURL=chunk-QEPNZBBC.js.map
@@ -1,3 +1,6 @@
1
+ import {
2
+ ClaudeCodeAdapter
3
+ } from "./chunk-J64TK33U.js";
1
4
  import {
2
5
  CodexAdapter
3
6
  } from "./chunk-RSUYKGGZ.js";
@@ -7,9 +10,6 @@ import {
7
10
  import {
8
11
  ReplitAdapter
9
12
  } from "./chunk-TMSXWOBZ.js";
10
- import {
11
- ClaudeCodeAdapter
12
- } from "./chunk-J64TK33U.js";
13
13
 
14
14
  // src/adapters/registry.ts
15
15
  var AdapterRegistry = class {
@@ -53,4 +53,4 @@ var AdapterRegistry = class {
53
53
  export {
54
54
  AdapterRegistry
55
55
  };
56
- //# sourceMappingURL=chunk-2QSZNTDO.js.map
56
+ //# sourceMappingURL=chunk-RKNJBZ55.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-V7IZKJI3.js";
4
4
  import {
5
5
  AdapterRegistry
6
- } from "./chunk-2QSZNTDO.js";
6
+ } from "./chunk-RKNJBZ55.js";
7
7
  import {
8
8
  WriteRateLimiter
9
9
  } from "./chunk-MKQBXQKU.js";
@@ -16,10 +16,10 @@ import {
16
16
  processChatMessage,
17
17
  sessionBelongsToPrincipal,
18
18
  subscribeChatTranscript
19
- } from "./chunk-ATUURSST.js";
19
+ } from "./chunk-FL3AM5KE.js";
20
20
  import {
21
21
  RelayMissionStoreError
22
- } from "./chunk-SIKCTPRK.js";
22
+ } from "./chunk-QEPNZBBC.js";
23
23
  import {
24
24
  executeResolution,
25
25
  isValidResolutionVerb
@@ -31,7 +31,7 @@ import {
31
31
  } from "./chunk-35NN3ZFA.js";
32
32
  import {
33
33
  validateRequest
34
- } from "./chunk-I5DQ6KZK.js";
34
+ } from "./chunk-FYO2GAZJ.js";
35
35
  import {
36
36
  maybeHandleLifecycleFlush
37
37
  } from "./chunk-5IVLTFOV.js";
@@ -41,12 +41,12 @@ import {
41
41
  import {
42
42
  authorizationProbeNamespaces,
43
43
  probeOperationAuthorization
44
- } from "./chunk-J6BYDVPL.js";
44
+ } from "./chunk-6HXQ2YO5.js";
45
45
  import {
46
46
  CorrectionContractError,
47
47
  getOperation,
48
48
  resolveQueryNamespaceWritablePreflight
49
- } from "./chunk-YFQMW2TH.js";
49
+ } from "./chunk-DG2R7M7K.js";
50
50
  import {
51
51
  isTrustZoneName
52
52
  } from "./chunk-JGSKJHF7.js";
@@ -3218,4 +3218,4 @@ export {
3218
3218
  MeetingsInputError,
3219
3219
  EngramAccessHttpServer
3220
3220
  };
3221
- //# sourceMappingURL=chunk-C4PEMCP4.js.map
3221
+ //# sourceMappingURL=chunk-RLOVRJZN.js.map
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-CMTINOFS.js";
15
15
  import {
16
16
  summarizeCorpusAndReplica
17
- } from "./chunk-MPH263X2.js";
17
+ } from "./chunk-HULSU7PS.js";
18
18
  import {
19
19
  readJudgeVerdictStats
20
20
  } from "./chunk-OZKOPQCM.js";
@@ -45,7 +45,7 @@ import {
45
45
  } from "./chunk-J6SLNQRO.js";
46
46
  import {
47
47
  listNamespaces
48
- } from "./chunk-N2B56SIS.js";
48
+ } from "./chunk-KJT3PZAR.js";
49
49
  import {
50
50
  analyzeGraphHealth
51
51
  } from "./chunk-L2DPF4DF.js";
@@ -1679,4 +1679,4 @@ export {
1679
1679
  runBenchmarkRecall,
1680
1680
  runOperatorRepair
1681
1681
  };
1682
- //# sourceMappingURL=chunk-EHNENZHZ.js.map
1682
+ //# sourceMappingURL=chunk-RQBF54FC.js.map
@@ -7,6 +7,9 @@ import {
7
7
  syncWearableSource,
8
8
  wearableSourceLabel
9
9
  } from "./chunk-UV72DEZD.js";
10
+ import {
11
+ runPeerProfileReasoner
12
+ } from "./chunk-I74SUMNI.js";
10
13
  import {
11
14
  CompressionGuidelineCoordinator
12
15
  } from "./chunk-6LKEUCEM.js";
@@ -14,15 +17,12 @@ import {
14
17
  ActivityStore,
15
18
  MaintenanceScheduler
16
19
  } from "./chunk-IZXTZ7BF.js";
17
- import {
18
- runPeerProfileReasoner
19
- } from "./chunk-I74SUMNI.js";
20
20
  import {
21
21
  migrateFromEngram
22
22
  } from "./chunk-7HYPN2GC.js";
23
23
  import {
24
24
  LcmEngine
25
- } from "./chunk-6NNNURLK.js";
25
+ } from "./chunk-Z54EM5YZ.js";
26
26
  import {
27
27
  chunkTranscriptEntries
28
28
  } from "./chunk-TECVW3JP.js";
@@ -50,6 +50,10 @@ import {
50
50
  import {
51
51
  TmtBuilder
52
52
  } from "./chunk-ECZU5BJH.js";
53
+ import {
54
+ shouldPromoteGlobalFactToShared,
55
+ withholdToolScopedFromSharedNamespace
56
+ } from "./chunk-KWMXR7XS.js";
53
57
  import {
54
58
  extractTopics
55
59
  } from "./chunk-UHGBNIOS.js";
@@ -210,7 +214,7 @@ import {
210
214
  ensureBuiltInWearableConnectors,
211
215
  getWearableConnector,
212
216
  listWearableConnectors
213
- } from "./chunk-TITQYVKD.js";
217
+ } from "./chunk-LRYAQGDR.js";
214
218
  import {
215
219
  normalizeReplaySessionKey
216
220
  } from "./chunk-AJVLDJU6.js";
@@ -240,7 +244,7 @@ import {
240
244
  import {
241
245
  runNamespaceMaintenanceFanout,
242
246
  summarizeNamespaceMaintenanceHealth
243
- } from "./chunk-EHNENZHZ.js";
247
+ } from "./chunk-RQBF54FC.js";
244
248
  import {
245
249
  NamespaceCatalog,
246
250
  planNamespaceMaintenance
@@ -318,7 +322,7 @@ import {
318
322
  } from "./chunk-LBJBNWS2.js";
319
323
  import {
320
324
  MeetingsInputError
321
- } from "./chunk-C4PEMCP4.js";
325
+ } from "./chunk-RLOVRJZN.js";
322
326
  import {
323
327
  WearablesInputError,
324
328
  describeErrorForOperator
@@ -336,17 +340,13 @@ import {
336
340
  capturePassiveCorrections,
337
341
  clusterByKey,
338
342
  detectPassiveCorrections
339
- } from "./chunk-YFQMW2TH.js";
343
+ } from "./chunk-DG2R7M7K.js";
340
344
  import {
341
345
  importCapsule
342
- } from "./chunk-6NPZ3FP2.js";
346
+ } from "./chunk-7CCVK67W.js";
343
347
  import {
344
348
  isCodingGraphInstalled
345
349
  } from "./chunk-VQ7B2Q6M.js";
346
- import {
347
- listTrustZoneRecords,
348
- searchTrustZoneRecords
349
- } from "./chunk-JGSKJHF7.js";
350
350
  import {
351
351
  applyTrustScoreStage,
352
352
  buildTrustSignalsForRerank,
@@ -354,6 +354,10 @@ import {
354
354
  trustResultFor,
355
355
  trustResultKey
356
356
  } from "./chunk-GNVZQ5JN.js";
357
+ import {
358
+ listTrustZoneRecords,
359
+ searchTrustZoneRecords
360
+ } from "./chunk-JGSKJHF7.js";
357
361
  import {
358
362
  buildXraySnapshot
359
363
  } from "./chunk-KWU6MAD4.js";
@@ -385,11 +389,11 @@ import {
385
389
  import {
386
390
  NamespaceSearchRouter,
387
391
  namespaceCollectionName
388
- } from "./chunk-V2MVDDJF.js";
392
+ } from "./chunk-SUZI6BHQ.js";
389
393
  import {
390
394
  createConversationIndexRuntime,
391
395
  createSearchBackend
392
- } from "./chunk-SFW2NABJ.js";
396
+ } from "./chunk-Y6XRTQMV.js";
393
397
  import {
394
398
  NoopSearchBackend
395
399
  } from "./chunk-CYEPCZN5.js";
@@ -3490,6 +3494,7 @@ var ExtractionPersistCoordinator = class {
3490
3494
  scopeProfileWritePlan.profile.readOrder.includes("serverShared") && scopeProfileWritePlan.readNamespaces.includes(this.deps.config.sharedNamespace) && sharedProfileLayer?.readable && sharedProfileLayer.writable && sharedPromotionTarget?.authorized
3491
3495
  );
3492
3496
  const namespacesEnabled = resolveNamespaceCapabilities(this.deps.config).namespaces;
3497
+ const sourceConnector = sourceContext?.sourceConnector;
3493
3498
  const promoteMemoryToProfileTargets = async (options) => {
3494
3499
  if (!scopeProfileWritePlan || !profileAutoPromotionAllows(scopeProfileWritePlan, options.category, options.confidence))
3495
3500
  return;
@@ -3618,6 +3623,7 @@ var ExtractionPersistCoordinator = class {
3618
3623
  };
3619
3624
  const promoteMemoryToShared = async (options) => {
3620
3625
  await promoteMemoryToProfileTargets(options);
3626
+ if (lifecycleCaps.extractionScopeClassification && withholdToolScopedFromSharedNamespace(options)) return;
3621
3627
  if (!shouldPromoteToShared(
3622
3628
  this.deps.config,
3623
3629
  scopeProfileWritePlan,
@@ -4006,7 +4012,12 @@ var ExtractionPersistCoordinator = class {
4006
4012
  }
4007
4013
  let factRedactionRules = preJudgeRedactionRules;
4008
4014
  let factNs = preRoutedNamespaceByFact[fi];
4009
- if (!factNs && lifecycleCaps.extractionScopeClassification && namespacesEnabled && f.scope === "global" && profileAllowsSharedWrites && this.deps.storageDirNamespace(storage.dir) !== this.deps.config.sharedNamespace) {
4015
+ if (!factNs && lifecycleCaps.extractionScopeClassification && namespacesEnabled && f.scope === "global" && profileAllowsSharedWrites && this.deps.storageDirNamespace(storage.dir) !== this.deps.config.sharedNamespace && shouldPromoteGlobalFactToShared({
4016
+ scope: f.scope,
4017
+ content: f.content,
4018
+ sourceConnector,
4019
+ procedureSteps: f.procedureSteps
4020
+ })) {
4010
4021
  factNs = this.deps.config.sharedNamespace;
4011
4022
  }
4012
4023
  if (factNs) {
@@ -4168,18 +4179,25 @@ var ExtractionPersistCoordinator = class {
4168
4179
  if (lifecycleCaps.extractionScopeClassification && namespacesEnabled && fact.scope === "global" && !routedNamespaceExplicit) {
4169
4180
  const currentNs = this.deps.storageDirNamespace(targetStorage.dir);
4170
4181
  if (currentNs !== this.deps.config.sharedNamespace && profileAllowsSharedWrites) {
4171
- try {
4172
- targetStorage = await this.deps.getStorageRouter().storageFor(
4173
- this.deps.config.sharedNamespace
4174
- );
4175
- targetNamespaceName = this.deps.config.sharedNamespace;
4176
- log.debug(
4177
- `scope-routing: fact "${fact.content.slice(0, 60)}\u2026" routed to shared namespace (scope=global)`
4178
- );
4179
- } catch (scopeRouteErr) {
4180
- log.warn(
4181
- `scope-routing: failed to resolve shared namespace storage; writing to session namespace (fail-open): ${scopeRouteErr}`
4182
- );
4182
+ if (shouldPromoteGlobalFactToShared({
4183
+ scope: fact.scope,
4184
+ content: fact.content,
4185
+ sourceConnector,
4186
+ procedureSteps: fact.procedureSteps
4187
+ })) {
4188
+ try {
4189
+ targetStorage = await this.deps.getStorageRouter().storageFor(
4190
+ this.deps.config.sharedNamespace
4191
+ );
4192
+ targetNamespaceName = this.deps.config.sharedNamespace;
4193
+ log.debug(
4194
+ `scope-routing: fact "${fact.content.slice(0, 60)}\u2026" routed to shared namespace (scope=global)`
4195
+ );
4196
+ } catch (scopeRouteErr) {
4197
+ log.warn(
4198
+ `scope-routing: failed to resolve shared namespace storage; writing to session namespace (fail-open): ${scopeRouteErr}`
4199
+ );
4200
+ }
4183
4201
  }
4184
4202
  } else if (currentNs !== this.deps.config.sharedNamespace) {
4185
4203
  log.debug(
@@ -4602,6 +4620,7 @@ var ExtractionPersistCoordinator = class {
4602
4620
  } : {},
4603
4621
  source: extractionWriteSource,
4604
4622
  ...extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {},
4623
+ ...fact.procedureSteps && fact.procedureSteps.length ? { procedureSteps: fact.procedureSteps } : {},
4605
4624
  ...fact.sources && fact.sources.length > 0 ? { sources: fact.sources } : {},
4606
4625
  ...fact.provenance ? { provenance: fact.provenance } : {}
4607
4626
  });
@@ -4807,6 +4826,7 @@ var ExtractionPersistCoordinator = class {
4807
4826
  } : {},
4808
4827
  source: extractionWriteSource,
4809
4828
  ...extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {},
4829
+ ...fact.procedureSteps && fact.procedureSteps.length ? { procedureSteps: fact.procedureSteps } : {},
4810
4830
  ...fact.sources && fact.sources.length > 0 ? { sources: fact.sources } : {},
4811
4831
  ...fact.provenance ? { provenance: fact.provenance } : {}
4812
4832
  });
@@ -23731,4 +23751,4 @@ export {
23731
23751
  filterRecallCandidates,
23732
23752
  Orchestrator
23733
23753
  };
23734
- //# sourceMappingURL=chunk-SPPL77NI.js.map
23754
+ //# sourceMappingURL=chunk-RSFWAI4D.js.map