superlab 0.1.20 → 0.1.21
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/lib/context.cjs
CHANGED
|
@@ -29,6 +29,35 @@ const EVAL_COLLABORATOR_FIELDS = [
|
|
|
29
29
|
{ name: "Metric source papers", labels: ["Metric source papers", "指标来源论文"] },
|
|
30
30
|
{ name: "Required output artifacts", labels: ["Required output artifacts", "必要输出工件"] },
|
|
31
31
|
];
|
|
32
|
+
const REPORT_REQUIRED_SECTIONS = [
|
|
33
|
+
{ name: "Report Status", patterns: [/^##\s+Report Status\s*$/m, /^##\s+报告状态\s*$/m] },
|
|
34
|
+
{ name: "Reader Summary", patterns: [/^##\s+Reader Summary\s*$/m, /^##\s+给用户看的总结\s*$/m] },
|
|
35
|
+
{ name: "Problem and Background", patterns: [/^##\s+Problem and Background\s*$/m, /^##\s+问题与背景\s*$/m] },
|
|
36
|
+
{ name: "Dataset Scene Notes", patterns: [/^##\s+Dataset Scene Notes\s*$/m, /^##\s+数据集场景说明\s*$/m] },
|
|
37
|
+
{ name: "Contribution Summary", patterns: [/^##\s+Contribution Summary\s*$/m, /^##\s+贡献总结\s*$/m] },
|
|
38
|
+
{ name: "Method Overview", patterns: [/^##\s+Method Overview\s*$/m, /^##\s+方法概述\s*$/m] },
|
|
39
|
+
{ name: "Selected Metrics", patterns: [/^##\s+Selected Metrics\s*$/m, /^##\s+选定指标\s*$/m] },
|
|
40
|
+
{ name: "Metric Guide", patterns: [/^##\s+Metric Guide\s*$/m, /^##\s+指标白话释义\s*$/m] },
|
|
41
|
+
{ name: "Background Sources", patterns: [/^##\s+Background Sources\s*$/m, /^##\s+背景来源\s*$/m] },
|
|
42
|
+
{
|
|
43
|
+
name: "Method and Baseline Sources",
|
|
44
|
+
patterns: [/^##\s+Method and Baseline Sources\s*$/m, /^##\s+方法与基线来源\s*$/m],
|
|
45
|
+
},
|
|
46
|
+
{ name: "Metric Sources", patterns: [/^##\s+Metric Sources\s*$/m, /^##\s+指标来源\s*$/m] },
|
|
47
|
+
];
|
|
48
|
+
const MAIN_TABLES_REQUIRED_SECTIONS = [
|
|
49
|
+
{ name: "Reader Summary", patterns: [/^##\s+Reader Summary\s*$/m, /^##\s+给用户看的总结\s*$/m] },
|
|
50
|
+
{ name: "Selected Metrics", patterns: [/^##\s+Selected Metrics\s*$/m, /^##\s+选定指标\s*$/m] },
|
|
51
|
+
{ name: "Metric Guide", patterns: [/^##\s+Metric Guide\s*$/m, /^##\s+指标白话释义\s*$/m] },
|
|
52
|
+
{
|
|
53
|
+
name: "Final Performance Summary",
|
|
54
|
+
patterns: [/^##\s+Final Performance Summary\s*$/m, /^##\s+最终表现摘要\s*$/m],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "How to Read These Tables",
|
|
58
|
+
patterns: [/^##\s+How to Read These Tables\s*$/m, /^##\s+怎么读这些表\s*$/m],
|
|
59
|
+
},
|
|
60
|
+
];
|
|
32
61
|
const REPORT_FIELDS = {
|
|
33
62
|
problem: ["Research problem in plain language", "研究问题白话解释", "研究问题"],
|
|
34
63
|
whyItMatters: ["Why this problem matters", "为什么这个问题重要"],
|
|
@@ -191,6 +220,36 @@ function collaboratorEvalIssues(targetDir) {
|
|
|
191
220
|
: [];
|
|
192
221
|
}
|
|
193
222
|
|
|
223
|
+
function missingRequiredSections(text, sections) {
|
|
224
|
+
if (!text) {
|
|
225
|
+
return sections.map((section) => section.name);
|
|
226
|
+
}
|
|
227
|
+
return sections
|
|
228
|
+
.filter((section) => !section.patterns.some((pattern) => pattern.test(text)))
|
|
229
|
+
.map((section) => section.name);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function collaboratorReportIssues(targetDir) {
|
|
233
|
+
if (!hasCollaboratorFacingDeliverables(targetDir)) {
|
|
234
|
+
return [];
|
|
235
|
+
}
|
|
236
|
+
const { reportPath, mainTablesPath } = getCollaboratorDeliverablePaths(targetDir);
|
|
237
|
+
const issues = [];
|
|
238
|
+
if (fs.existsSync(reportPath)) {
|
|
239
|
+
const missing = missingRequiredSections(readFileIfExists(reportPath), REPORT_REQUIRED_SECTIONS);
|
|
240
|
+
if (missing.length > 0) {
|
|
241
|
+
issues.push(`report.md is missing required collaborator-facing sections: ${missing.join(", ")}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (fs.existsSync(mainTablesPath)) {
|
|
245
|
+
const missing = missingRequiredSections(readFileIfExists(mainTablesPath), MAIN_TABLES_REQUIRED_SECTIONS);
|
|
246
|
+
if (missing.length > 0) {
|
|
247
|
+
issues.push(`main-tables.md is missing required collaborator-facing sections: ${missing.join(", ")}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return issues;
|
|
251
|
+
}
|
|
252
|
+
|
|
194
253
|
function extractReportValue(reportText, key) {
|
|
195
254
|
return extractValue(reportText, REPORT_FIELDS[key] || []);
|
|
196
255
|
}
|
|
@@ -611,7 +670,8 @@ function hydrateEvalProtocol(targetDir) {
|
|
|
611
670
|
function getCollaboratorReportStatus(targetDir) {
|
|
612
671
|
const missionIssues = collaboratorMissionIssues(targetDir);
|
|
613
672
|
const evalIssues = collaboratorEvalIssues(targetDir);
|
|
614
|
-
const
|
|
673
|
+
const reportIssues = collaboratorReportIssues(targetDir);
|
|
674
|
+
const issues = missionIssues.concat(evalIssues, reportIssues);
|
|
615
675
|
if (issues.length > 0) {
|
|
616
676
|
return {
|
|
617
677
|
mode: "artifact-anchored interim",
|
|
@@ -1318,6 +1378,7 @@ module.exports = {
|
|
|
1318
1378
|
archiveContext,
|
|
1319
1379
|
collaboratorEvalIssues,
|
|
1320
1380
|
collaboratorMissionIssues,
|
|
1381
|
+
collaboratorReportIssues,
|
|
1321
1382
|
getCollaboratorReportStatus,
|
|
1322
1383
|
hasCollaboratorFacingDeliverables,
|
|
1323
1384
|
hydrateCanonicalContext,
|
package/lib/i18n.cjs
CHANGED
|
@@ -338,6 +338,7 @@ const ZH_SKILL_FILES = {
|
|
|
338
338
|
- 在起草报告前,先检查 \`.lab/context/mission.md\` 和 \`.lab/context/eval-protocol.md\` 是否仍是模板空壳。
|
|
339
339
|
- 如果 canonical context 还是空壳,要先根据 frozen result artifacts、data-decisions、evidence-index 和已批准上下文回填“最小可信版本”,再写报告。
|
|
340
340
|
- 如果回填后仍缺少协作者可读所需的关键字段,就必须把输出降级成 \`artifact-anchored interim report\`,不能冒充最终协作者报告。
|
|
341
|
+
- 如果现有的 \`report.md\` 或 \`main-tables.md\` 缺少受管模板要求的协作者可读章节,也必须视为报告缺陷;rerun 需要补齐这些缺失块,不能直接宣称“正文无变化”或把这次 rerun 当成 no-op。
|
|
341
342
|
- 如果报告依赖了对原始指标或原始实现的偏差,必须明确写出这个偏差。
|
|
342
343
|
- workflow 工件状态、rerun id 或 LaTeX 骨架状态不能混进“已验证主结果”;这些内容必须单列到工件状态部分。
|
|
343
344
|
- 如果 workflow language 是中文,\`report.md\` 和 \`<deliverables_root>/main-tables.md\` 也应使用中文,除非文件路径、代码标识符或字面指标名必须保持原样。
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
- Before drafting the report, inspect `.lab/context/mission.md` and `.lab/context/eval-protocol.md` for skeletal template fields.
|
|
59
59
|
- If either canonical context file is still skeletal, hydrate the smallest trustworthy version from frozen result artifacts, dataset decisions, evidence-index, and prior approved context, and write that back before finalizing the report.
|
|
60
60
|
- If collaborator-critical fields still remain missing after hydration, downgrade the output to an `artifact-anchored interim report` instead of presenting it as a final collaborator-ready report.
|
|
61
|
+
- If the existing `report.md` or `main-tables.md` is missing required collaborator-facing sections from the managed templates, treat that as a report deficiency. A rerun must repair the missing sections instead of declaring "no content change" or treating the rerun as a no-op.
|
|
61
62
|
- Do not mix workflow deliverable status, rerun ids, or manuscript skeleton status into validated scientific findings; keep those in a separate artifact-status section.
|
|
62
63
|
- If `.lab/config/workflow.json` sets the workflow language to Chinese, write `report.md` and `<deliverables_root>/main-tables.md` in Chinese unless a file path, code identifier, or literal metric name must remain unchanged.
|
|
63
64
|
- Prefer conservative interpretation over marketing language.
|