rhachet-roles-bhrain 0.3.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/dist/access/sdk/sdkOpenAi.d.ts +25 -0
  2. package/dist/access/sdk/sdkOpenAi.js +122 -0
  3. package/dist/access/sdk/sdkOpenAi.js.map +1 -1
  4. package/dist/access/sdks/anthropic/sdkAnthropic.d.ts +31 -0
  5. package/dist/access/sdks/anthropic/sdkAnthropic.js +151 -0
  6. package/dist/access/sdks/anthropic/sdkAnthropic.js.map +1 -0
  7. package/dist/access/sdks/qwen/sdkQwen.d.ts +31 -0
  8. package/dist/access/sdks/qwen/sdkQwen.js +134 -0
  9. package/dist/access/sdks/qwen/sdkQwen.js.map +1 -0
  10. package/dist/domain.objects/BrainArch1/BrainArch1Actor.d.ts +67 -0
  11. package/dist/domain.objects/BrainArch1/BrainArch1Actor.js +12 -0
  12. package/dist/domain.objects/BrainArch1/BrainArch1Actor.js.map +1 -0
  13. package/dist/domain.objects/BrainArch1/BrainArch1Atom.d.ts +40 -0
  14. package/dist/domain.objects/BrainArch1/BrainArch1Atom.js +3 -0
  15. package/dist/domain.objects/BrainArch1/BrainArch1Atom.js.map +1 -0
  16. package/dist/domain.objects/BrainArch1/BrainArch1Context.d.ts +30 -0
  17. package/dist/domain.objects/BrainArch1/BrainArch1Context.js +3 -0
  18. package/dist/domain.objects/BrainArch1/BrainArch1Context.js.map +1 -0
  19. package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.d.ts +34 -0
  20. package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.js +8 -0
  21. package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.js.map +1 -0
  22. package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.d.ts +23 -0
  23. package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.js +9 -0
  24. package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.js.map +1 -0
  25. package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.d.ts +49 -0
  26. package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.js +8 -0
  27. package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.js.map +1 -0
  28. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.d.ts +31 -0
  29. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.js +9 -0
  30. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.js.map +1 -0
  31. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.d.ts +27 -0
  32. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.js +8 -0
  33. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.js.map +1 -0
  34. package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.d.ts +45 -0
  35. package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.js +3 -0
  36. package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.js.map +1 -0
  37. package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.d.ts +29 -0
  38. package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.js +8 -0
  39. package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.js.map +1 -0
  40. package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.d.ts +22 -0
  41. package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.js +8 -0
  42. package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.js.map +1 -0
  43. package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.d.ts +30 -0
  44. package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.js +3 -0
  45. package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.js.map +1 -0
  46. package/dist/domain.objects/BrainArch1/BrainArch1Session.d.ts +47 -0
  47. package/dist/domain.objects/BrainArch1/BrainArch1Session.js +17 -0
  48. package/dist/domain.objects/BrainArch1/BrainArch1Session.js.map +1 -0
  49. package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.d.ts +34 -0
  50. package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.js +12 -0
  51. package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.js.map +1 -0
  52. package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.d.ts +21 -0
  53. package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.js +8 -0
  54. package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.js.map +1 -0
  55. package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.d.ts +54 -0
  56. package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.js +20 -0
  57. package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.js.map +1 -0
  58. package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.d.ts +36 -0
  59. package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.js +9 -0
  60. package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.js.map +1 -0
  61. package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.d.ts +25 -0
  62. package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.js +8 -0
  63. package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.js.map +1 -0
  64. package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.d.ts +31 -0
  65. package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.js +3 -0
  66. package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.js.map +1 -0
  67. package/dist/domain.objects/Reviewer/ReviewerReflectManifest.d.ts +44 -0
  68. package/dist/domain.objects/Reviewer/ReviewerReflectManifest.js +8 -0
  69. package/dist/domain.objects/Reviewer/ReviewerReflectManifest.js.map +1 -0
  70. package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.d.ts +30 -0
  71. package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.js +35 -0
  72. package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.js.map +1 -0
  73. package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.d.ts +89 -0
  74. package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.js +8 -0
  75. package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.js.map +1 -0
  76. package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.d.ts +43 -0
  77. package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.js +8 -0
  78. package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.js.map +1 -0
  79. package/dist/domain.operations/artifact/genLoopFeedback.js +1 -1
  80. package/dist/domain.operations/artifact/genLoopFeedback.js.map +1 -1
  81. package/dist/domain.operations/artifact/genStepGrabCallerFeedbackToArtifact.d.ts +1 -1
  82. package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.d.ts +13 -0
  83. package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.js +106 -0
  84. package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.js.map +1 -0
  85. package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.d.ts +18 -0
  86. package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.js +16 -0
  87. package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.js.map +1 -0
  88. package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.d.ts +30 -0
  89. package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.js +71 -0
  90. package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.js.map +1 -0
  91. package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.d.ts +20 -0
  92. package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.js +90 -0
  93. package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.js.map +1 -0
  94. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.d.ts +8 -0
  95. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.js +31 -0
  96. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.js.map +1 -0
  97. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.d.ts +3 -0
  98. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.js +10 -0
  99. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.js.map +1 -0
  100. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.d.ts +8 -0
  101. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.js +31 -0
  102. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.js.map +1 -0
  103. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.d.ts +8 -0
  104. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.js +32 -0
  105. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.js.map +1 -0
  106. package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.d.ts +6 -0
  107. package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.js +80 -0
  108. package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.js.map +1 -0
  109. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.d.ts +6 -0
  110. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.js +14 -0
  111. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.js.map +1 -0
  112. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.d.ts +8 -0
  113. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.js +52 -0
  114. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.js.map +1 -0
  115. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.d.ts +8 -0
  116. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.js +38 -0
  117. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.js.map +1 -0
  118. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.d.ts +33 -0
  119. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.js +100 -0
  120. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.js.map +1 -0
  121. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.d.ts +6 -0
  122. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.js +26 -0
  123. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.js.map +1 -0
  124. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.d.ts +41 -0
  125. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.js +107 -0
  126. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.js.map +1 -0
  127. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.d.ts +33 -0
  128. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.js +68 -0
  129. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.js.map +1 -0
  130. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.d.ts +41 -0
  131. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.js +97 -0
  132. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.js.map +1 -0
  133. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.d.ts +6 -0
  134. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.js +65 -0
  135. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.js.map +1 -0
  136. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.d.ts +37 -0
  137. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.js +96 -0
  138. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.js.map +1 -0
  139. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.d.ts +33 -0
  140. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.js +81 -0
  141. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.js.map +1 -0
  142. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.d.ts +33 -0
  143. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.js +113 -0
  144. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.js.map +1 -0
  145. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.d.ts +6 -0
  146. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.js +36 -0
  147. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.js.map +1 -0
  148. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.d.ts +36 -0
  149. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.js +101 -0
  150. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.js.map +1 -0
  151. package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.d.ts +14 -0
  152. package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.js +45 -0
  153. package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.js.map +1 -0
  154. package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.d.ts +19 -0
  155. package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.js +35 -0
  156. package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.js.map +1 -0
  157. package/dist/domain.operations/git/genGitHubFileUrl.d.ts +9 -0
  158. package/dist/domain.operations/git/genGitHubFileUrl.js +55 -0
  159. package/dist/domain.operations/git/genGitHubFileUrl.js.map +1 -0
  160. package/dist/domain.operations/git/getGitRemoteUrl.d.ts +7 -0
  161. package/dist/domain.operations/git/getGitRemoteUrl.js +40 -0
  162. package/dist/domain.operations/git/getGitRemoteUrl.js.map +1 -0
  163. package/dist/domain.operations/hooks/getInvokeHooks.js +1 -1
  164. package/dist/domain.operations/hooks/getInvokeHooks.js.map +1 -1
  165. package/dist/domain.operations/reflect/createDraftDirectory.d.ts +11 -0
  166. package/dist/domain.operations/reflect/createDraftDirectory.js +46 -0
  167. package/dist/domain.operations/reflect/createDraftDirectory.js.map +1 -0
  168. package/dist/domain.operations/reflect/enumFeedbackFiles.d.ts +7 -0
  169. package/dist/domain.operations/reflect/enumFeedbackFiles.js +69 -0
  170. package/dist/domain.operations/reflect/enumFeedbackFiles.js.map +1 -0
  171. package/dist/domain.operations/reflect/extractJsonFromResultText.d.ts +7 -0
  172. package/dist/domain.operations/reflect/extractJsonFromResultText.js +19 -0
  173. package/dist/domain.operations/reflect/extractJsonFromResultText.js.map +1 -0
  174. package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.d.ts +46 -0
  175. package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.js +120 -0
  176. package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.js.map +1 -0
  177. package/dist/domain.operations/reflect/metrics/computeMetricsExpected.d.ts +12 -0
  178. package/dist/domain.operations/reflect/metrics/computeMetricsExpected.js +28 -0
  179. package/dist/domain.operations/reflect/metrics/computeMetricsExpected.js.map +1 -0
  180. package/dist/domain.operations/reflect/metrics/computeMetricsRealized.d.ts +26 -0
  181. package/dist/domain.operations/reflect/metrics/computeMetricsRealized.js +66 -0
  182. package/dist/domain.operations/reflect/metrics/computeMetricsRealized.js.map +1 -0
  183. package/dist/domain.operations/reflect/metrics/writeLogArtifact.d.ts +17 -0
  184. package/dist/domain.operations/reflect/metrics/writeLogArtifact.js +93 -0
  185. package/dist/domain.operations/reflect/metrics/writeLogArtifact.js.map +1 -0
  186. package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.d.ts +8 -0
  187. package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.js +28 -0
  188. package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.js.map +1 -0
  189. package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.d.ts +14 -0
  190. package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.js +93 -0
  191. package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.js.map +1 -0
  192. package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.d.ts +18 -0
  193. package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.js +208 -0
  194. package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.js.map +1 -0
  195. package/dist/domain.operations/reflect/step2/executeManifestOperations.d.ts +17 -0
  196. package/dist/domain.operations/reflect/step2/executeManifestOperations.js +189 -0
  197. package/dist/domain.operations/reflect/step2/executeManifestOperations.js.map +1 -0
  198. package/dist/domain.operations/reflect/step2/parseManifestOperations.d.ts +8 -0
  199. package/dist/domain.operations/reflect/step2/parseManifestOperations.js +73 -0
  200. package/dist/domain.operations/reflect/step2/parseManifestOperations.js.map +1 -0
  201. package/dist/domain.operations/reflect/validateSourceDirectory.d.ts +9 -0
  202. package/dist/domain.operations/reflect/validateSourceDirectory.js +63 -0
  203. package/dist/domain.operations/reflect/validateSourceDirectory.js.map +1 -0
  204. package/dist/domain.operations/reflect/validateTargetDirectory.d.ts +10 -0
  205. package/dist/domain.operations/reflect/validateTargetDirectory.js +59 -0
  206. package/dist/domain.operations/reflect/validateTargetDirectory.js.map +1 -0
  207. package/dist/domain.operations/review/compileReviewPrompt.js +16 -5
  208. package/dist/domain.operations/review/compileReviewPrompt.js.map +1 -1
  209. package/dist/domain.operations/review/formatReviewOutput.d.ts +15 -6
  210. package/dist/domain.operations/review/formatReviewOutput.js +15 -17
  211. package/dist/domain.operations/review/formatReviewOutput.js.map +1 -1
  212. package/dist/index.js.map +1 -1
  213. package/dist/roles/architect/getArchitectRole.d.ts +6 -0
  214. package/dist/roles/architect/getArchitectRole.js +31 -0
  215. package/dist/roles/architect/getArchitectRole.js.map +1 -0
  216. package/dist/roles/brain/getBrainRole.d.ts +6 -0
  217. package/dist/roles/brain/getBrainRole.js +28 -0
  218. package/dist/roles/brain/getBrainRole.js.map +1 -0
  219. package/dist/roles/brain/skills/act/skillAct.d.ts +5 -0
  220. package/dist/roles/brain/skills/act/skillAct.js +147 -0
  221. package/dist/roles/brain/skills/act/skillAct.js.map +1 -0
  222. package/dist/roles/brain/skills/act/skillAct.ts +186 -0
  223. package/dist/roles/brain/skills/act/stepAct.d.ts +27 -0
  224. package/dist/roles/brain/skills/act/stepAct.js +95 -0
  225. package/dist/roles/brain/skills/act/stepAct.js.map +1 -0
  226. package/dist/roles/brain/skills/act/stepAct.ts +123 -0
  227. package/dist/roles/getRoleRegistry.js +5 -4
  228. package/dist/roles/getRoleRegistry.js.map +1 -1
  229. package/dist/roles/reviewer/briefs/on.rules/rules101.[article].md +41 -0
  230. package/dist/roles/reviewer/briefs/on.rules/rules101.citations.[article].md +88 -0
  231. package/dist/roles/reviewer/briefs/on.rules/rules101.collocated.[article].md +97 -0
  232. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[article].md +228 -0
  233. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].forbid.failhide.md +87 -0
  234. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].forbid.gerunds.md +85 -0
  235. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].require.failfast.md +73 -0
  236. package/dist/roles/reviewer/briefs/on.rules/rules101.structure.[article].md +70 -0
  237. package/dist/roles/reviewer/skills/reflect/reflect.d.ts +30 -0
  238. package/dist/roles/reviewer/skills/reflect/reflect.js +305 -0
  239. package/dist/roles/reviewer/skills/reflect/reflect.js.map +1 -0
  240. package/dist/roles/reviewer/skills/reflect/reflect.sh +38 -0
  241. package/dist/roles/reviewer/skills/reflect/reflect.ts +356 -0
  242. package/dist/roles/reviewer/skills/review/review.js.map +1 -1
  243. package/dist/roles/reviewer/skills/review/review.ts +12 -3
  244. package/dist/roles/thinker/getThinkerBrief.d.ts +1 -1
  245. package/dist/roles/thinker/getThinkerRole.js +8 -8
  246. package/dist/roles/thinker/getThinkerRole.js.map +1 -1
  247. package/package.json +6 -4
