@researai/deepscientist 1.5.14 → 1.5.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +8 -0
  2. package/assets/branding/logo-raster.png +0 -0
  3. package/bin/ds.js +134 -49
  4. package/docs/en/00_QUICK_START.md +2 -2
  5. package/docs/en/01_SETTINGS_REFERENCE.md +20 -4
  6. package/docs/en/03_QQ_CONNECTOR_GUIDE.md +19 -0
  7. package/docs/en/10_WEIXIN_CONNECTOR_GUIDE.md +20 -0
  8. package/docs/en/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +2 -0
  9. package/docs/en/16_TELEGRAM_CONNECTOR_GUIDE.md +134 -0
  10. package/docs/en/17_WHATSAPP_CONNECTOR_GUIDE.md +126 -0
  11. package/docs/en/18_FEISHU_CONNECTOR_GUIDE.md +136 -0
  12. package/docs/en/README.md +6 -0
  13. package/docs/zh/00_QUICK_START.md +2 -2
  14. package/docs/zh/01_SETTINGS_REFERENCE.md +20 -4
  15. package/docs/zh/03_QQ_CONNECTOR_GUIDE.md +19 -0
  16. package/docs/zh/10_WEIXIN_CONNECTOR_GUIDE.md +20 -0
  17. package/docs/zh/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +2 -0
  18. package/docs/zh/16_TELEGRAM_CONNECTOR_GUIDE.md +134 -0
  19. package/docs/zh/17_WHATSAPP_CONNECTOR_GUIDE.md +126 -0
  20. package/docs/zh/18_FEISHU_CONNECTOR_GUIDE.md +136 -0
  21. package/docs/zh/README.md +6 -0
  22. package/install.sh +2 -0
  23. package/package.json +1 -1
  24. package/pyproject.toml +1 -1
  25. package/src/deepscientist/__init__.py +1 -1
  26. package/src/deepscientist/artifact/charts.py +567 -0
  27. package/src/deepscientist/artifact/guidance.py +50 -10
  28. package/src/deepscientist/artifact/metrics.py +228 -5
  29. package/src/deepscientist/artifact/schemas.py +3 -0
  30. package/src/deepscientist/artifact/service.py +3534 -191
  31. package/src/deepscientist/bash_exec/models.py +23 -0
  32. package/src/deepscientist/bash_exec/monitor.py +147 -67
  33. package/src/deepscientist/bash_exec/runtime.py +218 -156
  34. package/src/deepscientist/bash_exec/service.py +79 -64
  35. package/src/deepscientist/bash_exec/shells.py +87 -0
  36. package/src/deepscientist/bridges/connectors.py +51 -2
  37. package/src/deepscientist/config/models.py +6 -3
  38. package/src/deepscientist/config/service.py +7 -2
  39. package/src/deepscientist/connector/weixin_support.py +122 -1
  40. package/src/deepscientist/daemon/api/handlers.py +75 -4
  41. package/src/deepscientist/daemon/api/router.py +1 -0
  42. package/src/deepscientist/daemon/app.py +758 -206
  43. package/src/deepscientist/doctor.py +51 -0
  44. package/src/deepscientist/file_lock.py +48 -0
  45. package/src/deepscientist/gitops/diff.py +167 -1
  46. package/src/deepscientist/mcp/server.py +173 -5
  47. package/src/deepscientist/process_control.py +161 -0
  48. package/src/deepscientist/prompts/builder.py +267 -442
  49. package/src/deepscientist/quest/service.py +2255 -163
  50. package/src/deepscientist/quest/stage_views.py +171 -0
  51. package/src/deepscientist/runners/base.py +2 -0
  52. package/src/deepscientist/runners/codex.py +88 -5
  53. package/src/deepscientist/runners/runtime_overrides.py +17 -1
  54. package/src/prompts/contracts/shared_interaction.md +13 -4
  55. package/src/prompts/system.md +916 -72
  56. package/src/skills/analysis-campaign/SKILL.md +31 -2
  57. package/src/skills/analysis-campaign/references/artifact-orchestration.md +1 -1
  58. package/src/skills/analysis-campaign/references/writing-facing-slice-examples.md +65 -0
  59. package/src/skills/baseline/SKILL.md +2 -0
  60. package/src/skills/decision/SKILL.md +19 -2
  61. package/src/skills/experiment/SKILL.md +8 -2
  62. package/src/skills/finalize/SKILL.md +18 -0
  63. package/src/skills/idea/SKILL.md +78 -0
  64. package/src/skills/idea/references/idea-generation-playbook.md +100 -0
  65. package/src/skills/idea/references/outline-seeding-example.md +60 -0
  66. package/src/skills/intake-audit/SKILL.md +1 -1
  67. package/src/skills/optimize/SKILL.md +1644 -0
  68. package/src/skills/rebuttal/SKILL.md +2 -1
  69. package/src/skills/review/SKILL.md +2 -1
  70. package/src/skills/write/SKILL.md +80 -12
  71. package/src/skills/write/references/outline-evidence-contract-example.md +107 -0
  72. package/src/tui/dist/app/AppContainer.js +3 -0
  73. package/src/tui/package.json +1 -1
  74. package/src/ui/dist/assets/{AiManusChatView-DaF9Nge_.js → AiManusChatView-DDjbFnbt.js} +12 -12
  75. package/src/ui/dist/assets/{AnalysisPlugin-BSVx6dXE.js → AnalysisPlugin-Yb5IdmaU.js} +1 -1
  76. package/src/ui/dist/assets/CliPlugin-e64sreyu.js +31037 -0
  77. package/src/ui/dist/assets/{CodeEditorPlugin-DU9G0Tox.js → CodeEditorPlugin-C4D2TIkU.js} +8 -8
  78. package/src/ui/dist/assets/{CodeViewerPlugin-DoX_fI9l.js → CodeViewerPlugin-BVoNZIvC.js} +5 -5
  79. package/src/ui/dist/assets/{DocViewerPlugin-C4FWIXuU.js → DocViewerPlugin-CLChbllo.js} +3 -3
  80. package/src/ui/dist/assets/{GitDiffViewerPlugin-BgfFMgtf.js → GitDiffViewerPlugin-C4xeFyFQ.js} +20 -20
  81. package/src/ui/dist/assets/{ImageViewerPlugin-tcPkfY_x.js → ImageViewerPlugin-OiMUAcLi.js} +5 -5
  82. package/src/ui/dist/assets/{LabCopilotPanel-_dKV60Bf.js → LabCopilotPanel-BjD2ThQF.js} +11 -11
  83. package/src/ui/dist/assets/{LabPlugin-Bje0ayoC.js → LabPlugin-DQPg-NrB.js} +2 -2
  84. package/src/ui/dist/assets/{LatexPlugin-CVsBzAln.js → LatexPlugin-CI05XAV9.js} +7 -7
  85. package/src/ui/dist/assets/{MarkdownViewerPlugin-xjmrqv_8.js → MarkdownViewerPlugin-DpeBLYZf.js} +4 -4
  86. package/src/ui/dist/assets/{MarketplacePlugin-mMM2A8wP.js → MarketplacePlugin-DolE58Q2.js} +3 -3
  87. package/src/ui/dist/assets/{NotebookEditor-3kVDSOBo.js → NotebookEditor-7Qm2rSWD.js} +11 -11
  88. package/src/ui/dist/assets/{NotebookEditor-SoJ8X-MO.js → NotebookEditor-C1kWaxKi.js} +1 -1
  89. package/src/ui/dist/assets/{PdfLoader-DElVuHl9.js → PdfLoader-BfOHw8Zw.js} +1 -1
  90. package/src/ui/dist/assets/{PdfMarkdownPlugin-Bq88XT4G.js → PdfMarkdownPlugin-BulDREv1.js} +2 -2
  91. package/src/ui/dist/assets/{PdfViewerPlugin-CsCXMo9S.js → PdfViewerPlugin-C-daaOaL.js} +10 -10
  92. package/src/ui/dist/assets/{SearchPlugin-oUPvy19k.js → SearchPlugin-CjpaiJ3A.js} +1 -1
  93. package/src/ui/dist/assets/{TextViewerPlugin-CRkT9yNy.js → TextViewerPlugin-BxIyqPQC.js} +5 -5
  94. package/src/ui/dist/assets/{VNCViewer-BgbuvWhR.js → VNCViewer-HAg9mF7M.js} +10 -10
  95. package/src/ui/dist/assets/{bot-v_RASACv.js → bot-0DYntytV.js} +1 -1
  96. package/src/ui/dist/assets/{code-5hC9d0VH.js → code-B20Slj_w.js} +1 -1
  97. package/src/ui/dist/assets/{file-content-D1PxfOrp.js → file-content-DT24KFma.js} +1 -1
  98. package/src/ui/dist/assets/{file-diff-panel-DG1oT_Hj.js → file-diff-panel-DK13YPql.js} +1 -1
  99. package/src/ui/dist/assets/{file-socket-BmdFYQlk.js → file-socket-B4T2o4nR.js} +1 -1
  100. package/src/ui/dist/assets/{image-Dqe2X2tW.js → image-DSeR_sDS.js} +1 -1
  101. package/src/ui/dist/assets/{index-RDlNXXx1.js → index-BrFje2Uk.js} +2 -2
  102. package/src/ui/dist/assets/{index-DVsMKK_y.js → index-BwRJaoTl.js} +1 -1
  103. package/src/ui/dist/assets/{index-Nt9hS4ck.js → index-D_E4281X.js} +5007 -28514
  104. package/src/ui/dist/assets/{index-Duvz8Ip0.js → index-DnYB3xb1.js} +12 -12
  105. package/src/ui/dist/assets/{index-BQG-1s2o.css → index-G7AcWcMu.css} +43 -2
  106. package/src/ui/dist/assets/{monaco-DIXge1CP.js → monaco-LExaAN3Y.js} +1 -1
  107. package/src/ui/dist/assets/{pdf-effect-queue-BBTTQaO-.js → pdf-effect-queue-BJk5okWJ.js} +1 -1
  108. package/src/ui/dist/assets/{popover-BWlolyxo.js → popover-D3Gg_FoV.js} +1 -1
  109. package/src/ui/dist/assets/{project-sync-BM5PkFH4.js → project-sync-C_ygLlVU.js} +1 -1
  110. package/src/ui/dist/assets/{select-D4dAtrA8.js → select-CpAK6uWm.js} +2 -2
  111. package/src/ui/dist/assets/{sigma-CKbE5jJT.js → sigma-DEccaSgk.js} +1 -1
  112. package/src/ui/dist/assets/{square-check-big-CZNGMgiB.js → square-check-big-uUfyVsbD.js} +1 -1
  113. package/src/ui/dist/assets/{trash-DaB37xAz.js → trash-CXvwwSe8.js} +1 -1
  114. package/src/ui/dist/assets/{useCliAccess-C2OmAcWe.js → useCliAccess-Bnop4mgR.js} +1 -1
  115. package/src/ui/dist/assets/{useFileDiffOverlay-Dowd1Ij4.js → useFileDiffOverlay-B8eUAX0I.js} +1 -1
  116. package/src/ui/dist/assets/{wrap-text-BGjAhAUq.js → wrap-text-9vbOBpkW.js} +1 -1
  117. package/src/ui/dist/assets/{zoom-out-dMZQMXzc.js → zoom-out-BgVMmOW4.js} +1 -1
  118. package/src/ui/dist/index.html +2 -2
  119. package/src/ui/dist/assets/CliPlugin-C9gzJX41.js +0 -5905
