@researai/deepscientist 1.5.15 → 1.5.16

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 (193) hide show
  1. package/README.md +336 -98
  2. package/bin/ds.js +691 -91
  3. package/docs/en/00_QUICK_START.md +36 -15
  4. package/docs/en/01_SETTINGS_REFERENCE.md +33 -0
  5. package/docs/en/02_START_RESEARCH_GUIDE.md +7 -0
  6. package/docs/en/05_TUI_GUIDE.md +6 -0
  7. package/docs/en/06_RUNTIME_AND_CANVAS.md +4 -3
  8. package/docs/en/09_DOCTOR.md +11 -5
  9. package/docs/en/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +63 -13
  10. package/docs/en/15_CODEX_PROVIDER_SETUP.md +25 -8
  11. package/docs/en/19_EXTERNAL_CONTROLLER_GUIDE.md +226 -0
  12. package/docs/en/19_LOCAL_BROWSER_AUTH.md +70 -0
  13. package/docs/en/20_WORKSPACE_MODES_GUIDE.md +250 -0
  14. package/docs/en/README.md +18 -0
  15. package/docs/zh/00_QUICK_START.md +36 -15
  16. package/docs/zh/01_SETTINGS_REFERENCE.md +33 -0
  17. package/docs/zh/02_START_RESEARCH_GUIDE.md +7 -0
  18. package/docs/zh/05_TUI_GUIDE.md +6 -0
  19. package/docs/zh/09_DOCTOR.md +11 -5
  20. package/docs/zh/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +63 -13
  21. package/docs/zh/15_CODEX_PROVIDER_SETUP.md +25 -8
  22. package/docs/zh/19_EXTERNAL_CONTROLLER_GUIDE.md +226 -0
  23. package/docs/zh/19_LOCAL_BROWSER_AUTH.md +68 -0
  24. package/docs/zh/20_WORKSPACE_MODES_GUIDE.md +251 -0
  25. package/docs/zh/README.md +18 -0
  26. package/package.json +1 -1
  27. package/pyproject.toml +1 -1
  28. package/src/deepscientist/__init__.py +1 -1
  29. package/src/deepscientist/acp/envelope.py +6 -0
  30. package/src/deepscientist/artifact/service.py +647 -22
  31. package/src/deepscientist/bash_exec/service.py +234 -9
  32. package/src/deepscientist/cli.py +115 -19
  33. package/src/deepscientist/codex_cli_compat.py +232 -0
  34. package/src/deepscientist/config/models.py +2 -1
  35. package/src/deepscientist/config/service.py +31 -9
  36. package/src/deepscientist/daemon/api/handlers.py +125 -6
  37. package/src/deepscientist/daemon/api/router.py +4 -0
  38. package/src/deepscientist/daemon/app.py +715 -98
  39. package/src/deepscientist/gitops/__init__.py +10 -1
  40. package/src/deepscientist/gitops/diff.py +129 -0
  41. package/src/deepscientist/gitops/service.py +4 -1
  42. package/src/deepscientist/mcp/server.py +39 -0
  43. package/src/deepscientist/prompts/builder.py +255 -32
  44. package/src/deepscientist/quest/layout.py +15 -2
  45. package/src/deepscientist/quest/service.py +295 -43
  46. package/src/deepscientist/quest/stage_views.py +6 -1
  47. package/src/deepscientist/runners/codex.py +86 -31
  48. package/src/deepscientist/skills/__init__.py +2 -2
  49. package/src/deepscientist/skills/installer.py +196 -5
  50. package/src/deepscientist/skills/registry.py +66 -0
  51. package/src/prompts/connectors/qq.md +18 -8
  52. package/src/prompts/connectors/weixin.md +16 -6
  53. package/src/prompts/contracts/shared_interaction.md +12 -1
  54. package/src/prompts/system.md +10 -5
  55. package/src/prompts/system_copilot.md +43 -0
  56. package/src/skills/analysis-campaign/SKILL.md +1 -0
  57. package/src/skills/baseline/SKILL.md +8 -0
  58. package/src/skills/decision/SKILL.md +8 -0
  59. package/src/skills/experiment/SKILL.md +8 -0
  60. package/src/skills/figure-polish/SKILL.md +1 -0
  61. package/src/skills/finalize/SKILL.md +1 -0
  62. package/src/skills/idea/SKILL.md +1 -0
  63. package/src/skills/intake-audit/SKILL.md +8 -0
  64. package/src/skills/mentor/SKILL.md +217 -0
  65. package/src/skills/mentor/references/correction-rules.md +210 -0
  66. package/src/skills/mentor/references/knowledge-profile.md +91 -0
  67. package/src/skills/mentor/references/persona-profile.md +138 -0
  68. package/src/skills/mentor/references/taste-profile.md +128 -0
  69. package/src/skills/mentor/references/thought-style-profile.md +138 -0
  70. package/src/skills/mentor/references/work-profile.md +289 -0
  71. package/src/skills/mentor/references/workflow-profile.md +240 -0
  72. package/src/skills/optimize/SKILL.md +1 -0
  73. package/src/skills/rebuttal/SKILL.md +1 -0
  74. package/src/skills/review/SKILL.md +1 -0
  75. package/src/skills/scout/SKILL.md +8 -0
  76. package/src/skills/write/SKILL.md +1 -0
  77. package/src/tui/dist/app/AppContainer.js +19 -11
  78. package/src/tui/dist/index.js +4 -1
  79. package/src/tui/dist/lib/api.js +33 -3
  80. package/src/tui/package.json +1 -1
  81. package/src/ui/dist/assets/AiManusChatView-COFACy7V.js +204 -0
  82. package/src/ui/dist/assets/AnalysisPlugin-DnSm0GZn.js +1 -0
  83. package/src/ui/dist/assets/CliPlugin-CvwCmDQ5.js +109 -0
  84. package/src/ui/dist/assets/CodeEditorPlugin-cOqSa0xq.js +2 -0
  85. package/src/ui/dist/assets/CodeViewerPlugin-itb0tltR.js +270 -0
  86. package/src/ui/dist/assets/DocViewerPlugin-DqKkiCI6.js +7 -0
  87. package/src/ui/dist/assets/GitCommitViewerPlugin-DVgNHBCS.js +1 -0
  88. package/src/ui/dist/assets/GitDiffViewerPlugin-DxL2ezFG.js +6 -0
  89. package/src/ui/dist/assets/GitSnapshotViewer-B_RQm1YZ.js +30 -0
  90. package/src/ui/dist/assets/ImageViewerPlugin-tHqlXY3n.js +26 -0
  91. package/src/ui/dist/assets/LabCopilotPanel-ClMbq5Yu.js +14 -0
  92. package/src/ui/dist/assets/LabPlugin-L_SuE8ow.js +22 -0
  93. package/src/ui/dist/assets/LatexPlugin-B495DTXC.js +25 -0
  94. package/src/ui/dist/assets/MarkdownViewerPlugin-DG28-61B.js +128 -0
  95. package/src/ui/dist/assets/MarketplacePlugin-BiOGT-Kj.js +13 -0
  96. package/src/ui/dist/assets/{NotebookEditor-CccQYZjX.css → NotebookEditor-BHH8rdGj.css} +1 -1
  97. package/src/ui/dist/assets/NotebookEditor-BOr3x3Ej.css +1 -0
  98. package/src/ui/dist/assets/NotebookEditor-C-4Kt1p9.js +81 -0
  99. package/src/ui/dist/assets/NotebookEditor-CVsj8h_T.js +361 -0
  100. package/src/ui/dist/assets/PdfLoader-CASDQmxJ.js +16 -0
  101. package/src/ui/dist/assets/PdfLoader-Cy5jtWrr.css +1 -0
  102. package/src/ui/dist/assets/PdfMarkdownPlugin-BFhwoKsY.js +1 -0
  103. package/src/ui/dist/assets/PdfViewerPlugin-DcOzU9vd.js +17 -0
  104. package/src/ui/dist/assets/PdfViewerPlugin-nwwE-fjJ.css +1 -0
  105. package/src/ui/dist/assets/SearchPlugin-CHj7M58O.js +16 -0
  106. package/src/ui/dist/assets/SearchPlugin-DA4en4hK.css +1 -0
  107. package/src/ui/dist/assets/TextViewerPlugin-CB4DYfWO.js +54 -0
  108. package/src/ui/dist/assets/VNCViewer-CjlbyCB3.js +11 -0
  109. package/src/ui/dist/assets/bot-CFkZY-JP.js +6 -0
  110. package/src/ui/dist/assets/browser-CTB2jwNe.js +8 -0
  111. package/src/ui/dist/assets/chevron-up-Dq5ofbht.js +6 -0
  112. package/src/ui/dist/assets/code-DLC6G24T.js +6 -0
  113. package/src/ui/dist/assets/file-content-Dv4LoZec.js +1 -0
  114. package/src/ui/dist/assets/file-diff-panel-Denq-lC3.js +1 -0
  115. package/src/ui/dist/assets/file-jump-queue-DA-SdG__.js +1 -0
  116. package/src/ui/dist/assets/file-socket-Cu4Qln7Y.js +1 -0
  117. package/src/ui/dist/assets/git-commit-horizontal-BUh6G52n.js +6 -0
  118. package/src/ui/dist/assets/image-B9HUUddG.js +6 -0
  119. package/src/ui/dist/assets/index-B2B1sg-M.js +1 -0
  120. package/src/ui/dist/assets/index-Cgla8biy.css +33 -0
  121. package/src/ui/dist/assets/index-DRyx7vAc.js +1 -0
  122. package/src/ui/dist/assets/index-Gbl53BNp.js +2496 -0
  123. package/src/ui/dist/assets/index-wQ7RIIRd.js +11 -0
  124. package/src/ui/dist/assets/monaco-CiHMMNH_.js +1 -0
  125. package/src/ui/dist/assets/pdf-effect-queue-ZtnHFCAi.js +6 -0
  126. package/src/ui/dist/assets/plugin-monaco-C8UgLomw.js +19 -0
  127. package/src/ui/dist/assets/plugin-notebook-HbW2K-1c.js +169 -0
  128. package/src/ui/dist/assets/plugin-pdf-CR8hgQBV.js +357 -0
  129. package/src/ui/dist/assets/plugin-terminal-MXFIPun8.js +227 -0
  130. package/src/ui/dist/assets/popover-DL6h35vr.js +1 -0
  131. package/src/ui/dist/assets/project-sync-CsX08Qno.js +1 -0
  132. package/src/ui/dist/assets/select-DvmXt1yY.js +11 -0
  133. package/src/ui/dist/assets/sigma-7jpXazui.js +6 -0
  134. package/src/ui/dist/assets/trash-xA7kFt8i.js +11 -0
  135. package/src/ui/dist/assets/useCliAccess-DsMwDjOp.js +1 -0
  136. package/src/ui/dist/assets/useFileDiffOverlay-FuhcnKiw.js +1 -0
  137. package/src/ui/dist/assets/wrap-text-CwMn-iqb.js +11 -0
  138. package/src/ui/dist/assets/zoom-out-R-GWEhzS.js +11 -0
  139. package/src/ui/dist/index.html +5 -2
  140. package/src/ui/dist/assets/AiManusChatView-DDjbFnbt.js +0 -26597
  141. package/src/ui/dist/assets/AnalysisPlugin-Yb5IdmaU.js +0 -123
  142. package/src/ui/dist/assets/CliPlugin-e64sreyu.js +0 -31037
  143. package/src/ui/dist/assets/CodeEditorPlugin-C4D2TIkU.js +0 -427
  144. package/src/ui/dist/assets/CodeViewerPlugin-BVoNZIvC.js +0 -905
  145. package/src/ui/dist/assets/DocViewerPlugin-CLChbllo.js +0 -278
  146. package/src/ui/dist/assets/GitDiffViewerPlugin-C4xeFyFQ.js +0 -2661
  147. package/src/ui/dist/assets/ImageViewerPlugin-OiMUAcLi.js +0 -500
  148. package/src/ui/dist/assets/LabCopilotPanel-BjD2ThQF.js +0 -4104
  149. package/src/ui/dist/assets/LabPlugin-DQPg-NrB.js +0 -2677
  150. package/src/ui/dist/assets/LatexPlugin-CI05XAV9.js +0 -1792
  151. package/src/ui/dist/assets/MarkdownViewerPlugin-DpeBLYZf.js +0 -308
  152. package/src/ui/dist/assets/MarketplacePlugin-DolE58Q2.js +0 -413
  153. package/src/ui/dist/assets/NotebookEditor-7Qm2rSWD.js +0 -4214
  154. package/src/ui/dist/assets/NotebookEditor-C1kWaxKi.js +0 -84873
  155. package/src/ui/dist/assets/NotebookEditor-C3VQ7ylN.css +0 -1405
  156. package/src/ui/dist/assets/PdfLoader-BfOHw8Zw.js +0 -25468
  157. package/src/ui/dist/assets/PdfLoader-C-Y707R3.css +0 -49
  158. package/src/ui/dist/assets/PdfMarkdownPlugin-BulDREv1.js +0 -409
  159. package/src/ui/dist/assets/PdfViewerPlugin-C-daaOaL.js +0 -3095
  160. package/src/ui/dist/assets/PdfViewerPlugin-DQ11QcSf.css +0 -3627
  161. package/src/ui/dist/assets/SearchPlugin-CjpaiJ3A.js +0 -741
  162. package/src/ui/dist/assets/SearchPlugin-DDMrGDkh.css +0 -379
  163. package/src/ui/dist/assets/TextViewerPlugin-BxIyqPQC.js +0 -472
  164. package/src/ui/dist/assets/VNCViewer-HAg9mF7M.js +0 -18821
  165. package/src/ui/dist/assets/awareness-C0NPR2Dj.js +0 -292
  166. package/src/ui/dist/assets/bot-0DYntytV.js +0 -21
  167. package/src/ui/dist/assets/browser-BAcuE0Xj.js +0 -2895
  168. package/src/ui/dist/assets/code-B20Slj_w.js +0 -17
  169. package/src/ui/dist/assets/file-content-DT24KFma.js +0 -377
  170. package/src/ui/dist/assets/file-diff-panel-DK13YPql.js +0 -92
  171. package/src/ui/dist/assets/file-jump-queue-r5XKgJEV.js +0 -16
  172. package/src/ui/dist/assets/file-socket-B4T2o4nR.js +0 -58
  173. package/src/ui/dist/assets/function-B5QZkkHC.js +0 -1895
  174. package/src/ui/dist/assets/image-DSeR_sDS.js +0 -18
  175. package/src/ui/dist/assets/index-BrFje2Uk.js +0 -120
  176. package/src/ui/dist/assets/index-BwRJaoTl.js +0 -25
  177. package/src/ui/dist/assets/index-D_E4281X.js +0 -221322
  178. package/src/ui/dist/assets/index-DnYB3xb1.js +0 -159
  179. package/src/ui/dist/assets/index-G7AcWcMu.css +0 -12594
  180. package/src/ui/dist/assets/monaco-LExaAN3Y.js +0 -623
  181. package/src/ui/dist/assets/pdf-effect-queue-BJk5okWJ.js +0 -47
  182. package/src/ui/dist/assets/pdf_viewer-e0g1is2C.js +0 -8206
  183. package/src/ui/dist/assets/popover-D3Gg_FoV.js +0 -476
  184. package/src/ui/dist/assets/project-sync-C_ygLlVU.js +0 -297
  185. package/src/ui/dist/assets/select-CpAK6uWm.js +0 -1690
  186. package/src/ui/dist/assets/sigma-DEccaSgk.js +0 -22
  187. package/src/ui/dist/assets/square-check-big-uUfyVsbD.js +0 -17
  188. package/src/ui/dist/assets/trash-CXvwwSe8.js +0 -32
  189. package/src/ui/dist/assets/useCliAccess-Bnop4mgR.js +0 -957
  190. package/src/ui/dist/assets/useFileDiffOverlay-B8eUAX0I.js +0 -53
  191. package/src/ui/dist/assets/wrap-text-9vbOBpkW.js +0 -35
  192. package/src/ui/dist/assets/yjs-DncrqiZ8.js +0 -11243
  193. package/src/ui/dist/assets/zoom-out-BgVMmOW4.js +0 -34
