@blulotus/trellis 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/README.md +2 -2
  2. package/dist/cli/index.js +2 -29
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/init.d.ts +0 -22
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +5 -12
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/mem.d.ts +2 -2
  9. package/dist/commands/mem.d.ts.map +1 -1
  10. package/dist/commands/mem.js +7 -40
  11. package/dist/commands/mem.js.map +1 -1
  12. package/dist/commands/uninstall.d.ts +1 -1
  13. package/dist/commands/uninstall.d.ts.map +1 -1
  14. package/dist/commands/uninstall.js +4 -34
  15. package/dist/commands/uninstall.js.map +1 -1
  16. package/dist/commands/update.d.ts.map +1 -1
  17. package/dist/commands/update.js +2 -28
  18. package/dist/commands/update.js.map +1 -1
  19. package/dist/configurators/index.d.ts.map +1 -1
  20. package/dist/configurators/index.js +7 -73
  21. package/dist/configurators/index.js.map +1 -1
  22. package/dist/configurators/shared.d.ts +18 -70
  23. package/dist/configurators/shared.d.ts.map +1 -1
  24. package/dist/configurators/shared.js +20 -299
  25. package/dist/configurators/shared.js.map +1 -1
  26. package/dist/configurators/workflow.d.ts +0 -14
  27. package/dist/configurators/workflow.d.ts.map +1 -1
  28. package/dist/configurators/workflow.js +1 -37
  29. package/dist/configurators/workflow.js.map +1 -1
  30. package/dist/migrations/manifests/0.1.9.json +0 -12
  31. package/dist/migrations/manifests/0.2.14.json +0 -84
  32. package/dist/migrations/manifests/0.3.0-beta.0.json +0 -87
  33. package/dist/migrations/manifests/0.3.4.json +1 -13
  34. package/dist/migrations/manifests/0.4.0-beta.1.json +24 -176
  35. package/dist/migrations/manifests/0.5.0-beta.0.json +67 -1203
  36. package/dist/migrations/manifests/0.5.0-beta.15.json +0 -96
  37. package/dist/migrations/manifests/0.5.0-beta.5.json +0 -168
  38. package/dist/migrations/manifests/0.5.0-beta.9.json +0 -20
  39. package/dist/migrations/manifests/0.6.0-beta.23.json +0 -66
  40. package/dist/migrations/manifests/0.6.3.json +1 -16
  41. package/dist/migrations/manifests/0.6.6.json +1 -9
  42. package/dist/migrations/manifests/0.7.0.json +9 -0
  43. package/dist/migrations/manifests/0.7.1.json +9 -0
  44. package/dist/migrations/manifests/0.7.2.json +9 -0
  45. package/dist/migrations/manifests/0.8.0.json +9 -0
  46. package/dist/templates/codex/hooks/session-start.py +37 -13
  47. package/dist/templates/codex/hooks.json +5 -0
  48. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +5 -5
  49. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +0 -10
  50. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +1 -1
  51. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +1 -13
  52. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +2 -2
  53. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +9 -28
  54. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +5 -5
  55. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +1 -1
  56. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +1 -17
  57. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +4 -12
  58. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +6 -6
  59. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +5 -75
  60. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +0 -16
  61. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +1 -1
  62. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +2 -3
  63. package/dist/templates/common/commands/continue.md +24 -4
  64. package/dist/templates/common/commands/finish-work.md +19 -9
  65. package/dist/templates/common/commands/start.md +38 -29
  66. package/dist/templates/extract.d.ts +0 -10
  67. package/dist/templates/extract.d.ts.map +1 -1
  68. package/dist/templates/extract.js +0 -24
  69. package/dist/templates/extract.js.map +1 -1
  70. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +7 -9
  71. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +4 -8
  72. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +5 -5
  73. package/dist/templates/shared-hooks/index.d.ts +11 -43
  74. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  75. package/dist/templates/shared-hooks/index.js +9 -86
  76. package/dist/templates/shared-hooks/index.js.map +1 -1
  77. package/dist/templates/shared-hooks/inject-spec-context.py +1 -1
  78. package/dist/templates/shared-hooks/inject-subagent-context.py +23 -85
  79. package/dist/templates/shared-hooks/inject-workflow-state.py +56 -86
  80. package/dist/templates/shared-hooks/session-start.py +76 -98
  81. package/dist/templates/trellis/config.yaml +8 -8
  82. package/dist/templates/trellis/index.d.ts +1 -4
  83. package/dist/templates/trellis/index.d.ts.map +1 -1
  84. package/dist/templates/trellis/index.js +1 -5
  85. package/dist/templates/trellis/index.js.map +1 -1
  86. package/dist/templates/trellis/scripts/add_session.py +12 -11
  87. package/dist/templates/trellis/scripts/common/__init__.py +2 -0
  88. package/dist/templates/trellis/scripts/common/active_task.py +80 -152
  89. package/dist/templates/trellis/scripts/common/config.py +7 -7
  90. package/dist/templates/trellis/scripts/common/git_context.py +1 -1
  91. package/dist/templates/trellis/scripts/common/session_context.py +2 -2
  92. package/dist/templates/trellis/scripts/common/spec_inject.py +2 -2
  93. package/dist/templates/trellis/scripts/common/task_store.py +8 -28
  94. package/dist/templates/trellis/scripts/common/workflow_phase.py +4 -8
  95. package/dist/templates/trellis/scripts/get_context.py +2 -2
  96. package/dist/templates/trellis/scripts/init_developer.py +1 -1
  97. package/dist/templates/trellis/scripts/task.py +90 -57
  98. package/dist/templates/trellis/workflow.md +44 -66
  99. package/dist/types/ai-tools.d.ts +10 -10
  100. package/dist/types/ai-tools.d.ts.map +1 -1
  101. package/dist/types/ai-tools.js +3 -434
  102. package/dist/types/ai-tools.js.map +1 -1
  103. package/dist/utils/uninstall-scrubbers.d.ts +3 -18
  104. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  105. package/dist/utils/uninstall-scrubbers.js +24 -154
  106. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  107. package/package.json +2 -2
  108. package/dist/configurators/antigravity.d.ts +0 -7
  109. package/dist/configurators/antigravity.d.ts.map +0 -1
  110. package/dist/configurators/antigravity.js +0 -11
  111. package/dist/configurators/antigravity.js.map +0 -1
  112. package/dist/configurators/codebuddy.d.ts +0 -10
  113. package/dist/configurators/codebuddy.d.ts.map +0 -1
  114. package/dist/configurators/codebuddy.js +0 -24
  115. package/dist/configurators/codebuddy.js.map +0 -1
  116. package/dist/configurators/copilot.d.ts +0 -14
  117. package/dist/configurators/copilot.d.ts.map +0 -1
  118. package/dist/configurators/copilot.js +0 -46
  119. package/dist/configurators/copilot.js.map +0 -1
  120. package/dist/configurators/cursor.d.ts +0 -10
  121. package/dist/configurators/cursor.d.ts.map +0 -1
  122. package/dist/configurators/cursor.js +0 -23
  123. package/dist/configurators/cursor.js.map +0 -1
  124. package/dist/configurators/devin.d.ts +0 -8
  125. package/dist/configurators/devin.d.ts.map +0 -1
  126. package/dist/configurators/devin.js +0 -12
  127. package/dist/configurators/devin.js.map +0 -1
  128. package/dist/configurators/droid.d.ts +0 -10
  129. package/dist/configurators/droid.d.ts.map +0 -1
  130. package/dist/configurators/droid.js +0 -24
  131. package/dist/configurators/droid.js.map +0 -1
  132. package/dist/configurators/dsh.d.ts +0 -26
  133. package/dist/configurators/dsh.d.ts.map +0 -1
  134. package/dist/configurators/dsh.js +0 -76
  135. package/dist/configurators/dsh.js.map +0 -1
  136. package/dist/configurators/gemini.d.ts +0 -18
  137. package/dist/configurators/gemini.d.ts.map +0 -1
  138. package/dist/configurators/gemini.js +0 -39
  139. package/dist/configurators/gemini.js.map +0 -1
  140. package/dist/configurators/grok.d.ts +0 -17
  141. package/dist/configurators/grok.d.ts.map +0 -1
  142. package/dist/configurators/grok.js +0 -38
  143. package/dist/configurators/grok.js.map +0 -1
  144. package/dist/configurators/kilo.d.ts +0 -7
  145. package/dist/configurators/kilo.d.ts.map +0 -1
  146. package/dist/configurators/kilo.js +0 -11
  147. package/dist/configurators/kilo.js.map +0 -1
  148. package/dist/configurators/kimi.d.ts +0 -26
  149. package/dist/configurators/kimi.d.ts.map +0 -1
  150. package/dist/configurators/kimi.js +0 -74
  151. package/dist/configurators/kimi.js.map +0 -1
  152. package/dist/configurators/kiro.d.ts +0 -11
  153. package/dist/configurators/kiro.d.ts.map +0 -1
  154. package/dist/configurators/kiro.js +0 -30
  155. package/dist/configurators/kiro.js.map +0 -1
  156. package/dist/configurators/omp.d.ts +0 -6
  157. package/dist/configurators/omp.d.ts.map +0 -1
  158. package/dist/configurators/omp.js +0 -28
  159. package/dist/configurators/omp.js.map +0 -1
  160. package/dist/configurators/opencode.d.ts +0 -5
  161. package/dist/configurators/opencode.d.ts.map +0 -1
  162. package/dist/configurators/opencode.js +0 -84
  163. package/dist/configurators/opencode.js.map +0 -1
  164. package/dist/configurators/pi.d.ts +0 -5
  165. package/dist/configurators/pi.d.ts.map +0 -1
  166. package/dist/configurators/pi.js +0 -39
  167. package/dist/configurators/pi.js.map +0 -1
  168. package/dist/configurators/qoder.d.ts +0 -12
  169. package/dist/configurators/qoder.d.ts.map +0 -1
  170. package/dist/configurators/qoder.js +0 -30
  171. package/dist/configurators/qoder.js.map +0 -1
  172. package/dist/configurators/reasonix.d.ts +0 -17
  173. package/dist/configurators/reasonix.d.ts.map +0 -1
  174. package/dist/configurators/reasonix.js +0 -37
  175. package/dist/configurators/reasonix.js.map +0 -1
  176. package/dist/configurators/snow.d.ts +0 -25
  177. package/dist/configurators/snow.d.ts.map +0 -1
  178. package/dist/configurators/snow.js +0 -69
  179. package/dist/configurators/snow.js.map +0 -1
  180. package/dist/configurators/trae.d.ts +0 -16
  181. package/dist/configurators/trae.d.ts.map +0 -1
  182. package/dist/configurators/trae.js +0 -34
  183. package/dist/configurators/trae.js.map +0 -1
  184. package/dist/configurators/zcode.d.ts +0 -23
  185. package/dist/configurators/zcode.d.ts.map +0 -1
  186. package/dist/configurators/zcode.js +0 -63
  187. package/dist/configurators/zcode.js.map +0 -1
  188. package/dist/templates/codebuddy/agents/trellis-check.md +0 -115
  189. package/dist/templates/codebuddy/agents/trellis-implement.md +0 -115
  190. package/dist/templates/codebuddy/agents/trellis-research.md +0 -137
  191. package/dist/templates/codebuddy/index.d.ts +0 -15
  192. package/dist/templates/codebuddy/index.d.ts.map +0 -1
  193. package/dist/templates/codebuddy/index.js +0 -15
  194. package/dist/templates/codebuddy/index.js.map +0 -1
  195. package/dist/templates/codebuddy/settings.json +0 -69
  196. package/dist/templates/copilot/copilot-instructions.md +0 -11
  197. package/dist/templates/copilot/hooks/session-start.py +0 -564
  198. package/dist/templates/copilot/hooks.json +0 -19
  199. package/dist/templates/copilot/index.d.ts +0 -28
  200. package/dist/templates/copilot/index.d.ts.map +0 -1
  201. package/dist/templates/copilot/index.js +0 -61
  202. package/dist/templates/copilot/index.js.map +0 -1
  203. package/dist/templates/copilot/prompts/before-dev.prompt.md +0 -39
  204. package/dist/templates/copilot/prompts/brainstorm.prompt.md +0 -173
  205. package/dist/templates/copilot/prompts/break-loop.prompt.md +0 -129
  206. package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +0 -170
  207. package/dist/templates/copilot/prompts/check.prompt.md +0 -110
  208. package/dist/templates/copilot/prompts/create-command.prompt.md +0 -116
  209. package/dist/templates/copilot/prompts/finish-work.prompt.md +0 -99
  210. package/dist/templates/copilot/prompts/integrate-skill.prompt.md +0 -223
  211. package/dist/templates/copilot/prompts/onboard.prompt.md +0 -362
  212. package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
  213. package/dist/templates/copilot/prompts/record-session.prompt.md +0 -66
  214. package/dist/templates/copilot/prompts/start.prompt.md +0 -63
  215. package/dist/templates/copilot/prompts/update-spec.prompt.md +0 -358
  216. package/dist/templates/cursor/agents/trellis-check.md +0 -114
  217. package/dist/templates/cursor/agents/trellis-implement.md +0 -114
  218. package/dist/templates/cursor/agents/trellis-research.md +0 -136
  219. package/dist/templates/cursor/hooks.json +0 -24
  220. package/dist/templates/cursor/index.d.ts +0 -13
  221. package/dist/templates/cursor/index.d.ts.map +0 -1
  222. package/dist/templates/cursor/index.js +0 -13
  223. package/dist/templates/cursor/index.js.map +0 -1
  224. package/dist/templates/droid/droids/trellis-check.md +0 -107
  225. package/dist/templates/droid/droids/trellis-implement.md +0 -107
  226. package/dist/templates/droid/droids/trellis-research.md +0 -137
  227. package/dist/templates/droid/index.d.ts +0 -15
  228. package/dist/templates/droid/index.d.ts.map +0 -1
  229. package/dist/templates/droid/index.js +0 -15
  230. package/dist/templates/droid/index.js.map +0 -1
  231. package/dist/templates/droid/settings.json +0 -69
  232. package/dist/templates/dsh/DSH.md +0 -80
  233. package/dist/templates/dsh/agents/trellis-check.md +0 -99
  234. package/dist/templates/dsh/agents/trellis-implement.md +0 -106
  235. package/dist/templates/dsh/agents/trellis-research.md +0 -134
  236. package/dist/templates/dsh/index.d.ts +0 -22
  237. package/dist/templates/dsh/index.d.ts.map +0 -1
  238. package/dist/templates/dsh/index.js +0 -27
  239. package/dist/templates/dsh/index.js.map +0 -1
  240. package/dist/templates/gemini/agents/trellis-check.md +0 -107
  241. package/dist/templates/gemini/agents/trellis-implement.md +0 -107
  242. package/dist/templates/gemini/agents/trellis-research.md +0 -136
  243. package/dist/templates/gemini/index.d.ts +0 -13
  244. package/dist/templates/gemini/index.d.ts.map +0 -1
  245. package/dist/templates/gemini/index.js +0 -13
  246. package/dist/templates/gemini/index.js.map +0 -1
  247. package/dist/templates/gemini/settings.json +0 -40
  248. package/dist/templates/grok/agents/trellis-check.md +0 -106
  249. package/dist/templates/grok/agents/trellis-implement.md +0 -121
  250. package/dist/templates/grok/agents/trellis-research.md +0 -146
  251. package/dist/templates/grok/index.d.ts +0 -16
  252. package/dist/templates/grok/index.d.ts.map +0 -1
  253. package/dist/templates/grok/index.js +0 -19
  254. package/dist/templates/grok/index.js.map +0 -1
  255. package/dist/templates/kimi/agents/trellis-check.md +0 -104
  256. package/dist/templates/kimi/agents/trellis-implement.md +0 -120
  257. package/dist/templates/kimi/agents/trellis-research.md +0 -144
  258. package/dist/templates/kimi/index.d.ts +0 -20
  259. package/dist/templates/kimi/index.d.ts.map +0 -1
  260. package/dist/templates/kimi/index.js +0 -23
  261. package/dist/templates/kimi/index.js.map +0 -1
  262. package/dist/templates/kiro/agents/trellis-check.json +0 -26
  263. package/dist/templates/kiro/agents/trellis-implement.json +0 -26
  264. package/dist/templates/kiro/agents/trellis-research.json +0 -30
  265. package/dist/templates/kiro/agents/trellis.json +0 -34
  266. package/dist/templates/kiro/hooks/trellis-workflow-state.kiro.hook +0 -14
  267. package/dist/templates/kiro/index.d.ts +0 -32
  268. package/dist/templates/kiro/index.d.ts.map +0 -1
  269. package/dist/templates/kiro/index.js +0 -28
  270. package/dist/templates/kiro/index.js.map +0 -1
  271. package/dist/templates/omp/agents/trellis-check.md +0 -41
  272. package/dist/templates/omp/agents/trellis-implement.md +0 -55
  273. package/dist/templates/omp/agents/trellis-research.md +0 -30
  274. package/dist/templates/omp/extensions/trellis/index.ts.txt +0 -592
  275. package/dist/templates/omp/index.d.ts +0 -4
  276. package/dist/templates/omp/index.d.ts.map +0 -1
  277. package/dist/templates/omp/index.js +0 -9
  278. package/dist/templates/omp/index.js.map +0 -1
  279. package/dist/templates/opencode/agents/trellis-check.md +0 -122
  280. package/dist/templates/opencode/agents/trellis-implement.md +0 -123
  281. package/dist/templates/opencode/agents/trellis-research.md +0 -145
  282. package/dist/templates/opencode/lib/context-visibility.js +0 -86
  283. package/dist/templates/opencode/lib/session-utils.js +0 -526
  284. package/dist/templates/opencode/lib/trellis-context.js +0 -627
  285. package/dist/templates/opencode/package.json +0 -5
  286. package/dist/templates/opencode/plugins/inject-spec-context.js +0 -121
  287. package/dist/templates/opencode/plugins/inject-subagent-context.js +0 -569
  288. package/dist/templates/opencode/plugins/inject-workflow-state.js +0 -340
  289. package/dist/templates/opencode/plugins/session-start.js +0 -74
  290. package/dist/templates/pi/agents/trellis-check.md +0 -37
  291. package/dist/templates/pi/agents/trellis-implement.md +0 -52
  292. package/dist/templates/pi/agents/trellis-research.md +0 -25
  293. package/dist/templates/pi/extensions/trellis/index.ts.txt +0 -2033
  294. package/dist/templates/pi/index.d.ts +0 -5
  295. package/dist/templates/pi/index.d.ts.map +0 -1
  296. package/dist/templates/pi/index.js +0 -12
  297. package/dist/templates/pi/index.js.map +0 -1
  298. package/dist/templates/pi/settings.json +0 -9
  299. package/dist/templates/qoder/agents/trellis-check.md +0 -108
  300. package/dist/templates/qoder/agents/trellis-implement.md +0 -108
  301. package/dist/templates/qoder/agents/trellis-research.md +0 -137
  302. package/dist/templates/qoder/index.d.ts +0 -15
  303. package/dist/templates/qoder/index.d.ts.map +0 -1
  304. package/dist/templates/qoder/index.js +0 -15
  305. package/dist/templates/qoder/index.js.map +0 -1
  306. package/dist/templates/qoder/settings.json +0 -59
  307. package/dist/templates/reasonix/agents/trellis-check.md +0 -36
  308. package/dist/templates/reasonix/agents/trellis-implement.md +0 -51
  309. package/dist/templates/reasonix/index.d.ts +0 -13
  310. package/dist/templates/reasonix/index.d.ts.map +0 -1
  311. package/dist/templates/reasonix/index.js +0 -16
  312. package/dist/templates/reasonix/index.js.map +0 -1
  313. package/dist/templates/shared-hooks/inject-shell-session-context.py +0 -292
  314. package/dist/templates/snow/SNOW.md +0 -86
  315. package/dist/templates/snow/agents/trellis-check.md +0 -136
  316. package/dist/templates/snow/agents/trellis-implement.md +0 -158
  317. package/dist/templates/snow/agents/trellis-research.md +0 -114
  318. package/dist/templates/snow/hooks/beforeSubAgentStart.json +0 -15
  319. package/dist/templates/snow/hooks/onSessionStart.json +0 -15
  320. package/dist/templates/snow/hooks/onUserMessage.json +0 -15
  321. package/dist/templates/snow/hooks/write-trellis-context.py +0 -644
  322. package/dist/templates/snow/index.d.ts +0 -26
  323. package/dist/templates/snow/index.d.ts.map +0 -1
  324. package/dist/templates/snow/index.js +0 -36
  325. package/dist/templates/snow/index.js.map +0 -1
  326. package/dist/templates/trae/agents/trellis-check.md +0 -108
  327. package/dist/templates/trae/agents/trellis-implement.md +0 -108
  328. package/dist/templates/trae/agents/trellis-research.md +0 -137
  329. package/dist/templates/trae/hooks.json +0 -39
  330. package/dist/templates/trae/index.d.ts +0 -15
  331. package/dist/templates/trae/index.d.ts.map +0 -1
  332. package/dist/templates/trae/index.js +0 -15
  333. package/dist/templates/trae/index.js.map +0 -1
  334. package/dist/templates/trellis/gitattributes.txt +0 -9
  335. package/dist/templates/trellis/scripts/common/cli_adapter.py +0 -982
  336. package/dist/templates/zcode/agents/trellis-check.md +0 -110
  337. package/dist/templates/zcode/agents/trellis-implement.md +0 -116
  338. package/dist/templates/zcode/agents/trellis-research.md +0 -133
  339. package/dist/templates/zcode/config.json +0 -52
  340. package/dist/templates/zcode/index.d.ts +0 -25
  341. package/dist/templates/zcode/index.d.ts.map +0 -1
  342. package/dist/templates/zcode/index.js +0 -29
  343. package/dist/templates/zcode/index.js.map +0 -1