@@ -28,6 +28,7 @@ Do not invent a separate experiment system for those cases.
28
28
 
29
29
  - Follow the shared interaction contract injected by the system prompt.
30
30
  - For ordinary active work, prefer a concise progress update once work has crossed roughly 6 tool calls with a human-meaningful delta, and do not drift beyond roughly 12 tool calls or about 8 minutes without a user-visible update.
31
+ - Hard execution rule: every terminal command in this stage must go through `bash_exec`; do not use any other terminal path for slice execution, smoke tests, Git, Python, package-manager, or file-inspection commands.
31
32
  - Prefer `bash_exec` for campaign slice commands so each run has a durable session id, quest-local log folder, and later `read/list/kill` control.
32
33
  - Keep ordinary subtask completions concise. When an analysis campaign or a stage-significant campaign checkpoint is complete, upgrade to a richer `artifact.interact(kind='milestone', reply_mode='threaded', ...)` report.
33
34
  - That richer campaign milestone report should normally cover: which slices completed, the main takeaway, whether the claim got stronger or weaker, and the exact recommended next route.
@@ -70,6 +71,7 @@ It preserves the core old DeepScientist analysis-experimenter discipline:
70
71
  The campaign should behave like a disciplined evidence program, not an unstructured pile of extra runs.
71
72
 