@@ -0,0 +1,228 @@
1
+ # rules content
2
+
3
+ ## .what
4
+
5
+ rules follow a two-section structure that separates quick reference from detailed guidance.
6
+
7
+ ## two-section structure
8
+
9
+ every rule has two sections separated by a triple separator:
10
+
11
+ ```md
12
+ # tldr
13
+
14
+ [quick reference content]
15
+
16
+ ---
17
+ ---
18
+ ---
19
+
20
+ # deets
21
+
22
+ [detailed content]
23
+ ```
24
+
25
+ ## # tldr section
26
+
27
+ the tldr section provides at-a-glance understanding:
28
+
29
+ ### ## severity header
30
+
31
+ ```md
32
+ ## severity: blocker
33
+ ```
34
+
35
+ or
36
+
37
+ ```md
38
+ ## severity: nitpick
39
+ ```
40
+
41
+ the severity must match the directive:
42
+ - `forbid` / `require` → `blocker`
43
+ - `avoid` / `prefer` → `nitpick`
44
+
45
+ ### .what summary
46
+
47
+ immediately after severity, state what the rule is:
48
+
49
+ ```md
50
+ ## severity: blocker
51
+
52
+ never use positional arguments in procedure signatures
53
+
54
+ use named arguments via destructured input objects instead
55
+ ```
56
+
57
+ ### .why rationale
58
+
59
+ explain why this rule matters:
60
+
61
+ ```md
62
+ positional arguments are fragile - adding, removing, or reordering parameters breaks callers.
63
+ named arguments are self-documenting and order-independent.
64
+ ```
65
+
66
+ ## # deets section
67
+
68
+ the deets section provides expanded guidance:
69
+
70
+ ### ## .what (optional)
71
+
72
+ expanded explanation of what the rule covers.
73
+
74
+ ### ## .why (optional)
75
+
76
+ deeper rationale, including tradeoffs and edge cases.
77
+
78
+ ### ## severity (required)
79
+
80
+ repeat the severity and explain why this level was chosen, tying to hazard, time cost, and money cost.
81
+
82
+ for negative directives (`forbid`/`avoid`), explain the cost of violation:
83
+
84
+ ```md
85
+ ## severity: blocker
86
+
87
+ hidden errors reach production and cost hours to debug, damaging customer trust.
88
+ ```
89
+
90
+ for positive directives (`require`/`prefer`), explain the benefit of compliance:
91
+
92
+ ```md
93
+ ## severity: blocker
94
+
95
+ fail-fast surfaces errors immediately with rich context, cutting debug time from hours to minutes.
96
+ ```
97
+
98
+ ### ## .where (optional)
99
+
100
+ scope or location where this rule applies:
101
+
102
+ ```md
103
+ ## .where
104
+
105
+ - all exported procedures in domain.operations/
106
+ - all public API endpoints
107
+ - exempt: anonymous inline callbacks
108
+ ```
109
+
110
+ ### ## .when (optional)
111
+
112
+ conditions under which the rule applies:
113
+
114
+ ```md
115
+ ## .when
116
+
117
+ - applies when defining function signatures
118
+ - applies when refactoring existing code
119
+ - does not apply to third-party API callbacks
120
+ ```
121
+
122
+ ### ## .how (optional)
123
+
124
+ guidance on detecting violations and applying the rule:
125
+
126
+ ```md
127
+ ## .how
128
+
129
+ search for patterns like:
130
+ - `function foo(a, b, c)`
131
+ - `const bar = (x, y) =>`
132
+
133
+ refactor to:
134
+ - `const foo = ({ a, b, c }: Input) =>`
135
+ ```
136
+
137
+ ### ## .note (optional)
138
+
139
+ caveats, edge cases, or special considerations:
140
+
141
+ ```md
142
+ ## .note
143
+
144
+ legacy code may still use positional args.
145
+ prioritize new code; refactor legacy opportunistically.
146
+ ```
147
+
148
+ ### ## .examples (optional)
149
+
150
+ concrete positive and negative patterns:
151
+
152
+ ```md
153
+ ## .examples
154
+
155
+ ### positive
156
+
157
+ const setCustomerPhone = ({ customer, phone }: Input) => {
158
+ return { ...customer, phone };
159
+ };
160
+
161
+ ### negative
162
+
163
+ function setCustomerPhone(customer, phone) { // forbidden
164
+ return { ...customer, phone };
165
+ }
166
+ ```
167
+
168
+ ## complete template
169
+
170
+ ```md
171
+ # tldr
172
+
173
+ ## severity: blocker|nitpick
174
+
175
+ [.what summary - what the rule is]
176
+
177
+ [.why rationale - why it matters]
178
+
179
+ ---
180
+ ---
181
+ ---
182
+
183
+ # deets
184
+
185
+ ## .what
186
+
187
+ [expanded summary]
188
+
189
+ ## .why
190
+
191
+ [expanded rationale]
192
+
193
+ ## severity: blocker|nitpick
194
+
195
+ [for forbid/avoid: cost of violation | for require/prefer: benefit of compliance]
196
+
197
+ ## .where
198
+
199
+ [scope/location]
200
+
201
+ ## .when
202
+
203
+ [conditions]
204
+
205
+ ## .how
206
+
207
+ [detection and usage guidance]
208
+
209
+ ## .note
210
+
211
+ [caveats]
212
+
213
+ ## .examples
214
+
215
+ ### positive
216
+
217
+ [correct usage]
218
+
219
+ ### negative
220
+
221
+ [violation]
222
+
223
+ ## .citations
224
+
225
+ > [quote from origin feedback]
226
+
227
+ source: [github url]
228
+ ```
@@ -0,0 +1,87 @@
1
+ # tldr
2
+
3
+ ## severity: blocker
4
+
5
+ never hide errors via blanket try/catch blocks.
6
+
7
+ hidden errors lead to silent defects and hours of pointless debugging. if an error is thrown, it must be rethrown unless explicitly allowlisted and carefully handled.
8
+
9
+ ---
10
+ ---
11
+ ---
12
+
13
+ # deets
14
+
15
+ ## .what
16
+
17
+ forbid any scenario where real errors are silently swallowed or hidden, commonly via try/catch blocks that catch all errors without rethrowing unexpected ones.
18
+
19
+ ## .why
20
+
21
+ - hidden errors cause silent defects that are extremely hard to diagnose
22
+ - blanket catch blocks mask the root cause of failures
23
+ - debugging becomes exponentially harder when errors don't surface
24
+ - fail-fast is impossible when errors are swallowed
25
+
26
+ ## severity: blocker
27
+
28
+ swallowed exceptions cause silent defects that cost hours or days to diagnose and erode customer trust.
29
+
30
+ ## .when
31
+
32
+ the only acceptable try/catch pattern:
33
+ - the catch has an explicit allowlist of expected errors
34
+ - those specific errors are carefully handled
35
+ - all other errors are rethrown
36
+
37
+ ## .how
38
+
39
+ search for patterns:
40
+ - `try { ... } catch (e) { }` — empty catch blocks
41
+ - `try { ... } catch (e) { return null; }` — swallowing with fallback
42
+ - `try { ... } catch (e) { console.log(e); }` — logging without rethrowing
43
+
44
+ ## .examples
45
+
46
+ ### positive
47
+
48
+ ```ts
49
+ try {
50
+ await doSomething({ userUuid });
51
+ } catch (error) {
52
+ if (!(error instanceof Error)) throw error;
53
+
54
+ // only handle specific expected error
55
+ if (error.message.includes('NOT_FOUND')) {
56
+ return null; // expected case: resource doesn't exist
57
+ }
58
+
59
+ // rethrow all unexpected errors
60
+ throw error;
61
+ }
62
+ ```
63
+
64
+ ### negative
65
+
66
+ ```ts
67
+ // ⛔ blanket catch hides all errors
68
+ try {
69
+ await doSomething({ userUuid });
70
+ } catch (error) {
71
+ console.log('something went wrong');
72
+ return null;
73
+ }
74
+ ```
75
+
76
+ ```ts
77
+ // ⛔ empty catch block
78
+ try {
79
+ await riskyOperation();
80
+ } catch (e) {
81
+ // silently swallowed
82
+ }
83
+ ```
84
+
85
+ ## .note
86
+
87
+ this is a mega blocker. any detection of failhide patterns should immediately halt review until resolved.
@@ -0,0 +1,85 @@
1
+ # tldr
2
+
3
+ ## severity: blocker
4
+
5
+ never use gerunds like `existing` in variable names.
6
+
7
+ gerunds signal unclear domain thought. use explicit names like `userBefore`, `userFound`, or `orderCreated` that force clarity about the domain model.
8
+
9
+ ---
10
+ ---
11
+ ---
12
+
13
+ # deets
14
+
15
+ ## .what
16
+
17
+ forbid gerund forms (words ending in `-ing`) in variable names. they signal unclear domain thought.
18
+
19
+ ## .why
20
+
21
+ - gerunds indicate the domain model was not thought through
22
+ - vague names like `existing` hide temporal state: existing when? before or after?
23
+ - they are a lead indicator of domain model issues that compound downstream
24
+ - explicit names (`userBefore`, `userFound`) force clarity about the domain
25
+
26
+ ## severity: blocker
27
+
28
+ gerunds signal unclear domain thought. they are a lead indicator of domain model issues that compound into costly refactors.
29
+
30
+ ## .where
31
+
32
+ - applies to all variable names in business logic
33
+ - especially important in update/upsert flows where before/after state matters
34
+ - applies to domain object references and database query results
35
+
36
+ ## .how
37
+
38
+ search for patterns:
39
+ - `existing*` — replace with `foundBefore` or `*Before`
40
+ - `running*` — replace with `isActive` or `hasStarted`
41
+ - `pending*` — replace with `needsApproval` or explicit state
42
+
43
+ common replacements:
44
+ | gerund | replacement |
45
+ | ----------------- | --------------------------------- |
46
+ | `existingUser` | `userBefore`, `userFound` |
47
+ | `existingInvoice` | `invoiceBefore`, `invoiceFound` |
48
+ | `runningProcess` | `processActive`, `processStarted` |
49
+
50
+ ## .examples
51
+
52
+ ### positive
53
+
54
+ ```ts
55
+ // clear temporal state
56
+ const userBefore = await userDao.findByUuid({ uuid });
57
+ const userAfter = userBefore.clone({ phone: newPhone });
58
+
59
+ // clear capture point
60
+ const invoiceFound = await invoiceDao.findByRef({ ref });
61
+ if (!invoiceFound) return BadRequestError.throw('invoice not found');
62
+
63
+ // clear lifecycle state
64
+ const orderCreated = await orderDao.insert({ order });
65
+ ```
66
+
67
+ ### negative
68
+
69
+ ```ts
70
+ // ⛔ "existing" is vague
71
+ const existingUser = await userDao.findByUuid({ uuid });
72
+ // existing when? before what operation?
73
+
74
+ // ⛔ gerund hides state
75
+ const runningJobs = await jobDao.findActive();
76
+ // are these currently running or were they running?
77
+ ```
78
+
79
+ ## .note
80
+
81
+ prefer `[noun][state]` order per the `name:treestruct` tactic:
82
+ - `userFound` not `foundUser`
83
+ - `invoiceBefore` not `beforeInvoice`
84
+
85
+ this enables autocomplete groups by domain noun.
@@ -0,0 +1,73 @@
1
+ # tldr
2
+
3
+ ## severity: blocker
4
+
5
+ fail fast using early exits and HelpfulError subclasses to reject invalid state or input immediately.
6
+
7
+ early returns and throws collapse failure paths, eliminate nested branches, and make core logic shine. rich error context via `helpful-errors` makes bugs easier to debug.
8
+
9
+ ---
10
+ ---
11
+ ---
12
+
13
+ # deets
14
+
15
+ ## .what
16
+
17
+ enforce fail-fast logic in all procedures by using guard clauses with early returns or throws.
18
+
19
+ ## .why
20
+
21
+ - improves readability by collapsing failure paths early
22
+ - eliminates nested branches and lets core logic shine
23
+ - increases safety by clearly documenting and halting on invalid input
24
+ - makes bugs easier to debug with rich context using `helpful-errors`
25
+
26
+ ## severity: blocker
27
+
28
+ fail-fast surfaces errors immediately with rich context, cutting debug time from hours to minutes.
29
+
30
+ ## .where
31
+
32
+ - required in all stitched logic, business procedures, and service flows
33
+ - applies to guard checks, validations, and branching paths
34
+
35
+ ## .how
36
+
37
+ - use early returns or throws for all guard clauses
38
+ - never use `if (...) else` or deep nesting to control flow
39
+ - prefer `UnexpectedCodePathError.throw(...)` for internal invariant violations
40
+ - prefer `BadRequestError.throw(...)` for rejecting invalid input
41
+ - include context objects in all thrown errors to aid debugging
42
+
43
+ ## .examples
44
+
45
+ ### positive
46
+
47
+ ```ts
48
+ // reject if user does not exist
49
+ if (!user) return BadRequestError.throw('user not found', { userUuid });
50
+
51
+ // halt if state is invalid
52
+ if (!input.customer.phone)
53
+ UnexpectedCodePathError.throw('customer lacks phone, invalid state', { customer });
54
+
55
+ // continue with core logic after guards
56
+ const result = await processCustomer(input.customer);
57
+ ```
58
+
59
+ ### negative
60
+
61
+ ```ts
62
+ // ⛔ nested branches hide the core logic
63
+ if (user) {
64
+ if (input.customer.phone) {
65
+ const result = await processCustomer(input.customer);
66
+ return result;
67
+ } else {
68
+ throw new Error('no phone');
69
+ }
70
+ } else {
71
+ throw new Error('no user');
72
+ }
73
+ ```
@@ -0,0 +1,70 @@
1
+ # rules structure
2
+
3
+ ## .what
4
+
5
+ rules follow a strict file name convention and directory organization that encodes semantics into the file system.
6
+
7
+ ## file name convention
8
+
9
+ rule files follow the pattern:
10
+
11
+ ```
12
+ rule.$directive.$topic.md
13
+ ```
14
+
15
+ - **rule** = literal prefix identifying the file as a rule
16
+ - **$directive** = severity and action: `forbid`, `avoid`, `prefer`, `require`
17
+ - **$topic** = snake_case description of what the rule addresses
18
+
19
+ ### examples
20
+
21
+ ```
22
+ rule.forbid.positional_args.md
23
+ rule.avoid.gerunds.md
24
+ rule.prefer.early_returns.md
25
+ rule.require.tests.md
26
+ ```
27
+
28
+ ## directive taxonomy
29
+
30
+ directives indicate what action to take and at what severity:
31
+
32
+ | directive | action | severity | description |
33
+ |-----------|------------------|----------|-------------------------|
34
+ | `forbid` | must not do | blocker | violation blocks merge |
35
+ | `require` | must do | blocker | absence blocks merge |
36
+ | `avoid` | discouraged | nitpick | flag but don't block |
37
+ | `prefer` | encouraged | nitpick | suggest but don't block |
38
+
39
+ ### severity map
40
+
41
+ | severity | directives | review impact |
42
+ |-----------|--------------------|-----------------------------|
43
+ | blocker | forbid, require | must resolve before merge |
44
+ | nitpick | avoid, prefer | optional to resolve |
45
+
46
+ ## practices directory structure
47
+
48
+ rules are organized into practice directories by domain concern. the specific practice domains vary by project and role - there is no prescribed set.
49
+
50
+ typical patterns include:
51
+ - group by artifact type (e.g., code, docs, config)
52
+ - group by quality dimension (e.g., readability, reliability)
53
+ - group by lifecycle stage (e.g., design, test, deploy)
54
+
55
+ nested subdirectories further refine the domain:
56
+
57
+ ```
58
+ practices/
59
+ └── $domain/
60
+ └── $subdomain/
61
+ ├── rule.$directive.$topic.md
62
+ └── rule.$directive.$topic.[demo].$qualifier.md
63
+ ```
64
+
65
+ ## .note
66
+
67
+ the directory structure groups related rules, making it easier to:
68
+ - discover rules relevant to a domain
69
+ - maintain consistent naming within a practice
70
+ - navigate rules by concern rather than alphabetically
@@ -0,0 +1,30 @@
1
+ import type { ReviewerReflectMetrics } from '../../../../domain.objects/Reviewer/ReviewerReflectMetrics';
2
+ /**
3
+ * .what = result of stepReflect execution
4
+ * .why = enables caller to inspect reflect outcome and artifacts
5
+ */
6
+ export type StepReflectResult = {
7
+ draft: {
8
+ dir: string;
9
+ pureDir: string;
10
+ syncDir: string;
11
+ };
12
+ results: {
13
+ created: number;
14
+ updated: number;
15
+ appended: number;
16
+ omitted: number;
17
+ };
18
+ metrics: ReviewerReflectMetrics;
19
+ };
20
+ /**
21
+ * .what = extracts rules from feedback and proposes them to target
22
+ * .why = core orchestration flow for reviewer.reflect skill
23
+ */
24
+ export declare const stepReflect: (input: {
25
+ source: string;
26
+ target: string;
27
+ mode?: 'soft' | 'hard';
28
+ force?: boolean;
29
+ rapid?: boolean;
30
+ }) => Promise<StepReflectResult>;