rhachet-roles-ehmpathy 1.0.0 → 1.1.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 (306) hide show
  1. package/dist/.test/getContextOpenAI.js +2 -1
  2. package/dist/.test/getContextOpenAI.js.map +1 -1
  3. package/dist/contract/commands/codegenBriefOptions.js +1 -0
  4. package/dist/contract/commands/codegenBriefOptions.js.map +1 -1
  5. package/dist/contract/sdk/index.d.ts +1 -0
  6. package/dist/contract/sdk/index.js +6 -0
  7. package/dist/contract/sdk/index.js.map +1 -0
  8. package/dist/data/sdk/sdkOpenAi.js +5 -1
  9. package/dist/data/sdk/sdkOpenAi.js.map +1 -1
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js +16 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/logic/artifact/asDotRhachetFile.d.ts +5 -0
  14. package/dist/logic/artifact/asDotRhachetFile.js +16 -0
  15. package/dist/logic/artifact/asDotRhachetFile.js.map +1 -0
  16. package/dist/logic/artifact/genLoopFeedback.d.ts +18 -0
  17. package/dist/logic/artifact/genLoopFeedback.js +40 -0
  18. package/dist/logic/artifact/genLoopFeedback.js.map +1 -0
  19. package/dist/logic/artifact/genStepArtSet.d.ts +2 -1
  20. package/dist/logic/artifact/genStepArtSet.js +24 -4
  21. package/dist/logic/artifact/genStepArtSet.js.map +1 -1
  22. package/dist/logic/artifact/genStepGrabCallerFeedbackToArtifact.js +7 -0
  23. package/dist/logic/artifact/genStepGrabCallerFeedbackToArtifact.js.map +1 -1
  24. package/dist/logic/artifact/genStepResetFeedback.d.ts +12 -0
  25. package/dist/logic/artifact/genStepResetFeedback.js +27 -0
  26. package/dist/logic/artifact/genStepResetFeedback.js.map +1 -0
  27. package/dist/logic/artifact/genStepSwapArtifact.d.ts +57 -0
  28. package/dist/logic/artifact/genStepSwapArtifact.js +58 -0
  29. package/dist/logic/artifact/genStepSwapArtifact.js.map +1 -0
  30. package/dist/logic/artifact/genStepSwapArtifact.test.js +131 -0
  31. package/dist/logic/artifact/genStepSwapArtifact.test.js.map +1 -0
  32. package/dist/logic/roles/architect/.briefs/ubiqlang.ambiguous-from-overload.md +1 -0
  33. package/dist/logic/roles/bhrain/.briefs/cognition/cog021.treestruct.md +85 -0
  34. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.definition.md +115 -0
  35. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct._.md +112 -0
  36. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.gravity.md +89 -0
  37. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.persp.1.perspectives.md +88 -0
  38. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.persp.2.universal.md +82 -0
  39. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.persp.3.relative.md +106 -0
  40. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.persp.4.fractal.md +83 -0
  41. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.cortal.focus.p1.definition.md +182 -0
  42. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.cortal.focus.p1.examples.cont.md +82 -0
  43. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.cortal.focus.p2.acuity.md +107 -0
  44. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.cortal.focus.p2.breadth.md +118 -0
  45. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.cortal.focus.p2.depth.md +121 -0
  46. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.cortal.focus.p3.mode.md +68 -0
  47. package/dist/logic/roles/bhrain/.briefs/cognition/cog101.cortal.focus.p3.rythm.md +56 -0
  48. package/dist/logic/roles/bhrain/.briefs/cognition/cog301.concept.traversal.p1.universal.md +108 -0
  49. package/dist/logic/roles/bhrain/.briefs/cognition/cog301.concept.traversal.p2.relative.md +76 -0
  50. package/dist/logic/roles/bhrain/.briefs/cognition/cog301.concept.traversal.p3.directions.md +42 -0
  51. package/dist/logic/roles/bhrain/.briefs/distilisys.grammar.compressed.md +19 -0
  52. package/dist/logic/roles/bhrain/.briefs/physics/optics.focal.acuity.md +77 -0
  53. package/dist/logic/roles/bhrain/.briefs/physics/optics.focal.breadth.md +74 -0
  54. package/dist/logic/roles/bhrain/.briefs/physics/optics.focal.depth.md +77 -0
  55. package/dist/logic/roles/bhrain/.briefs/physics/optics.focal.distance.md +92 -0
  56. package/dist/logic/roles/bhrain/.briefs/physics/optics.focal.tradeoffs.md +107 -0
  57. package/dist/logic/roles/bhrain/.briefs/tactic.<think>[idea]/composite/<triangulate>[concept].md +66 -0
  58. package/dist/logic/roles/bhrain/.briefs/tactic.<think>[idea]/primitive/<zoom>._.md +124 -0
  59. package/dist/logic/roles/bhrain/.briefs/tactic.<think>[idea]/primitive/<zoomin>[acuity]<sharpen>[concept].md +53 -0
  60. package/dist/logic/roles/bhrain/.briefs/tactic.<think>[idea]/primitive/<zoomin>[breadth]<decompose>[concept].md +67 -0
  61. package/dist/logic/roles/bhrain/.briefs/tactic.<think>[idea]/primitive/<zoomin>[depth]<abstractify>[concept].md +124 -0
  62. package/dist/logic/roles/bhrain/.briefs/tactic.<think>[idea]/primitive/<zoomout>[acuity]<blurren>[concept].md +56 -0
  63. package/dist/logic/roles/bhrain/.briefs/tactic.<think>[idea]/primitive/<zoomout>[breadth]<broaden>[concept].md +71 -0
  64. package/dist/logic/roles/bhrain/.briefs/tactic.<think>[idea]/primitive/<zoomout>[depth]<elaborate>[concept].md +74 -0
  65. package/dist/logic/roles/bhrain/.briefs/terms.motive.intent.goal.md +46 -0
  66. package/dist/logic/roles/bhrain/.briefs/trait.ocd.md +5 -0
  67. package/dist/logic/roles/bhrain/getBhrainBrief.Options.codegen.d.ts +10 -0
  68. package/dist/logic/roles/bhrain/getBhrainBrief.Options.codegen.js +15 -0
  69. package/dist/logic/roles/bhrain/getBhrainBrief.Options.codegen.js.map +1 -0
  70. package/dist/logic/roles/bhrain/getBhrainBrief.d.ts +13 -0
  71. package/dist/logic/roles/bhrain/getBhrainBrief.js +21 -0
  72. package/dist/logic/roles/bhrain/getBhrainBrief.js.map +1 -0
  73. package/dist/logic/roles/bhrain/getBhrainRole.d.ts +2 -0
  74. package/dist/logic/roles/bhrain/getBhrainRole.js +27 -0
  75. package/dist/logic/roles/bhrain/getBhrainRole.js.map +1 -0
  76. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/cluster/stepCluster.d.ts +51 -0
  77. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/cluster/stepCluster.integration.test.js +102 -0
  78. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/cluster/stepCluster.integration.test.js.map +1 -0
  79. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/cluster/stepCluster.js +59 -0
  80. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/cluster/stepCluster.js.map +1 -0
  81. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/cluster/stepCluster.template.md +127 -0
  82. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/collect/stepCollect.d.ts +15 -0
  83. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/collect/stepCollect.integration.test.js +91 -0
  84. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/collect/stepCollect.integration.test.js.map +1 -0
  85. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/collect/stepCollect.js +33 -0
  86. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/collect/stepCollect.js.map +1 -0
  87. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/diverge/stepDiverge.d.ts +49 -0
  88. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/diverge/stepDiverge.integration.test.d.ts +1 -0
  89. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/diverge/stepDiverge.integration.test.js +122 -0
  90. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/diverge/stepDiverge.integration.test.js.map +1 -0
  91. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/diverge/stepDiverge.js +59 -0
  92. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/diverge/stepDiverge.js.map +1 -0
  93. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/diverge/stepDiverge.template.md +125 -0
  94. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/envision/stepEnvision.d.ts +53 -0
  95. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/envision/stepEnvision.integration.test.d.ts +1 -0
  96. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/envision/stepEnvision.integration.test.js +126 -0
  97. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/envision/stepEnvision.integration.test.js.map +1 -0
  98. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/envision/stepEnvision.js +61 -0
  99. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/envision/stepEnvision.js.map +1 -0
  100. package/dist/logic/roles/bhrain/primitive.idealogic.atomic/envision/stepEnvision.template.md +105 -0
  101. package/dist/logic/roles/bhrain/primitive.idealogic.composite/expand/stepExpand.d.ts +24 -0
  102. package/dist/logic/roles/bhrain/primitive.idealogic.composite/expand/stepExpand.integration.test.d.ts +1 -0
  103. package/dist/logic/roles/bhrain/primitive.idealogic.composite/expand/stepExpand.integration.test.js +118 -0
  104. package/dist/logic/roles/bhrain/primitive.idealogic.composite/expand/stepExpand.integration.test.js.map +1 -0
  105. package/dist/logic/roles/bhrain/primitive.idealogic.composite/expand/stepExpand.js +38 -0
  106. package/dist/logic/roles/bhrain/primitive.idealogic.composite/expand/stepExpand.js.map +1 -0
  107. package/dist/logic/roles/bhrain/primitive.strategic.atomic/interpret/stepInterpret.d.ts +45 -0
  108. package/dist/logic/roles/bhrain/primitive.strategic.atomic/interpret/stepInterpret.integration.test.d.ts +1 -0
  109. package/dist/logic/roles/bhrain/primitive.strategic.atomic/interpret/stepInterpret.integration.test.js +115 -0
  110. package/dist/logic/roles/bhrain/primitive.strategic.atomic/interpret/stepInterpret.integration.test.js.map +1 -0
  111. package/dist/logic/roles/bhrain/primitive.strategic.atomic/interpret/stepInterpret.js +59 -0
  112. package/dist/logic/roles/bhrain/primitive.strategic.atomic/interpret/stepInterpret.js.map +1 -0
  113. package/dist/logic/roles/bhrain/primitive.strategic.atomic/interpret/stepInterpret.skill.d.ts +24 -0
  114. package/dist/logic/roles/bhrain/primitive.strategic.atomic/interpret/stepInterpret.skill.js +64 -0
  115. package/dist/logic/roles/bhrain/primitive.strategic.atomic/interpret/stepInterpret.skill.js.map +1 -0
  116. package/dist/logic/roles/bhrain/primitive.strategic.atomic/interpret/stepInterpret.template.md +143 -0
  117. package/dist/logic/roles/designer/.briefs/declarative-over-imperative.md +79 -0
  118. package/dist/logic/roles/designer/.briefs/declarative-over-imperative.stub.md +14 -0
  119. package/dist/logic/roles/designer/.briefs/pit-of-success.md +70 -0
  120. package/dist/logic/roles/designer/.briefs/pit-of-success.stub.md +3 -0
  121. package/dist/logic/roles/designer/outlineDistilisys/stepOutlineDistilisys.js +4 -2
  122. package/dist/logic/roles/designer/outlineDistilisys/stepOutlineDistilisys.js.map +1 -1
  123. package/dist/logic/roles/designer/outlineDistilisys/stepOutlineDistilisys.template.md +173 -0
  124. package/dist/logic/roles/designer/outlineRoadmap/stepOutlineRoadmap.js +1 -1
  125. package/dist/logic/roles/designer/outlineRoadmap/stepOutlineRoadmap.js.map +1 -1
  126. package/dist/logic/roles/designer/outlineRoadmap/stepOutlineRoadmap.template.md +88 -0
  127. package/dist/logic/roles/designer/outlineVision/stepOutlineVision.template.md +47 -0
  128. package/dist/logic/roles/ecologist/.briefs/.readme.md +17 -0
  129. package/dist/logic/roles/ecologist/.briefs/distilisys/sys101.distilisys.grammar.md +221 -0
  130. package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive._.summary.md +82 -0
  131. package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive.p1.reversibility.entropy.md +39 -0
  132. package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive.p2.option.chance.choice.md +140 -0
  133. package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive.p3.chance.motive.polarity.threat.md +72 -0
  134. package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive.p4.motive.horizon.md +101 -0
  135. package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive.p5.motive.grammar.md +131 -0
  136. package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources._.primitives.summary.md +108 -0
  137. package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources.pt1.primitive.time.md +56 -0
  138. package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources.pt2.primitive.energy.md +69 -0
  139. package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources.pt3.primitive.space.md +85 -0
  140. package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources.pt4.primitive.claim.md +113 -0
  141. package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources.pt5.composites.md +146 -0
  142. package/dist/logic/roles/ecologist/.briefs/distilisys/sys231.actor.claims.p1.primitive.exchange.md +130 -0
  143. package/dist/logic/roles/ecologist/.briefs/ecology/.eco001.origin.prompt.md +11 -0
  144. package/dist/logic/roles/ecologist/.briefs/ecology/eco001.overview.md +44 -0
  145. package/dist/logic/roles/ecologist/.briefs/ecology/eco101.core-system-understanding.md +70 -0
  146. package/dist/logic/roles/ecologist/.briefs/ecology/eco101.p1.ecosystem-structure.md +62 -0
  147. package/dist/logic/roles/ecologist/.briefs/ecology/eco101.p2.trophic-dynamics.md +59 -0
  148. package/dist/logic/roles/ecologist/.briefs/ecology/eco101.p3.population-ecology.md +71 -0
  149. package/dist/logic/roles/ecologist/.briefs/ecology/eco101.p4.community-interactions.md +78 -0
  150. package/dist/logic/roles/ecologist/.briefs/ecology/eco505.systems-thinking.md +62 -0
  151. package/dist/logic/roles/ecologist/.briefs/economy/econ001.overview.md +65 -0
  152. package/dist/logic/roles/ecologist/.briefs/economy/econ101.core-mechanics.md +65 -0
  153. package/dist/logic/roles/ecologist/.briefs/economy/econ101.p1.supply-and-demand.md +76 -0
  154. package/dist/logic/roles/ecologist/.briefs/economy/econ101.p2.opportunity-cost.md +106 -0
  155. package/dist/logic/roles/ecologist/.briefs/economy/econ101.p3.marginal-analysis.md +79 -0
  156. package/dist/logic/roles/ecologist/.briefs/economy/econ101.p4.rational-choice.md +81 -0
  157. package/dist/logic/roles/ecologist/.briefs/economy/econ201.market-structures-and-failures.md +81 -0
  158. package/dist/logic/roles/ecologist/.briefs/economy/econ301.production-and-growth.md +71 -0
  159. package/dist/logic/roles/ecologist/.briefs/economy/econ401.macro-systems.md +92 -0
  160. package/dist/logic/roles/ecologist/.briefs/economy/econ501.global-and-institutional.md +85 -0
  161. package/dist/logic/roles/ecologist/.briefs/economy/econ501.p1.game-theory.md +142 -0
  162. package/dist/logic/roles/ecologist/.briefs/economy/econ501.p4.behavioral-economics.md +146 -0
  163. package/dist/logic/roles/ecologist/.briefs/term.distillation.md +93 -0
  164. package/dist/logic/roles/ecologist/domain.sketch/loopStudyDomain.d.ts +24 -0
  165. package/dist/logic/roles/ecologist/domain.sketch/loopStudyDomain.integration.test.d.ts +1 -0
  166. package/dist/logic/roles/ecologist/domain.sketch/loopStudyDomain.integration.test.js +57 -0
  167. package/dist/logic/roles/ecologist/domain.sketch/loopStudyDomain.integration.test.js.map +1 -0
  168. package/dist/logic/roles/ecologist/domain.sketch/loopStudyDomain.js +11 -0
  169. package/dist/logic/roles/ecologist/domain.sketch/loopStudyDomain.js.map +1 -0
  170. package/dist/logic/roles/ecologist/domain.sketch/skillStudyDomain.d.ts +25 -0
  171. package/dist/logic/roles/ecologist/domain.sketch/skillStudyDomain.js +90 -0
  172. package/dist/logic/roles/ecologist/domain.sketch/skillStudyDomain.js.map +1 -0
  173. package/dist/logic/roles/ecologist/{distill/distillDomain.ActionsAndActors.d.ts → domain.sketch/stepStudyDomain.d.ts} +8 -3
  174. package/dist/logic/roles/ecologist/domain.sketch/stepStudyDomain.integration.test.d.ts +1 -0
  175. package/dist/logic/roles/ecologist/domain.sketch/stepStudyDomain.integration.test.js +65 -0
  176. package/dist/logic/roles/ecologist/domain.sketch/stepStudyDomain.integration.test.js.map +1 -0
  177. package/dist/logic/roles/ecologist/domain.sketch/stepStudyDomain.js +60 -0
  178. package/dist/logic/roles/ecologist/domain.sketch/stepStudyDomain.js.map +1 -0
  179. package/dist/logic/roles/ecologist/domain.sketch/stepStudyDomain.template.md +93 -0
  180. package/dist/logic/roles/ecologist/domain.term/stepCollectTermUsecases.d.ts +45 -0
  181. package/dist/logic/roles/ecologist/domain.term/stepCollectTermUsecases.integration.test.d.ts +1 -0
  182. package/dist/logic/roles/ecologist/domain.term/stepCollectTermUsecases.integration.test.js +69 -0
  183. package/dist/logic/roles/ecologist/domain.term/stepCollectTermUsecases.integration.test.js.map +1 -0
  184. package/dist/logic/roles/ecologist/domain.term/stepCollectTermUsecases.js +67 -0
  185. package/dist/logic/roles/ecologist/domain.term/stepCollectTermUsecases.js.map +1 -0
  186. package/dist/logic/roles/ecologist/domain.term/stepCollectTermUsecases.skill.d.ts +25 -0
  187. package/dist/logic/roles/ecologist/domain.term/stepCollectTermUsecases.skill.js +85 -0
  188. package/dist/logic/roles/ecologist/domain.term/stepCollectTermUsecases.skill.js.map +1 -0
  189. package/dist/logic/roles/ecologist/domain.term/stepCollectTermUsecases.template.md +160 -0
  190. package/dist/logic/roles/ecologist/domain.term/stepDistillTerm.d.ts +47 -0
  191. package/dist/logic/roles/ecologist/domain.term/stepDistillTerm.integration.test.d.ts +1 -0
  192. package/dist/logic/roles/ecologist/domain.term/stepDistillTerm.integration.test.js +127 -0
  193. package/dist/logic/roles/ecologist/domain.term/stepDistillTerm.integration.test.js.map +1 -0
  194. package/dist/logic/roles/ecologist/domain.term/stepDistillTerm.js +68 -0
  195. package/dist/logic/roles/ecologist/domain.term/stepDistillTerm.js.map +1 -0
  196. package/dist/logic/roles/ecologist/domain.term/stepDistillTerm.skill.d.ts +26 -0
  197. package/dist/logic/roles/ecologist/domain.term/stepDistillTerm.skill.js +92 -0
  198. package/dist/logic/roles/ecologist/domain.term/stepDistillTerm.skill.js.map +1 -0
  199. package/dist/logic/roles/ecologist/domain.term/stepDistillTerm.template.md +173 -0
  200. package/dist/logic/roles/ecologist/domain.usecases/stepCollectUsecases.d.ts +45 -0
  201. package/dist/logic/roles/ecologist/domain.usecases/stepCollectUsecases.integration.test.d.ts +1 -0
  202. package/dist/logic/roles/ecologist/domain.usecases/stepCollectUsecases.integration.test.js +69 -0
  203. package/dist/logic/roles/ecologist/domain.usecases/stepCollectUsecases.integration.test.js.map +1 -0
  204. package/dist/logic/roles/ecologist/domain.usecases/stepCollectUsecases.js +67 -0
  205. package/dist/logic/roles/ecologist/domain.usecases/stepCollectUsecases.js.map +1 -0
  206. package/dist/logic/roles/ecologist/domain.usecases/stepCollectUsecases.skill.d.ts +25 -0
  207. package/dist/logic/roles/ecologist/domain.usecases/stepCollectUsecases.skill.js +85 -0
  208. package/dist/logic/roles/ecologist/domain.usecases/stepCollectUsecases.skill.js.map +1 -0
  209. package/dist/logic/roles/ecologist/domain.usecases/stepCollectUsecases.template.md +160 -0
  210. package/dist/logic/roles/ecologist/domain.usecases/stepDiscoverUsecases.d.ts +45 -0
  211. package/dist/logic/roles/ecologist/domain.usecases/stepDiscoverUsecases.js +67 -0
  212. package/dist/logic/roles/ecologist/domain.usecases/stepDiscoverUsecases.js.map +1 -0
  213. package/dist/logic/roles/ecologist/envision/stepEnvision.d.ts +0 -0
  214. package/dist/logic/roles/ecologist/envision/stepEnvision.integration.test.d.ts +0 -0
  215. package/dist/logic/roles/ecologist/envision/stepEnvision.integration.test.js +78 -0
  216. package/dist/logic/roles/ecologist/envision/stepEnvision.integration.test.js.map +1 -0
  217. package/dist/logic/roles/ecologist/envision/stepEnvision.js +96 -0
  218. package/dist/logic/roles/ecologist/envision/stepEnvision.js.map +1 -0
  219. package/dist/logic/roles/ecologist/envision/stepEnvision.skill.d.ts +0 -0
  220. package/dist/logic/roles/ecologist/envision/stepEnvision.skill.js +72 -0
  221. package/dist/logic/roles/ecologist/envision/stepEnvision.skill.js.map +1 -0
  222. package/dist/logic/roles/ecologist/envision/stepEnvision.template.md +92 -0
  223. package/dist/logic/roles/ecologist/getEcologistBrief.Options.codegen.d.ts +1 -1
  224. package/dist/logic/roles/ecologist/getEcologistBrief.Options.codegen.js +34 -27
  225. package/dist/logic/roles/ecologist/getEcologistBrief.Options.codegen.js.map +1 -1
  226. package/dist/logic/roles/ecologist/getEcologistRole.d.ts +2 -0
  227. package/dist/logic/roles/ecologist/getEcologistRole.js +29 -0
  228. package/dist/logic/roles/ecologist/getEcologistRole.js.map +1 -0
  229. package/dist/logic/roles/getRoleRegistry.js +7 -1
  230. package/dist/logic/roles/getRoleRegistry.js.map +1 -1
  231. package/dist/logic/roles/mechanic/.briefs/architecture/bounded-contexts.md +61 -0
  232. package/dist/logic/roles/mechanic/.briefs/architecture/directional-dependencies.md +73 -0
  233. package/dist/logic/roles/mechanic/.briefs/architecture/domain-driven-design.md +61 -0
  234. package/dist/logic/roles/mechanic/.briefs/architecture/ubiqlang.md +37 -0
  235. package/dist/logic/roles/mechanic/.briefs/codestyle/_mech.compressed.md +57 -0
  236. package/dist/logic/roles/mechanic/.briefs/codestyle/_mech.compressed.prompt.md +5 -0
  237. package/dist/logic/roles/mechanic/.briefs/codestyle/flow.failfast.md +37 -0
  238. package/dist/logic/roles/mechanic/.briefs/codestyle/flow.idempotency.md +63 -0
  239. package/dist/logic/roles/mechanic/.briefs/codestyle/flow.immutability.md +48 -0
  240. package/dist/logic/roles/mechanic/.briefs/codestyle/flow.narratives.md +74 -0
  241. package/dist/logic/roles/mechanic/.briefs/codestyle/flow.single-responsibility.md +67 -0
  242. package/dist/logic/roles/mechanic/.briefs/codestyle/mech.args.input-context.md +61 -0
  243. package/dist/logic/roles/mechanic/.briefs/codestyle/mech.arrowonly.md +47 -0
  244. package/dist/logic/roles/mechanic/.briefs/codestyle/mech.clear-contracts.md +53 -0
  245. package/dist/logic/roles/mechanic/.briefs/codestyle/mech.tests.given-when-then.md +62 -0
  246. package/dist/logic/roles/mechanic/.briefs/codestyle/mech.what-why.md +88 -0
  247. package/dist/logic/roles/mechanic/.briefs/codestyle/mech.what-why.v2.md +98 -0
  248. package/dist/logic/roles/mechanic/.briefs/engineer/dependency-injection.md +118 -0
  249. package/dist/logic/roles/mechanic/.briefs/engineer/dependency-injection.stub.md +11 -0
  250. package/dist/logic/roles/mechanic/.briefs/style.compressed.md +29 -0
  251. package/dist/logic/roles/mechanic/.briefs/style.compressed.prompt.md +5 -0
  252. package/dist/logic/roles/mechanic/.briefs/style.names.treestruct.md +48 -0
  253. package/dist/logic/roles/mechanic/.briefs/style.names.ubiqlang.md +37 -0
  254. package/dist/logic/roles/mechanic/.briefs/style.words.lowercase.md +36 -0
  255. package/dist/logic/roles/mechanic/codediff/routeArtistCodeDiff.template.md +46 -0
  256. package/dist/logic/roles/mechanic/codediff/routeCriticCodeReviewArchitecture.template.md +78 -0
  257. package/dist/logic/roles/mechanic/codediff/routeCriticCodeReviewCodestyle.template.md +75 -0
  258. package/dist/logic/roles/mechanic/codediff/routeJudgeReleasable.template.md +67 -0
  259. package/dist/logic/roles/mechanic/getMechanicBrief.Options.codegen.d.ts +1 -1
  260. package/dist/logic/roles/mechanic/getMechanicBrief.Options.codegen.js +1 -1
  261. package/dist/logic/roles/mechanic/getMechanicBrief.Options.codegen.js.map +1 -1
  262. package/dist/logic/roles/mechanic/getMechanicRole.js +3 -137
  263. package/dist/logic/roles/mechanic/getMechanicRole.js.map +1 -1
  264. package/dist/logic/roles/mechanic/skills/getSkillCodePropose.d.ts +2 -0
  265. package/dist/logic/roles/mechanic/skills/getSkillCodePropose.js +140 -0
  266. package/dist/logic/roles/mechanic/skills/getSkillCodePropose.js.map +1 -0
  267. package/dist/logic/roles/mechanic/study/routeStudyAsk.template.md +73 -0
  268. package/dist/logic/roles/mechanic/write/.test/prior.template.md +21 -0
  269. package/dist/logic/roles/mechanic/write/loopWrite.d.ts +25 -0
  270. package/dist/logic/roles/mechanic/write/loopWrite.integration.test.d.ts +1 -0
  271. package/dist/logic/roles/mechanic/write/loopWrite.integration.test.js +57 -0
  272. package/dist/logic/roles/mechanic/write/loopWrite.integration.test.js.map +1 -0
  273. package/dist/logic/roles/mechanic/write/loopWrite.js +11 -0
  274. package/dist/logic/roles/mechanic/write/loopWrite.js.map +1 -0
  275. package/dist/logic/roles/mechanic/write/loopWrite.skill.d.ts +25 -0
  276. package/dist/logic/roles/mechanic/write/loopWrite.skill.js +100 -0
  277. package/dist/logic/roles/mechanic/write/loopWrite.skill.js.map +1 -0
  278. package/dist/logic/roles/mechanic/write/stepWrite.d.ts +22 -0
  279. package/dist/logic/roles/mechanic/write/stepWrite.integration.test.d.ts +1 -0
  280. package/dist/logic/roles/mechanic/write/stepWrite.integration.test.js +189 -0
  281. package/dist/logic/roles/mechanic/write/stepWrite.integration.test.js.map +1 -0
  282. package/dist/logic/roles/mechanic/write/stepWrite.js +50 -0
  283. package/dist/logic/roles/mechanic/write/stepWrite.js.map +1 -0
  284. package/dist/logic/roles/mechanic/write/stepWrite.template.md +34 -0
  285. package/package.json +9 -6
  286. package/readme.md +1 -1
  287. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.expand.ResourcesAndMechanisms.d.ts +0 -17
  288. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.expand.ResourcesAndMechanisms.integration.test.js +0 -107
  289. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.expand.ResourcesAndMechanisms.integration.test.js.map +0 -1
  290. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.expand.ResourcesAndMechanisms.js +0 -76
  291. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.expand.ResourcesAndMechanisms.js.map +0 -1
  292. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.imagine.ResourcesAndMechanisms.d.ts +0 -17
  293. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.imagine.ResourcesAndMechanisms.js +0 -73
  294. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.imagine.ResourcesAndMechanisms.js.map +0 -1
  295. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.refine.ResourcesAndMechanisms.d.ts +0 -18
  296. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.refine.ResourcesAndMechanisms.integration.test.js +0 -73
  297. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.refine.ResourcesAndMechanisms.integration.test.js.map +0 -1
  298. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.refine.ResourcesAndMechanisms.js +0 -62
  299. package/dist/logic/roles/ecologist/distill/.deprecate/distillDomain.refine.ResourcesAndMechanisms.js.map +0 -1
  300. package/dist/logic/roles/ecologist/distill/distillDomain.ActionsAndActors.integration.test.js +0 -120
  301. package/dist/logic/roles/ecologist/distill/distillDomain.ActionsAndActors.integration.test.js.map +0 -1
  302. package/dist/logic/roles/ecologist/distill/distillDomain.ActionsAndActors.js +0 -69
  303. package/dist/logic/roles/ecologist/distill/distillDomain.ActionsAndActors.js.map +0 -1
  304. /package/dist/logic/{roles/ecologist/distill/.deprecate/distillDomain.expand.ResourcesAndMechanisms.integration.test.d.ts → artifact/genStepSwapArtifact.test.d.ts} +0 -0
  305. /package/dist/logic/roles/{ecologist/distill/.deprecate/distillDomain.refine.ResourcesAndMechanisms.integration.test.d.ts → bhrain/primitive.idealogic.atomic/cluster/stepCluster.integration.test.d.ts} +0 -0
  306. /package/dist/logic/roles/{ecologist/distill/distillDomain.ActionsAndActors.integration.test.d.ts → bhrain/primitive.idealogic.atomic/collect/stepCollect.integration.test.d.ts} +0 -0