72
73
  For campaign prioritization and writing-facing slice design, read `references/campaign-design.md`.
74
+ When the campaign is paper-facing and the mapping fields are not obvious, also read `references/writing-facing-slice-examples.md`.
73
75
 
74
76
  ## Quick workflow
75
77
 
@@ -93,6 +95,7 @@ Treat this as the compressed campaign map. The authoritative slice protocol and
93
95
  - When a selected outline exists, every slice should map to a named `research_question` and `experimental_design` from that outline.
94
96
  - When the campaign is supporting a paper or paper-like report, do not launch or reorder the slice set without first reading `paper/paper_experiment_matrix.md` when it exists.
95
97
  - For writing-facing campaigns, every slice should correspond to a stable matrix row such as `exp_id`, not just a free-form note.
98
+ - For writing-facing campaigns, every todo item must also carry `section_id`, `item_id`, `claim_links`, and `paper_role`; otherwise the slice is not paper-ready.
96
99
  - Do not aggregate campaign conclusions without per-run evidence.
97
100
  - Do not bury null or contradictory findings.
98
101
 
@@ -129,6 +132,22 @@ Treat quest files, attached user assets, checkpoints, configs, extracted texts,
129
132
  Do not design slices around hypothetical resources that the current system cannot actually access or run.
130
133
  If a slice cannot be executed with the current system, redesign it around available assets or explicitly report that the task cannot currently be completed.
131
134
  If infeasibility appears mid-run, attempt bounded recovery first; if still blocked, record the slice with a non-success status and explain why.
135
+ If ids, active refs, or current quest state are unclear after restart, call `artifact.get_quest_state(detail='summary')` and `artifact.resolve_runtime_refs(...)` before launching or recording slices.
136
+ If the exact quest brief / plan / status wording matters for campaign scope, call `artifact.read_quest_documents(...)`.
137
+ If earlier user instructions materially affect campaign scope or ordering, call `artifact.get_conversation_context(...)` before changing the slice set.
138
+
139
+ For concrete paper-facing cases:
140
+
141
+ - if the slice is the only thing keeping a main-text section unsupported, make it `main_required` / `main_text`
142
+ - if the slice is useful but non-blocking, make it `appendix`
143
+ - if the slice is informative but not meant for the manuscript, keep it durable and mark it `reference_only` with a reason
144
+ - after every completed paper-facing slice, verify the return path immediately:
145
+ - the matching outline `result_table` row is updated
146
+ - the section notes are updated when the outline folder exists
147
+ - `paper/evidence_ledger.json` reflects the new mapping
148
+ - the active paper line summary no longer treats that slice as missing
149
+
150
+ Do not leave a slice "completed" while the paper contract still looks stale.
132
151
 
133
152
  ## Required plan and checklist
134
153
 
@@ -235,6 +254,16 @@ If the campaign exists to support a paper or paper-like report:
235
254
  - `paper_placement`
236
255
  - `completion_condition`
237
256
 
257
+ For writing-facing campaigns, every slice should also carry paper-contract identity, not just free-form text:
258
+
259
+ - `section_id`
260
+ - `item_id`
261
+ - `claim_links`
262
+ - `paper_role`
263
+
264
+ Do not treat a completed analysis slice as paper-ready until those fields exist and the slice is mappable back into the selected outline or paper experiment matrix.
265
+ Use `references/writing-facing-slice-examples.md` when the correct field values are not obvious.
266
+
238
267
  This keeps the analysis campaign aligned with the paper plan instead of becoming a free-floating batch of slices.
239
268
 
240
269
  ### 1. Define the campaign charter
@@ -393,8 +422,8 @@ For slices that run longer than a quick smoke check:
393
422
  - if you only need wall-clock waiting between checks, use `bash_exec(command='sleep N', mode='await', timeout_seconds=N+buffer, ...)`
394
423
  - keep a real buffer on that sleep timeout; do not set `timeout_seconds` exactly equal to `N`
395
424
  - if you are waiting on an already running managed session, prefer `bash_exec(mode='await', id=..., timeout_seconds=...)` instead of starting a new sleep command
396
- - after the first meaningful signal and then at real checkpoints (e.g., completion, or roughly every ~30 minutes if still running), send `artifact.interact(kind='progress', ...)` so the user sees slice status, latest evidence, and the next check point
397
- - after each completed sleep / await monitoring cycle for an active slice, send another concise `artifact.interact(kind='progress', ...)` update rather than going silent
425
+ - after the first meaningful signal and then at real checkpoints (e.g., completion, blocker, recovery, or a materially changed evidence frontier), send `artifact.interact(kind='progress', ...)` so the user sees the newest real state
426
+ - after each completed sleep / await monitoring cycle for an active slice, inspect state first; only send another `artifact.interact(kind='progress', ...)` update if the user-visible state materially changed
398
427
  - include the estimated next reply time or next check time in those monitoring updates
399
428
  - stop them with `bash_exec(mode='kill', id=..., wait=true, timeout_seconds=...)` if the slice is invalid, wedged, or superseded; add `force=true` when immediate termination is required
400
429
  - when you control the slice code, prefer a throttled `tqdm` progress reporter and, when feasible, pair it with concise `__DS_PROGRESS__` lines carrying phase and ETA
@@ -23,7 +23,7 @@ Use this reference because the current runtime has no dedicated `campaign` artif
23
23
 
24
24
  ## Recommended per-slice fields
25
25
 
26
- Because `artifact.record(...)` accepts extra fields, include:
26
+ Because `artifact.record(payload={...})` accepts extra fields, include:
27
27
 
28
28
  - `campaign_id`
29
29
  - `slice_id`