@@ -19,18 +19,18 @@ max_journal_lines: 2000
19
19
  #-------------------------------------------------------------------------------
20
20
 
21
21
  # Auto-commit behavior for session journal + task archive operations.
22
- # - true (default): scripts auto-stage and auto-commit journal / task changes
23
- # after add_session.py / task.py archive runs.
24
- # - false: scripts do not touch git. Files (journal-*.md, task archive moves)
25
- # are still written to disk; you decide whether to git add / commit.
22
+ # - false (default): scripts do not touch git. Files (journal-*.md, task archive
23
+ # moves) are still written to disk; you decide whether to git add / commit.
24
+ # - true: scripts auto-stage and auto-commit journal / task changes after
25
+ # add_session.py / task.py archive runs.
26
26
  #
27
- # Use `false` if your project's .gitignore intentionally excludes `.trellis/`
28
- # and you want session data kept local-only, or if you prefer to review
29
- # staged changes manually before each commit.
27
+ # Use `true` if you want session records to land in git without extra steps.
28
+ # With `true` and parallel worktrees/branches, journal-*.md and index.md merges
29
+ # can conflict; resolve by keeping both sides' session blocks.
30
30
  #
31
31
  # Accepts: true / false / yes / no / 1 / 0 / on / off (case-insensitive).