@@ -0,0 +1,289 @@
1
+ # Mentor Work Profile
2
+
3
+ This file captures the user's stable technical standards.
4
+
5
+ ## Core operating principles
6
+
7
+ ### 1. Architecture before patching
8
+
9
+ - First identify the real system boundary.
10
+ - Then identify the real truth source.
11
+ - Only after that choose an implementation route.
12
+
13
+ Do not start from surface symptoms if the issue is obviously architectural.
14
+
15
+ ### 2. Prefer one convergent model
16
+
17
+ The user consistently prefers:
18
+
19
+ - one timeline model instead of split message vs tool models
20
+ - one viewer instead of many partial viewers
21
+ - one target contract instead of ad hoc special cases
22
+ - one durable research route instead of parallel undocumented paths
23
+
24
+ If several systems overlap, the mentor default is to merge or thin them rather than add a fourth layer.
25
+
26
+ ### 3. Backend truth first, UI second
27
+
28
+ The UI is not allowed to invent semantics that the backend cannot justify.
29
+
30
+ Good frontend work should reflect:
31
+
32
+ - the actual status model
33
+ - the actual event order
34
+ - the actual branch or worktree lineage
35
+ - the actual artifact or connector contract
36
+
37
+ If the UI looks nice but misstates truth, the result is still wrong.
38
+
39
+ ### 4. Durable state matters
40
+
41
+ The user consistently values:
42
+
43
+ - Git as durable lineage
44
+ - worktrees and branches as explicit divergence
45
+ - artifacts as durable route and result records
46
+ - files as stable state
47
+ - prompts and skills as visible workflow control
48
+
49
+ Whenever state matters, make it durable and inspectable.
50
+
51
+ ### 5. Verification is part of the implementation
52
+
53
+ The user does not treat "implemented" as complete unless it is also:
54
+
55
+ - inspected
56
+ - tested
57
+ - run
58
+ - compared against the intended contract
59
+
60
+ Preferred pattern:
61
+
62
+ 1. identify the exact failure mode
63
+ 2. patch the real leverage point
64
+ 3. run the smallest useful verification
65
+ 4. say what remains uncertain
66
+
67
+ Quest dialogue evidence adds one more hard rule:
68
+
69
+ 5. if the user points to a specific suspected mismatch, verify that specific mismatch directly before giving a broader health summary
70
+
71
+ ### 6. Prefer minimal surface expansion
72
+
73
+ Before adding:
74
+
75
+ - a new page
76
+ - a new endpoint
77
+ - a new tool
78
+ - a new state object
79
+ - a new workflow
80
+
81
+ first ask whether the current system can be extended more cleanly.
82
+
83
+ This is especially important for research and workspace flows:
84
+
85
+ - do not add a second paper viewer if the real fix is to make the existing one load the right durable object
86
+ - do not add a second experiment-tracking contract if the current artifact protocol can express it
87
+ - do not add a second progress system if the real issue is that the current progress messages are underspecified
88
+
89
+ ### 7. Make IDs, paths, and route objects explicit
90
+
91
+ The user repeatedly pushes for:
92
+
93
+ - explicit ids
94
+ - explicit path rules
95
+ - explicit route transitions
96
+ - explicit query interfaces when agent-generated ids are needed
97
+
98
+ If an agent must reference something, the system should expose a reliable way to query it.
99
+ Do not leave critical references to guesswork.
100
+
101
+ Quest conversations also show a practical preference:
102
+
103
+ - when reporting durable work, prefer exact paths and exact run / experiment / idea ids
104
+ - especially when the user is checking whether a result is real, current, or already mapped into the paper contract
105
+
106
+ Privacy boundary:
107
+
108
+ - use exact ids and exact paths for internal debugging and local workspace truth checks
109
+ - but do not surface secrets, connector conversation ids, personal handles, access tokens, or unnecessary workstation-specific absolute paths in outward-facing summaries
110
+ - if a relative path or semantic object id is sufficient, prefer that over exposing a raw local machine path
111
+
112
+ ### 8. Prompt, skill, MCP, and UI must agree
113
+
114
+ The user strongly prefers systems where:
115
+
116
+ - the prompt says the same workflow the skill expects
117
+ - the skill uses the same tool contracts the MCP server exposes
118
+ - the UI renders the same objects the backend actually persists
119
+
120
+ If these layers diverge, fix the divergence instead of documenting around it.
121
+
122
+ ### 8A. Privacy-preserving truth reporting
123
+
124
+ The user wants strong traceability, but not accidental data leakage.
125
+
126
+ Preferred rule:
127
+
128
+ - keep private truth accessible to the runtime
129
+ - expose only the minimum necessary identifier to the user-facing surface
130
+
131
+ Examples:
132
+
133
+ - okay: run id, idea id, experiment id, semantic relative path, sanitized metric summary
134
+ - avoid by default: raw connector ids, phone-like ids, OpenID-like ids, API keys, bearer tokens, machine-specific personal paths, or copied private messages that are not needed for the current task
135
+
136
+ ### 9. Current-turn user instruction overrides stale route assumptions
137
+
138
+ The user accepts strong route guidance, but not stubbornness.
139
+
140
+ If the durable state says:
141
+
142
+ - the paper is ready
143
+ - the route is sufficient
144
+ - finalize is justified
145
+
146
+ but the current-turn user instruction clearly says:
147
+
148
+ - continue experiments
149
+ - keep exploring
150
+ - expand evidence
151
+ - write a fuller paper after more supplementary work
152
+
153
+ then the active contract has changed.
154
+ Do not keep arguing from the old contract.
155
+ Briefly note the previous state if needed, then pivot and execute the new scope.
156
+
157
+ ### 10. Progress reporting must answer the real uncertainty
158
+
159
+ The user consistently values progress updates that make four things explicit:
160
+
161
+ - what is already done
162
+ - what is currently running
163
+ - what is blocked or still unknown
164
+ - what exact next checkpoint will change the decision
165
+
166
+ When the user asks about performance, execution, or delivery readiness, add a fifth requirement:
167
+
168
+ - the concrete acceptance metric or quantitative gate
169
+
170
+ Examples:
171
+
172
+ - actual batch size
173
+ - completed task count
174
+ - whether the run is `20/20`
175
+ - whether the paper is already `9.5` to `10` pages
176
+ - which supplementary experiments are already mapped into the outline or evidence ledger
177
+
178
+ Avoid vague health summaries like:
179
+
180
+ - generic "healthy" language
181
+ - generic "still progressing" language
182
+ - generic "not stalled" language
183
+
184
+ when the real user question is about:
185
+
186
+ - whether a bug exists
187
+ - whether batch size is correct
188
+ - whether an experiment really landed
189
+ - whether the paper actually includes the promised evidence
190
+
191
+ ### 11. Do not confuse control-surface updates with substantive progress
192
+
193
+ Updating:
194
+
195
+ - `PLAN.md`
196
+ - `CHECKLIST.md`
197
+ - `status.md`
198
+ - `SUMMARY.md`
199
+ - review ledgers
200
+ - experiment matrices
201
+
202
+ is useful, but it is not the same as substantive research progress unless it accompanies at least one of:
203
+
204
+ - a new measured result
205
+ - a new validated comparison
206
+ - a new manuscript delta
207
+ - a real route change
208
+ - a newly durable contract correction
209
+
210
+ When only the control surface changed, say so plainly.
211
+
212
+ ## Research-system preferences
213
+
214
+ ### 1. Shared protocol over stage-specific hacks
215
+
216
+ Review, rebuttal, supplementary experiments, connector delivery, and long-running monitoring should use shared protocols whenever possible.
217
+
218
+ The user dislikes:
219
+
220
+ - special rebuttal-only experiment systems
221
+ - separate terminal protocols when `bash_exec` could be extended
222
+ - new UI panes that duplicate an existing viewer with slightly different semantics
223
+
224
+ ### 2. State machine clarity
225
+
226
+ The user prefers workflows that can answer:
227
+
228
+ - what stage are we in?
229
+ - what artifact made that stage durable?
230
+ - what event allows the next transition?
231
+ - what is blocked on user input vs autonomous continuation?
232
+
233
+ ### 3. Human-visible continuity
234
+
235
+ The system should keep the user informed with meaningful progress, not hidden black-box execution.
236
+
237
+ Preferred pattern:
238
+
239
+ - short status while work is ongoing
240
+ - richer milestone when route or trust state changes
241
+ - explicit decision when continuation is non-trivial
242
+
243
+ Quest dialogue also shows a strong continuation preference:
244
+
245
+ - if the user clearly signals continuation, default to continuing the active task rather than re-arguing why the current route is reasonable
246
+ - explain only what is needed to keep the continuation trustworthy
247
+
248
+ ### 4. Hard operational constraints are first-class contract items
249
+
250
+ When the user specifies:
251
+
252
+ - concurrency targets
253
+ - batch size
254
+ - throughput expectations
255
+ - page-count targets
256
+ - required appendix or supplementary evidence count
257
+ - endpoint usage rules
258
+
259
+ those are not decorative preferences.
260
+ Treat them as acceptance gates that must be checked explicitly.
261
+
262
+ ## What good output looks like
263
+
264
+ Good work for this profile usually has these traits:
265
+
266
+ - conclusion-first
267
+ - specific file or contract references
268
+ - one main route, not five equal options
269
+ - clear tradeoffs
270
+ - root cause identified
271
+ - minimal but sufficient implementation plan
272
+ - verification strategy attached
273
+ - durable file and state updates synchronized to the same conclusion
274
+ - direct answer to the user's actual concern before broader background
275
+ - clear distinction between "control files updated" and "new result obtained"
276
+ - quantitative acceptance checks when the user asked for performance or completeness
277
+ - enough evidence to be auditable without exposing unnecessary private identifiers
278
+
279
+ ## What to avoid
280
+
281
+ - broad abstract advice with no leverage point
282
+ - polishing symptoms while state models remain wrong
283
+ - adding more UI around weak backend contracts
284
+ - hand-wavy references to ids, paths, or "the latest object"
285
+ - saying "done" before the route is actually verified
286
+ - using durable state as a shield against the user's new request
287
+ - repeating the same monitoring narrative after the user has already identified a likely bug
288
+ - treating user-specified performance or completeness targets as soft suggestions
289
+ - overfitting the distilled mentor profile to concrete private quest details instead of reusable standards
@@ -0,0 +1,240 @@
1
+ # Mentor Workflow Profile
2
+
3
+ This file captures the user's preferred working routines and technical norms.
4
+
5
+ ## General technical workflow
6
+
7
+ ### A. When the user asks for planning first
8
+
9
+ Preferred sequence:
10
+
11
+ 1. inspect the relevant code and current state
12
+ 2. identify the real contract and leverage points
13
+ 3. propose one clear route
14
+ 4. name risks and open questions
15
+ 5. wait for approval before edits
16
+
17
+ If the task is an audit, the preferred output is structured rather than vague prose.
18
+ Typical audit format:
19
+
20
+ - feature or component name
21
+ - intended contract or plan statement
22
+ - current implementation status
23
+ - missing part or risk
24
+ - exact file path
25
+ - optional line-level evidence
26
+
27
+ Preferred status vocabulary:
28
+
29
+ - completed
30
+ - partially completed
31
+ - missing or not implemented
32
+
33
+ Preferred audit behavior:
34
+
35
+ - keep the same item order as the governing plan
36
+ - do not hide missing items inside a prose paragraph
37
+ - make the missing part directly scannable
38
+
39
+ For larger codebase audits, the preferred process is:
40
+
41
+ 1. read the governing plan or contract first
42
+ 2. inspect only the named directories or modules
43
+ 3. map each planned feature to real implementation evidence
44
+ 4. report missing pieces in the same order as the plan
45
+
46
+ ### B. When the user wants immediate implementation
47
+
48
+ Preferred sequence:
49
+
50
+ 1. inspect the current state quickly but concretely
51
+ 2. identify the acceptance gate
52
+ 3. back up or preserve safety when the change is risky
53
+ 4. implement in the smallest coherent slice
54
+ 5. run targeted verification
55
+ 6. report what changed and what still needs checking
56
+
57
+ If the user explicitly rejected simplification, do not silently swap to a weaker surrogate architecture.
58
+ State the heavier route and implement it honestly unless blocked.
59
+
60
+ ### C. When the user reports that nothing changed
61
+
62
+ Preferred sequence:
63
+
64
+ 1. verify the actual rendered source of truth
65
+ 2. check build, cache, route, variant, and runtime wiring
66
+ 3. confirm the modified file is really the live one
67
+ 4. only then claim the change is present
68
+
69
+ This pattern appears repeatedly in historical interactive coding sessions.
70
+
71
+ Typical hidden causes the mentor should check early:
72
+
73
+ - editing the wrong component variant
74
+ - editing source while the app serves a compiled or standalone copy
75
+ - frontend not rebuilt or not restarted
76
+ - route points to a different dashboard, enhanced component, or plugin entry
77
+ - cache or generated asset mismatch
78
+
79
+ And when the user says "the change is not visible", do not stop at source inspection.
80
+ Check:
81
+
82
+ - the actual entry component
83
+ - the actual loaded variant
84
+ - the actual served bundle
85
+ - whether the edited code path is the one the runtime is using
86
+
87
+ ## Research-task workflow
88
+
89
+ ### A. For baseline or experiment work
90
+
91
+ The user consistently wants:
92
+
93
+ - explicit runtime configuration
94
+ - explicit throughput or concurrency validation when performance matters
95
+ - real smoke tests before broad runs
96
+ - measured checkpoints instead of vague monitor messages
97
+
98
+ Preferred reporting format:
99
+
100
+ - baseline / run status
101
+ - current completed tasks or examples
102
+ - current quantitative gate
103
+ - current blocker or uncertainty
104
+ - next checkpoint
105
+
106
+ When the user questions runtime quality, also add:
107
+
108
+ - the exact runtime parameter under suspicion
109
+ - the currently measured value
110
+ - whether that value satisfies the requested target
111
+
112
+ ### B. For analysis and supplementary experiments
113
+
114
+ The user prefers:
115
+
116
+ - preserve usable old experiments if still relevant
117
+ - inventory them explicitly
118
+ - map them into outline / evidence ledger / appendix or reject them honestly
119
+ - only run new supplementary experiments when a real gap remains
120
+
121
+ When the user asks "what can be kept?" or "what is still missing?", prefer:
122
+
123
+ - explicit retained experiment list
124
+ - explicit rejected or historical-only list
125
+ - explicit missing-evidence list
126
+ - explicit next-experiment list only if the gap is real
127
+
128
+ ### C. For writing and paper work
129
+
130
+ The user expects:
131
+
132
+ - real page-count awareness
133
+ - main paper vs appendix distinction
134
+ - evidence actually mapped into the paper contract
135
+ - a complete paper, not just a compile-clean draft
136
+
137
+ When reporting paper progress, separate:
138
+
139
+ - compile status
140
+ - page-count status
141
+ - evidence-mapping status
142
+ - appendix status
143
+ - remaining scientific gaps
144
+
145
+ If the user asks for more experiments before the final paper, treat that as an active scope expansion, not as confusion.
146
+
147
+ ## Product and frontend workflow
148
+
149
+ ### A. UI redesign tasks
150
+
151
+ The user usually wants:
152
+
153
+ - visual improvement
154
+ - but with real product coherence
155
+ - and without random component dumping
156
+
157
+ Preferred workflow:
158
+
159
+ 1. understand actual page structure and rendered source
160
+ 2. define visual direction
161
+ 3. preserve or improve contract clarity
162
+ 4. implement
163
+ 5. verify the result is actually visible in the running app
164
+
165
+ Preferred visual direction from history:
166
+
167
+ - light background
168
+ - controlled motion
169
+ - "good-looking" but not cluttered
170
+ - not random component dumping
171
+ - preserve the product's own identity
172
+
173
+ When the user asks for beauty improvements, the workflow should still include:
174
+
175
+ - why this component is being added
176
+ - which existing contract it supports
177
+ - what visual clutter it replaces or avoids
178
+
179
+ ### B. Admin / settings / auth flows
180
+
181
+ The user expects:
182
+
183
+ - frontend and backend to stay consistent
184
+ - validation errors to be surfaced clearly
185
+ - actual user-visible behavior to match database rules
186
+ - if a token or invitation flow exists, it must be functionally and visually coherent
187
+
188
+ When the task spans frontend plus backend:
189
+
190
+ - verify request payloads and backend validation agree
191
+ - verify saved state is visible in the real admin surface
192
+ - verify user-facing success and error states match backend semantics
193
+
194
+ When the task spans more than one subsystem, the user often expects an explicit coordination list.
195
+ Typical shape:
196
+
197
+ - frontend files
198
+ - backend files
199
+ - data model or API contract
200
+ - migration or bootstrap implications
201
+ - verification steps
202
+
203
+ ## Verification norms
204
+
205
+ The user strongly prefers:
206
+
207
+ - unit tests when logic changes
208
+ - live smoke or e2e checks when runtime behavior matters
209
+ - explicit statement when a test was not possible
210
+ - explicit statement of what was verified vs only reasoned about
211
+
212
+ Additional norm from historical interactive coding sessions:
213
+
214
+ - after implementation, verify the user can actually see or trigger the changed behavior
215
+ - do not treat code edits alone as proof
216
+ - when the task asked for exhaustive or comprehensive coverage, return to the checklist and verify each requested item was addressed
217
+
218
+ ## Working-style markers from history
219
+
220
+ Repeated user-side signals across historical coding sessions point to these workflow contracts:
221
+
222
+ - think carefully when planning
223
+ - be careful when changing
224
+ - keep cross-layer consistency
225
+ - maintain momentum when continuation is requested
226
+ - preserve safety on risky edits
227
+ - back up when the user explicitly asks for it or when the edit surface is brittle
228
+ - produce todo lists or checklists when the change spans many coupled files
229
+ - for explorer or subagent-style work, keep each subtask narrow and return a directly usable summary
230
+
231
+ ## Workflow anti-patterns
232
+
233
+ Avoid:
234
+
235
+ - editing before identifying the real live code path
236
+ - claiming completion without testing the actual acceptance gate
237
+ - treating a control-file rewrite as equivalent to experiment or paper progress
238
+ - continuing to narrate health after the user has asked for exact verification
239
+ - giving an audit without a structured feature-to-file status table when the user explicitly asked for a comprehensive audit
240
+ - silently simplifying a requested integration after the user has explicitly rejected simplification
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: optimize
3
3
  description: Use when an algorithm-first quest should manage candidate briefs, optimization frontier, branch promotion, or fusion-aware search instead of the paper-oriented default loop.
