@specship/specship-win32-arm64 0.24.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/bin/specship.cmd +31 -1
  2. package/lib/dist/activation/cheatsheet.d.ts +17 -1
  3. package/lib/dist/activation/cheatsheet.d.ts.map +1 -1
  4. package/lib/dist/activation/cheatsheet.js +47 -3
  5. package/lib/dist/activation/cheatsheet.js.map +1 -1
  6. package/lib/dist/activation/hook-output.d.ts +80 -0
  7. package/lib/dist/activation/hook-output.d.ts.map +1 -0
  8. package/lib/dist/activation/hook-output.js +103 -0
  9. package/lib/dist/activation/hook-output.js.map +1 -0
  10. package/lib/dist/activation/search-intercept.d.ts +60 -29
  11. package/lib/dist/activation/search-intercept.d.ts.map +1 -1
  12. package/lib/dist/activation/search-intercept.js +159 -55
  13. package/lib/dist/activation/search-intercept.js.map +1 -1
  14. package/lib/dist/activation/steering.d.ts +11 -13
  15. package/lib/dist/activation/steering.d.ts.map +1 -1
  16. package/lib/dist/activation/steering.js +25 -10
  17. package/lib/dist/activation/steering.js.map +1 -1
  18. package/lib/dist/behaviour/behaviour-surface.d.ts +47 -0
  19. package/lib/dist/behaviour/behaviour-surface.d.ts.map +1 -1
  20. package/lib/dist/behaviour/behaviour-surface.js +108 -2
  21. package/lib/dist/behaviour/behaviour-surface.js.map +1 -1
  22. package/lib/dist/bin/node-version-check.d.ts +22 -7
  23. package/lib/dist/bin/node-version-check.d.ts.map +1 -1
  24. package/lib/dist/bin/node-version-check.js +39 -9
  25. package/lib/dist/bin/node-version-check.js.map +1 -1
  26. package/lib/dist/bin/specship.js +989 -116
  27. package/lib/dist/bin/specship.js.map +1 -1
  28. package/lib/dist/commands/specship/learn.md +27 -3
  29. package/lib/dist/commands/specship/spec.md +85 -15
  30. package/lib/dist/db/spec-queries.d.ts +73 -3
  31. package/lib/dist/db/spec-queries.d.ts.map +1 -1
  32. package/lib/dist/db/spec-queries.js +139 -5
  33. package/lib/dist/db/spec-queries.js.map +1 -1
  34. package/lib/dist/db/sqlite-adapter.d.ts +7 -5
  35. package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
  36. package/lib/dist/db/sqlite-adapter.js +11 -9
  37. package/lib/dist/db/sqlite-adapter.js.map +1 -1
  38. package/lib/dist/enforce/changed-files.d.ts +39 -0
  39. package/lib/dist/enforce/changed-files.d.ts.map +1 -0
  40. package/lib/dist/enforce/changed-files.js +114 -0
  41. package/lib/dist/enforce/changed-files.js.map +1 -0
  42. package/lib/dist/enforce/enforce.d.ts +53 -2
  43. package/lib/dist/enforce/enforce.d.ts.map +1 -1
  44. package/lib/dist/enforce/enforce.js +95 -8
  45. package/lib/dist/enforce/enforce.js.map +1 -1
  46. package/lib/dist/enforce/mutation.d.ts +46 -0
  47. package/lib/dist/enforce/mutation.d.ts.map +1 -0
  48. package/lib/dist/enforce/mutation.js +104 -0
  49. package/lib/dist/enforce/mutation.js.map +1 -0
  50. package/lib/dist/enforce/suppressions.d.ts +33 -0
  51. package/lib/dist/enforce/suppressions.d.ts.map +1 -0
  52. package/lib/dist/enforce/suppressions.js +159 -0
  53. package/lib/dist/enforce/suppressions.js.map +1 -0
  54. package/lib/dist/extraction/grammars.d.ts +10 -0
  55. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  56. package/lib/dist/extraction/grammars.js +32 -3
  57. package/lib/dist/extraction/grammars.js.map +1 -1
  58. package/lib/dist/extraction/index.d.ts +7 -0
  59. package/lib/dist/extraction/index.d.ts.map +1 -1
  60. package/lib/dist/extraction/index.js.map +1 -1
  61. package/lib/dist/extraction/specs/markdown-spec-extractor.d.ts +7 -0
  62. package/lib/dist/extraction/specs/markdown-spec-extractor.d.ts.map +1 -1
  63. package/lib/dist/extraction/specs/markdown-spec-extractor.js +97 -10
  64. package/lib/dist/extraction/specs/markdown-spec-extractor.js.map +1 -1
  65. package/lib/dist/extraction/wasm/tree-sitter-pascal.wasm.gz +0 -0
  66. package/lib/dist/extraction/wasm/tree-sitter-scala.wasm.gz +0 -0
  67. package/lib/dist/graph/spec-coverage.d.ts +142 -0
  68. package/lib/dist/graph/spec-coverage.d.ts.map +1 -0
  69. package/lib/dist/graph/spec-coverage.js +276 -0
  70. package/lib/dist/graph/spec-coverage.js.map +1 -0
  71. package/lib/dist/health/smoke-check.js +2 -2
  72. package/lib/dist/health/smoke-check.js.map +1 -1
  73. package/lib/dist/index.d.ts +75 -7
  74. package/lib/dist/index.d.ts.map +1 -1
  75. package/lib/dist/index.js +191 -23
  76. package/lib/dist/index.js.map +1 -1
  77. package/lib/dist/installer/gemini-commands.d.ts +107 -0
  78. package/lib/dist/installer/gemini-commands.d.ts.map +1 -0
  79. package/lib/dist/installer/gemini-commands.js +264 -0
  80. package/lib/dist/installer/gemini-commands.js.map +1 -0
  81. package/lib/dist/installer/index.d.ts +55 -8
  82. package/lib/dist/installer/index.d.ts.map +1 -1
  83. package/lib/dist/installer/index.js +72 -53
  84. package/lib/dist/installer/index.js.map +1 -1
  85. package/lib/dist/installer/init-offer.d.ts +14 -9
  86. package/lib/dist/installer/init-offer.d.ts.map +1 -1
  87. package/lib/dist/installer/init-offer.js +13 -9
  88. package/lib/dist/installer/init-offer.js.map +1 -1
  89. package/lib/dist/installer/install-defaults.d.ts +81 -0
  90. package/lib/dist/installer/install-defaults.d.ts.map +1 -0
  91. package/lib/dist/installer/install-defaults.js +95 -0
  92. package/lib/dist/installer/install-defaults.js.map +1 -0
  93. package/lib/dist/installer/instructions-template.d.ts +22 -0
  94. package/lib/dist/installer/instructions-template.d.ts.map +1 -1
  95. package/lib/dist/installer/instructions-template.js +37 -1
  96. package/lib/dist/installer/instructions-template.js.map +1 -1
  97. package/lib/dist/installer/targets/claude.d.ts +18 -0
  98. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  99. package/lib/dist/installer/targets/claude.js +70 -23
  100. package/lib/dist/installer/targets/claude.js.map +1 -1
  101. package/lib/dist/installer/targets/gemini.d.ts +85 -12
  102. package/lib/dist/installer/targets/gemini.d.ts.map +1 -1
  103. package/lib/dist/installer/targets/gemini.js +527 -30
  104. package/lib/dist/installer/targets/gemini.js.map +1 -1
  105. package/lib/dist/installer/targets/shared.d.ts +13 -0
  106. package/lib/dist/installer/targets/shared.d.ts.map +1 -1
  107. package/lib/dist/installer/targets/shared.js +22 -4
  108. package/lib/dist/installer/targets/shared.js.map +1 -1
  109. package/lib/dist/installer/targets/types.d.ts +12 -0
  110. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  111. package/lib/dist/jira/auto-publish.d.ts +71 -4
  112. package/lib/dist/jira/auto-publish.d.ts.map +1 -1
  113. package/lib/dist/jira/auto-publish.js +186 -17
  114. package/lib/dist/jira/auto-publish.js.map +1 -1
  115. package/lib/dist/jira/reconcile.d.ts +24 -1
  116. package/lib/dist/jira/reconcile.d.ts.map +1 -1
  117. package/lib/dist/jira/reconcile.js +46 -2
  118. package/lib/dist/jira/reconcile.js.map +1 -1
  119. package/lib/dist/jira/repo-config.d.ts +9 -0
  120. package/lib/dist/jira/repo-config.d.ts.map +1 -1
  121. package/lib/dist/jira/repo-config.js +11 -0
  122. package/lib/dist/jira/repo-config.js.map +1 -1
  123. package/lib/dist/jira/types.d.ts +7 -0
  124. package/lib/dist/jira/types.d.ts.map +1 -1
  125. package/lib/dist/jira/types.js.map +1 -1
  126. package/lib/dist/knowledge/enforce.d.ts +75 -0
  127. package/lib/dist/knowledge/enforce.d.ts.map +1 -0
  128. package/lib/dist/knowledge/enforce.js +250 -0
  129. package/lib/dist/knowledge/enforce.js.map +1 -0
  130. package/lib/dist/knowledge/facts.d.ts +33 -0
  131. package/lib/dist/knowledge/facts.d.ts.map +1 -0
  132. package/lib/dist/knowledge/facts.js +117 -0
  133. package/lib/dist/knowledge/facts.js.map +1 -0
  134. package/lib/dist/knowledge/proposals.d.ts +88 -0
  135. package/lib/dist/knowledge/proposals.d.ts.map +1 -0
  136. package/lib/dist/knowledge/proposals.js +360 -0
  137. package/lib/dist/knowledge/proposals.js.map +1 -0
  138. package/lib/dist/knowledge/stale.d.ts +64 -0
  139. package/lib/dist/knowledge/stale.d.ts.map +1 -0
  140. package/lib/dist/knowledge/stale.js +174 -0
  141. package/lib/dist/knowledge/stale.js.map +1 -0
  142. package/lib/dist/mcp/fitness-tool.d.ts +5 -6
  143. package/lib/dist/mcp/fitness-tool.d.ts.map +1 -1
  144. package/lib/dist/mcp/fitness-tool.js +0 -16
  145. package/lib/dist/mcp/fitness-tool.js.map +1 -1
  146. package/lib/dist/mcp/gemini-session.d.ts +50 -0
  147. package/lib/dist/mcp/gemini-session.d.ts.map +1 -0
  148. package/lib/dist/mcp/gemini-session.js +159 -0
  149. package/lib/dist/mcp/gemini-session.js.map +1 -0
  150. package/lib/dist/mcp/health-tool.d.ts +26 -0
  151. package/lib/dist/mcp/health-tool.d.ts.map +1 -0
  152. package/lib/dist/mcp/health-tool.js +50 -0
  153. package/lib/dist/mcp/health-tool.js.map +1 -0
  154. package/lib/dist/mcp/jira-tools.d.ts.map +1 -1
  155. package/lib/dist/mcp/jira-tools.js +25 -0
  156. package/lib/dist/mcp/jira-tools.js.map +1 -1
  157. package/lib/dist/mcp/maintainability-tool.d.ts +5 -7
  158. package/lib/dist/mcp/maintainability-tool.d.ts.map +1 -1
  159. package/lib/dist/mcp/maintainability-tool.js +0 -16
  160. package/lib/dist/mcp/maintainability-tool.js.map +1 -1
  161. package/lib/dist/mcp/model-context.d.ts +31 -7
  162. package/lib/dist/mcp/model-context.d.ts.map +1 -1
  163. package/lib/dist/mcp/model-context.js +70 -21
  164. package/lib/dist/mcp/model-context.js.map +1 -1
  165. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  166. package/lib/dist/mcp/proxy.js +5 -2
  167. package/lib/dist/mcp/proxy.js.map +1 -1
  168. package/lib/dist/mcp/server-instructions.d.ts +16 -15
  169. package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
  170. package/lib/dist/mcp/server-instructions.js +72 -5
  171. package/lib/dist/mcp/server-instructions.js.map +1 -1
  172. package/lib/dist/mcp/session.js +1 -1
  173. package/lib/dist/mcp/session.js.map +1 -1
  174. package/lib/dist/mcp/spec-tools.d.ts +9 -1
  175. package/lib/dist/mcp/spec-tools.d.ts.map +1 -1
  176. package/lib/dist/mcp/spec-tools.js +282 -49
  177. package/lib/dist/mcp/spec-tools.js.map +1 -1
  178. package/lib/dist/mcp/tools.d.ts +49 -9
  179. package/lib/dist/mcp/tools.d.ts.map +1 -1
  180. package/lib/dist/mcp/tools.js +210 -58
  181. package/lib/dist/mcp/tools.js.map +1 -1
  182. package/lib/dist/pulse/pulse.d.ts +93 -0
  183. package/lib/dist/pulse/pulse.d.ts.map +1 -0
  184. package/lib/dist/pulse/pulse.js +401 -0
  185. package/lib/dist/pulse/pulse.js.map +1 -0
  186. package/lib/dist/reflect/apply.d.ts.map +1 -1
  187. package/lib/dist/reflect/apply.js +38 -3
  188. package/lib/dist/reflect/apply.js.map +1 -1
  189. package/lib/dist/reflect/auto-sweep.d.ts +26 -0
  190. package/lib/dist/reflect/auto-sweep.d.ts.map +1 -0
  191. package/lib/dist/reflect/auto-sweep.js +90 -0
  192. package/lib/dist/reflect/auto-sweep.js.map +1 -0
  193. package/lib/dist/reflect/cli.d.ts +62 -0
  194. package/lib/dist/reflect/cli.d.ts.map +1 -0
  195. package/lib/dist/reflect/cli.js +163 -0
  196. package/lib/dist/reflect/cli.js.map +1 -0
  197. package/lib/dist/reflect/miner.d.ts.map +1 -1
  198. package/lib/dist/reflect/miner.js +119 -0
  199. package/lib/dist/reflect/miner.js.map +1 -1
  200. package/lib/dist/reflect/sweep.d.ts +1 -0
  201. package/lib/dist/reflect/sweep.d.ts.map +1 -1
  202. package/lib/dist/reflect/sweep.js +62 -13
  203. package/lib/dist/reflect/sweep.js.map +1 -1
  204. package/lib/dist/reflect/targets.d.ts +2 -0
  205. package/lib/dist/reflect/targets.d.ts.map +1 -1
  206. package/lib/dist/reflect/targets.js +33 -0
  207. package/lib/dist/reflect/targets.js.map +1 -1
  208. package/lib/dist/reflect/types.d.ts +19 -2
  209. package/lib/dist/reflect/types.d.ts.map +1 -1
  210. package/lib/dist/resolution/spec-link-resolver.d.ts +44 -2
  211. package/lib/dist/resolution/spec-link-resolver.d.ts.map +1 -1
  212. package/lib/dist/resolution/spec-link-resolver.js +132 -0
  213. package/lib/dist/resolution/spec-link-resolver.js.map +1 -1
  214. package/lib/dist/resolution/test-title-links.d.ts +62 -0
  215. package/lib/dist/resolution/test-title-links.d.ts.map +1 -0
  216. package/lib/dist/resolution/test-title-links.js +97 -0
  217. package/lib/dist/resolution/test-title-links.js.map +1 -0
  218. package/lib/dist/search/query-parser.d.ts.map +1 -1
  219. package/lib/dist/search/query-parser.js +6 -1
  220. package/lib/dist/search/query-parser.js.map +1 -1
  221. package/lib/dist/server/project-registry.js +1 -1
  222. package/lib/dist/server/routes/claude.js +24 -43
  223. package/lib/dist/server/routes/graph.js +53 -7
  224. package/lib/dist/server/routes/knowledge.js +118 -0
  225. package/lib/dist/server/routes/mcp.js +4 -3
  226. package/lib/dist/server/routes/projects.js +4 -4
  227. package/lib/dist/server/routes/spec.js +49 -7
  228. package/lib/dist/server/server.js +31 -17
  229. package/lib/dist/skills/spec-author/SKILL.md +164 -0
  230. package/lib/dist/skills/spec-author/references/format.md +210 -0
  231. package/lib/dist/skills/spec-author/references/gap-questions.md +152 -0
  232. package/lib/dist/skills/spec-author/references/quality-rubric.md +125 -0
  233. package/lib/dist/skills/spec-author/references/review-checklist.md +175 -0
  234. package/lib/dist/spec-lint/lint.d.ts +82 -0
  235. package/lib/dist/spec-lint/lint.d.ts.map +1 -0
  236. package/lib/dist/spec-lint/lint.js +491 -0
  237. package/lib/dist/spec-lint/lint.js.map +1 -0
  238. package/lib/dist/spec-quality/criterion-ids.d.ts +13 -0
  239. package/lib/dist/spec-quality/criterion-ids.d.ts.map +1 -0
  240. package/lib/dist/spec-quality/criterion-ids.js +38 -0
  241. package/lib/dist/spec-quality/criterion-ids.js.map +1 -0
  242. package/lib/dist/spec-quality/evidence-kind.d.ts +54 -0
  243. package/lib/dist/spec-quality/evidence-kind.d.ts.map +1 -0
  244. package/lib/dist/spec-quality/evidence-kind.js +183 -0
  245. package/lib/dist/spec-quality/evidence-kind.js.map +1 -0
  246. package/lib/dist/spec-quality/link-persist.d.ts +65 -0
  247. package/lib/dist/spec-quality/link-persist.d.ts.map +1 -0
  248. package/lib/dist/spec-quality/link-persist.js +249 -0
  249. package/lib/dist/spec-quality/link-persist.js.map +1 -0
  250. package/lib/dist/spec-quality/plan-scope.d.ts +38 -0
  251. package/lib/dist/spec-quality/plan-scope.d.ts.map +1 -0
  252. package/lib/dist/spec-quality/plan-scope.js +129 -0
  253. package/lib/dist/spec-quality/plan-scope.js.map +1 -0
  254. package/lib/dist/spec-quality/postcheck.d.ts +85 -0
  255. package/lib/dist/spec-quality/postcheck.d.ts.map +1 -0
  256. package/lib/dist/spec-quality/postcheck.js +390 -0
  257. package/lib/dist/spec-quality/postcheck.js.map +1 -0
  258. package/lib/dist/spec-quality/readiness.d.ts +72 -0
  259. package/lib/dist/spec-quality/readiness.d.ts.map +1 -0
  260. package/lib/dist/spec-quality/readiness.js +226 -0
  261. package/lib/dist/spec-quality/readiness.js.map +1 -0
  262. package/lib/dist/statusline/index.js.map +1 -1
  263. package/lib/dist/statusline/render.d.ts +1 -1
  264. package/lib/dist/statusline/render.d.ts.map +1 -1
  265. package/lib/dist/statusline/render.js +3 -1
  266. package/lib/dist/statusline/render.js.map +1 -1
  267. package/lib/dist/ui/assets/index-BzuUWUAE.js +50 -0
  268. package/lib/dist/ui/index.html +1 -1
  269. package/lib/dist/verify/report-ingest.d.ts +88 -0
  270. package/lib/dist/verify/report-ingest.d.ts.map +1 -0
  271. package/lib/dist/verify/report-ingest.js +269 -0
  272. package/lib/dist/verify/report-ingest.js.map +1 -0
  273. package/lib/dist/workflows/agents/claude.d.ts +16 -0
  274. package/lib/dist/workflows/agents/claude.d.ts.map +1 -0
  275. package/lib/dist/workflows/agents/claude.js +82 -0
  276. package/lib/dist/workflows/agents/claude.js.map +1 -0
  277. package/lib/dist/workflows/agents/gemini.d.ts +21 -0
  278. package/lib/dist/workflows/agents/gemini.d.ts.map +1 -0
  279. package/lib/dist/workflows/agents/gemini.js +124 -0
  280. package/lib/dist/workflows/agents/gemini.js.map +1 -0
  281. package/lib/dist/workflows/agents/index.d.ts +28 -0
  282. package/lib/dist/workflows/agents/index.d.ts.map +1 -0
  283. package/lib/dist/workflows/agents/index.js +104 -0
  284. package/lib/dist/workflows/agents/index.js.map +1 -0
  285. package/lib/dist/workflows/agents/types.d.ts +55 -0
  286. package/lib/dist/workflows/agents/types.d.ts.map +1 -0
  287. package/lib/dist/workflows/agents/types.js +46 -0
  288. package/lib/dist/workflows/agents/types.js.map +1 -0
  289. package/lib/dist/workflows/batch.d.ts +63 -0
  290. package/lib/dist/workflows/batch.d.ts.map +1 -0
  291. package/lib/dist/workflows/batch.js +151 -0
  292. package/lib/dist/workflows/batch.js.map +1 -0
  293. package/lib/dist/workflows/defaults/claude-design-implement.yaml +3 -4
  294. package/lib/dist/workflows/defaults/spec-author.yaml +11 -9
  295. package/lib/dist/workflows/defaults/spec-fix.yaml +103 -12
  296. package/lib/dist/workflows/defaults/spec-implement-mixed.yaml +21 -193
  297. package/lib/dist/workflows/defaults/spec-implement.yaml +701 -41
  298. package/lib/dist/workflows/defaults/spec-verify.yaml +60 -9
  299. package/lib/dist/workflows/discovery.d.ts +13 -0
  300. package/lib/dist/workflows/discovery.d.ts.map +1 -1
  301. package/lib/dist/workflows/discovery.js +79 -17
  302. package/lib/dist/workflows/discovery.js.map +1 -1
  303. package/lib/dist/workflows/executor.d.ts +18 -0
  304. package/lib/dist/workflows/executor.d.ts.map +1 -1
  305. package/lib/dist/workflows/executor.js +130 -33
  306. package/lib/dist/workflows/executor.js.map +1 -1
  307. package/lib/dist/workflows/gc.d.ts +50 -0
  308. package/lib/dist/workflows/gc.d.ts.map +1 -0
  309. package/lib/dist/workflows/gc.js +120 -0
  310. package/lib/dist/workflows/gc.js.map +1 -0
  311. package/lib/dist/workflows/merge-queue.d.ts +64 -0
  312. package/lib/dist/workflows/merge-queue.d.ts.map +1 -0
  313. package/lib/dist/workflows/merge-queue.js +162 -0
  314. package/lib/dist/workflows/merge-queue.js.map +1 -0
  315. package/lib/dist/workflows/runners/approval.d.ts +1 -1
  316. package/lib/dist/workflows/runners/approval.d.ts.map +1 -1
  317. package/lib/dist/workflows/runners/approval.js +11 -2
  318. package/lib/dist/workflows/runners/approval.js.map +1 -1
  319. package/lib/dist/workflows/runners/bash.d.ts +15 -0
  320. package/lib/dist/workflows/runners/bash.d.ts.map +1 -1
  321. package/lib/dist/workflows/runners/bash.js +50 -1
  322. package/lib/dist/workflows/runners/bash.js.map +1 -1
  323. package/lib/dist/workflows/runners/prompt.d.ts +16 -41
  324. package/lib/dist/workflows/runners/prompt.d.ts.map +1 -1
  325. package/lib/dist/workflows/runners/prompt.js +55 -120
  326. package/lib/dist/workflows/runners/prompt.js.map +1 -1
  327. package/lib/dist/workflows/runners/types.d.ts +12 -0
  328. package/lib/dist/workflows/runners/types.d.ts.map +1 -1
  329. package/lib/dist/workflows/schemas/workflow.d.ts +17 -0
  330. package/lib/dist/workflows/schemas/workflow.d.ts.map +1 -1
  331. package/lib/dist/workflows/schemas/workflow.js +27 -0
  332. package/lib/dist/workflows/schemas/workflow.js.map +1 -1
  333. package/lib/node_modules/.package-lock.json +1 -1
  334. package/lib/package.json +8 -4
  335. package/package.json +5 -3
  336. package/lib/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  337. package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  338. package/lib/dist/server/ingest/impact-query.js +0 -343
  339. package/lib/dist/server/routes/events.js +0 -152
  340. package/lib/dist/ui/assets/index-CjjaftDw.js +0 -50
  341. package/node.exe +0 -4
