gennady 0.6.0 → 0.7.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 (319) hide show
  1. package/README.md +2 -15
  2. package/ai/agents/agent-resolve-conflicts.xml +6 -0
  3. package/ai/agents/agent-review-verifier.xml +6 -0
  4. package/ai/directives/architecture/README.md +21 -0
  5. package/ai/directives/coding/README.md +23 -0
  6. package/ai/directives/coding/result-conventions.xml +55 -0
  7. package/ai/directives/coding/svelte5-runes.xml +248 -0
  8. package/ai/directives/coding/sveltekit-rules.xml +247 -0
  9. package/ai/directives/coding/typescript-rules.xml +589 -0
  10. package/ai/directives/coding/uikit-component-storybook.xml +347 -0
  11. package/ai/directives/coding/uikit-component-svelte.xml +344 -0
  12. package/ai/directives/coding/uikit-spec-drafting.xml +243 -0
  13. package/ai/directives/dbc-audit.directive.xml +131 -0
  14. package/ai/directives/dev-review.directive.xml +148 -0
  15. package/ai/directives/infra/README.md +11 -0
  16. package/ai/directives/infra/eslint-setup.xml +467 -0
  17. package/ai/directives/infra/git-setup.xml +261 -0
  18. package/ai/directives/infra/nodejs-npm-setup.xml +354 -0
  19. package/ai/directives/infra/storybook-setup.xml +153 -0
  20. package/ai/directives/knowledge.xml +206 -0
  21. package/ai/directives/perf-auditor/perf-auditor.directive.xml +75 -0
  22. package/ai/directives/perf-auditor/rules/async-latency.xml +101 -0
  23. package/ai/directives/perf-auditor/rules/data-structures.xml +103 -0
  24. package/ai/directives/perf-auditor/rules/iteration-fusion.xml +96 -0
  25. package/ai/directives/perf-auditor/rules/memory-gc.xml +102 -0
  26. package/ai/directives/sdd/README.md +49 -0
  27. package/ai/directives/sdd/audit.directive.xml +543 -0
  28. package/ai/directives/sdd/discovery.directive.xml +824 -0
  29. package/ai/directives/sdd/fix.directive.xml +249 -0
  30. package/ai/directives/sdd/module-decomposition.directive.xml +666 -0
  31. package/ai/directives/sdd/phase-execution-protocol.xml +339 -0
  32. package/ai/directives/sdd/scaffold.directive.xml +717 -0
  33. package/ai/directives/sdd/setup.directive.xml +213 -0
  34. package/ai/directives/sdd/svelte-ui-discovery.directive.xml +263 -0
  35. package/ai/directives/semantic-change-extractor.directive.xml +99 -0
  36. package/ai/directives/testing/README.md +25 -0
  37. package/ai/directives/testing/common.xml +234 -0
  38. package/ai/directives/testing/node-test.xml +288 -0
  39. package/ai/directives/testing/playwright-cli.xml +199 -0
  40. package/ai/directives/testing/playwright-e2e.xml +292 -0
  41. package/ai/directives/testing/storybook-usage.xml +173 -0
  42. package/ai/directives/testing/svelte-testing.xml +237 -0
  43. package/ai/directives/testing/vitest-rules.xml +326 -0
  44. package/ai/docs/README.md +17 -0
  45. package/ai/docs/ai-icl.md +538 -0
  46. package/ai/docs/ai-priming.md +548 -0
  47. package/ai/docs/ai-prompt-formats.md +406 -0
  48. package/ai/docs/ai-promting.md +572 -0
  49. package/ai/drafts/DRAFT.md +120 -0
  50. package/ai/drafts/agent-devgen-class-from-description.rules.xml +123 -0
  51. package/ai/drafts/agent-typescript-devgen.v1.xml +303 -0
  52. package/ai/drafts/d.md +65 -0
  53. package/ai/drafts/music-posts.md +105 -0
  54. package/ai/fw/v1/architecture/blueprint-factory.xml +77 -0
  55. package/ai/fw/v1/core/mental-model.xml +50 -0
  56. package/ai/fw/v1/discovery/intent-reactor.xml +92 -0
  57. package/ai/fw/v1/production/swarm-protocol.xml +122 -0
  58. package/ai/fw/v1/review/quality-pipeline.xml +102 -0
  59. package/ai/fw/v2/arch-universal.xml +73 -0
  60. package/ai/fw-draft/README.md +79 -0
  61. package/ai/fw-draft/bin/discovery.sh +116 -0
  62. package/ai/fw-draft/gennady.xml +58 -0
  63. package/ai/fw-draft/provider/claude.xml +16 -0
  64. package/ai/fw-draft/provider/cursor.xml +23 -0
  65. package/ai/fw-draft/provider/default.xml +12 -0
  66. package/ai/fw-draft/roles/developer.xml +18 -0
  67. package/ai/fw-draft/router.xml +39 -0
  68. package/ai/fw-draft/routes/development.xml +32 -0
  69. package/ai/fw-draft/routes/universal.xml +58 -0
  70. package/ai/fw-draft/rules/dev/base/file-structure-rules.xml +89 -0
  71. package/ai/fw-draft/rules/dev/typescript/contacts.xml +194 -0
  72. package/dist/ai/agents/agent-resolve-conflicts.xml +6 -0
  73. package/dist/ai/agents/agent-review-verifier.xml +6 -0
  74. package/dist/ai/directives/architecture/README.md +21 -0
  75. package/dist/ai/directives/coding/README.md +23 -0
  76. package/dist/ai/directives/coding/result-conventions.xml +55 -0
  77. package/dist/ai/directives/coding/svelte5-runes.xml +248 -0
  78. package/dist/ai/directives/coding/sveltekit-rules.xml +247 -0
  79. package/dist/ai/directives/coding/typescript-rules.xml +589 -0
  80. package/dist/ai/directives/coding/uikit-component-storybook.xml +347 -0
  81. package/dist/ai/directives/coding/uikit-component-svelte.xml +344 -0
  82. package/dist/ai/directives/coding/uikit-spec-drafting.xml +243 -0
  83. package/dist/ai/directives/dbc-audit.directive.xml +131 -0
  84. package/dist/ai/directives/dev-review.directive.xml +148 -0
  85. package/dist/ai/directives/infra/README.md +11 -0
  86. package/dist/ai/directives/infra/eslint-setup.xml +467 -0
  87. package/dist/ai/directives/infra/git-setup.xml +261 -0
  88. package/dist/ai/directives/infra/nodejs-npm-setup.xml +354 -0
  89. package/dist/ai/directives/infra/storybook-setup.xml +153 -0
  90. package/dist/ai/directives/knowledge.xml +206 -0
  91. package/dist/ai/directives/perf-auditor/perf-auditor.directive.xml +75 -0
  92. package/dist/ai/directives/perf-auditor/rules/async-latency.xml +101 -0
  93. package/dist/ai/directives/perf-auditor/rules/data-structures.xml +103 -0
  94. package/dist/ai/directives/perf-auditor/rules/iteration-fusion.xml +96 -0
  95. package/dist/ai/directives/perf-auditor/rules/memory-gc.xml +102 -0
  96. package/dist/ai/directives/sdd/README.md +49 -0
  97. package/dist/ai/directives/sdd/audit.directive.xml +543 -0
  98. package/dist/ai/directives/sdd/discovery.directive.xml +824 -0
  99. package/dist/ai/directives/sdd/fix.directive.xml +249 -0
  100. package/dist/ai/directives/sdd/module-decomposition.directive.xml +666 -0
  101. package/dist/ai/directives/sdd/phase-execution-protocol.xml +339 -0
  102. package/dist/ai/directives/sdd/scaffold.directive.xml +717 -0
  103. package/dist/ai/directives/sdd/setup.directive.xml +213 -0
  104. package/dist/ai/directives/sdd/svelte-ui-discovery.directive.xml +263 -0
  105. package/dist/ai/directives/semantic-change-extractor.directive.xml +99 -0
  106. package/dist/ai/directives/testing/README.md +25 -0
  107. package/dist/ai/directives/testing/common.xml +234 -0
  108. package/dist/ai/directives/testing/node-test.xml +288 -0
  109. package/dist/ai/directives/testing/playwright-cli.xml +199 -0
  110. package/dist/ai/directives/testing/playwright-e2e.xml +292 -0
  111. package/dist/ai/directives/testing/storybook-usage.xml +173 -0
  112. package/dist/ai/directives/testing/svelte-testing.xml +237 -0
  113. package/dist/ai/directives/testing/vitest-rules.xml +326 -0
  114. package/dist/ai/docs/README.md +17 -0
  115. package/dist/ai/docs/ai-icl.md +538 -0
  116. package/dist/ai/docs/ai-priming.md +548 -0
  117. package/dist/ai/docs/ai-prompt-formats.md +406 -0
  118. package/dist/ai/docs/ai-promting.md +572 -0
  119. package/dist/ai/drafts/DRAFT.md +120 -0
  120. package/dist/ai/drafts/agent-devgen-class-from-description.rules.xml +123 -0
  121. package/dist/ai/drafts/agent-typescript-devgen.v1.xml +303 -0
  122. package/dist/ai/drafts/d.md +65 -0
  123. package/dist/ai/drafts/music-posts.md +105 -0
  124. package/dist/ai/fw/v1/architecture/blueprint-factory.xml +77 -0
  125. package/dist/ai/fw/v1/core/mental-model.xml +50 -0
  126. package/dist/ai/fw/v1/discovery/intent-reactor.xml +92 -0
  127. package/dist/ai/fw/v1/production/swarm-protocol.xml +122 -0
  128. package/dist/ai/fw/v1/review/quality-pipeline.xml +102 -0
  129. package/dist/ai/fw/v2/arch-universal.xml +73 -0
  130. package/dist/ai/fw-draft/README.md +79 -0
  131. package/dist/ai/fw-draft/bin/discovery.sh +116 -0
  132. package/dist/ai/fw-draft/gennady.xml +58 -0
  133. package/dist/ai/fw-draft/provider/claude.xml +16 -0
  134. package/dist/ai/fw-draft/provider/cursor.xml +23 -0
  135. package/dist/ai/fw-draft/provider/default.xml +12 -0
  136. package/dist/ai/fw-draft/roles/developer.xml +18 -0
  137. package/dist/ai/fw-draft/router.xml +39 -0
  138. package/dist/ai/fw-draft/routes/development.xml +32 -0
  139. package/dist/ai/fw-draft/routes/universal.xml +58 -0
  140. package/dist/ai/fw-draft/rules/dev/base/file-structure-rules.xml +89 -0
  141. package/dist/ai/fw-draft/rules/dev/typescript/contacts.xml +194 -0
  142. package/dist/chunks/devtools-B-7ugZhF.js +79 -0
  143. package/dist/chunks/{help.cmd-CWasx25o.js → help.cmd-B_G7EWzF.js} +9 -2
  144. package/dist/chunks/{index-B63fYXL2.js → index-BeL1Zcbg.js} +1 -1
  145. package/dist/chunks/index-CVR66voe.js +26963 -0
  146. package/dist/chunks/index-CXuhZzS3.js +16979 -0
  147. package/dist/chunks/{index-B5bA2T7A.js → index-CaahtXiM.js} +33 -9
  148. package/dist/chunks/{index-iqg0w_pE.js → index-CiEM-8nJ.js} +35 -19
  149. package/dist/chunks/{index-B4m0-PAT.js → index-D1qsi0Uc.js} +57 -33
  150. package/dist/chunks/index-D9ceRUyB.js +443 -0
  151. package/dist/chunks/index-DJpVmyp2.js +176 -0
  152. package/dist/chunks/{index-C0andxna.js → index-DU6jD7SS.js} +1 -1
  153. package/dist/chunks/index-KxSZKmZn.js +540 -0
  154. package/dist/chunks/{index-Dqe1TdW4.js → index-UbHoePfr.js} +12 -12
  155. package/dist/chunks/{index-5xIgwwKx.js → index-g1LXlp77.js} +2 -2
  156. package/dist/chunks/index-zBnnuvLA.js +3788 -0
  157. package/dist/chunks/{run-review-command.logic-a_M3CkeZ.js → run-review-command.logic-DpkRoEi8.js} +2 -2
  158. package/dist/chunks/services-CaLOhuLV.js +2889 -0
  159. package/dist/chunks/shared-Bjy30TeM.js +665 -0
  160. package/dist/cli/cmd/_shared/prompt/io/load-agent-template.io.d.ts +3 -3
  161. package/dist/cli/cmd/_shared/prompt/logic/build-ai-first-knowledge-block.logic.d.ts +3 -3
  162. package/dist/cli/cmd/_shared/prompt/logic/build-ai-verify-placeholders.logic.d.ts +7 -4
  163. package/dist/cli/cmd/_shared/prompt/logic/verify-commands/resolve-verify-commands.logic.d.ts +5 -0
  164. package/dist/cli/cmd/_shared/update-check-worker.d.ts +1 -0
  165. package/dist/cli/cmd/_shared/update-check.d.ts +38 -0
  166. package/dist/cli/cmd/agent-mon/cmd/create-providers.d.ts +15 -0
  167. package/dist/cli/cmd/agent-mon/cmd/index.d.ts +1 -0
  168. package/dist/cli/cmd/agent-mon/cmd/run.d.ts +12 -0
  169. package/dist/cli/cmd/agent-mon/state/create-state-manager.d.ts +32 -0
  170. package/dist/cli/cmd/agent-mon/state/group-by-provider.d.ts +14 -0
  171. package/dist/cli/cmd/agent-mon/state/index.d.ts +5 -0
  172. package/dist/cli/cmd/agent-mon/state/is-waiting.d.ts +9 -0
  173. package/dist/cli/cmd/agent-mon/state/view-model.type.d.ts +74 -0
  174. package/dist/cli/cmd/agent-mon/ui/app.d.ts +16 -0
  175. package/dist/cli/cmd/agent-mon/ui/column-view.d.ts +14 -0
  176. package/dist/cli/cmd/agent-mon/ui/index.d.ts +10 -0
  177. package/dist/cli/cmd/agent-mon/ui/provider-column.d.ts +14 -0
  178. package/dist/cli/cmd/agent-mon/ui/session-card.d.ts +12 -0
  179. package/dist/cli/cmd/agent-mon/ui/status-badge.d.ts +10 -0
  180. package/dist/cli/cmd/alt-opinion/alt-opinion-parser.d.ts +18 -0
  181. package/dist/cli/cmd/alt-opinion/alt-opinion-runner.d.ts +32 -0
  182. package/dist/cli/cmd/alt-opinion/alt-opinion.cmd.d.ts +34 -0
  183. package/dist/cli/cmd/alt-opinion/alt-opinion.types.d.ts +88 -0
  184. package/dist/cli/cmd/alt-opinion/index.d.ts +1 -0
  185. package/dist/cli/cmd/cat/cat-url.fn.d.ts +19 -0
  186. package/dist/cli/cmd/lint/checks/anchor.check.d.ts +11 -0
  187. package/dist/cli/cmd/lint/checks/dbc-contract.check.d.ts +16 -0
  188. package/dist/cli/cmd/lint/checks/disables.check.d.ts +12 -0
  189. package/dist/cli/cmd/lint/checks/file-header.check.d.ts +10 -0
  190. package/dist/cli/cmd/lint/checks/language.check.d.ts +11 -0
  191. package/dist/cli/cmd/lint/index.d.ts +1 -0
  192. package/dist/cli/cmd/lint/lint.cmd.d.ts +18 -0
  193. package/dist/cli/cmd/lint/lint.types.d.ts +72 -0
  194. package/dist/cli/cmd/lint/utils/resolve-references.fn.d.ts +32 -0
  195. package/dist/cli/cmd/remote-console/index.d.ts +2 -0
  196. package/dist/cli/cmd/remote-console/remote-console.cmd.d.ts +55 -0
  197. package/dist/cli/cmd/resolve-conflicts/_core/io/resolve-conflicts-template-load.io.d.ts +2 -2
  198. package/dist/cli/cmd/resolve-conflicts/_core/logic/resolve-conflicts-command-args-parse.logic.d.ts +3 -3
  199. package/dist/cli/cmd/resolve-conflicts/_core/logic/resolve-conflicts-command-run.logic.d.ts +3 -3
  200. package/dist/cli/cmd/resolve-conflicts/_core/logic/resolve-conflicts-context-git-build.logic.d.ts +4 -4
  201. package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-artifact.type.d.ts +3 -1
  202. package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-command-args.type.d.ts +3 -1
  203. package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-command-result.type.d.ts +5 -1
  204. package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-context-git.type.d.ts +18 -2
  205. package/dist/cli/cmd/resolve-conflicts/_core/xml/resolve-conflicts-artifact-build.xml.d.ts +6 -6
  206. package/dist/cli/cmd/resolve-conflicts/_core/xml/resolve-conflicts-render.xml.d.ts +4 -4
  207. package/dist/cli/cmd/review/_core/io/load-review-verify-template.io.d.ts +2 -2
  208. package/dist/cli/cmd/review/_core/logic/build-review-context-git.logic.d.ts +3 -3
  209. package/dist/cli/cmd/review/_core/logic/build-review-context-vcs.logic.d.ts +2 -2
  210. package/dist/cli/cmd/review/_core/logic/load-review-context-mr.logic.d.ts +5 -5
  211. package/dist/cli/cmd/review/_core/logic/parse-review-command-args.logic.d.ts +3 -3
  212. package/dist/cli/cmd/review/_core/logic/resolve-review-intent.logic.d.ts +3 -3
  213. package/dist/cli/cmd/review/_core/logic/run-review-command.logic.d.ts +3 -3
  214. package/dist/cli/cmd/review/_core/types/review-artifact.type.d.ts +4 -1
  215. package/dist/cli/cmd/review/_core/types/review-command-args.type.d.ts +7 -1
  216. package/dist/cli/cmd/review/_core/types/review-command-mode.type.d.ts +1 -1
  217. package/dist/cli/cmd/review/_core/types/review-command-options.type.d.ts +3 -1
  218. package/dist/cli/cmd/review/_core/types/review-command-result.type.d.ts +5 -1
  219. package/dist/cli/cmd/review/_core/types/review-context-git.type.d.ts +3 -1
  220. package/dist/cli/cmd/review/_core/types/review-context-mr.type.d.ts +22 -3
  221. package/dist/cli/cmd/review/_core/types/review-context-vcs.type.d.ts +4 -1
  222. package/dist/cli/cmd/review/_core/types/review-intent.type.d.ts +1 -1
  223. package/dist/cli/cmd/review/_core/xml/build-review-artifact.xml.d.ts +10 -10
  224. package/dist/cli/cmd/review/_core/xml/render-review-issues.xml.d.ts +3 -3
  225. package/dist/cli/cmd/review/_core/xml/render-review-verify.xml.d.ts +4 -4
  226. package/dist/cli/cmd/sync/index.d.ts +1 -0
  227. package/dist/cli/cmd/sync/sync-core.d.ts +65 -0
  228. package/dist/cli/cmd/sync/sync-formatter.d.ts +12 -0
  229. package/dist/cli/cmd/sync/sync.cmd.d.ts +33 -0
  230. package/dist/cli/cmd/sync/sync.types.d.ts +50 -0
  231. package/dist/cli/cmd/vcs-reply/vcs-reply.cmd.d.ts +4 -4
  232. package/dist/cli/utils/ai-legacy/ai-legacy-agent.d.ts +12 -11
  233. package/dist/cli/utils/ai-legacy/ai-legacy-core.d.ts +33 -17
  234. package/dist/cli/utils/ai-legacy/ai-legacy-model.d.ts +42 -23
  235. package/dist/cli/utils/cat-gen/cat-gen.d.ts +19 -8
  236. package/dist/cli/utils/commit-gen/commit-gen.d.ts +39 -15
  237. package/dist/cli/utils/prompts/index.d.ts +6 -6
  238. package/dist/cli/utils/review-gen/review-gen.d.ts +33 -9
  239. package/dist/gennady.js +30 -10
  240. package/dist/index.d.ts +1 -0
  241. package/dist/index.js +44 -23
  242. package/dist/services/agent-mon/diff/diff.d.ts +9 -0
  243. package/dist/services/agent-mon/diff/index.d.ts +1 -0
  244. package/dist/services/agent-mon/index.d.ts +10 -0
  245. package/dist/services/agent-mon/model/agent-provider.type.d.ts +20 -0
  246. package/dist/services/agent-mon/model/agent-session.type.d.ts +49 -0
  247. package/dist/services/agent-mon/model/errors.d.ts +20 -0
  248. package/dist/services/agent-mon/model/index.d.ts +7 -0
  249. package/dist/services/agent-mon/model/observe-opts.type.d.ts +7 -0
  250. package/dist/services/agent-mon/model/scan-opts.type.d.ts +7 -0
  251. package/dist/services/agent-mon/model/session-changes.type.d.ts +10 -0
  252. package/dist/services/agent-mon/monitor/agent-monitor.d.ts +44 -0
  253. package/dist/services/agent-mon/monitor/create-monitor.d.ts +6 -0
  254. package/dist/services/agent-mon/monitor/index.d.ts +2 -0
  255. package/dist/services/agent-mon/observe/index.d.ts +1 -0
  256. package/dist/services/agent-mon/observe/observe.d.ts +12 -0
  257. package/dist/services/agent-mon/providers/claude/claude-provider.d.ts +50 -0
  258. package/dist/services/agent-mon/providers/claude/index.d.ts +5 -0
  259. package/dist/services/agent-mon/providers/claude/ps.d.ts +36 -0
  260. package/dist/services/agent-mon/providers/claude/session-json.d.ts +37 -0
  261. package/dist/services/agent-mon/providers/opencode/db.d.ts +41 -0
  262. package/dist/services/agent-mon/providers/opencode/index.d.ts +3 -0
  263. package/dist/services/agent-mon/providers/opencode/model-parser.d.ts +6 -0
  264. package/dist/services/agent-mon/providers/opencode/opencode-provider.d.ts +45 -0
  265. package/dist/services/ai-client/providers/ai-model.type.d.ts +14 -0
  266. package/dist/services/ai-client/providers/open-router/open-router-model.type.d.ts +1 -4
  267. package/dist/services/ai-client/providers/open-router/open-router-provider.d.ts +17 -0
  268. package/dist/services/ai-client/providers/openai-like-provider.d.ts +1 -0
  269. package/dist/services/data-ore/telegram/telegram-data-ore.d.ts +17 -0
  270. package/dist/services/data-ore/telegram/telegram-data-ore.types.d.ts +4 -0
  271. package/dist/services/data-ore/telegram/telegram-demo-music-helper.d.ts +1 -0
  272. package/dist/services/data-ore/telegram/telegram-demo.d.ts +1 -0
  273. package/dist/services/dbc/linter/dbc-ast-adapter.types.d.ts +82 -0
  274. package/dist/services/dbc/linter/dbc-linter.types.d.ts +95 -0
  275. package/dist/services/dbc/linter/implementations/ts/dbc-ts-ast-adapter.d.ts +183 -0
  276. package/dist/services/dbc/linter/implementations/ts/dbc-ts-linter.d.ts +152 -0
  277. package/dist/services/dbc/parser/dbc-parser.types.d.ts +16 -16
  278. package/dist/services/dbc/parser/implementations/jsdoc/dbc-jsdoc-parser.d.ts +14 -4
  279. package/dist/services/logger/logger.d.ts +26 -6
  280. package/dist/services/remote-console/client/remote-console-client-serializer.d.ts +7 -0
  281. package/dist/services/remote-console/client/remote-console-client.d.ts +20 -0
  282. package/dist/services/remote-console/client/remote-console-client.types.d.ts +88 -0
  283. package/dist/services/remote-console/remote-console.d.ts +6 -0
  284. package/dist/services/remote-console/server/remote-console-server.d.ts +10 -0
  285. package/dist/services/remote-console/server/remote-console-server.types.d.ts +44 -0
  286. package/dist/services/remote-console/server/remote-console-stdout-writer.d.ts +26 -0
  287. package/dist/services/vcs-client/abstract/vcs-client-merge-discussions.d.ts +22 -14
  288. package/dist/services/vcs-client/abstract/vcs-client-merge-requests.d.ts +31 -14
  289. package/dist/services/vcs-client/abstract/vcs-client-repository-files.d.ts +16 -0
  290. package/dist/services/vcs-client/abstract/vcs-client.d.ts +9 -5
  291. package/dist/services/vcs-client/entities/vcs-file-content.type.d.ts +24 -0
  292. package/dist/services/vcs-client/entities/vcs-merge-request-changes.type.d.ts +32 -0
  293. package/dist/services/vcs-client/entities/vcs-url.type.d.ts +14 -0
  294. package/dist/services/vcs-client/entities/vcs-user.type.d.ts +3 -0
  295. package/dist/services/vcs-client/github/vcs-github-client.d.ts +31 -0
  296. package/dist/services/vcs-client/github/vcs-github-merge-requests.d.ts +40 -0
  297. package/dist/services/vcs-client/github/vcs-github-repository-files.d.ts +27 -0
  298. package/dist/services/vcs-client/gitlab/vcs-gitlab-client.d.ts +13 -4
  299. package/dist/services/vcs-client/gitlab/vcs-gitlab-merge-discussions.d.ts +16 -5
  300. package/dist/services/vcs-client/gitlab/vcs-gitlab-merge-requests.d.ts +24 -5
  301. package/dist/services/vcs-client/gitlab/vcs-gitlab-repository-files.d.ts +27 -0
  302. package/dist/services/vcs-client/parse-vcs-url.d.ts +3 -0
  303. package/dist/shared/backend/git/git-core.d.ts +24 -22
  304. package/dist/shared/backend/git/git-diff.d.ts +16 -5
  305. package/dist/shared/backend/rc/rc-config.d.ts +27 -15
  306. package/dist/shared/common/exec.d.ts +4 -6
  307. package/dist/shared/common/files.d.ts +1 -3
  308. package/dist/shared/common/language.d.ts +3 -6
  309. package/dist/shared/common/parse-args.d.ts +1 -4
  310. package/dist/shared/common/style.d.ts +3 -3
  311. package/dist/shared/common/think.d.ts +1 -5
  312. package/dist/shared/common/tokens.d.ts +1 -5
  313. package/dist/shared/common/unguard.d.ts +4 -8
  314. package/dist/shared/common/xml.d.ts +16 -12
  315. package/package.json +20 -4
  316. package/dist/.ai/agents/agent-review-verifier.xml +0 -181
  317. package/dist/chunks/index-CNbmXK8M.js +0 -3548
  318. package/dist/chunks/services-Sb7TwLxt.js +0 -122
  319. package/dist/chunks/shared-BgLzFWMH.js +0 -577
