scientify 1.13.6 → 2.1.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 (100) hide show
  1. package/README.en.md +371 -0
  2. package/README.md +167 -356
  3. package/dist/index.d.ts +8 -2
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +131 -122
  6. package/dist/index.js.map +1 -1
  7. package/dist/src/cli/research.d.ts +1 -6
  8. package/dist/src/cli/research.d.ts.map +1 -1
  9. package/dist/src/cli/research.js +227 -123
  10. package/dist/src/cli/research.js.map +1 -1
  11. package/dist/src/commands/metabolism-status.d.ts +3 -3
  12. package/dist/src/commands/metabolism-status.d.ts.map +1 -1
  13. package/dist/src/commands/metabolism-status.js +72 -75
  14. package/dist/src/commands/metabolism-status.js.map +1 -1
  15. package/dist/src/commands.d.ts +1 -1
  16. package/dist/src/commands.d.ts.map +1 -1
  17. package/dist/src/commands.js +0 -55
  18. package/dist/src/commands.js.map +1 -1
  19. package/dist/src/hooks/cron-skill-inject.d.ts +6 -7
  20. package/dist/src/hooks/cron-skill-inject.d.ts.map +1 -1
  21. package/dist/src/hooks/cron-skill-inject.js +6 -15
  22. package/dist/src/hooks/cron-skill-inject.js.map +1 -1
  23. package/dist/src/hooks/research-mode.d.ts +1 -1
  24. package/dist/src/hooks/research-mode.d.ts.map +1 -1
  25. package/dist/src/hooks/research-mode.js +24 -101
  26. package/dist/src/hooks/research-mode.js.map +1 -1
  27. package/dist/src/hooks/scientify-signature.d.ts +1 -1
  28. package/dist/src/hooks/scientify-signature.d.ts.map +1 -1
  29. package/dist/src/hooks/scientify-signature.js +2 -5
  30. package/dist/src/hooks/scientify-signature.js.map +1 -1
  31. package/dist/src/knowledge-state/render.d.ts +1 -9
  32. package/dist/src/knowledge-state/render.d.ts.map +1 -1
  33. package/dist/src/knowledge-state/render.js +33 -187
  34. package/dist/src/knowledge-state/render.js.map +1 -1
  35. package/dist/src/knowledge-state/store.d.ts.map +1 -1
  36. package/dist/src/knowledge-state/store.js +65 -1100
  37. package/dist/src/knowledge-state/store.js.map +1 -1
  38. package/dist/src/knowledge-state/types.d.ts +0 -76
  39. package/dist/src/knowledge-state/types.d.ts.map +1 -1
  40. package/dist/src/literature/subscription-state.d.ts +0 -2
  41. package/dist/src/literature/subscription-state.d.ts.map +1 -1
  42. package/dist/src/literature/subscription-state.js +7 -1375
  43. package/dist/src/literature/subscription-state.js.map +1 -1
  44. package/dist/src/research-subscriptions/constants.d.ts +1 -1
  45. package/dist/src/research-subscriptions/constants.js +1 -1
  46. package/dist/src/research-subscriptions/cron-client.d.ts +1 -1
  47. package/dist/src/research-subscriptions/cron-client.d.ts.map +1 -1
  48. package/dist/src/research-subscriptions/delivery.d.ts +1 -1
  49. package/dist/src/research-subscriptions/delivery.d.ts.map +1 -1
  50. package/dist/src/research-subscriptions/handlers.d.ts +1 -1
  51. package/dist/src/research-subscriptions/handlers.d.ts.map +1 -1
  52. package/dist/src/research-subscriptions/handlers.js +10 -20
  53. package/dist/src/research-subscriptions/handlers.js.map +1 -1
  54. package/dist/src/research-subscriptions/parse.d.ts.map +1 -1
  55. package/dist/src/research-subscriptions/parse.js +0 -25
  56. package/dist/src/research-subscriptions/parse.js.map +1 -1
  57. package/dist/src/research-subscriptions/prompt.d.ts +1 -1
  58. package/dist/src/research-subscriptions/prompt.d.ts.map +1 -1
  59. package/dist/src/research-subscriptions/prompt.js +195 -244
  60. package/dist/src/research-subscriptions/prompt.js.map +1 -1
  61. package/dist/src/research-subscriptions/types.d.ts +1 -3
  62. package/dist/src/research-subscriptions/types.d.ts.map +1 -1
  63. package/dist/src/templates/bootstrap.d.ts.map +1 -1
  64. package/dist/src/templates/bootstrap.js +32 -19
  65. package/dist/src/templates/bootstrap.js.map +1 -1
  66. package/dist/src/tools/arxiv-download.d.ts +1 -2
  67. package/dist/src/tools/arxiv-download.d.ts.map +1 -1
  68. package/dist/src/tools/arxiv-search.d.ts +1 -2
  69. package/dist/src/tools/arxiv-search.d.ts.map +1 -1
  70. package/dist/src/tools/github-search-tool.d.ts +1 -2
  71. package/dist/src/tools/github-search-tool.d.ts.map +1 -1
  72. package/dist/src/tools/openalex-search.d.ts +1 -2
  73. package/dist/src/tools/openalex-search.d.ts.map +1 -1
  74. package/dist/src/tools/openreview-lookup.d.ts +1 -2
  75. package/dist/src/tools/openreview-lookup.d.ts.map +1 -1
  76. package/dist/src/tools/paper-browser.d.ts +1 -2
  77. package/dist/src/tools/paper-browser.d.ts.map +1 -1
  78. package/dist/src/tools/result.d.ts +3 -5
  79. package/dist/src/tools/result.d.ts.map +1 -1
  80. package/dist/src/tools/result.js +5 -7
  81. package/dist/src/tools/result.js.map +1 -1
  82. package/dist/src/tools/scientify-cron.d.ts +4 -11
  83. package/dist/src/tools/scientify-cron.d.ts.map +1 -1
  84. package/dist/src/tools/scientify-cron.js +19 -524
  85. package/dist/src/tools/scientify-cron.js.map +1 -1
  86. package/dist/src/tools/scientify-literature-state.d.ts +1 -76
  87. package/dist/src/tools/scientify-literature-state.d.ts.map +1 -1
  88. package/dist/src/tools/scientify-literature-state.js +46 -363
  89. package/dist/src/tools/scientify-literature-state.js.map +1 -1
  90. package/dist/src/tools/unpaywall-download.d.ts +1 -2
  91. package/dist/src/tools/unpaywall-download.d.ts.map +1 -1
  92. package/dist/src/types.d.ts +16 -0
  93. package/dist/src/types.d.ts.map +1 -0
  94. package/dist/src/types.js +2 -0
  95. package/dist/src/types.js.map +1 -0
  96. package/openclaw.plugin.json +4 -2
  97. package/package.json +1 -1
  98. package/skills/metabolism/SKILL.md +2 -0
  99. package/skills/research-subscription/SKILL.md +1 -29
  100. package/README.zh.md +0 -494
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/research-subscriptions/prompt.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAkHpE,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,IAAI,CACX,mBAAmB,EACjB,OAAO,GACP,SAAS,GACT,WAAW,GACX,WAAW,GACX,aAAa,GACb,SAAS,GACT,eAAe,GACf,cAAc,GACd,cAAc,GACd,UAAU,CACb,EACD,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC,EAClC,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,GACzB,MAAM,CAmRR;AAED,wBAAgB,WAAW,IAAI,MAAM,CAwBpC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/research-subscriptions/prompt.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA0DpE,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,IAAI,CACX,mBAAmB,EACnB,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,cAAc,CAC/G,EACD,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC,EAClC,QAAQ,EAAE,MAAM,GACf,MAAM,CAiRR;AAED,wBAAgB,WAAW,IAAI,MAAM,CAsBpC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
@@ -1,9 +1,6 @@
1
1
  import { DEFAULT_SCORE_WEIGHTS, REMINDER_HINT_RE, RESEARCH_HINT_RE, SCIENTIFY_SIGNATURE_FOOTER, } from "./constants.js";