@@ -0,0 +1,65 @@
1
+ # Writing-Facing Slice Examples
2
+
3
+ Use this reference when an analysis campaign is supporting a paper-like deliverable and each slice must bind to the paper contract.
4
+
5
+ ## Good writing-facing todo item
6
+
7
+ ```json
8
+ {
9
+ "exp_id": "EXP-ABL-001",
10
+ "todo_id": "todo-ablation-core",
11
+ "slice_id": "ablation-core",
12
+ "title": "Core component ablation",
13
+ "research_question": "RQ2",
14
+ "experimental_design": "Component ablation",
15
+ "tier": "main_required",
16
+ "paper_placement": "main_text",
17
+ "paper_role": "main_text",
18
+ "section_id": "analysis-mechanism",
19
+ "item_id": "AN-ABL-001",
20
+ "claim_links": ["C2"],
21
+ "completion_condition": "Show whether the central gain survives removal of the core component.",
22
+ "why_now": "The draft cannot support the mechanism claim without this slice.",
23
+ "success_criteria": "Produce a fair ablation under the accepted metric contract.",
24
+ "abandonment_criteria": "Stop only if the evaluation contract becomes invalid.",
25
+ "manuscript_targets": ["Results", "Mechanism analysis"]
26
+ }
27
+ ```
28
+
29
+ ## Bad writing-facing todo item
30
+
31
+ ```json
32
+ {
33
+ "slice_id": "ablation-core",
34
+ "title": "Try one ablation",
35
+ "research_question": "RQ2"
36
+ }
37
+ ```
38
+
39
+ Why it is bad:
40
+
41
+ - no `section_id`
42
+ - no `item_id`
43
+ - no `claim_links`
44
+ - no paper placement
45
+ - impossible to write back into the outline cleanly later
46
+
47
+ ## Case guide
48
+
49
+ - Main claim support:
50
+ use `paper_role=main_text` and make the item part of `required_items`
51
+ - Supporting but non-blocking evidence:
52
+ use `paper_role=appendix` and make the item part of `optional_items`
53
+ - Useful but paper-excluded result:
54
+ keep the slice durable, but mark it `reference_only` or exclude it with a written reason in the matrix
55
+
56
+ ## Completion rule
57
+
58
+ After `artifact.record_analysis_slice(...)`:
59
+
60
+ 1. the slice result must exist under the analysis worktree
61
+ 2. the mirror must exist under `experiments/analysis-results/`
62
+ 3. the evidence ledger must contain the corresponding `item_id`
63
+ 4. the selected outline section must show the updated row in `result_table`
64
+
65
+ If step 3 or 4 is missing, the slice is not paper-ready yet.
@@ -13,6 +13,7 @@ The target is one trustworthy baseline line, not an endless reproduction diary.
13
13
  - Follow the shared interaction contract injected by the system prompt.
14
14
  - Keep ordinary setup and debugging updates concise.
15
15
  - Use richer milestone updates only when the baseline becomes trusted, caveated, blocked, waived, or route-changing.
16
+ - Hard execution rule: every terminal command in this stage must go through `bash_exec`; do not use any other terminal path for setup, reproduction, monitoring, verification, Git, Python, package-manager, or file-inspection commands.
16
17
  - Prefer `bash_exec` for setup, reproduction, monitoring, and verification commands so the baseline line stays durable and auditable.
17
18
 
18
19
  ## Non-negotiable rules
@@ -463,6 +464,7 @@ Metric-contract rules:
463
464
  - when confirming a baseline, submit the canonical `metrics_summary` as a flat top-level dictionary keyed by the paper-facing metric ids
464
465
  - every canonical baseline metric entry should include `description`, either `derivation` or `origin_path`, and `source_ref`
465
466
  - if the paper reports both aggregate and per-dataset or per-task results, preserve both whenever feasible through `metrics_summary` plus structured rows rather than one cherry-picked scalar
467
+ - if the source package already has a richer leaderboard table, structured result file, or `json/metric_contract.json`, reuse that richer contract instead of hand-writing a thinner one that keeps only one averaged scalar
466
468
  - `Result/metric.md` is optional temporary scratch memory only; reconcile against it before calling `artifact.confirm_baseline(...)`, but do not treat it as a required durable file
467
469
 
468
470
  ## Publication and reuse
@@ -84,12 +84,14 @@ Choose the smallest action that genuinely resolves the current state.
84
84
 
85
85
  In the current runtime, prefer these concrete flow actions:
86
86
 
87
+ - record a candidate brief before branch promotion -> `artifact.submit_idea(mode='create', submission_mode='candidate', ...)`
87
88
  - accepted idea -> `artifact.submit_idea(mode='create', lineage_intent='continue_line'|'branch_alternative', ...)`
89
+ - promote a candidate brief into a durable optimization line -> `artifact.submit_idea(mode='create', submission_mode='line', source_candidate_id=..., lineage_intent='continue_line'|'branch_alternative', ...)`
88
90
  - maintenance-only in-place cleanup of the same branch -> `artifact.submit_idea(mode='revise', ...)`
89
91
  - compare branch foundations before a new round -> `artifact.list_research_branches(...)`
90
92
  - return to an older durable branch without creating a new node -> `artifact.activate_branch(...)`
91
93
  - materialize the concrete main-result node when a real main experiment line is about to be or was just durably recorded -> dedicated child `run/*` branch/worktree
92
- - start the next optimization round from a measured result -> `artifact.record(kind='decision', action='iterate', ...)`
94
+ - start the next optimization round from a measured result -> `artifact.record(payload={'kind': 'decision', 'action': 'iterate', ...})`
93
95
  - launch analysis campaign -> `artifact.create_analysis_campaign(...)`
94
96
  - finish one analysis slice -> `artifact.record_analysis_slice(...)`
95
97
  - select a paper outline -> `artifact.submit_paper_outline(mode='select', ...)`
@@ -104,6 +106,7 @@ If the chosen action is baseline reuse, the decision is not complete until one o
104
106
  Treat `prepare_branch` as a compatibility or recovery action, not the normal path.
105
107
  Treat `activate_branch` as the correct recovery or revisit action when the quest should resume on an existing older durable branch while preserving the newer research head.
106
108
  Treat each accepted branch as one durable research round.
109
+ Treat candidate briefs as branchless pre-promotion objects; they are not yet durable optimization lines.
107
110
  If a branch already has a durable main-experiment result, a genuinely new optimization round should normally create a child branch from a chosen foundation rather than keep revising that old branch in place.