@@ -2,7 +2,8 @@
2
2
  /**
3
3
  * Model-aware context compaction (MODCTX-DOC).
4
4
  *
5
- * Lower-tier models (Haiku; Sonnet to a lesser degree) pay more attention
5
+ * Lower-tier models (lite-tier models — Haiku, Gemini Flash; standard tier
6
+ * to a lesser degree) pay more attention
6
7
  * cost per token of scaffolding. When the session runs on one, code-graph
7
8
  * tool responses pass through a deterministic, fence-preserving compactor:
8
9
  * SpecShip's own prose (boilerplate notices, meta-guidance, blank runs)
@@ -12,8 +13,14 @@
12
13
  *
13
14
  * Detection rides the status line: Claude Code pipes the model into every
14
15
  * status-line render, and `recordSessionModel` persists it to
15
- * `.specship/session/model.json`; the MCP server reads it per call.
16
+ * `.specship/session/model.json`; the MCP server reads it per call. On a
17
+ * Gemini CLI session none of the Claude channels exist, so detection reads
18
+ * Gemini CLI's own surface in-server (`./gemini-session`, REQ-LOWEND-001).
16
19
  * Unknown model → `full` tier → identity (never compact blind).
20
+ *
21
+ * Tiers are capability names (`lite` / `standard` / `full`), not model-family
22
+ * names (REQ-GEMINI-007): the provider mapping table below is what binds a
23
+ * concrete model id (Claude or Gemini) to a tier.
17
24
  */