@@ -0,0 +1,48 @@
1
+ .tactic = vars:require-immutable
2
+
3
+ .what = require all code to use immutable variables, objects, and update patterns — mutation is a blocker
4
+
5
+ .scope:
6
+ - applies to all variable declarations, function arguments, object updates, and data flows
7
+ - enforced in all modules, logic layers, stitched routes, and tests
8
+
9
+ .why:
10
+ - eliminates side effects from shared mutable state
11
+ - enables predictable execution, safer concurrency, and undoable flows
12
+ - enforces functional purity and simplifies debugging
13
+ - guarantees compatibility with clone-based and parallel architectures
14
+
15
+ .how:
16
+ - all bindings must use `const`; `let` or `var` are **forbidden** unless explicitly scoped to a mutation block
17
+ - input arguments must never be mutated — always treat as read-only
18
+ - objects must never be mutated in place:
19
+ - use object spreads (`{ ...original, field }`) or `.clone()` on domain objects
20
+ - arrays must not be mutated directly:
21
+ - never use `.push()`, `.pop()`, `.splice()`, or `.sort()` on the original array
22
+ - use spread + map/filter/reduce or copy before mutating
23
+ - use `withImmute()` and `.clone()` for all updates to domain objects
24
+ - avoid shared reference mutation:
25
+ - never change shared singletons or top-level config objects after import
26
+ - if mutation is unavoidable (e.g. caching, metrics), isolate it in a clearly scoped, documented zone with `.note = deliberate mutation` comment
27
+
28
+ .enforcement:
29
+ - `let`, `var`, and in-place mutation are blockers unless specifically exempted
30
+ - mutation of input arguments or shared objects must fail review
31
+ - mutation of domain object instances is forbidden; use `.clone()` instead
32
+ - functions with mutation behavior must be annotated and justified
33
+
34
+ .examples:
35
+
36
+ .positive:
37
+ - `const updated = { ...original, status: 'complete' }`
38
+ - `const newInvoice = invoice.clone({ total: 1200 })`
39
+ - `const next = [...current].sort(byDate)`
40
+
41
+ .negative:
42
+ - `let count = 0; count++`
43
+ - `input.customer.name = 'bob'` // ⛔ input mutation
44
+ - `config.debug = false` // ⛔ shared singleton mutation
45
+ - `arr.push(1)` // ⛔ in-place array mutation
46
+
47
+ .links:
48
+ - see also: `arch:immutable-core`, `args:input-context`, `domain-objects.withImmute`
@@ -0,0 +1,74 @@
1
+ .tactic = flow:narrative
2
+
3
+ .what = structure all logic as flat, linear code paragraphs — never nested branches — to improve clarity and scanability
4
+
5
+ .scope:
6
+ - applies to all procedural code: stitched logic, exports, and internal helpers
7
+ - required for all conditional flows, validation paths, and stateful transformations
8
+
9
+ .why:
10
+ - reduces visual complexity by eliminating indentation creep
11
+ - aligns code with natural narrative flow: guard clauses → main path → fallback
12
+ - makes logic easier to read, debug, test, and extend
13
+ - allows each "paragraph" of logic to be summarized with a single comment
14
+
15
+ .how:
16
+ - eliminate `if/else` and nested `if` blocks entirely
17
+ - use early returns (`if (x) return`, `if (error) throw`) instead
18
+ - prefer `return`, `throw`, or `continue` to flatten control flow
19
+ - define and use **code paragraphs**:
20
+ - a group of 1–5 lines that do one thing together
21
+ - each paragraph must be preceded by a `//` one-line title explaining **what** or **why**
22
+ - paragraph titles act like section headers — they are not optional
23
+ - paragraphs must be separated by a blank line
24
+ - paragraph comments must **not** describe how the code works — only why this paragraph exists
25
+ - deeply nested branches should be broken into separate procedures if needed
26
+
27
+ .enforcement:
28
+ - `else` and nested `if` blocks are blockers and must be refactored
29
+ - any multi-line logic block without a paragraph title is a violation
30
+ - paragraph comments must be one-liners — multiline `//` is forbidden (see `comment-discipline`)
31
+ - code that reads like a decision tree must be flattened into a readable narrative
32
+
33
+ .definitions:
34
+ - **code paragraph** = a contiguous block of related lines, preceded by a single-line `//` title and separated by a blank line
35
+ ```ts
36
+ // validate input format
37
+ const isValid = validateShape(input);
38
+ if (!isValid) return failure();
39
+
40
+ // attempt fallback resolution
41
+ const resolved = tryToResolve(input);
42
+ if (!resolved) UnexpectedCodePathError.throw('resolution failed');
43
+ ```
44
+
45
+ .examples:
46
+
47
+ .positive:
48
+ ```ts
49
+ // return early if invalid
50
+ if (!input.email) return failure();
51
+
52
+ // check for banned domains
53
+ if (input.email.endsWith('@spam.com')) return forbidden();
54
+
55
+ // process verified email
56
+ const result = handleVerifiedEmail(input.email);
57
+ ```
58
+
59
+ .negative:
60
+ ```ts
61
+ if (!input.email) {
62
+ return failure();
63
+ } else {
64
+ if (input.email.endsWith('@spam.com')) {
65
+ return forbidden();
66
+ } else {
67
+ const result = handleVerifiedEmail(input.email);
68
+ ...
69
+ }
70
+ }
71
+ ```
72
+
73
+ .links:
74
+ - see also: `comment-discipline`, `funcs:shape-and-signal`, `flow:guard-first`
@@ -0,0 +1,67 @@
1
+ ### .tactic = codestyle:single-responsibility
2
+
3
+ #### .what
4
+ enforce that every code file and procedure has a singular, clearly-defined responsibility
5
+
6
+ #### .why
7
+ - makes code easier to locate, understand, and test
8
+ - ensures separation of concerns between logic, validation, and orchestration
9
+ - prevents files from bloating with unrelated logic or creeping concerns
10
+
11
+ #### .rules
12
+
13
+ ✅ required
14
+ - every file must export **exactly one** named procedure
15
+ - filename must match the exported procedure
16
+ - all logic in the file must directly support the procedure’s **domain intent**
17
+ - runtime typechecks are only allowed **if** the file's sole purpose is validation
18
+
19
+ ❌ forbidden
20
+ - more than one exported procedure per file
21
+ - co-locating validation, parsing, or orchestration logic alongside domain logic
22
+ - runtime type assertions or guards inside general-purpose logic
23
+ - dead code, TODOs, or unrelated comments in the file
24
+ - guards that apply redundant runtime typechecks (we trust typescript)
25
+
26
+
27
+ #### .examples
28
+
29
+ **✅ good**
30
+ ```ts
31
+ // getCustomerInvoices.ts
32
+ /**
33
+ * .what = retrieves all invoices for a given customer
34
+ * .why = isolates domain logic for invoice lookup by customer
35
+ */
36
+ export const getCustomerInvoices = ({ customerId }: { customerId: string }) => {
37
+ return invoiceDao.findMany({ customerId });
38
+ };
39
+ ```
40
+
41
+
42
+
43
+ **⛔ bad**
44
+ ```ts
45
+ // customerUtils.ts
46
+ // utility file that contains many things
47
+
48
+ export const getCustomerInvoices = (...) => { ... }
49
+
50
+ export const validateCustomer = (...) => { ... } // ❌ multiple responsibilities
51
+
52
+ // random comment about edge cases — ❌ unrelated noise
53
+
54
+ ```
55
+
56
+
57
+ **⛔ bad**
58
+ ```ts
59
+ // getCustomerInvoices.ts
60
+ export const getCustomerInvoices = ({ customerId }: { customerId: string }) => {
61
+ if (typeof customerId !== 'string') // ❌ redundant runtime check
62
+ throw new Error('bad id');
63
+
64
+ return invoiceDao.findMany({ customerId });
65
+ };
66
+ ```
67
+
@@ -0,0 +1,61 @@
1
+ ### .tactic = args:input-context
2
+
3
+ #### .what
4
+ enforce hard requirement that all procedure args to follow the canonical pattern: `(input, context?)` — even for simple one-liners
5
+
6
+ #### .why
7
+ - promotes long-term clarity and change-resilience over short-term brevity
8
+ - prevents positional argument confusion
9
+ - supports context injection without argument churn
10
+ - aligns with domain patterns: input = upstream data, context = runtime environment
11
+ - enables safe refactoring and consistent documentation across codebase
12
+
13
+ #### .where
14
+ - applies to **all function definitions** (sync or async)
15
+ - required for all exported and internal functions in production code
16
+ - expected in tests, hooks, utils, and logic modules
17
+ - only anonymous inline callbacks are **exempt** if tightly scoped
18
+
19
+ #### .how
20
+
21
+ ##### ✅ required
22
+ - every function must accept exactly:
23
+ - one `input` arg — a destructurable object
24
+ - optional second `context` arg — also a destructurable object
25
+
26
+ - **hard requirement** — applies even to trivial utilities, pure transforms, and data extractors
27
+
28
+ - `input` does **not** need to be destructured at the function boundary; shape like `(input: { ... })` is fine
29
+ - `function` keyword is forbidden unless implementing class methods (see `.tactic:funcs:arrow-only`)
30
+
31
+ ##### ❌ forbidden
32
+ - more than 2 positional args
33
+ - non-destructurable inputs
34
+ - context blended into input
35
+ - inline positional args unless anonymous
36
+
37
+
38
+ ---
39
+
40
+ ### .examples
41
+
42
+ ##### ✅ positive
43
+ ```ts
44
+ // standard function
45
+ export const genRoute = async (input: { slug: string }, context?: { traceId?: string }) => { ... }
46
+
47
+ // internal logic
48
+ const updateUser = ({ userId }: { userId: string }, context: { userDao: UserDao }) => { ... }
49
+
50
+ // test
51
+ expect(hasChanges({ before, after })).toBe(true);
52
+ ```ts
53
+
54
+ ##### ❌ negative
55
+ ```ts
56
+ export function doThing(a, b, c) {} // ⛔ positional args & function keyword
57
+
58
+ handleRequest(input, options, env) // ⛔ more than two args
59
+
60
+ export const getTotal = (invoice) => ... // ⛔ input not typed
61
+ ```
@@ -0,0 +1,47 @@
1
+ ### .tactic = funcs:arrow-only
2
+
3
+ #### .what
4
+ enforce that all procedures are declared using arrow functions
5
+ disallow use of `function` keyword for any procedure
6
+
7
+ #### .where
8
+ - applies to all exported and internal functions across codebase
9
+ - required in modules, utilities, hooks, logic, and test declarations
10
+ - exempt only for class methods or dynamic `this` binding (rare)
11
+
12
+ #### .why
13
+ - enforces lexical `this` binding for predictable behavior
14
+ - aligns code structure with uniform declaration style
15
+ - improves visual clarity and reduces syntactic noise
16
+ - simplifies use with higher-order functions, closures, and composability
17
+
18
+ #### .how
19
+
20
+ ##### .rules
21
+ - use arrow syntax (`const fn = (input) => {}`) for all functions
22
+ - never use `function` keyword for standalone or inline functions
23
+ - use object methods only when tied to a `class` or API contract
24
+ - always destructure input as the first arg if applicable
25
+
26
+ ##### .examples
27
+
28
+ ###### .positive
29
+ ```ts
30
+ export const setCustomerPhone = ({ customer, phone }) => {
31
+ return { ...customer, phone };
32
+ };
33
+
34
+ const getName = (input) => input.name;
35
+ ```
36
+
37
+
38
+ ###### .negative
39
+ ```ts
40
+ function setCustomerPhone({ customer, phone }) { // ⛔ function keyword
41
+ return { ...customer, phone };
42
+ }
43
+
44
+ export function doWork() { // ⛔ export with function
45
+ ...
46
+ }
47
+ ```
@@ -0,0 +1,53 @@
1
+
2
+ .tactic = mech:contract-before-implementation
3
+
4
+ .what = declare the shape and expectations of behavior (the contract) before writing its implementation
5
+
6
+ .why:
7
+ - forces clarity about what is being built and why
8
+ - prevents premature optimization and over-engineering
9
+ - creates a shared agreement for both the builder and consumer
10
+ - enables parallel work (e.g., backend + frontend, or logic + UI)
11
+
12
+ .scope:
13
+ - applies to procedures, stitched flows, and any domain mechanisms
14
+ - applies at both macro (API endpoint, service) and micro (function, component) levels
15
+
16
+ .how:
17
+ - always begin with a **procedure type** that defines:
18
+ - function signature or interface
19
+ - expected inputs and output shape
20
+ - error modes and invariants
21
+ - why it exists (motivation or business rule)
22
+
23
+ .examples:
24
+
25
+ ✅ good
26
+ // domain/procedures/sendInvoice.ts
27
+
28
+ /**
29
+ * .what = sends an invoice to the customer and marks it as sent
30
+ * .why = required for customer billing compliance and automation
31
+ */
32
+ export const sendInvoice = async ({
33
+ invoice,
34
+ customer,
35
+ }: {
36
+ invoice: Invoice;
37
+ customer: Customer;
38
+ }): Promise<{ success: true }> => {
39
+ // ...
40
+ };
41
+
42
+ ❌ bad
43
+ // logic/sendInvoice.ts
44
+
45
+ export const sendInvoice = async (invoice, customer) => {
46
+ // suddenly starts doing 4 things and mutates stuff randomly
47
+ };
48
+
49
+ .enforcement:
50
+ - if a PR implements logic without any visible contract: **blocker**
51
+ - if types are vague or inferred (e.g. `any`, `unknown`): **blocker**
52
+ - if behavior differs from contract or lacks a test: **blocker**
53
+
@@ -0,0 +1,62 @@
1
+ ### .tactic = tests:given-when-then
2
+
3
+ #### .what
4
+ use `jest` in combination with `test-fns` to structure tests with `given / when / then` hierarchy
5
+
6
+ #### .where
7
+ - applies to all test suites across core logic and modules
8
+ - required for integration tests and expected for unit tests
9
+ - recommended for test readability, maintainability, and intent traceability
10
+
11
+ #### .why
12
+ - expresses test intent and flow in human-readable structure
13
+ - aligns test structure with natural reasoning: context → action → result
14
+ - improves ability to isolate, debug, and extend test scenarios
15
+ - keeps test surface minimal and expressive, especially for high-context logic
16
+
17
+ #### .how
18
+
19
+ ##### .rules
20
+ - use `describe()` for grouping related logic (e.g., a route or stitcher)
21
+ - use `given()` to describe the setup scenario
22
+ - must establish all required input (e.g., files, threads, role context)
23
+ - use `when()` to declare the act or trigger
24
+ - should define one clear execution path
25
+ - use `then()` to assert outcomes
26
+ - may include async calls, file checks, or output inspection
27
+
28
+ ##### .examples
29
+
30
+ ###### .positive
31
+ ```ts
32
+ import { given, when, then } from 'test-fns';
33
+
34
+ given('a mechanic with ask, claim, and coderefs', () => {
35
+ const coderef = genArtifactGitFile({ uri: 'file.md' });
36
+
37
+ beforeEach(async () => {
38
+ await coderef.set({ content: '...' });
39
+ });
40
+
41
+ when('executed', () => {
42
+ const threads = { /* setup threads */ };
43
+
44
+ then('updates the claims artifact', async () => {
45
+ const result = await enweaveOneStitcher({ stitcher, threads }, context);
46
+ const content = await claimsArt.get();
47
+ expect(content).toContain('...');
48
+ });
49
+
50
+ then('throws on invalid input', async () => {
51
+ const error = await getError(enweaveOneStitcher({ stitcher, threads: {} }, context));
52
+ expect(error).toBeInstanceOf(ThreadMissError)
53
+ });
54
+ });
55
+ });
56
+ ```
57
+
58
+ ```ts
59
+ when('executed', async () => { // ⛔ async not allowed in when()
60
+ const result = await doSomething();
61
+ });
62
+ ```
@@ -0,0 +1,88 @@
1
+
2
+ ### .tactic = funcs:what-why-comments
3
+
4
+ #### .what
5
+ require `.what` and `.why` comments to prefix every named procedure and code paragraph
6
+
7
+ #### .why
8
+ - improves readability for future travelers
9
+ - captures intent behind decisions, not just behavior
10
+ - speeds up audits, refactors, and onboarding
11
+ - reinforces consistent communication in code
12
+
13
+ ---
14
+
15
+ #### .how
16
+
17
+ ##### .procedure headers
18
+
19
+ every named function must begin with a jsdoc block like:
20
+
21
+ ```ts
22
+ /**
23
+ * .what = summarize the intent of the procedure
24
+ * .why = explain why it exists or why it matters
25
+ * .note = optional; record special behaviors, edge cases, caveats
26
+ */
27
+ ```
28
+
29
+ - mandatory for all exported procedures => this is a BLOCKER
30
+ - required for helpers that aren’t self-evident
31
+ - optional for anonymous one-liners or trivial passthroughs
32
+
33
+
34
+ ##### .paragraph summaries
35
+
36
+ every logical paragraph (group of lines) must be prefixed with a `//` comment summarizing its purpose:
37
+
38
+ ```ts
39
+ // load invoice from database, for status check later in flow
40
+ const invoice = await getInvoiceById(invoiceId);
41
+ ```
42
+
43
+ - avoid duplicating code — focus on *intent*
44
+ - explain why something matters, not just what it is
45
+ - group related lines under a shared summary
46
+ - important: compress into one line. if a paragraph summary is multiline, then the code paragraph is complex enough to need its own procedure and testsuite
47
+
48
+
49
+ #### .examples
50
+
51
+ ##### ✅ positive
52
+
53
+ ```ts
54
+ /**
55
+ * .what = generates a proposal by iterating until a releasable version is judged
56
+ * .why = ensures only clean code reaches the reviewer, via mechanic feedback loop
57
+ */
58
+ export const proposeCode = async ({ threads }) => {
59
+ // iterate to gather feedback and judgment on inflight code
60
+ const result = await runIterateCycle({ threads });
61
+
62
+ // expose artifact for downstream routes
63
+ return result.threads.artist.context.stash.art.inflight;
64
+ };
65
+ ```
66
+
67
+ ##### ❌ negative
68
+
69
+ ```ts
70
+ // run flow ⛔ unclear
71
+ const r = await run();
72
+
73
+ return r.artifact; // ⛔ what is this? why return this?
74
+
75
+ // very long comment describing why this block exists
76
+ // and what it does and why it's written in this particular way
77
+ // suggests the code below is too complex and should be split out
78
+ const result = someLogic(input);
79
+ const adjusted = adjustResult(result);
80
+ const validated = validate(adjusted);
81
+ const final = finalize(validated);
82
+ ```
83
+
84
+ #### .where
85
+
86
+ - applies to all production code: modules, utilities, logic, and exports
87
+ - expected in test files for setup blocks and assertions
88
+ - exempt only for tiny, obviously self-contained expressions
@@ -0,0 +1,98 @@
1
+
2
+ ### .tactic = comment-discipline
3
+
4
+ #### .what
5
+ require jsdoc style `.what` and `.why` comments to prefix every named procedure
6
+ require oneliner summaries of .what and why comments to precede every code paragraph
7
+
8
+ #### .why
9
+ - improves readability for future travelers
10
+ - captures intent behind decisions, not just behavior
11
+ - speeds up audits, refactors, and onboarding
12
+ - reinforces consistent communication in code
13
+
14
+
15
+ ### .comment discipline
16
+
17
+ comments are a hard requirement — they must follow precise structure and length:
18
+
19
+ ✅ required
20
+ - /** .what, .why */ block above all named procedures
21
+ - // one-liner before every logical paragraph of code
22
+
23
+ ❌ forbidden
24
+ - missing .what or .why above a procedure
25
+ - multiline // paragraph comments
26
+ - vague, redundant, or “code-shaped” comments
27
+
28
+ ##### .procedure headers
29
+ every named function must begin with:
30
+
31
+ ```ts
32
+ /**
33
+ * .what = intent summary
34
+ * .why = reason it exists or matters
35
+ * .note = optional; caveats or special behavior
36
+ */
37
+ const doThing = (input: {}, context) => { ... }
38
+ ```
39
+
40
+ rules:
41
+ - both .what and .why are mandatory — missing either = BLOCKER
42
+ - .what must be 1line max, clear and scan-friendly
43
+ - .why must be 3lines max, clear and scan-friendly
44
+ - .note is optional but must be concise
45
+
46
+
47
+ ##### .code paragraphs
48
+
49
+ every meaningful block of lines must start with a one-line summary:
50
+
51
+ ```ts
52
+ // load invoice and raise on pastdue
53
+ const invoice = await getInvoiceById(invoiceId);
54
+ if (invoice.status === 'PASTDUE') UnexpectedCodePathError.throw(...)
55
+ ```
56
+
57
+ rules:
58
+ - must summarize intent (why this block exists), not echo code
59
+ - strictly one line — if it needs more, extract into its own procedure
60
+ - comment must precede the code it describes and have a newline predecessor (think of it like a paragraph title)
61
+
62
+ ## .examples
63
+
64
+ expected, positive examples
65
+ ```ts
66
+ /**
67
+ * .what = generates a proposal via mechanic-reviewer feedback loop
68
+ * .why = ensures code reaches quality bar before review
69
+ */
70
+ export const proposeCode = async ({ threads }) => {
71
+ // gather mechanic feedback through iteration
72
+ const result = await runIterateCycle({ threads });
73
+
74
+ // expose artifact for downstream use
75
+ return result.threads.artist.context.stash.art.inflight;
76
+ };
77
+ ```
78
+
79
+
80
+ forbidden, negative examples
81
+ ```ts
82
+ // missing .what/.why above export ⛔ blocker
83
+ export const doStuff = () => { ... }
84
+
85
+ // vague comment ⛔ no intent
86
+ // run flow
87
+ const r = run();
88
+
89
+ // multiline paragraph comment ⛔ must extract into procedure
90
+ // handle logic for retries because retries are complicated
91
+ // and they sometimes need to be skipped on failure
92
+ const result = retry(input);
93
+ ```
94
+
95
+ ## .where
96
+ - required across all prod code (logic, utils, exports)
97
+ - expected in tests for setup/assert blocks
98
+ - exempt only for tiny expressions or internal lambdas