4
+ skill_role: stage
4
5
  ---
5
6
 
6
7
  # Optimize
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: rebuttal
3
3
  description: Use when a quest already has a paper, draft, or review package and the task is to map reviewer feedback into experiments, manuscript deltas, and a durable rebuttal / revision response.
4
+ skill_role: companion
4
5
  ---
5
6
 
6
7
  # Rebuttal
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: review
3
3
  description: Use when a draft, paper, or paper-like report is substantial enough for an independent skeptical audit before finalization, rebuttal, or revision routing.
4
+ skill_role: companion
4
5
  ---
5
6
 
6
7
  # Review
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: scout
3
3
  description: Use when a quest needs problem framing, literature scouting, dataset or metric clarification, or baseline discovery before deeper work.
4
+ skill_role: stage
4
5
  ---
5
6
 
6
7
  # Scout
@@ -15,6 +16,13 @@ Use this skill when the quest does not yet have a stable research frame.
15
16
  - If a threaded user reply arrives, interpret it relative to the latest scout progress update before assuming the task changed completely.
16
17
  - When scouting actually resolves the framing ambiguity, locks the evaluation contract, or makes the next anchor obvious, send one richer `artifact.interact(kind='milestone', reply_mode='threaded', ...)` update that says what is now clear, why it matters, and which stage should come next.