32
32
  #
33
- # session_auto_commit: true
33
+ session_auto_commit: false
34
34
 
35
35
  #-------------------------------------------------------------------------------
36
36
  # Task Lifecycle Hooks
@@ -15,8 +15,7 @@
15
15
  * ├── scripts-shell-archive/ # Archived shell scripts (for reference)
16
16
  * ├── workflow.md # Workflow guide
17
17
  * ├── config.yaml # Trellis configuration
18
- * ├── gitignore.txt # .gitignore content
19
- * └── gitattributes.txt # project-root .gitattributes content
18
+ * └── gitignore.txt # .gitignore content
20
19
  */
21
20
  export declare const scriptsInit: string;
22
21
  export declare const commonInit: string;
@@ -26,7 +25,6 @@ export declare const commonGitContext: string;
26
25
  export declare const commonTaskQueue: string;
27
26
  export declare const commonTaskUtils: string;
28
27
  export declare const commonActiveTask: string;
29
- export declare const commonCliAdapter: string;
30
28
  export declare const commonConfig: string;
31
29
  export declare const commonIo: string;
32
30
  export declare const commonLog: string;
@@ -51,7 +49,6 @@ export declare const addSessionScript: string;
51
49
  export declare const workflowMdTemplate: string;
52
50
  export declare const configYamlTemplate: string;
