productfoo 0.0.0-stage → 1.0.1

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 (498) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +338 -2
  3. package/bin/foo +3 -0
  4. package/bin/foo.mjs +42 -0
  5. package/commands/bug.md +31 -0
  6. package/commands/discovery.md +28 -0
  7. package/commands/ideate.md +27 -0
  8. package/commands/init.md +28 -0
  9. package/commands/pitch.md +27 -0
  10. package/commands/preview.md +25 -0
  11. package/commands/research.md +31 -0
  12. package/commands/roast.md +27 -0
  13. package/commands/spec.md +30 -0
  14. package/config/pricing.yaml +198 -0
  15. package/config/routing-policy.yaml +171 -0
  16. package/dist-public/src/activeModel.d.ts +83 -0
  17. package/dist-public/src/activeModel.js +331 -0
  18. package/dist-public/src/agentAdapters.d.ts +122 -0
  19. package/dist-public/src/agentAdapters.js +178 -0
  20. package/dist-public/src/agentState.d.ts +43 -0
  21. package/dist-public/src/agentState.js +177 -0
  22. package/dist-public/src/bugCapsule.d.ts +94 -0
  23. package/dist-public/src/bugCapsule.js +227 -0
  24. package/dist-public/src/bugCapture.d.ts +26 -0
  25. package/dist-public/src/bugCapture.js +251 -0
  26. package/dist-public/src/bugOwnerLog.d.ts +93 -0
  27. package/dist-public/src/bugOwnerLog.js +304 -0
  28. package/dist-public/src/bugReportStore.d.ts +48 -0
  29. package/dist-public/src/bugReportStore.js +860 -0
  30. package/dist-public/src/bugSpecContext.d.ts +7 -0
  31. package/dist-public/src/bugSpecContext.js +129 -0
  32. package/dist-public/src/channelFreshness.d.ts +25 -0
  33. package/dist-public/src/channelFreshness.js +194 -0
  34. package/dist-public/src/cli.d.ts +30 -0
  35. package/dist-public/src/cli.js +1667 -0
  36. package/dist-public/src/cliArgs.d.ts +7 -0
  37. package/dist-public/src/cliArgs.js +44 -0
  38. package/dist-public/src/codeCatalog.d.ts +41 -0
  39. package/dist-public/src/codeCatalog.js +197 -0
  40. package/dist-public/src/commandContract.d.ts +84 -0
  41. package/dist-public/src/commandContract.js +390 -0
  42. package/dist-public/src/commandUsage.d.ts +3 -0
  43. package/dist-public/src/commandUsage.js +30 -0
  44. package/dist-public/src/commands/agent.d.ts +60 -0
  45. package/dist-public/src/commands/agent.js +1353 -0
  46. package/dist-public/src/commands/asp.d.ts +8 -0
  47. package/dist-public/src/commands/asp.js +669 -0
  48. package/dist-public/src/commands/evalCmd.d.ts +4 -0
  49. package/dist-public/src/commands/evalCmd.js +405 -0
  50. package/dist-public/src/commands/login.d.ts +25 -0
  51. package/dist-public/src/commands/login.js +94 -0
  52. package/dist-public/src/commands/loop.d.ts +16 -0
  53. package/dist-public/src/commands/loop.js +619 -0
  54. package/dist-public/src/commands/reconcile.d.ts +41 -0
  55. package/dist-public/src/commands/reconcile.js +292 -0
  56. package/dist-public/src/commands/runtime.d.ts +1 -0
  57. package/dist-public/src/commands/runtime.js +36 -0
  58. package/dist-public/src/commands/scanRedact.d.ts +8 -0
  59. package/dist-public/src/commands/scanRedact.js +266 -0
  60. package/dist-public/src/commands/setup.d.ts +28 -0
  61. package/dist-public/src/commands/setup.js +398 -0
  62. package/dist-public/src/commands/shared.d.ts +17 -0
  63. package/dist-public/src/commands/shared.js +147 -0
  64. package/dist-public/src/commands/source.d.ts +1 -0
  65. package/dist-public/src/commands/source.js +134 -0
  66. package/dist-public/src/commands/specCmd.d.ts +24 -0
  67. package/dist-public/src/commands/specCmd.js +794 -0
  68. package/dist-public/src/commands/update.d.ts +61 -0
  69. package/dist-public/src/commands/update.js +244 -0
  70. package/dist-public/src/comprehensionSignal.d.ts +20 -0
  71. package/dist-public/src/comprehensionSignal.js +166 -0
  72. package/dist-public/src/conductor/diversity.d.ts +48 -0
  73. package/dist-public/src/conductor/diversity.js +423 -0
  74. package/dist-public/src/conductor/engine.d.ts +7 -0
  75. package/dist-public/src/conductor/engine.js +295 -0
  76. package/dist-public/src/conductor/families/ideate.d.ts +2 -0
  77. package/dist-public/src/conductor/families/ideate.js +255 -0
  78. package/dist-public/src/conductor/families/interview.d.ts +2 -0
  79. package/dist-public/src/conductor/families/interview.js +39 -0
  80. package/dist-public/src/conductor/families/specSwarm.d.ts +2 -0
  81. package/dist-public/src/conductor/families/specSwarm.js +146 -0
  82. package/dist-public/src/conductor/familyDelivery.d.ts +6 -0
  83. package/dist-public/src/conductor/familyDelivery.js +37 -0
  84. package/dist-public/src/conductor/familyPackArtifact.d.ts +4 -0
  85. package/dist-public/src/conductor/familyPackArtifact.js +260 -0
  86. package/dist-public/src/conductor/ideateDecision.d.ts +6 -0
  87. package/dist-public/src/conductor/ideateDecision.js +237 -0
  88. package/dist-public/src/conductor/pack.d.ts +26 -0
  89. package/dist-public/src/conductor/pack.js +75 -0
  90. package/dist-public/src/conductor/types.d.ts +111 -0
  91. package/dist-public/src/conductor/types.js +7 -0
  92. package/dist-public/src/configPath.d.ts +2 -0
  93. package/dist-public/src/configPath.js +7 -0
  94. package/dist-public/src/discoveryArtifacts.d.ts +54 -0
  95. package/dist-public/src/discoveryArtifacts.js +467 -0
  96. package/dist-public/src/discoveryCommand.d.ts +127 -0
  97. package/dist-public/src/discoveryCommand.js +2148 -0
  98. package/dist-public/src/discoveryConnections.d.ts +339 -0
  99. package/dist-public/src/discoveryConnections.js +613 -0
  100. package/dist-public/src/discoveryDocs.d.ts +129 -0
  101. package/dist-public/src/discoveryDocs.js +577 -0
  102. package/dist-public/src/discoveryEvidence.d.ts +59 -0
  103. package/dist-public/src/discoveryEvidence.js +198 -0
  104. package/dist-public/src/discoveryFireflies.d.ts +25 -0
  105. package/dist-public/src/discoveryFireflies.js +551 -0
  106. package/dist-public/src/discoveryGmail.d.ts +12 -0
  107. package/dist-public/src/discoveryGmail.js +466 -0
  108. package/dist-public/src/discoveryGong.d.ts +12 -0
  109. package/dist-public/src/discoveryGong.js +491 -0
  110. package/dist-public/src/discoveryLearningRouting.d.ts +90 -0
  111. package/dist-public/src/discoveryLearningRouting.js +405 -0
  112. package/dist-public/src/discoveryMatching.d.ts +26 -0
  113. package/dist-public/src/discoveryMatching.js +73 -0
  114. package/dist-public/src/discoveryOutlook.d.ts +12 -0
  115. package/dist-public/src/discoveryOutlook.js +492 -0
  116. package/dist-public/src/discoveryProcess.d.ts +221 -0
  117. package/dist-public/src/discoveryProcess.js +703 -0
  118. package/dist-public/src/discoveryProof.d.ts +143 -0
  119. package/dist-public/src/discoveryProof.js +529 -0
  120. package/dist-public/src/discoveryProviders.d.ts +152 -0
  121. package/dist-public/src/discoveryProviders.js +756 -0
  122. package/dist-public/src/discoveryReadiness.d.ts +219 -0
  123. package/dist-public/src/discoveryReadiness.js +672 -0
  124. package/dist-public/src/discoveryReconcile.d.ts +57 -0
  125. package/dist-public/src/discoveryReconcile.js +424 -0
  126. package/dist-public/src/discoverySlack.d.ts +12 -0
  127. package/dist-public/src/discoverySlack.js +452 -0
  128. package/dist-public/src/discoverySources.d.ts +56 -0
  129. package/dist-public/src/discoverySources.js +322 -0
  130. package/dist-public/src/discoverySync.d.ts +52 -0
  131. package/dist-public/src/discoverySync.js +151 -0
  132. package/dist-public/src/discoverySynthesis.d.ts +57 -0
  133. package/dist-public/src/discoverySynthesis.js +215 -0
  134. package/dist-public/src/discoveryTeams.d.ts +12 -0
  135. package/dist-public/src/discoveryTeams.js +516 -0
  136. package/dist-public/src/discoveryZoom.d.ts +12 -0
  137. package/dist-public/src/discoveryZoom.js +523 -0
  138. package/dist-public/src/elicitationSurface.d.ts +13 -0
  139. package/dist-public/src/elicitationSurface.js +77 -0
  140. package/dist-public/src/errorReport.d.ts +99 -0
  141. package/dist-public/src/errorReport.js +443 -0
  142. package/dist-public/src/errorTaxonomy.d.ts +84 -0
  143. package/dist-public/src/errorTaxonomy.js +189 -0
  144. package/dist-public/src/evalCalibration.d.ts +82 -0
  145. package/dist-public/src/evalCalibration.js +169 -0
  146. package/dist-public/src/evalChecks.d.ts +21 -0
  147. package/dist-public/src/evalChecks.js +295 -0
  148. package/dist-public/src/evalCompile.d.ts +56 -0
  149. package/dist-public/src/evalCompile.js +58 -0
  150. package/dist-public/src/evalImprove.d.ts +60 -0
  151. package/dist-public/src/evalImprove.js +175 -0
  152. package/dist-public/src/evalJudge.d.ts +47 -0
  153. package/dist-public/src/evalJudge.js +143 -0
  154. package/dist-public/src/evalLabels.d.ts +100 -0
  155. package/dist-public/src/evalLabels.js +287 -0
  156. package/dist-public/src/evalRecord.d.ts +68 -0
  157. package/dist-public/src/evalRecord.js +165 -0
  158. package/dist-public/src/evalRoast.d.ts +88 -0
  159. package/dist-public/src/evalRoast.js +249 -0
  160. package/dist-public/src/evidenceIntake.d.ts +66 -0
  161. package/dist-public/src/evidenceIntake.js +356 -0
  162. package/dist-public/src/feedback.d.ts +78 -0
  163. package/dist-public/src/feedback.js +294 -0
  164. package/dist-public/src/firefliesClient.d.ts +106 -0
  165. package/dist-public/src/firefliesClient.js +258 -0
  166. package/dist-public/src/firstMoveTensions.d.ts +10 -0
  167. package/dist-public/src/firstMoveTensions.js +93 -0
  168. package/dist-public/src/gitRun.d.ts +21 -0
  169. package/dist-public/src/gitRun.js +50 -0
  170. package/dist-public/src/githubReconcile.d.ts +94 -0
  171. package/dist-public/src/githubReconcile.js +205 -0
  172. package/dist-public/src/gmailNango.d.ts +131 -0
  173. package/dist-public/src/gmailNango.js +329 -0
  174. package/dist-public/src/gongNango.d.ts +118 -0
  175. package/dist-public/src/gongNango.js +308 -0
  176. package/dist-public/src/grammarGate.d.ts +13 -0
  177. package/dist-public/src/grammarGate.js +72 -0
  178. package/dist-public/src/harnessGates.d.ts +65 -0
  179. package/dist-public/src/harnessGates.js +168 -0
  180. package/dist-public/src/humanSurfaceEval.d.ts +19 -0
  181. package/dist-public/src/humanSurfaceEval.js +156 -0
  182. package/dist-public/src/ideate.d.ts +43 -0
  183. package/dist-public/src/ideate.js +255 -0
  184. package/dist-public/src/ideateContext.d.ts +11 -0
  185. package/dist-public/src/ideateContext.js +83 -0
  186. package/dist-public/src/index.d.ts +2 -0
  187. package/dist-public/src/index.js +4 -0
  188. package/dist-public/src/initCommand.d.ts +25 -0
  189. package/dist-public/src/initCommand.js +558 -0
  190. package/dist-public/src/interviewGate.d.ts +25 -0
  191. package/dist-public/src/interviewGate.js +126 -0
  192. package/dist-public/src/jsonFile.d.ts +2 -0
  193. package/dist-public/src/jsonFile.js +22 -0
  194. package/dist-public/src/loopBudget.d.ts +182 -0
  195. package/dist-public/src/loopBudget.js +494 -0
  196. package/dist-public/src/loopContracts.d.ts +35 -0
  197. package/dist-public/src/loopContracts.js +364 -0
  198. package/dist-public/src/machineState.d.ts +1 -0
  199. package/dist-public/src/machineState.js +9 -0
  200. package/dist-public/src/notionNango.d.ts +93 -0
  201. package/dist-public/src/notionNango.js +279 -0
  202. package/dist-public/src/orchestrationResult.d.ts +11 -0
  203. package/dist-public/src/orchestrationResult.js +73 -0
  204. package/dist-public/src/outlookNango.d.ts +124 -0
  205. package/dist-public/src/outlookNango.js +327 -0
  206. package/dist-public/src/packetCorrections.d.ts +40 -0
  207. package/dist-public/src/packetCorrections.js +172 -0
  208. package/dist-public/src/packetGlossary.d.ts +6 -0
  209. package/dist-public/src/packetGlossary.js +42 -0
  210. package/dist-public/src/packetIndex.d.ts +54 -0
  211. package/dist-public/src/packetIndex.js +744 -0
  212. package/dist-public/src/packetIndexEntry.d.ts +3 -0
  213. package/dist-public/src/packetIndexEntry.js +128 -0
  214. package/dist-public/src/packetIndexServe.d.ts +13 -0
  215. package/dist-public/src/packetIndexServe.js +113 -0
  216. package/dist-public/src/packetIndexWorker.d.ts +7 -0
  217. package/dist-public/src/packetIndexWorker.js +45 -0
  218. package/dist-public/src/packetLifecycle.d.ts +30 -0
  219. package/dist-public/src/packetLifecycle.js +127 -0
  220. package/dist-public/src/packetReconcile.d.ts +73 -0
  221. package/dist-public/src/packetReconcile.js +386 -0
  222. package/dist-public/src/packetStatus.d.ts +125 -0
  223. package/dist-public/src/packetStatus.js +770 -0
  224. package/dist-public/src/packetValidation.d.ts +17 -0
  225. package/dist-public/src/packetValidation.js +333 -0
  226. package/dist-public/src/packetVerify.d.ts +73 -0
  227. package/dist-public/src/packetVerify.js +303 -0
  228. package/dist-public/src/packetWrite.d.ts +52 -0
  229. package/dist-public/src/packetWrite.js +448 -0
  230. package/dist-public/src/pitch.d.ts +38 -0
  231. package/dist-public/src/pitch.js +154 -0
  232. package/dist-public/src/processMemo.d.ts +8 -0
  233. package/dist-public/src/processMemo.js +23 -0
  234. package/dist-public/src/productDetect.d.ts +30 -0
  235. package/dist-public/src/productDetect.js +376 -0
  236. package/dist-public/src/profile.d.ts +62 -0
  237. package/dist-public/src/profile.js +334 -0
  238. package/dist-public/src/questionModel.d.ts +46 -0
  239. package/dist-public/src/questionModel.js +74 -0
  240. package/dist-public/src/questionText.d.ts +7 -0
  241. package/dist-public/src/questionText.js +38 -0
  242. package/dist-public/src/redactConfig.d.ts +2 -0
  243. package/dist-public/src/redactConfig.js +11 -0
  244. package/dist-public/src/redactEngine.d.ts +59 -0
  245. package/dist-public/src/redactEngine.js +509 -0
  246. package/dist-public/src/redactGate.d.ts +63 -0
  247. package/dist-public/src/redactGate.js +209 -0
  248. package/dist-public/src/repoRead.d.ts +29 -0
  249. package/dist-public/src/repoRead.js +160 -0
  250. package/dist-public/src/research.d.ts +242 -0
  251. package/dist-public/src/research.js +1314 -0
  252. package/dist-public/src/researchCompletion.d.ts +34 -0
  253. package/dist-public/src/researchCompletion.js +123 -0
  254. package/dist-public/src/researchExecution.d.ts +47 -0
  255. package/dist-public/src/researchExecution.js +309 -0
  256. package/dist-public/src/researchFormat.d.ts +21 -0
  257. package/dist-public/src/researchFormat.js +77 -0
  258. package/dist-public/src/researchGate.d.ts +86 -0
  259. package/dist-public/src/researchGate.js +1036 -0
  260. package/dist-public/src/researchReceipt.d.ts +76 -0
  261. package/dist-public/src/researchReceipt.js +148 -0
  262. package/dist-public/src/researchRender.d.ts +2 -0
  263. package/dist-public/src/researchRender.js +267 -0
  264. package/dist-public/src/researchSigningKey.d.ts +19 -0
  265. package/dist-public/src/researchSigningKey.js +95 -0
  266. package/dist-public/src/riskClassify.d.ts +42 -0
  267. package/dist-public/src/riskClassify.js +149 -0
  268. package/dist-public/src/routines.d.ts +42 -0
  269. package/dist-public/src/routines.js +269 -0
  270. package/dist-public/src/routingPolicy.d.ts +172 -0
  271. package/dist-public/src/routingPolicy.js +646 -0
  272. package/dist-public/src/secretInput.d.ts +8 -0
  273. package/dist-public/src/secretInput.js +89 -0
  274. package/dist-public/src/selfCheck.d.ts +7 -0
  275. package/dist-public/src/selfCheck.js +473 -0
  276. package/dist-public/src/selfCheckCache.d.ts +29 -0
  277. package/dist-public/src/selfCheckCache.js +147 -0
  278. package/dist-public/src/severityClass.d.ts +15 -0
  279. package/dist-public/src/severityClass.js +22 -0
  280. package/dist-public/src/skillClientPolicy.d.ts +8 -0
  281. package/dist-public/src/skillClientPolicy.js +16 -0
  282. package/dist-public/src/skillLocal.d.ts +98 -0
  283. package/dist-public/src/skillLocal.js +463 -0
  284. package/dist-public/src/skillTreeDigest.d.ts +9 -0
  285. package/dist-public/src/skillTreeDigest.js +64 -0
  286. package/dist-public/src/slackNango.d.ts +62 -0
  287. package/dist-public/src/slackNango.js +208 -0
  288. package/dist-public/src/social/arxiv.d.ts +19 -0
  289. package/dist-public/src/social/arxiv.js +96 -0
  290. package/dist-public/src/social/github.d.ts +2 -0
  291. package/dist-public/src/social/github.js +78 -0
  292. package/dist-public/src/social/hackernews.d.ts +2 -0
  293. package/dist-public/src/social/hackernews.js +67 -0
  294. package/dist-public/src/social/index.d.ts +10 -0
  295. package/dist-public/src/social/index.js +79 -0
  296. package/dist-public/src/social/reddit.d.ts +2 -0
  297. package/dist-public/src/social/reddit.js +125 -0
  298. package/dist-public/src/social/types.d.ts +73 -0
  299. package/dist-public/src/social/types.js +61 -0
  300. package/dist-public/src/social/xml.d.ts +10 -0
  301. package/dist-public/src/social/xml.js +49 -0
  302. package/dist-public/src/social/youtube.d.ts +7 -0
  303. package/dist-public/src/social/youtube.js +217 -0
  304. package/dist-public/src/sourceIngress.d.ts +488 -0
  305. package/dist-public/src/sourceIngress.js +1651 -0
  306. package/dist-public/src/specAfter.d.ts +187 -0
  307. package/dist-public/src/specAfter.js +814 -0
  308. package/dist-public/src/specBudget.d.ts +124 -0
  309. package/dist-public/src/specBudget.js +424 -0
  310. package/dist-public/src/specDecisionSignals.d.ts +38 -0
  311. package/dist-public/src/specDecisionSignals.js +121 -0
  312. package/dist-public/src/specLinkedCommits.d.ts +7 -0
  313. package/dist-public/src/specLinkedCommits.js +107 -0
  314. package/dist-public/src/specSections.d.ts +105 -0
  315. package/dist-public/src/specSections.js +718 -0
  316. package/dist-public/src/statusGlyphs.d.ts +18 -0
  317. package/dist-public/src/statusGlyphs.js +75 -0
  318. package/dist-public/src/swarmCommand.d.ts +10 -0
  319. package/dist-public/src/swarmCommand.js +96 -0
  320. package/dist-public/src/teamsNango.d.ts +114 -0
  321. package/dist-public/src/teamsNango.js +301 -0
  322. package/dist-public/src/tokenStore.d.ts +10 -0
  323. package/dist-public/src/tokenStore.js +77 -0
  324. package/dist-public/src/trustEnvelope.d.ts +78 -0
  325. package/dist-public/src/trustEnvelope.js +392 -0
  326. package/dist-public/src/untrustedText.d.ts +6 -0
  327. package/dist-public/src/untrustedText.js +20 -0
  328. package/dist-public/src/updateNotice.d.ts +41 -0
  329. package/dist-public/src/updateNotice.js +290 -0
  330. package/dist-public/src/vendorYaml.d.ts +1 -0
  331. package/dist-public/src/vendorYaml.js +7374 -0
  332. package/dist-public/src/workflowRunActuals.d.ts +67 -0
  333. package/dist-public/src/workflowRunActuals.js +184 -0
  334. package/dist-public/src/zendeskDiscovery.d.ts +12 -0
  335. package/dist-public/src/zendeskDiscovery.js +513 -0
  336. package/dist-public/src/zendeskNango.d.ts +131 -0
  337. package/dist-public/src/zendeskNango.js +344 -0
  338. package/dist-public/src/zoomNango.d.ts +106 -0
  339. package/dist-public/src/zoomNango.js +351 -0
  340. package/docs/CHANGELOG.md +32 -0
  341. package/docs/THIRD_PARTY_NOTICES.md +36 -0
  342. package/package.json +71 -4
  343. package/schemas/bug-capsule-receipt.schema.json +54 -0
  344. package/schemas/bug-capsule.schema.json +189 -0
  345. package/schemas/discovery-evidence-envelope.schema.json +79 -0
  346. package/schemas/discovery-processing-receipt.schema.json +71 -0
  347. package/schemas/discovery-service-contract.schema.json +189 -0
  348. package/skills/AGENTS.md +32 -0
  349. package/skills/README.md +287 -0
  350. package/skills/bug/SKILL.md +49 -0
  351. package/skills/build-preview-spec/SKILL.md +103 -0
  352. package/skills/capture-external-artifact/SKILL.md +23 -0
  353. package/skills/capture-external-artifact/agents/openai.yaml +4 -0
  354. package/skills/capture-external-artifact/references/extractor-libraries.md +27 -0
  355. package/skills/check-spec-health/SKILL.md +45 -0
  356. package/skills/check-spec-health/agents/openai.yaml +4 -0
  357. package/skills/competitive-positioning/SKILL.md +86 -0
  358. package/skills/competitive-positioning/agents/openai.yaml +4 -0
  359. package/skills/cpo-lens/SKILL.md +398 -0
  360. package/skills/cpo-lens/agents/openai.yaml +4 -0
  361. package/skills/create-prd/SKILL.md +26 -0
  362. package/skills/create-prd/agents/openai.yaml +4 -0
  363. package/skills/customer-discovery/SKILL.md +192 -0
  364. package/skills/design-system/SKILL.md +49 -0
  365. package/skills/design-system/agents/openai.yaml +4 -0
  366. package/skills/discussion-guide/SKILL.md +75 -0
  367. package/skills/discussion-guide/agents/openai.yaml +4 -0
  368. package/skills/firecrawl-research-papers/SKILL.md +96 -0
  369. package/skills/firecrawl-research-papers/agents/openai.yaml +4 -0
  370. package/skills/foo-roast/SKILL.md +325 -0
  371. package/skills/generate-gtm-brief/SKILL.md +41 -0
  372. package/skills/generate-gtm-brief/agents/openai.yaml +4 -0
  373. package/skills/generate-gtm-brief/references/gtm-brief-template.md +56 -0
  374. package/skills/gong-quotes/SKILL.md +43 -0
  375. package/skills/gong-quotes/agents/openai.yaml +4 -0
  376. package/skills/grill-me/SKILL.md +27 -0
  377. package/skills/grill-me/agents/openai.yaml +4 -0
  378. package/skills/ideate/SKILL.md +180 -0
  379. package/skills/ideate/references/family-packs.md +5 -0
  380. package/skills/initiative-tracker/SKILL.md +23 -0
  381. package/skills/initiative-tracker/agents/openai.yaml +4 -0
  382. package/skills/interop-review/SKILL.md +25 -0
  383. package/skills/interop-review/agents/openai.yaml +4 -0
  384. package/skills/interview-me/SKILL.md +404 -0
  385. package/skills/interview-me/agents/openai.yaml +4 -0
  386. package/skills/loop-library-audit/SKILL.md +123 -0
  387. package/skills/pitch/SKILL.md +110 -0
  388. package/skills/pitch/references/opportunity-assessment.md +136 -0
  389. package/skills/pitch/references/prfaq-template.md +54 -0
  390. package/skills/pmm-release-briefing/SKILL.md +27 -0
  391. package/skills/pmm-release-briefing/agents/openai.yaml +4 -0
  392. package/skills/pmm-release-briefing/references/variant-generalized.md +16 -0
  393. package/skills/positioning-messaging/SKILL.md +70 -0
  394. package/skills/positioning-messaging/agents/openai.yaml +4 -0
  395. package/skills/positioning-messaging/references/guest-insights.md +1400 -0
  396. package/skills/preview-swarm/SKILL.md +418 -0
  397. package/skills/preview-swarm/agents/openai.yaml +4 -0
  398. package/skills/preview-swarm/references/html-effectiveness-build-previews.md +168 -0
  399. package/skills/product-copywriting/SKILL.md +127 -0
  400. package/skills/product-copywriting/agents/openai.yaml +4 -0
  401. package/skills/product-copywriting/references/foo-voice.md +26 -0
  402. package/skills/product-shape-interview/SKILL.md +219 -0
  403. package/skills/product-shape-interview/agents/openai.yaml +4 -0
  404. package/skills/ready-for-release/SKILL.md +39 -0
  405. package/skills/ready-for-release/agents/openai.yaml +4 -0
  406. package/skills/redact-transcripts/SKILL.md +23 -0
  407. package/skills/redact-transcripts/agents/openai.yaml +4 -0
  408. package/skills/research-brief/SKILL.md +48 -0
  409. package/skills/research-brief/agents/openai.yaml +4 -0
  410. package/skills/research-refresh/SKILL.md +63 -0
  411. package/skills/research-refresh/references/worked-cases.md +44 -0
  412. package/skills/review-loop/SKILL.md +200 -0
  413. package/skills/review-spec/SKILL.md +32 -0
  414. package/skills/review-spec/agents/openai.yaml +4 -0
  415. package/skills/rfc-from-research/SKILL.md +42 -0
  416. package/skills/rfc-from-research/agents/openai.yaml +4 -0
  417. package/skills/rfc-from-research/references/rfc-pattern.md +69 -0
  418. package/skills/skill-registry.yaml +810 -0
  419. package/skills/spec-cleanup/SKILL.md +103 -0
  420. package/skills/spec-cleanup/agents/openai.yaml +4 -0
  421. package/skills/spec-swarm/SKILL.md +87 -0
  422. package/skills/spec-swarm/agents/openai.yaml +4 -0
  423. package/skills/spec-swarm/template/SKILL.template.md +94 -0
  424. package/skills/spec-swarm/template/personas/accessibility-inclusion.md +40 -0
  425. package/skills/spec-swarm/template/personas/ai-technical-pm.md +69 -0
  426. package/skills/spec-swarm/template/personas/analytics-engineering.md +39 -0
  427. package/skills/spec-swarm/template/personas/applied-ai-eval.md +64 -0
  428. package/skills/spec-swarm/template/personas/business-gm-pm.md +67 -0
  429. package/skills/spec-swarm/template/personas/consumer-craft-pm.md +68 -0
  430. package/skills/spec-swarm/template/personas/content-design.md +40 -0
  431. package/skills/spec-swarm/template/personas/cpo.md +42 -0
  432. package/skills/spec-swarm/template/personas/data-science.md +42 -0
  433. package/skills/spec-swarm/template/personas/developer-experience.md +65 -0
  434. package/skills/spec-swarm/template/personas/dx-product.md +70 -0
  435. package/skills/spec-swarm/template/personas/field.md +43 -0
  436. package/skills/spec-swarm/template/personas/finance-cfo.md +40 -0
  437. package/skills/spec-swarm/template/personas/growth-pm.md +67 -0
  438. package/skills/spec-swarm/template/personas/platform-pm.md +67 -0
  439. package/skills/spec-swarm/template/personas/pmm.md +43 -0
  440. package/skills/spec-swarm/template/personas/principal-product-designer.md +42 -0
  441. package/skills/spec-swarm/template/personas/product-ops-program.md +41 -0
  442. package/skills/spec-swarm/template/personas/qa-release.md +41 -0
  443. package/skills/spec-swarm/template/personas/responsible-ai-safety.md +64 -0
  444. package/skills/spec-swarm/template/personas/security-privacy-legal.md +40 -0
  445. package/skills/spec-swarm/template/personas/strategy-competitive.md +41 -0
  446. package/skills/spec-swarm/template/personas/technical-architect.md +42 -0
  447. package/skills/spec-swarm/template/personas/technical-lead.md +43 -0
  448. package/skills/spec-swarm/template/personas/user-research.md +41 -0
  449. package/skills/spec-swarm-accessibility-inclusion/SKILL.md +95 -0
  450. package/skills/spec-swarm-accessibility-inclusion/agents/openai.yaml +4 -0
  451. package/skills/spec-swarm-ai-technical-pm/SKILL.md +124 -0
  452. package/skills/spec-swarm-analytics-engineering/SKILL.md +94 -0
  453. package/skills/spec-swarm-analytics-engineering/agents/openai.yaml +4 -0
  454. package/skills/spec-swarm-applied-ai-eval/SKILL.md +120 -0
  455. package/skills/spec-swarm-business-gm-pm/SKILL.md +122 -0
  456. package/skills/spec-swarm-consumer-craft-pm/SKILL.md +122 -0
  457. package/skills/spec-swarm-content-design/SKILL.md +95 -0
  458. package/skills/spec-swarm-content-design/agents/openai.yaml +4 -0
  459. package/skills/spec-swarm-cpo/SKILL.md +94 -0
  460. package/skills/spec-swarm-cpo/agents/openai.yaml +4 -0
  461. package/skills/spec-swarm-data-science/SKILL.md +95 -0
  462. package/skills/spec-swarm-data-science/agents/openai.yaml +4 -0
  463. package/skills/spec-swarm-developer-experience/SKILL.md +121 -0
  464. package/skills/spec-swarm-dx-product/SKILL.md +126 -0
  465. package/skills/spec-swarm-field/SKILL.md +96 -0
  466. package/skills/spec-swarm-field/agents/openai.yaml +4 -0
  467. package/skills/spec-swarm-finance-cfo/SKILL.md +95 -0
  468. package/skills/spec-swarm-finance-cfo/agents/openai.yaml +4 -0
  469. package/skills/spec-swarm-growth-pm/SKILL.md +122 -0
  470. package/skills/spec-swarm-platform-pm/SKILL.md +122 -0
  471. package/skills/spec-swarm-pmm/SKILL.md +96 -0
  472. package/skills/spec-swarm-pmm/agents/openai.yaml +4 -0
  473. package/skills/spec-swarm-principal-product-designer/SKILL.md +95 -0
  474. package/skills/spec-swarm-principal-product-designer/agents/openai.yaml +4 -0
  475. package/skills/spec-swarm-product-ops-program/SKILL.md +96 -0
  476. package/skills/spec-swarm-product-ops-program/agents/openai.yaml +4 -0
  477. package/skills/spec-swarm-qa-release/SKILL.md +96 -0
  478. package/skills/spec-swarm-qa-release/agents/openai.yaml +4 -0
  479. package/skills/spec-swarm-responsible-ai-safety/SKILL.md +120 -0
  480. package/skills/spec-swarm-security-privacy-legal/SKILL.md +95 -0
  481. package/skills/spec-swarm-security-privacy-legal/agents/openai.yaml +4 -0
  482. package/skills/spec-swarm-strategy-competitive/SKILL.md +96 -0
  483. package/skills/spec-swarm-strategy-competitive/agents/openai.yaml +4 -0
  484. package/skills/spec-swarm-technical-architect/SKILL.md +95 -0
  485. package/skills/spec-swarm-technical-architect/agents/openai.yaml +4 -0
  486. package/skills/spec-swarm-technical-lead/SKILL.md +96 -0
  487. package/skills/spec-swarm-technical-lead/agents/openai.yaml +4 -0
  488. package/skills/spec-swarm-user-research/SKILL.md +95 -0
  489. package/skills/spec-swarm-user-research/agents/openai.yaml +4 -0
  490. package/skills/strategy-check/SKILL.md +170 -0
  491. package/skills/strategy-check/agents/openai.yaml +4 -0
  492. package/skills/study-digest/SKILL.md +41 -0
  493. package/skills/synthetic-customer/SKILL.md +68 -0
  494. package/skills/update-cli-spec/SKILL.md +69 -0
  495. package/skills/update-cli-spec/agents/openai.yaml +4 -0
  496. package/skills/voc-researcher/SKILL.md +45 -0
  497. package/skills/voc-researcher/agents/openai.yaml +4 -0
  498. package/skills-lock.json +35 -0
