@blxzer/cursor-trellis 0.4.2 → 0.4.3

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 (315) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +23 -14
  3. package/README.zh-CN.md +14 -10
  4. package/bin/smart-search.js +10 -2
  5. package/dist/cli/index.d.ts.map +1 -1
  6. package/dist/cli/index.js +36 -15
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/commands/init.d.ts +1 -1
  9. package/dist/commands/init.d.ts.map +1 -1
  10. package/dist/commands/init.js +42 -153
  11. package/dist/commands/init.js.map +1 -1
  12. package/dist/commands/migrate.d.ts +10 -0
  13. package/dist/commands/migrate.d.ts.map +1 -0
  14. package/dist/commands/migrate.js +38 -0
  15. package/dist/commands/migrate.js.map +1 -0
  16. package/dist/commands/update.d.ts +5 -0
  17. package/dist/commands/update.d.ts.map +1 -1
  18. package/dist/commands/update.js +137 -40
  19. package/dist/commands/update.js.map +1 -1
  20. package/dist/configurators/cursor.d.ts +2 -1
  21. package/dist/configurators/cursor.d.ts.map +1 -1
  22. package/dist/configurators/cursor.js +4 -2
  23. package/dist/configurators/cursor.js.map +1 -1
  24. package/dist/configurators/index.js +4 -4
  25. package/dist/configurators/index.js.map +1 -1
  26. package/dist/configurators/shared.d.ts +8 -0
  27. package/dist/configurators/shared.d.ts.map +1 -1
  28. package/dist/configurators/shared.js +27 -1
  29. package/dist/configurators/shared.js.map +1 -1
  30. package/dist/configurators/workflow.d.ts +0 -9
  31. package/dist/configurators/workflow.d.ts.map +1 -1
  32. package/dist/configurators/workflow.js +2 -4
  33. package/dist/configurators/workflow.js.map +1 -1
  34. package/dist/constants/paths.d.ts +9 -0
  35. package/dist/constants/paths.d.ts.map +1 -1
  36. package/dist/constants/paths.js +13 -0
  37. package/dist/constants/paths.js.map +1 -1
  38. package/dist/migrations/manifests/0.3.0.json +1 -1
  39. package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/skills-and-commands.md +2 -4
  40. package/dist/templates/common/bundled-skills/cstl-skill-creator/SKILL.md +10 -7
  41. package/dist/templates/common/bundled-skills/cstl-skill-creator/references/authoring-rules.md +93 -19
  42. package/dist/templates/common/bundled-skills/cstl-skill-creator/references/general-authoring.md +189 -0
  43. package/dist/templates/common/bundled-skills/cstl-skill-creator/references/review-checklist.md +10 -5
  44. package/dist/templates/common/commands/continue.md +5 -4
  45. package/dist/templates/common/index.d.ts +20 -0
  46. package/dist/templates/common/index.d.ts.map +1 -1
  47. package/dist/templates/common/index.js +21 -2
  48. package/dist/templates/common/index.js.map +1 -1
  49. package/dist/templates/common/optional-skills/chrome-cdp/SKILL.md +179 -0
  50. package/dist/templates/common/optional-skills/chrome-cdp/examples/fetch-hook-api-capture.md +149 -0
  51. package/dist/templates/common/optional-skills/chrome-cdp/scripts/cdp.mjs +903 -0
  52. package/dist/templates/cursor/agents/cstl-research.md +1 -1
  53. package/dist/templates/cursor/fixtures/expected-rules.d.ts +1 -1
  54. package/dist/templates/cursor/fixtures/expected-rules.d.ts.map +1 -1
  55. package/dist/templates/cursor/fixtures/expected-rules.js +7 -24
  56. package/dist/templates/cursor/fixtures/expected-rules.js.map +1 -1
  57. package/dist/templates/cursor/hooks.json +4 -0
  58. package/dist/templates/cursor/index.d.ts +1 -1
  59. package/dist/templates/cursor/index.js +1 -1
  60. package/dist/templates/cursor/rules/cstl-bootstrap.mdc +17 -0
  61. package/dist/templates/markdown/agents.md +15 -10
  62. package/dist/templates/markdown/framework/cursor-native-modes-guide.md.txt +12 -9
  63. package/dist/templates/markdown/framework/cursor-subagent-policy.md.txt +62 -126
  64. package/dist/templates/markdown/framework/dogfood-only-surfaces.md.txt +4 -6
  65. package/dist/templates/markdown/framework/execution-strategy.md.txt +2 -0
  66. package/dist/templates/markdown/framework/index.md.txt +4 -0
  67. package/dist/templates/markdown/framework/internal-skills-cursor-reachability.md.txt +4 -3
  68. package/dist/templates/markdown/framework/middleware-protocol.md.txt +83 -0
  69. package/dist/templates/markdown/framework/parallel-first-execution.md.txt +78 -0
  70. package/dist/templates/markdown/framework/release-boundary.md.txt +30 -0
  71. package/dist/templates/markdown/framework/retrieval-daily-guide.md.txt +1 -1
  72. package/dist/templates/markdown/framework/upgrade.md.txt +15 -0
  73. package/dist/templates/markdown/index.d.ts +4 -0
  74. package/dist/templates/markdown/index.d.ts.map +1 -1
  75. package/dist/templates/markdown/index.js +17 -0
  76. package/dist/templates/markdown/index.js.map +1 -1
  77. package/dist/templates/markdown/spec/guides/index.md.txt +0 -6
  78. package/dist/templates/shared-hooks/event-bridge.py +60 -0
  79. package/dist/templates/shared-hooks/index.d.ts +1 -1
  80. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  81. package/dist/templates/shared-hooks/index.js +1 -0
  82. package/dist/templates/shared-hooks/index.js.map +1 -1
  83. package/dist/templates/shared-hooks/session-start.py +18 -1
  84. package/dist/templates/trellis/CONTEXT.md +63 -3
  85. package/dist/templates/trellis/gitignore.txt +39 -39
  86. package/dist/templates/trellis/index.d.ts +12 -0
  87. package/dist/templates/trellis/index.d.ts.map +1 -1
  88. package/dist/templates/trellis/index.js +73 -15
  89. package/dist/templates/trellis/index.js.map +1 -1
  90. package/dist/templates/trellis/pool/README.md +12 -3
  91. package/dist/templates/trellis/pool/plan.md +24 -5
  92. package/dist/templates/trellis/scripts/common/adapter_middleware.py +158 -0
  93. package/dist/templates/trellis/scripts/common/artifact_locale.py +12 -3
  94. package/dist/templates/trellis/scripts/common/cursor_retrieval_env.py +5 -2
  95. package/dist/templates/trellis/scripts/common/full_quality.py +237 -0
  96. package/dist/templates/trellis/scripts/common/git.py +6 -0
  97. package/dist/templates/trellis/scripts/common/git_context.py +17 -5
  98. package/dist/templates/trellis/scripts/common/kernel_command.py +367 -0
  99. package/dist/templates/trellis/scripts/common/lite_context.py +280 -0
  100. package/dist/templates/trellis/scripts/common/ondemand_topology.py +225 -0
  101. package/dist/templates/trellis/scripts/common/parent_orchestration.py +1 -1
  102. package/dist/templates/trellis/scripts/common/pool_store.py +16 -4
  103. package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +2 -2
  104. package/dist/templates/trellis/scripts/common/session_context.py +28 -2
  105. package/dist/templates/trellis/scripts/common/task_gates.py +73 -12
  106. package/dist/templates/trellis/scripts/common/task_map.py +42 -9
  107. package/dist/templates/trellis/scripts/common/task_store.py +286 -56
  108. package/dist/templates/trellis/scripts/common/test_adapter_middleware.py +56 -0
  109. package/dist/templates/trellis/scripts/common/test_depends_mode_block.py +9 -0
  110. package/dist/templates/trellis/scripts/common/test_full_quality.py +197 -0
  111. package/dist/templates/trellis/scripts/common/test_kernel_command.py +326 -0
  112. package/dist/templates/trellis/scripts/common/test_lite_path.py +190 -0
  113. package/dist/templates/trellis/scripts/common/test_ondemand_topology.py +122 -0
  114. package/dist/templates/trellis/scripts/common/test_pool_store.py +17 -0
  115. package/dist/templates/trellis/scripts/common/test_task_store_kernel_patch.py +163 -0
  116. package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -0
  117. package/dist/templates/trellis/scripts/get_context.py +1 -0
  118. package/dist/templates/trellis/scripts/pool.py +5 -0
  119. package/dist/templates/trellis/scripts/task.py +83 -7
  120. package/dist/templates/trellis/workflow.md +100 -18
  121. package/dist/utils/cursor-retrieval-env.d.ts +2 -1
  122. package/dist/utils/cursor-retrieval-env.d.ts.map +1 -1
  123. package/dist/utils/cursor-retrieval-env.js +3 -2
  124. package/dist/utils/cursor-retrieval-env.js.map +1 -1
  125. package/dist/utils/cursor2plus-residue-cleanup.d.ts +38 -0
  126. package/dist/utils/cursor2plus-residue-cleanup.d.ts.map +1 -0
  127. package/dist/utils/cursor2plus-residue-cleanup.js +145 -0
  128. package/dist/utils/cursor2plus-residue-cleanup.js.map +1 -0
  129. package/dist/utils/manifest-prune.d.ts.map +1 -1
  130. package/dist/utils/manifest-prune.js +7 -2
  131. package/dist/utils/manifest-prune.js.map +1 -1
  132. package/dist/utils/p36-upgrade.d.ts +62 -0
  133. package/dist/utils/p36-upgrade.d.ts.map +1 -0
  134. package/dist/utils/p36-upgrade.js +160 -0
  135. package/dist/utils/p36-upgrade.js.map +1 -0
  136. package/dist/utils/project-capabilities.d.ts +1 -12
  137. package/dist/utils/project-capabilities.d.ts.map +1 -1
  138. package/dist/utils/project-capabilities.js +3 -100
  139. package/dist/utils/project-capabilities.js.map +1 -1
  140. package/dist/utils/readiness.d.ts +10 -0
  141. package/dist/utils/readiness.d.ts.map +1 -1
  142. package/dist/utils/readiness.js +58 -26
  143. package/dist/utils/readiness.js.map +1 -1
  144. package/dist/utils/retrieval-agent-instructions.js +1 -1
  145. package/dist/utils/retrieval-agent-instructions.js.map +1 -1
  146. package/dist/utils/template-hash.d.ts.map +1 -1
  147. package/dist/utils/template-hash.js +11 -1
  148. package/dist/utils/template-hash.js.map +1 -1
  149. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  150. package/dist/utils/uninstall-scrubbers.js +52 -14
  151. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  152. package/dist/utils/update-rollout-report.d.ts +14 -0
  153. package/dist/utils/update-rollout-report.d.ts.map +1 -1
  154. package/dist/utils/update-rollout-report.js +1 -0
  155. package/dist/utils/update-rollout-report.js.map +1 -1
  156. package/dist/utils/workflow-ownership.d.ts +1 -1
  157. package/dist/utils/workflow-ownership.js +4 -4
  158. package/dist/utils/workflow-ownership.js.map +1 -1
  159. package/package.json +5 -4
  160. package/scripts/postinstall.js +6 -7
  161. package/dist/commands/campaign/canvas-render.d.ts +0 -68
  162. package/dist/commands/campaign/canvas-render.d.ts.map +0 -1
  163. package/dist/commands/campaign/canvas-render.js +0 -414
  164. package/dist/commands/campaign/canvas-render.js.map +0 -1
  165. package/dist/commands/campaign/compose.d.ts +0 -15
  166. package/dist/commands/campaign/compose.d.ts.map +0 -1
  167. package/dist/commands/campaign/compose.js +0 -110
  168. package/dist/commands/campaign/compose.js.map +0 -1
  169. package/dist/commands/campaign/index.d.ts +0 -13
  170. package/dist/commands/campaign/index.d.ts.map +0 -1
  171. package/dist/commands/campaign/index.js +0 -134
  172. package/dist/commands/campaign/index.js.map +0 -1
  173. package/dist/commands/campaign/kind-map.d.ts +0 -6
  174. package/dist/commands/campaign/kind-map.d.ts.map +0 -1
  175. package/dist/commands/campaign/kind-map.js +0 -21
  176. package/dist/commands/campaign/kind-map.js.map +0 -1
  177. package/dist/commands/campaign/mcp-server.d.ts +0 -6
  178. package/dist/commands/campaign/mcp-server.d.ts.map +0 -1
  179. package/dist/commands/campaign/mcp-server.js +0 -167
  180. package/dist/commands/campaign/mcp-server.js.map +0 -1
  181. package/dist/commands/campaign/render.d.ts +0 -5
  182. package/dist/commands/campaign/render.d.ts.map +0 -1
  183. package/dist/commands/campaign/render.js +0 -103
  184. package/dist/commands/campaign/render.js.map +0 -1
  185. package/dist/commands/campaign/trellis-load.d.ts +0 -13
  186. package/dist/commands/campaign/trellis-load.d.ts.map +0 -1
  187. package/dist/commands/campaign/trellis-load.js +0 -122
  188. package/dist/commands/campaign/trellis-load.js.map +0 -1
  189. package/dist/commands/campaign/types.d.ts +0 -61
  190. package/dist/commands/campaign/types.d.ts.map +0 -1
  191. package/dist/commands/campaign/types.js +0 -3
  192. package/dist/commands/campaign/types.js.map +0 -1
  193. package/dist/commands/goal/index.d.ts +0 -3
  194. package/dist/commands/goal/index.d.ts.map +0 -1
  195. package/dist/commands/goal/index.js +0 -159
  196. package/dist/commands/goal/index.js.map +0 -1
  197. package/dist/commands/goal/review.d.ts +0 -6
  198. package/dist/commands/goal/review.d.ts.map +0 -1
  199. package/dist/commands/goal/review.js +0 -28
  200. package/dist/commands/goal/review.js.map +0 -1
  201. package/dist/commands/rpc/client.d.ts +0 -51
  202. package/dist/commands/rpc/client.d.ts.map +0 -1
  203. package/dist/commands/rpc/client.js +0 -147
  204. package/dist/commands/rpc/client.js.map +0 -1
  205. package/dist/commands/rpc/index.d.ts +0 -10
  206. package/dist/commands/rpc/index.d.ts.map +0 -1
  207. package/dist/commands/rpc/index.js +0 -157
  208. package/dist/commands/rpc/index.js.map +0 -1
  209. package/dist/commands/rpc/serve.d.ts +0 -23
  210. package/dist/commands/rpc/serve.d.ts.map +0 -1
  211. package/dist/commands/rpc/serve.js +0 -60
  212. package/dist/commands/rpc/serve.js.map +0 -1
  213. package/dist/commands/rpc/smoke.d.ts +0 -16
  214. package/dist/commands/rpc/smoke.d.ts.map +0 -1
  215. package/dist/commands/rpc/smoke.js +0 -92
  216. package/dist/commands/rpc/smoke.js.map +0 -1
  217. package/dist/commands/sdk/index.d.ts +0 -9
  218. package/dist/commands/sdk/index.d.ts.map +0 -1
  219. package/dist/commands/sdk/index.js +0 -58
  220. package/dist/commands/sdk/index.js.map +0 -1
  221. package/dist/commands/sdk/run.d.ts +0 -42
  222. package/dist/commands/sdk/run.d.ts.map +0 -1
  223. package/dist/commands/sdk/run.js +0 -220
  224. package/dist/commands/sdk/run.js.map +0 -1
  225. package/dist/commands/sdk/status.d.ts +0 -14
  226. package/dist/commands/sdk/status.d.ts.map +0 -1
  227. package/dist/commands/sdk/status.js +0 -69
  228. package/dist/commands/sdk/status.js.map +0 -1
  229. package/dist/configurators/cursor2plus-local.d.ts +0 -6
  230. package/dist/configurators/cursor2plus-local.d.ts.map +0 -1
  231. package/dist/configurators/cursor2plus-local.js +0 -21
  232. package/dist/configurators/cursor2plus-local.js.map +0 -1
  233. package/dist/goal/action-packet.d.ts +0 -89
  234. package/dist/goal/action-packet.d.ts.map +0 -1
  235. package/dist/goal/action-packet.js +0 -113
  236. package/dist/goal/action-packet.js.map +0 -1
  237. package/dist/goal/audit.d.ts +0 -14
  238. package/dist/goal/audit.d.ts.map +0 -1
  239. package/dist/goal/audit.js +0 -12
  240. package/dist/goal/audit.js.map +0 -1
  241. package/dist/goal/constants.d.ts +0 -26
  242. package/dist/goal/constants.d.ts.map +0 -1
  243. package/dist/goal/constants.js +0 -24
  244. package/dist/goal/constants.js.map +0 -1
  245. package/dist/goal/paths.d.ts +0 -8
  246. package/dist/goal/paths.d.ts.map +0 -1
  247. package/dist/goal/paths.js +0 -36
  248. package/dist/goal/paths.js.map +0 -1
  249. package/dist/goal/preflight.d.ts +0 -21
  250. package/dist/goal/preflight.d.ts.map +0 -1
  251. package/dist/goal/preflight.js +0 -97
  252. package/dist/goal/preflight.js.map +0 -1
  253. package/dist/goal/review-seam.d.ts +0 -44
  254. package/dist/goal/review-seam.d.ts.map +0 -1
  255. package/dist/goal/review-seam.js +0 -153
  256. package/dist/goal/review-seam.js.map +0 -1
  257. package/dist/goal/reviewer-rules.d.ts +0 -13
  258. package/dist/goal/reviewer-rules.d.ts.map +0 -1
  259. package/dist/goal/reviewer-rules.js +0 -153
  260. package/dist/goal/reviewer-rules.js.map +0 -1
  261. package/dist/goal/reviewer.d.ts +0 -9
  262. package/dist/goal/reviewer.d.ts.map +0 -1
  263. package/dist/goal/reviewer.js +0 -54
  264. package/dist/goal/reviewer.js.map +0 -1
  265. package/dist/goal/runtime.d.ts +0 -32
  266. package/dist/goal/runtime.d.ts.map +0 -1
  267. package/dist/goal/runtime.js +0 -242
  268. package/dist/goal/runtime.js.map +0 -1
  269. package/dist/goal/sdk-client.d.ts +0 -10
  270. package/dist/goal/sdk-client.d.ts.map +0 -1
  271. package/dist/goal/sdk-client.js +0 -34
  272. package/dist/goal/sdk-client.js.map +0 -1
  273. package/dist/goal/state.d.ts +0 -40
  274. package/dist/goal/state.d.ts.map +0 -1
  275. package/dist/goal/state.js +0 -37
  276. package/dist/goal/state.js.map +0 -1
  277. package/dist/goal/task-triggers.d.ts +0 -15
  278. package/dist/goal/task-triggers.d.ts.map +0 -1
  279. package/dist/goal/task-triggers.js +0 -23
  280. package/dist/goal/task-triggers.js.map +0 -1
  281. package/dist/goal/walls.d.ts +0 -12
  282. package/dist/goal/walls.d.ts.map +0 -1
  283. package/dist/goal/walls.js +0 -65
  284. package/dist/goal/walls.js.map +0 -1
  285. package/dist/goal/worker-prompt.d.ts +0 -13
  286. package/dist/goal/worker-prompt.d.ts.map +0 -1
  287. package/dist/goal/worker-prompt.js +0 -41
  288. package/dist/goal/worker-prompt.js.map +0 -1
  289. package/dist/goal/worker.d.ts +0 -42
  290. package/dist/goal/worker.d.ts.map +0 -1
  291. package/dist/goal/worker.js +0 -180
  292. package/dist/goal/worker.js.map +0 -1
  293. package/dist/templates/common/bundled-skills/cstl-cursor2plus-setup/SKILL.md +0 -63
  294. package/dist/templates/cursor/commands/cursor2plus-setup.md +0 -82
  295. package/dist/templates/cursor/rules/cstl-cursor-modes.mdc +0 -32
  296. package/dist/templates/cursor/rules/cstl-session-rename.mdc +0 -31
  297. package/dist/templates/cursor/rules/cstl-subagent-dispatch.mdc +0 -34
  298. package/dist/templates/cursor/rules/cstl-triage.mdc +0 -36
  299. package/dist/templates/cursor/rules/retrieval-routing.mdc +0 -78
  300. package/dist/templates/trellis/local/README.md +0 -85
  301. package/dist/templates/trellis/local/config.local.json.example +0 -6
  302. package/dist/templates/trellis/local/index.d.ts +0 -8
  303. package/dist/templates/trellis/local/index.d.ts.map +0 -1
  304. package/dist/templates/trellis/local/index.js +0 -15
  305. package/dist/templates/trellis/local/index.js.map +0 -1
  306. package/dist/templates/trellis/local/patch_wpelc8.py +0 -421
  307. package/dist/templates/trellis/local/smoke.py +0 -94
  308. package/dist/templates/trellis/local/subagent-models.json.example +0 -4
  309. package/dist/templates/trellis/local/trellis-task-models.json.example +0 -10
  310. package/dist/templates/trellis/local/trellis-task-models.json5.example +0 -45
  311. package/dist/templates/trellis/local/trellis_task_models_config.py +0 -200
  312. package/dist/utils/cursor-sdk-gate.d.ts +0 -10
  313. package/dist/utils/cursor-sdk-gate.d.ts.map +0 -1
  314. package/dist/utils/cursor-sdk-gate.js +0 -32
  315. package/dist/utils/cursor-sdk-gate.js.map +0 -1