53
51
  export declare const gitignoreTemplate: string;
54
- export declare const gitattributesTemplate: string;
55
52
  export declare const implementAgentTemplate: string;
56
53
  export declare const checkAgentTemplate: string;
57
54
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAcH,eAAO,MAAM,WAAW,QAAsC,CAAC;AAG/D,eAAO,MAAM,UAAU,QAA6C,CAAC;AACrE,eAAO,MAAM,WAAW,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gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAG9E,eAAO,MAAM,kBAAkB,QAA2C,CAAC;AAC3E,eAAO,MAAM,mBAAmB,QAA4C,CAAC;AAC7E,eAAO,MAAM,UAAU,QAAkC,CAAC;AAC1D,eAAO,MAAM,gBAAgB,QAAyC,CAAC;AACvE,eAAO,MAAM,gBAAgB,QAAyC,CAAC;AAGvE,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,iBAAiB,QAAgC,CAAC;AAM/D,eAAO,MAAM,sBAAsB,QAAsC,CAAC;AAC1E,eAAO,MAAM,kBAAkB,QAAkC,CAAC;AAElE;;GAEG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAuCnD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAKlD"}
@@ -15,8 +15,7 @@
15
15
  * ├── scripts-shell-archive/ # Archived shell scripts (for reference)
16
16
  * ├── workflow.md # Workflow guide
17
17
  * ├── config.yaml # Trellis configuration
18
- * ├── gitignore.txt # .gitignore content
19
- * └── gitattributes.txt # project-root .gitattributes content
18
+ * └── gitignore.txt # .gitignore content
20
19
  */
21
20
  import { readFileSync } from "node:fs";
22
21
  import { dirname, join } from "node:path";
@@ -36,7 +35,6 @@ export const commonGitContext = readTemplate("scripts/common/git_context.py");
36
35
  export const commonTaskQueue = readTemplate("scripts/common/task_queue.py");
37
36
  export const commonTaskUtils = readTemplate("scripts/common/task_utils.py");
38
37
  export const commonActiveTask = readTemplate("scripts/common/active_task.py");
39
- export const commonCliAdapter = readTemplate("scripts/common/cli_adapter.py");
40
38
  export const commonConfig = readTemplate("scripts/common/config.py");
41
39
  export const commonIo = readTemplate("scripts/common/io.py");
42
40
  export const commonLog = readTemplate("scripts/common/log.py");
@@ -63,7 +61,6 @@ export const addSessionScript = readTemplate("scripts/add_session.py");
63
61
  export const workflowMdTemplate = readTemplate("workflow.md");
64
62
  export const configYamlTemplate = readTemplate("config.yaml");
65
63
  export const gitignoreTemplate = readTemplate("gitignore.txt");
66
- export const gitattributesTemplate = readTemplate("gitattributes.txt");
67
64
  // Channel runtime agent definitions (loaded by
68
65
  // `packages/cli/src/commands/channel/agent-loader.ts` from `.trellis/agents/`).