108
111
  Treat each durable main experiment as its own child `run/*` branch/node, not as another mutable state on the idea branch.
109
112
  When paper mode is enabled and the necessary analysis for a strong run is done, the next default route is `write` on a dedicated `paper/*` branch/worktree derived from that run branch.
@@ -121,6 +124,12 @@ Make decisions from durable evidence:
121
124
 
122
125
  Do not make major decisions from vibe or momentum.
123
126
 
127
+ When the quest is algorithm-first, add one extra truth-source rule before non-trivial route choices:
128
+
129
+ - read `artifact.get_optimization_frontier(...)`
130
+ - treat the frontier as the primary optimize-state summary
131
+ - only override it when newer durable evidence clearly dominates
132
+
124
133
  ## Workflow
125
134
 
126
135
  ### 1. State the question
@@ -249,6 +258,14 @@ When recording the decision, make explicit:
249
258
  - which existing evidence was decisive
250
259
  - what residual risk remains after the choice
251
260
 
261
+ For algorithm-first route choices, prefer this default mapping:
262
+
263
+ - frontier says `explore` -> widen or refine candidate briefs before new branch creation
264
+ - frontier says `exploit` -> keep the strongest line active and advance the best implementation candidates
265
+ - frontier says `fusion` -> open at most one bounded fusion candidate
266
+ - a fixable candidate failure dominates -> run a debug route instead of widening search blindly
267
+ - frontier says `stop` -> record the stop decision and explicit reopen condition
268
+
252
269
  Good route-selection criteria often include:
253
270
 
254
271
  - feasibility
@@ -326,7 +343,7 @@ When asking, use a structured decision request with:
326
343
 
327
344
  ### 6. Record the decision durably
328
345
 
329
- Use `artifact.record(kind='decision', ...)` for the final decision.
346
+ Use `artifact.record(payload={'kind': 'decision', ...})` for the final decision.
330
347
 
331
348
  If user input is needed, also use `artifact.interact(kind='decision_request', ...)`.
332
349
  If the timeout expires without a user reply, choose the best option yourself, record why, and notify the user of the chosen option before moving on.
@@ -39,7 +39,9 @@ Use this skill for the main evidence-producing runs of the quest.
39
39
  - If the runtime starts an auto-continue turn with no new user message, continue from the current run state, logs, artifacts, and active requirements instead of replaying the previous user turn.
40
40
  - Progress message templates are references only. Adapt to the actual context and vary wording so messages feel human, respectful, and non-robotic.
41
41
  - If a threaded user reply arrives, interpret it relative to the latest experiment progress update before assuming the task changed completely.
42
+ - Hard execution rule: every terminal command in this stage must go through `bash_exec`; do not use any other terminal path for smoke tests, real runs, Git, Python, package-manager, or file-inspection commands.
42
43
  - Prefer `bash_exec` for experiment commands so each run gets a durable session id, quest-local log folder, and later `read/list/kill` control.
44
+ - For meaningful long-running runs, include the estimated next reply time or next check-in window whenever it is defensible.
43
45
 
44
46
  ## Stage purpose
45
47
 
@@ -64,6 +66,9 @@ Use `references/evidence-ladder.md` when deciding whether the current package is
64
66
  Completing one main run is not quest completion.
65
67
  After reporting the run, keep moving to iterate, analyze, write, or finalize unless a genuine blocking decision remains.
66
68
 
69
+ When the quest is algorithm-first, treat `experiment` as the execution surface of `optimize`, not as the terminal goal of the workflow.
70
+ After a measured result, the default next move is frontier review and optimize-side route selection rather than paper packaging.
71
+
67
72
  ## Quick workflow
68
73
 
69
74
  Treat this as the short run-order summary. The detailed run contract, execution rules, and recording rules remain in `Workflow`.
@@ -90,6 +95,7 @@ Treat this as the short run-order summary. The detailed run contract, execution
90
95
  - After each `artifact.record_main_experiment(...)`, route from the measured result:
91
96
  - if paper mode is enabled, decide whether to strengthen evidence, analyze, or write
92
97
  - if paper mode is disabled, prefer iterate / revise-idea / branch over default writing
98
+ - In algorithm-first work, after each main run, return to `optimize` or `decision` for frontier review before launching another large run.
93
99
 
94
100
  ## Experiment mental guardrails
95
101
 
@@ -429,8 +435,8 @@ For commands that may run longer than a few minutes:
429
435
  - if you only need wall-clock waiting between checks, use `bash_exec(command='sleep N', mode='await', timeout_seconds=N+buffer, ...)`
430
436
  - keep a real buffer on that sleep timeout; do not set `timeout_seconds` exactly equal to `N`
431
437
  - if you are waiting on an already running managed session, prefer `bash_exec(mode='await', id=..., timeout_seconds=...)` instead of starting a new sleep command
432
- - after every completed sleep / await cycle, inspect logs and send `artifact.interact(kind='progress', ...)` with the latest real status, latest evidence, the next checkpoint, and the estimated next reply time
433
- - after the first meaningful signal and then at real checkpoints (e.g., completion, or roughly every ~30 minutes if still running), keep those progress updates going rather than waiting silently
438
+ - after every completed sleep / await cycle, inspect logs first; only send `artifact.interact(kind='progress', ...)` when the user-visible state, frontier, blocker status, or ETA materially changed
439
+ - after the first meaningful signal and then at real checkpoints (e.g., completion, recovery, blocker, or a materially widened comparable surface), keep those progress updates going rather than waiting silently
434
440
  - if the run is clearly invalid, wedged, or superseded, stop it with `bash_exec(mode='kill', id=..., wait=true, timeout_seconds=...)`; if it must die immediately, add `force=true`, record the reason, fix the issue, and relaunch cleanly
435
441
  - do not report completion until logs and output files both confirm completion
436
442
 
@@ -11,10 +11,13 @@ Use this skill to close or pause a quest responsibly.
11
11
 
12
12
  - Follow the shared interaction contract injected by the system prompt.
13
13
  - For ordinary active work, prefer a concise progress update once work has crossed roughly 6 tool calls with a human-meaningful delta, and do not drift beyond roughly 12 tool calls or about 8 minutes without a user-visible update.
