@researai/deepscientist 1.5.16 → 1.6.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 (896) hide show
  1. package/AGENTS.md +309 -130
  2. package/AISB/catalog/aisb.b1.agentic_coding.yaml +244 -0
  3. package/AISB/catalog/aisb.b10.climate_earth.yaml +235 -0
  4. package/AISB/catalog/aisb.b11.model_efficiency.yaml +231 -0
  5. package/AISB/catalog/aisb.b12.embodied_ai.yaml +238 -0
  6. package/AISB/catalog/aisb.b2.agent_systems.yaml +229 -0
  7. package/AISB/catalog/aisb.b3.self_evolving_rl.yaml +237 -0
  8. package/AISB/catalog/aisb.b4.lm_reasoning.yaml +240 -0
  9. package/AISB/catalog/aisb.b5.math_proof.yaml +235 -0
  10. package/AISB/catalog/aisb.b6.research_process.yaml +243 -0
  11. package/AISB/catalog/aisb.b7.multimodal_fusion.yaml +232 -0
  12. package/AISB/catalog/aisb.b8.lifesci_drug.yaml +275 -0
  13. package/AISB/catalog/aisb.b9.material_science.yaml +237 -0
  14. package/AISB/catalog/aisb.t3.001_savvy.yaml +159 -0
  15. package/AISB/catalog/aisb.t3.001_savvy.zh.yaml +121 -0
  16. package/AISB/catalog/aisb.t3.002_pinet.yaml +189 -0
  17. package/AISB/catalog/aisb.t3.002_pinet.zh.yaml +130 -0
  18. package/AISB/catalog/aisb.t3.004_decentralattn.yaml +184 -0
  19. package/AISB/catalog/aisb.t3.004_decentralattn.zh.yaml +153 -0
  20. package/AISB/catalog/aisb.t3.005_tsae.yaml +193 -0
  21. package/AISB/catalog/aisb.t3.005_tsae.zh.yaml +139 -0
  22. package/AISB/catalog/aisb.t3.006_physense.yaml +194 -0
  23. package/AISB/catalog/aisb.t3.006_physense.zh.yaml +118 -0
  24. package/AISB/catalog/aisb.t3.007_reasoningiqa.yaml +169 -0
  25. package/AISB/catalog/aisb.t3.007_reasoningiqa.zh.yaml +133 -0
  26. package/AISB/catalog/aisb.t3.008_meanflows.yaml +188 -0
  27. package/AISB/catalog/aisb.t3.008_meanflows.zh.yaml +140 -0
  28. package/AISB/catalog/aisb.t3.009_scoremissing.yaml +179 -0
  29. package/AISB/catalog/aisb.t3.009_scoremissing.zh.yaml +119 -0
  30. package/AISB/catalog/aisb.t3.010_suitabilityfilter.yaml +221 -0
  31. package/AISB/catalog/aisb.t3.010_suitabilityfilter.zh.yaml +141 -0
  32. package/AISB/catalog/aisb.t3.011_osd.yaml +206 -0
  33. package/AISB/catalog/aisb.t3.011_osd.zh.yaml +163 -0
  34. package/AISB/catalog/aisb.t3.012_efficientqat.yaml +206 -0
  35. package/AISB/catalog/aisb.t3.012_efficientqat.zh.yaml +159 -0
  36. package/AISB/catalog/aisb.t3.013_appl.yaml +152 -0
  37. package/AISB/catalog/aisb.t3.013_appl.zh.yaml +126 -0
  38. package/AISB/catalog/aisb.t3.014_piguard.yaml +207 -0
  39. package/AISB/catalog/aisb.t3.014_piguard.zh.yaml +164 -0
  40. package/AISB/catalog/aisb.t3.015_frspec.yaml +209 -0
  41. package/AISB/catalog/aisb.t3.015_frspec.zh.yaml +163 -0
  42. package/AISB/catalog/aisb.t3.016_mathfusion.yaml +166 -0
  43. package/AISB/catalog/aisb.t3.016_mathfusion.zh.yaml +145 -0
  44. package/AISB/catalog/aisb.t3.017_multimodalglp.yaml +171 -0
  45. package/AISB/catalog/aisb.t3.017_multimodalglp.zh.yaml +122 -0
  46. package/AISB/catalog/aisb.t3.018_cotsynth.yaml +206 -0
  47. package/AISB/catalog/aisb.t3.018_cotsynth.zh.yaml +162 -0
  48. package/AISB/catalog/aisb.t3.019_dyscaleut.yaml +211 -0
  49. package/AISB/catalog/aisb.t3.019_dyscaleut.zh.yaml +148 -0
  50. package/AISB/catalog/aisb.t3.020_aristotle.yaml +173 -0
  51. package/AISB/catalog/aisb.t3.020_aristotle.zh.yaml +119 -0
  52. package/AISB/catalog/aisb.t3.021_tokenrecycling.yaml +160 -0
  53. package/AISB/catalog/aisb.t3.021_tokenrecycling.zh.yaml +129 -0
  54. package/AISB/catalog/aisb.t3.022_chainofreasoning.yaml +204 -0
  55. package/AISB/catalog/aisb.t3.022_chainofreasoning.zh.yaml +161 -0
  56. package/AISB/catalog/aisb.t3.023_guidedembed.yaml +211 -0
  57. package/AISB/catalog/aisb.t3.023_guidedembed.zh.yaml +189 -0
  58. package/AISB/catalog/aisb.t3.024_outputcentric.yaml +148 -0
  59. package/AISB/catalog/aisb.t3.024_outputcentric.zh.yaml +131 -0
  60. package/AISB/catalog/aisb.t3.025_deeper.yaml +143 -0
  61. package/AISB/catalog/aisb.t3.025_deeper.zh.yaml +116 -0
  62. package/AISB/catalog/aisb.t3.026_gartkg.yaml +195 -0
  63. package/AISB/catalog/aisb.t3.026_gartkg.zh.yaml +127 -0
  64. package/AISB/catalog/aisb.t3.027_citeeval.yaml +182 -0
  65. package/AISB/catalog/aisb.t3.027_citeeval.zh.yaml +135 -0
  66. package/AISB/catalog/aisb.t3.028_sbam.yaml +206 -0
  67. package/AISB/catalog/aisb.t3.028_sbam.zh.yaml +166 -0
  68. package/AISB/catalog/aisb.t3.029_cdqgeoembed.yaml +224 -0
  69. package/AISB/catalog/aisb.t3.029_cdqgeoembed.zh.yaml +142 -0
  70. package/AISB/catalog/aisb.t3.030_processrm.yaml +211 -0
  71. package/AISB/catalog/aisb.t3.030_processrm.zh.yaml +166 -0
  72. package/AISB/catalog/aisb.t3.031_circuitstability.yaml +172 -0
  73. package/AISB/catalog/aisb.t3.031_circuitstability.zh.yaml +134 -0
  74. package/AISB/catalog/aisb.t3.032_ptsolver.yaml +169 -0
  75. package/AISB/catalog/aisb.t3.032_ptsolver.zh.yaml +135 -0
  76. package/AISB/catalog/aisb.t3.033_gcse.yaml +144 -0
  77. package/AISB/catalog/aisb.t3.033_gcse.zh.yaml +126 -0
  78. package/AISB/catalog/aisb.t3.034_ensemblewm.yaml +183 -0
  79. package/AISB/catalog/aisb.t3.034_ensemblewm.zh.yaml +146 -0
  80. package/AISB/catalog/aisb.t3.035_moralvalueswa.yaml +207 -0
  81. package/AISB/catalog/aisb.t3.035_moralvalueswa.zh.yaml +165 -0
  82. package/AISB/catalog/aisb.t3.036_weakstrongpref.yaml +210 -0
  83. package/AISB/catalog/aisb.t3.036_weakstrongpref.zh.yaml +194 -0
  84. package/AISB/catalog/aisb.t3.037_dementiamask.yaml +172 -0
  85. package/AISB/catalog/aisb.t3.037_dementiamask.zh.yaml +132 -0
  86. package/AISB/catalog/aisb.t3.038_tinysam.yaml +284 -0
  87. package/AISB/catalog/aisb.t3.038_tinysam.zh.yaml +240 -0
  88. package/AISB/catalog/aisb.t3.039_calf.yaml +224 -0
  89. package/AISB/catalog/aisb.t3.039_calf.zh.yaml +194 -0
  90. package/AISB/catalog/aisb.t3.040_graniteguardian.yaml +199 -0
  91. package/AISB/catalog/aisb.t3.040_graniteguardian.zh.yaml +174 -0
  92. package/AISB/catalog/aisb.t3.041_amdm.yaml +149 -0
  93. package/AISB/catalog/aisb.t3.041_amdm.zh.yaml +137 -0
  94. package/AISB/catalog/aisb.t3.042_xpatch.yaml +216 -0
  95. package/AISB/catalog/aisb.t3.042_xpatch.zh.yaml +182 -0
  96. package/AISB/catalog/aisb.t3.043_vhm.yaml +268 -0
  97. package/AISB/catalog/aisb.t3.043_vhm.zh.yaml +193 -0
  98. package/AISB/catalog/aisb.t3.044_rgvi.yaml +224 -0
  99. package/AISB/catalog/aisb.t3.044_rgvi.zh.yaml +176 -0
  100. package/AISB/catalog/aisb.t3.045_pslstm.yaml +203 -0
  101. package/AISB/catalog/aisb.t3.045_pslstm.zh.yaml +179 -0
  102. package/AISB/catalog/aisb.t3.046_nonstatts.yaml +208 -0
  103. package/AISB/catalog/aisb.t3.046_nonstatts.zh.yaml +194 -0
  104. package/AISB/catalog/aisb.t3.047_timepfn.yaml +156 -0
  105. package/AISB/catalog/aisb.t3.047_timepfn.zh.yaml +124 -0
  106. package/AISB/catalog/aisb.t3.048_proxyspex.yaml +148 -0
  107. package/AISB/catalog/aisb.t3.048_proxyspex.zh.yaml +125 -0
  108. package/AISB/catalog/aisb.t3.049_hogwildinference.yaml +183 -0
  109. package/AISB/catalog/aisb.t3.049_hogwildinference.zh.yaml +138 -0
  110. package/AISB/catalog/aisb.t3.050_causalpfn.yaml +214 -0
  111. package/AISB/catalog/aisb.t3.050_causalpfn.zh.yaml +190 -0
  112. package/AISB/catalog/aisb.t3.051_flashtp.yaml +169 -0
  113. package/AISB/catalog/aisb.t3.051_flashtp.zh.yaml +124 -0
  114. package/AISB/catalog/aisb.t3.052_nsdiff.yaml +155 -0
  115. package/AISB/catalog/aisb.t3.052_nsdiff.zh.yaml +138 -0
  116. package/AISB/catalog/aisb.t3.053_k2vae.yaml +158 -0
  117. package/AISB/catalog/aisb.t3.053_k2vae.zh.yaml +132 -0
  118. package/AISB/catalog/aisb.t3.054_timebase.yaml +178 -0
  119. package/AISB/catalog/aisb.t3.054_timebase.zh.yaml +158 -0
  120. package/AISB/catalog/aisb.t3.055_csbrain.yaml +238 -0
  121. package/AISB/catalog/aisb.t3.055_csbrain.zh.yaml +184 -0
  122. package/AISB/catalog/aisb.t3.056_infosam.yaml +224 -0
  123. package/AISB/catalog/aisb.t3.056_infosam.zh.yaml +189 -0
  124. package/AISB/catalog/aisb.t3.057_mdreid.yaml +129 -0
  125. package/AISB/catalog/aisb.t3.057_mdreid.zh.yaml +117 -0
  126. package/AISB/catalog/aisb.t3.058_mindglitch.yaml +171 -0
  127. package/AISB/catalog/aisb.t3.058_mindglitch.zh.yaml +145 -0
  128. package/AISB/catalog/aisb.t3.059_selfsupervised.yaml +154 -0
  129. package/AISB/catalog/aisb.t3.059_selfsupervised.zh.yaml +125 -0
  130. package/AISB/catalog/aisb.t3.060_iaggad.yaml +121 -0
  131. package/AISB/catalog/aisb.t3.060_iaggad.zh.yaml +100 -0
  132. package/AISB/catalog/aisb.t3.061_hsgkn.yaml +136 -0
  133. package/AISB/catalog/aisb.t3.061_hsgkn.zh.yaml +113 -0
  134. package/AISB/catalog/aisb.t3.062_visionts.yaml +237 -0
  135. package/AISB/catalog/aisb.t3.062_visionts.zh.yaml +216 -0
  136. package/AISB/catalog/aisb.t3.063_tsrag.yaml +162 -0
  137. package/AISB/catalog/aisb.t3.063_tsrag.zh.yaml +138 -0
  138. package/AISB/catalog/aisb.t3.064_pir.yaml +221 -0
  139. package/AISB/catalog/aisb.t3.064_pir.zh.yaml +197 -0
  140. package/AISB/catalog/aisb.t3.065_proteinbinding.yaml +234 -0
  141. package/AISB/catalog/aisb.t3.065_proteinbinding.zh.yaml +167 -0
  142. package/AISB/catalog/aisb.t3.066_tropicalattention.yaml +267 -0
  143. package/AISB/catalog/aisb.t3.066_tropicalattention.zh.yaml +229 -0
  144. package/AISB/catalog/aisb.t3.067_kanad.yaml +193 -0
  145. package/AISB/catalog/aisb.t3.067_kanad.zh.yaml +167 -0
  146. package/AISB/catalog/aisb.t3.068_sempo.yaml +187 -0
  147. package/AISB/catalog/aisb.t3.068_sempo.zh.yaml +148 -0
  148. package/AISB/catalog/aisb.t3.069_treehfd.yaml +129 -0
  149. package/AISB/catalog/aisb.t3.069_treehfd.zh.yaml +111 -0
  150. package/AISB/catalog/aisb.t3.070_certifiedunlearning.yaml +224 -0
  151. package/AISB/catalog/aisb.t3.070_certifiedunlearning.zh.yaml +171 -0
  152. package/AISB/catalog/aisb.t3.071_neuralmjd.yaml +142 -0
  153. package/AISB/catalog/aisb.t3.071_neuralmjd.zh.yaml +120 -0
  154. package/AISB/catalog/aisb.t3.072_fedgmt.yaml +181 -0
  155. package/AISB/catalog/aisb.t3.072_fedgmt.zh.yaml +158 -0
  156. package/AISB/catalog/aisb.t3.073_rld.yaml +161 -0
  157. package/AISB/catalog/aisb.t3.073_rld.zh.yaml +129 -0
  158. package/AISB/catalog/aisb.t3.074_lsvi.yaml +163 -0
  159. package/AISB/catalog/aisb.t3.074_lsvi.zh.yaml +129 -0
  160. package/AISB/catalog/aisb.t3.075_treeslicedentropy.yaml +201 -0
  161. package/AISB/catalog/aisb.t3.075_treeslicedentropy.zh.yaml +148 -0
  162. package/AISB/catalog/aisb.t3.076_aanet.yaml +169 -0
  163. package/AISB/catalog/aisb.t3.076_aanet.zh.yaml +129 -0
  164. package/AISB/catalog/aisb.t3.077_cmnn.yaml +199 -0
  165. package/AISB/catalog/aisb.t3.077_cmnn.zh.yaml +165 -0
  166. package/AISB/catalog/aisb.t3.078_conformalanomaly.yaml +146 -0
  167. package/AISB/catalog/aisb.t3.078_conformalanomaly.zh.yaml +117 -0
  168. package/AISB/catalog/aisb.t3.079_dpfkmeans.yaml +131 -0
  169. package/AISB/catalog/aisb.t3.079_dpfkmeans.zh.yaml +104 -0
  170. package/AISB/catalog/aisb.t3.080_latentscorereweight.yaml +169 -0
  171. package/AISB/catalog/aisb.t3.080_latentscorereweight.zh.yaml +123 -0
  172. package/AISB/catalog/aisb.t3.081_qmamba.yaml +150 -0
  173. package/AISB/catalog/aisb.t3.081_qmamba.zh.yaml +117 -0
  174. package/AISB/catalog/aisb.t3.082_onlinellmrouting.yaml +160 -0
  175. package/AISB/catalog/aisb.t3.082_onlinellmrouting.zh.yaml +133 -0
  176. package/AISB/catalog/aisb.t3.083_starformer.yaml +178 -0
  177. package/AISB/catalog/aisb.t3.083_starformer.zh.yaml +140 -0
  178. package/AISB/catalog/aisb.t3.084_ift.yaml +139 -0
  179. package/AISB/catalog/aisb.t3.084_ift.zh.yaml +111 -0
  180. package/AISB/catalog/aisb.t3.085_neuralsurv.yaml +183 -0
  181. package/AISB/catalog/aisb.t3.085_neuralsurv.zh.yaml +143 -0
  182. package/AISB/catalog/aisb.t3.086_stella.yaml +197 -0
  183. package/AISB/catalog/aisb.t3.086_stella.zh.yaml +142 -0
  184. package/AISB/catalog/aisb.t3.087_moses.yaml +167 -0
  185. package/AISB/catalog/aisb.t3.087_moses.zh.yaml +132 -0
  186. package/AISB/catalog/aisb.t3.088_channelnorm.yaml +140 -0
  187. package/AISB/catalog/aisb.t3.088_channelnorm.zh.yaml +109 -0
  188. package/AISB/catalog/aisb.t3.089_causalvelocity.yaml +730 -0
  189. package/AISB/catalog/aisb.t3.089_causalvelocity.zh.yaml +668 -0
  190. package/AISB/catalog/aisb.t3.090_rstib.yaml +144 -0
  191. package/AISB/catalog/aisb.t3.090_rstib.zh.yaml +109 -0
  192. package/AISB/catalog/aisb.t3.091_timeawarecausal.yaml +132 -0
  193. package/AISB/catalog/aisb.t3.091_timeawarecausal.zh.yaml +107 -0
  194. package/AISB/catalog/aisb.t3.092_kmeanslocalopt.yaml +138 -0
  195. package/AISB/catalog/aisb.t3.092_kmeanslocalopt.zh.yaml +110 -0
  196. package/AISB/catalog/aisb.t3.093_fedwmsam.yaml +134 -0
  197. package/AISB/catalog/aisb.t3.093_fedwmsam.zh.yaml +106 -0
  198. package/AISB/catalog/aisb.t3.094_boundre.yaml +147 -0
  199. package/AISB/catalog/aisb.t3.094_boundre.zh.yaml +114 -0
  200. package/AISB/catalog/aisb.t3.095_fastfeaturecp.yaml +153 -0
  201. package/AISB/catalog/aisb.t3.095_fastfeaturecp.zh.yaml +118 -0
  202. package/AISB/catalog/aisb.t3.096_m3svm.yaml +189 -0
  203. package/AISB/catalog/aisb.t3.096_m3svm.zh.yaml +149 -0
  204. package/AISB/catalog/aisb.t3.097_wassersteintl.yaml +212 -0
  205. package/AISB/catalog/aisb.t3.097_wassersteintl.zh.yaml +169 -0
  206. package/AISB/catalog/aisb.t3.098_xmahalanobis.yaml +171 -0
  207. package/AISB/catalog/aisb.t3.098_xmahalanobis.zh.yaml +127 -0
  208. package/AISB/catalog/aisb.t3.099_ollalanding.yaml +248 -0
  209. package/AISB/catalog/aisb.t3.099_ollalanding.zh.yaml +182 -0
  210. package/AISB/catalog/aisb.t3.100_invmissingdata.yaml +179 -0
  211. package/AISB/catalog/aisb.t3.100_invmissingdata.zh.yaml +150 -0
  212. package/AISB/catalog/aisb.t3.101_acia.yaml +164 -0
  213. package/AISB/catalog/aisb.t3.101_acia.zh.yaml +109 -0
  214. package/AISB/catalog/aisb.t3.102_stochasticff.yaml +178 -0
  215. package/AISB/catalog/aisb.t3.102_stochasticff.zh.yaml +130 -0
  216. package/AISB/catalog/aisb.t3.103_qdcp.yaml +150 -0
  217. package/AISB/catalog/aisb.t3.103_qdcp.zh.yaml +116 -0
  218. package/AISB/catalog/aisb.t3.104_balancedactiveinf.yaml +137 -0
  219. package/AISB/catalog/aisb.t3.104_balancedactiveinf.zh.yaml +104 -0
  220. package/AISB/catalog/aisb.t3.105_binaryclasseval.yaml +161 -0
  221. package/AISB/catalog/aisb.t3.105_binaryclasseval.zh.yaml +130 -0
  222. package/AISB/image/001_aisb.t3.001_savvy.jpg +0 -0
  223. package/AISB/image/002_aisb.t3.002_pinet.jpg +0 -0
  224. package/AISB/image/003_aisb.t3.003_dmsqd.jpg +0 -0
  225. package/AISB/image/004_aisb.t3.004_decentralattn.jpg +0 -0
  226. package/AISB/image/005_aisb.t3.005_tsae.jpg +0 -0
  227. package/AISB/image/006_aisb.t3.006_physense.jpg +0 -0
  228. package/AISB/image/007_aisb.t3.007_reasoningiqa.jpg +0 -0
  229. package/AISB/image/008_aisb.t3.008_meanflows.jpg +0 -0
  230. package/AISB/image/009_aisb.t3.009_scoremissing.jpg +0 -0
  231. package/AISB/image/010_aisb.t3.010_suitabilityfilter.jpg +0 -0
  232. package/AISB/image/011_aisb.t3.011_osd.jpg +0 -0
  233. package/AISB/image/012_aisb.t3.012_efficientqat.jpg +0 -0
  234. package/AISB/image/013_aisb.t3.013_appl.jpg +0 -0
  235. package/AISB/image/014_aisb.t3.014_piguard.jpg +0 -0
  236. package/AISB/image/015_aisb.t3.015_frspec.jpg +0 -0
  237. package/AISB/image/016_aisb.t3.016_mathfusion.jpg +0 -0
  238. package/AISB/image/017_aisb.t3.017_multimodalglp.jpg +0 -0
  239. package/AISB/image/018_aisb.t3.018_cotsynth.jpg +0 -0
  240. package/AISB/image/019_aisb.t3.019_dyscaleut.jpg +0 -0
  241. package/AISB/image/020_aisb.t3.020_aristotle.jpg +0 -0
  242. package/AISB/image/021_aisb.t3.021_tokenrecycling.jpg +0 -0
  243. package/AISB/image/022_aisb.t3.022_chainofreasoning.jpg +0 -0
  244. package/AISB/image/023_aisb.t3.023_guidedembed.jpg +0 -0
  245. package/AISB/image/024_aisb.t3.024_outputcentric.jpg +0 -0
  246. package/AISB/image/025_aisb.t3.025_deeper.jpg +0 -0
  247. package/AISB/image/026_aisb.t3.026_gartkg.jpg +0 -0
  248. package/AISB/image/027_aisb.t3.027_citeeval.jpg +0 -0
  249. package/AISB/image/028_aisb.t3.028_sbam.jpg +0 -0
  250. package/AISB/image/029_aisb.t3.029_cdqgeoembed.jpg +0 -0
  251. package/AISB/image/030_aisb.t3.030_processrm.jpg +0 -0
  252. package/AISB/image/031_aisb.t3.031_circuitstability.jpg +0 -0
  253. package/AISB/image/032_aisb.t3.032_ptsolver.jpg +0 -0
  254. package/AISB/image/033_aisb.t3.033_gcse.jpg +0 -0
  255. package/AISB/image/034_aisb.t3.034_ensemblewm.jpg +0 -0
  256. package/AISB/image/035_aisb.t3.035_moralvalueswa.jpg +0 -0
  257. package/AISB/image/036_aisb.t3.036_weakstrongpref.jpg +0 -0
  258. package/AISB/image/037_aisb.t3.037_dementiamask.jpg +0 -0
  259. package/AISB/image/038_aisb.t3.038_tinysam.jpg +0 -0
  260. package/AISB/image/039_aisb.t3.039_calf.jpg +0 -0
  261. package/AISB/image/040_aisb.t3.040_graniteguardian.jpg +0 -0
  262. package/AISB/image/041_aisb.t3.041_amdm.jpg +0 -0
  263. package/AISB/image/042_aisb.t3.042_xpatch.jpg +0 -0
  264. package/AISB/image/043_aisb.t3.043_vhm.jpg +0 -0
  265. package/AISB/image/044_aisb.t3.044_rgvi.jpg +0 -0
  266. package/AISB/image/045_aisb.t3.045_pslstm.jpg +0 -0
  267. package/AISB/image/046_aisb.t3.046_nonstatts.jpg +0 -0
  268. package/AISB/image/047_aisb.t3.047_timepfn.jpg +0 -0
  269. package/AISB/image/048_aisb.t3.048_proxyspex.jpg +0 -0
  270. package/AISB/image/049_aisb.t3.049_hogwildinference.jpg +0 -0
  271. package/AISB/image/050_aisb.t3.050_causalpfn.jpg +0 -0
  272. package/AISB/image/051_aisb.t3.051_flashtp.jpg +0 -0
  273. package/AISB/image/052_aisb.t3.052_nsdiff.jpg +0 -0
  274. package/AISB/image/053_aisb.t3.053_k2vae.jpg +0 -0
  275. package/AISB/image/054_aisb.t3.054_timebase.jpg +0 -0
  276. package/AISB/image/055_aisb.t3.055_csbrain.jpg +0 -0
  277. package/AISB/image/056_aisb.t3.056_infosam.jpg +0 -0
  278. package/AISB/image/057_aisb.t3.057_mdreid.jpg +0 -0
  279. package/AISB/image/058_aisb.t3.058_mindglitch.jpg +0 -0
  280. package/AISB/image/059_aisb.t3.059_selfsupervised.jpg +0 -0
  281. package/AISB/image/060_aisb.t3.060_iaggad.jpg +0 -0
  282. package/AISB/image/061_aisb.t3.061_hsgkn.jpg +0 -0
  283. package/AISB/image/062_aisb.t3.062_visionts.jpg +0 -0
  284. package/AISB/image/063_aisb.t3.063_tsrag.jpg +0 -0
  285. package/AISB/image/064_aisb.t3.064_pir.jpg +0 -0
  286. package/AISB/image/065_aisb.t3.065_proteinbinding.jpg +0 -0
  287. package/AISB/image/066_aisb.t3.066_tropicalattention.jpg +0 -0
  288. package/AISB/image/067_aisb.t3.067_kanad.jpg +0 -0
  289. package/AISB/image/068_aisb.t3.068_sempo.jpg +0 -0
  290. package/AISB/image/069_aisb.t3.069_treehfd.jpg +0 -0
  291. package/AISB/image/070_aisb.t3.070_certifiedunlearning.jpg +0 -0
  292. package/AISB/image/071_aisb.t3.071_neuralmjd.jpg +0 -0
  293. package/AISB/image/072_aisb.t3.072_fedgmt.jpg +0 -0
  294. package/AISB/image/073_aisb.t3.073_rld.jpg +0 -0
  295. package/AISB/image/074_aisb.t3.074_lsvi.jpg +0 -0
  296. package/AISB/image/075_aisb.t3.075_treeslicedentropy.jpg +0 -0
  297. package/AISB/image/076_aisb.t3.076_aanet.jpg +0 -0
  298. package/AISB/image/077_aisb.t3.077_cmnn.jpg +0 -0
  299. package/AISB/image/078_aisb.t3.078_conformalanomaly.jpg +0 -0
  300. package/AISB/image/079_aisb.t3.079_dpfkmeans.jpg +0 -0
  301. package/AISB/image/080_aisb.t3.080_latentscorereweight.jpg +0 -0
  302. package/AISB/image/081_aisb.t3.081_qmamba.jpg +0 -0
  303. package/AISB/image/082_aisb.t3.082_onlinellmrouting.jpg +0 -0
  304. package/AISB/image/083_aisb.t3.083_starformer.jpg +0 -0
  305. package/AISB/image/084_aisb.t3.084_ift.jpg +0 -0
  306. package/AISB/image/085_aisb.t3.085_neuralsurv.jpg +0 -0
  307. package/AISB/image/086_aisb.t3.086_stella.jpg +0 -0
  308. package/AISB/image/087_aisb.t3.087_moses.jpg +0 -0
  309. package/AISB/image/088_aisb.t3.088_channelnorm.jpg +0 -0
  310. package/AISB/image/089_aisb.t3.089_causalvelocity.jpg +0 -0
  311. package/AISB/image/090_aisb.t3.090_rstib.jpg +0 -0
  312. package/AISB/image/091_aisb.t3.091_timeawarecausal.jpg +0 -0
  313. package/AISB/image/092_aisb.t3.092_kmeanslocalopt.jpg +0 -0
  314. package/AISB/image/093_aisb.t3.093_fedwmsam.jpg +0 -0
  315. package/AISB/image/094_aisb.t3.094_boundre.jpg +0 -0
  316. package/AISB/image/095_aisb.t3.095_fastfeaturecp.jpg +0 -0
  317. package/AISB/image/096_aisb.t3.096_m3svm.jpg +0 -0
  318. package/AISB/image/097_aisb.t3.097_wassersteintl.jpg +0 -0
  319. package/AISB/image/098_aisb.t3.098_xmahalanobis.jpg +0 -0
  320. package/AISB/image/099_aisb.t3.099_ollalanding.jpg +0 -0
  321. package/AISB/image/100_aisb.t3.100_invmissingdata.jpg +0 -0
  322. package/AISB/image/101_aisb.t3.101_acia.jpg +0 -0
  323. package/AISB/image/102_aisb.t3.102_stochasticff.jpg +0 -0
  324. package/AISB/image/103_aisb.t3.103_qdcp.jpg +0 -0
  325. package/AISB/image/104_aisb.t3.104_balancedactiveinf.jpg +0 -0
  326. package/AISB/image/105_aisb.t3.105_binaryclasseval.jpg +0 -0
  327. package/AISB/image/106_aisb.t1.reasoning_lite.jpg +0 -0
  328. package/AISB/image/107_aisb.t2.paper_audit.jpg +0 -0
  329. package/AISB/image/108_aisb.t3.multi_gpu_search.jpg +0 -0
  330. package/AISB/image/109_aisb.t3.tdc_admet.jpg +0 -0
  331. package/AISB/image/aisb.b1.agentic_coding.svg +16 -0
  332. package/AISB/image/aisb.b10.climate_earth.svg +16 -0
  333. package/AISB/image/aisb.b11.model_efficiency.svg +16 -0
  334. package/AISB/image/aisb.b12.embodied_ai.svg +16 -0
  335. package/AISB/image/aisb.b2.agent_systems.svg +16 -0
  336. package/AISB/image/aisb.b3.self_evolving_rl.svg +16 -0
  337. package/AISB/image/aisb.b4.lm_reasoning.svg +16 -0
  338. package/AISB/image/aisb.b5.math_proof.svg +16 -0
  339. package/AISB/image/aisb.b6.research_process.svg +16 -0
  340. package/AISB/image/aisb.b7.multimodal_fusion.svg +16 -0
  341. package/AISB/image/aisb.b8.lifesci_drug.svg +16 -0
  342. package/AISB/image/aisb.b9.material_science.svg +16 -0
  343. package/README.md +196 -32
  344. package/bin/ds.js +924 -66
  345. package/docs/en/00_QUICK_START.md +195 -18
  346. package/docs/en/01_SETTINGS_REFERENCE.md +468 -96
  347. package/docs/en/02_START_RESEARCH_GUIDE.md +26 -5
  348. package/docs/en/03_QQ_CONNECTOR_GUIDE.md +14 -3
  349. package/docs/en/04_LINGZHU_CONNECTOR_GUIDE.md +2 -0
  350. package/docs/en/05_TUI_GUIDE.md +171 -2
  351. package/docs/en/07_MEMORY_AND_MCP.md +38 -2
  352. package/docs/en/09_DOCTOR.md +78 -7
  353. package/docs/en/10_WEIXIN_CONNECTOR_GUIDE.md +38 -1
  354. package/docs/en/11_LICENSE_AND_RISK.md +4 -0
  355. package/docs/en/12_GUIDED_WORKFLOW_TOUR.md +15 -0
  356. package/docs/en/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +9 -0
  357. package/docs/en/15_CODEX_PROVIDER_SETUP.md +624 -180
  358. package/docs/en/16_TELEGRAM_CONNECTOR_GUIDE.md +14 -0
  359. package/docs/en/17_WHATSAPP_CONNECTOR_GUIDE.md +14 -0
  360. package/docs/en/18_FEISHU_CONNECTOR_GUIDE.md +14 -0
  361. package/docs/en/21_LOCAL_MODEL_BACKENDS_GUIDE.md +386 -0
  362. package/docs/en/22_BENCHSTORE_YAML_REFERENCE.md +469 -0
  363. package/docs/en/23_BENCHSTORE_GITHUB_RELEASES_SPEC.md +316 -0
  364. package/docs/en/24_CLAUDE_CODE_PROVIDER_SETUP.md +469 -0
  365. package/docs/en/25_OPENCODE_PROVIDER_SETUP.md +653 -0
  366. package/docs/en/26_CITATION_AND_ATTRIBUTION.md +119 -0
  367. package/docs/en/27_KIMI_CODE_PROVIDER_SETUP.md +180 -0
  368. package/docs/en/28_DISCORD_CONNECTOR_GUIDE.md +61 -0
  369. package/docs/en/29_SLACK_CONNECTOR_GUIDE.md +60 -0
  370. package/docs/en/30_SETTINGS_CONTROL_CENTER_GUIDE.md +371 -0
  371. package/docs/en/{19_LOCAL_BROWSER_AUTH.md → 31_LOCAL_BROWSER_AUTH.md} +1 -1
  372. package/docs/en/32_WINDOWS_WSL2_DEPLOYMENT_GUIDE.md +273 -0
  373. package/docs/en/33_WORKSPACE_EXPLORER_QA.md +121 -0
  374. package/docs/en/91_DEVELOPMENT.md +266 -0
  375. package/docs/en/99_ACKNOWLEDGEMENTS.md +24 -19
  376. package/docs/en/README.md +48 -7
  377. package/docs/images/admin/admin-connectors-health-en.png +0 -0
  378. package/docs/images/admin/admin-controllers-en.png +0 -0
  379. package/docs/images/admin/admin-diagnostics-en.png +0 -0
  380. package/docs/images/admin/admin-errors-en.png +0 -0
  381. package/docs/images/admin/admin-issues-en.png +0 -0
  382. package/docs/images/admin/admin-logs-en.png +0 -0
  383. package/docs/images/admin/admin-quest-detail-en.png +0 -0
  384. package/docs/images/admin/admin-quests-en.png +0 -0
  385. package/docs/images/admin/admin-repairs-en.png +0 -0
  386. package/docs/images/admin/admin-runtime-en.png +0 -0
  387. package/docs/images/admin/admin-search-en.png +0 -0
  388. package/docs/images/admin/admin-stats-en.png +0 -0
  389. package/docs/images/admin/admin-summary-en.png +0 -0
  390. package/docs/images/connectors/connector-discord-en.png +0 -0
  391. package/docs/images/connectors/connector-feishu-en.png +0 -0
  392. package/docs/images/connectors/connector-lingzhu-en.png +0 -0
  393. package/docs/images/connectors/connector-qq-en.png +0 -0
  394. package/docs/images/connectors/connector-slack-en.png +0 -0
  395. package/docs/images/connectors/connector-telegram-en.png +0 -0
  396. package/docs/images/connectors/connector-weixin-en.png +0 -0
  397. package/docs/images/connectors/connector-whatsapp-en.png +0 -0
  398. package/docs/images/settings/settings-baselines-en.png +0 -0
  399. package/docs/images/settings/settings-config-en.png +0 -0
  400. package/docs/images/settings/settings-connectors-overview-en.png +0 -0
  401. package/docs/images/settings/settings-deepxiv-en.png +0 -0
  402. package/docs/images/settings/settings-mcp-servers-en.png +0 -0
  403. package/docs/images/settings/settings-plugins-en.png +0 -0
  404. package/docs/images/settings/settings-runners-en.png +0 -0
  405. package/docs/zh/00_QUICK_START.md +142 -18
  406. package/docs/zh/01_SETTINGS_REFERENCE.md +219 -98
  407. package/docs/zh/02_START_RESEARCH_GUIDE.md +26 -5
  408. package/docs/zh/05_TUI_GUIDE.md +171 -2
  409. package/docs/zh/07_MEMORY_AND_MCP.md +29 -2
  410. package/docs/zh/09_DOCTOR.md +54 -8
  411. package/docs/zh/10_WEIXIN_CONNECTOR_GUIDE.md +24 -1
  412. package/docs/zh/11_LICENSE_AND_RISK.md +4 -0
  413. package/docs/zh/12_GUIDED_WORKFLOW_TOUR.md +15 -0
  414. package/docs/zh/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +9 -0
  415. package/docs/zh/15_CODEX_PROVIDER_SETUP.md +552 -181
  416. package/docs/zh/21_LOCAL_MODEL_BACKENDS_GUIDE.md +384 -0
  417. package/docs/zh/22_BENCHSTORE_YAML_REFERENCE.md +459 -0
  418. package/docs/zh/23_BENCHSTORE_GITHUB_RELEASES_SPEC.md +287 -0
  419. package/docs/zh/23_CLAUDE_RUNNER_GUIDE.md +103 -0
  420. package/docs/zh/24_CLAUDE_CODE_PROVIDER_SETUP.md +460 -0
  421. package/docs/zh/25_OPENCODE_PROVIDER_SETUP.md +660 -0
  422. package/docs/zh/26_CITATION_AND_ATTRIBUTION.md +102 -0
  423. package/docs/zh/27_KIMI_CODE_PROVIDER_SETUP.md +51 -0
  424. package/docs/zh/{19_LOCAL_BROWSER_AUTH.md → 31_LOCAL_BROWSER_AUTH.md} +1 -1
  425. package/docs/zh/32_WINDOWS_WSL2_DEPLOYMENT_GUIDE.md +264 -0
  426. package/docs/zh/33_WORKSPACE_EXPLORER_QA.md +127 -0
  427. package/docs/zh/99_ACKNOWLEDGEMENTS.md +23 -19
  428. package/docs/zh/README.md +33 -7
  429. package/install.sh +168 -20
  430. package/package.json +5 -1
  431. package/pyproject.toml +2 -1
  432. package/src/deepscientist/__init__.py +1 -1
  433. package/src/deepscientist/acp/envelope.py +13 -0
  434. package/src/deepscientist/admin/__init__.py +3 -0
  435. package/src/deepscientist/admin/charts.py +681 -0
  436. package/src/deepscientist/admin/logs.py +119 -0
  437. package/src/deepscientist/admin/repairs.py +217 -0
  438. package/src/deepscientist/admin/service.py +1310 -0
  439. package/src/deepscientist/admin/system_info.py +700 -0
  440. package/src/deepscientist/admin/tasks.py +465 -0
  441. package/src/deepscientist/admin/tool_metrics.py +600 -0
  442. package/src/deepscientist/artifact/guidance.py +8 -4
  443. package/src/deepscientist/artifact/schemas.py +115 -0
  444. package/src/deepscientist/artifact/service.py +4268 -260
  445. package/src/deepscientist/bash_exec/monitor.py +30 -3
  446. package/src/deepscientist/bash_exec/service.py +134 -1
  447. package/src/deepscientist/benchstore/__init__.py +4 -0
  448. package/src/deepscientist/benchstore/prompt_builder.py +224 -0
  449. package/src/deepscientist/benchstore/service.py +1716 -0
  450. package/src/deepscientist/bridges/connectors.py +8 -2
  451. package/src/deepscientist/channels/weixin_ilink.py +8 -1
  452. package/src/deepscientist/cli.py +92 -17
  453. package/src/deepscientist/codex_cli_compat.py +187 -74
  454. package/src/deepscientist/config/models.py +82 -11
  455. package/src/deepscientist/config/service.py +1077 -93
  456. package/src/deepscientist/connector/weixin_support.py +48 -17
  457. package/src/deepscientist/daemon/api/handlers.py +827 -235
  458. package/src/deepscientist/daemon/api/router.py +81 -1
  459. package/src/deepscientist/daemon/app.py +1512 -85
  460. package/src/deepscientist/diagnostics/__init__.py +6 -0
  461. package/src/deepscientist/diagnostics/runner_failures.py +277 -0
  462. package/src/deepscientist/doctor.py +407 -56
  463. package/src/deepscientist/evidence_packets.py +590 -0
  464. package/src/deepscientist/home.py +52 -4
  465. package/src/deepscientist/kimi_cli_compat.py +50 -0
  466. package/src/deepscientist/latex_runtime.py +2 -2
  467. package/src/deepscientist/mcp/context.py +2 -0
  468. package/src/deepscientist/mcp/schemas.py +114 -0
  469. package/src/deepscientist/mcp/server.py +1566 -126
  470. package/src/deepscientist/memory/service.py +203 -16
  471. package/src/deepscientist/process_control.py +8 -1
  472. package/src/deepscientist/prompts/builder.py +850 -88
  473. package/src/deepscientist/quest/__init__.py +2 -2
  474. package/src/deepscientist/quest/layout.py +12 -1
  475. package/src/deepscientist/quest/node_traces.py +10 -0
  476. package/src/deepscientist/quest/service.py +1852 -161
  477. package/src/deepscientist/quest/stage_views.py +1 -1
  478. package/src/deepscientist/runners/__init__.py +18 -0
  479. package/src/deepscientist/runners/base.py +89 -1
  480. package/src/deepscientist/runners/builtins.py +13 -1
  481. package/src/deepscientist/runners/claude.py +391 -0
  482. package/src/deepscientist/runners/codex.py +480 -35
  483. package/src/deepscientist/runners/codex_telemetry.py +127 -0
  484. package/src/deepscientist/runners/kimi.py +334 -0
  485. package/src/deepscientist/runners/metadata.py +68 -0
  486. package/src/deepscientist/runners/opencode.py +414 -0
  487. package/src/deepscientist/runners/runtime_overrides.py +100 -0
  488. package/src/deepscientist/runners/simple_cli.py +538 -0
  489. package/src/deepscientist/runtime_storage.py +303 -0
  490. package/src/deepscientist/shared.py +80 -16
  491. package/src/deepscientist/skills/installer.py +37 -0
  492. package/src/deepscientist/skills/registry.py +2 -0
  493. package/src/deepscientist/tinytex.py +2 -2
  494. package/src/deepscientist/tui.py +10 -3
  495. package/src/prompts/benchstore/system.md +77 -0
  496. package/src/prompts/connectors/qq.md +33 -2
  497. package/src/prompts/connectors/weixin.md +208 -23
  498. package/src/prompts/contracts/admin_ops.md +74 -0
  499. package/src/prompts/contracts/admin_ops_knowledge.md +138 -0
  500. package/src/prompts/contracts/shared_interaction.md +5 -10
  501. package/src/prompts/start_setup/system.md +422 -0
  502. package/src/prompts/system.md +411 -304
  503. package/src/prompts/system_copilot.md +89 -0
  504. package/src/skills/analysis-campaign/SKILL.md +239 -578
  505. package/src/skills/analysis-campaign/references/artifact-flow-examples.md +102 -0
  506. package/src/skills/analysis-campaign/references/boundary-cases.md +98 -0
  507. package/src/skills/analysis-campaign/references/campaign-checklist-template.md +39 -24
  508. package/src/skills/analysis-campaign/references/campaign-design.md +26 -10
  509. package/src/skills/analysis-campaign/references/campaign-plan-template.md +53 -54
  510. package/src/skills/analysis-campaign/references/operational-guidance.md +97 -0
  511. package/src/skills/analysis-campaign/references/writing-facing-slice-examples.md +10 -20
  512. package/src/skills/baseline/SKILL.md +183 -461
  513. package/src/skills/baseline/references/artifact-flow-examples.md +106 -0
  514. package/src/skills/baseline/references/artifact-payload-examples.md +1 -1
  515. package/src/skills/baseline/references/baseline-checklist-template.md +27 -35
  516. package/src/skills/baseline/references/baseline-plan-template.md +37 -76
  517. package/src/skills/baseline/references/boundary-cases.md +86 -0
  518. package/src/skills/baseline/references/codebase-audit-checklist.md +2 -6
  519. package/src/skills/baseline/references/comparability-contract.md +7 -12
  520. package/src/skills/baseline/references/operational-guidance.md +56 -0
  521. package/src/skills/baseline/references/route-selection.md +5 -25
  522. package/src/skills/decision/SKILL.md +113 -306
  523. package/src/skills/decision/references/checkpoint-memory-template.md +47 -0
  524. package/src/skills/decision/references/operational-guidance.md +94 -0
  525. package/src/skills/decision/references/research-route-criteria.md +7 -8
  526. package/src/skills/decision/references/strategic-decision-template.md +13 -26
  527. package/src/skills/experiment/SKILL.md +132 -670
  528. package/src/skills/experiment/references/execution-playbook.md +374 -0
  529. package/src/skills/experiment/references/main-experiment-checklist-template.md +26 -2
  530. package/src/skills/experiment/references/main-experiment-plan-template.md +28 -17
  531. package/src/skills/experiment/references/operational-guidance.md +108 -0
  532. package/src/skills/finalize/SKILL.md +62 -0
  533. package/src/skills/finalize/references/checkpoint-memory-template.md +49 -0
  534. package/src/skills/finalize/references/resume-packet-template.md +7 -0
  535. package/src/skills/idea/SKILL.md +228 -15
  536. package/src/skills/idea/references/controlled-brainstorming-playbook.md +78 -0
  537. package/src/skills/idea/references/current-board-packet-template.md +61 -0
  538. package/src/skills/idea/references/high-value-idea-sourcing.md +119 -0
  539. package/src/skills/idea/references/idea-generation-playbook.md +21 -0
  540. package/src/skills/idea/references/idea-thinking-flow.md +6 -0
  541. package/src/skills/idea/references/literature-survey-template.md +3 -0
  542. package/src/skills/idea/references/objective-contract-template.md +54 -0
  543. package/src/skills/idea/references/outline-seeding-example.md +56 -0
  544. package/src/skills/idea/references/pre-idea-draft-template.md +105 -0
  545. package/src/skills/idea/references/related-work-playbook.md +75 -2
  546. package/src/skills/idea/references/research-history-playbook.md +114 -0
  547. package/src/skills/idea/references/selection-gate.md +58 -6
  548. package/src/skills/intake-audit/SKILL.md +43 -2
  549. package/src/skills/intake-audit/references/state-audit-template.md +10 -0
  550. package/src/skills/nature-data/SKILL.md +128 -0
  551. package/src/skills/nature-data/UPSTREAM_LICENSE.txt +21 -0
  552. package/src/skills/nature-data/agents/openai.yaml +4 -0
  553. package/src/skills/nature-data/references/chinese-author-alignment.md +84 -0
  554. package/src/skills/nature-data/references/fair-metadata-checklist.md +105 -0
  555. package/src/skills/nature-data/references/policy-principles.md +103 -0
  556. package/src/skills/nature-data/references/repository-and-identifiers.md +96 -0
  557. package/src/skills/nature-data/references/source-basis.md +54 -0
  558. package/src/skills/nature-data/references/statement-patterns.md +153 -0
  559. package/src/skills/nature-figure/SKILL.md +197 -0
  560. package/src/skills/nature-figure/UPSTREAM_LICENSE.txt +21 -0
  561. package/src/skills/nature-figure/agents/openai.yaml +4 -0
  562. package/src/skills/nature-figure/evals/evals.json +37 -0
  563. package/src/skills/nature-figure/references/api.md +428 -0
  564. package/src/skills/nature-figure/references/backend-selection.md +100 -0
  565. package/src/skills/nature-figure/references/chart-types.md +281 -0
  566. package/src/skills/nature-figure/references/common-patterns.md +349 -0
  567. package/src/skills/nature-figure/references/design-theory.md +436 -0
  568. package/src/skills/nature-figure/references/figure-contract.md +93 -0
  569. package/src/skills/nature-figure/references/nature-2026-observations.md +112 -0
  570. package/src/skills/nature-figure/references/qa-contract.md +119 -0
  571. package/src/skills/nature-figure/references/r-template-index.md +66 -0
  572. package/src/skills/nature-figure/references/r-workflow.md +161 -0
  573. package/src/skills/nature-figure/references/tutorials.md +250 -0
  574. package/src/skills/nature-paper2ppt/SKILL.md +507 -0
  575. package/src/skills/nature-paper2ppt/UPSTREAM_LICENSE.txt +21 -0
  576. package/src/skills/nature-paper2ppt/agents/openai.yaml +4 -0
  577. package/src/skills/nature-polishing/SKILL.md +385 -0
  578. package/src/skills/nature-polishing/UPSTREAM_LICENSE.txt +21 -0
  579. package/src/skills/nature-polishing/agents/openai.yaml +4 -0
  580. package/src/skills/nature-polishing/references/phrasebank-playbook.md +162 -0
  581. package/src/skills/nature-polishing/references/section-moves.md +240 -0
  582. package/src/skills/nature-polishing/references/style-guardrails.md +94 -0
  583. package/src/skills/nature-polishing/references/writing-strategy.md +148 -0
  584. package/src/skills/optimize/SKILL.md +177 -1568
  585. package/src/skills/optimize/references/brief-shaping-playbook.md +95 -0
  586. package/src/skills/optimize/references/candidate-board-template.md +13 -0
  587. package/src/skills/optimize/references/candidate-ranking-template.md +51 -0
  588. package/src/skills/optimize/references/codegen-route-playbook.md +50 -0
  589. package/src/skills/optimize/references/debug-response-template.md +29 -0
  590. package/src/skills/optimize/references/frontier-review-template.md +32 -0
  591. package/src/skills/optimize/references/fusion-playbook.md +36 -0
  592. package/src/skills/optimize/references/method-brief-template.md +73 -0
  593. package/src/skills/optimize/references/operational-guidance.md +621 -0
  594. package/src/skills/optimize/references/optimization-memory-template.md +30 -0
  595. package/src/skills/optimize/references/optimize-checklist-template.md +18 -0
  596. package/src/skills/optimize/references/plateau-response-playbook.md +28 -0
  597. package/src/skills/optimize/references/prompt-patterns.md +49 -0
  598. package/src/skills/paper-outline/SKILL.md +227 -0
  599. package/src/skills/paper-outline/references/outline-patterns.md +87 -0
  600. package/src/skills/paper-plot/SKILL.md +79 -0
  601. package/src/skills/paper-plot/agents/openai.yaml +4 -0
  602. package/src/skills/paper-plot/references/bar_grouped_hatch.md +96 -0
  603. package/src/skills/paper-plot/references/bar_paired_delta.md +72 -0
  604. package/src/skills/paper-plot/references/line_confidence_band.md +75 -0
  605. package/src/skills/paper-plot/references/line_loss_with_inset.md +65 -0
  606. package/src/skills/paper-plot/references/line_training_curve.md +44 -0
  607. package/src/skills/paper-plot/references/radar_dual_series.md +59 -0
  608. package/src/skills/paper-plot/references/scatter_broken_axis.md +59 -0
  609. package/src/skills/paper-plot/references/scatter_tsne_cluster.md +72 -0
  610. package/src/skills/paper-plot/scripts/bar_memevolve.py +109 -0
  611. package/src/skills/paper-plot/scripts/bar_spice.py +166 -0
  612. package/src/skills/paper-plot/scripts/line_aime.py +94 -0
  613. package/src/skills/paper-plot/scripts/line_loss_inset.py +157 -0
  614. package/src/skills/paper-plot/scripts/line_selfdistill.py +168 -0
  615. package/src/skills/paper-plot/scripts/radar_dora.py +151 -0
  616. package/src/skills/paper-plot/scripts/scatter_break.py +169 -0
  617. package/src/skills/paper-plot/scripts/scatter_tsne.py +133 -0
  618. package/src/skills/rebuttal/SKILL.md +9 -0
  619. package/src/skills/references/tool-usage-by-stage.md +438 -0
  620. package/src/skills/review/SKILL.md +105 -7
  621. package/src/skills/science/PROVENANCE.md +44 -0
  622. package/src/skills/science/SKILL.md +137 -0
  623. package/src/skills/science/references/artifact-science-tool.md +110 -0
  624. package/src/skills/science/references/claim-type-discipline.md +56 -0
  625. package/src/skills/science/references/domain-index.md +422 -0
  626. package/src/skills/science/references/hpc-via-bash-exec.md +42 -0
  627. package/src/skills/science/references/package-check-playbook.md +64 -0
  628. package/src/skills/science/references/package-index.min.json +3616 -0
  629. package/src/skills/science/references/packages/abinit.md +80 -0
  630. package/src/skills/science/references/packages/acts.md +73 -0
  631. package/src/skills/science/references/packages/aiida-core.md +80 -0
  632. package/src/skills/science/references/packages/alamode.md +80 -0
  633. package/src/skills/science/references/packages/amuse.md +88 -0
  634. package/src/skills/science/references/packages/anndata.md +88 -0
  635. package/src/skills/science/references/packages/arbor.md +80 -0
  636. package/src/skills/science/references/packages/arc.md +73 -0
  637. package/src/skills/science/references/packages/astropy.md +88 -0
  638. package/src/skills/science/references/packages/astroquery.md +88 -0
  639. package/src/skills/science/references/packages/atomate2.md +80 -0
  640. package/src/skills/science/references/packages/atomsmltr.md +73 -0
  641. package/src/skills/science/references/packages/awkward.md +73 -0
  642. package/src/skills/science/references/packages/batman.md +88 -0
  643. package/src/skills/science/references/packages/biopython.md +88 -0
  644. package/src/skills/science/references/packages/bloqade.md +73 -0
  645. package/src/skills/science/references/packages/brian2.md +73 -0
  646. package/src/skills/science/references/packages/bullet3.md +73 -0
  647. package/src/skills/science/references/packages/calculix.md +80 -0
  648. package/src/skills/science/references/packages/cantera.md +73 -0
  649. package/src/skills/science/references/packages/cavity-md-ipi.md +80 -0
  650. package/src/skills/science/references/packages/ccdproc.md +88 -0
  651. package/src/skills/science/references/packages/celerite2.md +88 -0
  652. package/src/skills/science/references/packages/cellrank.md +73 -0
  653. package/src/skills/science/references/packages/cesm.md +80 -0
  654. package/src/skills/science/references/packages/chemicals.md +73 -0
  655. package/src/skills/science/references/packages/chempy.md +73 -0
  656. package/src/skills/science/references/packages/cirq.md +73 -0
  657. package/src/skills/science/references/packages/coffea.md +73 -0
  658. package/src/skills/science/references/packages/cp2k.md +88 -0
  659. package/src/skills/science/references/packages/custodian.md +80 -0
  660. package/src/skills/science/references/packages/dart.md +73 -0
  661. package/src/skills/science/references/packages/datamol.md +88 -0
  662. package/src/skills/science/references/packages/dd4hep.md +73 -0
  663. package/src/skills/science/references/packages/dealii.md +80 -0
  664. package/src/skills/science/references/packages/deepchem.md +88 -0
  665. package/src/skills/science/references/packages/delphes.md +73 -0
  666. package/src/skills/science/references/packages/devito.md +80 -0
  667. package/src/skills/science/references/packages/dftb.md +88 -0
  668. package/src/skills/science/references/packages/dftd4.md +88 -0
  669. package/src/skills/science/references/packages/dftk-jl.md +80 -0
  670. package/src/skills/science/references/packages/dolfinx.md +80 -0
  671. package/src/skills/science/references/packages/drake.md +73 -0
  672. package/src/skills/science/references/packages/dumux.md +73 -0
  673. package/src/skills/science/references/packages/elk.md +80 -0
  674. package/src/skills/science/references/packages/elmerfem.md +80 -0
  675. package/src/skills/science/references/packages/enzo-e.md +88 -0
  676. package/src/skills/science/references/packages/espresso.md +80 -0
  677. package/src/skills/science/references/packages/exoplanet.md +88 -0
  678. package/src/skills/science/references/packages/fairroot.md +73 -0
  679. package/src/skills/science/references/packages/fbpic.md +80 -0
  680. package/src/skills/science/references/packages/fdtdbath-meep.md +80 -0
  681. package/src/skills/science/references/packages/geant4.md +73 -0
  682. package/src/skills/science/references/packages/geosx.md +80 -0
  683. package/src/skills/science/references/packages/gprmax.md +80 -0
  684. package/src/skills/science/references/packages/gromacs.md +80 -0
  685. package/src/skills/science/references/packages/gwaslab.md +73 -0
  686. package/src/skills/science/references/packages/gz-sim.md +73 -0
  687. package/src/skills/science/references/packages/hail.md +88 -0
  688. package/src/skills/science/references/packages/hiphive.md +80 -0
  689. package/src/skills/science/references/packages/hoomd-blue.md +80 -0
  690. package/src/skills/science/references/packages/itensor.md +73 -0
  691. package/src/skills/science/references/packages/itensors-jl.md +73 -0
  692. package/src/skills/science/references/packages/jdftx.md +73 -0
  693. package/src/skills/science/references/packages/jobflow.md +80 -0
  694. package/src/skills/science/references/packages/kadanoffbaym-jl.md +73 -0
  695. package/src/skills/science/references/packages/kite.md +80 -0
  696. package/src/skills/science/references/packages/kratos.md +80 -0
  697. package/src/skills/science/references/packages/kwant.md +73 -0
  698. package/src/skills/science/references/packages/lammps.md +80 -0
  699. package/src/skills/science/references/packages/lightkurve.md +88 -0
  700. package/src/skills/science/references/packages/limix.md +73 -0
  701. package/src/skills/science/references/packages/maxwelllink.md +80 -0
  702. package/src/skills/science/references/packages/mcdc.md +73 -0
  703. package/src/skills/science/references/packages/meep.md +80 -0
  704. package/src/skills/science/references/packages/mfem.md +80 -0
  705. package/src/skills/science/references/packages/mitgcm.md +73 -0
  706. package/src/skills/science/references/packages/modflow6.md +73 -0
  707. package/src/skills/science/references/packages/molecool.md +73 -0
  708. package/src/skills/science/references/packages/mom6.md +73 -0
  709. package/src/skills/science/references/packages/moose.md +80 -0
  710. package/src/skills/science/references/packages/mpas-model.md +73 -0
  711. package/src/skills/science/references/packages/mujoco.md +73 -0
  712. package/src/skills/science/references/packages/mumax3.md +73 -0
  713. package/src/skills/science/references/packages/nekrs.md +80 -0
  714. package/src/skills/science/references/packages/nessi.md +73 -0
  715. package/src/skills/science/references/packages/nest-simulator.md +73 -0
  716. package/src/skills/science/references/packages/netket.md +73 -0
  717. package/src/skills/science/references/packages/neuron.md +73 -0
  718. package/src/skills/science/references/packages/nextflow.md +88 -0
  719. package/src/skills/science/references/packages/nwchem.md +88 -0
  720. package/src/skills/science/references/packages/openbabel.md +88 -0
  721. package/src/skills/science/references/packages/openems.md +80 -0
  722. package/src/skills/science/references/packages/openff-toolkit.md +88 -0
  723. package/src/skills/science/references/packages/openfoam-dev.md +80 -0
  724. package/src/skills/science/references/packages/openmc.md +73 -0
  725. package/src/skills/science/references/packages/openmm.md +80 -0
  726. package/src/skills/science/references/packages/openmoc.md +73 -0
  727. package/src/skills/science/references/packages/openmx.md +80 -0
  728. package/src/skills/science/references/packages/opensees.md +80 -0
  729. package/src/skills/science/references/packages/opensn.md +80 -0
  730. package/src/skills/science/references/packages/opm-simulators.md +73 -0
  731. package/src/skills/science/references/packages/oqupy.md +73 -0
  732. package/src/skills/science/references/packages/packmol.md +80 -0
  733. package/src/skills/science/references/packages/palabos.md +80 -0
  734. package/src/skills/science/references/packages/parflow.md +80 -0
  735. package/src/skills/science/references/packages/pennylane.md +88 -0
  736. package/src/skills/science/references/packages/perceval.md +73 -0
  737. package/src/skills/science/references/packages/phono3py.md +73 -0
  738. package/src/skills/science/references/packages/phonopy.md +73 -0
  739. package/src/skills/science/references/packages/photutils.md +88 -0
  740. package/src/skills/science/references/packages/picongpu.md +80 -0
  741. package/src/skills/science/references/packages/plink-ng.md +88 -0
  742. package/src/skills/science/references/packages/precice.md +73 -0
  743. package/src/skills/science/references/packages/psc.md +80 -0
  744. package/src/skills/science/references/packages/psi4.md +88 -0
  745. package/src/skills/science/references/packages/pybinding.md +73 -0
  746. package/src/skills/science/references/packages/pyfr.md +80 -0
  747. package/src/skills/science/references/packages/pyhf.md +73 -0
  748. package/src/skills/science/references/packages/pyiron_base.md +80 -0
  749. package/src/skills/science/references/packages/pylcp.md +73 -0
  750. package/src/skills/science/references/packages/pylith.md +80 -0
  751. package/src/skills/science/references/packages/pynbody.md +88 -0
  752. package/src/skills/science/references/packages/pysam.md +88 -0
  753. package/src/skills/science/references/packages/pyscf.md +88 -0
  754. package/src/skills/science/references/packages/q-e.md +73 -0
  755. package/src/skills/science/references/packages/qibo.md +73 -0
  756. package/src/skills/science/references/packages/qiskit.md +73 -0
  757. package/src/skills/science/references/packages/quantica-jl.md +73 -0
  758. package/src/skills/science/references/packages/quantumoptics-jl.md +73 -0
  759. package/src/skills/science/references/packages/quimb.md +73 -0
  760. package/src/skills/science/references/packages/qulacs.md +73 -0
  761. package/src/skills/science/references/packages/qutip.md +73 -0
  762. package/src/skills/science/references/packages/rdkit.md +88 -0
  763. package/src/skills/science/references/packages/rmg-py.md +73 -0
  764. package/src/skills/science/references/packages/root.md +73 -0
  765. package/src/skills/science/references/packages/scanpy.md +88 -0
  766. package/src/skills/science/references/packages/scikit-allel.md +88 -0
  767. package/src/skills/science/references/packages/scikit-bio.md +88 -0
  768. package/src/skills/science/references/packages/scqubits.md +73 -0
  769. package/src/skills/science/references/packages/scuff-em.md +80 -0
  770. package/src/skills/science/references/packages/scvi-tools.md +73 -0
  771. package/src/skills/science/references/packages/seissol.md +73 -0
  772. package/src/skills/science/references/packages/sfepy.md +80 -0
  773. package/src/skills/science/references/packages/sisl.md +73 -0
  774. package/src/skills/science/references/packages/smilei.md +80 -0
  775. package/src/skills/science/references/packages/snakemake.md +88 -0
  776. package/src/skills/science/references/packages/specfem3d-globe.md +80 -0
  777. package/src/skills/science/references/packages/specutils.md +88 -0
  778. package/src/skills/science/references/packages/spglib.md +80 -0
  779. package/src/skills/science/references/packages/squidpy.md +88 -0
  780. package/src/skills/science/references/packages/starry.md +88 -0
  781. package/src/skills/science/references/packages/strawberryfields.md +73 -0
  782. package/src/skills/science/references/packages/su2.md +80 -0
  783. package/src/skills/science/references/packages/sunny-jl.md +73 -0
  784. package/src/skills/science/references/packages/sw4.md +73 -0
  785. package/src/skills/science/references/packages/swift.md +88 -0
  786. package/src/skills/science/references/packages/tdnegf.md +73 -0
  787. package/src/skills/science/references/packages/tenpy.md +73 -0
  788. package/src/skills/science/references/packages/thermo.md +73 -0
  789. package/src/skills/science/references/packages/tkwant.md +73 -0
  790. package/src/skills/science/references/packages/tvb-root.md +73 -0
  791. package/src/skills/science/references/packages/uproot5.md +73 -0
  792. package/src/skills/science/references/packages/vampire.md +80 -0
  793. package/src/skills/science/references/packages/wannier_tools.md +73 -0
  794. package/src/skills/science/references/packages/warpx.md +80 -0
  795. package/src/skills/science/references/packages/wrf.md +73 -0
  796. package/src/skills/science/references/packages/xtb.md +88 -0
  797. package/src/skills/science/references/packages/yt.md +73 -0
  798. package/src/skills/science/references/science-task-brief-template.md +71 -0
  799. package/src/skills/scout/SKILL.md +83 -425
  800. package/src/skills/scout/references/literature-scout-template.md +5 -24
  801. package/src/skills/scout/references/operational-guidance.md +191 -0
  802. package/src/skills/scout/references/paper-triage-playbook.md +11 -35
  803. package/src/skills/write/SKILL.md +744 -1246
  804. package/src/skills/write/references/experiments_analysis_patterns.md +129 -0
  805. package/src/skills/write/references/oral_package_patterns.md +252 -0
  806. package/src/skills/write/references/oral_writing_principles.md +291 -0
  807. package/src/skills/write/references/section_rewrite_checklist.md +234 -0
  808. package/src/tui/dist/app/AppContainer.js +1314 -27
  809. package/src/tui/dist/components/Composer.js +26 -1
  810. package/src/tui/dist/components/ConfigScreen.js +2 -1
  811. package/src/tui/dist/components/InputPrompt.js +25 -9
  812. package/src/tui/dist/components/MainContent.js +18 -3
  813. package/src/tui/dist/components/QuestScreen.js +3 -2
  814. package/src/tui/dist/components/UtilityScreen.js +37 -0
  815. package/src/tui/dist/hooks/useSafeInput.js +10 -0
  816. package/src/tui/dist/index.js +13 -1
  817. package/src/tui/dist/layouts/DefaultAppLayout.js +11 -8
  818. package/src/tui/dist/lib/api.js +89 -1
  819. package/src/tui/package.json +1 -1
  820. package/src/ui/dist/assets/{AnalysisPlugin-DnSm0GZn.js → AnalysisPlugin-CA94NGmI.js} +1 -1
  821. package/src/ui/dist/assets/CliPlugin-DHBzphZU.js +79 -0
  822. package/src/ui/dist/assets/CodeEditorPlugin-BOFwD2rn.js +2 -0
  823. package/src/ui/dist/assets/{CodeViewerPlugin-itb0tltR.js → CodeViewerPlugin-CqDpgjik.js} +4 -4
  824. package/src/ui/dist/assets/{DocViewerPlugin-DqKkiCI6.js → DocViewerPlugin-UDBgt8-4.js} +3 -3
  825. package/src/ui/dist/assets/GitCommitViewerPlugin-BmHtZ0bZ.js +6 -0
  826. package/src/ui/dist/assets/{GitDiffViewerPlugin-DxL2ezFG.js → GitDiffViewerPlugin-CAxjNorQ.js} +2 -2
  827. package/src/ui/dist/assets/{GitSnapshotViewer-B_RQm1YZ.js → GitSnapshotViewer-CweA6VON.js} +2 -2
  828. package/src/ui/dist/assets/{ImageViewerPlugin-tHqlXY3n.js → ImageViewerPlugin-C8wHGvGN.js} +5 -5
  829. package/src/ui/dist/assets/LabPlugin-COyyLUol.js +32 -0
  830. package/src/ui/dist/assets/{LatexPlugin-B495DTXC.js → LatexPlugin-BQjAaA5J.js} +4 -4
  831. package/src/ui/dist/assets/{MarkdownViewerPlugin-DG28-61B.js → MarkdownViewerPlugin-Dy1NE2dI.js} +3 -3
  832. package/src/ui/dist/assets/{MarketplacePlugin-BiOGT-Kj.js → MarketplacePlugin-DMIZtEJ2.js} +2 -2
  833. package/src/ui/dist/assets/NotebookEditor-CFHMq_Qt.js +91 -0
  834. package/src/ui/dist/assets/{NotebookEditor-CVsj8h_T.js → NotebookEditor-WFyd8Ybt.js} +23 -23
  835. package/src/ui/dist/assets/{PdfLoader-CASDQmxJ.js → PdfLoader-CLE5u5TS.js} +3 -3
  836. package/src/ui/dist/assets/{PdfMarkdownPlugin-BFhwoKsY.js → PdfMarkdownPlugin-_iNK_H83.js} +1 -1
  837. package/src/ui/dist/assets/PdfViewerPlugin-DgWsbInT.js +22 -0
  838. package/src/ui/dist/assets/SearchPlugin-DrZmn5iw.js +11 -0
  839. package/src/ui/dist/assets/{TextViewerPlugin-CB4DYfWO.js → TextViewerPlugin-D1-T3aC7.js} +4 -4
  840. package/src/ui/dist/assets/branding/runner-claude.svg +107 -0
  841. package/src/ui/dist/assets/branding/runner-codex.svg +10 -0
  842. package/src/ui/dist/assets/branding/runner-kimi.svg +14 -0
  843. package/src/ui/dist/assets/branding/runner-opencode.svg +7 -0
  844. package/src/ui/dist/assets/cli-store-CoZ-x5Ip.js +1 -0
  845. package/src/ui/dist/assets/{code-DLC6G24T.js → code-DbsmSd3Y.js} +1 -1
  846. package/src/ui/dist/assets/file-diff-panel-DsvyRz47.js +1 -0
  847. package/src/ui/dist/assets/{wrap-text-CwMn-iqb.js → file-jump-queue-DeQBikaw.js} +3 -3
  848. package/src/ui/dist/assets/{file-socket-Cu4Qln7Y.js → file-socket-DA5XIx88.js} +1 -1
  849. package/src/ui/dist/assets/fonts/ds-fonts.css +50 -4
  850. package/src/ui/dist/assets/images/deepxiv/register-guide.png +0 -0
  851. package/src/ui/dist/assets/index-39vY9LmZ.js +1 -0
  852. package/src/ui/dist/assets/{index-wQ7RIIRd.js → index-BsO46tJA.js} +1 -1
  853. package/src/ui/dist/assets/index-CHzJ2xtB.js +3530 -0
  854. package/src/ui/dist/assets/index-DH-zxoZ3.css +33 -0
  855. package/src/ui/dist/assets/{plugin-notebook-HbW2K-1c.js → plugin-notebook-JRhysCqj.js} +2 -2
  856. package/src/ui/dist/assets/{project-sync-CsX08Qno.js → project-sync-DPmWKmKD.js} +1 -1
  857. package/src/ui/dist/assets/{zoom-out-R-GWEhzS.js → zoom-out-DAukFWen.js} +3 -3
  858. package/src/ui/dist/index.html +3 -3
  859. package/src/skills/analysis-campaign/references/artifact-orchestration.md +0 -58
  860. package/src/skills/baseline/references/memory-playbook.md +0 -40
  861. package/src/skills/baseline/references/publishable-baseline-package.md +0 -30
  862. package/src/skills/write/references/outline-evidence-contract-example.md +0 -107
  863. package/src/skills/write/references/paper-experiment-matrix-template.md +0 -131
  864. package/src/skills/write/references/paper-section-playbook.md +0 -64
  865. package/src/skills/write/references/reviewer-first-writing.md +0 -64
  866. package/src/skills/write/references/revision-checklist.md +0 -70
  867. package/src/skills/write/references/section-contracts.md +0 -82
  868. package/src/skills/write/references/sentence-level-proofing.md +0 -49
  869. package/src/ui/dist/assets/AiManusChatView-COFACy7V.js +0 -204
  870. package/src/ui/dist/assets/CliPlugin-CvwCmDQ5.js +0 -109
  871. package/src/ui/dist/assets/CodeEditorPlugin-cOqSa0xq.js +0 -2
  872. package/src/ui/dist/assets/GitCommitViewerPlugin-DVgNHBCS.js +0 -1
  873. package/src/ui/dist/assets/LabCopilotPanel-ClMbq5Yu.js +0 -14
  874. package/src/ui/dist/assets/LabPlugin-L_SuE8ow.js +0 -22
  875. package/src/ui/dist/assets/NotebookEditor-C-4Kt1p9.js +0 -81
  876. package/src/ui/dist/assets/PdfViewerPlugin-DcOzU9vd.js +0 -17
  877. package/src/ui/dist/assets/SearchPlugin-CHj7M58O.js +0 -16
  878. package/src/ui/dist/assets/VNCViewer-CjlbyCB3.js +0 -11
  879. package/src/ui/dist/assets/bot-CFkZY-JP.js +0 -6
  880. package/src/ui/dist/assets/chevron-up-Dq5ofbht.js +0 -6
  881. package/src/ui/dist/assets/file-content-Dv4LoZec.js +0 -1
  882. package/src/ui/dist/assets/file-diff-panel-Denq-lC3.js +0 -1
  883. package/src/ui/dist/assets/file-jump-queue-DA-SdG__.js +0 -1
  884. package/src/ui/dist/assets/git-commit-horizontal-BUh6G52n.js +0 -6
  885. package/src/ui/dist/assets/image-B9HUUddG.js +0 -6
  886. package/src/ui/dist/assets/index-B2B1sg-M.js +0 -1
  887. package/src/ui/dist/assets/index-Cgla8biy.css +0 -33
  888. package/src/ui/dist/assets/index-DRyx7vAc.js +0 -1
  889. package/src/ui/dist/assets/index-Gbl53BNp.js +0 -2496
  890. package/src/ui/dist/assets/pdf-effect-queue-ZtnHFCAi.js +0 -6
  891. package/src/ui/dist/assets/popover-DL6h35vr.js +0 -1
  892. package/src/ui/dist/assets/select-DvmXt1yY.js +0 -11
  893. package/src/ui/dist/assets/sigma-7jpXazui.js +0 -6
  894. package/src/ui/dist/assets/trash-xA7kFt8i.js +0 -11
  895. package/src/ui/dist/assets/useCliAccess-DsMwDjOp.js +0 -1
  896. package/src/ui/dist/assets/useFileDiffOverlay-FuhcnKiw.js +0 -1
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import json
4
+ import os
4
5
  import re