17
18
 
19
+ ## Tool discipline
20
+
21
+ - **Do not use native `shell_command` / `command_execution` in this skill.**
22
+ - **Any shell, CLI, Python, bash, node, git, npm, uv, or repo-inspection execution must go through `bash_exec(...)`.**
23
+ - **For git inspection inside the current quest repository or worktree, prefer `artifact.git(...)` before raw shell git commands.**
24
+ - **If scouting only needs durable quest context, prefer `artifact.read_quest_documents(...)`, `artifact.get_quest_state(...)`, and `memory.*` instead of shelling out.**
25
+
18
26
  ## Stage purpose
19
27
 
20
28
  The scout stage exists to answer the smallest set of framing questions required to make the rest of the quest efficient:
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: write
3
3
  description: Use when a quest has enough evidence to draft or refine a paper, report, or research summary without inventing missing support.
4
+ skill_role: stage
4
5
  ---
5
6
 
6
7
  # Write
@@ -93,16 +93,18 @@ const buildQuestConfigItems = (questId, questRoot) => {
93
93
  documentId: 'path::quest.yaml',
94
94
  },
95
95
  ];
96
- const codexPath = `${questRoot}/.codex/config.toml`;
97
- if (fs.existsSync(codexPath)) {
96
+ const codexCandidates = [`${questRoot}/.ds/codex-home/config.toml`, `${questRoot}/.codex/config.toml`];
97
+ const codexPath = codexCandidates.find((candidate) => fs.existsSync(candidate));
98
+ if (codexPath) {
99
+ const relativeCodexPath = codexPath.replace(`${questRoot}/`, '');
98
100
  items.push({
99
- id: `quest:${questId}:.codex/config.toml`,
101
+ id: `quest:${questId}:${relativeCodexPath}`,
100
102
  scope: 'quest',
101
- name: '.codex/config.toml',
102
- title: '.codex/config.toml',
103
+ name: relativeCodexPath,
104
+ title: relativeCodexPath,
103
105
  path: codexPath,
104
106
  writable: true,
105
- documentId: 'path::.codex/config.toml',
107
+ documentId: `path::${relativeCodexPath}`,
106
108
  });
107
109
  }
108
110
  return items;
@@ -480,18 +482,21 @@ function openBrowser(url) {
480
482
  }
481
483
  spawn('xdg-open', [url], { detached: true, stdio: 'ignore' }).unref();
482
484
  }
