scientify 1.12.0 → 1.12.2
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.
- package/README.md +3 -1
- package/README.zh.md +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/src/cli/research.d.ts +1 -1
- package/dist/src/cli/research.d.ts.map +1 -1
- package/dist/src/cli/research.js +123 -227
- package/dist/src/cli/research.js.map +1 -1
- package/dist/src/commands/metabolism-status.d.ts +2 -2
- package/dist/src/commands/metabolism-status.d.ts.map +1 -1
- package/dist/src/commands/metabolism-status.js +75 -72
- package/dist/src/commands/metabolism-status.js.map +1 -1
- package/dist/src/commands.d.ts.map +1 -1
- package/dist/src/commands.js +55 -0
- package/dist/src/commands.js.map +1 -1
- package/dist/src/hooks/research-mode.d.ts +1 -1
- package/dist/src/hooks/research-mode.d.ts.map +1 -1
- package/dist/src/hooks/research-mode.js +67 -24
- package/dist/src/hooks/research-mode.js.map +1 -1
- package/dist/src/hooks/scientify-signature.d.ts.map +1 -1
- package/dist/src/hooks/scientify-signature.js +5 -2
- package/dist/src/hooks/scientify-signature.js.map +1 -1
- package/dist/src/knowledge-state/render.d.ts +9 -1
- package/dist/src/knowledge-state/render.d.ts.map +1 -1
- package/dist/src/knowledge-state/render.js +132 -33
- package/dist/src/knowledge-state/render.js.map +1 -1
- package/dist/src/knowledge-state/store.d.ts.map +1 -1
- package/dist/src/knowledge-state/store.js +545 -38
- package/dist/src/knowledge-state/store.js.map +1 -1
- package/dist/src/knowledge-state/types.d.ts +31 -0
- package/dist/src/knowledge-state/types.d.ts.map +1 -1
- package/dist/src/literature/subscription-state.d.ts +2 -0
- package/dist/src/literature/subscription-state.d.ts.map +1 -1
- package/dist/src/literature/subscription-state.js +586 -7
- package/dist/src/literature/subscription-state.js.map +1 -1
- package/dist/src/research-subscriptions/constants.d.ts +1 -1
- package/dist/src/research-subscriptions/constants.js +1 -1
- package/dist/src/research-subscriptions/parse.d.ts.map +1 -1
- package/dist/src/research-subscriptions/parse.js +10 -0
- package/dist/src/research-subscriptions/parse.js.map +1 -1
- package/dist/src/research-subscriptions/prompt.d.ts +1 -1
- package/dist/src/research-subscriptions/prompt.d.ts.map +1 -1
- package/dist/src/research-subscriptions/prompt.js +144 -195
- package/dist/src/research-subscriptions/prompt.js.map +1 -1
- package/dist/src/research-subscriptions/types.d.ts +1 -0
- package/dist/src/research-subscriptions/types.d.ts.map +1 -1
- package/dist/src/templates/bootstrap.d.ts.map +1 -1
- package/dist/src/templates/bootstrap.js +19 -32
- package/dist/src/templates/bootstrap.js.map +1 -1
- package/dist/src/tools/scientify-cron.d.ts +6 -2
- package/dist/src/tools/scientify-cron.d.ts.map +1 -1
- package/dist/src/tools/scientify-cron.js +396 -12
- package/dist/src/tools/scientify-cron.js.map +1 -1
- package/dist/src/tools/scientify-literature-state.d.ts +12 -0
- package/dist/src/tools/scientify-literature-state.d.ts.map +1 -1
- package/dist/src/tools/scientify-literature-state.js +159 -45
- package/dist/src/tools/scientify-literature-state.js.map +1 -1
- package/openclaw.plugin.json +2 -4
- package/package.json +1 -1
- package/skills/research-subscription/SKILL.md +23 -0
|
@@ -1,6 +1,9 @@
|
|
|
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;
|
|
4
7
|
function normalizeReminderText(raw) {
|
|
5
8
|
let text = raw.trim();
|
|
6
9
|
text = text.replace(/^(please\s+)?remind\s+(me|us|you)\s+(to\s+)?/i, "");
|
|
@@ -42,6 +45,37 @@ function deriveResearchTopicFromMessage(message) {
|
|
|
42
45
|
const normalized = text.trim();
|
|
43
46
|
return normalized.length > 0 ? normalized : message.trim();
|
|
44
47
|
}
|
|
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 buildVariantKeywords(topic) {
|
|
53
|
+
const keywords = new Set();
|
|
54
|
+
const normalized = normalizeRetrievalTopic(topic);
|
|
55
|
+
const tokens = normalized
|
|
56
|
+
.toLowerCase()
|
|
57
|
+
.match(/[\p{L}\p{N}][\p{L}\p{N}_-]{1,47}/gu)
|
|
58
|
+
?.map((item) => item.trim())
|
|
59
|
+
.filter((item) => item.length >= 3) ?? [];
|
|
60
|
+
if (normalized.length > 0)
|
|
61
|
+
keywords.add(normalized);
|
|
62
|
+
if (tokens.length >= 2) {
|
|
63
|
+
keywords.add(tokens.slice(0, 4).join(" "));
|
|
64
|
+
keywords.add(tokens.slice(0, 3).join("-"));
|
|
65
|
+
}
|
|
66
|
+
for (const token of tokens.slice(0, 8)) {
|
|
67
|
+
keywords.add(token);
|
|
68
|
+
}
|
|
69
|
+
return [...keywords].slice(0, 10);
|
|
70
|
+
}
|
|
71
|
+
function resolveRunProfile(options, effectiveTopic) {
|
|
72
|
+
if (options.metadataOnly === true)
|
|
73
|
+
return "fast";
|
|
74
|
+
const text = `${options.topic ?? ""} ${options.message ?? ""} ${effectiveTopic}`.trim();
|
|
75
|
+
if (text.length > 0 && FULLTEXT_OPT_OUT_RE.test(text))
|
|
76
|
+
return "fast";
|
|
77
|
+
return "strict";
|
|
78
|
+
}
|
|
45
79
|
function buildPreferencePayload(options) {
|
|
46
80
|
const maxPapers = options.maxPapers ?? 5;
|
|
47
81
|
const normalizedSources = options.sources?.map((item) => item.trim().toLowerCase()).filter(Boolean);
|
|
@@ -73,9 +107,15 @@ export function buildScheduledTaskMessage(options, scheduleKind, scopeKey) {
|
|
|
73
107
|
}
|
|
74
108
|
const trimmedTopic = (options.topic ?? promotedTopic)?.trim();
|
|
75
109
|
const effectiveTopic = trimmedTopic || "active project research updates";
|
|
110
|
+
const retrievalTopic = normalizeRetrievalTopic(effectiveTopic);
|
|
111
|
+
const variantKeywords = buildVariantKeywords(retrievalTopic);
|
|
76
112
|
const preferences = buildPreferencePayload(options);
|
|
113
|
+
const runProfile = resolveRunProfile(options, effectiveTopic);
|
|
77
114
|
const projectId = options.projectId?.trim();
|
|
78
|
-
const
|
|
115
|
+
const candidatePoolBase = resolveCandidatePool(options.candidatePool, preferences.max_papers);
|
|
116
|
+
const candidatePool = runProfile === "strict"
|
|
117
|
+
? Math.max(candidatePoolBase, Math.min(40, Math.max(20, preferences.max_papers * 4)))
|
|
118
|
+
: candidatePoolBase;
|
|
79
119
|
const scoreWeights = options.scoreWeights ?? DEFAULT_SCORE_WEIGHTS;
|
|
80
120
|
const scoreWeightsText = formatScoreWeights(scoreWeights);
|
|
81
121
|
const preparePayload = JSON.stringify({
|
|
@@ -85,236 +125,144 @@ export function buildScheduledTaskMessage(options, scheduleKind, scopeKey) {
|
|
|
85
125
|
...(projectId ? { project_id: projectId } : {}),
|
|
86
126
|
preferences,
|
|
87
127
|
});
|
|
88
|
-
const
|
|
89
|
-
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
};
|
|
128
|
+
const strictRunLogTemplate = runProfile === "strict"
|
|
129
|
+
? {
|
|
130
|
+
required_core_papers: Math.max(1, Math.min(preferences.max_papers, 3)),
|
|
131
|
+
required_full_text_coverage_pct: 80,
|
|
132
|
+
}
|
|
133
|
+
: {};
|
|
205
134
|
const recordTemplate = JSON.stringify({
|
|
206
135
|
action: "record",
|
|
207
136
|
scope: scopeKey,
|
|
208
137
|
topic: effectiveTopic,
|
|
209
138
|
...(projectId ? { project_id: projectId } : {}),
|
|
139
|
+
run_profile: runProfile,
|
|
140
|
+
run_id: "run-<unique-id>",
|
|
210
141
|
status: "ok",
|
|
211
|
-
papers:
|
|
212
|
-
knowledge_state:
|
|
142
|
+
papers: [{ id: "arxiv:2501.12345", title: "Paper title", url: "https://arxiv.org/abs/2501.12345" }],
|
|
143
|
+
knowledge_state: {
|
|
144
|
+
core_papers: [
|
|
145
|
+
{
|
|
146
|
+
id: "arxiv:2501.12345",
|
|
147
|
+
title: "Paper title",
|
|
148
|
+
url: "https://arxiv.org/abs/2501.12345",
|
|
149
|
+
full_text_read: true,
|
|
150
|
+
domain: "machine learning",
|
|
151
|
+
subdomains: ["parameter-efficient fine-tuning"],
|
|
152
|
+
research_goal: "one-sentence goal",
|
|
153
|
+
approach: "one-sentence approach",
|
|
154
|
+
methodology_design: "one-sentence method setup",
|
|
155
|
+
key_contributions: ["contribution 1", "contribution 2"],
|
|
156
|
+
practical_insights: ["insight 1"],
|
|
157
|
+
must_understand_points: ["must-understand 1"],
|
|
158
|
+
limitations: ["limitation 1"],
|
|
159
|
+
evidence_anchors: [
|
|
160
|
+
{
|
|
161
|
+
section: "Method",
|
|
162
|
+
locator: "Eq.(3)",
|
|
163
|
+
claim: "key claim",
|
|
164
|
+
quote: "short quote from paper",
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
knowledge_changes: [{ type: "NEW", statement: "one concrete change", evidence_ids: ["arxiv:2501.12345"] }],
|
|
170
|
+
run_log: { run_profile: runProfile, notes: "short run note", ...strictRunLogTemplate },
|
|
171
|
+
},
|
|
213
172
|
});
|
|
214
|
-
const
|
|
173
|
+
const recordDegradedTemplate = JSON.stringify({
|
|
215
174
|
action: "record",
|
|
216
175
|
scope: scopeKey,
|
|
217
176
|
topic: effectiveTopic,
|
|
218
177
|
...(projectId ? { project_id: projectId } : {}),
|
|
219
|
-
|
|
220
|
-
|
|
178
|
+
run_profile: runProfile,
|
|
179
|
+
run_id: "run-<unique-id>-degraded",
|
|
180
|
+
status: "degraded_quality",
|
|
181
|
+
papers: [{ id: "arxiv:2501.12345", title: "Paper title", url: "https://arxiv.org/abs/2501.12345" }],
|
|
221
182
|
knowledge_state: {
|
|
222
|
-
...
|
|
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
|
-
},
|
|
183
|
+
run_log: { run_profile: runProfile, degraded: true, notes: "quality not fully met in this run", ...strictRunLogTemplate },
|
|
234
184
|
},
|
|
235
|
-
note: "
|
|
185
|
+
note: "selected papers persisted with degraded quality",
|
|
236
186
|
});
|
|
237
187
|
const recordEmptyTemplate = JSON.stringify({
|
|
238
188
|
action: "record",
|
|
239
189
|
scope: scopeKey,
|
|
240
190
|
topic: effectiveTopic,
|
|
241
191
|
...(projectId ? { project_id: projectId } : {}),
|
|
192
|
+
run_profile: runProfile,
|
|
193
|
+
run_id: "run-20260309T103000Z-empty",
|
|
242
194
|
status: "empty",
|
|
243
195
|
papers: [],
|
|
244
196
|
knowledge_state: {
|
|
245
|
-
|
|
246
|
-
exploration_papers: [],
|
|
247
|
-
exploration_trace: [],
|
|
248
|
-
knowledge_changes: [],
|
|
249
|
-
knowledge_updates: [],
|
|
250
|
-
hypotheses: [],
|
|
251
|
-
run_log: {
|
|
252
|
-
model: "model-name",
|
|
253
|
-
temp_cleanup_status: "not_needed",
|
|
254
|
-
notes: "No suitable paper found in this cycle.",
|
|
255
|
-
},
|
|
197
|
+
run_log: { run_profile: runProfile, notes: "No suitable paper found in this cycle.", ...strictRunLogTemplate },
|
|
256
198
|
},
|
|
257
199
|
note: "No suitable paper found in incremental pass and fallback representative pass.",
|
|
258
200
|
});
|
|
201
|
+
const variantHintLine = variantKeywords.length > 0 ? `- Expansion keywords: ${variantKeywords.join(", ")}` : "- Expansion keywords: (none)";
|
|
259
202
|
if (scheduleKind === "at") {
|
|
260
203
|
return [
|
|
261
204
|
`/research-pipeline Run a focused literature study on \"${effectiveTopic}\" and return up to ${preferences.max_papers} high-value representative papers.`,
|
|
262
205
|
"",
|
|
263
|
-
"
|
|
264
|
-
|
|
265
|
-
"2)
|
|
266
|
-
|
|
267
|
-
`
|
|
268
|
-
`
|
|
269
|
-
`
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
"
|
|
275
|
-
"
|
|
276
|
-
"
|
|
277
|
-
"
|
|
278
|
-
"
|
|
279
|
-
"
|
|
280
|
-
"
|
|
281
|
-
"
|
|
282
|
-
|
|
283
|
-
"
|
|
284
|
-
|
|
206
|
+
"Workflow (simple, Markdown-first):",
|
|
207
|
+
"1) Complete 5 steps in this turn: retrieve -> filter -> read -> save metadata -> update knowledge/hypothesis.",
|
|
208
|
+
"2) First call prepare:",
|
|
209
|
+
`${preparePayload}`,
|
|
210
|
+
`3) Build candidate pool around ${candidatePool}; select up to ${preferences.max_papers} credible papers.`,
|
|
211
|
+
` - Retrieval topic (normalized): ${retrievalTopic}`,
|
|
212
|
+
` ${variantHintLine}`,
|
|
213
|
+
" - Filter policy: semantic relevance, not exact string match; include important variants and aliases.",
|
|
214
|
+
" - If core candidates < 3, relax filters and rerun with broader query terms before declaring empty.",
|
|
215
|
+
`4) Reading policy: ${runProfile === "strict" ? "full-text required by default (strict)." : "metadata-only allowed (explicit opt-out detected)."}`,
|
|
216
|
+
" - Never drop a relevant paper only because full text failed; keep it with full_text_read=false and unread_reason.",
|
|
217
|
+
"5) User-facing answer MUST be concise Markdown:",
|
|
218
|
+
" - Selected papers (numbered, title + URL + one-line value)",
|
|
219
|
+
" - Read status (fulltext vs metadata)",
|
|
220
|
+
" - For each selected paper: domain/subdomains + goal + approach + methodology + contributions + insights + limitations",
|
|
221
|
+
" - Knowledge updates (NEW/CONFIRM/REVISE/BRIDGE)",
|
|
222
|
+
" - Hypothesis decision (generated or not + reason)",
|
|
223
|
+
" - 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",
|
|
224
|
+
"6) Persist once via `scientify_literature_state.record` using MINIMAL JSON only:",
|
|
225
|
+
`${recordTemplate}`,
|
|
226
|
+
"7) If papers exist but quality is partial, persist `degraded_quality` (do not skip record):",
|
|
227
|
+
`${recordDegradedTemplate}`,
|
|
228
|
+
"8) Use `empty` only when no paper is selected after both primary and broadened fallback retrieval:",
|
|
285
229
|
`${recordEmptyTemplate}`,
|
|
286
|
-
"
|
|
230
|
+
"9) After record, call status and include `run_id`/`latest_run_id`.",
|
|
231
|
+
"Never write placeholders like 'not provided'/'N/A' in core_papers fields. If unavailable, omit the field or set unread_reason.",
|
|
232
|
+
"Do not output large JSON to users; JSON is for tool call only.",
|
|
287
233
|
].join("\n");
|
|
288
234
|
}
|
|
289
235
|
return [
|
|
290
236
|
`/research-pipeline Run an incremental literature check focused on \"${effectiveTopic}\".`,
|
|
291
237
|
"",
|
|
292
|
-
"
|
|
293
|
-
|
|
294
|
-
"2)
|
|
295
|
-
|
|
296
|
-
`
|
|
297
|
-
`
|
|
298
|
-
|
|
299
|
-
`
|
|
300
|
-
"
|
|
301
|
-
"
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
"
|
|
305
|
-
"
|
|
306
|
-
"
|
|
307
|
-
"
|
|
308
|
-
"
|
|
309
|
-
"
|
|
310
|
-
|
|
311
|
-
"
|
|
312
|
-
|
|
313
|
-
"
|
|
314
|
-
|
|
315
|
-
"
|
|
238
|
+
"Workflow (simple, Markdown-first):",
|
|
239
|
+
"1) Complete 5 steps in this turn: retrieve -> filter -> read -> save metadata -> update knowledge/hypothesis.",
|
|
240
|
+
"2) First call prepare:",
|
|
241
|
+
`${preparePayload}`,
|
|
242
|
+
`3) Build candidate pool around ${candidatePool}; select up to ${preferences.max_papers} credible unseen papers.`,
|
|
243
|
+
`4) Rank with weights (${scoreWeightsText}), while respecting memory hints and dedupe.`,
|
|
244
|
+
` - Retrieval topic (normalized): ${retrievalTopic}`,
|
|
245
|
+
` ${variantHintLine}`,
|
|
246
|
+
" - Filter policy: semantic relevance, not exact string match; include major method variants.",
|
|
247
|
+
" - If selected core papers < 3, broaden query and rerun once before returning empty.",
|
|
248
|
+
`5) Reading policy: ${runProfile === "strict" ? "full-text required by default (strict)." : "metadata-only allowed (explicit opt-out detected)."}`,
|
|
249
|
+
" - Never drop a relevant paper only because full text failed; keep it with full_text_read=false and unread_reason.",
|
|
250
|
+
"6) User-facing answer MUST be concise Markdown:",
|
|
251
|
+
" - Selected papers (numbered, title + URL + one-line value)",
|
|
252
|
+
" - Read status (fulltext vs metadata)",
|
|
253
|
+
" - For each selected paper: domain/subdomains + goal + approach + methodology + contributions + insights + limitations",
|
|
254
|
+
" - Knowledge updates (NEW/CONFIRM/REVISE/BRIDGE)",
|
|
255
|
+
" - Hypothesis decision (generated or not + reason)",
|
|
256
|
+
" - 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",
|
|
257
|
+
"7) Persist once via `scientify_literature_state.record` using MINIMAL JSON only:",
|
|
258
|
+
`${recordTemplate}`,
|
|
259
|
+
"8) If papers exist but quality is partial, persist `degraded_quality` (do not skip record):",
|
|
260
|
+
`${recordDegradedTemplate}`,
|
|
261
|
+
"9) If both incremental and broadened fallback passes are empty, persist empty:",
|
|
316
262
|
`${recordEmptyTemplate}`,
|
|
317
|
-
"
|
|
263
|
+
"10) After record, call status and include `run_id`/`latest_run_id` for traceability.",
|
|
264
|
+
"Never write placeholders like 'not provided'/'N/A' in core_papers fields. If unavailable, omit the field or set unread_reason.",
|
|
265
|
+
"Do not output large JSON to users; JSON is for tool call only.",
|
|
318
266
|
].join("\n");
|
|
319
267
|
}
|
|
320
268
|
export function formatUsage() {
|
|
@@ -336,6 +284,7 @@ export function formatUsage() {
|
|
|
336
284
|
"- `/research-subscribe daily 08:00 --topic \"LLM alignment\"`",
|
|
337
285
|
"- `/research-subscribe daily 08:00 --topic \"LLM alignment\" --max-papers 5 --sources arxiv,openalex`",
|
|
338
286
|
"- `/research-subscribe daily 08:00 --topic \"LLM alignment\" --candidate-pool 12 --score-weights relevance:45,novelty:20,authority:25,actionability:10`",
|
|
287
|
+
"- `/research-subscribe daily 08:00 --topic \"LLM alignment\" --metadata-only`",
|
|
339
288
|
"- `/research-subscribe at 1m --message \"Time to drink coffee.\"`",
|
|
340
289
|
"- `/research-subscribe daily 09:00 --no-deliver`",
|
|
341
290
|
].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,MAAM,YAAY,CAAC;AAGtE,MAAM,yBAAyB,GAC7B,iHAAiH,CAAC;
|
|
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,MAAM,YAAY,CAAC;AAGtE,MAAM,yBAAyB,GAC7B,iHAAiH,CAAC;AACpH,MAAM,mBAAmB,GACvB,uIAAuI,CAAC;AAC1I,MAAM,oBAAoB,GAAG,0FAA0F,CAAC;AACxH,MAAM,aAAa,GAAG,8CAA8C,CAAC;AAErE,SAAS,qBAAqB,CAAC,GAAW;IACxC,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACtB,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,+CAA+C,EAAE,EAAE,CAAC,CAAC;IACzE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IAC9C,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,uCAAuC,EAAE,EAAE,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC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,gBAAgB,8CAA8C;QACvF,sCAAsC,cAAc,EAAE;QACtD,MAAM,eAAe,EAAE;QACvB,gGAAgG;QAChG,wFAAwF;QACxF,sBAAsB,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC,CAAC,oDAAoD,EAAE;QAClJ,sHAAsH;QACtH,iDAAiD;QACjD,+DAA+D;QAC/D,yCAAyC;QACzC,0HAA0H;QAC1H,oDAAoD;QACpD,sDAAsD;QACtD,oKAAoK;QACpK,kFAAkF;QAClF,GAAG,cAAc,EAAE;QACnB,6FAA6F;QAC7F,GAAG,sBAAsB,EAAE;QAC3B,gFAAgF;QAChF,GAAG,mBAAmB,EAAE;QACxB,sFAAsF;QACtF,gIAAgI;QAChI,gEAAgE;KACjE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO;QACL,qCAAqC;QACrC,EAAE;QACF,WAAW;QACX,yBAAyB;QACzB,mDAAmD;QACnD,wDAAwD;QACxD,kCAAkC;QAClC,+BAA+B;QAC/B,sDAAsD;QACtD,0DAA0D;QAC1D,kEAAkE;QAClE,mEAAmE;QACnE,+CAA+C;QAC/C,2DAA2D;QAC3D,+DAA+D;QAC/D,uGAAuG;QACvG,yJAAyJ;QACzJ,+EAA+E;QAC/E,mEAAmE;QACnE,kDAAkD;KACnD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,GAAG,IAAI,KAAK,0BAA0B,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/research-subscriptions/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE5D,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,EAAE,MAAM,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B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/research-subscriptions/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE5D,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEN,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAA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IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../src/templates/bootstrap.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../src/templates/bootstrap.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAkC7D;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAexD;AAED,wBAAgB,cAAc,IAAI,MAAM,CAmFvC"}
|
|
@@ -13,36 +13,25 @@ export function renderBootstrapMd(projectName) {
|
|
|
13
13
|
2. 根据用户回答,提取:
|
|
14
14
|
- 核心域关键词(3-5 个)
|
|
15
15
|
- 建议的 arXiv 分类(如 cs.LG, cs.AI)
|
|
16
|
-
-
|
|
16
|
+
- 建议的跨域探索方向(反射带)
|
|
17
17
|
3. 向用户确认以上配置,接受调整
|
|
18
18
|
4. 确认后执行以下写入操作:
|
|
19
19
|
- 更新 SOUL.md:填写研究方向、核心域、监测带各字段
|
|
20
|
-
- 生成
|
|
21
|
-
5.
|
|
22
|
-
-
|
|
20
|
+
- 生成 task.json(记录 topic / mode / created)
|
|
21
|
+
5. 询问用户是否立即执行首轮研究(持续研究引擎)
|
|
22
|
+
- 如果是,执行 prepare -> collect/filter -> reflect -> record -> status
|
|
23
|
+
- 研究状态写入 knowledge_state/
|
|
23
24
|
6. 删除本文件(BOOTSTRAP.md)
|
|
24
25
|
|
|
25
|
-
##
|
|
26
|
+
## task.json 模板
|
|
26
27
|
|
|
27
28
|
\`\`\`json
|
|
28
29
|
{
|
|
29
30
|
"projectId": "${projectName}",
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
"monitorZone": {
|
|
36
|
-
"categories": ["相邻领域分类"],
|
|
37
|
-
"enabled": true
|
|
38
|
-
},
|
|
39
|
-
"heartbeat": {
|
|
40
|
-
"cronExpression": "0 6 * * *",
|
|
41
|
-
"timezone": "Asia/Shanghai",
|
|
42
|
-
"enabled": true
|
|
43
|
-
},
|
|
44
|
-
"agentId": "research-${projectName}",
|
|
45
|
-
"currentDay": 0,
|
|
31
|
+
"topic": "由用户确认后的研究主题",
|
|
32
|
+
"coreKeywords": ["关键词1", "关键词2"],
|
|
33
|
+
"monitorKeywords": ["跨域探索关键词"],
|
|
34
|
+
"mode": "continuous-research-engine",
|
|
46
35
|
"createdAt": "${new Date().toISOString()}"
|
|
47
36
|
}
|
|
48
37
|
\`\`\`
|
|
@@ -75,14 +64,13 @@ export function renderAgentsMd() {
|
|
|
75
64
|
$W/
|
|
76
65
|
├── SOUL.md # 身份 + 研究方向
|
|
77
66
|
├── AGENTS.md # 本文档
|
|
78
|
-
├──
|
|
79
|
-
│ ├──
|
|
80
|
-
│ ├──
|
|
81
|
-
│
|
|
82
|
-
│
|
|
83
|
-
│ ├──
|
|
84
|
-
│
|
|
85
|
-
│ └── log/ # 运行日志
|
|
67
|
+
├── knowledge_state/ # 持续研究状态真源(唯一)
|
|
68
|
+
│ ├── knowledge/
|
|
69
|
+
│ ├── daily_changes/
|
|
70
|
+
│ ├── hypotheses/
|
|
71
|
+
│ ├── logs/
|
|
72
|
+
│ ├── state.json
|
|
73
|
+
│ └── events.jsonl
|
|
86
74
|
├── survey/ # /research-collect outputs
|
|
87
75
|
│ ├── search_terms.json
|
|
88
76
|
│ └── report.md
|
|
@@ -102,14 +90,13 @@ $W/
|
|
|
102
90
|
├── iterations/ # /research-review: 审查迭代
|
|
103
91
|
│ └── judge_v*.md
|
|
104
92
|
├── experiment_res.md # /research-experiment: 实验报告
|
|
105
|
-
└── skills/ # workspace skills (metabolism 等)
|
|
106
93
|
\`\`\`
|
|
107
94
|
|
|
108
95
|
## Session Context
|
|
109
96
|
|
|
110
97
|
你可能在不同类型的 session 中被唤醒:
|
|
111
98
|
- **Main session**:与人类直接对话,可触发 research-pipeline 等编排 skill
|
|
112
|
-
- **Cron session
|
|
99
|
+
- **Cron session**:定时触发,执行周期性研究心跳
|
|
113
100
|
- **Spawn session**:被 main session 调度(sessions_spawn),执行一次性重任务
|
|
114
101
|
|
|
115
102
|
任务指令会在 session 启动时注入,按指令执行即可。
|
|
@@ -123,7 +110,7 @@ $W/
|
|
|
123
110
|
产出文件一旦写入不修改,除非用户明确要求。例外:\`project/\` 在 implement-review 迭代中可变。
|
|
124
111
|
|
|
125
112
|
### Knowledge File Rules
|
|
126
|
-
-
|
|
113
|
+
- knowledge_state/ 下的文件是持久知识状态,修改需谨慎
|
|
127
114
|
- 每次修改必须先读取当前内容再更新
|
|
128
115
|
- _index.md 是全景索引,必须与 topic 文件保持同步
|
|
129
116
|
- topic 文件数上限 50,低活跃主题应合并归档
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../src/templates/bootstrap.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,OAAO;;YAEG,WAAW;;;;kBAIL,WAAW
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../src/templates/bootstrap.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,OAAO;;YAEG,WAAW;;;;kBAIL,WAAW;;;;;;;;;;;;;;;;;;kBAkBX,WAAW;;;;;kBAKX,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;;;CAGzC,CAAC;AACF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,WAAmB;IAC9C,OAAO,qBAAqB,WAAW;;OAElC,WAAW;;;;;;;;;;;CAWjB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFR,CAAC;AACF,CAAC"}
|