5
6
  from pathlib import Path
6
7
 
@@ -124,6 +125,7 @@ class PromptBuilder:
124
125
  turn_intent: str | None = None,
125
126
  turn_mode: str | None = None,
126
127
  retry_context: dict | None = None,
128
+ runner_name: str = "codex",
127
129
  ) -> str:
128
130
  snapshot = self.quest_service.snapshot(quest_id)
129
131
  runtime_config = self.config_manager.load_named("config")
@@ -133,57 +135,138 @@ class PromptBuilder:
133
135
  active_anchor = str(snapshot.get("active_anchor") or skill_id)
134
136
  default_locale = str(runtime_config.get("default_locale") or "en-US")
135
137
  workspace_mode = self._workspace_mode(snapshot)
138
+ custom_profile = self._custom_profile(snapshot)
139
+ start_setup_session = self._start_setup_session(snapshot)
136
140
  system_block = self._prompt_fragment(
137
- "system_copilot.md" if workspace_mode == "copilot" else "system.md",
141
+ Path("start_setup") / "system.md"
142
+ if start_setup_session
143
+ else ("system_copilot.md" if workspace_mode == "copilot" else "system.md"),
138
144
  quest_root=quest_root,
139
145
  )
140
146
  shared_interaction_block = self._prompt_fragment(
141
147
  Path("contracts") / "shared_interaction.md",
142
148
  quest_root=quest_root,
143
149
  )