14
+ - Do not emit another finalize progress update when the user-visible state is unchanged.
14
15
  - If the runtime starts an auto-continue turn with no new user message, keep finalizing from the durable quest state and active requirements instead of replaying the previous user turn.
15
16
  - If a threaded user reply arrives, interpret it relative to the latest finalize progress update before assuming the task changed completely.
16
17
  - When finalize reaches a real closure state, pause-ready packet, or route-back decision, send one threaded `artifact.interact(kind='milestone', ...)` update that names the recommendation, why it is the right call, and any reopen condition that still matters.
17
18
  - True quest completion still requires explicit user approval through the runtime completion flow before calling `artifact.complete_quest(...)`.
19
+ - Rechecking that the same bundle files still exist, or re-aligning status surfaces without changing the closure judgment, does not by itself count as a fresh milestone.
20
+ - Hard execution rule: if this stage needs terminal work such as Git inspection, packaging checks, document builds, or file inspection, every such command must go through `bash_exec`.
18
21
 
19
22
  ## Stage purpose
20
23
 
@@ -54,8 +57,19 @@ Before finalizing, gather:
54
57
  - latest quest documents
55
58
  - latest review / proofing / submission state when a paper bundle exists
56
59
  - the paper bundle manifest and its referenced paths when the quest has a paper-like deliverable
60
+ - the paper evidence ledger and selected-outline section statuses when the quest has a paper-like deliverable
57
61
 
58
62
  If finalization reveals that the quest is still too uncertain, route back through `decision` rather than forcing closure.
63
+ For paper-like deliverables, do not finalize while any of these remain true:
64
+
65
+ - required main-text outline items are still unresolved
66
+ - completed analysis remains unmapped into the paper contract
67
+ - the active paper line still reports open supplementary work that is expected to block the manuscript
68
+
69
+ If the current paper-state blocker is not obvious from the existing files, call `artifact.get_paper_contract_health(detail='full')` before deciding whether finalize is legitimate.
70
+ If the active quest/runtime state is unclear after restart or long pause, call `artifact.get_quest_state(detail='summary')` first.
71
+ If the exact latest `SUMMARY.md`, `status.md`, or active user requirement wording matters for closure, call `artifact.read_quest_documents(...)`.
72
+ If earlier user/assistant continuity matters for whether the quest should really stop, call `artifact.get_conversation_context(...)` instead of guessing from prompt context alone.
59
73
 
60
74
  ## Truth sources
61
75
 
@@ -90,6 +104,7 @@ The finalize stage should usually leave behind:
90
104
  If the quest produced a paper-style bundle, finalization should also check that the writing stage left behind enough closure evidence, such as:
91
105
 
92
106
  - selected outline and outline selection records
107
+ - evidence ledger records and section-level result tables
93
108
  - review output
94
109
  - proofing output
95
110
  - submission or packaging checklist
@@ -113,12 +128,14 @@ Say clearly what exists and why it matters. Name concrete paths or artifact ids
113
128
  When a paper bundle exists, verify the manifest inventory explicitly, including:
114
129
 
115
130
  - `paper/paper_bundle_manifest.json`
131
+ - `paper/evidence_ledger.json`
116
132
  - the recorded `paper_branch` and source evidence branch / run fields in that manifest
117
133
  - referenced `outline_path`
118
134
  - referenced `draft_path`
119
135
  - referenced `writing_plan_path`
120
136
  - referenced `references_path`
121
137
  - referenced `claim_evidence_map_path`
138
+ - referenced `evidence_ledger_path`
122
139
  - referenced `baseline_inventory_path`
123
140
  - referenced `compile_report_path`
124
141
  - referenced `pdf_path`
@@ -243,6 +260,7 @@ Weak finalization:
243
260
  - leaves no clear recommendation
244
261
  - claims “done” without showing what is actually done
245
262
  - drops the package or file inventory needed for resumption
263
+ - ignores unmapped completed analysis that never entered the paper contract
246
264
 
247
265
  ## Memory rules
248
266
 
@@ -7,6 +7,10 @@ description: Use when a quest needs concrete hypotheses, limitation analysis, ca
7
7
 
8
8
  Use this skill to turn the current baseline and problem frame into concrete, literature-grounded, testable directions.
9
9
 
10
+ When `startup_contract.need_research_paper = false` and the quest already has a concrete optimization handle, `idea` may stop after selecting or seeding a direction and then hand off into `optimize` instead of insisting on the full paper-oriented ideation loop.
11
+ In that algorithm-first case, `idea` should usually produce a small method-brief frontier and then defer candidate ranking, promotion, and bounded search to `optimize`.
12
+ When doing that handoff, prefer the brief-shaping discipline later used by `optimize`: clarify the bottleneck and constraints, keep only a small differentiated `2-3` option slate, and hand off a recommended brief rather than a pile of loose intuitions.
13
+
10
14
  ## Interaction discipline
11
15
 
12
16
  - Follow the shared interaction contract injected by the system prompt.
@@ -39,6 +43,15 @@ The output must survive three checks at once:
39
43
  - feasibility in the current repo and resource budget
40
44
  - manuscript defensibility if the line later becomes a paper claim
41
45
 
46
+ When the route already looks likely to become a paper-facing line, seed one lightweight structured outline candidate during idea work.
47
+ Use `artifact.submit_paper_outline(mode='candidate', ...)` for that seed instead of leaving the future paper structure only in prose.
48
+ Use `references/outline-seeding-example.md` for the minimum acceptable shape.
49
+ The idea-stage outline candidate is not the full paper line yet, but it should already name the likely `research_questions`, `experimental_designs`, and the first section-level evidence needs that later supplementary slices must satisfy.
50
+ Keep that seed minimal and executable: a small section skeleton plus expected evidence items is better than a long narrative outline with no concrete evidence hooks.
51
+ If the current research head, strongest measured branch, or active runtime refs are unclear after resume, call `artifact.get_quest_state(detail='summary')` and `artifact.list_research_branches(...)` before choosing a foundation.
52
+ If the current brief / plan / status wording matters for direction choice, call `artifact.read_quest_documents(...)`.
53
+ If earlier user conversation materially changes the direction-selection target, call `artifact.get_conversation_context(...)` before locking the next idea.
54
+
42
55
  Finishing one idea deliverable is not quest completion.