@@ -1,9 +1,14 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
3
  """
4
- Task Management Script.
4
+ Thin Task shim over `cstl kernel --json`.
5
+
6
+ Write-path commands (create / start-execution / record-gate / archive / patch
7
+ via add-subtask and friends) submit a Kernel Command. Do not invent `cstl task`.
8
+ Select / dashboard / jsonl / parent-status stay Python overlays.
5
9
 
6
10
  Usage:
11
+ python task.py kernel # stdin JSON → cstl kernel --json
7
12
  python task.py create "<title>" [--slug <name>] [--assignee <dev>] [--priority P0|P1|P2|P3] [--parent <dir>] [--package <pkg>]
8
13
  python task.py add-context <dir> <file> <path> [reason] # Add jsonl entry
9
14
  python task.py validate <dir> # Validate jsonl files
@@ -39,6 +44,7 @@ Usage:
39
44
  from __future__ import annotations
40
45
 
41
46
  import argparse
47
+ import json
42
48
  import sys
43
49
  from datetime import datetime, timezone
44
50
  from pathlib import Path
@@ -58,12 +64,22 @@ from common.active_task import (
58
64
  resolve_selected_task,
59
65
  set_selected_task,
60
66
  )
61
- from common.io import read_json, write_json
67
+ from common.io import read_json
68
+ from common.kernel_command import (
69
+ KernelCliNotFound,
70
+ KernelCommandError,
71
+ kernel_expected_revision,
72
+ kernel_record_gate,
73
+ kernel_start,
74
+ print_kernel_error,
75
+ run_kernel_command,
76
+ )
62
77
  from common.task_dashboard import render_task_dashboard
63
78
  from common.cli_environment import optional_capability_note
64
79
  from common.task_gates import (
65
80
  BASELINE_GATE,
66
81
  build_reviewer_gate_record,
82
+ collect_kernel_projection_extras,
67
83
  read_strategy_contract,
68
84
  start_execution_repair_hints,
69
85
  validate_start_execution,
@@ -141,6 +157,27 @@ def _resolve_existing_task(task_input: str, repo_root):
141
157
  return full_path
142
158
 
143
159
 
160
+ def cmd_kernel(args: argparse.Namespace) -> int:
161
+ """Forward one JSON object on stdin to `cstl kernel --json`."""
162
+ _ = args
163
+ raw = sys.stdin.read()
164
+ try:
165
+ payload = json.loads(raw) if raw.strip() else {}
166
+ except json.JSONDecodeError as err:
167
+ print(colored(f"Error: stdin is not JSON: {err}", Colors.RED), file=sys.stderr)
168
+ return 1
169
+ if not isinstance(payload, dict):
170
+ print(colored("Error: Kernel request must be a JSON object", Colors.RED), file=sys.stderr)
171
+ return 1
172
+ try:
173
+ result = run_kernel_command(payload, cwd=get_repo_root())
174
+ except (KernelCliNotFound, KernelCommandError) as err:
175
+ print_kernel_error(err)
176
+ return 1
177
+ print(json.dumps(result, ensure_ascii=False))
178
+ return 0
179
+
180
+
144
181
  def cmd_dashboard(args: argparse.Namespace) -> int:
145
182
  """Show Task Dashboard without mutating selection or status."""
146
183
  _ = args
@@ -348,8 +385,24 @@ def cmd_start_execution(args: argparse.Namespace) -> int:
348
385
  }
349
386
  if task_data.get("status") == "planning":
350
387
  task_data["status"] = "in_progress"
351
- if not write_json(task_json_path, task_data):
352
- print(colored("Error: failed to write task.json", Colors.RED), file=sys.stderr)
388
+
389
+ extras = collect_kernel_projection_extras(task_data)
390
+ try:
391
+ expected = kernel_expected_revision(task_dir)
392
+ kernel_start(
393
+ task_dir,
394
+ task_data,
395
+ extras,
396
+ expected_revision=expected,
397
+ actor="task.py start-execution --approved",
398
+ idempotency_key=(
399
+ f"start:{task_data.get('id') or task_dir.name}:"
400
+ f"{task_data['execution_approval']['approved_at']}"
401
+ ),
402
+ evidence="task.py start-execution --approved",
403
+ )
404
+ except (KernelCliNotFound, KernelCommandError) as err:
405
+ print_kernel_error(err)
353
406
  return 1
354
407
 
355
408
  print(colored(f"✓ Execution approved for: {_repo_relative(task_dir, repo_root)}", Colors.GREEN))
@@ -394,8 +447,25 @@ def cmd_record_gate(args: argparse.Namespace) -> int:
394
447
 
395
448
  assert record is not None
396
449
  write_gate_record(task_data, args.transition, args.gate, record)
397
- if not write_json(task_json_path, task_data):
398
- print(colored("Error: failed to write task.json", Colors.RED), file=sys.stderr)
450
+ extras = collect_kernel_projection_extras(task_data)
451
+ try:
452
+ expected = kernel_expected_revision(task_dir)
453
+ kernel_record_gate(
454
+ task_dir,
455
+ expected_revision=expected,
456
+ actor="task.py record-gate",
457
+ idempotency_key=(
458
+ f"gate:{args.transition}:{args.gate}:"
459
+ f"{record.get('contract_fingerprint') or record.get('evidence')}"
460
+ ),
461
+ transition=args.transition,
462
+ gate=args.gate,
463
+ record=record,
464
+ extras=extras,
465
+ evidence=str(record.get("evidence") or args.evidence),
466
+ )
467
+ except (KernelCliNotFound, KernelCommandError) as err:
468
+ print_kernel_error(err)
399
469
  return 1
400
470
 
401
471
  print(colored(f"✓ Recorded gate: {args.transition}/{args.gate} = {record['result']}", Colors.GREEN))
@@ -656,11 +726,16 @@ def main() -> int:
656
726
  return 2
657
727
 
658
728
  parser = argparse.ArgumentParser(
659
- description="Task Management Script",
729
+ description="Thin Task shim over cstl kernel --json",
660
730
  formatter_class=argparse.RawDescriptionHelpFormatter,
661
731
  )
662
732
  subparsers = parser.add_subparsers(dest="command", help="Commands")
663
733
 
734
+ subparsers.add_parser(
735
+ "kernel",
736
+ help="Forward stdin JSON to `cstl kernel --json` (do not invent cstl task)",
737
+ )
738
+
664
739
  # create
665
740
  p_create = subparsers.add_parser("create", help="Create new task")
666
741
  p_create.add_argument("title", help="Task title")
@@ -989,6 +1064,7 @@ def main() -> int:
989
1064
  return 1
990
1065
 
991
1066
  commands = {
1067
+ "kernel": cmd_kernel,
992
1068
  "create": cmd_create,
993
1069
  "add-context": cmd_add_context,
994
1070
  "validate": cmd_validate,
@@ -1,17 +1,22 @@
1
1
  # Development Workflow
2
2
 
3
+ > **Human overview — not runtime SSOT.** This file is a copy-template reading guide for people. Gates, Rigor, Topology, and Task state are Kernel/`task.json` projections (`required_controls`, Topology, Event Bridge). Do not parse this document as the runtime program of record.
4
+
3
5
  ---
4
6
 
5
7
  ## Core Principles
6
8
 
7
- 1. **Plan before code** — figure out what to do before you start
8
- 2. **Specs injected, not remembered** — guidelines are injected via hook/skill, not recalled from memory
9
- 3. **Persist everything** — research, decisions, and lessons all go to files; conversations get compacted, files don't
10
- 4. **Incremental development** — one task at a time
11
- 5. **Capture learnings** — after each task, review and write new knowledge back to spec
9
+ 1. **Parallel first** — when ≥2 independent units have isolatable write-sets, default to parallel; serial needs a written reason. Attention order is not a serial lock. Convention + review, not a new CLI gate. See Parallel-first below.
10
+ 2. **Plan before code** — figure out what to do before you start
11
+ 3. **Specs injected, not remembered** guidelines are injected via hook/skill, not recalled from memory
12
+ 4. **Persist everything** — research, decisions, and lessons all go to files; conversations get compacted, files don't
13
+ 5. **Incremental development** — finish a slice before expanding; this is not a serial lock on independent units
14
+ 6. **Capture learnings** — after each task, review and write new knowledge back to spec
12
15
 
13
16
  **Session boundary** — Continue → clear → handoff (`cstl-handoff`, when the work needs to travel) → subagent → compact. A task directory's `handoff.md` is integration/delivery evidence, not a session handoff document.
14
17
 
18
+ **Durable objectives** — Cursor official `/goal` (persistent in-session run). Not a Trellis task type, not Parent/Child, not `cstl-handoff`. Do **not** restore `cstl-goal`.
19
+
15
20
  ---
16
21
 
17
22
  ## Trellis System
@@ -110,7 +115,7 @@ python3 ./.cstl/scripts/get_context.py --mode retrieval-pack --json --input <evi
110
115
 
111
116
  **Retrieval daily guide:** `.cstl/framework/retrieval-daily-guide.md` — when to use rg, codegraph, fast-context-mcp, smart-search-cli (and Cursor web fallback), artifact/session memory, codebase router (suggest-only), and explicit retrieval-pack scoring.
112
117
 
113
- **Cursor subagent dispatch:** `.cstl/framework/cursor-subagent-policy.md` — `cstl-research` / `cstl-implement` / `cstl-check`; Parent child default **Task** `cstl-implement` from Parent session (`generate-child-prompt --mode subagent`). **Cursor++ BYOK:** per-type models via `.cstl/local/cursor2plus/` + user/project JSON maps (not committed slugs). **Native Cursor API:** frontmatter `model:` on agents still works. PRD Grill stays in the planning session (Read `.cstl/framework/prd-grill-frontier.md`), not a subagent. **Cursor++:** compatible v0.0.11+ (SubAgent readonly bug fixed).
118
+ **Cursor subagent dispatch:** `.cstl/framework/cursor-subagent-policy.md` — `cstl-research` / `cstl-implement` / `cstl-check`; Parent child default **Task** `cstl-implement` from Parent session (`generate-child-prompt --mode subagent`). **Native Cursor API:** frontmatter `model:` on agents still works. PRD Grill stays in the planning session (Read `.cstl/framework/prd-grill-frontier.md`), not a subagent. Cursor++ / cstl-byok are **not** Native install surfaces (no command, skill, or init ask).
114
119
 
115
120
  ---
116
121
 
@@ -188,6 +193,65 @@ Classification mark (R2 — visible audit trail). Start your reply with one line
188
193
 
189
194
  Consent gate. After classifying into any mode that creates a task, ask the user for task-creation consent before creating any Trellis artifact. User approval to create a task is **not** approval to start implementation — planning still happens first. If the user declines a task for a simple request, skip Trellis for this session.
190
195
 
196
+ ### Personal Lite path (Open → Close)
197
+
198
+ Personal Lite is the default runnable slice: **main Agent**, Definition / Evidence dual surfaces, **no Parent topology**, **no Git requirement**. Kernel phase names are internal; user-visible `planning` / `in_progress` / `completed` stay unchanged.
199
+
200
+ | Step | Event / surface | Notes |
201
+ | --- | --- | --- |
202
+ | Open | Triage Outcome `No Task` or `Lite` | Event-style; do not require Parent. Full always-on tree stays for Full/Parent. |
203
+ | Define | `prd.md` | Created on `task.py create`; fill Acceptance Criteria before Execute. |
204
+ | Approve | `task.py start-execution --approved` | `--check` is CLI preflight only — it does **not** impersonate human approval. |
205
+ | Execute | Main Agent | Do not force Subagent, worktree, or Parent. |
206
+ | Verify | `verify.md` | Required Evidence. Placeholder / fake-green still fails Close. |
207
+ | Close | `task.py archive` | Writes Outcome. Missing `.git` or `task-map.md` / `children[]` must not fail Lite Close. Physical directory retention is not a completion condition. |
208
+
209
+ Context: `python3 ./.cstl/scripts/get_context.py --mode lite --json` assembles a **budgeted** pack (Definition / Evidence / thin exact-semantic-structural-external router). Unactivated On-demand (Parent / VCS / retrieval-extended) and a full `workflow.md` dump are refused rather than silently stuffed in.
210
+
211
+ Low interaction: no hard-Risk Lite does not add extra mechanical confirmation gates. The Agent retrieves repo facts; the user decides intent, risk acceptance, and the Approve/Close gates above.
212
+
213
+ ### Full Quality path (conditional Design + ledger + graded Check)
214
+
215
+ Full keeps the same user-visible `planning` / `in_progress` / `completed` names. Kernel persists resolved `required_controls`; **do not infer Rigor from whether `design.md` happens to exist**.
216
+
217
+ | Role | Default surface | Required? |
218
+ | --- | --- | --- |
219
+ | Definition | `prd.md` | Yes |
220
+ | Execution Contract | `implement.md` (strategy contract) | Yes |
221
+ | Verification Plan | `implement.md` | Yes |
222
+ | Evidence | `verify.md` (human projection) | Yes |
223
+ | Independent Check | `self-review` or `true-independent` verdict | Yes for Full; **not** for Lite |
224
+ | Design | `design.md` | Only when Risk/Policy or `verification_profile: architecture` requires it |
225
+
226
+ - `verification_profile` expands to gates; Kernel stores the final `required_controls`.
227
+ - AC → Evidence Ledger is machine-readable (`ac_evidence_ledger` on `task.json`); `verify.md` is the human projection. Missing mapping, placeholder evidence, or a stale fingerprint after definition/code change blocks Close.
228
+ - Independent Check is **read-only**. Repair returns to Execute. Platform without a reliable independent worker must label `self-review` and must not claim independent. `true-independent` without a worker **blocks**.
229
+ - Lite Open→Close is unchanged and does not gain Independent Check from this path.
230
+
231
+ ### On-demand and Topology (Stage 5)
232
+
233
+ Rigor (`lite` / `full`) and Topology (`single` / `parent-child`) are orthogonal. Parent is an orchestration topology, not a higher quality grade. Kernel extras (`topology`, `dependency_graph`, `ondemand_modules`) are the graph authority; `task-map.md` and the dashboard are projections. Prefer Cursor native parallel (P18); Trellis does not schedule workers.
234
+
235
+ - Single-parent tree: a Task has at most one Parent. A second Parent is rejected.
236
+ - Decompose only proposes slices. Child directories are not created until the user confirms.
237
+ - Capture Candidate writes a pool candidate. It does not create a Task.
238
+ - Typed edges: `requires` blocks readiness; `advisory` does not. Existing `depends_on` expands to `requires`.
239
+ - Integration authority stays with the Parent. A Child must not `integrate-child`.
240
+ - On-demand modules (Parent-Child, VCS, Memory, Retention, …) are registered and dormant. First legal trigger activates them and is auditable. Lite Single does not force Parent / VCS / Memory / Retention into the resident pack.
241
+ - `integration-handoff` is owned by Parent-Child. `session-transfer` is a separate owner.
242
+ - Missing lifecycle slots still block start. Missing Profile-required On-demand is `degraded`, not fake-green. Physical Retention does not change Close Outcome.
243
+ - User-visible `planning` / `in_progress` / `completed` names stay unchanged.
244
+
245
+ ### Adapter and Middleware (Stage 6)
246
+
247
+ Cursor Adapter stays thin: a generic Event Bridge, one Bootstrap rule, and a short AGENTS pointer. Modules subscribe to standard hook events; an unsubscribed module must not fail the hook. Baseline capability routing is only `exact` / `semantic` / `structural` / `external`.
248
+
249
+ - smart-search is an independent `external-knowledge` Middleware Provider. CSTL holds capability, readiness, compatibility range, and evidence pointers — not the Provider implementation.
250
+ - Missing or failed Provider marks Profile `degraded`. Tasks that do not need external knowledge may Open→Close. Tasks that require it block, or degrade when Policy says so. Platform native Web is a downgrade, not an equivalent.
251
+ - codegraph and fast-context are Optional. They are not default always-on and are not forced into the install surface.
252
+ - Native SSOT has no Cursor++ / cstl-byok live entry. Environment probe fields may remain.
253
+ - Do not rewrite smart-search or codegraph here. Do not invent a Trellis scheduler.
254
+
191
255
  Selected-task continuity. When a `selected_task` already exists, do not rerun global classification on every follow-up; continue inside the selected task unless a strong conflict exists (explicit exit/switch/create language, out-of-scope request, different artifact/archive target, new independent deliverable, contract-changing request, or evidence pollution risk).
192
256
 
193
257
  Review-pool boundary. In-session requests that are clear and directly actionable go straight to Lite / Full / Parent task creation and do **not** enter the pool (`.cstl/pool/`). Ideas, directions, gaps, or unformed thoughts go into the pool. Only `accepted` pool entries may be turned into tasks via `task.py create`. The pool is a candidate queue; a Task is a commitment. See `.cstl/pool/README.md` for the full state machine and role split. Pool entry ↔ task links and pool/plan validation are maintained via the pool CLI: `python3 ./.cstl/scripts/pool.py --help` (link/unlink/validate/plan-check/show). Choosing the next item: treat `plan.md` closed/mainline sections as authoritative → item status → `task.py list` → ask the user; landed items/mechanisms must leave fog (discipline in `.cstl/pool/README.md` 「下一项怎么选 + fog 卫生」).
@@ -201,7 +265,7 @@ Classify by risk and persistence, not raw effort size. A short change to durable
201
265
  | No Task | Conversation, status, explanation, read-only lookup, or a tiny one-turn action with no durable project change. | explain / status / lookup / read-only / one-liner | None. No archive unless upgraded. |
202
266
  | Micro-Grill | The user needs focused clarification, decision pressure, or a small requirement interrogation before deciding whether work exists. | small + underspecified / "depends" / needs clarification / decision tree first | Usually none. Upgrade before durable edits, validation, gates, or archive evidence. |
203
267
  | Lite Task | Low-risk durable work with narrow scope, local validation, and no shared contract change. | low-risk / single file / local validation / no contract / narrow scope | `task.json`, `prd.md`, `verify.md`, and archive evidence. |
204
- | Full Task | Durable code, template, runtime, workflow, or cross-file behavior where design, execution strategy, validation, or reviewer gates matter. | cross-file / framework semantics / contract change / template / runtime / workflow / multi-file behavior | `prd.md`, `design.md`, `implement.md`, `verify.md`, Development Strategy Contract, `verification_profile`, `quality_gates`, and archive evidence. |
268
+ | Full Task | Durable code, template, runtime, workflow, or cross-file behavior where design, execution strategy, validation, or reviewer gates matter. | cross-file / framework semantics / contract change / template / runtime / workflow / multi-file behavior | `prd.md`, `implement.md`, `verify.md`, Execution/Verification contract, `required_controls`, AC ledger, Independent Check; `design.md` only when Risk/Policy requires it |
205
269
  | Parent Task / Child Tasks | One request contains independent deliverables, staged execution, parallel execution, or final integration authority that must be owned by a Parent. | multiple independent deliverables / staged / parallel / integration authority | Parent `task-map.md`, Child task artifacts, Child handoff evidence, Parent final integration evidence. |
206
270
 
207
271
  Default Trellis framework semantics, task model, platform adapters, MCP/capability setup, runtime integration, retrieval/graph tooling, Parent/Child orchestration, and quality-gate work to Full Task or higher.
@@ -227,16 +291,12 @@ Before executing an upgrade that creates artifacts, changes task mode, adds gate
227
291
  | No selected task + need dashboard | `cstl-start` |
228
292
  | Selected task + resume step | `cstl-continue` |
229
293
  | Planning / PRD | Read `.cstl/framework/prd-grill-frontier.md` (PRD Grill discipline; full body in the bundled brainstorm skill) |
230
- | Parent with parallel children | `generate-child-prompt --mode subagent`; writable Agent; see `.cstl/framework/cursor-subagent-policy.md` |
231
-
232
- ### Goal runtime (not a Task Ladder type)
233
-
234
- **Goal** here means the **CLI subsystem** `cstl goal` (preflight → accept → run / pause / status / review), **not** a Task Ladder type and **not** Parent/Child orchestration. When the user says "use goal", run or suggest `cstl goal status` / `cstl goal preflight …` in the project terminal — do **not** create a "goal" task or map it to `add-subtask` / Parent-only planning. Default Cursor install has **no** `/cstl-goal` slash command (dogfood/extension only). See the AGENTS.md Invocation map.
294
+ | Parent with parallel children | Prefer Multitask / `Task` parallel (serial needs `serial_reason`); `generate-child-prompt --mode subagent`; see `cursor-native-modes-guide.md` |
235
295
 
236
296
  ### Cursor native modes (Prefer — don't replace)
237
297
 
238
298
  Full map: `.cstl/framework/cursor-native-modes-guide.md` · per-turn slim rule: `.cursor/rules/cstl-cursor-modes.mdc`.
239
- Task-driven: try callable native first (`SwitchMode` plan/agent, Multitask/`Task` when useful); **quiet cstl spine fallback** when not — no user-facing “不适配 mode” list.
299
+ Task-driven: try callable native first (`SwitchMode` plan/agent; Multitask/`Task` **by default** when ≥2 independent units); **quiet cstl spine fallback** when not — no user-facing “不适配 mode” list.
240
300
 
241
301
  | Situation | Prefer Cursor mode | Trellis phase / note |
242
302
  | --- | --- | --- |
@@ -244,7 +304,7 @@ Task-driven: try callable native first (`SwitchMode` plan/agent, Multitask/`Task
244
304
  | Scope / design before code | **Plan** (`SwitchMode(plan)` when useful) | Phase 1; artifacts → `prd.md` / `design.md` / `implement.md` |
245
305
  | Approved build / verify | **Agent** | Phase 2–3; `execution_mode` contract |
246
306
  | Repeat failure / runtime debug | **Debug** when reachable | Evidence → `verify.md`; loops → `cstl-break-loop` |
247
- | Independent Parent children (post-approval) | **Multitask** / Build in Parallel when useful | Explicit task path per worker; Parent integrates |
307
+ | Independent Parent children (post-approval) | **Multitask** / Build in Parallel **by default** when ≥2 independent units | Explicit task path per worker; serial needs `serial_reason`; Parent integrates |
248
308
 
249
309
  Details: archived `06-15-child-phase3-task-ladder` → `research/task-ladder-iteration.md`.
250
310
 
@@ -252,10 +312,10 @@ Details: archived `06-15-child-phase3-task-ladder` → `research/task-ladder-ite
252
312
 
253
313
  - `prd.md` — requirements, constraints, and acceptance criteria. Do not put technical design or execution checklists here.
254
314
  - `design.md` — technical design for complex tasks: boundaries, contracts, data flow, tradeoffs, compatibility, rollout / rollback shape.
255
- - `implement.md` — execution plan for complex tasks: ordered checklist, Development Strategy Contract, validation commands, review gates, and rollback points.
315
+ - `implement.md` — execution plan for complex tasks: ordered checklist, Development Strategy Contract, validation commands, review gates, and rollback points. Parent / Full Task fan-out also declare parallel-first fields (可并行组 / 合并点 / 冲突面 / `serial_reason`) — see Parallel-first above and `.cstl/framework/parallel-first-execution.md`.
256
316
  - `implement.jsonl` / `check.jsonl` — spec and research manifests for sub-agent context. They do not replace `implement.md`.
257
- - `verification_profile` / `quality_gates` — gate policy belongs in task artifacts and `task.json`; `task.json.quality_gate_results` is compact machine-checkable state, not human review prose.
258
- - Lightweight tasks may be PRD-only. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start-execution --check`.
317
+ - `verification_profile` / `quality_gates` — gate policy belongs in task artifacts and `task.json`; Kernel persists resolved `required_controls`. `task.json.quality_gate_results` is compact machine-checkable state, not human review prose. `ac_evidence_ledger` is the machine AC → Evidence map; `verify.md` is the human projection.
318
+ - Lightweight tasks may be PRD-only. Full tasks need Definition + Execution/Verification contract (`implement.md` default) before `task.py start-execution --check`. Design is required only when Risk/Policy or `verification_profile: architecture` says so — do not treat a leftover `design.md` as Full.
259
319
  - `start-execution` planning gates (`requirements-review`, `architecture-review` when enabled) auto-record on `--approved` when artifacts pass CLI checks; use `record-gate` only as a manual override.
260
320
 
261
321
  ### Parent / Child Task Trees
@@ -264,6 +324,24 @@ Use a parent task when one user request contains several independently verifiabl
264
324
 
265
325
  Use child tasks for deliverables that can be planned, implemented, checked, and archived independently. Ordering between deliverables is an explicit declaration, not an implicit system: child-level ordering lives in the Parent `task-map.md` `children[].depends_on`, and task-level ordering in task.json `depends_on` (`task.py set-deps <task> <dep...>`). By default these declarations are soft hints only — the dashboard and `start-execution --check` show unmet / dangling / cyclic dependencies as warnings and do not block a transition (a task may opt into hard gates with `depends_mode: block`, see Task dependencies below); `depends_on` declares ordering, it does not schedule work. Keep each child's acceptance criteria testable on its own, and keep the Parent as the integration authority.
266
326
 
327
+ ### Parallel-first execution
328
+
329
+ This is a **product** principle, not only an execution contract. It applies to the review pool, development-plan batches, Parent/Full fan-out, and independent middleware / protocol / release tracks. Planning declares parallel structure; **Cursor native** runs it. Trellis does **not** ship a parallel scheduler or a Multitask replacement. Field map: `.cstl/framework/parallel-first-execution.md`.
330
+
331
+ **Does not apply:** Lite / single-file work; write-sets that cannot isolate; HITL / `start-execution --approved` / reviewer / `integrate-child`.
332
+
333
+ **Does not replace** the existing `serial_reason` list. v1 strength is convention + review call-out, **not** a CLI hard gate.
334
+
335
+ | Layer | Duty |
336
+ | --- | --- |
337
+ | **Prefer** | Cursor Multitask / Build in Parallel / Agent `Task` parallel / native worktree. If it can run native, run native. |
338
+ | **Adapt** | Parent still owns `integrate-child`. HITL, `start-execution --approved`, and reviewer gates stay **serial**. Every worker prompt includes explicit `.cstl/tasks/<dir>` — never rely on `selected_task`. |
339
+ | **Own** | Contract only: default parallel; serial must write `serial_reason`; task-map / `implement.md` declare 可并行组 / 合并点 / 冲突面. No queue, no new CLI. |
340
+
341
+ **Default parallel when** planning already has ≥2 independent units: Parent children with empty `depends_on`, or a Full task with explicit Task fan-out. Lite / single-file work is **not** forced into parallel agents.
342
+
343
+ **Serial is an exception.** Write `serial_reason` as one of: shared write-set / HITL or reviewer gate / `depends_on` unmet / user asked serial / conflict surface cannot isolate.
344
+
267
345
  ### Task dependencies (Plan A / Plan B)
268
346
 
269
347
  **任务依赖(Plan A / Plan B)**:顺序须显式声明;默认(`warn`)仅 dashboard / `start-execution --check` 软提示(WARN),不挡门禁;可 opt-in `block` 在 mutation 点硬挡(见下);不是调度器,也不替代 Parent 集成权威。
@@ -402,10 +480,11 @@ When a user request matches one of these intents inside a selected task, route f
402
480
 
403
481
 
404
482
  - Planning or unclear requirements -> **Prefer Plan** when designing scope; read `.cstl/framework/prd-grill-frontier.md` for PRD grill discipline (see `.cstl/framework/cursor-native-modes-guide.md`).
483
+ - Creating or making a **behavioral/structural** change to a Trellis bundled, `blaze-skills`, or harness skill → **must** Read `cstl-skill-creator` (`SKILL.md` + `references/review-checklist.md`) and follow its workflow before editing `SKILL.md`. **Skip** for typo / pure link fixes. Internal skill, not a user slash command. **Does not apply** to Cursor product skills (e.g. `~/.cursor/skills-cursor/create-skill`). Paths: `.cstl/framework/internal-skills-cursor-reachability.md`.
405
484
  - Read-only questions with no durable change -> **Prefer Ask**; classify No Task; do not create artifacts without consent.
406
485
  - `in_progress` implementation/check -> **Agent** default; if contract `execution_mode: worker`, dispatch `cstl-implement` / `cstl-check`; if `inline`, main session; if `child-task`, Child/Parent orchestration.
407
486
  - Repeated debugging / runtime evidence -> **Prefer Debug**; load `cstl-break-loop` when the same issue recurred; persist evidence in `verify.md`.
408
- - Parent parallel independent children (after execution approval) -> **Multitask** / Build in Parallel with explicit `.cstl/tasks/<dir>` in each worker prompt; Parent retains integration authority.
487
+ - Parent parallel independent children (after execution approval) -> **Multitask** / Build in Parallel **by default** (empty `depends_on`); each worker prompt has explicit `.cstl/tasks/<dir>`; serial needs `serial_reason`; Parent retains integration authority. HITL / gates / `integrate-child` stay serial.
409
488
  - Spec updates after learning decision -> `cstl-update-spec`.
410
489
 
411
490
 
@@ -646,6 +725,8 @@ Read `execution_mode` from the approved Development Strategy Contract in `implem
646
725
  | `worker` | Spawn **`cstl-implement`** (Cursor): after `start-execution --approved`, assemble dispatch prompt via CLI Layer 2, then `Task(subagent_type=cstl-implement, prompt=<assembled>)`. Do **not** rely on preToolUse hook alone — see `cursor-context-injection-guide.md`. Tell the spawned agent it is already `cstl-implement` and must not spawn another `cstl-implement` / `cstl-check`. |
647
726
  | `child-task` | Child worker session (or Parent `generate-child-prompt`); isolation per contract (`git-worktree` → `prepare-child-worktree` when applicable). |
648
727
 
728
+ Independent Parent children (post-approval, empty `depends_on`): Prefer native parallel (Multitask / Build in Parallel / `Task` / worktree). Do **not** invent a Trellis scheduler. HITL, `start-execution --approved`, reviewer gates, and `integrate-child` stay serial (`merge_limit: 1`). Serial work requires `serial_reason` in the task-map / `implement.md` declaration. See Parallel-first above.
729
+
649
730
  Context for worker dispatch includes `implement.jsonl` references, `prd.md`, `design.md` if present, and `implement.md` if present.
650
731
 
651
732
  #### 2.2 Quality check `[required · repeatable]`
@@ -662,6 +743,7 @@ The check agent's job:
662
743
  - Fix implementation defects only when they stay inside the approved contract
663
744
  - Route requirement, design, contract, scope, gate, capability, runtime, Parent `contract_epoch`, or Child boundary defects to Return-to-Planning
664
745
  - Run lint and typecheck to verify
746
+ - For **new or structurally changed** Trellis / blaze-skills / harness skills: `verify.md` should record that `cstl-skill-creator` workflow + review-checklist was followed (always-on convention, not a CLI gate). Typo / link-only and Cursor product skills are out of scope.
665
747
 
666
748
 
667
749
 
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Detect Cursor Native vs Cursor++ BYOK for retrieval routing.
2
+ * Detect Cursor Native vs BYOK environment for retrieval routing.
3
+ * This is an environment probe, not a product install surface.
3
4
  * Mirrors templates/trellis/scripts/common/cursor_retrieval_env.py
4
5
  */
5
6
  export declare const ENV_NATIVE: "native";
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-retrieval-env.d.ts","sourceRoot":"","sources":["../../src/utils/cursor-retrieval-env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,eAAO,MAAM,UAAU,EAAG,QAAiB,CAAC;AAC5C,eAAO,MAAM,QAAQ,EAAG,MAAe,CAAC;AACxC,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAE9C,MAAM,MAAM,kBAAkB,GAC1B,OAAO,UAAU,GACjB,OAAO,QAAQ,GACf,OAAO,WAAW,CAAC;AAEvB,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,kBAAkB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,KAAK,CAAC,EA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,IAAI,sBAAsB,CA8CrE;AAED,wBAAgB,wBAAwB,IAAI,kBAAkB,CAU7D;AAED,wBAAgB,MAAM,CAAC,GAAG,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,OAAO,CAE/D;AAED,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,OAAO,CAG3E;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,kBAAkB,GAAG,gBAAgB,CAAC;CACxD;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,kBAAkB,GAC5B,iBAAiB,CAqBnB"}
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Detect Cursor Native vs Cursor++ BYOK for retrieval routing.
2
+ * Detect Cursor Native vs BYOK environment for retrieval routing.
3
+ * This is an environment probe, not a product install surface.
3
4
  * Mirrors templates/trellis/scripts/common/cursor_retrieval_env.py
4
5
  */
5
6
  import fs from "node:fs";
@@ -82,7 +83,7 @@ export function semanticRouteSpec(cursorEnv) {
82
83
  : "";
83
84
  return {
84
85
  commands: ["fast_context_search (fast-context MCP)"],
85
- rationaleSuffix: " Cursor++ BYOK: built-in semantic unavailable; fast-context MCP primary." +
86
+ rationaleSuffix: " BYOK env probe: built-in semantic unavailable; Optional fast-context only if selected." +
86
87
  unknownCaveat,
87
88
  platformNative: false,
88
89
  semanticBackend: "fast-context-mcp",
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-retrieval-env.js","sourceRoot":"","sources":["../../src/utils/cursor-retrieval-env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,UAA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AO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,WAAW,CAAC;AAC3D,CAAC;AASD,MAAM,UAAU,iBAAiB,CAC/B,SAA6B;IAE7B,IAAI,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC;QAClC,MAAM,aAAa,GACjB,SAAS,KAAK,WAAW;YACvB,CAAC,CAAC,uEAAuE;YACzE,CAAC,CAAC,EAAE,CAAC;QACT,OAAO;YACL,QAAQ,EAAE,CAAC,wCAAwC,CAAC;YACpD,eAAe,EACb,yFAAyF;gBACzF,aAAa;YACf,cAAc,EAAE,KAAK;YACrB,eAAe,EAAE,kBAAkB;SACpC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,CAAC,8CAA8C,CAAC;QAC1D,eAAe,EAAE,mCAAmC;QACpD,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,gBAAgB;KAClC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Hash-safe cleanup of retired Cursor++ managed residue.
3
+ *
4
+ * Cursor++ product surfaces are no longer shipped. On `cstl update`, delete
5
+ * known managed paths only when on-disk content matches a pristine template
6
+ * hash captured from the last shipped SSOT bytes. User-modified files are
7
+ * preserved with a warning.
8
+ *
9
+ * Never target `.cstl/middleware/` (user overlay). Residue paths are an
10
+ * explicit allow-list; overlay isolation is a separate contract.
11
+ */
12
+ /** Relative path under the workflow dir (`.cstl` or `.trellis`) or absolute-from-cwd. */
13
+ export interface Cursor2plusResidueTarget {
14
+ /** Posix-style path relative to project cwd (uses `{workflow}` placeholder). */
15
+ pathTemplate: string;
16
+ allowedHashes: readonly string[];
17
+ }
18
+ /**
19
+ * Pristine hashes computed from packages/cli/src/templates before P23 deletion
20
+ * (LF-normalized SHA-256, same as computeHash).
21
+ */
22
+ export declare const CURSOR2PLUS_RESIDUE_TARGETS: readonly Cursor2plusResidueTarget[];
23
+ export interface Cursor2plusResidueCleanupResult {
24
+ deleted: string[];
25
+ preservedModified: string[];
26
+ missing: string[];
27
+ }
28
+ /**
29
+ * Delete pristine Cursor++ residue under cwd. Never deletes user-modified files.
30
+ */
31
+ export declare function cleanupCursor2plusResidue(cwd: string, options?: {
32
+ dryRun?: boolean;
33
+ }): Cursor2plusResidueCleanupResult;
34
+ /**
35
+ * True when any Cursor++ local bundle directory still exists (residue notice).
36
+ */
37
+ export declare function hasCursor2plusBundleResidue(cwd: string): boolean;
38
+ //# sourceMappingURL=cursor2plus-residue-cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor2plus-residue-cleanup.d.ts","sourceRoot":"","sources":["../../src/utils/cursor2plus-residue-cleanup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,yFAAyF;AACzF,MAAM,WAAW,wBAAwB;IACvC,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,wBAAwB,EA6D1E,CAAC;AAEF,MAAM,WAAW,+BAA+B;IAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAwBD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,+BAA+B,CA8BjC;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAQhE"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Hash-safe cleanup of retired Cursor++ managed residue.
3
+ *
4
+ * Cursor++ product surfaces are no longer shipped. On `cstl update`, delete
5
+ * known managed paths only when on-disk content matches a pristine template
6
+ * hash captured from the last shipped SSOT bytes. User-modified files are
7
+ * preserved with a warning.
8
+ *
9
+ * Never target `.cstl/middleware/` (user overlay). Residue paths are an
10
+ * explicit allow-list; overlay isolation is a separate contract.
11
+ */
12
+ import fs from "node:fs";
13
+ import path from "node:path";
14
+ import { DIR_NAMES } from "../constants/paths.js";
15
+ import { computeHash, removeHash } from "./template-hash.js";
16
+ import { resolveWorkflowDirName } from "./workflow-dir.js";
17
+ /**
18
+ * Pristine hashes computed from packages/cli/src/templates before P23 deletion
19
+ * (LF-normalized SHA-256, same as computeHash).
20
+ */
21
+ export const CURSOR2PLUS_RESIDUE_TARGETS = [
22
+ {
23
+ pathTemplate: "{workflow}/local/cursor2plus/patch_wpelc8.py",
24
+ allowedHashes: [
25
+ "480d24cb0b5f98691938525db2e73326dfc9e2c70783fb3c357bc442f4d4c427",
26
+ ],
27
+ },
28
+ {
29
+ pathTemplate: "{workflow}/local/cursor2plus/smoke.py",
30
+ allowedHashes: [
31
+ "e7eecc069188e1dde85312ac5271932e797a3af37c3ae1bd397bbbbfe4f9785b",
32
+ ],
33
+ },
34
+ {
35
+ pathTemplate: "{workflow}/local/cursor2plus/README.md",
36
+ allowedHashes: [
37
+ "d170822a5f3d2bc01238ca4b9e72acb197b2678da7f5f9ffa0226e09fdb2a312",
38
+ ],
39
+ },
40
+ {
41
+ pathTemplate: "{workflow}/local/cursor2plus/config.local.json.example",
42
+ allowedHashes: [
43
+ "b01b653f74fed06070232eca22f2daeb8c14bf7c99db21446f6ee1105f0ce016",
44
+ ],
45
+ },
46
+ {
47
+ pathTemplate: "{workflow}/local/cursor2plus/trellis_task_models_config.py",
48
+ allowedHashes: [
49
+ "d27ebea2caeb52ec990a99c9e1c20c6a8265f65ceb95f28e01771b4efd6fa891",
50
+ ],
51
+ },
52
+ {
53
+ pathTemplate: "{workflow}/local/subagent-models.json.example",
54
+ allowedHashes: [
55
+ "57212acbb4d2434f13ca5a7b40ec7ca00136870748943a92e8036d8b1e8e7434",
56
+ ],
57
+ },
58
+ {
59
+ pathTemplate: "{workflow}/local/trellis-task-models.json.example",
60
+ allowedHashes: [
61
+ "10b74000b32020fbd5d3be73deeb61c066b51ea6fcfe7c1bba5883deb24fce65",
62
+ ],
63
+ },
64
+ {
65
+ pathTemplate: "{workflow}/local/trellis-task-models.json5.example",
66
+ allowedHashes: [
67
+ "30c7bf1809065eecd9afcafd67ad36d32b5d3a5a3c07f54b9a58a22b4f34f267",
68
+ ],
69
+ },
70
+ {
71
+ pathTemplate: ".cursor/commands/cstl-cursor2plus-setup.md",
72
+ allowedHashes: [
73
+ "7792337f85639e1bd0162d525056ee26cadb3400bf77e98d1a9bfe18d09d885c",
74
+ ],
75
+ },
76
+ {
77
+ pathTemplate: ".cursor/skills/cstl-cursor2plus-setup/SKILL.md",
78
+ allowedHashes: [
79
+ "bc3e11e550caceab6fa3feb994bcc5c4fb45ee612feb5223b0212b061d136d16",
80
+ ],
81
+ },
82
+ ];
83
+ function resolvePathTemplate(pathTemplate, workflowDirName) {
84
+ return pathTemplate.replaceAll("{workflow}", workflowDirName);
85
+ }
86
+ function tryRemoveEmptyParents(filePath, stopAt) {
87
+ let dir = path.dirname(filePath);
88
+ const stop = path.resolve(stopAt);
89
+ while (dir.startsWith(stop) && dir !== stop) {
90
+ if (!fs.existsSync(dir)) {
91
+ dir = path.dirname(dir);
92
+ continue;
93
+ }
94
+ const entries = fs.readdirSync(dir);
95
+ if (entries.length > 0)
96
+ break;
97
+ fs.rmdirSync(dir);
98
+ dir = path.dirname(dir);
99
+ }
100
+ }
101
+ /**
102
+ * Delete pristine Cursor++ residue under cwd. Never deletes user-modified files.
103
+ */
104
+ export function cleanupCursor2plusResidue(cwd, options = {}) {
105
+ const workflowDirName = resolveWorkflowDirName(cwd) ?? DIR_NAMES.WORKFLOW;
106
+ const result = {
107
+ deleted: [],
108
+ preservedModified: [],
109
+ missing: [],
110
+ };
111
+ for (const target of CURSOR2PLUS_RESIDUE_TARGETS) {
112
+ const rel = resolvePathTemplate(target.pathTemplate, workflowDirName);
113
+ const fullPath = path.join(cwd, rel);
114
+ if (!fs.existsSync(fullPath)) {
115
+ result.missing.push(rel);
116
+ continue;
117
+ }
118
+ const content = fs.readFileSync(fullPath, "utf-8");
119
+ const hash = computeHash(content);
120
+ if (!target.allowedHashes.includes(hash)) {
121
+ result.preservedModified.push(rel);
122
+ continue;
123
+ }
124
+ if (!options.dryRun) {
125
+ fs.unlinkSync(fullPath);
126
+ removeHash(cwd, rel);
127
+ tryRemoveEmptyParents(fullPath, cwd);
128
+ }
129
+ result.deleted.push(rel);
130
+ }
131
+ return result;
132
+ }
133
+ /**
134
+ * True when any Cursor++ local bundle directory still exists (residue notice).
135
+ */
136
+ export function hasCursor2plusBundleResidue(cwd) {
137
+ const workflowDirName = resolveWorkflowDirName(cwd) ?? DIR_NAMES.WORKFLOW;
138
+ const candidates = [
139
+ path.join(cwd, workflowDirName, "local", "cursor2plus"),
140
+ path.join(cwd, ".cstl", "local", "cursor2plus"),
141
+ path.join(cwd, ".trellis", "local", "cursor2plus"),
142
+ ];
143
+ return candidates.some((p) => fs.existsSync(p));
144
+ }
145
+ //# sourceMappingURL=cursor2plus-residue-cleanup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor2plus-residue-cleanup.js","sourceRoot":"","sources":["../../src/utils/cursor2plus-residue-cleanup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAS3D;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAwC;IAC9E;QACE,YAAY,EAAE,8CAA8C;QAC5D,aAAa,EAAE;YACb,kEAAkE;SACnE;KACF;IACD;QACE,YAAY,EAAE,uCAAuC;QACrD,aAAa,EAAE;YACb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GAAG,EAAE,MAAM,EACX,mBAAmB,EAAE,SAAS,MAAM,EAAE,EACtC,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,YAAiB,GACzB,WAAW,CAmCb"}
1
+ {"version":3,"file":"manifest-prune.d.ts","sourceRoot":"","sources":["../../src/utils/manifest-prune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAWH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK5D,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,6EAA6E;IAC7E,MAAM,EAAE,cAAc,CAAC;CACxB;AA0DD,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,EACX,mBAAmB,EAAE,SAAS,MAAM,EAAE,EACtC,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,YAAiB,GACzB,WAAW,CAwCb"}