150
+ admin_ops_contract_block = ""
151
+ admin_ops_knowledge_block = ""
152
+ admin_ops_session_block = ""
153
+ settings_issue_session_block = ""
154
+ start_setup_session_block = ""
155
+ if custom_profile == "admin_ops":
156
+ admin_ops_contract_block = self._prompt_fragment(
157
+ Path("contracts") / "admin_ops.md",
158
+ quest_root=quest_root,
159
+ )
160
+ admin_ops_knowledge_block = self._prompt_fragment(
161
+ Path("contracts") / "admin_ops_knowledge.md",
162
+ quest_root=quest_root,
163
+ )
164
+ admin_ops_session_block = self._admin_ops_session_block(snapshot)
165
+ if custom_profile == "settings_issue":
166
+ settings_issue_session_block = self._settings_issue_session_block(snapshot)
167
+ if start_setup_session:
168
+ start_setup_session_block = self._start_setup_session_block(snapshot)
144
169
  connector_contract_block = self._connector_contract_block(quest_id=quest_id, snapshot=snapshot)
170
+ hardware_block = self._local_runtime_hardware_block(runtime_config=runtime_config)
171
+ deepxiv_block = self._deepxiv_capability_block(runtime_config=runtime_config)
172
+ cross_quest_recall_block = self._cross_quest_recall_policy_block(runtime_config)
145
173
  sections = [
146
174
  system_block,
147
175
  "",
148
176
  shared_interaction_block,
149
177
  "",
150
- "## Runtime Context",
151
- f"ds_home: {self.home.resolve()}",
152
- f"quest_id: {quest_id}",
153
- f"quest_root: {quest_root}",
154
- f"research_head_branch: {snapshot.get('research_head_branch') or 'none'}",
155
- f"research_head_worktree_root: {snapshot.get('research_head_worktree_root') or 'none'}",
156
- f"current_workspace_branch: {snapshot.get('current_workspace_branch') or 'none'}",
157
- f"current_workspace_root: {snapshot.get('current_workspace_root') or 'none'}",
158
- f"active_idea_id: {snapshot.get('active_idea_id') or 'none'}",
159
- f"active_analysis_campaign_id: {snapshot.get('active_analysis_campaign_id') or 'none'}",
160
- f"active_anchor: {active_anchor}",
161
- f"active_branch: {snapshot.get('branch')}",
162
- f"requested_skill: {skill_id}",
163
- f"runner_name: codex",
164
- f"model: {model}",
165
- f"conversation_id: quest:{quest_id}",
166
- f"default_locale: {default_locale}",
167
- "built_in_mcp_namespaces: memory, artifact, bash_exec",
168
- "mcp_namespace_note: **any shell-like command execution must use `bash_exec(...)`, including curl/python/bash/node/git/npm/uv and similar CLI tools; do not use native `shell_command` / `command_execution`.**",
169
- "",
170
- "Canonical stage skills root:",
171
- str((self.repo_root / "src" / "skills").resolve()),
172
- "",
173
- "Standard stage skill paths:",
174
- self._skill_paths_block(),
175
- "",
176
- "Companion skill paths:",
177
- self._companion_skill_paths_block(),
178
- "",
179
- "## Active Communication Surface",
180
- self._active_communication_surface_block(
181
- quest_id=quest_id,
182
- snapshot=snapshot,
183
- runtime_config=runtime_config,
184
- connectors_config=connectors_config,
185
- ),
186
178
  ]