69
66
  // These are platform-agnostic Trellis runtime files dispatched at `trellis init`
@@ -85,7 +82,6 @@ export function getAllScripts() {
85
82
  scripts.set("common/task_queue.py", commonTaskQueue);
86
83
  scripts.set("common/task_utils.py", commonTaskUtils);
87
84
  scripts.set("common/active_task.py", commonActiveTask);
88
- scripts.set("common/cli_adapter.py", commonCliAdapter);
89
85
  scripts.set("common/config.py", commonConfig);
90
86
  scripts.set("common/io.py", commonIo);
91
87
  scripts.set("common/log.py", commonLog);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,gCAAgC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAC;AAE/D,0BAA0B;AAC1B,MAAM,CAAC,M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AgB,CAAC,CAAC;IAEhD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;IACnD,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -4,16 +4,16 @@
4
4
  Add a new session to journal file and update index.md.
5
5
 
6
6
  Usage:
7
- python3 add_session.py --title "Title" --commit "hash" --summary "Summary" [--package cli]
8
- python3 add_session.py --title "Title" --branch "feat/my-branch"
7
+ python add_session.py --title "Title" --commit "hash" --summary "Summary" [--package cli]
8
+ python add_session.py --title "Title" --branch "feat/my-branch"
9
9
 
10
10
  # Pipe detailed content via stdin (use --stdin to opt in):
11
- cat << 'EOF' | python3 add_session.py --stdin --title "Title" --summary "Summary"
11
+ cat << 'EOF' | python add_session.py --stdin --title "Title" --summary "Summary"
12
12
  <session content here>
13
13
  EOF
14
14
 
15
15
  # Structured content (repeatable; a section with no bullets is omitted):
16
- python3 add_session.py --title "Title" --change "Did X" --test "Ran Y" --next-step "Do Z"
16
+ python add_session.py --title "Title" --change "Did X" --test "Ran Y" --next-step "Do Z"
17
17
 
18
18
  Branch resolution order:
19
19
  1. --branch CLI arg (explicit)
@@ -202,9 +202,9 @@ def is_git_worktree(repo_root: Path) -> bool:
202
202
 
203
203
 
204
204
  def warn_if_parallel_worktree(repo_root: Path) -> None:
205
- """Non-blocking note: index.md conflicts across parallel worktrees/branches
206
- are expected and safe. Only fires when running in a linked git worktree
207
- (not the main tree) with `session_auto_commit` enabled (#415 quick-fix tier).
205
+ """Non-blocking note: workspace merge conflicts across parallel
206
+ worktrees/branches are expected and safe. Only fires when running in a
207
+ linked git worktree (not the main tree) with `session_auto_commit` enabled.
208
208
  """
209
209
  if not get_session_auto_commit(repo_root):
210
210
  return
@@ -213,10 +213,11 @@ def warn_if_parallel_worktree(repo_root: Path) -> None:
213
213
  print(
214
214
  colored(
215
215
  "[NOTE] Running in a git worktree with session_auto_commit enabled: "
216
- "journal-*.md files auto-merge via .gitattributes, but index.md "
217
- "conflicts across parallel worktrees/branches are expected and safe "
218
- "to resolve by picking either side (task state lives in task.json, "
219
- "not index.md). See .trellis/spec/cli/backend/directory-structure.md "
216
+ "journal-*.md and index.md conflicts across parallel "
217
+ "worktrees/branches are expected and safe to resolve by keeping "
218
+ "both sides' session blocks (task state lives in task.json, not in "
219
+ "the workspace files). See "
220
+ ".trellis/spec/cli/backend/directory-structure.md "
220
221
  '("Workspace Journal Merge Behavior").',
221
222
  Colors.YELLOW,
222
223
  ),
@@ -86,6 +86,8 @@ from .paths import (
86
86
  from .active_task import (
87
87
  ActiveTask,
88
88
  clear_active_task,
89
+ is_session_engaged,
90
+ mark_session_engaged,
89
91
  resolve_active_task,
90
92
  resolve_context_key,
91
93
  set_active_task,
@@ -24,15 +24,16 @@ DIR_TASKS = "tasks"
24
24
  DIR_RUNTIME = ".runtime"
25
25
  DIR_SESSIONS = "sessions"
26
26
  DIR_SHELL_TICKETS = "shell-tickets"
27
- # Pre-0.6.13 name, when the bridge was Cursor-only. Still read so a session that
28
- # was mid-command across an upgrade does not silently degrade; never written.
29
- # Tickets are 30-second ephemera, so the old directory ages out by itself —
30
- # there is nothing to migrate, only a glob on a directory that is normally
31
- # absent. The alternative (ignore it) would land its one lost command on the
32
- # platform that works today.
33
- DIR_LEGACY_CURSOR_SHELL_TICKETS = "cursor-shell"
27
+ # Session engagement lives in its own runtime directory, NOT as a field on the
28
+ # session file. `clear_task_from_sessions` (archive) and `clear_active_task`
29
+ # (`task.py finish`) both *delete* the session file, which would silently
30
+ # un-engage a session that is mid-Phase-3 dropping the per-turn breadcrumb
31
+ # that enforces 3.4 commit. Keeping the flag on a separate path also leaves the
32
+ # `sessions/` file count that `_resolve_single_session_fallback` depends on
33
+ # exactly as it was.
34
+ DIR_ENGAGED = "engaged"
34
35
  SHELL_TICKET_TTL_SECONDS = 30
35
- TASK_SESSION_COMMANDS = {"start", "current", "finish"}
36
+ TASK_SESSION_COMMANDS = {"start", "current", "finish", "engage"}
36
37
 
37
38
  _SESSION_KEYS = ("session_id", "sessionId", "sessionID")
38
39
  _CONVERSATION_KEYS = ("conversation_id", "conversationId", "conversationID")
@@ -41,39 +42,15 @@ _NESTED_KEYS = ("input", "properties", "event", "hook_input", "hookInput")
41
42
  _KNOWN_PLATFORMS = {
42
43
  "claude",
43
44
  "codex",
44
- "cursor",
45
- "opencode",
46
- "gemini",
47
- "droid",
48
- "qoder",
49
- "codebuddy",
50
- "kiro",
51
- "copilot",
52
- "pi",
53
- "trae",
54
- "grok",
55
- "kimi",
56
- "zcode",
57
- "snow",
58
- "dsh",
59
45
  }
60
46
 
61
47
  # Every name below records how it was checked. Do NOT add a name by analogy
62
- # with a neighbour: a 2026-08-05 audit of the then-current 21 platforms found
63
- # 12 declared names had never existed anywhere — they were pattern-guessed from
64
- # `<PLATFORM>_SESSION_ID` shape no vendor agreed to, and the uniformity was the
65
- # only "evidence" behind them. A platform with no verified name belongs in no
66
- # table; it resolves through TRELLIS_CONTEXT_ID or its hook/plugin bridge.
48
+ # with a neighbour: a 2026-08-05 audit found several declared names had never
49
+ # existed anywhere — they were pattern-guessed from `<PLATFORM>_SESSION_ID`
50
+ # shape no vendor agreed to, and the uniformity was the only "evidence" behind
51
+ # them. A platform with no verified name belongs in no table; it resolves
52
+ # through TRELLIS_CONTEXT_ID or its hook bridge.
67
53
  _ENV_SESSION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
68
- # REAL (reported 2026-08-13 against DSH 0.1.0-rc.6 by @SajoLuo, from a live
69
- # run: DSH exports DSH_SESSION_ID plus DSH_SHELL=1 into its managed shell).
70
- # MUST STAY FIRST. A DSH session can inherit an outer host's identity — a
71
- # DSH launched from Codex still carries CODEX_THREAD_ID — and the untargeted
72
- # lookup below walks this table in order, so any earlier entry would claim
73
- # the session and write a foreign `codex_<thread>` pointer for DSH work.
74
- # DSH_SESSION_ID is the only name here no other vendor sets, so first place
75
- # is safe: it cannot mis-claim a non-DSH session.
76
- ("dsh", ("DSH_SESSION_ID",)),
77
54
  # REAL, undocumented (verified 2026-08-05 in a live Claude Code 2.1.221 bash
78
55
  # child; absent from code.claude.com/docs/en/env-vars). CLAUDE_SESSION_ID
79
56
  # was removed here — verified absent from that same live environment.
@@ -82,80 +59,9 @@ _ENV_SESSION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
82
59
  # into shell children, absent from the parent env; openai/codex#19937).
83
60
  # CODEX_SESSION_ID was removed — absent from a live `codex exec` env.
84
61
  ("codex", ("CODEX_THREAD_ID",)),
85
- # REAL but HOOK-SCOPE ONLY (verified 2026-08-05): set by Gemini's
86
- # hookRunner.ts. Its shell tool builds the child env in
87
- # shellExecutionService.ts and adds only GEMINI_CLI/TERM/PAGER/GIT_PAGER, so
88
- # this never reaches a bash child — it resolves only inside a hook process.
89
- ("gemini", ("GEMINI_SESSION_ID",)),
90
- # REAL but HOOK-SCOPE ONLY (verified 2026-08-05): docs.qoder.com/zh/
91
- # extensions/hooks documents it as injected during hook execution by the
92
- # Qoder *IDE plugin*. Absent from the Qoder CLI hook docs and from Lingma.
93
- ("qoder", ("QODER_SESSION_ID",)),
94
- # UNVERIFIED (2026-08-05): absent from kiro.dev/docs/hooks/, but Dynatrace
95
- # dtctl, oh-my-agent and gastown all key agent detection on it and one notes
96
- # it is "set in both interactive and --no-interactive". Kept because that is
97
- # absence of evidence, not evidence of absence. To settle: run
98
- # `env | grep KIRO` from a Kiro shell-tool call on a machine with Kiro.
99
- ("kiro", ("KIRO_SESSION_ID",)),
100
- # UNVERIFIED (2026-08-05): absent from docs.github.com/en/copilot/reference/
101
- # hooks-reference and from the CLI programmatic reference. To settle: run
102
- # `copilot help environment` (the authoritative list per those docs) — not
103
- # runnable here, the CLI is not installed and copilot-cli ships no source.
104
- ("copilot", ("COPILOT_SESSION_ID", "COPILOT_SESSIONID")),
105
- # REASONED, UNVERIFIED (2026-08-05): ZCode is closed-source and not
106
- # installable here. It mirrors Claude's naming elsewhere (CLAUDE_PLUGIN_ROOT
107
- # / CLAUDE_PLUGIN_DATA compat aliases are in its docs), and the previously
108
- # declared CLAUDE_SESSION_ID does not exist on Claude Code either — so the
109
- # name ZCode would actually reuse is CLAUDE_CODE_SESSION_ID. Try that first,
110
- # keep the historical name as a fallback: if neither exists nothing changes.
111
- # Platform-scoped lookup (_iter_env_keys filters by platform name), so the
112
- # entry only fires once the resolver detected "zcode" — no collision with
113
- # the claude entry above.
114
- ("zcode", ("CLAUDE_CODE_SESSION_ID", "CLAUDE_SESSION_ID")),
115
- # REAL by vendor design (verified 2026-08-05): Snow's sessionIdentityEnv.ts
116
- # exports SNOW_SESSION_ID into hook/terminal/sub-agent children and names
117
- # Trellis in its source header. TRELLIS_CONTEXT_ID stays the preferred
118
- # override — Snow sets that too.
119
- ("snow", ("SNOW_SESSION_ID",)),
120
- )
121
- _ENV_CONVERSATION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
122
- # REAL in cursor-agent (CLI), undocumented (verified 2026-08-05: the value
123
- # matches ~/.cursor/chats/<ws>/<id>). The Cursor *IDE* is unverified — a
124
- # 2026-05 forum request for it drew no staff reply. The invented
125
- # CURSOR_SESSION_ID was removed from the session table: empty in a live
126
- # cursor-agent shell. Cursor's other path is the shell ticket below
127
- # (_lookup_shell_ticket_context_key), which is not Cursor-specific.
128
- ("cursor", ("CURSOR_CONVERSATION_ID", "CURSOR_CONVERSATIONID")),
129
- )
130
- _ENV_TRANSCRIPT_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
131
- # REAL but HOOK-SCOPE ONLY (verified 2026-08-05): documented for Cursor hook
132
- # scripts; empty in the agent's own shell env.
133
- ("cursor", ("CURSOR_TRANSCRIPT_PATH",)),
134
- # UNVERIFIED — never researched. The 2026-08-05 audit covered the session
135
- # table only, so do not infer these are real *or* fake from that work
136
- # (CLAUDE_/CODEX_TRANSCRIPT_PATH were removed because those two *were*
137
- # checked: absent from docs and from live envs). To settle each: run
138
- # `env | grep _TRANSCRIPT_PATH` inside a hook and inside a shell-tool call.
139
- ("gemini", ("GEMINI_TRANSCRIPT_PATH",)),
140
- ("droid", ("FACTORY_TRANSCRIPT_PATH", "DROID_TRANSCRIPT_PATH")),
141
- ("qoder", ("QODER_TRANSCRIPT_PATH",)),
142
- ("codebuddy", ("CODEBUDDY_TRANSCRIPT_PATH",)),
143
62
  )
144
63
  _ENV_PLATFORM_ALIASES = {
145
64
  "claude-code": "claude",
146
- "factory": "droid",
147
- "factory-ai": "droid",
148
- "github-copilot": "copilot",
149
- }
150
- # ZCode intentionally reuses Claude's session env var name. Hooks know the host
151
- # is ZCode, while later shell commands see only the shared env name and resolve
152
- # it through the claude entry. Canonicalize both paths to one runtime filename.
153
- _CONTEXT_KEY_PLATFORM_ALIASES = {
154
- "zcode": "claude",
155
- # Factory Droid's config directory is `.factory/`, so a hook that names its
156
- # platform after the directory it was installed in reports "factory". Its
157
- # sibling hooks report "droid". One runtime filename either way.
158
- "factory": "droid",
159
65
  }
160
66
 
161
67
 
@@ -238,6 +144,10 @@ def _runtime_sessions_dir(repo_root: Path) -> Path:
238
144
  return repo_root / DIR_WORKFLOW / DIR_RUNTIME / DIR_SESSIONS
239
145
 
240
146
 
147
+ def _runtime_engaged_dir(repo_root: Path) -> Path:
148
+ return repo_root / DIR_WORKFLOW / DIR_RUNTIME / DIR_ENGAGED
149
+
150
+
241
151
  def _sanitize_key(raw: str) -> str:
242
152
  safe = re.sub(r"[^A-Za-z0-9._-]+", "_", raw.strip())
243
153
  safe = safe.strip("._-")
@@ -284,13 +194,10 @@ def _detect_platform(platform_input: dict[str, Any] | None, platform: str | None
284
194
  value = _string_value(platform_input.get(key))
285
195
  if value:
286
196
  return _sanitize_key(value) or "session"
287
- if _string_value(platform_input.get("cursor_version")):
288
- return "cursor"
289
197
  return "session"
290
198
 
291
199
 
292
200
  def _context_key(platform_name: str, kind: str, value: str) -> str:
293
- platform_name = _CONTEXT_KEY_PLATFORM_ALIASES.get(platform_name, platform_name)
294
201
  if kind == "transcript":
295
202
  return f"{platform_name}_transcript_{_hash_value(value)}"
296
203
  safe_value = _sanitize_key(value)
@@ -337,18 +244,6 @@ def _lookup_env_context_key(platform_name: str | None) -> str | None:
337
244
  if value:
338
245
  return _context_key(name, "session", value)
339
246
 
340
- for name, keys in _iter_env_keys(_ENV_CONVERSATION_KEYS, env_platform_name):
341
- for key in keys:
342
- value = _string_value(os.environ.get(key))
343
- if value:
344
- return _context_key(name, "conversation", value)
345
-
346
- for name, keys in _iter_env_keys(_ENV_TRANSCRIPT_KEYS, env_platform_name):
347
- for key in keys:
348
- value = _string_value(os.environ.get(key))
349
- if value:
350
- return _context_key(name, "transcript", value)
351
-
352
247
  return None
353
248
 
354
249
 
@@ -364,10 +259,7 @@ def _find_repo_root_from_cwd() -> Path | None:
364
259
 
365
260
  def _shell_ticket_dirs(repo_root: Path) -> tuple[Path, ...]:
366
261
  runtime_dir = repo_root / DIR_WORKFLOW / DIR_RUNTIME
367
- return (
368
- runtime_dir / DIR_SHELL_TICKETS,
369
- runtime_dir / DIR_LEGACY_CURSOR_SHELL_TICKETS,
370
- )
262
+ return (runtime_dir / DIR_SHELL_TICKETS,)
371
263
 
372
264
 
373
265
  def _remove_file(path: Path) -> bool:
@@ -451,7 +343,8 @@ def _matching_ticket_context_key(
451
343
  """Accept a ticket on its merits, never on which platform wrote it.
452
344
 
453
345
  The `platform` field a ticket carries is debugging metadata; gating on it
454
- was what kept this bridge invisible to every platform but Cursor.
346
+ would make this bridge invisible to every platform but the one that wrote
347
+ the ticket.
455
348
  """
456
349
  ticket = _read_json(ticket_path)
457
350
  if ticket is None:
@@ -507,28 +400,6 @@ def resolve_context_key(
507
400
  scripts and subprocesses. It does not store the task itself.
508
401
  """
509
402
  if allow_environment_context:
510
- # The optional dsh-trellis plugin contributes this managed DSH_* value
511
- # per shell execution from the current DSH session header. DSH scrubs
512
- # ambient DSH_* values before rebuilding that namespace, so this value
513
- # cannot be inherited from an outer Claude/Codex Trellis session. It
514
- # must outrank the generic override below, which ordinary child
515
- # processes inherit indiscriminately.
516
- dsh_override = _string_value(os.environ.get("DSH_TRELLIS_CONTEXT_ID"))
517
- if dsh_override:
518
- return _sanitize_key(dsh_override) or _hash_value(dsh_override)
519
-
520
- # A real DSH managed shell rebuilds the complete DSH_* namespace: the
521
- # paired sentinel and session id cannot be inherited from an outer
522
- # Trellis host. Prefer that canonical env-table identity over
523
- # a generic override that ordinary process inheritance may carry in.
524
- if (
525
- _string_value(os.environ.get("DSH_SHELL")) == "1"
526
- and _string_value(os.environ.get("DSH_SESSION_ID"))
527
- ):
528
- dsh_context_key = _lookup_env_context_key("dsh")
529
- if dsh_context_key:
530
- return dsh_context_key
531
-
532
403
  override = _string_value(os.environ.get("TRELLIS_CONTEXT_ID"))
533
404
  if override:
534
405
  return _sanitize_key(override) or _hash_value(override)
@@ -615,6 +486,10 @@ def _context_path(repo_root: Path, context_key: str) -> Path:
615
486
  return _runtime_sessions_dir(repo_root) / f"{context_key}.json"
616
487
 
617
488
 
489
+ def _engaged_path(repo_root: Path, context_key: str) -> Path:
490
+ return _runtime_engaged_dir(repo_root) / f"{context_key}.json"
491
+
492
+
618
493
  def resolve_active_task(
619
494
  repo_root: Path,
620
495
  platform_input: dict[str, Any] | None = None,
@@ -628,8 +503,8 @@ def resolve_active_task(
628
503
  A stale session task is returned as stale. Missing context identity or a
629
504
  missing/empty session context falls back to single-session inference: if
630
505
  exactly one session file exists in the runtime, return its task with
631
- source_type="session-fallback" — covers pull-based platform sub-agents
632
- (copilot, gemini, qoder) that don't inherit the parent's session id. ≥2
506
+ source_type="session-fallback" — covers pull-based sub-agents that don't
507
+ inherit the parent's session id. ≥2
633
508
  files or 0 files yield ActiveTask(None) — refuses to guess across windows.
634
509
  """
635
510
  context_key = resolve_context_key(
@@ -703,6 +578,59 @@ def _context_metadata(
703
578
  return metadata
704
579
 
705
580
 
581
+ def mark_session_engaged(
582
+ repo_root: Path,
583
+ platform_input: dict[str, Any] | None = None,
584
+ platform: str | None = None,
585
+ ) -> str | None:
586
+ """Opt this session into the Trellis workflow.
587
+
588
+ Context injection is opt-in: `session-start.py` and `inject-workflow-state.py`
589
+ emit nothing until a session is engaged. The user engages by invoking one of
590
+ the three lifecycle entry points (`trellis-start` / `trellis-continue` /
591
+ `trellis-finish-work`), each of which runs `task.py engage` as its first
592
+ step.
593
+
594
+ Returns the context key on success, or None when no session identity is
595
+ available. Callers must surface that as an error — reporting success without
596
+ a written flag would leave the hooks permanently silent and the user with no
597
+ way to tell why.
598
+ """
599
+ context_key = resolve_context_key(platform_input, platform)
600
+ if not context_key:
601
+ return None
602
+
603
+ engaged_path = _engaged_path(repo_root, context_key)
604
+ record = _read_json(engaged_path) or {}
605
+ record.update(_context_metadata(platform_input, platform, context_key))
606
+ record["engaged"] = True
607
+ # Re-running an entry point in the same session must not reset when the
608
+ # session first opted in; `last_seen_at` above already carries recency.
609
+ record.setdefault("engaged_at", _utc_now())
610
+ if not _write_json(engaged_path, record):
611
+ return None
612
+ return context_key
613
+
614
+
615
+ def is_session_engaged(
616
+ repo_root: Path,
617
+ platform_input: dict[str, Any] | None = None,
618
+ platform: str | None = None,
619
+ ) -> bool:
620
+ """Report whether THIS session opted into the Trellis workflow.
621
+
622
+ Deliberately has no single-session fallback, unlike `resolve_active_task`:
623
+ inheriting engagement from a file another window left behind is exactly the
624
+ failure the opt-in model exists to prevent. A new session that never ran an
625
+ entry point must stay silent even while a task is mid-flight.
626
+ """
627
+ context_key = resolve_context_key(platform_input, platform)
628
+ if not context_key:
629
+ return False
630
+ record = _read_json(_engaged_path(repo_root, context_key)) or {}
631
+ return record.get("engaged") is True
632
+
633
+
706
634
  def set_active_task(
707
635
  task_path: str,
708
636
  repo_root: Path,
@@ -167,7 +167,7 @@ def _next_content_line(lines: list[str], start: int) -> tuple[int, str]:
167
167
  # Defaults
168
168
  DEFAULT_SESSION_COMMIT_MESSAGE = "chore: record journal"
169
169
  DEFAULT_MAX_JOURNAL_LINES = 2000
170
- DEFAULT_SESSION_AUTO_COMMIT = True
170
+ DEFAULT_SESSION_AUTO_COMMIT = False
171
171
  DEFAULT_CODEX_DISPATCH_MODE = "auto"
172
172
 
173
173
  CONFIG_FILE = "config.yaml"
@@ -220,14 +220,14 @@ def get_session_auto_commit(repo_root: Path | None = None) -> bool:
220
220
  Governs both ``add_session.py:_auto_commit_workspace`` and
221
221
  ``task_store.py:_auto_commit_archive``.
222
222
 
223
- Default: ``True`` (existing behavior auto-stage + auto-commit).
224
- Set ``session_auto_commit: false`` in ``.trellis/config.yaml`` to skip
225
- auto-staging entirely; the journal/archive files are still written to
226
- disk, but the user manages ``git add`` / ``git commit`` themselves.
223
+ Default: ``False`` the journal / archive files are written to disk and
224
+ git is left untouched; the user manages ``git add`` / ``git commit``.
225
+ Set ``session_auto_commit: true`` in ``.trellis/config.yaml`` to let the
226
+ scripts auto-stage and auto-commit those changes.
227
227
 
228
228
  Accepts native YAML booleans (``true`` / ``false``) and the string
229
229
  aliases ``true / false / yes / no / 1 / 0 / on / off`` (case-insensitive).
230
- Invalid values fall back to ``True`` with a stderr warning.
230
+ Invalid values fall back to ``False`` with a stderr warning.
231
231
  """
232
232
  config = _load_config(repo_root)
233
233
  raw = config.get("session_auto_commit", DEFAULT_SESSION_AUTO_COMMIT)
@@ -239,7 +239,7 @@ def get_session_auto_commit(repo_root: Path | None = None) -> bool:
239
239
  if s in ("false", "no", "0", "off"):
240
240
  return False
241
241
  print(
242
- f"[WARN] invalid session_auto_commit value: {raw!r}; using true (default)",
242
+ f"[WARN] invalid session_auto_commit value: {raw!r}; using false (default)",
243
243
  file=sys.stderr,
244
244
  )
245
245
  return DEFAULT_SESSION_AUTO_COMMIT
@@ -69,7 +69,7 @@ def main() -> None:
69
69
  )
70
70
  parser.add_argument(
71
71
  "--platform",
72
- help="Platform name for --mode phase, e.g. cursor, claude-code. Filters platform-tagged blocks.",
72
+ help="Platform name for --mode phase, e.g. claude, codex. Filters platform-tagged blocks.",
73
73
  )
74
74
  parser.add_argument(
75
75
  "--file",
@@ -599,7 +599,7 @@ def get_context_text(repo_root: Path | None = None) -> str:
599
599
  lines.append("## DEVELOPER")
600
600
  if not developer:
601
601
  lines.append(
602
- f"ERROR: Not initialized. Run: python3 ./{DIR_WORKFLOW}/{DIR_SCRIPTS}/init_developer.py <name>"
602
+ f"ERROR: Not initialized. Run: python ./{DIR_WORKFLOW}/{DIR_SCRIPTS}/init_developer.py <name>"
603
603
  )
604
604
  return "\n".join(lines)
605
605
 
@@ -818,7 +818,7 @@ def get_context_text_record(repo_root: Path | None = None) -> str:
818
818
  developer = get_developer(repo_root)
819
819
  if not developer:
820
820
  lines.append(
821
- f"ERROR: Not initialized. Run: python3 ./{DIR_WORKFLOW}/{DIR_SCRIPTS}/init_developer.py <name>"
821
+ f"ERROR: Not initialized. Run: python ./{DIR_WORKFLOW}/{DIR_SCRIPTS}/init_developer.py <name>"
822
822
  )
823
823
  return "\n".join(lines)
824
824
 
@@ -295,7 +295,7 @@ def assemble_payload(
295
295
  _all_index_lines = [_index_line(m) for m in matches]
296
296
  _summary_upper = (
297
297
  f"- (+{len(matches)} more governing specs over budget — run "
298
- f"python3 ./.trellis/scripts/get_context.py --mode spec "
298
+ f"python ./.trellis/scripts/get_context.py --mode spec "
299
299
  f"--file {edited_rel} to list them)"
300
300
  )
301
301
  _summary_reserve = len("\n\n" + _index_block([_summary_upper]))
@@ -409,7 +409,7 @@ def assemble_payload(
409
409
  noun = "spec" if dropped == 1 else "specs"
410
410
  summary = (
411
411
  f"- (+{dropped} more governing {noun} over budget — run "
412
- f"python3 ./.trellis/scripts/get_context.py --mode spec "
412
+ f"python ./.trellis/scripts/get_context.py --mode spec "
413
413
  f"--file {edited_rel} to list them)"
414
414
  )
415
415
  if fits(_index_block([*chosen, summary])):