2
2
  import { formatScoreWeights, resolveCandidatePool } from "./parse.js";
3
3
  const RESEARCH_WORKFLOW_VERB_RE = /\b(search|survey|analy[sz]e|filter|track|monitor|update|summari[sz]e|report|plan)\b|检索|调研|筛选|跟踪|追踪|更新|总结|汇报|规划/u;
4
- const FULLTEXT_OPT_OUT_RE = /\b(metadata[-\s]?only|abstract[-\s]?only|no\s+full[-\s]?text|without\s+full[-\s]?text|quick\s+scan)\b|不需要全文|不用全文|只看摘要|仅摘要|只要元数据|不读全文/u;
5
- const TOPIC_NOISE_TOKEN_RE = /\b(?:smoke|test|testing|debug|dry[-\s]?run|trial|sandbox|e2e|staging)[-_ ]?\d{0,12}\b/giu;
6
- const DATE_NOISE_RE = /\b20\d{2}(?:[-_.]?\d{2})?(?:[-_.]?\d{2})?\b/g;
7
4
  function normalizeReminderText(raw) {
8
5
  let text = raw.trim();
9
6
  text = text.replace(/^(please\s+)?remind\s+(me|us|you)\s+(to\s+)?/i, "");
@@ -45,54 +42,6 @@ function deriveResearchTopicFromMessage(message) {
45
42
  const normalized = text.trim();
46
43
  return normalized.length > 0 ? normalized : message.trim();
47
44
  }
48
- function normalizeRetrievalTopic(topic) {
49
- const stripped = topic.replace(TOPIC_NOISE_TOKEN_RE, " ").replace(DATE_NOISE_RE, " ").replace(/\s+/g, " ").trim();
50
- return stripped.length > 0 ? stripped : topic.trim();
51
- }
52
- function inferPreferredLanguage(text) {
53
- const trimmed = text.trim();
54
- if (!trimmed)
55
- return undefined;
56
- if (/[\p{Script=Han}]/u.test(trimmed))
57
- return "zh";
58
- return undefined;
59
- }
60
- function formatLanguageDirective(lang) {
61
- if (lang === "zh") {
62
- return [
63
- "0) Your Output language: Chinese (Simplified).",
64
- " - Use Chinese for all content, even if the prompt is in English.",
65
- ];
66
- }
67
- return [];
68
- }
69
- function buildVariantKeywords(topic) {
70
- const keywords = new Set();
71
- const normalized = normalizeRetrievalTopic(topic);
72
- const tokens = normalized
73
- .toLowerCase()
74
- .match(/[\p{L}\p{N}][\p{L}\p{N}_-]{1,47}/gu)
75
- ?.map((item) => item.trim())
76
- .filter((item) => item.length >= 3) ?? [];
77
- if (normalized.length > 0)
78
- keywords.add(normalized);
79
- if (tokens.length >= 2) {
80
- keywords.add(tokens.slice(0, 4).join(" "));
81
- keywords.add(tokens.slice(0, 3).join("-"));
82
- }
83
- for (const token of tokens.slice(0, 8)) {
84
- keywords.add(token);
85
- }
86
- return [...keywords].slice(0, 10);
87
- }
88
- function resolveRunProfile(options, effectiveTopic) {
89
- if (options.metadataOnly === true)
90
- return "fast";
91
- const text = `${options.topic ?? ""} ${options.message ?? ""} ${effectiveTopic}`.trim();
92
- if (text.length > 0 && FULLTEXT_OPT_OUT_RE.test(text))
93
- return "fast";
94
- return "strict";
95
- }
96
45
  function buildPreferencePayload(options) {
97
46
  const maxPapers = options.maxPapers ?? 5;
98
47
  const normalizedSources = options.sources?.map((item) => item.trim().toLowerCase()).filter(Boolean);
@@ -102,18 +51,14 @@ function buildPreferencePayload(options) {
102
51
  ...(normalizedSources && normalizedSources.length > 0 ? { sources: [...new Set(normalizedSources)] } : {}),
103
52
  };
104
53
  }
105
- export function buildScheduledTaskMessage(options, scheduleKind, scopeKey, languageHint) {
54
+ export function buildScheduledTaskMessage(options, scheduleKind, scopeKey) {
106
55
  const customMessage = options.message?.trim();
107
56
  const promotedTopic = !options.topic && customMessage && shouldPromoteMessageToResearchTopic(customMessage)
108
57
  ? deriveResearchTopicFromMessage(customMessage)
109
58
  : undefined;
110
- const inferredLanguage = languageHint ??
111
- inferPreferredLanguage(`${options.topic ?? ""} ${options.message ?? ""}`.trim());
112
- const languageDirective = formatLanguageDirective(inferredLanguage);
113
59
  if (customMessage && !promotedTopic) {
114
60
  return [
115
61
  "Scheduled reminder task.",
116
- ...languageDirective,
117
62
  `Please send this reminder now: \"${customMessage}\"`,
118
63
  "Keep the reminder concise and do not run a research workflow unless explicitly requested.",
119
64
  ].join("\n");
@@ -122,22 +67,15 @@ export function buildScheduledTaskMessage(options, scheduleKind, scopeKey, langu
122
67
  if (reminderFromTopic) {
123
68
  return [
124
69
  "Scheduled reminder task.",
125
- ...languageDirective,
126
70
  `Please send this reminder now: \"${reminderFromTopic}\"`,
127
71
  "Keep the reminder concise and do not run a research workflow unless explicitly requested.",
128
72
  ].join("\n");
129
73
  }
130
74
  const trimmedTopic = (options.topic ?? promotedTopic)?.trim();
131
75
  const effectiveTopic = trimmedTopic || "active project research updates";
132
- const retrievalTopic = normalizeRetrievalTopic(effectiveTopic);
133
- const variantKeywords = buildVariantKeywords(retrievalTopic);
134
76
  const preferences = buildPreferencePayload(options);
135
- const runProfile = resolveRunProfile(options, effectiveTopic);
136
77
  const projectId = options.projectId?.trim();
137
- const candidatePoolBase = resolveCandidatePool(options.candidatePool, preferences.max_papers);
138
- const candidatePool = runProfile === "strict"
139
- ? Math.max(candidatePoolBase, Math.min(40, Math.max(24, preferences.max_papers * 4)))
140
- : candidatePoolBase;
78
+ const candidatePool = resolveCandidatePool(options.candidatePool, preferences.max_papers);
141
79
  const scoreWeights = options.scoreWeights ?? DEFAULT_SCORE_WEIGHTS;
142
80
  const scoreWeightsText = formatScoreWeights(scoreWeights);
143
81
  const preparePayload = JSON.stringify({
@@ -147,222 +85,237 @@ export function buildScheduledTaskMessage(options, scheduleKind, scopeKey, langu
147
85
  ...(projectId ? { project_id: projectId } : {}),
148
86
  preferences,
149
87
  });
150
- const strictRunLogTemplate = runProfile === "strict"
151
- ? {
152
- required_core_papers: Math.max(1, Math.min(preferences.max_papers, 3)),
153
- required_full_text_coverage_pct: 80,
154
- }
155
- : {};
88
+ const recordPaperTemplate = [
89
+ {
90
+ id: "arxiv:2501.12345",
91
+ title: "Paper title",
92
+ url: "https://arxiv.org/abs/2501.12345",
93
+ score: 92,
94
+ reason: "High topical relevance and strong authority.",
95
+ },
96
+ {
97
+ id: "doi:10.1000/xyz123",
98
+ title: "Paper title 2",
99
+ url: "https://doi.org/10.1000/xyz123",
100
+ score: 88,
101
+ reason: "Novel method with clear practical impact.",
102
+ },
103
+ ];
104
+ const knowledgeStateTemplate = {
105
+ core_papers: [
106
+ {
107
+ id: "arxiv:2501.12345",
108
+ title: "Paper title",
109
+ url: "https://arxiv.org/abs/2501.12345",
110
+ source: "arxiv",
111
+ score: 92,
112
+ reason: "High topical relevance and strong authority.",
113
+ summary: "One-line core takeaway.",
114
+ evidence_ids: ["arxiv:2501.12345"],
115
+ full_text_read: true,
116
+ read_status: "fulltext",
117
+ full_text_source: "arxiv_pdf",
118
+ full_text_ref: "https://arxiv.org/pdf/2501.12345.pdf",
119
+ domain: "machine learning",
120
+ subdomains: ["parameter-efficient fine-tuning", "large language models"],
121
+ cross_domain_links: ["systems optimization"],
122
+ research_goal: "Improve adaptation quality while keeping trainable parameters very small.",
123
+ approach: "Introduce low-rank adapters and train only adapter matrices.",
124
+ methodology_design: "Compare with full fine-tuning across multiple model scales/tasks.",
125
+ key_contributions: ["Low-rank adaptation module design", "Parameter/memory efficiency evidence"],
126
+ practical_insights: ["Rank choice strongly affects stability and quality tradeoff"],
127
+ must_understand_points: ["Why low-rank decomposition works in adaptation layers"],
128
+ limitations: ["Task-specific rank sensitivity"],
129
+ key_evidence_spans: ["Eq.(3) shows ...", "Section 4 reports ..."],
130
+ evidence_anchors: [
131
+ {
132
+ section: "Method",
133
+ locator: "Eq.(3)",
134
+ claim: "Low-rank decomposition reduces trainable parameters drastically.",
135
+ quote: "W = W0 + BA where rank(B,A) << d",
136
+ },
137
+ ],
138
+ },
139
+ ],
140
+ exploration_papers: [
141
+ {
142
+ id: "doi:10.1000/xyz123",
143
+ title: "Paper title 2",
144
+ url: "https://doi.org/10.1000/xyz123",
145
+ source: "openalex",
146
+ score: 88,
147
+ reason: "Novel method with clear practical impact.",
148
+ full_text_read: false,
149
+ read_status: "metadata",
150
+ unread_reason: "Full text not accessible in this run.",
151
+ },
152
+ ],
153
+ exploration_trace: [
154
+ {
155
+ query: "P2D battery model physics-informed agent",
156
+ source: "arxiv",
157
+ candidates: 20,
158
+ filtered_to: 3,
159
+ filtered_out_reasons: ["off-topic", "weak authority"],
160
+ result_count: 3,
161
+ },
162
+ ],
163
+ knowledge_changes: [
164
+ {
165
+ type: "NEW",
166
+ statement: "New method/insight discovered in this run.",
167
+ evidence_ids: ["arxiv:2501.12345"],
168
+ topic: "example-topic",
169
+ },
170
+ ],
171
+ knowledge_updates: [
172
+ {
173
+ topic: "example-topic",
174
+ op: "append",
175
+ content: "Update knowledge base with this run's key finding.",
176
+ confidence: "medium",
177
+ evidence_ids: ["arxiv:2501.12345"],
178
+ },
179
+ ],
180
+ hypotheses: [
181
+ {
182
+ statement: "Potential hypothesis triggered by current changes.",
183
+ trigger: "TREND",
184
+ dependency_path: ["Prior unresolved question", "New supporting evidence"],
185
+ novelty: 3.5,
186
+ feasibility: 3.2,
187
+ impact: 4.1,
188
+ evidence_ids: ["arxiv:2501.12345"],
189
+ validation_status: "unchecked",
190
+ validation_notes: "Optional: run openreview_lookup or additional search before promotion.",
191
+ validation_evidence: [],
192
+ },
193
+ ],
194
+ run_log: {
195
+ model: "model-name",
196
+ duration_ms: 1200,
197
+ temp_full_text_dir: "/tmp/scientify-fulltext/run-123",
198
+ temp_files_downloaded: 3,
199
+ temp_cleanup_status: "done",
200
+ full_text_attempted: 3,
201
+ full_text_completed: 2,
202
+ notes: "short run note",
203
+ },
204
+ };
156
205
  const recordTemplate = JSON.stringify({
157
206
  action: "record",
158
207
  scope: scopeKey,
159
208
  topic: effectiveTopic,
160
209
  ...(projectId ? { project_id: projectId } : {}),
161
- run_profile: runProfile,
162
- run_id: "run-<unique-id>",
163
210
  status: "ok",
164
- papers: [{ id: "arxiv:2501.12345", title: "Paper title", url: "https://arxiv.org/abs/2501.12345" }],
165
- knowledge_state: {
166
- core_papers: [
167
- {
168
- id: "arxiv:2501.12345",
169
- title: "Paper title",
170
- url: "https://arxiv.org/abs/2501.12345",
171
- full_text_read: true,
172
- domain: "machine learning",
173
- subdomains: ["parameter-efficient fine-tuning"],
174
- research_goal: "one-sentence goal",
175
- approach: "one-sentence approach",
176
- methodology_design: "one-sentence method setup",
177
- key_contributions: ["contribution 1", "contribution 2"],
178
- practical_insights: ["insight 1"],
179
- must_understand_points: ["must-understand 1"],
180
- limitations: ["limitation 1"],
181
- evidence_anchors: [
182
- {
183
- section: "Method",
184
- locator: "Eq.(3)",
185
- claim: "key claim",
186
- quote: "short quote from paper",
187
- },
188
- ],
189
- },
190
- ],
191
- knowledge_changes: [{ type: "NEW", statement: "one concrete change", evidence_ids: ["arxiv:2501.12345"] }],
192
- hypotheses: [
193
- {
194
- statement: "one grounded hypothesis",
195
- trigger: "TREND",
196
- problem_gap: "what current literature still fails to solve",
197
- proposed_mechanism: "how and why the proposed method could solve the gap",
198
- novelty_rationale: "what is new versus closest prior methods",
199
- dependency_path: ["step 1 grounded in prior result", "step 2 links new evidence"],
200
- falsifiable_predictions: [
201
- "prediction 1 with measurable direction",
202
- "prediction 2 that should fail if mechanism is wrong",
203
- ],
204
- critical_assumptions: ["assumption 1", "assumption 2"],
205
- failure_modes: ["failure mode 1"],
206
- success_criteria: ["criterion 1 with threshold", "criterion 2 from ablation"],
207
- strengths: ["strong empirical signal", "clear implementation path"],
208
- weaknesses: ["limited external validity", "potential data bias"],
209
- plan_steps: [
210
- "Build a reproducible baseline pipeline first (for ML tasks, include a simple baseline such as random forest if applicable).",
211
- "Implement the proposed method and run controlled comparison.",
212
- "Run ablation and failure-case analysis, then decide accept/revise/reject.",
213
- ],
214
- strict_evaluation: {
215
- overall_score: 78,
216
- decision: "accept",
217
- reason: "Evidence and execution plan are sufficient for immediate validation.",
218
- },
219
- novelty: 4,
220
- feasibility: 4,
221
- impact: 4,
222
- evidence_ids: ["arxiv:2501.12345", "arxiv:2501.54321"],
223
- },
224
- ],
225
- run_log: { run_profile: runProfile, notes: "short run note", ...strictRunLogTemplate },
226
- },
211
+ papers: recordPaperTemplate,
212
+ knowledge_state: knowledgeStateTemplate,
227
213
  });
228
- const recordDegradedTemplate = JSON.stringify({
214
+ const recordFallbackTemplate = JSON.stringify({
229
215
  action: "record",
230
216
  scope: scopeKey,
231
217
  topic: effectiveTopic,
232
218
  ...(projectId ? { project_id: projectId } : {}),
233
- run_profile: runProfile,
234
- run_id: "run-<unique-id>-degraded",
235
- status: "degraded_quality",
236
- papers: [{ id: "arxiv:2501.12345", title: "Paper title", url: "https://arxiv.org/abs/2501.12345" }],
219
+ status: "fallback_representative",
220
+ papers: recordPaperTemplate,
237
221
  knowledge_state: {
238
- run_log: { run_profile: runProfile, degraded: true, notes: "quality not fully met in this run", ...strictRunLogTemplate },
222
+ ...knowledgeStateTemplate,
223
+ run_log: {
224
+ model: "model-name",
225
+ duration_ms: 1300,
226
+ degraded: true,
227
+ temp_full_text_dir: "/tmp/scientify-fulltext/run-123",
228
+ temp_files_downloaded: 1,
229
+ temp_cleanup_status: "done",
230
+ full_text_attempted: 1,
231
+ full_text_completed: 0,
232
+ notes: "Fallback pass was used because incremental pass had no unseen papers.",
233
+ },
239
234
  },
240
- note: "selected papers persisted with degraded quality",
235
+ note: "No unseen papers this cycle; delivered best representative papers instead.",
241
236
  });
242
237
  const recordEmptyTemplate = JSON.stringify({
243
238
  action: "record",
244
239
  scope: scopeKey,
245
240
  topic: effectiveTopic,
246
241
  ...(projectId ? { project_id: projectId } : {}),
247
- run_profile: runProfile,
248
- run_id: "run-20260309T103000Z-empty",
249
242
  status: "empty",
250
243
  papers: [],
251
244
  knowledge_state: {
245
+ core_papers: [],
246
+ exploration_papers: [],
247
+ exploration_trace: [],
248
+ knowledge_changes: [],
249
+ knowledge_updates: [],
250
+ hypotheses: [],
252
251
  run_log: {
253
- run_profile: runProfile,
254
- notes: "No suitable paper found in this cycle. empty_cycle_diagnosis=query_or_recency_mismatch_or_scope_saturation || empty_cycle_next_queries=<q1>|<q2>|<q3> || empty_cycle_pivot_hint=<how this serves current idea>",
255
- ...strictRunLogTemplate,
252
+ model: "model-name",
253
+ temp_cleanup_status: "not_needed",
254
+ notes: "No suitable paper found in this cycle.",
256
255
  },
257
256
  },
258
257
  note: "No suitable paper found in incremental pass and fallback representative pass.",
259
258
  });
260
- const variantHintLine = variantKeywords.length > 0 ? `- Expansion keywords: ${variantKeywords.join(", ")}` : "- Expansion keywords: (none)";
261
- const languageDirectiveLines = languageDirective.length > 0 ? languageDirective : formatLanguageDirective(inferPreferredLanguage(effectiveTopic));
262
259
  if (scheduleKind === "at") {
263
260
  return [
264
261
  `/research-pipeline Run a focused literature study on \"${effectiveTopic}\" and return up to ${preferences.max_papers} high-value representative papers.`,
265
262
  "",
266
- "Workflow (simple, Markdown-first):",
267
- ...languageDirectiveLines,
268
- "1) Complete 5 steps in this turn: retrieve -> filter -> read -> save metadata -> update knowledge/hypothesis.",
269
- "2) First call prepare:",
270
- `${preparePayload}`,
271
- `3) Build candidate pool around ${candidatePool}; select up to ${preferences.max_papers} credible papers.`,
272
- ` - Retrieval topic (normalized): ${retrievalTopic}`,
273
- ` ${variantHintLine}`,
274
- " - Filter policy: semantic relevance, not exact string match; include important variants and aliases.",
275
- " - If user asks special constraints (foundational-first / avoid benchmark-only / prefer survey or authoritative papers), apply them in filtering and ranking.",
276
- " - If core candidates < 3, relax filters and rerun with broader query terms before declaring empty.",
277
- `4) Reading policy: ${runProfile === "strict" ? "full-text required by default (strict)." : "metadata-only allowed (explicit opt-out detected)."}`,
278
- " - Never drop a relevant paper only because full text failed; keep it with full_text_read=false and unread_reason.",
279
- " - Early cycles should prioritize foundational/survey papers; later cycles should shift to mainstream variants and adjacent tracks.",
280
- "5) User-facing answer MUST be concise Markdown:",
281
- " - Selected papers (numbered, title + URL + one-line value)",
282
- " - Read status (fulltext vs metadata)",
283
- " - For each selected paper: domain/subdomains + goal + approach + methodology + contributions + insights + limitations",
284
- " - Knowledge updates (NEW/CONFIRM/REVISE/BRIDGE)",
285
- " - Hypothesis decision (generated or not + reason)",
286
- " - If trigger signals are present (e.g. NEW>=2, or NEW+REVISE>=2, or BRIDGE present), propose 1 grounded hypothesis with >=2 evidence_ids and dependency_path>=2",
287
- " - Present hypothesis as a research card: gap, mechanism, novelty, falsifiable predictions, assumptions, failure modes, success criteria, executable plan.",
288
- " - Hypothesis must include: problem_gap, proposed_mechanism, novelty_rationale, falsifiable_predictions>=2, critical_assumptions>=2, failure_modes>=1, success_criteria>=2, strengths>=2, weaknesses>=2, plan_steps>=3, strict_evaluation (overall_score + decision + reason).",
289
- " - Plan must be executable; when task is predictive/modeling, include at least one lightweight baseline idea (e.g., random forest).",
290
- "6) Persist once via `scientify_literature_state.record` using MINIMAL JSON only:",
291
- `${recordTemplate}`,
292
- "7) Soft-gate default: non-fatal quality gaps should keep status=`ok` and be reported as warnings in quality_gate.",
293
- "8) Execute one immediate reflection follow-up when trigger signals exist (hypothesis generated, BRIDGE, NEW+REVISE, unread core), and write trace/results back into knowledge_state.",
294
- "9) Use `degraded_quality` only for fatal gate issues (do not skip record):",
295
- `${recordDegradedTemplate}`,
296
- "10) Before using `empty`, perform empty-cycle diagnosis:",
297
- " - Check whether query/alias/recency is too narrow.",
298
- " - Check whether this sub-direction is likely saturated (few unseen papers across repeated cycles).",
299
- " - Propose 2-3 next queries and one pivot hint tied to current idea validation (supporting + critical evidence).",
300
- "11) Use `empty` only when no paper is selected after both primary and broadened fallback retrieval:",
263
+ "Mandatory workflow:",
264
+ `1) Call tool \`scientify_literature_state\` with: ${preparePayload}`,
265
+ "2) Read `memory_hints` from prepare result. Treat preferred keywords/sources as positive ranking priors, and avoided ones as negative priors.",
266
+ `3) Build a candidate pool of around ${candidatePool} papers when possible, matching returned preferences (sources/recency).`,
267
+ `4) Score each candidate with weighted dimensions (${scoreWeightsText}). Each dimension is 0-100, then compute weighted average score.`,
268
+ `5) Apply memory prior adjustment to the score (up-rank preferred keyword/source matches; down-rank avoided matches).`,
269
+ `6) Select top ${preferences.max_papers} papers.`,
270
+ "7) Create a temporary local directory for full text (for example `/tmp/scientify-fulltext/<run-id>`). Download full text for selected core papers when possible (arXiv PDF/source first, then DOI OA PDF if available).",
271
+ "8) Read full text with `paper_browser` in sections (method, experiments, limitations). Extract structured fields per paper: `domain`, `subdomains`, `cross_domain_links`, `research_goal`, `approach`, `methodology_design`, `key_contributions`, `practical_insights`, `must_understand_points`, `limitations`, and `evidence_anchors`.",
272
+ "9) For papers without full text, explicitly set `full_text_read=false` and provide `unread_reason`.",
273
+ `10) Call \`scientify_literature_state\` to persist selected papers and knowledge_state details using this JSON shape: ${recordTemplate}`,
274
+ "11) `knowledge_state.core_papers` must include all selected papers with id/title/url/score/reason and structured reading fields (not placeholders).",
275
+ "12) `knowledge_state.knowledge_changes` and `knowledge_state.knowledge_updates` must reflect this run's actual findings and include `evidence_ids` whenever available.",
276
+ "13) Quality targets must be met: core full-text coverage >= 80%, evidence-binding rate >= 90% (key conclusions backed by section+locator+quote), citation error rate < 2%.",
277
+ "14) Without sufficient full-text evidence, do not keep high-confidence conclusions; downgrade confidence explicitly.",
278
+ "15) For hypotheses, include at least one `evidence_ids` entry and a concrete `dependency_path` when applicable. Prioritize evidence from full-text-read papers.",
279
+ "16) If a hypothesis is high-impact, optionally run `openreview_lookup` or additional literature search and fill `validation_status`/`validation_notes`/`validation_evidence`.",
280
+ "17) After recording state, clean temporary full-text files. Put cleanup outcome in `run_log.temp_cleanup_status` (`done|partial|failed|not_needed`) and optional `temp_cleanup_note`.",
281
+ "18) Keep `run_log.notes` factual (candidate count, filtering reason, fallback/no-fallback).",
282
+ "19) In user-facing output, always include a numbered paper list with title + direct source URL + one-line value. Never claim papers were selected without listing links.",
283
+ "20) Do not display raw score/reason unless explicitly requested.",
284
+ "21) If nothing suitable is found, still call record with empty papers using:",
301
285
  `${recordEmptyTemplate}`,
302
- "12) After record, call status and include `run_id`/`latest_run_id`.",
303
- " - Use status as the single source of truth. Never claim hypothesis persisted unless status.hypothesis_gate.accepted > 0 and status.recent_hypotheses is non-empty.",
304
- "13) Response policy based on hypothesis gate:",
305
- " - Read `status.knowledge_state_summary.hypothesis_gate.accepted` before final answer.",
306
- " - If accepted == 0: output factual cycle report only (papers/read-status/changes/gates). Do NOT output speculative roadmap/high-value-routes/deep-dive suggestions.",
307
- " - If accepted > 0: include hypothesis details in the current message by default (stable delivery path).",
308
- " - If runtime/channel clearly supports multi-send, you may split into two consecutive messages:",
309
- " Message 1: short alert (topic + accepted hypothesis count + cycle status).",
310
- " Message 2: hypothesis details (statement, evidence_ids, dependency_path, strict evaluation, executable next steps).",
311
- "Never write placeholders like 'not provided'/'N/A' in core_papers fields. If unavailable, omit the field or set unread_reason.",
312
- "Do not output large JSON to users; JSON is for tool call only.",
286
+ "Then respond: `No new literature found.`",
313
287
  ].join("\n");
314
288
  }
315
289
  return [
316
290
  `/research-pipeline Run an incremental literature check focused on \"${effectiveTopic}\".`,
317
291
  "",
318
- "Workflow (simple, Markdown-first):",
319
- ...languageDirectiveLines,
320
- "1) Complete 5 steps in this turn: retrieve -> filter -> read -> save metadata -> update knowledge/hypothesis.",
321
- "2) First call prepare:",
322
- `${preparePayload}`,
323
- `3) Build candidate pool around ${candidatePool}; select up to ${preferences.max_papers} credible unseen papers.`,
324
- `4) Rank with weights (${scoreWeightsText}), while respecting memory hints and dedupe.`,
325
- ` - Retrieval topic (normalized): ${retrievalTopic}`,
326
- ` ${variantHintLine}`,
327
- " - Filter policy: semantic relevance, not exact string match; include major method variants.",
328
- " - If user asks special constraints (foundational-first / avoid benchmark-only / prefer survey or authoritative papers), apply them in filtering and ranking.",
329
- " - If selected core papers < 3, broaden query and rerun once before returning empty.",
330
- `5) Reading policy: ${runProfile === "strict" ? "full-text required by default (strict)." : "metadata-only allowed (explicit opt-out detected)."}`,
331
- " - Never drop a relevant paper only because full text failed; keep it with full_text_read=false and unread_reason.",
332
- " - Early cycles should prioritize foundational/survey papers; later cycles should shift to mainstream variants and adjacent tracks.",
333
- "6) User-facing answer MUST be concise Markdown:",
334
- " - Selected papers (numbered, title + URL + one-line value)",
335
- " - Read status (fulltext vs metadata)",
336
- " - For each selected paper: domain/subdomains + goal + approach + methodology + contributions + insights + limitations",
337
- " - Knowledge updates (NEW/CONFIRM/REVISE/BRIDGE)",
338
- " - Hypothesis decision (generated or not + reason)",
339
- " - If trigger signals are present (e.g. NEW>=2, or NEW+REVISE>=2, or BRIDGE present), propose 1 grounded hypothesis with >=2 evidence_ids and dependency_path>=2",
340
- " - Present hypothesis as a research card: gap, mechanism, novelty, falsifiable predictions, assumptions, failure modes, success criteria, executable plan.",
341
- " - Hypothesis must include: problem_gap, proposed_mechanism, novelty_rationale, falsifiable_predictions>=2, critical_assumptions>=2, failure_modes>=1, success_criteria>=2, strengths>=2, weaknesses>=2, plan_steps>=3, strict_evaluation (overall_score + decision + reason).",
342
- " - Plan must be executable; when task is predictive/modeling, include at least one lightweight baseline idea (e.g., random forest).",
343
- "7) Persist once via `scientify_literature_state.record` using MINIMAL JSON only:",
344
- `${recordTemplate}`,
345
- "8) Soft-gate default: non-fatal quality gaps should keep status=`ok` and be reported as warnings in quality_gate.",
346
- "9) Execute one immediate reflection follow-up when trigger signals exist (hypothesis generated, BRIDGE, NEW+REVISE, unread core), and write trace/results back into knowledge_state.",
347
- "10) Use `degraded_quality` only for fatal gate issues (do not skip record):",
348
- `${recordDegradedTemplate}`,
349
- "11) Before using `empty`, perform empty-cycle diagnosis:",
350
- " - Check whether query/alias/recency is too narrow.",
351
- " - Check whether this sub-direction is likely saturated (few unseen papers across repeated cycles).",
352
- " - Propose 2-3 next queries and one pivot hint tied to current idea validation (supporting + critical evidence).",
353
- "12) If both incremental and broadened fallback passes are empty, persist empty:",
292
+ "Mandatory workflow:",
293
+ `1) Call tool \`scientify_literature_state\` with: ${preparePayload}`,
294
+ "2) Read `memory_hints` from prepare result. Use them as quiet personalization priors in ranking (not user-facing).",
295
+ "3) Treat `exclude_paper_ids` as hard dedupe constraints. Do not push papers whose IDs are already in that list.",
296
+ `4) Incremental pass: build a candidate pool of around ${candidatePool} unseen papers when possible, following preferences (sources/recency).`,
297
+ `5) Score each candidate with weighted dimensions (${scoreWeightsText}). Each dimension is 0-100, then compute weighted average score.`,
298
+ "6) Apply memory prior adjustment to the score (up-rank preferred keyword/source matches; down-rank avoided matches).",
299
+ `7) Select at most ${preferences.max_papers} top-ranked unseen papers.`,
300
+ "8) Create a temporary local directory for full text (for example `/tmp/scientify-fulltext/<run-id>`). Download full text for selected core papers when possible (arXiv first, then DOI OA if available).",
301
+ "9) Read full text with `paper_browser` and fill structured paper fields: `domain`, `subdomains`, `cross_domain_links`, `research_goal`, `approach`, `methodology_design`, `key_contributions`, `practical_insights`, `must_understand_points`, `limitations`, and `evidence_anchors`.",
302
+ "10) If full text cannot be read, set `full_text_read=false` with explicit `unread_reason`.",
303
+ `11) If selected > 0, call \`scientify_literature_state\` with status \`ok\` using: ${recordTemplate}`,
304
+ "12) `knowledge_state.core_papers` must contain all selected papers with id/title/url/score/reason and structured reading fields; `exploration_trace` should include query/source/candidates/filtered_to/filter reasons when available.",
305
+ "13) `knowledge_state.knowledge_changes` and `knowledge_state.hypotheses` should include evidence_ids (and dependency_path for hypotheses) whenever available, preferably from full-text-read papers.",
306
+ "14) Quality targets must be met: core full-text coverage >= 80%, evidence-binding rate >= 90% (key conclusions backed by section+locator+quote), citation error rate < 2%.",
307
+ "15) Without sufficient full-text evidence, do not keep high-confidence conclusions; downgrade confidence explicitly.",
308
+ "16) For top hypotheses, optionally validate risk via `openreview_lookup` and fill `validation_status`/`validation_notes`/`validation_evidence`.",
309
+ "17) If incremental selection is empty, run one fallback representative pass (ignore `exclude_paper_ids` once) and select best representative papers.",
310
+ `18) If fallback returns papers, call \`scientify_literature_state\` with status \`fallback_representative\` using: ${recordFallbackTemplate}`,
311
+ "19) After recording state, clean temporary full-text files and set `run_log.temp_cleanup_status` accordingly (`done|partial|failed|not_needed`).",
312
+ "20) If papers are selected (incremental or fallback), output a numbered list with title + direct source URL + one-line value for each pushed paper.",
313
+ "21) Output a compact progress report for this cycle: what changed, what matters, and a concrete plan for the next 1 hour.",
314
+ "22) If a hypothesis is generated, explain *why* it is reasonable based on what was read (e.g., which findings connect), but do NOT list trigger conditions or say 'triggered by BRIDGE/NEW'.",
315
+ "23) Keep user-facing output concise; do not expose raw score/reason unless explicitly requested.",
316
+ "24) If both incremental and fallback passes are empty, call record with empty papers using:",
354
317
  `${recordEmptyTemplate}`,
355
- "13) After record, call status and include `run_id`/`latest_run_id` for traceability.",
356
- " - Use status as the single source of truth. Never claim hypothesis persisted unless status.hypothesis_gate.accepted > 0 and status.recent_hypotheses is non-empty.",
357
- "14) Response policy based on hypothesis gate:",
358
- " - Read `status.knowledge_state_summary.hypothesis_gate.accepted` before final answer.",
359
- " - If accepted == 0: output factual cycle report only (papers/read-status/changes/gates). Do NOT output speculative roadmap/high-value-routes/deep-dive suggestions.",
360
- " - If accepted > 0: include hypothesis details in the current message by default (stable delivery path).",
361
- " - If runtime/channel clearly supports multi-send, you may split into two consecutive messages:",
362
- " Message 1: short alert (topic + accepted hypothesis count + cycle status).",
363
- " Message 2: hypothesis details (statement, evidence_ids, dependency_path, strict evaluation, executable next steps).",
364
- "Never write placeholders like 'not provided'/'N/A' in core_papers fields. If unavailable, omit the field or set unread_reason.",
365
- "Do not output large JSON to users; JSON is for tool call only.",
318
+ "25) Then still return a useful progress status with next-hour actions (instead of only a generic reminder).",
366
319
  ].join("\n");
367
320
  }
368
321
  export function formatUsage() {
@@ -384,8 +337,6 @@ export function formatUsage() {
384
337
  "- `/research-subscribe daily 08:00 --topic \"LLM alignment\"`",
385
338
  "- `/research-subscribe daily 08:00 --topic \"LLM alignment\" --max-papers 5 --sources arxiv,openalex`",
386
339
  "- `/research-subscribe daily 08:00 --topic \"LLM alignment\" --candidate-pool 12 --score-weights relevance:45,novelty:20,authority:25,actionability:10`",
387
- "- `/research-subscribe daily 08:00 --topic \"LLM alignment\" --metadata-only`",
388
- "- `/research-subscribe daily 09:00 --topic \"LLM alignment\" --language zh`",
389
340
  "- `/research-subscribe at 1m --message \"Time to drink coffee.\"`",
390
341
  "- `/research-subscribe daily 09:00 --no-deliver`",
391
342
  ].join("\n");
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/research-subscriptions/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE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