179
+ if admin_ops_contract_block:
180
+ sections.extend([admin_ops_contract_block, ""])
181
+ if start_setup_session_block:
182
+ sections.extend(["## Start Setup Session", start_setup_session_block, ""])
183
+ if admin_ops_session_block:
184
+ sections.extend(["## Admin Ops Session Packet", admin_ops_session_block, ""])
185
+ if settings_issue_session_block:
186
+ sections.extend(["## Settings Issue Session Packet", settings_issue_session_block, ""])
187
+ if admin_ops_knowledge_block:
188
+ sections.extend([admin_ops_knowledge_block, ""])
189
+ if custom_profile == "settings_issue":
190
+ built_in_namespaces = "artifact, bash_exec"
191
+ mcp_namespace_note = "mcp_namespace_note: only `artifact.prepare_github_issue(...)` and `bash_exec(...)` are available in this session."
192
+ elif start_setup_session:
193
+ built_in_namespaces = "artifact, bash_exec"
194
+ mcp_namespace_note = "mcp_namespace_note: only `artifact.prepare_start_setup_form(...)` and `bash_exec(...)` are available in this session."
195
+ else:
196
+ built_in_namespaces = "memory, artifact, bash_exec"
197
+ mcp_namespace_note = "mcp_namespace_note: use `bash_exec(...)` for all CLI commands."
198
+ runner_tool_name_note = ""
199
+ normalized_runner_name = str(runner_name or "").strip().lower()
200
+ if normalized_runner_name in {"claude", "kimi", "opencode", "codex"}:
201
+ if custom_profile == "settings_issue":
202
+ runner_tool_name_note = (
203
+ "runner_tool_name_note: this runner may expose MCP tools with names like "
204
+ "`mcp__artifact__prepare_github_issue` and `mcp__bash_exec__bash_exec`; "
205
+ "if the tool picker is namespaced, call those exact `mcp__...` names instead of inventing a bare "
206
+ "`artifact.prepare_github_issue(...)` or `bash_exec(...)` tool name."
207
+ )
208
+ elif start_setup_session:
209
+ runner_tool_name_note = (
210
+ "runner_tool_name_note: this runner may expose MCP tools with names like "
211
+ "`mcp__artifact__prepare_start_setup_form` and `mcp__bash_exec__bash_exec`; "
212
+ "if the tool picker is namespaced, call those exact `mcp__...` names instead of inventing a bare "
213
+ "`artifact.prepare_start_setup_form(...)` or `bash_exec(...)` tool name."
214
+ )
215
+ else:
216
+ runner_tool_name_note = (
217
+ "runner_tool_name_note: this runner may expose MCP tools with names like "
218
+ "`mcp__memory__search`, `mcp__artifact__get_quest_state`, and `mcp__bash_exec__bash_exec`; "
219
+ "if the tool picker is namespaced, call those exact `mcp__...` names instead of inventing a bare "
220
+ "`memory.*`, `artifact.*`, or `bash_exec(...)` tool name."
221
+ )
222
+
223
+ sections.extend(
224
+ [
225
+ "## Runtime Context",
226
+ f"ds_home: {self.home.resolve()}",
227
+ f"quest_id: {quest_id}",
228
+ f"quest_root: {quest_root}",
229
+ f"research_head_branch: {snapshot.get('research_head_branch') or 'none'}",
230
+ f"research_head_worktree_root: {snapshot.get('research_head_worktree_root') or 'none'}",
231
+ f"current_workspace_branch: {snapshot.get('current_workspace_branch') or 'none'}",
232
+ f"current_workspace_root: {snapshot.get('current_workspace_root') or 'none'}",
233
+ f"active_idea_id: {snapshot.get('active_idea_id') or 'none'}",
234
+ f"active_analysis_campaign_id: {snapshot.get('active_analysis_campaign_id') or 'none'}",
235
+ f"active_anchor: {active_anchor}",
236
+ f"active_branch: {snapshot.get('branch')}",
237
+ f"requested_skill: {skill_id}",
238
+ f"runner_name: {runner_name}",
239
+ f"model: {model}",
240
+ f"conversation_id: quest:{quest_id}",
241
+ f"default_locale: {default_locale}",
242
+ f"built_in_mcp_namespaces: {built_in_namespaces}",
243
+ mcp_namespace_note,
244
+ *( [runner_tool_name_note] if runner_tool_name_note else [] ),
245
+ "",
246
+ "Canonical stage skills root:",
247
+ str((self.repo_root / "src" / "skills").resolve()),
248
+ "",
249
+ "Standard stage skill paths:",
250
+ self._skill_paths_block(),
251
+ "",
252
+ "Companion skill paths:",
253
+ self._companion_skill_paths_block(),
254
+ "",
255
+ "## Active Communication Surface",
256
+ self._active_communication_surface_block(
257
+ quest_id=quest_id,
258
+ snapshot=snapshot,
259
+ runtime_config=runtime_config,
260
+ connectors_config=connectors_config,
261
+ ),
262
+ ]
263
+ )
264
+ if cross_quest_recall_block:
265
+ sections.extend(["", "## Cross-Quest Recall Policy", cross_quest_recall_block])
266
+ if hardware_block:
267
+ sections.extend(["", "## Local Runtime Hardware", hardware_block])
268
+ if deepxiv_block:
269
+ sections.extend(["", "## DeepXiv Capability", deepxiv_block])
187
270
  if connector_contract_block:
188
271
  sections.extend(
189
272
  [
@@ -255,7 +338,7 @@ class PromptBuilder:
255
338
  ),
256
339
  "",
257
340
  "## Recent Conversation Window",
258
- self._conversation_block(quest_id),
341
+ self._special_conversation_block(snapshot, quest_id=quest_id),
259
342
  "",
260
343
  "## Current Turn Attachments",
261
344
  self._current_turn_attachments_block(
@@ -295,6 +378,13 @@ class PromptBuilder:
295
378
  "- handle the newest runtime-delivered user requirements first, then continue the main quest route",
296
379
  ]
297
380
  )
381
+ elif normalized_reason == "immediate_read":
382
+ lines.extend(
383
+ [
384
+ "- this turn was explicitly restarted because the user clicked immediate read for queued user messages",
385
+ "- the attached user_message already contains the runtime-prepared queued-message bundle; treat it as freshly delivered and handle it before resuming other work",
386
+ ]
387
+ )
298
388
  else:
299
389
  preview = " ".join(str(user_message or "").split())
300
390
  if len(preview) > 220:
@@ -310,6 +400,12 @@ class PromptBuilder:
310
400
  lines.append(
311
401
  "- direct_answer_tool_rule: if the question is about overall progress, paper readiness, current best result, or next step, call artifact.get_global_status(detail='brief'|'full', locale='zh'|'en') before answering from memory or local stage context."
312
402
  )
403
+ lines.append(
404
+ "- node_progress_tool_rule: if the question is about the active node, research head, canvas-like global progress, branch switching, or which durable line is currently live, call artifact.get_research_map_status(detail='summary'|'full', locale='zh'|'en') before answering."
405
+ )
406
+ lines.append(
407
+ "- node_progress_dedupe_rule: if research_map_status shows the same current node, research head, and blocker/route state as the last judgment, do not loop on more map reads or branch-switch chatter; continue the current action."
408
+ )
313
409
  elif resolved_turn_intent == "execute_user_command_first":