43
56
  After reporting a completed idea package, continue into the next justified stage unless a real blocking decision is still unresolved.
44
57
 
@@ -106,6 +119,11 @@ Break ties primarily through careful reasoning over:
106
119
  - Do not write, promote, or submit a final idea until the durable survey covers at least `5` and usually `5-10` task-modeling-related, mechanism-relevant, or otherwise directly usable papers.
107
120
  - Treat that literature floor as a hard gate, not a suggestion.
108
121
  If the direct task-modeling neighborhood truly contains fewer than `5` usable papers, record that evidence explicitly and fill the remaining slots with the closest adjacent papers whose mechanism can be translated into the current task and codebase.
122
+ - Algorithm-first exception:
123
+ - when `startup_contract.need_research_paper = false` and a concrete optimization handle already exists, you may stop after a memory sweep plus a small targeted paper check instead of satisfying the full `5-10` paper floor
124
+ - use that exception only when the immediate goal is method-brief selection for `optimize`, not paper-level novelty claims
125
+ - if you use the exception, say explicitly that the output is an optimization brief frontier rather than a paper-ready idea package
126
+ - still shape that frontier deliberately: clarify the bottleneck and comparability boundary first, keep a differentiated `2-3` candidate slate, and explain why one brief is recommended now
109
127
  - Every fresh idea build or idea-refinement pass must begin with:
110
128
  - a memory sweep, and
111
129
  - an external literature sweep.
@@ -133,12 +151,19 @@ Break ties primarily through careful reasoning over:
133
151
  - Unless strong durable evidence already narrows the route to one obvious serious option, run one bounded divergent pass that produces a small but meaningfully varied slate, usually `6-12` raw ideas before collapsing to a serious frontier that is usually `2-3` and at most `5`.
134
152
  - If all surviving candidates belong to the same mechanism family, widen once with at least two new ideation lenses before converging.
135
153
  - Keep structurally coherent rejected ideas in a parking-lot or rejected-candidate section so they can be recombined later if needed.
154
+ - In algorithm-first work, `idea` should usually produce direction families, not a large within-family variant swarm.
155
+ - Treat within-family micro-variants as `optimize` brief work unless the mechanism family itself is still unresolved.
136
156
  - Every serious candidate must answer `why now?` or `what changed?`, not just `what is the mechanism?`
137
157
  - Every selected idea must survive a two-sentence pitch and strongest-objection check before promotion.
138
158
  - Do not promote a direction unless you can explain:
139
159
  - what limitation it targets
140
160
  - why prior methods do not already solve it
141
161
  - what evidence would later be needed to defend the claim
162
+ - When the likely next route is a paper-facing main experiment plus analysis package, do not stop at prose-only idea notes; seed the likely `research_questions`, `experimental_designs`, and per-section evidence needs in the outline candidate.
163
+ - If the likely route already has a clear paper-facing structure, seed the future paper line early:
164
+ - identify the likely main-text sections
165
+ - identify which sections will need supplementary evidence rather than only the main run
166
+ - identify the concrete evidence items that must later be maintained in the paper line's outline folder or compiled outline contract
142
167
  - If the idea is not novel but still worth doing, state that honestly as:
143
168
  - replication value
144
169
  - transfer-to-new-setting value
@@ -182,6 +207,51 @@ In practice:
182
207
 
183
208
  Do not skip the `scout` pass just because the quest is already in the `idea` stage.
184
209
 
210
+ ## Direction-shaping protocol
211
+
212
+ Use `references/idea-thinking-flow.md` when the main need is better reasoning hygiene.
213
+ Use `references/idea-generation-playbook.md` when the main need is to create a new idea slate and select one clear next research object.
214
+
215
+ Default creation flow for a fresh idea pass:
216
+
217
+ 1. frame one concrete limitation
218
+ 2. separate symptom / mechanism hypothesis / consequence
219
+ 3. keep one main hypothesis plus `2-3` competing hypotheses
220
+ 4. name the primary lever bucket
221
+ 5. generate a bounded candidate slate from that framing
222
+ 6. record selected / deferred / rejected outcomes explicitly
223
+
224
+ Set the frontier width with a validation-cost estimate before widening:
225
+
226
+ - `fast-check`: the first objective validation loop is likely under about `20` minutes
227
+ - `slow-check`: the first objective validation loop is likely over about `20` minutes or otherwise expensive in compute, queue time, or human delay
228
+
229
+ For `fast-check` idea work:
230
+
231
+ - allow a slightly wider serious slate when the candidates are meaningfully different
232
+ - prefer candidates with cheap, orthogonal falsification paths
233
+ - keep more alternatives alive into `optimize` because validation is cheaper than overthinking
234
+
235
+ For `slow-check` idea work:
236
+
237
+ - keep the serious slate tighter, usually `1-3`
238
+ - demand a clearer bottleneck story and stronger evidence before adding another family
239
+ - prefer the route with the best expected evidence-per-run, not the route with the most speculative upside
240
+ - do not hand off a broad speculative slate just because it sounds interesting
241
+
242
+ Do not start by shopping for modules to add.
243
+ Do not let one attractive mechanism become the de facto framing before the limitation is pinned down.
244
+ Do not let direction-family ideation collapse into within-family variant generation too early.
245
+
246
+ In normal idea work, stop at the direction-family level:
247
+
248
+ - select which mechanism families deserve serious consideration
249
+ - identify the strongest one to carry forward
250
+ - hand off within-family brief shaping to `optimize` when the quest is algorithm-first
251
+
252
+ If the task still requires choosing among mechanism families, stay in `idea`.
253
+ If the family is already chosen and the next need is branchless method-brief shaping, hand off to `optimize`.
254
+
185
255
  ## Truth sources
186
256
 
187
257
  Use:
@@ -1118,6 +1188,14 @@ When writing paper memory cards, include enough metadata to avoid redundant sear
1118
1188
 
1119
1189
  At the end of ideation, at least one part of the literature survey must be preserved in memory so a later idea pass can retrieve it directly instead of rebuilding the search from scratch.
1120
1190
 