@@ -0,0 +1,326 @@
1
+ <VitestRules keywords="vitest, runner, vi_mock, vi_fn, fake_timers, stub_env, vitest_run_not_watch, mock_confirm_gate, explicit_imports" type="testing-rules" ver="3.0">
2
+ <Mission>
3
+ Vitest runner (`vitest`) specifics on top of [`testing/common`](./common.xml). Only the deltas are stated here: one-shot vs watch invocation, `vi`-matcher API, `vi.mock` confirm-gate, mock hygiene, fake timers / env / global lifecycle, explicit imports, default isolation.
4
+
5
+ Read `testing/common.xml` first. Everything about contract boundary, case flow, phase anchors, unified context, factory-over-hooks, BDD mapping, snapshot operator-confirm, file budget — lives there.
6
+ </Mission>
7
+
8
+ <Inherited_Baseline>
9
+ All axioms in [`testing/common`](./common.xml) `Belief_State` apply here UNCHANGED — reader-agent treats them as binding under this directive. `BDD_Mapping_Hint`, `Definitions`, `Workflow_Outline` likewise inherited. This file only adds Vitest-specific overrides and patterns. Mechanical assertion-API substitutions when the inherited text mentions node:test assertions: `assert.throws()` → `expect(fn).toThrow(...)`; `assert.rejects()` → `await expect(promise).rejects.toThrow(...)`; `assert.match()` → `expect(str).toMatch(regex)`.
10
+ </Inherited_Baseline>
11
+
12
+ <Belief_State>
13
+
14
+ <Axiom id="AX_VITEST_RUN_NOT_WATCH">
15
+ **Primary `test` script MUST invoke `vitest run` (one-shot), never bare `vitest` (defaults to watch in TTY).**
16
+
17
+ ```json
18
+ "test": "vitest run", // ✅ one-shot, exits 0/1
19
+ "test:watch": "vitest", // ✅ explicit watch (human dev)
20
+ "test:coverage": "vitest run --coverage" // ✅ one-shot with coverage
21
+ ```
22
+ ```json
23
+ "test": "vitest" // ❌ defaults to watch in TTY → agent hangs
24
+ "test": "vitest --watch" // ❌ explicit watch
25
+ ```
26
+
27
+ AI agents and CI runners invoke `npm test` and wait for exit. Bare `vitest` in TTY enters interactive watch mode, streams forever, never exits → the session hangs with no way to distinguish «still running» from «ready, waiting for changes». Top cause of stuck infrastructure-setup tickets — see `nodejs-npm-rules.xml#AX_AI_FIRST_SCRIPTS_ONE_SHOT`.
28
+ </Axiom>
29
+
30
+ <Axiom id="AX_VITEST_ASSERT_API_CHOICE">
31
+ Pick the simplest direct matcher by shape:
32
+ - `expect(x).toBe(y)` — scalars and reference identity (NOT for structural equality).
33
+ - `expect(x).toEqual(y)` — deep structural equality; ignores `undefined` properties on the actual side.
34
+ - `expect(x).toStrictEqual(y)` — deep equality including `undefined`, prototype, sparse arrays. Prefer over `toEqual` when contract distinguishes «absent» from `undefined`.
35
+ - `expect(fn).toThrow(...)` / `await expect(promise).rejects.toThrow(...)` — thrown failures.
36
+ - `expect(str).toMatch(regex)` — partial string / error-message checks (inherited `AX_PARTIAL_STRING_VIA_MATCH`).
37
+ - `expect(x).toMatchInlineSnapshot(...)` — only under inherited `AX_SNAPSHOT_USAGE_GATE`.
38
+
39
+ Forbidden idioms: `toContain` on `error.message` (use `toMatch`); `toBeTruthy` / `toBeFalsy` to fold a structured assertion into a boolean (use the structured form); `try/catch + expect.fail` instead of `rejects.toThrow`.
40
+ </Axiom>
41
+
42
+ <Axiom id="AX_MOCK_REQUIRES_OPERATOR_CONFIRM">
43
+ Introducing a NEW `vi.mock(...)` or `vi.hoisted(...)` call in a test file is a gated action. Execution-agent MUST stop before introducing such a mock and request explicit operator confirmation in chat, presenting:
44
+ - module being mocked,
45
+ - why dependency injection cannot be used here (per inherited `AX_MOCK_AS_LAST_RESORT`),
46
+ - what observable contract the mock preserves.
47
+
48
+ Re-using an existing project-level mock helper does NOT require a new confirmation. `vi.mock` is the single biggest lever for fabricating green tests; confirm-gate makes that fabrication visible.
49
+ </Axiom>
50
+
51
+ <Axiom id="AX_PREFER_VI_FN_FOR_INTERACTION">
52
+ For tracking call interactions on injected collaborators use `vi.fn()` directly. `vi.spyOn(target, 'method')` allowed when the SUT receives a real object (not an injection seam) and a specific method must be observed without replacing the rest. Even then prefer refactoring to an injection seam. `vi.fn()` on an injected port is the cleanest interaction surface.
53
+ </Axiom>
54
+
55
+ <Axiom id="AX_HTTP_BOUNDARY_INJECTION">
56
+ Default way to test HTTP-touching code is to inject the HTTP client (or a typed `request` port) into the SUT and stub it with `vi.fn()`. Direct `globalThis.fetch` replacement, `vi.mock('node:http')`, full module mocks of HTTP libraries are last-resort and gated by `AX_MOCK_REQUIRES_OPERATOR_CONFIRM`.
57
+
58
+ If the project already standardizes on a network-mocking harness (e.g., MSW, in-house helper), reuse it consistently — do NOT introduce a parallel mocking path. Choosing a network-mocking library is an architecture decision, not a per-test decision.
59
+ </Axiom>
60
+
61
+ <Axiom id="AX_MOCK_HYGIENE">
62
+ Mocks used → lifecycle hygiene mandatory. Either set in `vitest.config`: `clearMocks: true`, plus `unstubEnvs: true` / `unstubGlobals: true` when stubs are used, OR call `vi.clearAllMocks()` in `afterEach`.
63
+
64
+ Reset granularity:
65
+ - `vi.clearAllMocks()` — clear call history; keep implementations.
66
+ - `vi.resetAllMocks()` — clear history AND reset implementations to empty `vi.fn()`.
67
+ - `vi.restoreAllMocks()` — restore originals of `vi.spyOn`-created spies.
68
+ - `vi.unstubAllEnvs()` / `vi.unstubAllGlobals()` — pair every `stubEnv` / `stubGlobal` with these in `afterEach`.
69
+
70
+ Without disciplined reset, mock state leaks across cases and creates order-dependent flicker.
71
+ </Axiom>
72
+
73
+ <Axiom id="AX_TIME_ENV_GLOBAL_LIFECYCLE">
74
+ State-mutating Vitest helpers MUST be paired with their teardown:
75
+ - `vi.useFakeTimers()` ↔ `vi.useRealTimers()` (use `vi.setSystemTime(date)` for clock).
76
+ - `vi.stubEnv(...)` ↔ `vi.unstubAllEnvs()` (or `unstubEnvs: true`).
77
+ - `vi.stubGlobal(...)` ↔ `vi.unstubAllGlobals()` (or `unstubGlobals: true`).
78
+
79
+ Forbidden: enabling any of these inside a single case without restoring — leaks into every later case in the same file. Classic source of order-dependent flicker that looks random.
80
+ </Axiom>
81
+
82
+ <Axiom id="AX_EXPLICIT_VITEST_IMPORTS">
83
+ Import every Vitest API explicitly from `vitest` (`describe`, `it`, `expect`, `vi`, `beforeEach`, `afterEach`, `beforeAll`, `afterAll`). Do NOT rely on `globals: true` in `vitest.config`. Explicit imports make the file self-describing for humans, TypeScript, ESLint, and agent grep.
84
+ </Axiom>
85
+
86
+ <Axiom id="AX_VITEST_ISOLATION_DEFAULT">
87
+ Vitest's default `isolate: true` is preserved. Do NOT weaken isolation in `vitest.config` without an architectural justification recorded in the project. Disabling isolation trades determinism for speed and re-introduces inter-test leakage.
88
+ </Axiom>
89
+
90
+ </Belief_State>
91
+
92
+ <Test_Patterns>
93
+ <Pattern id="PT_UNIFIED_FACTORY_CONTEXT">
94
+ <Intent>Default shape per inherited `AX_ONE_UNIFIED_CONTEXT_PER_FILE` + `AX_PREFER_FACTORY_OVER_HOOKS`: ONE context type + ONE factory for the whole file. Two cases differ only by factory overrides, not by structure.</Intent>
95
+ <Snippet language="typescript">
96
+ ```typescript
97
+ import { describe, it, expect, vi } from 'vitest';
98
+ import { OrderLifecycle } from './order-lifecycle.ts';
99
+ import type { OrderRepository, EventBus } from './ports.ts';
100
+
101
+ type OrderLifecycleContext = {
102
+ sut: OrderLifecycle;
103
+ saveOrder: ReturnType<typeof vi.fn<OrderRepository['saveOrder']>>;
104
+ publish: ReturnType<typeof vi.fn<EventBus['publish']>>;
105
+ };
106
+
107
+ function createOrderLifecycleContext(
108
+ overrides: Partial<{
109
+ saveOrder: OrderRepository['saveOrder'];
110
+ publish: EventBus['publish'];
111
+ }> = {},
112
+ ): OrderLifecycleContext {
113
+ const saveOrder = vi.fn(overrides.saveOrder ?? (async () => {}));
114
+ const publish = vi.fn(overrides.publish ?? (() => {}));
115
+ const sut = new OrderLifecycle({ saveOrder, publish });
116
+ return { sut, saveOrder, publish };
117
+ }
118
+
119
+ describe('OrderLifecycle#settleCharge', () => {
120
+ it('should persist order in PAID state and publish settled event', async () => {
121
+ // observation focus: persistence args + event payload, not pipeline internals
122
+ const { sut, saveOrder, publish } = createOrderLifecycleContext();
123
+
124
+ await sut.settleCharge('ord-1');
125
+
126
+ // #region START_SETTLE_CHARGE_ASSERT_INTERACTIONS
127
+ expect(saveOrder).toHaveBeenCalledWith({ id: 'ord-1', state: 'PAID' });
128
+ expect(publish).toHaveBeenCalledWith({
129
+ type: 'order.settled',
130
+ detail: { orderId: 'ord-1' },
131
+ });
132
+ // #endregion END_SETTLE_CHARGE_ASSERT_INTERACTIONS
133
+ });
134
+
135
+ it('should not publish when persistence rejects', async () => {
136
+ // contract: settled event is emitted ONLY after successful persistence
137
+ // failure mode: a leaked event after a failed write would corrupt downstream consumers
138
+ const { sut, publish } = createOrderLifecycleContext({
139
+ saveOrder: async () => { throw new Error('db down'); },
140
+ });
141
+
142
+ await expect(sut.settleCharge('ord-1')).rejects.toThrow(/db down/);
143
+ expect(publish).not.toHaveBeenCalled();
144
+ });
145
+ });
146
+ ```
147
+ </Snippet>
148
+ <Why>One context type, one factory; failure case overrides exactly one field and reuses everything else. No describe-scope `let`s; stubs flow through injection seams; no module-level mocks. One-line SETUP and TRIGGER → no anchors; multi-line ASSERT → anchored.</Why>
149
+ </Pattern>
150
+
151
+ <Pattern id="PT_LIFECYCLE_CONTEXT_WITH_CLEANUP">
152
+ <Intent>Justified hook usage: SUT requires teardown-bound setup (fake timers + env stub). A SINGLE lifecycle context object built in `beforeEach` and disposed in `afterEach`; cases consume fields off that context per inherited `AX_HOOKS_ONLY_FOR_LIFECYCLE` + `AX_NO_DESCRIBE_LET_PILEUP`.</Intent>
153
+ <Snippet language="typescript">
154
+ ```typescript
155
+ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
156
+ import { ScheduleRunner } from './schedule-runner.ts';
157
+
158
+ type ScheduleRunnerContext = {
159
+ sut: ScheduleRunner;
160
+ tick: (ms: number) => Promise<void>;
161
+ };
162
+
163
+ describe('ScheduleRunner#runDueJobs', () => {
164
+ let ctx: ScheduleRunnerContext;
165
+
166
+ beforeEach(() => {
167
+ vi.useFakeTimers();
168
+ vi.setSystemTime(new Date('2026-01-01T00:00:00Z'));
169
+ vi.stubEnv('SCHEDULE_TICK_MS', '1000');
170
+
171
+ const sut = new ScheduleRunner();
172
+ ctx = { sut, tick: (ms) => vi.advanceTimersByTimeAsync(ms) };
173
+ });
174
+
175
+ afterEach(() => {
176
+ vi.useRealTimers();
177
+ vi.unstubAllEnvs();
178
+ });
179
+
180
+ it('should fire a single job exactly once at its due time', async () => {
181
+ // contract: a job scheduled at t+1000ms fires once at t+1000ms, not before, not twice
182
+ const onFire = vi.fn();
183
+ ctx.sut.schedule({ id: 'j1', dueAt: 1000, run: onFire });
184
+
185
+ // #region START_DUE_JOBS_TRIGGER_TICK
186
+ await ctx.tick(999);
187
+ expect(onFire).not.toHaveBeenCalled();
188
+ await ctx.tick(1);
189
+ // #endregion END_DUE_JOBS_TRIGGER_TICK
190
+
191
+ expect(onFire).toHaveBeenCalledTimes(1);
192
+ });
193
+ });
194
+ ```
195
+ </Snippet>
196
+ <Why>Fake timers and env stubs are teardown-bound — cannot be cleaned by a factory return value. The describe holds exactly ONE `let ctx`, not a pile of `let sut, let tick, let env`. Multi-step TRIGGER (boundary observation between ticks) → anchored.</Why>
197
+ </Pattern>
198
+
199
+ <Pattern id="PT_DI_OVER_MOCK">
200
+ <Intent>Preferred posture: SUT designed with injection seams is exercised against real `vi.fn()` stubs. No `vi.mock`, no operator confirm-gate triggered, no global patching — yet the test is fully isolated from the network.</Intent>
201
+ <Snippet language="typescript">
202
+ ```typescript
203
+ import { describe, it, expect, vi } from 'vitest';
204
+ import { CatalogSync } from './catalog-sync.ts';
205
+ import type { HttpRequest, CatalogStore } from './ports.ts';
206
+
207
+ type CatalogSyncContext = {
208
+ sut: CatalogSync;
209
+ httpRequest: ReturnType<typeof vi.fn<HttpRequest>>;
210
+ store: CatalogStore;
211
+ };
212
+
213
+ function createCatalogSyncContext(
214
+ overrides: Partial<{
215
+ response: Awaited<ReturnType<HttpRequest>>;
216
+ store: CatalogStore;
217
+ }> = {},
218
+ ): CatalogSyncContext {
219
+ const httpRequest = vi.fn<HttpRequest>(async () =>
220
+ overrides.response ?? { status: 200, body: { items: [] } },
221
+ );
222
+ const store = overrides.store ?? { replaceAll: vi.fn(async () => {}) };
223
+ const sut = new CatalogSync({ httpRequest, store });
224
+ return { sut, httpRequest, store };
225
+ }
226
+
227
+ describe('CatalogSync#pull', () => {
228
+ it('should request the catalog endpoint and replace the store with normalized items', async () => {
229
+ // observation focus: the URL pulled + the items written, not transport internals
230
+ const { sut, httpRequest, store } = createCatalogSyncContext({
231
+ response: {
232
+ status: 200,
233
+ body: { items: [{ id: '1', title: 'Keyboard ', stock: 3 }] },
234
+ },
235
+ });
236
+
237
+ await sut.pull();
238
+
239
+ // #region START_PULL_ASSERT_BOUNDARY
240
+ expect(httpRequest).toHaveBeenCalledWith({ method: 'GET', url: '/v1/catalog' });
241
+ expect(store.replaceAll).toHaveBeenCalledWith([
242
+ { id: '1', title: 'Keyboard', stock: 3 },
243
+ ]);
244
+ // #endregion END_PULL_ASSERT_BOUNDARY
245
+ });
246
+ });
247
+ ```
248
+ </Snippet>
249
+ <Why>No `vi.mock`, no `vi.spyOn`, no `globalThis.fetch` patching: SUT exposes injection seams (`httpRequest`, `store`) and the test passes typed `vi.fn()`s through them. Unified factory reused; case differs only by `response` override.</Why>
250
+ </Pattern>
251
+ </Test_Patterns>
252
+
253
+ <Anti_Patterns>
254
+ <Anti_Pattern id="AP_BEFORE_EACH_LET_PILEUP">
255
+ <Bad>Describe scope hosts `let sut, saveOrder, publish, order, now`; `beforeEach` assigns them; second case re-assigns shared `sut` to a different config (leaks state).</Bad>
256
+ <Why_Bad>Pile of `let`-variables (inherited `AX_NO_DESCRIBE_LET_PILEUP`). Per-case data built in `beforeEach` without teardown reason (inherited `AX_HOOKS_ONLY_FOR_LIFECYCLE` + `AX_PREFER_FACTORY_OVER_HOOKS`). No unified context type/factory (inherited `AX_ONE_UNIFIED_CONTEXT_PER_FILE`).</Why_Bad>
257
+ <Good>ONE context type + ONE `createOrderLifecycleContext(overrides)` factory used by every case. Each case destructures the fields it uses; failure case overrides one field. No `beforeEach`, no shared `let`s.</Good>
258
+ </Anti_Pattern>
259
+
260
+ <Anti_Pattern id="AP_PARALLEL_FACTORIES">
261
+ <Bad>One file declares `createOrderContextHappy()`, `createOrderContextWithDiscount()`, `createOrderContextFailing()`.</Bad>
262
+ <Why_Bad>Three parallel factories for one SUT (inherited `AX_ONE_UNIFIED_CONTEXT_PER_FILE`). Each drifts independently; structural changes in `OrderLifecycle` require N edits, not one. Reader-agent must learn three shapes instead of one + a set of overrides.</Why_Bad>
263
+ <Good>Single `createOrderLifecycleContext(overrides)` factory; happy / discount / failure cases pass different overrides through the same factory.</Good>
264
+ </Anti_Pattern>
265
+
266
+ <Anti_Pattern id="AP_UNJUSTIFIED_VI_MOCK">
267
+ <Bad>`vi.mock('./http-client.ts', () => ({ httpClient: { get: vi.fn(...) } }))` for an in-process module; SUT instantiated as `new CatalogSync()` without injection.</Bad>
268
+ <Why_Bad>`vi.mock` introduced without operator confirm and without justification (`AX_MOCK_REQUIRES_OPERATOR_CONFIRM`, inherited `AX_MOCK_AS_LAST_RESORT`). `httpClient` is in-process — the SUT could have accepted it as a constructor argument (`AX_HTTP_BOUNDARY_INJECTION`).</Why_Bad>
269
+ <Good>SUT exposes injection seam: `class CatalogSync { constructor(deps: { httpRequest: HttpRequest }) {} }`. Test uses unified factory + `vi.fn()` stub through the seam (see `PT_DI_OVER_MOCK`).</Good>
270
+ </Anti_Pattern>
271
+
272
+ <Anti_Pattern id="AP_LEAKED_LIFECYCLE_AND_GLOBAL_RELIANCE">
273
+ <Bad>Test file has no imports (relies on `globals: true`). Inside a case: `vi.useFakeTimers(); vi.setSystemTime(...); vi.stubEnv('TICK', '1000');` without paired teardown.</Bad>
274
+ <Why_Bad>Reliance on `globals: true` (`AX_EXPLICIT_VITEST_IMPORTS`). Fake timers and env stubs without paired teardown (`AX_TIME_ENV_GLOBAL_LIFECYCLE`). State leaks into subsequent cases → order-dependent flicker.</Why_Bad>
275
+ <Good>Explicit imports; `beforeEach` enables fake timers + env stubs; `afterEach` calls `vi.useRealTimers()` + `vi.unstubAllEnvs()` (see `PT_LIFECYCLE_CONTEXT_WITH_CLEANUP`).</Good>
276
+ </Anti_Pattern>
277
+
278
+ <Anti_Pattern id="AP_CONTAINS_ON_ERROR_AND_PRIVATE_INSPECTION">
279
+ <Bad>`try { await client.reserveStock(''); expect.fail('should have thrown'); } catch (e) { expect((e as Error).message).toContain('idempotency'); }` AND inspecting `client._inflightCount` with `@ts-expect-error`.</Bad>
280
+ <Why_Bad>Manual `try/catch + expect.fail` instead of `rejects.toThrow` (`AX_VITEST_ASSERT_API_CHOICE`). `toContain` on `error.message` (inherited `AX_PARTIAL_STRING_VIA_MATCH`). Inspecting protected internal field (inherited `AX_CONTRACT_OVER_IMPLEMENTATION`).</Why_Bad>
281
+ <Good>`await expect(client.reserveStock('')).rejects.toThrow(/idempotency.*empty|empty.*idempotency/i);` and subscribe to public lifecycle event for observation.</Good>
282
+ </Anti_Pattern>
283
+ </Anti_Patterns>
284
+
285
+ <Verification_Hooks>
286
+ <Hook id="HOOK_RUN_TESTS">
287
+ <Command>npx vitest run</Command>
288
+ <Expected>Exit 0; no `.only` / `.skip` / `.todo` without a deferred-ownership reference.</Expected>
289
+ </Hook>
290
+ <Hook id="HOOK_RUN_SINGLE_FILE">
291
+ <Command>npx vitest run path/to/subject.test.ts</Command>
292
+ <Expected>Exit 0; targeted file passes.</Expected>
293
+ </Hook>
294
+ <Hook id="HOOK_COVERAGE">
295
+ <Command>npx vitest run --coverage</Command>
296
+ <Expected>Exit 0; ≥1 happy + ≥1 boundary (when applicable) + ≥1 failure-path per public method (inherited `AX_COVERAGE_BY_CONTRACT_NOT_BY_LINE`). Blockers declared EXPLICITLY.</Expected>
297
+ </Hook>
298
+ <Hook id="HOOK_TYPECHECK_BEFORE_TEST">
299
+ <Command>npx tsc --noEmit</Command>
300
+ <Expected>Exit 0.</Expected>
301
+ </Hook>
302
+ <Hook id="HOOK_FILE_SIZE_BUDGET">
303
+ <Purpose>Flag test files exceeding inherited `AX_TEST_FILE_SIZE_BUDGET` thresholds.</Purpose>
304
+ <Command>find . -name '*.test.ts' -not -path '*/node_modules/*' -exec sh -c 'lines=$(grep -cvE "^\s*(//|/\*|\*|$)" "$1"); [ "$lines" -gt 300 ] && echo "$lines $1"' _ {} \; | sort -n</Command>
305
+ <Expected>No test file exceeds 500 code-LOC. Files over 300 carry a tracked split task or explicit justification.</Expected>
306
+ </Hook>
307
+ <Hook id="HOOK_NO_FORBIDDEN_TEST_PATTERNS">
308
+ <Command>rg --no-heading -n "\b(it|describe)\.(only|skip|todo)\b|Step \d|\.message\)?\.toContain\(|expect\.fail\(" -t ts --glob '**/*.test.ts'</Command>
309
+ <Expected>Empty on new/changed test files (or matches carry explicit deferred-ownership reference).</Expected>
310
+ </Hook>
311
+ <Hook id="HOOK_NO_UNJUSTIFIED_VI_MOCK">
312
+ <Purpose>Every `vi.mock(` / `vi.hoisted(` MUST be paired with a justification comment within 3 lines.</Purpose>
313
+ <Command>rg --no-heading -n -B1 -A2 "vi\.(mock|hoisted)\(" -t ts --glob '**/*.test.ts'</Command>
314
+ <Expected>Each match has an immediate-neighbor comment naming the dependency and reason injection is unavailable.</Expected>
315
+ </Hook>
316
+ <Hook id="HOOK_NO_AUTO_SNAPSHOT_UPDATE">
317
+ <Purpose>Verify the agent did NOT run snapshot updates autonomously (inherited `AX_SNAPSHOT_OPERATOR_CONFIRM`).</Purpose>
318
+ <Command>git diff --name-only -- '**/__snapshots__/*.snap' '**/*.test.ts'</Command>
319
+ <Expected>Snapshot diffs presented to operator BEFORE commit; no `vitest --update` / `vitest -u` in agent's command history.</Expected>
320
+ </Hook>
321
+ <Hook id="HOOK_PARALLEL_FACTORIES_GUARD">
322
+ <Command>rg --no-heading -nU "function create\w+Context" -t ts --glob '**/*.test.ts' | awk -F: '{c[$1]++} END {for (f in c) if (c[f] > 1) print c[f], f}'</Command>
323
+ <Expected>No file declares more than one `createXxxContext` factory.</Expected>
324
+ </Hook>
325
+ </Verification_Hooks>
326
+ </VitestRules>
@@ -0,0 +1,17 @@
1
+ # Индекс
2
+
3
+ ### 🧠 [ai-promting.md](./ai-promting.md)
4
+
5
+ Руководство по **prompt architecture для программиста**: как собирать prompt из **goal, context, belief state, reward criteria, golden examples, verification loops и output contract**. Объясняет, что подтверждается исследованиями напрямую, что опирается на косвенную базу, а что остается инженерной эвристикой.
6
+
7
+ ### 🧱 [ai-prompt-formats.md](./ai-prompt-formats.md)
8
+
9
+ Руководство по **форматам prompt engineering**: где работает **Markdown**, почему длинные протоколы лучше собирать как **XML-like layout**, почему **YAML** плох как default для prompt-control, и почему **JSON** нужно использовать прежде всего для **output-schema и state data**, а не как основной язык постановки задачи.
10
+
11
+ ### 🎯 [ai-icl.md](./ai-icl.md)
12
+
13
+ Исследование **In-Context Learning (ICL)**: от **Few-Shot к Many-Shot**, **архитектура примеров**, проблемы **порядка и смещения**, **синтетический и негативный ICL**. Описывает техники **обучения моделей на примерах в контексте без изменения весов**.
14
+
15
+ ### ⚡ [ai-priming.md](./ai-priming.md)
16
+
17
+ Руководство по **продвинутому праймингу и латентному управлению**: **семантическая, структурная, когнитивная, рекурсивная и заместительная** техники прайминга для настройки поведения LLM через **активацию специфических векторов и паттернов внимания**.