@@ -0,0 +1,146 @@
1
+ // Where the swarm hands off: the finalization pass that turns good product
2
+ // thinking into an implementable packet (alpha_tester_fixes_v0 R-003).
3
+ //
4
+ // This used to read `foo spec-cleanup <packet>` — a command that has never
5
+ // existed. `foo spec-cleanup` is not a CLI domain, it errors with "unknown
6
+ // domain: spec-cleanup"; spec-cleanup is a *skill*. An agent handed a command
7
+ // that does not exist either gives up or invents its own next move, which is
8
+ // the one thing a handoff is supposed to prevent.
9
+ const HANDOFF = "foo skill spec-cleanup";
10
+ // Core lens roster (golden swarm-001 selection rationale, OQ-E2: the fast
11
+ // tier draws the first N lenses; deep runs the full roster).
12
+ const LENSES = [
13
+ "cpo",
14
+ "technical-architect",
15
+ "security-privacy-legal",
16
+ "applied-ai-eval",
17
+ "business-gm-pm",
18
+ "developer-experience",
19
+ "principal-product-designer",
20
+ "technical-lead",
21
+ "data-science",
22
+ "pmm",
23
+ "user-research",
24
+ "qa-release",
25
+ "content-design",
26
+ "strategy-competitive",
27
+ "product-ops-program",
28
+ "finance-cfo",
29
+ "accessibility-inclusion",
30
+ "dx-product",
31
+ "responsible-ai-safety",
32
+ "analytics-engineering",
33
+ "field",
34
+ "growth-pm",
35
+ "consumer-craft-pm",
36
+ "ai-technical-pm",
37
+ "platform-pm",
38
+ ];
39
+ export const specSwarmFamily = {
40
+ family: "spec-swarm",
41
+ banner: "── foo ▸ swarm ── expert lenses before user questions ──",
42
+ tagline: "expert lenses before user questions",
43
+ skillRef: "spec-swarm", // a `foo skill` argument, never a filesystem path
44
+ defaultDepth: "standard",
45
+ depths: {
46
+ fast: { lenses: 6, user_questions: 3, candidates_per_lens: 2, judges: 0, exhaustive: false },
47
+ standard: { lenses: 12, user_questions: 7, candidates_per_lens: 2, judges: 0, exhaustive: false },
48
+ deep: { lenses: 25, user_questions: 7, candidates_per_lens: 3, judges: 0, exhaustive: true },
49
+ },
50
+ phases: ["INTAKE", "LENSES", "PREFLIGHT", "RANK", "ASK", "REPORT"],
51
+ cells: {
52
+ rolePrefix: "lens-",
53
+ countKey: "lenses",
54
+ maxCount: 25,
55
+ pools: {
56
+ lens: { values: LENSES },
57
+ },
58
+ },
59
+ record: {
60
+ dir: "swarms",
61
+ frontmatter: (ctx) => [
62
+ "---",
63
+ `swarm_id: swarm-${ctx.at.slice(0, 10)}`,
64
+ `target: ${JSON.stringify(ctx.target)}`,
65
+ `depth: ${ctx.depth}`,
66
+ "decider: human # expert answers carry forward unless the user disagrees",
67
+ // The decision fields the gates read live in the front matter — the
68
+ // record is prepared with them EMPTY and the swarm fills them before
69
+ // `check` can pass (the completion gate demands nonempty not_doing).
70
+ 'minority_report: ""',
71
+ "not_doing: []",
72
+ 'what_would_change_our_mind: ""',
73
+ `handoff: ${JSON.stringify(HANDOFF)}`,
74
+ "---",
75
+ ],
76
+ body: () => [
77
+ "",
78
+ "# Preflight routing table",
79
+ "",
80
+ "| Candidate question | Asking role | Experts consulted | Expert answer | Evidence / reason | Ask user? |",
81
+ "| --- | --- | --- | --- | --- | --- |",
82
+ "",
83
+ "# Swarm report",
84
+ "",
85
+ "# Judgment ledger",
86
+ "",
87
+ "| Judgment | Owner lens | Type | Evidence | Confidence | Dissent | User? |",
88
+ "| --- | --- | --- | --- | --- | --- | --- |",
89
+ "",
90
+ "# Decision",
91
+ "",
92
+ ],
93
+ },
94
+ // methodology-compiler-v0 T-004: the swarm's orchestration protocol moved
95
+ // out of skills/spec-swarm/SKILL.md prose into this compiled emission; the
96
+ // skill keeps only role-lens craft. Rationale lines ride with each rule.
97
+ contract: (ctx) => [
98
+ ctx.family.banner,
99
+ "",
100
+ `Target (read before any lens runs): ${ctx.target}`,
101
+ `Depth: ${ctx.depth} — ${ctx.tier.lenses} lenses · ${ctx.tier.candidates_per_lens} candidates per lens · user-question budget ${ctx.tier.user_questions} across the WHOLE swarm${ctx.tier.exhaustive ? " · exhaustive review" : ""}`,
102
+ "",
103
+ "Execute the phases in order. Leaf craft (how to be a good lens): run `foo skill spec-swarm`.",
104
+ ` ${ctx.family.phases.join(" → ")}`,
105
+ "",
106
+ "Protocol (conductor rules — each with its why):",
107
+ " INTAKE read the spec/packet and extract bet, user, workflow, MVP boundary, evidence boundary, risks, validation bar, cut line, open questions — lenses that skip intake re-ask answered questions.",
108
+ ` LENSES each lens forms its top ${ctx.tier.candidates_per_lens} candidate question(s) grill-me shaped: question + recommended answer + evidence + type + dissent — a question already answered by the packet is dropped WITH the answering decision cited.`,
109
+ " PREFLIGHT every candidate passes the routing gate before any user question: inspect spec/code/tests/docs first, ask the other lenses second, escalate only genuine user-judgment — never ask the user what another lens or the repo can answer.",
110
+ " RANK stack-rank survivors by: bet/user/source-boundary/cut-line impact, then MVP/validation impact, then risk reduction, then churn avoided; ask from the top only — lower-ranked questions become recorded assumptions or open questions, never budget overruns.",
111
+ " ASK one question at a time as numbered options, recommendation first marked (recommended) — the user answers with a digit; batching questions hides the ranking.",
112
+ " REPORT the seven sections, all mandatory: highest-leverage question · expert answers to override · deferred questions · judgment ledger · spec changes implied · finalization gate (spec-cleanup before implementation) · do-not-expand-yet.",
113
+ "",
114
+ "Lens roster (one cell per lens):",
115
+ ...ctx.cells.map((c) => ` ${c.role}: ${c.attrs.lens}`),
116
+ "",
117
+ "Routing table (render it — invisible expert routing is the failure mode):",
118
+ " | Candidate question | Asking role | Experts consulted | Expert answer | Evidence / reason | Ask user? |",
119
+ " Use 'No, carrying forward unless you disagree' for steerable defaults; 'Yes' only for true judgment calls.",
120
+ "Ledger types never collapse: repo-evidence | approved-context | role-expertise | agent-inference | user-judgment — the boundary between evidence, expertise, inference, and human judgment is the product.",
121
+ "Progress surface (what the USER sees WHILE lenses run — separate from the record above):",
122
+ ` Narrate the whole fan-out as ONE foo status line, not a per-lens agent tree — e.g. "🔄 doing — routing your brief past ${ctx.tier.lenses} expert lenses" while they run, then "✋ needs your input — synthesis ready" at the handoff. The lens count and machinery are plumbing; productfoo feels simple only when plumbing stays invisible.`,
123
+ ` If your harness insists on surfacing agents separately, label EVERY agent — every lens AND the preflight/rank/synthesis steps — as "Expert N" with ONE running counter that never resets between phases (the synthesis step included, e.g. "Expert ${Number(ctx.tier.lenses) + 1}"). The label is the NUMBER ALONE: never a lens id, a role name, or a step name — never "security-privacy-legal", "Chief Product Officer", "Preflight", "Synthesis". Each agent's final line is a bare COUNT — "Done — 2 candidate questions" — never which lens it was. "Expert 3 security-privacy-legal" and "Chief Product Officer" leak the roster exactly as loudly as lens:cpo did; a number with anything stapled to it is not anonymized.`,
124
+ " WHICH experts foo routes to, in what order, and which it draws at each depth — ALL of it is the craft. A progress panel is the most screenshotted, most shared surface productfoo has; the roster does not belong in transient chrome.",
125
+ " Numbered in the RUNTIME, named in the RECORD. Anonymity buys secrecy in the chrome, never in the product: in the routing table, judgment ledger, and report every judgment keeps its real owner lens — \"Security & Privacy raised this risk\" is what makes a judgment legible and overridable. Invisible expert routing is still the failure mode. And never write \"Expert 3\" into a report: a reader who did not watch the run cannot resolve a number back to a judgment.",
126
+ "Ground rules: no spec rewrite during the swarm; no new scope by default; expert-resolved answers stay visible and overridable; agent inference is never presented as fact.",
127
+ "",
128
+ `Swarm record scaffolded: ${ctx.recordPath}`,
129
+ " Read that record before you fill it. productfoo's CLI wrote the file, not you — and a harness that guards blind overwrites refuses the first write to a file the session has never read, so filling it blind fails.",
130
+ "The user steers every carried-forward expert answer. The human is the Decider.",
131
+ "",
132
+ ],
133
+ gates: [
134
+ { type: "frontmatter-present", check: "target", field: "target", detail: "target captured", failDetail: "target missing from front matter" },
135
+ { type: "frontmatter-present", check: "depth", field: "depth", pattern: "(fast|standard|deep)", detail: "depth {value}", failDetail: "depth missing or invalid" },
136
+ { type: "section-present", check: "routing-table", heading: "Preflight routing table", detail: "routing table present", failDetail: "preflight routing table missing — expert routing was invisible" },
137
+ { type: "section-present", check: "ledger", heading: "Judgment ledger", detail: "judgment ledger present", failDetail: "judgment ledger missing" },
138
+ { type: "ledger-types", check: "ledger-taxonomy", taxonomy: ["repo-evidence", "approved-context", "role-expertise", "agent-inference", "user-judgment"] },
139
+ { type: "section-present", check: "report", heading: "Swarm report", detail: "swarm report present", failDetail: "swarm report missing" },
140
+ { type: "frontmatter-nonempty", check: "minority-report", field: "minority_report", detail: "dissent preserved", failDetail: "minority report empty — dissent was voted away" },
141
+ { type: "frontmatter-nonempty", check: "not-doing", field: "not_doing", detail: "explicit not-doing recorded", failDetail: 'missing "do not expand yet"' },
142
+ { type: "frontmatter-equals", check: "human-decider", field: "decider", expect: "human", detail: "human is the Decider", failDetail: "decider must be human, found: " },
143
+ ],
144
+ handoff: HANDOFF,
145
+ decider: "human",
146
+ };
@@ -0,0 +1,6 @@
1
+ import { type FamilyPack } from "./pack.js";
2
+ import type { Depth } from "./types.js";
3
+ export declare function familyPacksNotBundledMessage(name: string): string;
4
+ export declare function isKnownFamily(name: string): boolean;
5
+ export declare function clearFamilyPackCache(): void;
6
+ export declare function resolveFamilyPack(name: string, depth: Depth, lean: boolean): Promise<FamilyPack>;
@@ -0,0 +1,37 @@
1
+ // Resolve bundled family definitions; missing package files are installation errors.
2
+ import { SkillDeliveryError } from "../skillLocal.js";
3
+ import { renderFamilyPack } from "./pack.js";
4
+ const LOCAL_FAMILIES = {
5
+ ideate: () => import("./families/ideate.js").then((m) => m.ideateFamily),
6
+ interview: () => import("./families/interview.js").then((m) => m.interviewFamily),
7
+ "spec-swarm": () => import("./families/specSwarm.js").then((m) => m.specSwarmFamily),
8
+ };
9
+ export function familyPacksNotBundledMessage(name) {
10
+ return `family packs for "${name}" are not bundled with this productfoo install.`;
11
+ }
12
+ export function isKnownFamily(name) {
13
+ return Object.prototype.hasOwnProperty.call(LOCAL_FAMILIES, name);
14
+ }
15
+ const packCache = new Map();
16
+ export function clearFamilyPackCache() {
17
+ packCache.clear();
18
+ }
19
+ export async function resolveFamilyPack(name, depth, lean) {
20
+ if (!isKnownFamily(name)) {
21
+ throw new SkillDeliveryError("not-found", `"${name}" is not a known foo method (expected: ${Object.keys(LOCAL_FAMILIES).join(", ")}).`);
22
+ }
23
+ const key = `${name}:${depth}:${lean ? 1 : 0}`;
24
+ const cached = packCache.get(key);
25
+ if (cached !== undefined)
26
+ return cached;
27
+ let family;
28
+ try {
29
+ family = await LOCAL_FAMILIES[name]();
30
+ }
31
+ catch (cause) {
32
+ throw new SkillDeliveryError("not-found", familyPacksNotBundledMessage(name), { cause });
33
+ }
34
+ const pack = renderFamilyPack(family, depth, lean);
35
+ packCache.set(key, pack);
36
+ return pack;
37
+ }
@@ -0,0 +1,4 @@
1
+ import { type FamilyPack } from "./pack.js";
2
+ import type { Depth, FamilyDefinition } from "./types.js";
3
+ export declare function renderFamilyPackArtifact(family: FamilyDefinition): string;
4
+ export declare function parseFamilyPackArtifact(text: string, family: string, depth: Depth, lean: boolean): FamilyPack;
@@ -0,0 +1,260 @@
1
+ import { canonicalJson } from "../trustEnvelope.js";
2
+ import { renderFamilyPack } from "./pack.js";
3
+ const PREFIX = "# Foo signed family packs v1\n\n```json foo-family-packs\n";
4
+ const SUFFIX = "\n```\n";
5
+ const DEPTHS = ["fast", "standard", "deep"];
6
+ const MAX_ARTIFACT_BYTES = 256 * 1024;
7
+ const SAFE_NAME = /^[a-z][a-z0-9-]{0,63}$/;
8
+ const SAFE_KEY = /^[a-z][a-z0-9_]{0,63}$/;
9
+ const SAFE_PATTERN = /^[A-Za-z0-9_().|^$-]{1,256}$/;
10
+ const SAFE_HEADING = /^[A-Za-z0-9][A-Za-z0-9 _&:,'"/-]{0,255}$/;
11
+ function variantKey(depth, lean) {
12
+ return `${depth}:${lean ? 1 : 0}`;
13
+ }
14
+ function exactKeys(value, expected) {
15
+ const actual = Object.keys(value).sort();
16
+ const wanted = [...expected].sort();
17
+ return actual.length === wanted.length && actual.every((key, index) => key === wanted[index]);
18
+ }
19
+ function plain(value) {
20
+ return typeof value === "object" && value !== null && !Array.isArray(value);
21
+ }
22
+ function stringList(value, maxItems = 512) {
23
+ return Array.isArray(value)
24
+ && value.length <= maxItems
25
+ && value.every((entry) => typeof entry === "string" && Buffer.byteLength(entry, "utf8") <= 32 * 1024);
26
+ }
27
+ function boundedString(value, maxBytes = 4096) {
28
+ return typeof value === "string" && Buffer.byteLength(value, "utf8") <= maxBytes;
29
+ }
30
+ function validPattern(value) {
31
+ if (typeof value !== "string" || !SAFE_PATTERN.test(value))
32
+ return false;
33
+ try {
34
+ void new RegExp(value);
35
+ return true;
36
+ }
37
+ catch {
38
+ return false;
39
+ }
40
+ }
41
+ function validGate(value) {
42
+ if (!plain(value) || typeof value.type !== "string" || typeof value.check !== "string"
43
+ || !SAFE_NAME.test(value.check)) {
44
+ return false;
45
+ }
46
+ const commonFrontmatter = () => typeof value.field === "string"
47
+ && SAFE_KEY.test(value.field)
48
+ && boundedString(value.detail)
49
+ && boundedString(value.failDetail);
50
+ switch (value.type) {
51
+ case "frontmatter-present": {
52
+ const hasPattern = Object.hasOwn(value, "pattern");
53
+ return exactKeys(value, hasPattern
54
+ ? ["type", "check", "field", "pattern", "detail", "failDetail"]
55
+ : ["type", "check", "field", "detail", "failDetail"])
56
+ && commonFrontmatter()
57
+ && (!hasPattern || validPattern(value.pattern));
58
+ }
59
+ case "frontmatter-nonempty":
60
+ return exactKeys(value, ["type", "check", "field", "detail", "failDetail"])
61
+ && commonFrontmatter();
62
+ case "frontmatter-equals":
63
+ return exactKeys(value, ["type", "check", "field", "expect", "detail", "failDetail"])
64
+ && commonFrontmatter()
65
+ && boundedString(value.expect, 1024);
66
+ case "diversity-meter":
67
+ return exactKeys(value, ["type", "check", "floorCap", "floorKey"])
68
+ && Number.isSafeInteger(value.floorCap)
69
+ && value.floorCap >= 0
70
+ && value.floorCap <= 1024
71
+ && typeof value.floorKey === "string"
72
+ && SAFE_KEY.test(value.floorKey);
73
+ case "diversity-provenance":
74
+ return exactKeys(value, ["type", "check"]);
75
+ // frames-v1 (#697): both new gates are closed shapes — frame-reasoning
76
+ // carries no payload beyond its check name, and versioned-keyline is the
77
+ // frontmatter-nonempty shape gated on the record's contract version.
78
+ case "frame-reasoning":
79
+ case "ideate-falsification":
80
+ case "ideate-decision":
81
+ return exactKeys(value, ["type", "check"]);
82
+ case "versioned-keyline":
83
+ return exactKeys(value, ["type", "check", "field", "detail", "failDetail"])
84
+ && commonFrontmatter();
85
+ case "section-present":
86
+ return exactKeys(value, ["type", "check", "heading", "detail", "failDetail"])
87
+ && typeof value.heading === "string"
88
+ && SAFE_HEADING.test(value.heading)
89
+ && boundedString(value.detail)
90
+ && boundedString(value.failDetail);
91
+ case "ledger-types":
92
+ return exactKeys(value, ["type", "check", "taxonomy"])
93
+ && stringList(value.taxonomy, 64)
94
+ && value.taxonomy.length > 0
95
+ && value.taxonomy.every((entry) => SAFE_NAME.test(entry));
96
+ default:
97
+ return false;
98
+ }
99
+ }
100
+ function validGates(value) {
101
+ return Array.isArray(value)
102
+ && value.length > 0
103
+ && value.length <= 64
104
+ && value.every(validGate);
105
+ }
106
+ function validTier(value) {
107
+ if (!plain(value) || Object.keys(value).length > 32)
108
+ return false;
109
+ return Object.entries(value).every(([key, entry]) => SAFE_KEY.test(key)
110
+ && (typeof entry === "boolean"
111
+ || (typeof entry === "number" && Number.isSafeInteger(entry) && entry >= 0 && entry <= 1024)));
112
+ }
113
+ function validDepthMap(value) {
114
+ return plain(value)
115
+ && exactKeys(value, DEPTHS)
116
+ && DEPTHS.every((depth) => validTier(value[depth]));
117
+ }
118
+ function validCells(value) {
119
+ if (value === null)
120
+ return true;
121
+ if (!plain(value)
122
+ || !exactKeys(value, ["rolePrefix", "countKey", "maxCount", "pools", "seed"])
123
+ || typeof value.rolePrefix !== "string"
124
+ || !SAFE_KEY.test(value.countKey)
125
+ || !Number.isSafeInteger(value.maxCount)
126
+ || value.maxCount < 1
127
+ || value.maxCount > 64
128
+ || !plain(value.pools)
129
+ || Object.keys(value.pools).length > 32) {
130
+ return false;
131
+ }
132
+ for (const [attribute, pool] of Object.entries(value.pools)) {
133
+ if (!SAFE_KEY.test(attribute)
134
+ || !plain(pool)
135
+ || !exactKeys(pool, Object.hasOwn(pool, "cycleKey") ? ["values", "cycleKey"] : ["values"])
136
+ || !stringList(pool.values, 64)
137
+ || pool.values.length === 0
138
+ || pool.values.some((entry) => !SAFE_NAME.test(entry))
139
+ || (Object.hasOwn(pool, "cycleKey") && (typeof pool.cycleKey !== "string" || !SAFE_KEY.test(pool.cycleKey)))) {
140
+ return false;
141
+ }
142
+ }
143
+ if (value.seed !== null) {
144
+ if (!plain(value.seed)
145
+ || !exactKeys(value.seed, ["attr", "base", "step"])
146
+ || typeof value.seed.attr !== "string"
147
+ || !SAFE_KEY.test(value.seed.attr)
148
+ || !Number.isSafeInteger(value.seed.base)
149
+ || !Number.isSafeInteger(value.seed.step)) {
150
+ return false;
151
+ }
152
+ }
153
+ return true;
154
+ }
155
+ const PACK_KEYS = [
156
+ "family",
157
+ "banner",
158
+ "tagline",
159
+ "skillRef",
160
+ "defaultDepth",
161
+ "phases",
162
+ "handoff",
163
+ "decider",
164
+ "depth",
165
+ "lean",
166
+ "depths",
167
+ "cells",
168
+ "recordDir",
169
+ "contract",
170
+ "frontmatter",
171
+ "body",
172
+ "gates",
173
+ ];
174
+ function validPack(value, family, depth, lean) {
175
+ if (!plain(value)
176
+ || !exactKeys(value, PACK_KEYS)
177
+ || value.family !== family
178
+ || value.depth !== depth
179
+ || value.lean !== lean
180
+ || value.skillRef !== family
181
+ || value.decider !== "human"
182
+ || !DEPTHS.includes(value.defaultDepth)
183
+ || typeof value.banner !== "string"
184
+ || typeof value.tagline !== "string"
185
+ || typeof value.handoff !== "string"
186
+ || !stringList(value.phases, 32)
187
+ || !validDepthMap(value.depths)
188
+ || !validCells(value.cells)
189
+ || !stringList(value.contract)
190
+ || !stringList(value.frontmatter)
191
+ || !stringList(value.body)
192
+ || !validGates(value.gates)) {
193
+ return false;
194
+ }
195
+ // V1 serves only ideate. Pinning the one writable directory makes a signed
196
+ // release bug fail closed before path.resolve can observe an escape.
197
+ return family === "ideate" && value.recordDir === "ideas";
198
+ }
199
+ export function renderFamilyPackArtifact(family) {
200
+ const variants = {};
201
+ for (const depth of DEPTHS) {
202
+ for (const lean of [false, true]) {
203
+ variants[variantKey(depth, lean)] = renderFamilyPack(family, depth, lean);
204
+ }
205
+ }
206
+ const payload = {
207
+ schema_version: "1",
208
+ family: family.family,
209
+ variants,
210
+ };
211
+ return `${PREFIX}${canonicalJson(payload)}${SUFFIX}`;
212
+ }
213
+ function deepFreeze(value) {
214
+ if (value && typeof value === "object" && !Object.isFrozen(value)) {
215
+ for (const entry of Object.values(value))
216
+ deepFreeze(entry);
217
+ Object.freeze(value);
218
+ }
219
+ return value;
220
+ }
221
+ export function parseFamilyPackArtifact(text, family, depth, lean) {
222
+ const invalid = () => {
223
+ throw new TypeError("invalid signed family-pack artifact");
224
+ };
225
+ if (!SAFE_NAME.test(family)
226
+ || Buffer.byteLength(text, "utf8") > MAX_ARTIFACT_BYTES
227
+ || !text.startsWith(PREFIX)
228
+ || !text.endsWith(SUFFIX)) {
229
+ return invalid();
230
+ }
231
+ let value;
232
+ try {
233
+ value = JSON.parse(text.slice(PREFIX.length, -SUFFIX.length));
234
+ }
235
+ catch {
236
+ return invalid();
237
+ }
238
+ if (!plain(value)
239
+ || !exactKeys(value, ["schema_version", "family", "variants"])
240
+ || value.schema_version !== "1"
241
+ || value.family !== family
242
+ || !plain(value.variants)) {
243
+ return invalid();
244
+ }
245
+ const expectedVariants = DEPTHS.flatMap((candidateDepth) => [
246
+ variantKey(candidateDepth, false),
247
+ variantKey(candidateDepth, true),
248
+ ]);
249
+ if (!exactKeys(value.variants, expectedVariants))
250
+ return invalid();
251
+ for (const candidateDepth of DEPTHS) {
252
+ for (const candidateLean of [false, true]) {
253
+ if (!validPack(value.variants[variantKey(candidateDepth, candidateLean)], family, candidateDepth, candidateLean)) {
254
+ return invalid();
255
+ }
256
+ }
257
+ }
258
+ const selected = value.variants[variantKey(depth, lean)];
259
+ return deepFreeze(selected);
260
+ }
@@ -0,0 +1,6 @@
1
+ import { type OrchestrationResult } from "../orchestrationResult.js";
2
+ export declare const DECISION_CONTRACT = "decisions-v2";
3
+ export declare function hasDecisionContract(record: string): boolean;
4
+ export declare function checkFalsification(record: string): string[];
5
+ export declare function checkDecision(record: string): string[];
6
+ export declare function decisionResult(record: string): OrchestrationResult;