1191
+ Every serious idea pass should also leave a durable outcome split:
1192
+
1193
+ - one selected idea or selected direction family
1194
+ - any deferred but still plausible alternatives
1195
+ - any rejected alternatives with a one-line rejection reason
1196
+
1197
+ Do not leave the rejected and deferred reasoning only in chat.
1198
+
1121
1199
  Promote to global memory only when the lesson is reusable outside this quest.
1122
1200
 
1123
1201
  ## Artifact rules
@@ -0,0 +1,100 @@
1
+ # Idea Generation Playbook
2
+
3
+ Use this reference when the `idea` stage needs a concrete creation flow for producing a new idea slate.
4
+
5
+ The goal is not a bag of clever mechanisms.
6
+ The goal is one clear next research object plus a durable record of what was deferred or rejected.
7
+
8
+ ## 1. Start from one limitation card
9
+
10
+ Write one limitation card before generating ideas:
11
+
12
+ - observed symptom
13
+ - condition where it appears
14
+ - why it matters for the target metric or claim
15
+ - strongest evidence that this is a real pattern
16
+
17
+ If the limitation card is weak, do not widen into ideation yet.
18
+
19
+ ## 2. Split the problem into three layers
20
+
21
+ For the active limitation, separate:
22
+
23
+ - symptom
24
+ - mechanism hypothesis
25
+ - consequence
26
+
27
+ Do not skip this split.
28
+ It prevents solution-shopping from becoming the hidden driver.
29
+
30
+ ## 3. Keep competing hypotheses alive
31
+
32
+ Before selecting mechanisms, record:
33
+
34
+ - one main hypothesis
35
+ - `2-3` competing hypotheses
36
+
37
+ If there is only one hypothesis, the idea pass is usually too collapsed.
38
+
39
+ ## 4. Name the lever bucket
40
+
41
+ Choose the primary lever bucket explicitly:
42
+
43
+ - data
44
+ - model
45
+ - objective
46
+ - optimization or training dynamics
47
+ - inference
48
+ - evaluation protocol
49
+ - infrastructure
50
+
51
+ If the lever bucket is unclear, the idea is usually still too fuzzy.
52
+
53
+ ## 5. Generate direction families, not micro-variants
54
+
55
+ Create a bounded slate of direction families.
56
+ Default target:
57
+
58
+ - `6-12` raw ideas in one bounded divergent pass
59
+ - collapse to `2-3` serious candidates and at most `5`
60
+
61
+ Prefer family-level differences over small parameter or implementation variations.
62
+ If several candidates are really the same family with minor tweaks, merge them.
63
+
64
+ For each serious candidate, record:
65
+
66
+ - limitation targeted
67
+ - mechanism family
68
+ - why now
69
+ - strongest prior-work overlap
70
+ - expected evidence burden
71
+ - likely falsification path
72
+
73
+ ## 6. Select one and ledger the rest
74
+
75
+ At the end of the pass, produce three durable buckets:
76
+
77
+ - selected
78
+ - deferred
79
+ - rejected
80
+
81
+ For deferred ideas, write why they remain plausible but are not first.
82
+ For rejected ideas, write one-line rejection reasons such as:
83
+
84
+ - redundant with closer prior work
85
+ - too confounded to test cleanly
86
+ - weak value if positive
87
+ - too broad for current compute or codebase
88
+ - lower priority than the selected route
89
+
90
+ ## 7. Exit criterion
91
+
92
+ The pass is complete only when the output contains:
93
+
94
+ - one selected idea or selected direction family
95
+ - one falsifiable claim
96
+ - one minimal experiment concept
97
+ - one abandonment condition
98
+ - deferred and rejected rationale recorded durably
99
+
100
+ If the result is still a bag of possibilities, stay in `idea`.
@@ -0,0 +1,60 @@
1
+ # Outline Seeding Example
2
+
3
+ Use this reference when the idea stage is strong enough that the next serious step will likely become a paper-facing line.
4
+
5
+ ## Goal
6
+
7
+ Before analysis begins, seed one lightweight but structured outline candidate so later experiments are not free-floating.
8
+
9
+ ## Minimal seed
10
+
11
+ ```json
12
+ {
13
+ "title": "Evidence-First Outline Seed",
14
+ "research_questions": [
15
+ "RQ1: Does the method outperform the accepted baseline?",
16
+ "RQ2: Which component is responsible for the gain?",
17
+ "RQ3: What boundary or failure regime matters most?"
18
+ ],
19
+ "experimental_designs": [
20
+ "Main benchmark comparison",
21
+ "Component ablation",
22
+ "Boundary analysis"
23
+ ],
24
+ "sections": [
25
+ {
26
+ "section_id": "results-main",
27
+ "title": "Main Results",
28
+ "paper_role": "main_text",
29
+ "claims": ["C1"],
30
+ "required_items": ["run-main-001"]
31
+ },
32
+ {
33
+ "section_id": "analysis-mechanism",
34
+ "title": "Mechanism Analysis",
35
+ "paper_role": "main_text",
36
+ "claims": ["C2"],
37
+ "required_items": ["AN-ABL-001"]
38
+ },
39
+ {
40
+ "section_id": "analysis-boundary",
41
+ "title": "Boundary Analysis",
42
+ "paper_role": "appendix",
43
+ "claims": ["C3"],
44
+ "optional_items": ["AN-BND-001"]
45
+ }
46
+ ]
47
+ }
48
+ ```
49
+
50
+ ## When to seed the outline
51
+
52
+ - The idea already survived literature and feasibility checks.
53
+ - The likely paper contribution is clear enough to name `1-3` research questions.
54
+ - You can already anticipate the first main experiment and at least one likely follow-up analysis family.
55
+
56
+ ## When not to seed the outline yet
57
+
58
+ - The task framing is still unstable.
59
+ - The idea frontier is still too wide.
60
+ - You still cannot say what the main claim would be if the route worked.
@@ -193,7 +193,7 @@ If the evidence is insufficient for a durable backfill, record that insufficienc
193
193
 
194
194
  ### 5. Choose the next anchor
195
195
 
196
- After reconciliation, write one durable route decision with `artifact.record(kind='decision', ...)`.
196
+ After reconciliation, write one durable route decision with `artifact.record(payload={'kind': 'decision', ...})`.
197
197
 
198
198
  Typical next anchors:
199
199