18
25
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19
26
  if (k2 === undefined) k2 = k;
@@ -59,6 +66,7 @@ const fs = __importStar(require("fs"));
59
66
  const paths_1 = require("../statusline/paths");
60
67
  const directory_1 = require("../directory");
61
68
  const runtime_settings_1 = require("../config/runtime-settings");
69
+ const gemini_session_1 = require("./gemini-session");
62
70
  /**
63
71
  * Persist the session's model (REQ-MODCTX-001). Called from the status-line
64
72
  * render path; writes only when the value changed so sub-second re-renders
@@ -152,23 +160,60 @@ function readModelFromTranscript(transcriptPath) {
152
160
  return null;
153
161
  }
154
162
  }
155
- /** Map a model id / display name to a compaction tier. */
163
+ /**
164
+ * Provider mapping table (REQ-GEMINI-007): model id → capability tier.
165
+ * Ordered, most-specific-first — the first match wins, so a looser rule can
166
+ * never swallow a narrower one (`gemini-2.5-flash-lite` must not fall through
167
+ * to a `pro`/full rule). Adding a provider means adding rows here, not
168
+ * scattering substring checks across the codebase.
169
+ */
170
+ const TIER_RULES = [
171
+ { match: /haiku/, tier: 'lite' },
172
+ // `[\s\w.-]*` so both ids (`gemini-2.5-flash`) and display names
173
+ // (`Gemini 2.5 Flash`) match — the marker can carry either.
174
+ { match: /gemini[\s\w.-]*flash/, tier: 'lite' }, // flash and flash-lite
175
+ { match: /sonnet/, tier: 'standard' },
176
+ { match: /gemini[\s\w.-]*pro/, tier: 'full' },
177
+ { match: /opus|fable/, tier: 'full' },
178
+ ];
179
+ /** The tier names themselves, accepted as override values. */
180
+ const TIER_NAMES = new Set(['lite', 'standard', 'full']);
181
+ /**
182
+ * Map a model id / display name to a compaction tier. A bare tier name
183
+ * (`lite` / `standard` / `full`) is also accepted, so the documented override
184
+ * can name a tier directly instead of a model id (REQ-LOWEND-001.A2).
185
+ */
156
186
  function modelTier(model) {
157
187
  if (!model)
158
188
  return 'full';
159
189
  const m = model.toLowerCase();
160
- if (m.includes('haiku'))
161
- return 'haiku';
162
- if (m.includes('sonnet'))
163
- return 'sonnet';
164
- return 'full';
190
+ if (TIER_NAMES.has(m))
191
+ return m;
192
+ for (const rule of TIER_RULES) {
193
+ if (rule.match.test(m))
194
+ return rule.tier;
195
+ }
196
+ return 'full'; // unknown id → never compact blind
165
197
  }
166
198
  /**
167
- * Resolve the active tier for a project (REQ-MODCTX-001, RUNSET-DOC):
168
- * `SPECSHIP_COMPACT=0` disables outright; `SPECSHIP_MODEL` overrides;
169
- * else the session model marker; else `full`. Both switches resolve
199
+ * Resolve the active tier for a project (REQ-MODCTX-001, REQ-LOWEND-001,
200
+ * RUNSET-DOC), in order:
201
+ *
202
+ * SPECSHIP_COMPACT=0 → SPECSHIP_MODEL → Claude marker → Gemini settings/env → full
203
+ *
204
+ * `SPECSHIP_COMPACT=0` disables compaction outright; `SPECSHIP_MODEL` is the
205
+ * single documented override and names either a tier or a model id, so it wins
206
+ * over every auto-detect channel (REQ-LOWEND-001.A2). Both switches resolve
170
207
  * through the settings chain (env > project `.specship/settings.json` >
171
208
  * `~/.specship/settings.json`), so a repo can pin its behavior.
209
+ *
210
+ * The session model marker is a **Claude-only channel** (status line /
211
+ * SessionStart hook / transcript tail). A Gemini CLI session writes no marker,
212
+ * so detection there reads Gemini CLI's own surface instead —
213
+ * `GEMINI_MODEL` / `.gemini/settings.json` (REQ-LOWEND-001.A1). No Claude
214
+ * channel is ever misread on a non-Claude host (REQ-GEMINI-007.A4), and with
215
+ * nothing detected anywhere the tier is `full` — never compact blind
216
+ * (REQ-LOWEND-001.A3).
172
217
  */