314
410
  lines.append(
315
411
  "- command_first_rule: the user primarily gave a concrete instruction. Execute or acknowledge that instruction first before resuming background stage narration."
@@ -426,6 +522,34 @@ class PromptBuilder:
426
522
  return None
427
523
  return connector
428
524
 
525
+ def _deepxiv_capability_block(self, *, runtime_config: dict) -> str:
526
+ literature = runtime_config.get("literature") if isinstance(runtime_config.get("literature"), dict) else {}
527
+ deepxiv = literature.get("deepxiv") if isinstance(literature.get("deepxiv"), dict) else {}
528
+ enabled = bool(deepxiv.get("enabled"))
529
+ direct_token = str(deepxiv.get("token") or "").strip()
530
+ token_env_name = str(deepxiv.get("token_env") or "").strip()
531
+ env_token = str(os.environ.get(token_env_name) or "").strip() if token_env_name else ""
532
+ configured = enabled and bool(direct_token or env_token)
533
+ lines = [
534
+ f"- deepxiv_available: {configured}",
535
+ f"- deepxiv_enabled: {enabled}",
536
+ f"- deepxiv_base_url: {str(deepxiv.get('base_url') or 'https://data.rag.ac.cn').strip() or 'https://data.rag.ac.cn'}",
537
+ f"- deepxiv_default_result_size: {int(deepxiv.get('default_result_size') or 10)}",
538
+ f"- deepxiv_preview_characters: {int(deepxiv.get('preview_characters') or 1200)}",
539
+ ]
540
+ if configured:
541
+ lines.extend([
542
+ "- deepxiv_rule: DeepXiv is configured in this runtime. For paper-centric literature discovery and shortlist paper triage, prefer the DeepXiv route before broad open-web search when it can answer the question more directly.",
543
+ "- deepxiv_preferred_path: use `artifact.deepxiv(...)` for paper retrieval and structured DeepXiv reads when that tool is available in this runtime.",
544
+ "- deepxiv_fallback_rule: if the runtime does not expose a DeepXiv tool, or if DeepXiv is insufficient for the needed paper detail, fall back to the legacy route: memory reuse, web discovery, and `artifact.arxiv(...)`."
545
+ ])
546
+ else:
547
+ lines.extend([
548
+ "- deepxiv_forbidden_rule: DeepXiv is not configured in this runtime. Do not rely on DeepXiv or assume its token exists.",
549
+ "- deepxiv_required_fallback: use the legacy route only: memory reuse, web discovery, and `artifact.arxiv(...)`."
550
+ ])
551
+ return "\n".join(lines)
552
+
429
553
  def _connector_contract_block(self, *, quest_id: str, snapshot: dict) -> str:
430
554
  connector = self._active_external_connector_name(quest_id=quest_id, snapshot=snapshot)
431
555
  if connector is None:
@@ -436,6 +560,188 @@ class PromptBuilder:
436
560
  return ""
437
561
  return self._markdown_body(path)
438
562
 
563
+ def _local_runtime_hardware_block(self, *, runtime_config: dict) -> str:
564
+ hardware = runtime_config.get("hardware") if isinstance(runtime_config.get("hardware"), dict) else {}
565
+ selection_mode = str(hardware.get("gpu_selection_mode") or "all").strip().lower() or "all"
566
+ if selection_mode not in {"all", "selected"}:
567
+ selection_mode = "all"
568
+ selected_gpu_ids = [str(item).strip() for item in (hardware.get("selected_gpu_ids") or []) if str(item).strip()]
569
+ include_summary = bool(hardware.get("include_system_hardware_in_prompt", True))
570
+ cache = read_json(self.home / "runtime" / "admin" / "cache" / "system_hardware.json", {})
571
+ preferences = cache.get("preferences") if isinstance(cache.get("preferences"), dict) else {}
572
+ system = cache.get("system") if isinstance(cache.get("system"), dict) else {}
573
+ effective_gpu_ids = [
574
+ str(item).strip()
575
+ for item in (
576
+ preferences.get("effective_gpu_ids")
577
+ if isinstance(preferences.get("effective_gpu_ids"), list)
578
+ else selected_gpu_ids
579
+ )
580
+ if str(item).strip()
581
+ ]
582
+ if selection_mode == "all" and not include_summary:
583
+ return ""
584
+ lines = [
585
+ "- hardware_scope_rule: treat the configured local hardware summary and selected GPUs as an operator-provided device boundary for local compute rather than as optional flavor text.",
586
+ f"- gpu_selection_mode: {selection_mode}",
587
+ f"- selected_gpu_ids: {', '.join(selected_gpu_ids) if selected_gpu_ids else ('all' if selection_mode == 'all' else 'none')}",
588
+ f"- effective_gpu_ids: {', '.join(effective_gpu_ids) if effective_gpu_ids else ('none' if selection_mode == 'selected' else 'all-detected-or-unset')}",
589
+ f"- cuda_visible_devices_hint: {str(preferences.get('cuda_visible_devices') or '').strip() or ('unset' if selection_mode == 'all' else 'none')}",
590
+ ]
591
+ if selection_mode == "selected":
592
+ if effective_gpu_ids:
593
+ lines.append("- gpu_boundary_rule: when launching local GPU workloads, stay within the selected GPU ids instead of assuming every detected GPU is available.")
594
+ else:
595
+ lines.append("- gpu_boundary_rule: no GPU is currently selected; treat local GPU workloads as unavailable unless the operator changes Admin hardware selection.")
596
+ if not include_summary:
597
+ lines.append("- hardware_summary_visibility: disabled by config; use the GPU boundary above but do not rely on a fuller hardware summary.")
598
+ return "\n".join(lines)
599
+ cpu = system.get("cpu") if isinstance(system.get("cpu"), dict) else {}
600
+ memory = system.get("memory") if isinstance(system.get("memory"), dict) else {}
601
+ disks = system.get("disks") if isinstance(system.get("disks"), list) else []
602
+ gpus = system.get("gpus") if isinstance(system.get("gpus"), list) else []
603
+ cpu_model = str(cpu.get("model") or "unknown cpu").strip()
604
+ logical_cores = str(cpu.get("logical_cores") or "unknown").strip()
605
+ memory_total_gb = str(memory.get("total_gb") or "unknown").strip()
606
+ disk_free = "unknown"
607
+ if disks and isinstance(disks[0], dict):
608
+ disk_free = f"{disks[0].get('free_gb') or 'unknown'}GB free on {disks[0].get('mount') or '/'}"
609
+ lines.extend(
610
+ [
611
+ f"- cpu_summary: {cpu_model} | logical_cores={logical_cores}",
612
+ f"- memory_total_gb: {memory_total_gb}",
613
+ f"- root_disk_summary: {disk_free}",
614
+ ]
615
+ )
616
+ if gpus:
617
+ gpu_parts = []
618
+ for item in gpus[:8]:
619
+ if not isinstance(item, dict):
620
+ continue
621
+ gpu_id = str(item.get("gpu_id") or "").strip() or "?"
622
+ name = str(item.get("name") or "GPU").strip()
623
+ memory_total = item.get("memory_total_gb")
624
+ gpu_parts.append(f"{gpu_id}:{name}{f' {memory_total}GB' if memory_total is not None else ''}")
625
+ lines.append(f"- gpu_inventory: {'; '.join(gpu_parts) or 'none'}")
626
+ else:
627
+ lines.append("- gpu_inventory: none detected")
628
+ return "\n".join(lines)
629
+
630
+ def _local_daemon_api_block(self, *, include_benchstore: bool = False, include_admin: bool = False) -> str:
631
+ runtime_config = self.config_manager.load_named("config")
632
+ ui_config = runtime_config.get("ui") if isinstance(runtime_config.get("ui"), dict) else {}
633
+ host = str(ui_config.get("host") or "0.0.0.0").strip() or "0.0.0.0"
634
+ raw_port = ui_config.get("port")
635
+ try:
636
+ port = int(raw_port)
637
+ except (TypeError, ValueError):
638
+ port = 20999
639
+ daemon_state = read_json(self.home / "runtime" / "daemon.json", {})
640
+ daemon_url = str((daemon_state.get("url") if isinstance(daemon_state, dict) else "") or "").strip()
641
+ bind_url = str((daemon_state.get("bind_url") if isinstance(daemon_state, dict) else "") or "").strip()
642
+ if not daemon_url:
643
+ normalized_host = "127.0.0.1" if host in {"0.0.0.0", "::", "[::]", ""} else host
644
+ rendered_host = normalized_host if ":" not in normalized_host or normalized_host.startswith("[") else f"[{normalized_host}]"
645
+ daemon_url = f"http://{rendered_host}:{port}"
646
+ if not bind_url:
647
+ bind_url = f"http://{host}:{port}"
648
+ auth_enabled = bool((daemon_state.get("auth_enabled") if isinstance(daemon_state, dict) else False))
649
+ auth_token = str((daemon_state.get("auth_token") if isinstance(daemon_state, dict) else "") or "").strip() or None
650
+
651
+ lines = [
652
+ f"- local_daemon_api_base_url: {daemon_url}",
653
+ f"- local_daemon_bind_url: {bind_url}",
654
+ f"- local_daemon_auth_enabled: {auth_enabled}",
655
+ f"- local_daemon_auth_token: {auth_token or 'none'}",
656
+ "- local_daemon_api_call_rule: if you need direct daemon API state beyond the MCP surface, use `bash_exec(...)` to call the local daemon over HTTP.",
657
+ "- local_daemon_api_auth_rule: when `local_daemon_auth_enabled` is true, include header `Authorization: Bearer <local_daemon_auth_token>` in those HTTP calls.",
658
+ "- local_daemon_api_health_endpoint: GET /api/health",
659
+ ]
660
+ if include_benchstore:
661
+ lines.extend(
662
+ [
663
+ "- local_daemon_api_benchstore_endpoints:",
664
+ " - GET /api/benchstore/entries",
665
+ " - GET /api/benchstore/entries/:entry_id",
666
+ " - GET /api/benchstore/entries/:entry_id/setup-packet",
667
+ " - POST /api/benchstore/entries/:entry_id/install",
668
+ " - POST /api/benchstore/entries/:entry_id/launch",
669
+ ]
670
+ )
671
+ if include_admin:
672
+ lines.extend(
673
+ [
674
+ "- local_daemon_api_admin_endpoints:",
675
+ " - GET /api/system/overview",
676
+ " - GET /api/system/hardware",
677
+ " - GET /api/system/logs/sources",
678
+ " - GET /api/system/logs/tail?source=<source>&line_count=<n>",
679
+ " - GET /api/system/quests",
680
+ " - GET /api/system/quests/:quest_id/summary",
681
+ " - GET /api/system/repairs",
682
+ " - POST /api/system/repairs",
683
+ " - GET /api/system/tasks",
684
+ " - GET /api/system/tasks/:task_id",
685
+ ]
686
+ )
687
+ return "\n".join(lines)
688
+
689
+ def _admin_ops_session_block(self, snapshot: dict) -> str:
690
+ startup_contract = snapshot.get("startup_contract")
691
+ if not isinstance(startup_contract, dict):
692
+ return "- none"
693
+ admin_session = startup_contract.get("admin_session")
694
+ if not isinstance(admin_session, dict):
695
+ return "- none"
696
+
697
+ repair_id = str(admin_session.get("repair_id") or "none").strip() or "none"
698
+ scope = str(admin_session.get("scope") or "system").strip() or "system"
699
+ repair_policy = str(admin_session.get("repair_policy") or "diagnose_only").strip() or "diagnose_only"
700
+ source_page = str(admin_session.get("source_page") or "/admin").strip() or "/admin"
701
+ targets = admin_session.get("targets")
702
+ selected_paths = [str(item).strip() for item in (admin_session.get("selected_paths") or []) if str(item).strip()]
703
+ knowledge_refs = [str(item).strip() for item in (admin_session.get("knowledge_refs") or []) if str(item).strip()]
704
+
705
+ lines = [
706
+ f"- repair_id: {repair_id}",
707
+ f"- scope: {scope}",
708
+ f"- repair_policy: {repair_policy}",
709
+ f"- source_page: {source_page}",
710
+ f"- local_repo_root: {self.repo_root.resolve()}",
711
+ self._local_daemon_api_block(include_admin=True),
712
+ f"- launcher_entry: {(self.repo_root / 'bin' / 'ds.js').resolve()}",
713
+ f"- python_runtime_root: {(self.repo_root / 'src' / 'deepscientist').resolve()}",
714
+ f"- web_ui_root: {(self.repo_root / 'src' / 'ui').resolve()}",
715
+ f"- tui_root: {(self.repo_root / 'src' / 'tui').resolve()}",
716
+ "- install_path_rule: treat the paths above as the active local checkout / install roots for this admin session unless fresh evidence proves a different deployed copy is in use.",
717
+ "- github_origin: https://github.com/ResearAI/DeepScientist",
718
+ ]
719
+ if isinstance(targets, dict) and targets:
720
+ lines.extend(
721
+ [
722
+ "- targets_json:",
723
+ "```json",
724
+ json.dumps(targets, ensure_ascii=False, indent=2),
725
+ "```",
726
+ ]
727
+ )
728
+ else:
729
+ lines.append("- targets_json: {}")
730
+ if selected_paths:
731
+ lines.append("- selected_paths:")
732
+ lines.extend([f" - {item}" for item in selected_paths[:20]])
733
+ else:
734
+ lines.append("- selected_paths: none")
735
+ lines.append("- source_address_rule: when proposing or applying source changes, always cite exact repo-relative file paths; when useful, also cite the absolute path anchored at `local_repo_root`.")
736
+ lines.append("- selected_paths_rule: treat `selected_paths` as the first-priority source scope for SEARCH / REPRO / PATCH / VERIFY whenever it is non-empty.")
737
+ lines.append("- command_forms_available: INSPECT, LOGS, SEARCH, REPRO, PATCH, VERIFY, ISSUE, PR")
738
+ if knowledge_refs:
739
+ lines.append("- recommended_knowledge_refs:")
740
+ lines.extend([f" - {item}" for item in knowledge_refs[:24]])
741
+ else:
742
+ lines.append("- recommended_knowledge_refs: none")
743
+ return "\n".join(lines)
744
+
439
745
  def _active_user_requirements_block(self, quest_root: Path) -> str:
440
746
  path = self.quest_service._active_user_requirements_path(quest_root)
441
747
  if not path.exists():
@@ -443,14 +749,14 @@ class PromptBuilder:
443
749
  text = read_text(path).strip()
444
750
  if not text:
445
751
  return "- none"
446
- return "\n".join(
447
- [
448
- f"- path: {path}",
449
- "- rule: treat this file as the highest-priority durable summary of the user's current requirements and constraints",
450
- "",
451
- text,
452
- ]
453
- )
752
+ lines = [
753
+ f"- path: {path}",
754
+ "- rule: treat this file as the highest-priority durable summary of the user's current requirements and constraints",
755
+ "- manuscript_boundary_rule: user requirements are planning constraints and acceptance criteria, not paper-ready source text",
756
+ "- manuscript_transduction_rule: when writing papers, convert only scientifically relevant requirements into neutral protocol language and keep operator/user/restart/provenance wording out of manuscript prose",
757
+ ]
758
+ lines.extend(["", text])
759
+ return "\n".join(lines)
454
760
 
455
761
  def _continuation_guard_block(
456
762
  self,
@@ -496,16 +802,15 @@ class PromptBuilder:
496
802
  lines.extend(
497
803
  [
498
804
  f"- active_bash_run_count: {bash_running_count}",
499
- "- long_run_watchdog_rule: while an important long-running bash_exec session is active, never let more than 30 minutes pass without inspecting real logs/status and sending a concise artifact.interact progress update if the run is still ongoing",
805
+ "- long_run_watchdog_rule: while an important long-running bash_exec session is active, inspect real logs/status periodically instead of parking or busy-looping",
500
806
  ]
501
807
  )
502
808
  if str(turn_reason or "").strip() == "auto_continue":
503
809
  lines.extend(
504
810
  [
505
- "- auto_continue_rule: this turn has no new user message; continue from the active requirements, durable artifacts, current quest state, and resume context spine instead of replaying the previous user message",
506
- f"- auto_continue_interval_rule: when a real long-running external task is already active, background-progress auto-continue becomes a low-frequency monitoring pass, about every {_AUTO_CONTINUE_MONITOR_INTERVAL_SECONDS} seconds rather than sub-minute polling",
507
- "- auto_continue_fast_prepare_rule: in autonomous mode before a real external long-running task exists, auto-continue may advance quickly, around 0.2 seconds between turns, so the agent can keep preparing or launching the real work without idling",
508
- "- autonomous_prepare_rule: in autonomous mode, if no real long-running external task is active yet, use the next turns to keep preparing, launching, or durably deciding the next real unit of work instead of parking idly",
811
+ "- auto_continue_rule: this turn has no new user message; continue from the active requirements, durable artifacts, current quest state, current workspace checklist/plan state, and resume context spine instead of replaying the previous user message",
812
+ f"- auto_continue_interval_rule: when a real long-running external task is already active, background-progress auto-continue becomes a low-frequency monitoring pass, about every {_AUTO_CONTINUE_MONITOR_INTERVAL_SECONDS} seconds rather than rapid polling",
813
+ "- autonomous_prepare_rule: in autonomous mode, if no real long-running external task is active yet, use the next turns to prepare, launch, or durably close the next real unit of work instead of parking idly",
509
814
  "- copilot_park_rule: in copilot mode, once the current requested unit is complete, it is normal to park and wait for the next user message or `/resume` instead of continuing autonomously",
510
815
  ]
511
816
  )
@@ -568,7 +873,7 @@ class PromptBuilder:
568
873
  if active_idea_id and active_anchor in {"experiment", "analysis-campaign", "write", "finalize"}:
569
874
  return f"Continue the `{active_anchor}` stage on the current idea `{active_idea_id}` from the latest durable evidence."
570
875
  if active_anchor == "baseline":
571
- return "Continue baseline establishment, verification, or reuse until the baseline gate is durably resolved."
876
+ return "Continue baseline only until one comparator is durably trustworthy enough for the next scientific step, then leave baseline immediately."
572
877
  if active_anchor == "idea":
573
878
  return (
574
879
  "Continue idea analysis and route selection until the next durable idea branch is submitted "
@@ -618,17 +923,20 @@ class PromptBuilder:
618
923
  f"- attachment_count: {len(attachments)}",
619
924
  "- attachment_handling_rule: prefer readable sidecars such as extracted text, OCR text, or archive manifests when they exist; use raw binaries only when the readable sidecar is insufficient.",
620
925
  "- attachment_handling_rule_2: if the attachment belongs to a prior idea or experiment line, treat it as reference material rather than the active contract unless durable evidence promotes it.",
926
+ "- attachment_handling_rule_3: do not assume raw image/video/audio binaries can be injected directly into the runner prompt; when no readable sidecar exists, treat the binary as non-inline reference material.",
621
927
  ]
622
928
  for index, item in enumerate(attachments[:6], start=1):
623
929
  preferred_read_path = (
624
- str(item.get("extracted_text_path") or item.get("ocr_text_path") or item.get("archive_manifest_path") or item.get("path") or "").strip()
930
+ str(item.get("extracted_text_path") or item.get("ocr_text_path") or item.get("archive_manifest_path") or "").strip()
625
931
  or "none"
626
932
  )
627
933
  label = str(item.get("name") or item.get("file_name") or item.get("path") or item.get("url") or f"attachment-{index}").strip()
628
934
  kind = str(item.get("kind") or "attachment").strip()
629
935
  content_type = str(item.get("content_type") or item.get("mime_type") or "unknown").strip()
936
+ binary_path = str(item.get("path") or "").strip() or "none"
937
+ binary_hidden = preferred_read_path == "none" and binary_path != "none"
630
938
  lines.append(
631
- f"- attachment_{index}: label={label} | kind={kind} | content_type={content_type} | preferred_read_path={preferred_read_path}"
939
+ f"- attachment_{index}: label={label} | kind={kind} | content_type={content_type} | preferred_read_path={preferred_read_path} | raw_binary_path={'hidden' if binary_hidden else binary_path}"
632
940
  )
633
941
  if len(attachments) > 6:
634
942
  lines.append(f"- remaining_attachment_count: {len(attachments) - 6}")
@@ -638,7 +946,7 @@ class PromptBuilder:
638
946
  if str(turn_reason or "").strip() != "auto_continue":
639
947
  return "- none"
640
948
  lines = [
641
- "- resume_spine_rule: on auto_continue turns, first continue from the latest durable user requirement, the latest assistant checkpoint, the latest run summary, and recent memory cues instead of reconstructing intent from scratch",
949
+ "- resume_spine_rule: on auto_continue turns, first continue from the latest durable user requirement, the latest assistant checkpoint, the latest run summary, the current workspace checklist/plan state, and recent memory cues instead of reconstructing intent from scratch",
642
950
  ]
643
951
  bash_running_count = int(((snapshot.get("counts") or {}).get("bash_running_count")) or 0)
644
952
  latest_bash_session = (
@@ -689,6 +997,8 @@ class PromptBuilder:
689
997
  f"exit_code={latest_run.get('exit_code') if latest_run.get('exit_code') is not None else 'none'} | "
690
998
  f"preview={preview or 'none'}"
691
999
  )
1000
+ lines.append("- workspace_checklist_rule: before changing route on auto_continue turns, reopen current workspace `CHECKLIST.md` / `REPRO_CHECKLIST.md` and continue from the latest completed and in-progress items.")
1001
+ lines.append("- workspace_plan_rule: if checklist state is ambiguous, reopen current workspace `PLAN.md` / `analysis_plan.md` before changing direction.")
692
1002
  recent_memory = self.memory_service.list_recent(scope="quest", quest_root=quest_root, limit=3)
693
1003
  if recent_memory:
694
1004
  lines.append("- recent_memory_cues:")
@@ -936,10 +1246,154 @@ class PromptBuilder:
936
1246
  startup_contract = snapshot.get("startup_contract")
937
1247
  if isinstance(startup_contract, dict):
938
1248
  value = str(startup_contract.get("custom_profile") or "").strip().lower()
939
- if value in {"continue_existing_state", "review_audit", "revision_rebuttal", "freeform"}:
1249
+ if value in {"continue_existing_state", "review_audit", "revision_rebuttal", "admin_ops", "settings_issue", "freeform"}:
940
1250
  return value
941
1251
  return "freeform"
942
1252
 
1253
+ @staticmethod
1254
+ def _start_setup_session(snapshot: dict) -> dict[str, Any] | None:
1255
+ startup_contract = snapshot.get("startup_contract")
1256
+ if not isinstance(startup_contract, dict):
1257
+ return None
1258
+ payload = startup_contract.get("start_setup_session")
1259
+ if isinstance(payload, dict):
1260
+ return dict(payload)
1261
+ return None
1262
+
1263
+ def _start_setup_session_block(self, snapshot: dict) -> str:
1264
+ payload = self._start_setup_session(snapshot) or {}
1265
+ locale = str(payload.get("locale") or "zh").strip().lower() or "zh"
1266
+ source = str(payload.get("source") or "manual").strip() or "manual"
1267
+ benchmark_context = payload.get("benchmark_context") if isinstance(payload.get("benchmark_context"), dict) else {}
1268
+ suggested_form = payload.get("suggested_form") if isinstance(payload.get("suggested_form"), dict) else {}
1269
+ lines = [
1270
+ f"- session_kind: autonomous_start_setup",
1271
+ f"- source: {source}",
1272
+ f"- preferred_language: {locale}",
1273
+ "- reply_language_rule: answer in the user's own language when it is clear from their latest message or the preferred language injected into this session.",
1274
+ self._local_daemon_api_block(include_benchstore=True),
1275
+ "- mission: help the user complete the autonomous start form and stop there; do not begin the real research workflow",
1276
+ "- context_first_rule: before asking the user for missing information, first read the current setup state and use the information already present in the form or benchmark context",
1277
+ "- start_setup_prepare_tool_rule: when you want to update the left-side form, prefer `artifact.prepare_start_setup_form(form_patch={...})` so the browser can patch the form automatically",
1278
+ "- start_setup_prepare_signature_rule: use `form_patch={...}` when the launch form itself changes, `session_patch={...}` when fit judgment or preview-plan state changes, and make sure at least one of them is non-empty; do not hide patch JSON inside `message`.",
1279
+ "- start_setup_session_patch_rule: when you learn or revise launch-fit judgment, missing confirmations, or the launch preview plan, write them back through the optional `session_patch={...}` argument on `artifact.prepare_start_setup_form(...)` so the browser can show them durably.",
1280
+ "- start_setup_session_shape_rule: keep `fit_assessment`, `preview_plan.markdown`, phases/risks, `copilot_handoff`, `science_task`, `science_task_brief`, and `science_package_cards` under `session_patch` when they become clear.",
1281
+ "- start_setup_tool_discovery_rule: before claiming the form writeback tool is unavailable, first try the runner-exposed tool name if it is shown (for example `mcp__artifact__prepare_start_setup_form`).",
1282
+ "- start_setup_context_rule: the current suggested form and benchmark context are already injected into this prompt; do not assume `memory.*` or other `artifact.*` helpers are available here",
1283
+ "- mode_fit_rule: explicitly judge whether the task is a good fit for autonomous mode, a provisional fit that still needs key confirmations, or should instead move to copilot / collaboration mode.",
1284
+ "- copilot_recommendation_rule: recommend copilot mode when the work cannot mainly run inside the computer system for long horizons, depends heavily on repeated human judgment, or is not primarily a method-optimization research loop.",
1285
+ "- copilot_handoff_rule: for ordinary/bounded Copilot routing, write `session_patch.copilot_handoff` with title, complete `startup_message`, `workspace_mode='copilot'`, `create_and_send=true`, and reason.",
1286
+ "- science_startup_rule: for natural science/engineering work, add `session_patch.science_task` and optionally `science_task_brief`; use the unified `science` skill catalog and FermiLink-style goal headings as a brief format, not as a required `goal.md` file.",
1287
+ "- science_package_card_rule: put known `science/references/packages/<package_id>.md` paths in `science_package_cards`; cards do not prove solver installation.",
1288
+ "- science_solver_rule: a science skill or knowledge pack does not prove the solver is installed; mark availability unknown unless import/executable/version/smoke-test evidence is explicit.",
1289
+ "- preview_plan_rule: before you treat the setup as complete, submit a structured Markdown launch preview plan through `session_patch.preview_plan`; do not print that plan in the normal visible reply.",
1290
+ "- preview_plan_template_rule: when enough information exists, structure the plan like a Deep Research plan: conclusion and mode recommendation, key questions the main agent should verify, materials/sources table, future execution steps, risks/confirmations, and conditions that should switch the user to copilot mode.",
1291
+ "- preview_plan_reviewability_rule: keep the Markdown preview compact enough for the user to review before launch; it is a confirmation artifact, not a hidden scheduler trace.",
1292
+ "- no_self_execution_rule: the preview plan is explanatory only. Do not start baseline work, experiments, analysis campaigns, or paper drafting from this setup session.",
1293
+ "- research_mainline_rule: when the user wants a real research project rather than a baseline-only task, the launch form should make the mainline explicit: baseline is only the starting point, then autonomous optimization and repeated performance improvement, then robust surpassing of strong baselines / SoTA with novelty, then analysis experiments, then literature / figures / paper-writing collaboration.",
1294
+ "- baseline_not_endpoint_rule: do not frame the mission as 'reproduce a baseline and stop' unless the user explicitly wants a baseline-only task.",
1295
+ "- novelty_confirmation_rule: if the user expects paper-level research or method contribution, explicitly confirm that the goal is not only to beat the baseline but to do so with a sufficiently novel and defensible method direction.",
1296
+ "- sequencing_confirmation_rule: if the long-term plan is still unclear, ask the user to confirm the intended sequence among baseline, optimization beyond SoTA, analysis experiments, and later literature / figure / writing work.",
1297
+ "- benchmark_context_source_rule: if `benchmark_context.raw_payload` exists, treat it as the full benchmark description file for this setup session rather than relying only on the shorter summary fields.",
1298
+ "- start_setup_context_injection_rule: the current setup session state is injected below by the system; use it as hidden planning context and never ask the user to paste or repeat this context.",
1299
+ "- start_setup_user_message_rule: treat the latest user message as the user's literal text only. Do not expect hidden planning XML or JSON to be embedded in the user message.",
1300
+ "- aisb_selection_rule: when the user asks you to choose or recommend a task, prefer the existing AISB / BenchStore catalog first instead of asking the user to invent a task from scratch.",
1301
+ "- aisb_selection_path: use `bash_exec(...)` against the injected local daemon BenchStore endpoints to inspect current catalog entries, then recommend the best fit based on both the user's stated needs and the current device boundary.",
1302
+ "- aisb_selection_truncation_rule: if you inspect BenchStore output through `head`, `tail`, `sed -n`, or another clipped shell window, explicitly treat it as truncated / partial output and never infer the global entry count from that preview alone.",
1303
+ "- aisb_selection_count_rule: before claiming how many BenchStore entries exist, read an explicit count such as `total`, `count`, or `items | length` from the daemon API result.",
1304
+ "- aisb_selection_output_rule: when multiple AISB candidates fit, summarize the top 1 to 3 options briefly, recommend one first, and then patch the form toward that recommendation.",
1305
+ "- performance_fit_rule: combine the user's requested task shape with the current machine boundary; if the machine is weak, prefer API-only, low-compute, short-cycle, and benchmark-faithful routes.",
1306
+ "- output_rule: do not emit fenced `start_setup_patch` or JSON patch blocks in the visible reply. If the prepare tool is unavailable, ask a short plain-language question or say the setup tool is temporarily unavailable instead of printing structured data.",
1307
+ "- tool_submission_rule: submit structured form/session data through `artifact.prepare_start_setup_form(...)`; never put JSON patches or structured drafts in the visible assistant message.",
1308
+ "- start_setup_prepare_schema_summary:",
1309
+ "```json",
1310
+ json.dumps(
1311
+ {
1312
+ "tool": "prepare_start_setup_form",
1313
+ "runner_namespaced_tool": "mcp__artifact__prepare_start_setup_form",
1314
+ "input_schema": {
1315
+ "type": "object",
1316
+ "properties": {
1317
+ "form_patch": {
1318
+ "type": "object",
1319
+ "description": "Optional top-level form patch containing only the launch-form fields that should change.",
1320
+ },
1321
+ "session_patch": {
1322
+ "type": "object",
1323
+ "description": "Optional durable setup-session metadata such as fit assessment, recommended workspace mode, missing confirmations, preview plan, and materials summary.",
1324
+ },
1325
+ "message": {
1326
+ "type": "string",
1327
+ "description": "Optional short user-facing note.",
1328
+ },
1329
+ "comment": {
1330
+ "type": ["string", "object", "null"],
1331
+ "description": "Optional internal note.",
1332
+ },
1333
+ },
1334
+ },
1335
+ },
1336
+ ensure_ascii=False,
1337
+ indent=2,
1338
+ ),
1339
+ "```",
1340
+ "- patch_rule: keep the patch small; only include fields that truly need to change, and do not emit an empty `form_patch` + empty `session_patch` pair",
1341
+ "- session_patch_fields_rule: persist clear setup state in `fit_assessment`, mode/readiness, confirmations, `preview_plan`, materials, `copilot_handoff`, and science fields.",
1342
+ "- no_black_talk_rule: use natural user-facing language and avoid internal words like route, taxonomy, stage, slice, trace, checkpoint, or contract unless the user explicitly asks for them",
1343
+ "- no_research_execution_rule: do not start baseline work, experiments, analysis campaigns, or paper drafting in this setup session",
1344
+ "- user_choice_rule: if the user already filled the form clearly enough, say so and avoid unnecessary follow-up questions",
1345
+ "- ask_rule: only ask short questions when a missing answer would materially change what gets submitted",
1346
+ "- mandatory_confirmation_rule: do not guess critical operator-controlled resources. If GPU scope, GPU count, explicit GPU ids, external LLM/API usage, API keys, tokens, paid-call permission, large-download permission, or privacy boundaries would change the launch plan, you must ask the user to confirm them before treating the form as launch-ready.",
1347
+ "- credential_confirmation_rule: if the task or benchmark would rely on an external API key, token, or account and that credential is not already explicitly available in context, proactively ask the user whether they want to provide it or switch to a different route.",
1348
+ "- gpu_confirmation_rule: do not assume every detected GPU is available. If the allowed GPU scope is unclear and local GPU usage matters, ask the user how many GPUs or which GPU ids may be used.",
1349
+ "- gated_patch_rule: if critical resource confirmations are still missing, patch only safe partial fields through the tool, set `launch_readiness=needs_confirmation`, and ask questions only; do not show a provisional draft in prose.",
1350
+ "- question_categories: when user input is incomplete, ask at most for these practical categories: task goal, current materials, runtime limits, whether they prefer paper-facing delivery or result-first delivery, and whether the real target is baseline-only or iterative performance improvement beyond SoTA with novelty.",
1351
+ "- field_mapping_rule: treat title as a short project name, goal as the real mission, baseline_urls as baseline/code/data inputs, paper_urls as paper or benchmark references, runtime_constraints as hard limits, objectives as the first 2-4 near-term outcomes, and custom_brief as extra preferences",
1352
+ ]
1353
+ if benchmark_context:
1354
+ lines.extend(
1355
+ [
1356
+ "- benchmark_context_json:",
1357
+ "```json",
1358
+ json.dumps(benchmark_context, ensure_ascii=False, indent=2),
1359
+ "```",
1360
+ ]
1361
+ )
1362
+ else:
1363
+ lines.append("- benchmark_context_json: {}")
1364
+ if suggested_form:
1365
+ lines.extend(
1366
+ [
1367
+ "- current_suggested_form_json:",
1368
+ "```json",
1369
+ json.dumps(suggested_form, ensure_ascii=False, indent=2),
1370
+ "```",
1371
+ ]
1372
+ )
1373
+ else:
1374
+ lines.append("- current_suggested_form_json: {}")
1375
+ setup_state = {
1376
+ "recommended_workspace_mode": payload.get("recommended_workspace_mode") or "unknown",
1377
+ "launch_readiness": payload.get("launch_readiness") or "unknown",
1378
+ "fit_assessment": payload.get("fit_assessment") if isinstance(payload.get("fit_assessment"), dict) else None,
1379
+ "missing_confirmations": payload.get("missing_confirmations") if isinstance(payload.get("missing_confirmations"), list) else [],
1380
+ "materials_summary": payload.get("materials_summary") if isinstance(payload.get("materials_summary"), list) else [],
1381
+ "preview_plan": payload.get("preview_plan") if isinstance(payload.get("preview_plan"), dict) else None,
1382
+ "copilot_handoff": payload.get("copilot_handoff") if isinstance(payload.get("copilot_handoff"), dict) else None,
1383
+ "science_task": payload.get("science_task") if isinstance(payload.get("science_task"), dict) else None,
1384
+ "science_task_brief": payload.get("science_task_brief") if isinstance(payload.get("science_task_brief"), dict) else None,
1385
+ "science_package_cards": payload.get("science_package_cards") if isinstance(payload.get("science_package_cards"), list) else [],
1386
+ }
1387
+ lines.extend(
1388
+ [
1389
+ "- current_start_setup_state_json:",
1390
+ "```json",
1391
+ json.dumps(setup_state, ensure_ascii=False, indent=2),
1392
+ "```",
1393
+ ]
1394
+ )
1395
+ return "\n".join(lines)
1396
+
943
1397
  @staticmethod
944
1398
  def _baseline_execution_policy(snapshot: dict) -> str:
945
1399
  startup_contract = snapshot.get("startup_contract")
@@ -949,6 +1403,40 @@ class PromptBuilder:
949
1403
  return value
950
1404
  return "auto"
951
1405
 
1406
+ @staticmethod
1407
+ def _baseline_source_mode(snapshot: dict) -> str:
1408
+ startup_contract = snapshot.get("startup_contract")
1409
+ if isinstance(startup_contract, dict):
1410
+ value = str(startup_contract.get("baseline_source_mode") or "").strip().lower()
1411
+ if value in {
1412
+ "auto",
1413
+ "verify_local_existing",
1414
+ "attach_registry_baseline",
1415
+ "reproduce_from_source",
1416
+ "repair_existing_baseline",
1417
+ "skip_until_blocking",
1418
+ }:
1419
+ return value
1420
+ return "auto"
1421
+
1422
+ @staticmethod
1423
+ def _execution_start_mode(snapshot: dict) -> str:
1424
+ startup_contract = snapshot.get("startup_contract")
1425
+ if isinstance(startup_contract, dict):
1426
+ value = str(startup_contract.get("execution_start_mode") or "").strip().lower()
1427
+ if value in {"plan_then_execute", "execute_immediately"}:
1428
+ return value
1429
+ return "execute_immediately"
1430
+
1431
+ @staticmethod
1432
+ def _baseline_acceptance_target(snapshot: dict) -> str:
1433
+ startup_contract = snapshot.get("startup_contract")
1434
+ if isinstance(startup_contract, dict):
1435
+ value = str(startup_contract.get("baseline_acceptance_target") or "").strip().lower()
1436
+ if value in {"comparison_ready", "paper_repro_ready", "registry_publishable"}:
1437
+ return value
1438
+ return "comparison_ready"
1439
+
952
1440
  @staticmethod
953
1441
  def _review_followup_policy(snapshot: dict) -> str:
954
1442
  startup_contract = snapshot.get("startup_contract")
@@ -967,7 +1455,98 @@ class PromptBuilder:
967
1455
  return value
968
1456
  return "none"
969
1457
 
1458
+ def _settings_issue_session_block(self, snapshot: dict) -> str:
1459
+ startup_contract = snapshot.get("startup_contract")
1460
+ if not isinstance(startup_contract, dict):
1461
+ return "- none"
1462
+ lines = [
1463
+ self._local_daemon_api_block(include_benchstore=True, include_admin=True),
1464
+ f"- local_repo_root: {self.repo_root.resolve()}",
1465
+ f"- launcher_entry: {(self.repo_root / 'bin' / 'ds.js').resolve()}",
1466
+ f"- python_runtime_root: {(self.repo_root / 'src' / 'deepscientist').resolve()}",
1467
+ f"- web_ui_root: {(self.repo_root / 'src' / 'ui').resolve()}",
1468
+ "- settings_issue_context_rule: the operator message history is expanded explicitly below; absorb that full conversation before asking for clarification.",
1469
+ "- settings_issue_issue_rule: the final output should still converge on `artifact.prepare_github_issue(...)`, but the draft must reflect the real daemon/settings state you verified.",
1470
+ "- settings_issue_tool_schema_summary:",
1471
+ "```json",
1472
+ json.dumps(
1473
+ {
1474
+ "tool": "prepare_github_issue",
1475
+ "runner_namespaced_tool": "mcp__artifact__prepare_github_issue",
1476
+ "input_schema": {
1477
+ "type": "object",
1478
+ "properties": {
1479
+ "summary": {"type": "string"},
1480
+ "user_notes": {"type": "string"},
1481
+ "include_doctor": {"type": "boolean"},
1482
+ "include_logs": {"type": "boolean"},
1483
+ "include_system_quirks": {"type": "boolean"},
1484
+ "open_settings_page": {"type": "boolean"},
1485
+ "comment": {"type": ["string", "object", "null"]},
1486
+ },
1487
+ },
1488
+ },
1489
+ ensure_ascii=False,
1490
+ indent=2,
1491
+ ),
1492
+ "```",
1493
+ ]
1494
+ return "\n".join(lines)
1495
+
1496
+ def _cross_quest_recall_policy_block(self, runtime_config: dict) -> str:
1497
+ memory_config = runtime_config.get("memory") if isinstance(runtime_config.get("memory"), dict) else {}
1498
+ read_visibility_mode = str(memory_config.get("read_visibility_mode") or "independent").strip().lower()
1499
+ shared_enabled = read_visibility_mode == "shared_across_quests"
1500
+ if not shared_enabled:
1501
+ return ""
1502
+ lines = [
1503
+ f"- memory_read_visibility_mode: {read_visibility_mode or 'independent'}",
1504
+ f"- cross_quest_recall_enabled: {str(shared_enabled).lower()}",
1505
+ ]
1506
+ lines.extend(
1507
+ [
1508
+ f"- framework_quirks_path: {(self.home / 'framework_quirks.md').resolve()}",
1509
+ f"- system_quirks_path: {(self.home / 'system_quirks.md').resolve()}",
1510
+ f"- sibling_quest_brief_glob: {(self.home / 'quests' / '*' / 'brief.md')}",
1511
+ "- cross_quest_recall_rule: you may use `bash_exec(...)` to scan sibling quest briefs and deep-read materially relevant sibling quest papers, especially Conclusion and Limitations / Discussion.",
1512
+ "- framework_quirks_rule: read or append `framework_quirks.md` only for durable framework-layer pitfalls and workarounds that future quests should know before touching the same surface.",
1513
+ "- system_quirks_rule: read or append `system_quirks.md` only for confirmed DeepScientist runtime/system bugs, with expected behavior, actual behavior, reproduction, impact, workaround, suggested fix, evidence paths, and status.",
1514
+ "- privacy_rule: do not write secrets, tokens, private hostnames, private paths, or raw logs to either quirks file; redact before recording.",
1515
+ "- fix_first_rule: prefer fixing code over recording permanent quirks; use quirks for confirmed behavior that cannot be fixed immediately or for short-lived workaround memory while the fix lands.",
1516
+ ]
1517
+ )
1518
+ return "\n".join(lines)
1519
+
970
1520
  def _research_delivery_policy_block(self, snapshot: dict) -> str:
1521
+ start_setup_session = self._start_setup_session(snapshot)
1522
+ if start_setup_session:
1523
+ locale = str(start_setup_session.get("locale") or "zh").strip().lower() or "zh"
1524
+ lines = [
1525
+ "- workspace_mode: start_setup",
1526
+ "- delivery_goal: fill the autonomous start form well enough that the user can launch confidently",
1527
+ "- hard_boundary: this is a setup session, not the real research session",
1528
+ "- start_setup_rule: organize the user's task, materials, and runtime limits into a clean launch-ready form",
1529
+ "- mode_recommendation_rule: explicitly judge whether autonomous mode is truly the right fit or whether copilot / collaboration mode is safer.",
1530
+ "- launch_preview_rule: only submit the preview through `session_patch.preview_plan` after launch readiness is `ready`; do not print it in the normal reply.",
1531
+ "- patch_protocol: use `artifact.prepare_start_setup_form(form_patch={...}, session_patch={...})` for all structured form/session updates; do not use fenced `start_setup_patch` blocks in the visible reply",
1532
+ "- completion_rule: once the form is good enough to launch, say so clearly and stop asking for more unless the user requests changes",
1533
+ "- directness_rule: if the current information is already sufficient, tell the user they can launch now",
1534
+ "- ask_rule: only ask short practical questions that directly affect what gets submitted",
1535
+ "- critical_confirmation_rule: treat GPU scope, explicit GPU ids, API keys, external credentials, paid-service permission, large-download permission, and privacy boundaries as mandatory confirmations when they would materially affect launch readiness; do not silently assume them.",
1536
+ ]
1537
+ if locale.startswith("zh"):
1538
+ lines.extend(
1539
+ [
1540
+ "- example_hint: 可以自然说“还差 2 件事就可以判断是否启动”;不要说“整理出草案”,也不要在正文展示草案。",
1541
+ ]
1542
+ )
1543
+ else:
1544
+ lines.extend(
1545
+ [
1546
+ "- example_hint: natural lines like 'Two details remain before launch' are preferred; do not say you drafted a version or show draft content in prose.",
1547
+ ]
1548
+ )
1549
+ return "\n".join(lines)
971
1550
  if self._workspace_mode(snapshot) == "copilot":
972
1551
  return "\n".join(
973
1552
  [
@@ -985,6 +1564,9 @@ class PromptBuilder:
985
1564
  standard_profile = self._standard_profile(snapshot)
986
1565
  custom_profile = self._custom_profile(snapshot)
987
1566
  baseline_execution_policy = self._baseline_execution_policy(snapshot)
1567
+ baseline_source_mode = self._baseline_source_mode(snapshot)
1568
+ execution_start_mode = self._execution_start_mode(snapshot)
1569
+ baseline_acceptance_target = self._baseline_acceptance_target(snapshot)
988
1570
  review_followup_policy = self._review_followup_policy(snapshot)
989
1571
  manuscript_edit_mode = self._manuscript_edit_mode(snapshot)
990
1572
  lines = [
@@ -992,6 +1574,9 @@ class PromptBuilder:
992
1574
  f"- launch_mode: {launch_mode}",
993
1575
  f"- standard_profile: {standard_profile if launch_mode == 'standard' else 'n/a'}",
994
1576
  f"- custom_profile: {custom_profile if launch_mode == 'custom' else 'n/a'}",
1577
+ f"- baseline_source_mode: {baseline_source_mode}",
1578
+ f"- execution_start_mode: {execution_start_mode}",
1579
+ f"- baseline_acceptance_target: {baseline_acceptance_target}",
995
1580
  f"- review_followup_policy: {review_followup_policy if custom_profile == 'review_audit' else 'n/a'}",
996
1581
  f"- baseline_execution_policy: {baseline_execution_policy if launch_mode == 'custom' else 'n/a'}",
997
1582
  f"- manuscript_edit_mode: {manuscript_edit_mode if custom_profile in {'review_audit', 'revision_rebuttal'} else 'n/a'}",
@@ -1003,6 +1588,67 @@ class PromptBuilder:
1003
1588
  "- post_main_result_rule: after every `artifact.record_main_experiment(...)`, first interpret the measured result and only then choose the next route.",
1004
1589
  "- foundation_selection_rule: for a genuinely new idea round, default to the current research head but feel free to choose another durable foundation when it is cleaner or stronger; inspect `artifact.list_research_branches(...)` first when the best foundation is not obvious.",
1005
1590
  ]
1591
+ if execution_start_mode == "plan_then_execute":
1592
+ lines.extend(
1593
+ [
1594
+ "- plan_first_entry_rule: this execution-start preference applies to the startup baseline route only. Before heavy baseline reproduction or expensive baseline setup at quest entry, first produce a bounded execution plan and wait for explicit user approval instead of executing immediately.",
1595
+ ]
1596
+ )
1597
+ if baseline_source_mode == "verify_local_existing":
1598
+ lines.extend(
1599
+ [
1600
+ "- baseline_source_rule: if local code or a local service already exists and the metric path is concrete, verify that local existing system first instead of defaulting into from-scratch source reproduction.",
1601
+ ]
1602
+ )
1603
+ elif baseline_source_mode == "attach_registry_baseline":
1604
+ lines.extend(
1605
+ [
1606
+ "- baseline_source_rule: prefer attaching and verifying a reusable registered baseline before considering a full source reproduction path.",
1607
+ ]
1608
+ )
1609
+ elif baseline_source_mode == "reproduce_from_source":
1610
+ lines.extend(
1611
+ [
1612
+ "- baseline_source_rule: treat source reproduction as the expected startup baseline path unless a clearly stronger local shortcut becomes trustworthy after inspection.",
1613
+ ]
1614
+ )
1615
+ elif baseline_source_mode == "repair_existing_baseline":
1616
+ lines.extend(
1617
+ [
1618
+ "- baseline_source_rule: prefer repairing the stale existing baseline before restarting from a clean-slate reproduction.",
1619
+ ]
1620
+ )
1621
+ elif baseline_source_mode == "skip_until_blocking":
1622
+ lines.extend(
1623
+ [
1624
+ "- baseline_source_rule: do not front-load baseline work at quest entry unless the missing comparator is actually blocking the next scientific step.",
1625
+ ]
1626
+ )
1627
+ else:
1628
+ lines.extend(
1629
+ [
1630
+ "- baseline_source_rule: auto mode prefers verify/reuse/attach before source reproduction.",
1631
+ ]
1632
+ )
1633
+ if baseline_acceptance_target == "comparison_ready":
1634
+ lines.extend(
1635
+ [
1636
+ "- baseline_acceptance_rule: once the comparator is trustworthy enough for the next scientific step, move forward immediately. Prefer attach / import / verify-local-existing over full reproduction whenever those lighter routes already satisfy `comparison_ready`, and do not escalate to heavier baseline work without naming one explicit unresolved comparison risk.",
1637
+ ]
1638
+ )
1639
+ elif baseline_acceptance_target == "paper_repro_ready":
1640
+ lines.extend(
1641
+ [
1642
+ "- baseline_acceptance_rule: keep startup baseline work primary until the comparator is strong enough to support paper-facing claims, not just one quick comparison.",
1643
+ ]
1644
+ )
1645
+ else:
1646
+ lines.extend(
1647
+ [
1648
+ "- baseline_acceptance_rule: treat the startup baseline as incomplete until it is reusable and clean enough to publish as a registry-quality baseline package.",
1649
+ ]
1650
+ )
1651
+
1006
1652
  if launch_mode == "custom":
1007
1653
  lines.extend(
1008
1654
  [
@@ -1049,6 +1695,25 @@ class PromptBuilder:
1049
1695
  "- rebuttal_routing_rule: route supplementary reviewer-facing evidence through `analysis-campaign` and manuscript deltas through `write`, but let `rebuttal` orchestrate that mapping.",
1050
1696
  ]
1051
1697
  )
1698
+ elif custom_profile == "admin_ops":
1699
+ lines.extend(
1700
+ [
1701
+ "- admin_ops_entry_rule: this is an administrator diagnosis / repair session for the local DeepScientist runtime rather than an ordinary end-user research quest.",
1702
+ "- admin_ops_scope_rule: treat `startup_contract.admin_session`, `entry_state_summary`, `custom_brief`, and `review_materials` as the active incident context packet.",
1703
+ "- admin_ops_truth_rule: prefer documented daemon APIs, durable quest files, config files, connector state, runtime logs, and bounded `bash_exec(...)` inspection over speculation.",
1704
+ "- admin_ops_repair_rule: diagnose first, then apply the smallest safe fix allowed by the repair policy; avoid direct mutation of undocumented `.ds/*` internals when a safer route exists.",
1705
+ "- admin_ops_output_rule: separate diagnosis, fix, verification, and residual risk; keep summaries operational and explicit about blast radius.",
1706
+ ]
1707
+ )
1708
+ elif custom_profile == "settings_issue":
1709
+ lines.extend(
1710
+ [
1711
+ "- settings_issue_entry_rule: this is a settings-only GitHub issue drafting session rather than a general research or admin repair session.",
1712
+ "- settings_issue_tool_surface_rule: prefer `artifact.prepare_github_issue(...)` for the final issue draft, but rely on the injected daemon API context and explicit message history first so the issue reflects the full settings conversation.",
1713
+ "- settings_issue_bash_rule: `bash_exec(...)` remains available for bounded local inspection or daemon checks when needed, and should be used to verify live settings/runtime behavior before the final draft.",
1714
+ "- settings_issue_execution_rule: collect the issue summary and user notes, call `artifact.prepare_github_issue(...)`, and rely on the browser prefill flow instead of hand-writing a separate issue body when the tool can provide it.",
1715
+ ]
1716
+ )
1052
1717
  else:
1053
1718
  lines.extend(
1054
1719
  [
@@ -1097,10 +1762,10 @@ class PromptBuilder:
1097
1762
  if need_research_paper:
1098
1763
  lines.extend(
1099
1764
  [
1100
- "- delivery_goal: the quest should normally continue until at least one paper-like deliverable exists.",
1101
- "- main_result_rule: a strong main experiment is evidence, not the endpoint; usually continue into analysis, writing, or strengthening work.",
1765
+ "- delivery_goal: the default paper-facing goal is at least one paper-like deliverable, but do not force every later stage when the nearer gate for this turn is already open.",
1766
+ "- main_result_rule: a strong main experiment is evidence, not the endpoint; often continue into analysis, writing, or strengthening work when the current contract really needs it.",
1102
1767
  "- paper_branch_rule: writing should normally continue on a dedicated `paper/*` branch/worktree derived from the evidence line rather than mutating the evidence branch itself.",
1103
- "- review_gate_rule: before declaring a substantial paper/draft task done, open `review` for an independent skeptical audit; if that audit finds serious gaps, route to `analysis-campaign`, `baseline`, `scout`, or `write` instead of stopping.",
1768
+ "- review_gate_rule: when a paper draft becomes substantial, consider opening `review` for an independent skeptical audit before calling it done; if that audit finds serious gaps, route to analysis, baseline, scout, or more writing instead of stopping.",
1104
1769
  "- stop_rule: do not stop with only an improved algorithm or isolated run logs unless the user explicitly narrows scope.",
1105
1770
  ]
1106
1771
  )
@@ -1192,7 +1857,12 @@ class PromptBuilder:
1192
1857
  "- collaboration_mode: user-directed copilot",
1193
1858
  "- freeform_task_rule: if the user asks for a concrete research task, solve that task directly before introducing stage-routing language.",
1194
1859
  "- requested_skill_hint_rule: in copilot mode, treat `requested_skill` as a lightweight routing hint, not as an instruction to default into `decision` for ordinary direct tasks.",
1195
- "- response_pattern: say what changed -> say what it means -> say what happens next",
1860
+ "- turn_self_routing_rule: before substantial work, classify the current turn as `direct_answer`, `direct_action`, `stage_continue`, or `route_decision`.",
1861
+ "- direct_answer_rule: if the user mainly wants an answer or clarification, answer with the narrowest sufficient context and avoid reading large stage state unless needed.",
1862
+ "- direct_action_rule: if the user mainly wants one concrete task, execute the smallest useful unit first and do not expand into background research continuation in the same turn unless the user asked for it.",
1863
+ "- stage_continue_rule: if the user mainly wants the quest to keep moving, continue from the active durable stage state after acknowledging the request.",
1864
+ "- route_decision_rule: switch into `decision`-style reasoning only when safe continuation depends on a real route, scope, cost, branch, or scientific-direction judgment.",
1865
+ "- decision_skill_escalation_rule: if a turn upgrades into `route_decision`, explicitly read the `decision` skill before substantial route-changing work.",
1196
1866
  "- mailbox_protocol: artifact.interact(include_recent_inbound_messages=True) remains the queued human-message mailbox and should be checked whenever human continuity matters.",
1197
1867
  "- planning_rule: before non-trivial execution, make the immediate plan explicit and keep the first step small.",
1198
1868
  "- tool_rule: use memory for durable recall, artifact for quest state and git-aware research operations, and bash_exec for terminal execution.",
@@ -1201,13 +1871,11 @@ class PromptBuilder:
1201
1871
  "- git_tool_mandate: for git work inside the current quest repository or worktree, prefer `artifact.git(...)` before raw shell git commands.",
1202
1872
  "- git_test_rule: if the user wants a generic git smoke test rather than a quest-repo mutation, use `bash_exec(...)` in an isolated scratch repository.",
1203
1873
  "- decision_entry_rule: use `decision` only for real route, scope, cost, branch, or scientific-direction judgments; do not default to it for ordinary repo, code, environment, or execution tasks.",
1874
+ "- micro_task_stop_rule: after finishing a `direct_answer` or `direct_action` turn, report the result plainly and wait instead of auto-continuing.",
1204
1875
  "- stop_rule: once the current requested unit is done, send a concise update and wait for the next message or `/resume`.",
1205
1876
  "- escalation_rule: if a route change materially affects cost, scope, or scientific direction, ask before proceeding.",
1877
+ "- connector_style_rule: connector-facing tone and report style live in the active connector contract rather than in this runtime block.",
1206
1878
  ]
1207
- if chinese_turn:
1208
- lines.append("- tone_hint: 使用自然、礼貌、专业的中文,先解释结论,再说明下一步。")
1209
- else:
1210
- lines.append("- tone_hint: use concise, natural, professional English and lead with the conclusion.")
1211
1879
  return "\n".join(lines)
1212
1880
  bound_conversations = snapshot.get("bound_conversations") or []
1213
1881
  need_research_paper = self._need_research_paper(snapshot)
@@ -1224,44 +1892,43 @@ class PromptBuilder:
1224
1892
  f"- standard_profile: {standard_profile if launch_mode == 'standard' else 'n/a'}",
1225
1893
  f"- custom_profile: {custom_profile if launch_mode == 'custom' else 'n/a'}",
1226
1894
  "- collaboration_mode: long-horizon, continuity-first, artifact-aware",
1227
- "- response_pattern: say what changed -> say what it means -> say what happens next",
1895
+ "- user_turn_self_routing_rule: on a fresh user message, first classify the turn as `direct_answer`, `direct_action`, `stage_continue`, or `route_decision` before reading additional skills or large quest context.",
1896
+ "- direct_answer_rule: if the user mainly wants an answer or clarification, answer with the narrowest sufficient context and avoid reading large stage state unless needed.",
1897
+ "- direct_action_rule: if the user mainly wants one concrete task, execute the smallest useful unit first and do not silently expand into broader autonomous continuation in the same turn unless the user asked for it.",
1898
+ "- stage_continue_rule: if the user is clearly asking to continue quest progress, resume from the active durable stage state.",
1899
+ "- route_decision_rule: open `decision`-style reasoning only when safe continuation genuinely depends on a real route, scope, cost, branch, or scientific-direction judgment.",
1900
+ "- decision_skill_escalation_rule: if a fresh user-message turn upgrades into `route_decision`, explicitly read the `decision` skill before substantial route-changing work.",
1228
1901
  "- interaction_protocol: first message may be plain conversation; after that, treat artifact.interact threads and mailbox polls as the main continuity spine across TUI, web, and connectors",
1229
1902
  "- shared_interaction_contract_precedence: use the shared interaction contract as the default user-facing cadence; the rules below add runtime-specific execution behavior instead of restating the same chat cadence",
1230
1903
  "- shell_tool_mandate: **native `shell_command` / `command_execution` is forbidden; all shell-like execution must use `bash_exec(...)`.**",
1231
1904
  "- mailbox_protocol: artifact.interact(include_recent_inbound_messages=True) is the queued human-message mailbox; when it returns user text, treat that input as higher priority than background subtasks until it has been acknowledged",
1232
1905
  "- acknowledgment_protocol: after artifact.interact returns any human message, immediately send one substantive artifact.interact(...) follow-up; if the active connector runtime already emitted a transport-level receipt acknowledgement, do not send a redundant receipt-only message; if answerable, answer directly, otherwise state the short plan, nearest checkpoint, and that the current background subtask is paused",
1233
1906
  "- subtask_boundary_protocol: send a user-visible update whenever the active subtask changes materially, especially across intake -> audit, audit -> experiment planning, experiment planning -> run launch, run result -> drafting, or drafting -> review/rebuttal",
1234
- "- smoke_then_detach_protocol: for baseline reproduction, main experiments, and analysis experiments, first validate the command path with a bounded smoke test; once the smoke test passes, launch the real long run with bash_exec(mode='detach', ...) and usually leave timeout_seconds unset rather than guessing a fake deadline",
1235
- "- progress_first_monitoring_protocol: when supervising a long-running bash_exec session, judge health by forward progress rather than by whether the final artifact has already appeared within a short window",
1907
+ "- smoke_then_detach_protocol: for baseline reproduction, main experiments, and analysis experiments, use a bounded smoke test only when the command path, output schema, or environment viability is still unverified; otherwise launch the real long run directly with bash_exec(mode='detach', ...) and usually leave timeout_seconds unset rather than guessing a fake deadline",
1908
+ "- progress_first_monitoring_protocol: judge health by forward progress in logs, metrics, new artifacts, or checkpoints rather than by wall-clock silence alone.",
1909
+ "- intervention_threshold_protocol: intervene only when the run shows a concrete blocker such as repeated hard errors, no forward progress across multiple checks, exhausted resources, or clearly invalid outputs.",
1910
+ "- timeout_protocol: do not kill or restart a run merely because a short watch window passed without final completion; use timeout_seconds for bounded command setup or watch windows, not as a fake experiment deadline.",
1236
1911
  "- long_run_reporting_protocol: inspect real logs/status after each meaningful await cycle and at least once every 30 minutes at worst, but only send a user-visible update when there is a human-meaningful delta, blocker, recovery, route change, or the visibility bound would otherwise be exceeded",
1237
- "- intervention_threshold_protocol: do not kill or restart a run merely because a short watch window passed without final completion; intervene only on explicit failure, clear invalidity, process exit, or no meaningful delta across a sufficiently long observation window",
1238
- "- timeout_protocol: before using bash_exec(mode='await', ...), estimate whether the command can finish within the selected wait window; if runtime is uncertain or likely longer, use bash_exec(mode='detach', ...) and monitor instead of guessing a fake deadline",
1239
1912
  f"- auto_continue_monitoring_protocol: if the runtime schedules background-progress auto_continue turns while a real external task is already active, treat them as low-frequency monitoring passes roughly every {_AUTO_CONTINUE_MONITOR_INTERVAL_SECONDS} seconds rather than as a fast polling loop",
1240
- "- auto_continue_prepare_protocol: in autonomous mode before a real long-running external task exists, rapid auto-continue passes around 0.2 seconds apart are acceptable only for active preparation, launch, or durable route closure work; they are not a substitute for starting the real task",
1241
1913
  "- long_run_ownership_protocol: real long-running execution should stay alive in detached bash_exec sessions or the runtime process it launched; do not rely on repeated model turns to simulate continuous execution",
1242
1914
  "- auto_continue_resume_protocol: on auto_continue turns, read the resume context spine first and continue from the latest durable user requirement, latest assistant checkpoint, latest run summary, recent memory cues, and current bash_exec state before changing route",
1915
+ "- decision_dedupe_rule: if no new durable evidence, blocker change, or user requirement appeared since the last route judgment, do not restate the same decision; continue the current action or remain waiting.",
1243
1916
  "- blocking_protocol: use reply_mode='blocking' only for true unresolved user decisions; ordinary progress updates should stay threaded and non-blocking",
1244
1917
  "- credential_blocking_protocol: if continuation requires user-supplied external credentials or secrets such as an API key, GitHub key/token, or Hugging Face key/token, emit one structured blocking decision request that asks the user to provide the credential or choose an alternative route; do not invent placeholders or silently skip the blocked step",
1245
1918
  "- credential_wait_protocol: if that credential request remains unanswered, keep the quest waiting rather than self-resolving; if you are resumed without new credentials and no other work is possible, a long low-frequency park such as `bash_exec(command='sleep 3600', mode='await', timeout_seconds=3700)` is acceptable to avoid busy-looping",
1246
1919
  f"- standby_prefix_rule: when you intentionally leave one blocking standby interaction after task completion, prefix it with {'[等待决策]' if chinese_turn else '[Waiting for decision]'} and wait for a new user reply before continuing",
1247
1920
  "- stop_notice_protocol: if work must pause or stop, send a user-visible notice that explains why, confirms preserved context, and states that any new message or `/resume` will continue from the same quest",
1248
- "- respect_protocol: write user-facing updates as natural, respectful, easy-to-follow chat; do not sound like a formal status report or internal tool log",
1249
- "- novice_context_protocol: assume the user may not know the repo layout, branch model, artifact schema, or tool names; explain progress in task language first.",
1250
- "- structure_protocol: when explaining 2 to 3 options, tradeoffs, or next steps, prefer a short numbered structure so the user can scan the decision surface quickly.",
1251
- "- example_and_numbers_protocol: when it materially improves understanding, include one short example or 1 to 3 key numbers or comparisons instead of relying only on vague adjectives such as better, slower, or more stable.",
1252
- "- omission_protocol: for ordinary user-facing updates, omit file paths, file names, artifact ids, branch/worktree ids, session ids, raw commands, raw logs, and internal tool names unless the user asked for them or needs them to act",
1253
- "- compaction_protocol: ordinary artifact.interact progress updates should usually fit in 2 to 4 short sentences and should not read like a monitoring transcript or execution diary",
1921
+ "- micro_task_stop_rule: after a fresh user-message turn that was only `direct_answer` or `direct_action`, finish that unit and do not silently turn the same turn into a broader autonomous stage pass unless the user asked for it.",
1254
1922
  "- watchdog_payload_protocol: if a tool result includes `watchdog_notes`, `progress_watchdog_note`, `visibility_watchdog_note`, or `state_change_watchdog_note`, treat that as an action item to inspect state and decide whether a fresh user-visible update is actually needed; do not emit duplicate progress by reflex",
1255
- "- human_progress_shape_protocol: ordinary progress updates should usually make three things explicit in human language: the current task, the main difficulty or latest real progress, and the concrete next measure you will take",
1256
1923
  "- stage_contract_protocol: stage-specific plan/checklist rules, milestone rules, literature rules, and writing rules belong in the requested skill; do not expect this runtime block to restate them",
1257
- "- teammate_voice_protocol: write like a calm capable teammate using natural first-person phrasing when helpful, for example 'I'm working on ...', 'The main issue right now is ...', 'Next I'll ...'; do not sound like a dashboard or incident log",
1258
- "- translation_protocol: convert internal actions into user-facing meaning; describe what was finished and why it matters instead of naming every touched file, path, branch, counter, timestamp, or subprocess",
1259
- "- detail_gate_protocol: include exact counters, worker labels, timestamps, retry counts, or file names only when the user explicitly asked for them, when they change the recommended action, or when they are the only honest way to explain a real blocker",
1260
- "- monitoring_summary_protocol: for long-running monitoring loops, summarize the frontier state in plain language such as still progressing, temporarily stalled, recovered, or needs intervention; do not narrate each watch window",
1261
- "- preflight_rewrite_protocol: before sending artifact.interact, quickly self-check whether the draft reads like a monitoring log, file inventory, or internal diary; if it mentions watch windows, heartbeats, retry counters, raw counts, timestamps, or multiple file names without being necessary for user action, rewrite it into conclusion -> meaning -> next step first",
1924
+ "- connector_style_rule: connector-facing tone and report style live in the active connector contract rather than in this runtime block.",
1262
1925
  "- workspace_discipline: read and modify code inside current_workspace_root; treat quest_root as the canonical repo identity and durable runtime root",
1263
1926
  "- binary_safety: do not open or rewrite large binary assets unless truly necessary; prefer summaries, metadata, and targeted inspection first",
1264
1927
  ]
1928
+ if re.search(r"(understand|easy|simple|plain|non-technical|更新|看懂|易懂|通俗)", user_message, re.IGNORECASE):
1929
+ lines.append(
1930
+ "- novice_context_protocol: when the user asks for accessible updates, omit file paths, file names, internal ids, retry counters, and low-level monitor narration; translate them into user-facing meaning such as baseline record, draft, experiment result, or supplementary run."
1931
+ )
1265
1932
  if decision_policy == "autonomous":
1266
1933
  lines.extend(
1267
1934
  [
@@ -1292,14 +1959,12 @@ class PromptBuilder:
1292
1959
  if chinese_turn:
1293
1960
  lines.extend(
1294
1961
  [
1295
- "- tone_hint: 使用自然、礼貌、专业、偏正式的中文;必要时可自然称呼用户为“老师”,但不要每句重复;避免机械模板腔。",
1296
1962
  "- connector_reply_hint: 在聊天面里优先简明说明当前状态、下一步动作、预计回传内容。",
1297
1963
  ]
1298
1964
  )
1299
1965
  else:
1300
1966
  lines.extend(
1301
1967
  [
1302
- "- tone_hint: use a polite, professional, gentlemanly English tone.",
1303
1968
  "- connector_reply_hint: keep chat replies concise but operational, with explicit next steps and evidence targets.",
1304
1969
  ]
1305
1970
  )
@@ -1311,6 +1976,9 @@ class PromptBuilder:
1311
1976
  "- quest_context_rule: quest documents are durable but not pre-expanded here.",
1312
1977
  "- quest_documents_tool: call artifact.read_quest_documents(names=['brief','plan','status','summary'], mode='excerpt'|'full') when document detail is needed.",
1313
1978
  "- active_user_requirements_tool: call artifact.read_quest_documents(names=['active_user_requirements'], mode='full') when exact current durable user requirements matter.",
1979
+ "- research_map_tool: call artifact.get_research_map_status(detail='summary'|'full') when the current active node, research head, node history, canvas progress, or activation refs matter.",
1980
+ "- research_map_usage_rule: use `summary` for ordinary recovery/status/switch questions and `full` only when you need the full node list or edge payload.",
1981
+ "- workspace_execution_rule: on resume/restart/auto_continue turns, read current workspace `PLAN.md` / `CHECKLIST.md` (or aliases) before inventing a new route.",
1314
1982
  ]
1315
1983
  )
1316
1984
 
@@ -1370,18 +2038,47 @@ class PromptBuilder:
1370
2038
  ).strip() or "none"
1371
2039
  lines.extend(
1372
2040
  [
1373
- f"- paper_contract_health: {'ready' if bool(paper_contract_health.get('writing_ready')) else 'blocked'}",
2041
+ (
2042
+ "- paper_contract_health: "
2043
+ f"evidence_ready={bool(paper_contract_health.get('evidence_ready', paper_contract_health.get('writing_ready')))}, "
2044
+ f"analysis_ready={bool(paper_contract_health.get('analysis_ready', paper_contract_health.get('writing_ready')))}, "
2045
+ f"academic_outline_ready={bool(paper_contract_health.get('academic_outline_ready'))}, "
2046
+ f"analysis_plan_ready={bool(paper_contract_health.get('analysis_plan_ready'))}, "
2047
+ f"language_firewall_ok={bool(paper_contract_health.get('language_firewall_ok', True))}, "
2048
+ f"draft_checkpoint_ready={bool(paper_contract_health.get('draft_checkpoint_ready'))}, "
2049
+ f"manuscript_ready={bool(paper_contract_health.get('manuscript_ready'))}, "
2050
+ f"submission_ready={bool(paper_contract_health.get('submission_ready'))}"
2051
+ ),
1374
2052
  f"- paper_health_counts: unresolved_required={int(paper_contract_health.get('unresolved_required_count') or 0)}, unmapped_completed={int(paper_contract_health.get('unmapped_completed_count') or 0)}, blocking_pending={int(paper_contract_health.get('blocking_open_supplementary_count') or 0)}",
2053
+ f"- paper_quality_warning_count: {len(paper_contract_health.get('manuscript_warning_reasons') or []) + len(paper_contract_health.get('submission_warning_reasons') or [])}",
2054
+ f"- paper_package_type: {str(paper_contract_health.get('package_type') or 'draft_checkpoint')}",
1375
2055
  f"- paper_recommended_next_stage: {str(paper_contract_health.get('recommended_next_stage') or 'none')}",
1376
2056
  f"- paper_recommended_action: {str(paper_contract_health.get('recommended_action') or 'none')}",
1377
2057
  f"- paper_primary_blocker: {primary_blocker}",
1378
- "- paper_health_tool: call artifact.get_paper_contract_health(detail='full') before paper-facing write/finalize work when the exact blocking items matter.",
2058
+ "- paper_contract_tool: call artifact.get_paper_contract(detail='full') before evidence-grounded paper prose.",
2059
+ "- paper_health_tool: call artifact.get_paper_contract_health(detail='full') before write/finalize routing.",
2060
+ "- paper_coverage_tool: call artifact.validate_manuscript_coverage(detail='full') before full-manuscript or submission claims.",
2061
+ "- paper_academic_outline_tool: call artifact.validate_academic_outline(detail='full') before writing from an outline.",
2062
+ "- paper_language_tool: call artifact.validate_manuscript_language(detail='full') before submission or after major prose edits.",
2063
+ "- paper_writing_plan_tool: call artifact.compile_outline_to_writing_plan(detail='full') after the academic outline passes and before drafting.",
1379
2064
  "- paper_outline_tool: call artifact.list_paper_outlines(...) when outline inventory or a valid outline_id is needed.",
1380
2065
  "- paper_campaign_tool: call artifact.get_analysis_campaign(campaign_id='active') when exact supplementary slice status matters.",
1381
2066
  ]
1382
2067
  )
1383
2068
  lines.append(
1384
- "- paper_contract_rule: if the paper state is blocked, do not stabilize draft prose as if the paper were settled; follow the recommended paper action first."
2069
+ "- paper_contract_rule: do not finalize unless submission_ready is true."
2070
+ )
2071
+ lines.append(
2072
+ "- paper_quality_warning_rule: paper quality and analysis-count warnings are reminders, not automatic blockers; surface them before claiming the draft is strong or final."
2073
+ )
2074
+ lines.append(
2075
+ "- paper_view_rule: a selected outline must separate `paper_view` (paper idea, claims, method, analyses) from `evidence_view` (result rows, run ids, paths, reproducibility details)."
2076
+ )
2077
+ lines.append(
2078
+ "- paper_language_rule: keep quest/worktree/port/batch/route wording out of main manuscript text; turn it into benchmark, baseline, budget, method, or appendix wording."
2079
+ )
2080
+ lines.append(
2081
+ "- paper_story_rule: write the paper around one defensible idea and what the reader learns from the results, not around the order in which the agent ran experiments."
1385
2082
  )
1386
2083
  return "\n".join(lines)
1387
2084
 
@@ -1399,7 +2096,8 @@ class PromptBuilder:
1399
2096
  global_kinds = ", ".join(plan.get("global", ())) or "none"
1400
2097
  lines = [
1401
2098
  f"- stage_memory_rule: for `{stage}`, prefer quest memory kinds [{quest_kinds}] and global memory kinds [{global_kinds}] when memory lookup is needed.",
1402
- "- memory_lookup_tool: call memory.list_recent(...) to recover context after pause/restart and memory.search(...) before repeating prior work.",
2099
+ "- memory_lookup_tool: call memory.list_recent(...) after pause/restart and memory.search(...) before repeating old work or reopening an old baseline route.",
2100
+ "- checkpoint_memory_lookup_rule: on resume/restart/auto_continue turns and continue/status questions, look for the latest checkpoint-style quest memory that states the current route, current active node, node history, what not to reopen, the next resume step, and the first files to read.",
1403
2101
  "- memory_injection_rule: keep the injected memory compact, but do not drop all continuity on auto_continue turns; reuse a few recent durable cues directly when they materially anchor the next action.",
1404
2102
  ]
1405
2103
  selected: list[dict] = []
@@ -1440,6 +2138,21 @@ class PromptBuilder:
1440
2138
  quest_root=quest_root,
1441
2139
  reason=f"matched current-turn query `{query}`",
1442
2140
  )
2141
+ for query in self._checkpoint_memory_queries(stage=stage, user_message=user_message):
2142
+ for card in self.memory_service.search(
2143
+ query,
2144
+ scope="quest",
2145
+ quest_root=quest_root,
2146
+ limit=1,
2147
+ ):
2148
+ self._append_priority_memory(
2149
+ selected,
2150
+ seen_paths,
2151
+ card=card,
2152
+ scope="quest",
2153
+ quest_root=quest_root,
2154
+ reason=f"matched checkpoint-memory query `{query}`",
2155
+ )
1443
2156
  lines.extend(["- selected_memory:", self._format_priority_memory(selected)])
1444
2157
  return "\n".join(lines)
1445
2158
 
@@ -1502,6 +2215,25 @@ class PromptBuilder:
1502
2215
  break
1503
2216
  return tokens
1504
2217
 
2218
+ @staticmethod
2219
+ def _checkpoint_memory_queries(*, stage: str, user_message: str) -> list[str]:
2220
+ normalized = str(user_message or "").strip().lower()
2221
+ continue_markers = ("继续", "resume", "status", "进展", "当前", "checkpoint", "next")
2222
+ if stage not in {"decision", "finalize", "write", "experiment", "analysis-campaign"} and not any(
2223
+ marker in normalized for marker in continue_markers
2224
+ ):
2225
+ return []
2226
+ return [
2227
+ "current checkpoint",
2228
+ "current node",
2229
+ "node history",
2230
+ "continue-later",
2231
+ "superseded",
2232
+ "reopen condition",
2233
+ "what should be read first",
2234
+ "do not repeat",
2235
+ ]
2236
+
1505
2237
  def _conversation_block(self, quest_id: str, limit: int = 12) -> str:
1506
2238
  return "\n".join(
1507
2239
  [
@@ -1510,6 +2242,36 @@ class PromptBuilder:
1510
2242
  ]
1511
2243
  )
1512
2244
 
2245
+ def _expanded_conversation_block(self, quest_id: str, *, limit: int = 200, char_budget: int = 24000) -> str:
2246
+ history = self.quest_service.history(quest_id, limit=limit)
2247
+ if not history:
2248
+ return "- none"
2249
+ lines = [
2250
+ f"- conversation_injection_rule: the recent {len(history)} message(s) are expanded below so you do not need to ask the user to restate them.",
2251
+ ]
2252
+ used = sum(len(line) for line in lines)
2253
+ for index, item in enumerate(history, start=1):
2254
+ role = str(item.get("role") or "unknown").strip() or "unknown"
2255
+ source = str(item.get("source") or "unknown").strip() or "unknown"
2256
+ created_at = str(item.get("created_at") or "").strip() or "unknown-time"
2257
+ content = str(item.get("content") or "").strip()
2258
+ if not content:
2259
+ continue
2260
+ line = f"{index}. [{role}|{source}|{created_at}] {content}"
2261
+ if used + len(line) > char_budget:
2262
+ lines.append(
2263
+ f"- conversation_injection_truncated: stopped after {index - 1} message(s) to stay within prompt budget."
2264
+ )
2265
+ break
2266
+ lines.append(line)
2267
+ used += len(line)
2268
+ return "\n".join(lines)
2269
+
2270
+ def _special_conversation_block(self, snapshot: dict, *, quest_id: str) -> str:
2271
+ if self._start_setup_session(snapshot) or self._custom_profile(snapshot) in {"settings_issue", "admin_ops"}:
2272
+ return self._expanded_conversation_block(quest_id)
2273
+ return self._conversation_block(quest_id)
2274
+
1513
2275
  def _markdown_body(self, path: Path) -> str:
1514
2276
  text = path.read_text(encoding="utf-8")
1515
2277
  if text.startswith("---\n"):