483
- function buildProjectsUrl(baseUrl) {
485
+ function buildProjectsUrl(baseUrl, authToken) {
484
486
  const target = new URL(baseUrl);
485
487
  if (target.hostname === '0.0.0.0') {
486
488
  target.hostname = '127.0.0.1';
487
489
  }
488
490
  target.pathname = '/projects';
489
491
  target.search = '';
492
+ if (authToken) {
493
+ target.searchParams.set('token', authToken);
494
+ }
490
495
  return target.toString();
491
496
  }
492
- function buildProjectUrl(baseUrl, questId) {
497
+ function buildProjectUrl(baseUrl, questId, authToken) {
493
498
  if (!questId) {
494
- return buildProjectsUrl(baseUrl);
499
+ return buildProjectsUrl(baseUrl, authToken);
495
500
  }
496
501
  const target = new URL(baseUrl);
497
502
  if (target.hostname === '0.0.0.0') {
@@ -499,9 +504,12 @@ function buildProjectUrl(baseUrl, questId) {
499
504
  }
500
505
  target.pathname = `/projects/${questId}`;
501
506
  target.search = '';
507
+ if (authToken) {
508
+ target.searchParams.set('token', authToken);
509
+ }
502
510
  return target.toString();
503
511
  }
504
- export const AppContainer = ({ baseUrl, initialQuestId = null, }) => {
512
+ export const AppContainer = ({ baseUrl, initialQuestId = null, authToken = null, }) => {
505
513
  const { exit } = useApp();
506
514
  const [quests, setQuests] = useState([]);
507
515
  const [connectors, setConnectors] = useState([]);
@@ -2540,7 +2548,7 @@ export const AppContainer = ({ baseUrl, initialQuestId = null, }) => {
2540
2548
  return;
2541
2549
  }
2542
2550
  if (key.ctrl && value.toLowerCase() === 'o') {
2543
- openBrowser(buildProjectUrl(baseUrl, activeQuestId || browseQuestId));
2551
+ openBrowser(buildProjectUrl(baseUrl, activeQuestId || browseQuestId, authToken));
2544
2552
  return;
2545
2553
  }
2546
2554
  if (key.ctrl && value.toLowerCase() === 'g') {
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { render } from 'ink';
3
3
  import { AppContainer } from './app/AppContainer.js';
4
+ import { setDaemonAuthToken } from './lib/api.js';
4
5
  import { isAlternateBufferEnabled, isIncrementalRenderingEnabled } from './utils/terminal.js';
5
6
  const CLEAR_TO_END = '\x1b[0K';
6
7
  const BRACKETED_PASTE_ENABLE = '\x1b[?2004h';
@@ -31,6 +32,8 @@ function parseArg(name) {
31
32
  }
32
33
  const baseUrl = parseArg('--base-url') ?? 'http://0.0.0.0:20999';
33
34
  const questId = parseArg('--quest-id');
35
+ const authToken = parseArg('--auth-token');
36
+ setDaemonAuthToken(authToken);
34
37
  const useAlternateBuffer = isAlternateBufferEnabled();
35
38
  const useIncrementalRendering = isIncrementalRenderingEnabled();
36
39
  const setBracketedPasteMode = (enabled) => {
@@ -54,7 +57,7 @@ const closeBracketedPasteMode = () => {
54
57
  };
55
58
  setBracketedPasteMode(true);
56
59
  process.once('exit', closeBracketedPasteMode);
57
- const instance = render(React.createElement(AppContainer, { baseUrl: baseUrl, initialQuestId: questId }), {
60
+ const instance = render(React.createElement(AppContainer, { baseUrl: baseUrl, initialQuestId: questId, authToken: authToken }), {
58
61
  stdout: withLineClearing(process.stdout),
59
62
  stderr: process.stderr,
60
63
  stdin: process.stdin,