173
218
  function detectModelTier(projectRoot, env = process.env, homedir) {
174
219
  if ((0, runtime_settings_1.resolveSetting)('SPECSHIP_COMPACT', projectRoot, env, homedir) === '0')
@@ -176,10 +221,14 @@ function detectModelTier(projectRoot, env = process.env, homedir) {
176
221
  const forced = (0, runtime_settings_1.resolveSetting)('SPECSHIP_MODEL', projectRoot, env, homedir);
177
222
  if (forced)
178
223
  return modelTier(forced);
179
- if (!projectRoot)
180
- return 'full';
181
- const marker = (0, paths_1.readJsonSafe)((0, paths_1.modelMarkerPath)(projectRoot));
182
- return modelTier(marker?.model);
224
+ if (projectRoot) {
225
+ const marker = (0, paths_1.readJsonSafe)((0, paths_1.modelMarkerPath)(projectRoot));
226
+ if (marker?.model)
227
+ return modelTier(marker.model);
228
+ }
229
+ // Gemini CLI leg: the workspace may not be an initialized SpecShip project,
230
+ // so fall back to the process cwd for the project-level settings lookup.
231
+ return modelTier((0, gemini_session_1.readGeminiSessionModel)(projectRoot ?? process.cwd(), env, homedir));
183
232
  }
184
233
  /**
185
234
  * Known long boilerplate → terse equivalents carrying the SAME instruction —
@@ -200,8 +249,8 @@ const TERSE_NOTICES = [
200
249
  '> Some sections trimmed. Need a symbol: specship_explore / specship_node with its exact name — not Read.',
201
250
  ],
202
251
  ];
203
- /** Blast-radius bullets kept on the haiku tier before "+N more". */
204
- const HAIKU_BLAST_CAP = 3;
252
+ /** Blast-radius bullets kept on the lite tier before "+N more". */
253
+ const LITE_BLAST_CAP = 3;
205
254
  /**
206
255
  * Compact one tool-response markdown string for a tier (REQ-MODCTX-002/003).
207
256
  * `full` → identity. Fenced code blocks are byte-verbatim at every tier.
@@ -217,14 +266,14 @@ function compactToolResult(text, tier) {
217
266
  let p = part;
218
267
  for (const [re, terse] of TERSE_NOTICES)
219
268
  p = p.replace(re, terse);
220
- if (tier === 'haiku')
269
+ if (tier === 'lite')
221
270
  p = capBlastRadius(p);
222
271
  // Collapse runs of blank lines (prose only).
223
272
  p = p.replace(/\n{3,}/g, '\n\n');
224
273
  return p;
225
274
  });
226
275
  // Visibility (REQ-MODCTX-003.A1): one line naming the tier — worded to
227
- // ASSERT completeness. Measured on the haiku baseline (express, 2/2 runs):
276
+ // ASSERT completeness. Measured on the lite baseline (express, 2/2 runs):
228
277
  // the original wording ("— SPECSHIP_COMPACT=0 for full output") read as
229
278
  // "this output is incomplete" to a small model, which then re-Read files
230
279
  // it had been handed (4 Reads / 11 turns vs 0-1 / 5-7 without the banner).
@@ -232,7 +281,7 @@ function compactToolResult(text, tier) {
232
281
  return `⛁ compact mode (${tier}): prose condensed, ALL code complete and verbatim — answer from this output; do not re-read these files.\n${out.join('')}`;
233
282
  }
234
283
  /**
235
- * Cap the "### Blast radius" bullet list (haiku tier). Truncation is loud —
284
+ * Cap the "### Blast radius" bullet list (lite tier). Truncation is loud —
236
285
  * an explicit "+N more" line, never silent (REQ-MODCTX-002.A3).
237
286
  */
238
287
  function capBlastRadius(prose) {
@@ -256,7 +305,7 @@ function capBlastRadius(prose) {
256
305
  if (!line.startsWith('- '))
257
306
  break; // section ended
258
307
  bullets++;
259
- if (bullets <= HAIKU_BLAST_CAP)
308
+ if (bullets <= LITE_BLAST_CAP)
260
309
  kept.push(line);
261
310
  else
262
311
  dropped++;
@@ -1 +1 @@
1
- {"version":3,"file":"model-context.js","sourceRoot":"","sources":["../../src/mcp/model-context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;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SAAS,CAAC;IACxB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuHpF"}
1
+ {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/mcp/proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAO3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAK1C,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,OAAO,EAAE,SAAS,GAAG,iBAAiB,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,QAAQ,CAC5B,UAAU,EAAE,MAAM,EAClB,eAAe,GAAE,MAA+B,GAC/C,OAAO,CAAC,WAAW,CAAC,CAsCtB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,eAAe,GAAE,MAA+B,GAC/C,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAAC,CAuBjD;AAID;+DAC+D;AAC/D,MAAM,WAAW,kBAAkB;IACjC;yFACqF;IACrF,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC9C;6EACyE;IACzE,UAAU,IAAI,SAAS,CAAC;IACxB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0HpF"}
@@ -246,11 +246,14 @@ async function runLocalHandshakeProxy(deps) {
246
246
  }
247
247
  if (msg.method === 'initialize') {
248
248
  clientInitId = msg.id;
249
- writeClient({ jsonrpc: '2.0', id: msg.id, result: { protocolVersion: session_1.PROTOCOL_VERSION, capabilities: { tools: {} }, serverInfo: session_1.SERVER_INFO, instructions: server_instructions_1.SERVER_INSTRUCTIONS } });
249
+ writeClient({ jsonrpc: '2.0', id: msg.id, result: { protocolVersion: session_1.PROTOCOL_VERSION, capabilities: { tools: {} }, serverInfo: session_1.SERVER_INFO, instructions: (0, server_instructions_1.resolveServerInstructions)(deps.root) } });
250
250
  routeToDaemon(line); // prime the daemon so it resolves the project (its reply is suppressed below)
251
251
  }
252
252
  else if (msg.method === 'tools/list') {
253
- writeClient({ jsonrpc: '2.0', id: msg.id, result: { tools: (0, tools_1.getStaticTools)() } });
253
+ // Pass the project root so the lite-tier menu trim applies to the
254
+ // connect-time list too (REQ-LOWMODEL-004.A4) — marker file only,
255
+ // no DB open, so this stays on the fast handshake path.
256
+ writeClient({ jsonrpc: '2.0', id: msg.id, result: { tools: (0, tools_1.getStaticTools)(deps.root) } });
254
257
  }
255
258
  else if (msg.method === 'resources/list') {
256
259
  // No resources exposed — answer the probe locally so it never reaches
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/mcp/proxy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCH,4BAyCC;AAQD,4CA0BC;AA8BD,wDAuHC;AAvQD,uCAAyB;AACzB,yCAA2B;AAC3B,yEAAiE;AACjE,qCAA6D;AAC7D,uCAAmD;AACnD,uCAA0D;AAC1D,+DAA4D;AAC5D,mCAAyC;AAGzC,8EAA8E;AAC9E,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAalC;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,QAAQ,CAC5B,UAAkB,EAClB,kBAA0B,gCAAsB;IAEhD,oEAAoE;IACpE,kEAAkE;IAClE,iEAAiE;IACjE,IAAI,OAAO,CAAC,QAA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CAAC;IAC1D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,mBAAmB,CAAC,GAAW;IACtC,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,GAA4B,CAAC;QACvC,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO;YAAE,OAAO,IAAI,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -1,18 +1,19 @@
1
+ import { type ModelTier } from './model-context';
2
+ export declare const SERVER_INSTRUCTIONS = "# Specship \u2014 code intelligence over an indexed knowledge graph\n\nSpecship is a SQLite knowledge graph of every symbol, edge, and file\nin the workspace. Reads are sub-millisecond; the index lags writes by\nabout a second through the file watcher. Consult it BEFORE writing or\nediting code, not during.\n\n## Answer directly \u2014 don't delegate exploration\n\nFor \"how does X work\", architecture, trace, or where-is-X questions,\nanswer DIRECTLY \u2014 usually with ONE `specship_explore` call.\n`specship_explore` takes either a natural-language question or a bag of\nsymbol/file names and returns the verbatim source of the relevant symbols\ngrouped by file, so it is Read-equivalent and most often the ONLY\nspecship call you need. Specship IS the pre-built search index \u2014 so\ndelegating the lookup to a separate file-reading sub-task/agent, or\nrunning your own grep + read loop, repeats work specship already did and\ncosts more for the same answer. Reach for raw Read/Grep only to confirm a\nspecific detail specship didn't cover. A direct specship answer is\ntypically one to a few calls; a grep/read exploration is dozens.\n\n## Tool selection by intent\n\n- **Almost any question \u2014 \"how does X work\", architecture, a bug, \"what/where is X\", or surveying an area** \u2192 `specship_explore` (PRIMARY \u2014 call FIRST; ONE capped call returns the verbatim source of the relevant symbols grouped by file; most often the ONLY call you need). Naming a documented domain term/entity also surfaces its human-confirmed fact body inline under \"Domain facts\".\n- **\"How does X reach/become Y? / the flow / the path from X to Y\"** \u2192 `specship_explore`, naming the symbols that span the flow (e.g. `mutateElement renderScene`) \u2014 it surfaces the call path among them, including dynamic-dispatch hops (callbacks, React re-render, JSX children) grep can't follow\n- **\"What is the symbol named X?\" (just its location)** \u2192 `specship_search`\n- **\"What calls this?\" / \"What does this call?\" / \"What would changing this break?\"** \u2192 `specship_callers` / `specship_callees` / `specship_impact`\n- **One specific symbol's full source (esp. a body `specship_explore` trimmed), or an OVERLOADED name** \u2192 `specship_node` (with `includeCode`): for an ambiguous name it returns EVERY matching definition's body in one call, so you never Read a file to find the right overload\n- **\"What's in directory X?\"** \u2192 `specship_files`\n- **\"Is the index ready / what's its size?\" or \"which SpecShip is running / what version am I on?\"** \u2192 `specship_status` (one tool for both: index stats plus the serving process's version, install method, install dir, node and project root; works with no project open)\n- **\"Is this code healthy / does it violate our architecture rules?\"** \u2192 `specship_health` (coupling + oversized symbols + god-files + cycles + dead-code candidates, and architecture-fitness violations; narrow with `checks: [\"maintainability\"]` or `[\"fitness\"]`)\n- **User mentions a spec ID or requirement (e.g. \"REQ-AUTH-005\", \"the rate-limit requirement\")** \u2192 `specship_spec` FIRST. Returns spec body + parent/siblings + linked code with state (verified / drifted / orphaned) \u2014 more than Read-ing the spec file alone. If domain facts (ubiquitous-language terms, business rules) are linked to the spec, they come back inline under \"Domain facts\" \u2014 no separate tool. Then jump into linked code via `specship_node`.\n- **User describes a change without naming a spec (a bug, an error, a one-line enhancement) and you need to find which existing spec it belongs to** \u2192 `specship_spec` with a free-text `query`. Returns scored, ranked candidate specs (id, title, kind, snippet) over the spec index \u2014 use it to route the change to the right requirement before authoring a new doc. (No `query`/`spec_id` \u2192 the lifecycle funnel; add `list: true` for a flat inventory of every requirement's single rolled-up status + per-status totals, or `ideas: true` for the ideas review view \u2014 the idea-state briefs with age since capture + labels, closing with the promotion hand-off.)\n- **Authoring end-to-end tests for a requirement** \u2192 `specship_spec` with `spec_id` + `behaviour_surface: true`. Returns the requirement's linked code plus the surrounding routes / components / handlers grouped into a UI tier (Playwright targets) and a backend/batch tier (API/job targets) \u2014 the flow map to write tests from.\n- **After editing code in response to a spec** \u2192 call `specship_link_assert` before reporting done. Idempotent. Supersedes the `// @implements REQ-X` comment backstop (which the extractor catches on its own). The target is validated against the graph \u2014 an unresolvable `file:symbol` is refused with near-miss suggestions, so re-call it with a real target rather than assuming it recorded.\n- **After running verification (tests) against a spec link** \u2192 `specship_link_verify` with `result: \"pass\" | \"fail\"` so the link moves from `implemented` to `verified` (or `broken`). Pass the test name(s) you ran as `evidence` (and a `reason`) \u2014 they're persisted with a timestamp as the audit trail for the claim. Promotion to `verified` needs test evidence declared IN A FILE (a `verifies:` block in the spec, an `@verifies REQ-X` comment on the test, or the spec id inside an `it()` title in a test file); an asserted `tests` link does not count, and neither does a `tests` link pointing outside a test file. For a whole test run, `specship verify --report <vitest-json>` moves every matching link from the report itself \u2014 deterministic, and it records the run as the evidence.\n- **\"Is this requirement actually proven / how much of it has tests?\"** \u2192 `specship_spec` with `coverage: true` (with or without a `spec_id`). Returns a per-requirement AND per-acceptance-criterion rollup with a verdict of untested / tested / verified / broken. The verdict comes from `tests` links ONLY \u2014 a criterion with implementing code and no test reads `untested`, so never answer \"is it done\" from the presence of an `implements` link.\n- **\"What's drifted / broken / orphaned?\" / non-coder review queue** \u2192 `specship_drifted` (optional `state` filter).\n\n## Common chains\n\n- **Flow / \"how does X reach Y\"**: ONE `specship_explore` with the symbol names spanning the flow \u2014 it surfaces the call path among them (riding dynamic-dispatch hops) AND returns their source. No need to reconstruct the path with `specship_search` + `specship_callers`.\n- **Onboarding / understanding any area**: ONE `specship_explore` is usually the whole answer. Only follow up \u2014 `specship_node` for a specific symbol \u2014 if something is still unclear.\n- **Refactor planning**: `specship_search` \u2192 `specship_callers` \u2192 `specship_impact`. The blast-radius answer comes from impact, not from walking callers manually.\n- **Debugging a regression**: `specship_callers` of the suspected symbol; widen with `specship_impact` if an unexpected call appears.\n\n## Anti-patterns\n\n- **Trust specship's results \u2014 don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.\n- **Don't grep first** when looking up a symbol by name \u2014 `specship_search` is faster and returns kind + location + signature.\n- **Don't chain `specship_search` + `specship_node`** to understand an area \u2014 ONE `specship_explore` returns the relevant symbols' source together in a single round-trip.\n- **Don't loop `specship_node` over many symbols** \u2014 one `specship_explore` call returns them all grouped by file, while each separate call re-reads the whole context and costs far more. Use `specship_node` for a single symbol.\n- **After editing, check the staleness banner.** When a tool response starts with \"\u26A0\uFE0F Some files referenced below were edited since the last index sync\u2026\", the listed files are pending re-index \u2014 Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust specship. `specship_status` also lists pending files under \"Pending sync\".\n\n## JIRA integration\n\nAny request about the user's JIRA issues/tasks/tickets goes to these tools by default \u2014 the user should NOT have to say \"use specship\". Each tool already returns a professional, formatted result (a table, with any caveat as a bottom note); **present that output verbatim \u2014 relay it as-is, do not re-summarize it, add a preamble, or speculate about why a list is empty.** The tools chain in this order:\n\n- **\"list my JIRA issues\" / \"what's assigned to me?\" / \"my JIRA tasks\"** \u2192 `specship_jira_issues` (identity comes from the configured token \u2014 the user never types their own name). It returns a ready-to-display table; show it as returned.\n- **\"Show me issue PROJ-123\"** \u2192 `specship_jira_issue` with the `key`.\n- **\"Pick / work on PROJ-123\"** \u2192 `specship_jira_pick` with the `key` \u2014 fetches the issue and authors a SpecShip spec under `specs/` (idempotent on the key).\n- **\"Start / implement it\"** \u2192 `specship_jira_start` with the same `key` \u2014 runs the bundled `spec-implement` workflow on the spec pick authored, in an isolated worktree. It runs to the **plan/approve gate** and pauses there, returning the run ID; review the plan, then approve (`specship workflow approve <runId>`) to continue. A failed run raises no PR. If no spec exists for the key yet, start points you back to `specship_jira_pick`.\n- **\"How's my JIRA work going? / status of my picked issues\"** \u2192 `specship_jira_track` \u2014 a read-only table joining each picked issue's SpecShip work-state (spec authored \u2192 implementing \u2192 PR raised \u2192 verified) with its **live** JIRA status (read fresh each time, so an issue moved outside SpecShip reflects its current status). It never re-picks or re-starts anything; pass an optional `project` to narrow the JIRA read. Published specs appear too, and one edited in JIRA after publish is flagged as a divergence.\n- **\"Reconcile JIRA edits back into the spec\" / \"someone edited PROJ-123 in JIRA\"** \u2192 `specship_jira_reconcile` \u2014 **preview first, then apply only after the user has explicitly confirmed the exact diff**. Preview (default `mode:\"preview\"`) is read-only; it enumerates every published spec whose live JIRA issue diverges (edited summary/description, or a Sub-task added in JIRA) and returns a proposed spec amendment plus a machine block with `expected_live_fingerprint`. Show the user the diff and ask; only after they confirm, call again with `mode:\"apply\"`, `issue_key`, the confirmed `accept_content`/`accept_subtasks`, and the `expected_live_fingerprint` from the preview. Apply refuses when the fingerprint doesn't match \u2014 no preview \u2192 no apply.\n- **\"Sprint coverage / how much of this sprint has specs / is verified?\"** \u2192 `specship_jira_coverage` \u2014 joins the bound project's active (or named) sprint to spec truth: every issue with its rolled-up repo-side state (unspecced / specced / implemented / verified / drifted / broken) and rollup totals. Read-only by default; pass `post: true` with `issue_key` to upsert one watermarked comment on an anchor issue (edited in place on re-post \u2014 never a duplicate, never a transition).\n- **\"List / choose an epic\" / \"what epics are open in PROJ?\"** \u2192 `specship_jira_epics` \u2014 returns the project's open epics (status category \u2260 Done). Powers the `/specship:jira` menu's epic-picker; omit `project` on a bound repo to use the committed `jira.projectKey`.\n- **\"Generate / refresh the regression pack\" / \"build regression tests in JIRA\"** \u2192 `specship_jira_regression_pack` \u2014 creates or refreshes the SpecShip Regression Pack epic in the bound project, with one domain-area Story per area (`Uncategorised` until REQ-JIRAREG-002 lands) and one Sub-task per acceptance criterion of every implemented (or verified) requirement. Idempotent: a re-run with no spec changes performs zero JIRA writes. Pass `dry_run: true` to preview the plan without touching JIRA.\n- **\"Create a JIRA for this spec\" / \"publish REQ-X to JIRA\"** \u2192 `specship_jira_publish` with the `spec_id` \u2014 creates a Story whose Sub-tasks mirror the spec's acceptance criteria (idempotent: re-publish updates the Story and adds only missing Sub-tasks) and writes `jira_issue:` into the spec's frontmatter, which wires branch naming, PR linkage, commit prefixes (\"PROJ-123: \u2026\"), and tracking automatically. After authoring a spec with JIRA configured, offer this once (REQ-JIRAPUB-003).\n\n## Limitations\n\n- If a tool reports the project isn't initialized, `.specship/` doesn't exist yet \u2014 offer to run `specship init -i` to build the index.\n- Index lags file writes by ~1 second.\n- Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.\n- No live correctness validation \u2014 that's still the TypeScript compiler / test suite / linter's job. Specship supplements those with structural context they don't have.\n";
1
3
  /**
2
- * Server-level instructions emitted in the MCP `initialize` response.
3
- *
4
- * Claude Code surfaces this text in the agent's system prompt
5
- * automatically, giving the agent a high-level playbook for the
6
- * specship toolset before it sees individual tool descriptions.
7
- *
8
- * Goals when editing this:
9
- * - Tool selection by intent (which tool for which question)
10
- * - Common chains (refactor planning = X then Y)
11
- * - Anti-patterns (don't grep when specship_search is faster)
12
- *
13
- * Keep it tight. The agent reads this every session — long instructions
14
- * burn tokens. Reference only tools that exist on `main`; gate any
15
- * conditional tools behind feature checks if/when they ship.
4
+ * Compact variant served when the resolved model tier is `lite`
5
+ * (REQ-LOWEND-003). Short imperative contract: explore-first, the core
6
+ * tools that survive `applyLiteTierTrim`, and the anti-patterns that stop a
7
+ * grep fallback. No JIRA section, and no tool the lite menu trimmed away.
16
8
  */
17
- export declare const SERVER_INSTRUCTIONS = "# Specship \u2014 code intelligence over an indexed knowledge graph\n\nSpecship is a SQLite knowledge graph of every symbol, edge, and file\nin the workspace. Reads are sub-millisecond; the index lags writes by\nabout a second through the file watcher. Consult it BEFORE writing or\nediting code, not during.\n\n## Answer directly \u2014 don't delegate exploration\n\nFor \"how does X work\", architecture, trace, or where-is-X questions,\nanswer DIRECTLY \u2014 usually with ONE `specship_explore` call.\n`specship_explore` takes either a natural-language question or a bag of\nsymbol/file names and returns the verbatim source of the relevant symbols\ngrouped by file, so it is Read-equivalent and most often the ONLY\nspecship call you need. Specship IS the pre-built search index \u2014 so\ndelegating the lookup to a separate file-reading sub-task/agent, or\nrunning your own grep + read loop, repeats work specship already did and\ncosts more for the same answer. Reach for raw Read/Grep only to confirm a\nspecific detail specship didn't cover. A direct specship answer is\ntypically one to a few calls; a grep/read exploration is dozens.\n\n## Tool selection by intent\n\n- **Almost any question \u2014 \"how does X work\", architecture, a bug, \"what/where is X\", or surveying an area** \u2192 `specship_explore` (PRIMARY \u2014 call FIRST; ONE capped call returns the verbatim source of the relevant symbols grouped by file; most often the ONLY call you need). Naming a documented domain term/entity also surfaces its human-confirmed fact body inline under \"Domain facts\".\n- **\"How does X reach/become Y? / the flow / the path from X to Y\"** \u2192 `specship_explore`, naming the symbols that span the flow (e.g. `mutateElement renderScene`) \u2014 it surfaces the call path among them, including dynamic-dispatch hops (callbacks, React re-render, JSX children) grep can't follow\n- **\"What is the symbol named X?\" (just its location)** \u2192 `specship_search`\n- **\"What calls this?\" / \"What does this call?\" / \"What would changing this break?\"** \u2192 `specship_callers` / `specship_callees` / `specship_impact`\n- **One specific symbol's full source (esp. a body `specship_explore` trimmed), or an OVERLOADED name** \u2192 `specship_node` (with `includeCode`): for an ambiguous name it returns EVERY matching definition's body in one call, so you never Read a file to find the right overload\n- **\"What's in directory X?\"** \u2192 `specship_files`\n- **\"Is the index ready / what's its size?\"** \u2192 `specship_status`\n- **\"Which SpecShip is running? / what version am I on?\"** \u2192 `specship_version` (zero-arg; identifies the MCP server process \u2014 version, install method, install dir, node, project root)\n- **User mentions a spec ID or requirement (e.g. \"REQ-AUTH-005\", \"the rate-limit requirement\")** \u2192 `specship_spec` FIRST. Returns spec body + parent/siblings + linked code with state (verified / drifted / orphaned) \u2014 more than Read-ing the spec file alone. If domain facts (ubiquitous-language terms, business rules) are linked to the spec, they come back inline under \"Domain facts\" \u2014 no separate tool. Then jump into linked code via `specship_node`.\n- **User describes a change without naming a spec (a bug, an error, a one-line enhancement) and you need to find which existing spec it belongs to** \u2192 `specship_spec` with a free-text `query`. Returns scored, ranked candidate specs (id, title, kind, snippet) over the spec index \u2014 use it to route the change to the right requirement before authoring a new doc. (No `query`/`spec_id` \u2192 the lifecycle funnel; add `list: true` for a flat inventory of every requirement's single rolled-up status + per-status totals, or `ideas: true` for the ideas review view \u2014 the idea-state briefs with age since capture + labels, closing with the promotion hand-off.)\n- **Authoring end-to-end tests for a requirement** \u2192 `specship_spec` with `spec_id` + `behaviour_surface: true`. Returns the requirement's linked code plus the surrounding routes / components / handlers grouped into a UI tier (Playwright targets) and a backend/batch tier (API/job targets) \u2014 the flow map to write tests from.\n- **After editing code in response to a spec** \u2192 call `specship_link_assert` before reporting done. Idempotent. Supersedes the `// @implements REQ-X` comment backstop (which the extractor catches on its own).\n- **After running verification (tests) against a spec link** \u2192 `specship_link_verify` with `result: \"pass\" | \"fail\"` so the link moves from `implemented` to `verified` (or `broken`).\n- **\"What's drifted / broken / orphaned?\" / non-coder review queue** \u2192 `specship_drifted` (optional `state` filter).\n\n## Common chains\n\n- **Flow / \"how does X reach Y\"**: ONE `specship_explore` with the symbol names spanning the flow \u2014 it surfaces the call path among them (riding dynamic-dispatch hops) AND returns their source. No need to reconstruct the path with `specship_search` + `specship_callers`.\n- **Onboarding / understanding any area**: ONE `specship_explore` is usually the whole answer. Only follow up \u2014 `specship_node` for a specific symbol \u2014 if something is still unclear.\n- **Refactor planning**: `specship_search` \u2192 `specship_callers` \u2192 `specship_impact`. The blast-radius answer comes from impact, not from walking callers manually.\n- **Debugging a regression**: `specship_callers` of the suspected symbol; widen with `specship_impact` if an unexpected call appears.\n\n## Anti-patterns\n\n- **Trust specship's results \u2014 don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.\n- **Don't grep first** when looking up a symbol by name \u2014 `specship_search` is faster and returns kind + location + signature.\n- **Don't chain `specship_search` + `specship_node`** to understand an area \u2014 ONE `specship_explore` returns the relevant symbols' source together in a single round-trip.\n- **Don't loop `specship_node` over many symbols** \u2014 one `specship_explore` call returns them all grouped by file, while each separate call re-reads the whole context and costs far more. Use `specship_node` for a single symbol.\n- **After editing, check the staleness banner.** When a tool response starts with \"\u26A0\uFE0F Some files referenced below were edited since the last index sync\u2026\", the listed files are pending re-index \u2014 Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust specship. `specship_status` also lists pending files under \"Pending sync\".\n\n## JIRA integration\n\nAny request about the user's JIRA issues/tasks/tickets goes to these tools by default \u2014 the user should NOT have to say \"use specship\". Each tool already returns a professional, formatted result (a table, with any caveat as a bottom note); **present that output verbatim \u2014 relay it as-is, do not re-summarize it, add a preamble, or speculate about why a list is empty.** The tools chain in this order:\n\n- **\"list my JIRA issues\" / \"what's assigned to me?\" / \"my JIRA tasks\"** \u2192 `specship_jira_issues` (identity comes from the configured token \u2014 the user never types their own name). It returns a ready-to-display table; show it as returned.\n- **\"Show me issue PROJ-123\"** \u2192 `specship_jira_issue` with the `key`.\n- **\"Pick / work on PROJ-123\"** \u2192 `specship_jira_pick` with the `key` \u2014 fetches the issue and authors a SpecShip spec under `specs/` (idempotent on the key).\n- **\"Start / implement it\"** \u2192 `specship_jira_start` with the same `key` \u2014 runs the bundled `spec-implement` workflow on the spec pick authored, in an isolated worktree. It runs to the **plan/approve gate** and pauses there, returning the run ID; review the plan, then approve (`specship workflow approve <runId>`) to continue. A failed run raises no PR. If no spec exists for the key yet, start points you back to `specship_jira_pick`.\n- **\"How's my JIRA work going? / status of my picked issues\"** \u2192 `specship_jira_track` \u2014 a read-only table joining each picked issue's SpecShip work-state (spec authored \u2192 implementing \u2192 PR raised \u2192 verified) with its **live** JIRA status (read fresh each time, so an issue moved outside SpecShip reflects its current status). It never re-picks or re-starts anything; pass an optional `project` to narrow the JIRA read. Published specs appear too, and one edited in JIRA after publish is flagged as a divergence.\n- **\"Reconcile JIRA edits back into the spec\" / \"someone edited PROJ-123 in JIRA\"** \u2192 `specship_jira_reconcile` \u2014 **preview first, then apply only after the user has explicitly confirmed the exact diff**. Preview (default `mode:\"preview\"`) is read-only; it enumerates every published spec whose live JIRA issue diverges (edited summary/description, or a Sub-task added in JIRA) and returns a proposed spec amendment plus a machine block with `expected_live_fingerprint`. Show the user the diff and ask; only after they confirm, call again with `mode:\"apply\"`, `issue_key`, the confirmed `accept_content`/`accept_subtasks`, and the `expected_live_fingerprint` from the preview. Apply refuses when the fingerprint doesn't match \u2014 no preview \u2192 no apply.\n- **\"Sprint coverage / how much of this sprint has specs / is verified?\"** \u2192 `specship_jira_coverage` \u2014 joins the bound project's active (or named) sprint to spec truth: every issue with its rolled-up repo-side state (unspecced / specced / implemented / verified / drifted / broken) and rollup totals. Read-only by default; pass `post: true` with `issue_key` to upsert one watermarked comment on an anchor issue (edited in place on re-post \u2014 never a duplicate, never a transition).\n- **\"List / choose an epic\" / \"what epics are open in PROJ?\"** \u2192 `specship_jira_epics` \u2014 returns the project's open epics (status category \u2260 Done). Powers the `/specship:jira` menu's epic-picker; omit `project` on a bound repo to use the committed `jira.projectKey`.\n- **\"Generate / refresh the regression pack\" / \"build regression tests in JIRA\"** \u2192 `specship_jira_regression_pack` \u2014 creates or refreshes the SpecShip Regression Pack epic in the bound project, with one domain-area Story per area (`Uncategorised` until REQ-JIRAREG-002 lands) and one Sub-task per acceptance criterion of every implemented (or verified) requirement. Idempotent: a re-run with no spec changes performs zero JIRA writes. Pass `dry_run: true` to preview the plan without touching JIRA.\n- **\"Create a JIRA for this spec\" / \"publish REQ-X to JIRA\"** \u2192 `specship_jira_publish` with the `spec_id` \u2014 creates a Story whose Sub-tasks mirror the spec's acceptance criteria (idempotent: re-publish updates the Story and adds only missing Sub-tasks) and writes `jira_issue:` into the spec's frontmatter, which wires branch naming, PR linkage, commit prefixes (\"PROJ-123: \u2026\"), and tracking automatically. After authoring a spec with JIRA configured, offer this once (REQ-JIRAPUB-003).\n\n## Limitations\n\n- If a tool reports the project isn't initialized, `.specship/` doesn't exist yet \u2014 offer to run `specship init -i` to build the index.\n- Index lags file writes by ~1 second.\n- Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.\n- No live correctness validation \u2014 that's still the TypeScript compiler / test suite / linter's job. Specship supplements those with structural context they don't have.\n";
9
+ export declare const LITE_SERVER_INSTRUCTIONS = "# Specship \u2014 the code index for this workspace\n\nSpecship is a pre-built index of every symbol, file, and call edge here.\nReads are instant; the index lags file writes by about a second.\n\n## Rule 1 \u2014 explore first, answer yourself\n\nAny question about how the code works, where something lives, how X reaches\nY, or what an area does: make ONE `specship_explore` call, then answer from\nit. `specship_explore` takes a plain question or a list of symbol/file\nnames and returns the verbatim source of the matching symbols grouped by\nfile \u2014 it is Read-equivalent, so treat what it returns as already Read.\nDo NOT hand the lookup to a sub-agent or sub-task. Do NOT start a\nGrep/Glob/Read sweep. One call is usually the whole answer.\n\n## Rule 2 \u2014 tools\n\n- Anything about how the code works, where it is, or a flow \u2192 `specship_explore` (FIRST, and usually the only call). For a flow, name both ends: `specship_explore` with `mutateElement renderScene`.\n- Just the location of a name \u2192 `specship_search`.\n- The full body of one named symbol, including every overload of an ambiguous name \u2192 `specship_node` with `includeCode`.\n- Is the index ready / which specship is running \u2192 `specship_status`.\n- The user names a spec or requirement (e.g. REQ-AUTH-005) \u2192 `specship_spec`.\n- After you edit code for a spec \u2192 `specship_link_assert` before reporting done.\n\n## Rule 3 \u2014 anti-patterns\n\n- Don't Grep/Glob/Read to find code. Ask `specship_explore` instead.\n- Don't re-run `specship_explore` for something a previous call already returned \u2014 re-read your earlier result.\n- Don't verify a specship answer with grep. It comes from a full parse.\n- Don't chain `specship_search` + `specship_node` to understand an area \u2014 one `specship_explore` covers it.\n- If a response opens with a \u26A0\uFE0F staleness banner, Read only the files it lists; everything else is fresh.\n- If a tool says the project isn't initialized, offer to run `specship init -i`.\n";
10
+ /** Instruction text for a resolved tier (REQ-LOWEND-003.A3: non-lite is unchanged). */
11
+ export declare function serverInstructionsFor(tier: ModelTier): string;
12
+ /**
13
+ * Resolve the instructions for a project-root hint, mirroring
14
+ * `applyLiteTierTrim`'s resolution exactly so the menu trim and the
15
+ * instruction trim always agree. Marker-file only — no DB open. A null or
16
+ * unresolvable hint gets the full text (never compact blind).
17
+ */
18
+ export declare function resolveServerInstructions(hint: string | null): string;
18
19
  //# sourceMappingURL=server-instructions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,28WA0E/B,CAAC"}
1
+ {"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAElE,eAAO,MAAM,mBAAmB,w8ZA2E/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,g/DAgCpC,CAAC;AAEF,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAKrE"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SERVER_INSTRUCTIONS = void 0;
3
+ exports.LITE_SERVER_INSTRUCTIONS = exports.SERVER_INSTRUCTIONS = void 0;
4
+ exports.serverInstructionsFor = serverInstructionsFor;
5
+ exports.resolveServerInstructions = resolveServerInstructions;
4
6
  /**
5
7
  * Server-level instructions emitted in the MCP `initialize` response.
6
8
  *
@@ -16,7 +18,14 @@ exports.SERVER_INSTRUCTIONS = void 0;
16
18
  * Keep it tight. The agent reads this every session — long instructions
17
19
  * burn tokens. Reference only tools that exist on `main`; gate any
18
20
  * conditional tools behind feature checks if/when they ship.
21
+ *
22
+ * Two variants live here and nowhere else (REQ-LOWEND-003): the full
23
+ * `SERVER_INSTRUCTIONS` below, and the compact `LITE_SERVER_INSTRUCTIONS`
24
+ * served to `lite`-tier sessions. Pick between them with
25
+ * `serverInstructionsFor(tier)` / `resolveServerInstructions(hint)`.
19
26
  */
27
+ const directory_1 = require("../directory");
28
+ const model_context_1 = require("./model-context");
20
29
  exports.SERVER_INSTRUCTIONS = `# Specship — code intelligence over an indexed knowledge graph
21
30
 
22
31
  Specship is a SQLite knowledge graph of every symbol, edge, and file
@@ -46,13 +55,14 @@ typically one to a few calls; a grep/read exploration is dozens.
46
55
  - **"What calls this?" / "What does this call?" / "What would changing this break?"** → \`specship_callers\` / \`specship_callees\` / \`specship_impact\`
47
56
  - **One specific symbol's full source (esp. a body \`specship_explore\` trimmed), or an OVERLOADED name** → \`specship_node\` (with \`includeCode\`): for an ambiguous name it returns EVERY matching definition's body in one call, so you never Read a file to find the right overload
48
57
  - **"What's in directory X?"** → \`specship_files\`
49
- - **"Is the index ready / what's its size?"** → \`specship_status\`
50
- - **"Which SpecShip is running? / what version am I on?"** → \`specship_version\` (zero-arg; identifies the MCP server process — version, install method, install dir, node, project root)
58
+ - **"Is the index ready / what's its size?" or "which SpecShip is running / what version am I on?"** → \`specship_status\` (one tool for both: index stats plus the serving process's version, install method, install dir, node and project root; works with no project open)
59
+ - **"Is this code healthy / does it violate our architecture rules?"** → \`specship_health\` (coupling + oversized symbols + god-files + cycles + dead-code candidates, and architecture-fitness violations; narrow with \`checks: ["maintainability"]\` or \`["fitness"]\`)
51
60
  - **User mentions a spec ID or requirement (e.g. "REQ-AUTH-005", "the rate-limit requirement")** → \`specship_spec\` FIRST. Returns spec body + parent/siblings + linked code with state (verified / drifted / orphaned) — more than Read-ing the spec file alone. If domain facts (ubiquitous-language terms, business rules) are linked to the spec, they come back inline under "Domain facts" — no separate tool. Then jump into linked code via \`specship_node\`.
52
61
  - **User describes a change without naming a spec (a bug, an error, a one-line enhancement) and you need to find which existing spec it belongs to** → \`specship_spec\` with a free-text \`query\`. Returns scored, ranked candidate specs (id, title, kind, snippet) over the spec index — use it to route the change to the right requirement before authoring a new doc. (No \`query\`/\`spec_id\` → the lifecycle funnel; add \`list: true\` for a flat inventory of every requirement's single rolled-up status + per-status totals, or \`ideas: true\` for the ideas review view — the idea-state briefs with age since capture + labels, closing with the promotion hand-off.)
53
62
  - **Authoring end-to-end tests for a requirement** → \`specship_spec\` with \`spec_id\` + \`behaviour_surface: true\`. Returns the requirement's linked code plus the surrounding routes / components / handlers grouped into a UI tier (Playwright targets) and a backend/batch tier (API/job targets) — the flow map to write tests from.
54
- - **After editing code in response to a spec** → call \`specship_link_assert\` before reporting done. Idempotent. Supersedes the \`// @implements REQ-X\` comment backstop (which the extractor catches on its own).
55
- - **After running verification (tests) against a spec link** → \`specship_link_verify\` with \`result: "pass" | "fail"\` so the link moves from \`implemented\` to \`verified\` (or \`broken\`).
63
+ - **After editing code in response to a spec** → call \`specship_link_assert\` before reporting done. Idempotent. Supersedes the \`// @implements REQ-X\` comment backstop (which the extractor catches on its own). The target is validated against the graph — an unresolvable \`file:symbol\` is refused with near-miss suggestions, so re-call it with a real target rather than assuming it recorded.
64
+ - **After running verification (tests) against a spec link** → \`specship_link_verify\` with \`result: "pass" | "fail"\` so the link moves from \`implemented\` to \`verified\` (or \`broken\`). Pass the test name(s) you ran as \`evidence\` (and a \`reason\`) — they're persisted with a timestamp as the audit trail for the claim. Promotion to \`verified\` needs test evidence declared IN A FILE (a \`verifies:\` block in the spec, an \`@verifies REQ-X\` comment on the test, or the spec id inside an \`it()\` title in a test file); an asserted \`tests\` link does not count, and neither does a \`tests\` link pointing outside a test file. For a whole test run, \`specship verify --report <vitest-json>\` moves every matching link from the report itself — deterministic, and it records the run as the evidence.
65
+ - **"Is this requirement actually proven / how much of it has tests?"** → \`specship_spec\` with \`coverage: true\` (with or without a \`spec_id\`). Returns a per-requirement AND per-acceptance-criterion rollup with a verdict of untested / tested / verified / broken. The verdict comes from \`tests\` links ONLY — a criterion with implementing code and no test reads \`untested\`, so never answer "is it done" from the presence of an \`implements\` link.
56
66
  - **"What's drifted / broken / orphaned?" / non-coder review queue** → \`specship_drifted\` (optional \`state\` filter).
57
67
 
58
68
  ## Common chains
@@ -92,4 +102,61 @@ Any request about the user's JIRA issues/tasks/tickets goes to these tools by de
92
102
  - Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.
93
103
  - No live correctness validation — that's still the TypeScript compiler / test suite / linter's job. Specship supplements those with structural context they don't have.
94
104
  `;
105
+ /**
106
+ * Compact variant served when the resolved model tier is `lite`
107
+ * (REQ-LOWEND-003). Short imperative contract: explore-first, the core
108
+ * tools that survive `applyLiteTierTrim`, and the anti-patterns that stop a
109
+ * grep fallback. No JIRA section, and no tool the lite menu trimmed away.
110
+ */
111
+ exports.LITE_SERVER_INSTRUCTIONS = `# Specship — the code index for this workspace
112
+
113
+ Specship is a pre-built index of every symbol, file, and call edge here.
114
+ Reads are instant; the index lags file writes by about a second.
115
+
116
+ ## Rule 1 — explore first, answer yourself
117
+
118
+ Any question about how the code works, where something lives, how X reaches
119
+ Y, or what an area does: make ONE \`specship_explore\` call, then answer from
120
+ it. \`specship_explore\` takes a plain question or a list of symbol/file
121
+ names and returns the verbatim source of the matching symbols grouped by
122
+ file — it is Read-equivalent, so treat what it returns as already Read.
123
+ Do NOT hand the lookup to a sub-agent or sub-task. Do NOT start a
124
+ Grep/Glob/Read sweep. One call is usually the whole answer.
125
+
126
+ ## Rule 2 — tools
127
+
128
+ - Anything about how the code works, where it is, or a flow → \`specship_explore\` (FIRST, and usually the only call). For a flow, name both ends: \`specship_explore\` with \`mutateElement renderScene\`.
129
+ - Just the location of a name → \`specship_search\`.
130
+ - The full body of one named symbol, including every overload of an ambiguous name → \`specship_node\` with \`includeCode\`.
131
+ - Is the index ready / which specship is running → \`specship_status\`.
132
+ - The user names a spec or requirement (e.g. REQ-AUTH-005) → \`specship_spec\`.
133
+ - After you edit code for a spec → \`specship_link_assert\` before reporting done.
134
+
135
+ ## Rule 3 — anti-patterns
136
+
137
+ - Don't Grep/Glob/Read to find code. Ask \`specship_explore\` instead.
138
+ - Don't re-run \`specship_explore\` for something a previous call already returned — re-read your earlier result.
139
+ - Don't verify a specship answer with grep. It comes from a full parse.
140
+ - Don't chain \`specship_search\` + \`specship_node\` to understand an area — one \`specship_explore\` covers it.
141
+ - If a response opens with a ⚠️ staleness banner, Read only the files it lists; everything else is fresh.
142
+ - If a tool says the project isn't initialized, offer to run \`specship init -i\`.
143
+ `;
144
+ /** Instruction text for a resolved tier (REQ-LOWEND-003.A3: non-lite is unchanged). */
145
+ function serverInstructionsFor(tier) {
146
+ return tier === 'lite' ? exports.LITE_SERVER_INSTRUCTIONS : exports.SERVER_INSTRUCTIONS;
147
+ }
148
+ /**
149
+ * Resolve the instructions for a project-root hint, mirroring
150
+ * `applyLiteTierTrim`'s resolution exactly so the menu trim and the
151
+ * instruction trim always agree. Marker-file only — no DB open. A null or
152
+ * unresolvable hint gets the full text (never compact blind).
153
+ */
154
+ function resolveServerInstructions(hint) {
155
+ if (!hint)
156
+ return exports.SERVER_INSTRUCTIONS;
157
+ const root = (0, directory_1.findNearestSpecShipRoot)(hint);
158
+ if (!root)
159
+ return exports.SERVER_INSTRUCTIONS;
160
+ return serverInstructionsFor((0, model_context_1.detectModelTier)(root));
161
+ }
95
162
  //# sourceMappingURL=server-instructions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;GAeG;AACU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0ElC,CAAC"}
1
+ {"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";;;AA8IA,sDAEC;AAQD,8DAKC;AA7JD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,4CAAuD;AACvD,mDAAkE;AAErD,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2ElC,CAAC;AAEF;;;;;GAKG;AACU,QAAA,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCvC,CAAC;AAEF,uFAAuF;AACvF,SAAgB,qBAAqB,CAAC,IAAe;IACnD,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,gCAAwB,CAAC,CAAC,CAAC,2BAAmB,CAAC;AAC1E,CAAC;AAED;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,IAAmB;IAC3D,IAAI,CAAC,IAAI;QAAE,OAAO,2BAAmB,CAAC;IACtC,MAAM,IAAI,GAAG,IAAA,mCAAuB,EAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI;QAAE,OAAO,2BAAmB,CAAC;IACtC,OAAO,qBAAqB,CAAC,IAAA,+BAAe,EAAC,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC"}
@@ -211,7 +211,7 @@ class MCPSession {
211
211
  protocolVersion: exports.PROTOCOL_VERSION,
212
212
  capabilities: { tools: {} },
213
213
  serverInfo: exports.SERVER_INFO,
214
- instructions: server_instructions_1.SERVER_INSTRUCTIONS,
214
+ instructions: (0, server_instructions_1.resolveServerInstructions)(explicitPath ?? this.explicitProjectPath ?? null),
215
215
  });
216
216
  if (explicitPath) {
217
217
  // Kick off engine init in the background. If another session in the
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/mcp/session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAC7B,2CAAgG;AAEhG,mCAAgC;AAChC,+DAA4D;AAC5D,uCAAmD;AAEnD;;;GAGG;AACH,2EAA2E;AAC3E,4EAA4E;AAC/D,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,gCAAsB;CAChC,CAAC;AAEF,uD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C"}
@@ -12,7 +12,7 @@
12
12
  * ToolHandler in `tools.ts` calls these via thin wrappers.
13
13
  */
14
14
  import type SpecShip from '../index';
15
- import type { SpecLinkState, SpecLinkKind } from '../types';
15
+ import type { Spec, SpecLinkState, SpecLinkKind } from '../types';
16
16
  import type { ToolDefinition, ToolResult } from './tools';
17
17
  export declare const SPEC_LINK_STATES: SpecLinkState[];
18
18
  export declare const SPEC_LINK_KINDS: SpecLinkKind[];
@@ -36,6 +36,14 @@ export type RequirementStatus = (typeof REQUIREMENT_STATUSES)[number];
36
36
  * harness (a separate v1 surface) which enforces the call via tool restriction.
37
37
  */
38
38
  export declare const specToolDefinitions: ToolDefinition[];
39
+ /**
40
+ * Render linked domain facts inline (REQ-DOMAIN-005.A1, REQ-KNOW-005). An
41
+ * `external` fact also carries its provenance — dependency, the version it was
42
+ * verified against, the installed version with a stale marker — and its
43
+ * enforced rules, so the agent does not rediscover any of it. Freshness is
44
+ * best-effort: an unresolvable dependency reads `unverifiable`, never fresh.
45
+ */
46
+ export declare function renderDomainFactsInline(facts: Spec[], projectRoot: string): string[];
39
47
  export declare function handleSpecshipSpec(cg: SpecShip, args: Record<string, unknown>): Promise<ToolResult>;
40
48
  export declare function handleSpecshipLinkAssert(cg: SpecShip, args: Record<string, unknown>): Promise<ToolResult>;
41
49
  export declare function handleSpecshipLinkVerify(cg: SpecShip, args: Record<string, unknown>): Promise<ToolResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"spec-tools.d.ts","sourceRoot":"","sources":["../../src/mcp/spec-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAkB,aAAa,EAAE,YAAY,EAAY,MAAM,UAAU,CAAC;AAItF,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAW1D,eAAO,MAAM,gBAAgB,EAAE,aAAa,EAQ3C,CAAC;AAEF,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