fraim-framework 2.0.66 → 2.0.67

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 (254) hide show
  1. package/dist/registry/ai-manager-rules/customer-development-phases/phase1-customer-profiling.md +101 -0
  2. package/dist/registry/ai-manager-rules/customer-development-phases/phase2-platform-discovery.md +235 -0
  3. package/dist/registry/ai-manager-rules/customer-development-phases/phase3-prospect-qualification.md +243 -0
  4. package/dist/registry/ai-manager-rules/customer-development-phases/phase4-inventory-compilation.md +206 -0
  5. package/dist/registry/ai-manager-rules/design-phases/design-completeness-review.md +73 -0
  6. package/dist/registry/ai-manager-rules/design-phases/design-design.md +145 -0
  7. package/dist/registry/ai-manager-rules/design-phases/design.md +108 -0
  8. package/dist/registry/ai-manager-rules/design-phases/finalize.md +60 -0
  9. package/dist/registry/ai-manager-rules/design-phases/validate.md +125 -0
  10. package/dist/registry/ai-manager-rules/design.json +97 -0
  11. package/dist/registry/ai-manager-rules/implement-phases/code.md +323 -0
  12. package/dist/registry/ai-manager-rules/implement-phases/completeness-review.md +94 -0
  13. package/dist/registry/ai-manager-rules/implement-phases/finalize.md +177 -0
  14. package/dist/registry/ai-manager-rules/implement-phases/implement-code.md +283 -0
  15. package/dist/registry/ai-manager-rules/implement-phases/implement-completeness-review.md +120 -0
  16. package/dist/registry/ai-manager-rules/implement-phases/implement-regression.md +173 -0
  17. package/dist/registry/ai-manager-rules/implement-phases/implement-repro.md +104 -0
  18. package/dist/registry/ai-manager-rules/implement-phases/implement-scoping.md +100 -0
  19. package/dist/registry/ai-manager-rules/implement-phases/implement-smoke.md +237 -0
  20. package/dist/registry/ai-manager-rules/implement-phases/implement-spike.md +121 -0
  21. package/dist/registry/ai-manager-rules/implement-phases/implement-validate.md +375 -0
  22. package/dist/registry/ai-manager-rules/implement-phases/quality-review.md +304 -0
  23. package/dist/registry/ai-manager-rules/implement-phases/regression.md +159 -0
  24. package/dist/registry/ai-manager-rules/implement-phases/repro.md +101 -0
  25. package/dist/registry/ai-manager-rules/implement-phases/scoping.md +93 -0
  26. package/dist/registry/ai-manager-rules/implement-phases/smoke.md +225 -0
  27. package/dist/registry/ai-manager-rules/implement-phases/spike.md +118 -0
  28. package/dist/registry/ai-manager-rules/implement-phases/validate.md +347 -0
  29. package/dist/registry/ai-manager-rules/implement.json +153 -0
  30. package/dist/registry/ai-manager-rules/retrospective.md +116 -0
  31. package/dist/registry/ai-manager-rules/shared-phases/address-pr-feedback.md +188 -0
  32. package/dist/registry/ai-manager-rules/shared-phases/finalize.md +169 -0
  33. package/dist/registry/ai-manager-rules/shared-phases/submit-pr.md +202 -0
  34. package/dist/registry/ai-manager-rules/shared-phases/wait-for-pr-review.md +170 -0
  35. package/dist/registry/ai-manager-rules/spec-phases/finalize.md +60 -0
  36. package/dist/registry/ai-manager-rules/spec-phases/spec-competitor-analysis.md +105 -0
  37. package/dist/registry/ai-manager-rules/spec-phases/spec-completeness-review.md +66 -0
  38. package/dist/registry/ai-manager-rules/spec-phases/spec-spec.md +139 -0
  39. package/dist/registry/ai-manager-rules/spec-phases/spec.md +102 -0
  40. package/dist/registry/ai-manager-rules/spec-phases/validate.md +118 -0
  41. package/dist/registry/ai-manager-rules/spec.json +112 -0
  42. package/dist/registry/ai-manager-rules/test.json +98 -0
  43. package/dist/registry/ai-manager-rules/user-survey-phases/phase1-survey-scoping.md +60 -0
  44. package/dist/registry/ai-manager-rules/user-survey-phases/phase2-survey-build-linkedin.md +23 -0
  45. package/dist/registry/ai-manager-rules/user-survey-phases/phase3-survey-build-reddit.md +22 -0
  46. package/dist/registry/ai-manager-rules/user-survey-phases/phase4-survey-build-x.md +21 -0
  47. package/dist/registry/ai-manager-rules/user-survey-phases/phase5-survey-build-facebook.md +19 -0
  48. package/dist/registry/ai-manager-rules/user-survey-phases/phase6-survey-build-custom.md +15 -0
  49. package/dist/registry/ai-manager-rules/user-survey-phases/phase7-survey-dispatch.md +45 -0
  50. package/dist/registry/delivery/address-feedback.md +83 -0
  51. package/dist/registry/delivery/retrospective.md +78 -0
  52. package/dist/registry/delivery/submit.md +79 -0
  53. package/dist/registry/providers/ado.json +19 -0
  54. package/dist/registry/providers/delivery-conversation.json +9 -0
  55. package/dist/registry/providers/delivery-pr.json +9 -0
  56. package/dist/registry/providers/github.json +19 -0
  57. package/dist/registry/rules/agent-success-criteria.md +101 -0
  58. package/dist/registry/rules/agent-testing-guidelines.md +502 -0
  59. package/dist/registry/rules/architecture.md +126 -0
  60. package/dist/registry/rules/communication.md +122 -0
  61. package/dist/registry/rules/continuous-learning.md +55 -0
  62. package/dist/registry/rules/debugging-multitenancy-issues.md +85 -0
  63. package/dist/registry/rules/ephemeral-execution.md +54 -0
  64. package/dist/registry/rules/git-safe-commands.md +34 -0
  65. package/dist/registry/rules/hitl-ppe-record-analysis.md +302 -0
  66. package/dist/registry/rules/integrity-and-test-ethics.md +275 -0
  67. package/dist/registry/rules/local-development.md +275 -0
  68. package/dist/registry/rules/mandatory-pre-completion-reflection.md +193 -0
  69. package/dist/registry/rules/merge-requirements.md +238 -0
  70. package/dist/registry/rules/simplicity.md +118 -0
  71. package/dist/registry/rules/software-development-lifecycle.md +105 -0
  72. package/dist/registry/rules/spike-first-development.md +205 -0
  73. package/dist/registry/rules/successful-debugging-patterns.md +488 -0
  74. package/dist/registry/scripts/build-scripts-generator.js +205 -0
  75. package/dist/registry/scripts/cleanup-branch.js +287 -0
  76. package/dist/registry/scripts/evaluate-code-quality.js +66 -0
  77. package/dist/registry/scripts/exec-with-timeout.js +142 -0
  78. package/dist/registry/scripts/fraim-config.js +61 -0
  79. package/dist/registry/scripts/generate-engagement-emails.js +705 -0
  80. package/dist/registry/scripts/generic-issues-api.js +100 -0
  81. package/dist/registry/scripts/newsletter-helpers.js +671 -0
  82. package/dist/registry/scripts/openapi-generator.js +664 -0
  83. package/dist/registry/scripts/performance/profile-server.js +390 -0
  84. package/dist/registry/scripts/profile-server.js +389 -0
  85. package/dist/registry/scripts/run-thank-you-workflow.js +92 -0
  86. package/dist/registry/scripts/send-newsletter-simple.js +85 -0
  87. package/dist/registry/scripts/send-thank-you-emails.js +54 -0
  88. package/dist/registry/scripts/validate-openapi-limits.js +311 -0
  89. package/dist/registry/scripts/validate-test-coverage.js +262 -0
  90. package/dist/registry/scripts/verify-test-coverage.js +66 -0
  91. package/dist/registry/stubs/workflows/azure/cost-optimization.md +11 -0
  92. package/dist/registry/stubs/workflows/bootstrap/create-architecture.md +11 -0
  93. package/dist/registry/stubs/workflows/bootstrap/detect-broken-windows.md +11 -0
  94. package/dist/registry/stubs/workflows/bootstrap/evaluate-code-quality.md +11 -0
  95. package/dist/registry/stubs/workflows/bootstrap/verify-test-coverage.md +11 -0
  96. package/dist/registry/stubs/workflows/brainstorming/blue-sky-brainstorming.md +11 -0
  97. package/dist/registry/stubs/workflows/brainstorming/codebase-brainstorming.md +11 -0
  98. package/dist/registry/stubs/workflows/business-development/create-business-plan.md +11 -0
  99. package/dist/registry/stubs/workflows/business-development/ideate-business-opportunity.md +11 -0
  100. package/dist/registry/stubs/workflows/business-development/price-product.md +18 -0
  101. package/dist/registry/stubs/workflows/compliance/detect-compliance-requirements.md +11 -0
  102. package/dist/registry/stubs/workflows/compliance/generate-audit-evidence.md +11 -0
  103. package/dist/registry/stubs/workflows/compliance/soc2-evidence-generator.md +11 -0
  104. package/dist/registry/stubs/workflows/customer-development/insight-analysis.md +11 -0
  105. package/dist/registry/stubs/workflows/customer-development/insight-triage.md +11 -0
  106. package/dist/registry/stubs/workflows/customer-development/interview-preparation.md +11 -0
  107. package/dist/registry/stubs/workflows/customer-development/linkedin-outreach.md +11 -0
  108. package/dist/registry/stubs/workflows/customer-development/strategic-brainstorming.md +11 -0
  109. package/dist/registry/stubs/workflows/customer-development/thank-customers.md +11 -0
  110. package/dist/registry/stubs/workflows/customer-development/user-survey-dispatch.md +11 -0
  111. package/dist/registry/stubs/workflows/customer-development/users-to-target.md +11 -0
  112. package/dist/registry/stubs/workflows/customer-development/weekly-newsletter.md +11 -0
  113. package/dist/registry/stubs/workflows/deploy/cloud-deployment.md +11 -0
  114. package/dist/registry/stubs/workflows/improve-fraim/contribute.md +11 -0
  115. package/dist/registry/stubs/workflows/improve-fraim/file-issue.md +11 -0
  116. package/dist/registry/stubs/workflows/learning/build-skillset.md +11 -0
  117. package/dist/registry/stubs/workflows/learning/synthesize-learnings.md +11 -0
  118. package/dist/registry/stubs/workflows/legal/contract-review-analysis.md +11 -0
  119. package/dist/registry/stubs/workflows/legal/nda.md +11 -0
  120. package/dist/registry/stubs/workflows/legal/patent-filing.md +11 -0
  121. package/dist/registry/stubs/workflows/legal/saas-contract-development.md +11 -0
  122. package/dist/registry/stubs/workflows/legal/trademark-filing.md +11 -0
  123. package/dist/registry/stubs/workflows/marketing/content-creation.md +11 -0
  124. package/dist/registry/stubs/workflows/marketing/convert-to-pdf.md +11 -0
  125. package/dist/registry/stubs/workflows/marketing/create-modern-website.md +11 -0
  126. package/dist/registry/stubs/workflows/marketing/domain-registration.md +11 -0
  127. package/dist/registry/stubs/workflows/marketing/evangelize.md +11 -0
  128. package/dist/registry/stubs/workflows/marketing/hbr-article.md +11 -0
  129. package/dist/registry/stubs/workflows/marketing/launch-checklist.md +11 -0
  130. package/dist/registry/stubs/workflows/marketing/marketing-strategy.md +11 -0
  131. package/dist/registry/stubs/workflows/marketing/storytelling.md +11 -0
  132. package/dist/registry/stubs/workflows/performance/analyze-performance.md +11 -0
  133. package/dist/registry/stubs/workflows/product-building/design.md +11 -0
  134. package/dist/registry/stubs/workflows/product-building/implement.md +11 -0
  135. package/dist/registry/stubs/workflows/product-building/iterate-on-pr-comments.md +11 -0
  136. package/dist/registry/stubs/workflows/product-building/prep-issue.md +11 -0
  137. package/dist/registry/stubs/workflows/product-building/prototype.md +11 -0
  138. package/dist/registry/stubs/workflows/product-building/resolve.md +11 -0
  139. package/dist/registry/stubs/workflows/product-building/retrospect.md +11 -0
  140. package/dist/registry/stubs/workflows/product-building/spec.md +11 -0
  141. package/dist/registry/stubs/workflows/product-building/test.md +11 -0
  142. package/dist/registry/stubs/workflows/productivity-report/productivity-report.md +11 -0
  143. package/dist/registry/stubs/workflows/quality-assurance/browser-validation.md +11 -0
  144. package/dist/registry/stubs/workflows/quality-assurance/iterative-improvement-cycle.md +11 -0
  145. package/dist/registry/stubs/workflows/replicate/replicate-discovery.md +11 -0
  146. package/dist/registry/stubs/workflows/replicate/replicate-to-issues.md +11 -0
  147. package/dist/registry/stubs/workflows/reviewer/review-implementation-vs-design-spec.md +11 -0
  148. package/dist/registry/stubs/workflows/reviewer/review-implementation-vs-feature-spec.md +11 -0
  149. package/dist/registry/stubs/workflows/startup-credits/aws-activate-application.md +11 -0
  150. package/dist/registry/stubs/workflows/startup-credits/google-cloud-application.md +11 -0
  151. package/dist/registry/stubs/workflows/startup-credits/microsoft-azure-application.md +11 -0
  152. package/dist/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +53 -0
  153. package/dist/registry/templates/bootstrap/CODE-QUALITY-REPORT-TEMPLATE.md +37 -0
  154. package/dist/registry/templates/bootstrap/TEST-COVERAGE-REPORT-TEMPLATE.md +35 -0
  155. package/dist/registry/templates/business-development/IDEATION-REPORT-TEMPLATE.md +29 -0
  156. package/dist/registry/templates/business-development/PRICING-STRATEGY-TEMPLATE.md +126 -0
  157. package/dist/registry/templates/customer-development/customer-interview-template.md +99 -0
  158. package/dist/registry/templates/customer-development/customer-persona-template.md +69 -0
  159. package/dist/registry/templates/customer-development/follow-up-email-templates.md +132 -0
  160. package/dist/registry/templates/customer-development/insight-analysis-template.md +74 -0
  161. package/dist/registry/templates/customer-development/prospect-inventory-template.csv +3 -0
  162. package/dist/registry/templates/customer-development/search-strategy-template.md +123 -0
  163. package/dist/registry/templates/customer-development/strategic-recommendations-template.md +53 -0
  164. package/dist/registry/templates/customer-development/thank-you-email-template.html +124 -0
  165. package/dist/registry/templates/customer-development/thank-you-note-template.md +16 -0
  166. package/dist/registry/templates/customer-development/triage-log-template.md +278 -0
  167. package/dist/registry/templates/customer-development/weekly-newsletter-template.html +204 -0
  168. package/dist/registry/templates/evidence/Design-Evidence.md +30 -0
  169. package/dist/registry/templates/evidence/Implementation-BugEvidence.md +122 -0
  170. package/dist/registry/templates/evidence/Implementation-FeatureEvidence.md +160 -0
  171. package/dist/registry/templates/evidence/Spec-Evidence.md +19 -0
  172. package/dist/registry/templates/help/HelpNeeded.md +14 -0
  173. package/dist/registry/templates/legal/NDA-TEMPLATE.md +170 -0
  174. package/dist/registry/templates/legal/PATENT-TEMPLATE.md +372 -0
  175. package/dist/registry/templates/legal/TRADEMARK-TEMPLATE.md +339 -0
  176. package/dist/registry/templates/legal/contract-review-checklist.md +193 -0
  177. package/dist/registry/templates/legal/review-report-template.md +198 -0
  178. package/dist/registry/templates/legal/saas-terms-template.md +174 -0
  179. package/dist/registry/templates/legal/sow-template.md +117 -0
  180. package/dist/registry/templates/legal/template-variables.md +131 -0
  181. package/dist/registry/templates/marketing/DOMAIN-REGISTRATION-TEMPLATE.md +194 -0
  182. package/dist/registry/templates/marketing/EVANGELIZE-TEMPLATE.md +102 -0
  183. package/dist/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +66 -0
  184. package/dist/registry/templates/marketing/STORYTELLING-TEMPLATE.md +130 -0
  185. package/dist/registry/templates/marketing/WEBSITE-TEMPLATE.md +262 -0
  186. package/dist/registry/templates/marketing/github-pages-workflow.yml +64 -0
  187. package/dist/registry/templates/replicate/implementation-checklist.md +39 -0
  188. package/dist/registry/templates/replicate/use-cases-template.md +88 -0
  189. package/dist/registry/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +55 -0
  190. package/dist/registry/templates/specs/BUGSPEC-TEMPLATE.md +37 -0
  191. package/dist/registry/templates/specs/FEATURESPEC-TEMPLATE.md +66 -0
  192. package/dist/registry/templates/specs/TECHSPEC-TEMPLATE.md +39 -0
  193. package/dist/registry/workflows/azure/cost-optimization.md +772 -0
  194. package/dist/registry/workflows/bootstrap/create-architecture.md +37 -0
  195. package/dist/registry/workflows/bootstrap/detect-broken-windows.md +300 -0
  196. package/dist/registry/workflows/bootstrap/evaluate-code-quality.md +35 -0
  197. package/dist/registry/workflows/bootstrap/verify-test-coverage.md +36 -0
  198. package/dist/registry/workflows/brainstorming/blue-sky-brainstorming.md +211 -0
  199. package/dist/registry/workflows/brainstorming/codebase-brainstorming.md +159 -0
  200. package/dist/registry/workflows/business-development/create-business-plan.md +737 -0
  201. package/dist/registry/workflows/business-development/ideate-business-opportunity.md +55 -0
  202. package/dist/registry/workflows/business-development/price-product.md +325 -0
  203. package/dist/registry/workflows/compliance/detect-compliance-requirements.md +80 -0
  204. package/dist/registry/workflows/compliance/generate-audit-evidence.md +80 -0
  205. package/dist/registry/workflows/compliance/soc2-evidence-generator.md +332 -0
  206. package/dist/registry/workflows/customer-development/insight-analysis.md +156 -0
  207. package/dist/registry/workflows/customer-development/insight-triage.md +933 -0
  208. package/dist/registry/workflows/customer-development/interview-preparation.md +452 -0
  209. package/dist/registry/workflows/customer-development/linkedin-outreach.md +599 -0
  210. package/dist/registry/workflows/customer-development/strategic-brainstorming.md +146 -0
  211. package/dist/registry/workflows/customer-development/thank-customers.md +203 -0
  212. package/dist/registry/workflows/customer-development/user-survey-dispatch.md +312 -0
  213. package/dist/registry/workflows/customer-development/users-to-target.md +427 -0
  214. package/dist/registry/workflows/customer-development/weekly-newsletter.md +366 -0
  215. package/dist/registry/workflows/deploy/cloud-deployment.md +310 -0
  216. package/dist/registry/workflows/improve-fraim/contribute.md +32 -0
  217. package/dist/registry/workflows/improve-fraim/file-issue.md +32 -0
  218. package/dist/registry/workflows/learning/build-skillset.md +212 -0
  219. package/dist/registry/workflows/learning/synthesize-learnings.md +369 -0
  220. package/dist/registry/workflows/legal/contract-review-analysis.md +382 -0
  221. package/dist/registry/workflows/legal/nda.md +69 -0
  222. package/dist/registry/workflows/legal/patent-filing.md +76 -0
  223. package/dist/registry/workflows/legal/saas-contract-development.md +204 -0
  224. package/dist/registry/workflows/legal/trademark-filing.md +77 -0
  225. package/dist/registry/workflows/marketing/content-creation.md +40 -0
  226. package/dist/registry/workflows/marketing/convert-to-pdf.md +265 -0
  227. package/dist/registry/workflows/marketing/create-modern-website.md +456 -0
  228. package/dist/registry/workflows/marketing/domain-registration.md +323 -0
  229. package/dist/registry/workflows/marketing/evangelize.md +426 -0
  230. package/dist/registry/workflows/marketing/hbr-article.md +73 -0
  231. package/dist/registry/workflows/marketing/launch-checklist.md +37 -0
  232. package/dist/registry/workflows/marketing/marketing-strategy.md +45 -0
  233. package/dist/registry/workflows/marketing/storytelling.md +65 -0
  234. package/dist/registry/workflows/performance/analyze-performance.md +65 -0
  235. package/dist/registry/workflows/product-building/design.md +263 -0
  236. package/dist/registry/workflows/product-building/implement.md +771 -0
  237. package/dist/registry/workflows/product-building/iterate-on-pr-comments.md +70 -0
  238. package/dist/registry/workflows/product-building/prep-issue.md +41 -0
  239. package/dist/registry/workflows/product-building/prototype.md +60 -0
  240. package/dist/registry/workflows/product-building/resolve.md +175 -0
  241. package/dist/registry/workflows/product-building/retrospect.md +86 -0
  242. package/dist/registry/workflows/product-building/spec.md +303 -0
  243. package/dist/registry/workflows/product-building/test.md +125 -0
  244. package/dist/registry/workflows/productivity-report/productivity-report.md +263 -0
  245. package/dist/registry/workflows/quality-assurance/browser-validation.md +221 -0
  246. package/dist/registry/workflows/quality-assurance/iterative-improvement-cycle.md +562 -0
  247. package/dist/registry/workflows/replicate/replicate-discovery.md +336 -0
  248. package/dist/registry/workflows/replicate/replicate-to-issues.md +319 -0
  249. package/dist/registry/workflows/reviewer/review-implementation-vs-design-spec.md +694 -0
  250. package/dist/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +734 -0
  251. package/dist/registry/workflows/startup-credits/aws-activate-application.md +535 -0
  252. package/dist/registry/workflows/startup-credits/google-cloud-application.md +647 -0
  253. package/dist/registry/workflows/startup-credits/microsoft-azure-application.md +538 -0
  254. package/package.json +2 -1
@@ -0,0 +1,311 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * FRAIM Generic OpenAPI Limits Validator
5
+ * This script validates OpenAPI file sizes against specified limits.
6
+ *
7
+ * Validates ChatGPT limitations for any project:
8
+ * - instructions.txt: 8,000 character limit
9
+ * - OpenAPI endpoints: 35 endpoint limit
10
+ * - OpenAPI descriptions: 300 character limit per operation
11
+ * - Missing operationIds
12
+ * - Missing schema definitions
13
+ * - x-openai-isConsequential on non-GET endpoints
14
+ *
15
+ * Usage:
16
+ * npx tsx scripts/validate-openapi-limits.ts [instructions-file] [openapi-file]
17
+ *
18
+ * Defaults:
19
+ * instructions-file: src/openapi/instructions.txt
20
+ * openapi-file: src/openapi/openapi.json
21
+ */
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.validateAll = validateAll;
24
+ const fs_1 = require("fs");
25
+ const INSTRUCTIONS_LIMIT = 8000;
26
+ const OPENAPI_ENDPOINT_LIMIT = 35;
27
+ const OPENAPI_DESC_LIMIT = 300;
28
+ /**
29
+ * Collect all schema references from an object recursively
30
+ */
31
+ function collectSchemaRefs(obj, refs = new Set()) {
32
+ if (typeof obj !== 'object' || obj === null) {
33
+ return refs;
34
+ }
35
+ if (Array.isArray(obj)) {
36
+ obj.forEach(item => collectSchemaRefs(item, refs));
37
+ return refs;
38
+ }
39
+ if (obj.$ref && typeof obj.$ref === 'string') {
40
+ // Extract schema name from #/components/schemas/SchemaName
41
+ const match = obj.$ref.match(/#\/components\/schemas\/(.+)$/);
42
+ if (match) {
43
+ refs.add(match[1]);
44
+ }
45
+ }
46
+ Object.values(obj).forEach(value => collectSchemaRefs(value, refs));
47
+ return refs;
48
+ }
49
+ /**
50
+ * Validate instructions.txt length
51
+ */
52
+ function validateInstructions(instructionsPath) {
53
+ const result = {
54
+ passed: true,
55
+ errors: [],
56
+ warnings: []
57
+ };
58
+ if (!(0, fs_1.existsSync)(instructionsPath)) {
59
+ result.warnings.push(`instructions.txt not found at ${instructionsPath}`);
60
+ return result;
61
+ }
62
+ try {
63
+ const instructionsContent = (0, fs_1.readFileSync)(instructionsPath, 'utf-8');
64
+ const instructionsLength = instructionsContent.length;
65
+ console.log(`šŸ“„ instructions.txt: ${instructionsLength} characters (limit: ${INSTRUCTIONS_LIMIT})`);
66
+ if (instructionsLength > INSTRUCTIONS_LIMIT) {
67
+ result.passed = false;
68
+ result.errors.push(`instructions.txt exceeds ${INSTRUCTIONS_LIMIT} character limit (${instructionsLength} chars). Move detailed content to KB files.`);
69
+ console.log(` āŒ FAILED: Exceeds limit`);
70
+ }
71
+ else {
72
+ console.log(` āœ… PASSED: Within limit\n`);
73
+ }
74
+ }
75
+ catch (error) {
76
+ result.passed = false;
77
+ result.errors.push(`Failed to read instructions.txt: ${error.message}`);
78
+ }
79
+ return result;
80
+ }
81
+ /**
82
+ * Validate OpenAPI specification
83
+ */
84
+ function validateOpenAPI(openapiPath) {
85
+ const result = {
86
+ passed: true,
87
+ errors: [],
88
+ warnings: []
89
+ };
90
+ if (!(0, fs_1.existsSync)(openapiPath)) {
91
+ result.warnings.push(`OpenAPI file not found at ${openapiPath}`);
92
+ return result;
93
+ }
94
+ try {
95
+ const openapiContent = (0, fs_1.readFileSync)(openapiPath, 'utf-8');
96
+ const openapiSpec = JSON.parse(openapiContent);
97
+ // Count endpoints (operations) and validate
98
+ let endpointCount = 0;
99
+ const endpointList = [];
100
+ const longDescriptions = [];
101
+ const missingOperationIds = [];
102
+ const allSchemaRefs = new Set();
103
+ const missingConsequential = [];
104
+ const wrongConsequential = [];
105
+ if (openapiSpec.paths) {
106
+ for (const [path, methods] of Object.entries(openapiSpec.paths)) {
107
+ for (const [method, details] of Object.entries(methods)) {
108
+ if (typeof details === 'object' && details !== null) {
109
+ // Skip if it's a parameter definition or response definition
110
+ if (['parameters', 'responses', 'requestBody'].includes(method)) {
111
+ continue;
112
+ }
113
+ endpointCount++;
114
+ endpointList.push(`${method.toUpperCase()} ${path}`);
115
+ // Check for operationId
116
+ if (!details.operationId) {
117
+ missingOperationIds.push({
118
+ path,
119
+ method: method.toUpperCase()
120
+ });
121
+ }
122
+ // Check description length
123
+ if (details.description) {
124
+ const descLength = details.description.length;
125
+ if (descLength > OPENAPI_DESC_LIMIT) {
126
+ longDescriptions.push({
127
+ path,
128
+ method: method.toUpperCase(),
129
+ length: descLength
130
+ });
131
+ }
132
+ }
133
+ // Collect all schema references from this operation
134
+ collectSchemaRefs(details, allSchemaRefs);
135
+ // Check for x-openai-isConsequential on non-GET endpoints
136
+ const nonGetMethods = ['post', 'put', 'patch', 'delete'];
137
+ if (nonGetMethods.includes(method.toLowerCase())) {
138
+ const hasConsequential = details.hasOwnProperty('x-openai-isConsequential');
139
+ const consequentialValue = details['x-openai-isConsequential'];
140
+ // ALL non-GET endpoints should have x-openai-isConsequential: false
141
+ if (!hasConsequential) {
142
+ missingConsequential.push({
143
+ path,
144
+ method: method.toUpperCase()
145
+ });
146
+ }
147
+ else if (consequentialValue !== false) {
148
+ wrongConsequential.push({
149
+ path,
150
+ method: method.toUpperCase(),
151
+ value: consequentialValue
152
+ });
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
159
+ // Also collect schema refs from components/responses and components/parameters if they exist
160
+ if (openapiSpec.components) {
161
+ if (openapiSpec.components.responses) {
162
+ Object.values(openapiSpec.components.responses).forEach((response) => {
163
+ collectSchemaRefs(response, allSchemaRefs);
164
+ });
165
+ }
166
+ if (openapiSpec.components.parameters) {
167
+ Object.values(openapiSpec.components.parameters).forEach((param) => {
168
+ collectSchemaRefs(param, allSchemaRefs);
169
+ });
170
+ }
171
+ }
172
+ // Check for missing schema definitions
173
+ const definedSchemas = new Set();
174
+ if (openapiSpec.components && openapiSpec.components.schemas) {
175
+ Object.keys(openapiSpec.components.schemas).forEach(schemaName => {
176
+ definedSchemas.add(schemaName);
177
+ });
178
+ }
179
+ const missingSchemas = [];
180
+ allSchemaRefs.forEach(refName => {
181
+ if (!definedSchemas.has(refName)) {
182
+ missingSchemas.push(refName);
183
+ }
184
+ });
185
+ // Validate endpoint count
186
+ console.log(`šŸ“‹ OpenAPI endpoints: ${endpointCount} (limit: ${OPENAPI_ENDPOINT_LIMIT})`);
187
+ if (endpointCount > OPENAPI_ENDPOINT_LIMIT) {
188
+ result.passed = false;
189
+ result.errors.push(`OpenAPI spec exceeds ${OPENAPI_ENDPOINT_LIMIT} endpoint limit (${endpointCount} endpoints). ChatGPT cannot handle more than ${OPENAPI_ENDPOINT_LIMIT} endpoints.`);
190
+ console.log(` āŒ FAILED: Too many endpoints`);
191
+ console.log(` Endpoints:`);
192
+ endpointList.slice(0, 10).forEach(ep => console.log(` - ${ep}`));
193
+ if (endpointCount > 10) {
194
+ console.log(` ... and ${endpointCount - 10} more`);
195
+ }
196
+ }
197
+ else {
198
+ console.log(` āœ… PASSED: Within limit`);
199
+ }
200
+ // Check description lengths
201
+ if (longDescriptions.length > 0) {
202
+ console.log(`\nšŸ“ OpenAPI descriptions: ${longDescriptions.length} exceed ${OPENAPI_DESC_LIMIT} char limit`);
203
+ longDescriptions.forEach(({ path, method, length }) => {
204
+ result.passed = false;
205
+ result.errors.push(`OpenAPI operation ${method} ${path} description exceeds ${OPENAPI_DESC_LIMIT} character limit (${length} chars). Shorten description or move details to KB files.`);
206
+ console.log(` āŒ ${method} ${path}: ${length} chars`);
207
+ });
208
+ }
209
+ else {
210
+ console.log(`\nšŸ“ OpenAPI descriptions: All within ${OPENAPI_DESC_LIMIT} char limit`);
211
+ console.log(` āœ… PASSED: All descriptions within limit`);
212
+ }
213
+ // Check for missing operationIds
214
+ if (missingOperationIds.length > 0) {
215
+ console.log(`\nšŸ”‘ OpenAPI operationIds: ${missingOperationIds.length} missing`);
216
+ missingOperationIds.forEach(({ path, method }) => {
217
+ result.passed = false;
218
+ result.errors.push(`OpenAPI operation ${method} ${path} is missing required 'operationId' field. Add a unique operationId (e.g., "getTask", "createTask").`);
219
+ console.log(` āŒ ${method} ${path}: Missing operationId`);
220
+ });
221
+ }
222
+ else {
223
+ console.log(`\nšŸ”‘ OpenAPI operationIds: All operations have operationId`);
224
+ console.log(` āœ… PASSED: All operations have operationId`);
225
+ }
226
+ // Check for missing schema definitions
227
+ if (missingSchemas.length > 0) {
228
+ console.log(`\nšŸ“š OpenAPI schemas: ${missingSchemas.length} referenced but not defined`);
229
+ missingSchemas.forEach(schemaName => {
230
+ result.passed = false;
231
+ result.errors.push(`OpenAPI schema '${schemaName}' is referenced but not defined in components.schemas. Add the schema definition to components.schemas.`);
232
+ console.log(` āŒ Missing schema: ${schemaName}`);
233
+ });
234
+ }
235
+ else {
236
+ console.log(`\nšŸ“š OpenAPI schemas: All referenced schemas are defined`);
237
+ console.log(` āœ… PASSED: All schema references resolve`);
238
+ }
239
+ // Check for missing or incorrect x-openai-isConsequential on non-GET endpoints
240
+ const allConsequentialIssues = [...missingConsequential, ...wrongConsequential];
241
+ if (allConsequentialIssues.length > 0) {
242
+ console.log(`\nšŸ” OpenAPI x-openai-isConsequential: ${allConsequentialIssues.length} non-GET endpoint(s) missing or incorrectly set`);
243
+ missingConsequential.forEach(({ path, method }) => {
244
+ result.passed = false;
245
+ result.errors.push(`OpenAPI operation ${method} ${path} is missing required 'x-openai-isConsequential: false' field. Add this field to bypass ChatGPT confirmation prompts.`);
246
+ console.log(` āŒ ${method} ${path}: Missing x-openai-isConsequential`);
247
+ });
248
+ wrongConsequential.forEach(({ path, method, value }) => {
249
+ result.passed = false;
250
+ result.errors.push(`OpenAPI operation ${method} ${path} has x-openai-isConsequential set to ${JSON.stringify(value)} but should be false. Non-GET endpoints should have x-openai-isConsequential: false to bypass ChatGPT confirmation prompts.`);
251
+ console.log(` āŒ ${method} ${path}: x-openai-isConsequential is ${JSON.stringify(value)}, should be false`);
252
+ });
253
+ }
254
+ else {
255
+ console.log(`\nšŸ” OpenAPI x-openai-isConsequential: All non-GET endpoints have x-openai-isConsequential: false`);
256
+ console.log(` āœ… PASSED: All non-GET endpoints configured to bypass confirmation`);
257
+ }
258
+ }
259
+ catch (error) {
260
+ result.passed = false;
261
+ result.errors.push(`Failed to parse OpenAPI JSON: ${error.message}`);
262
+ console.log(` āŒ ERROR: ${error.message}`);
263
+ }
264
+ return result;
265
+ }
266
+ /**
267
+ * Main validation function
268
+ */
269
+ function validateAll(instructionsPath = 'src/openapi/instructions.txt', openapiPath = 'src/openapi/openapi.json') {
270
+ console.log('šŸ” Validating OpenAPI and instructions limits...\n');
271
+ const instructionsResult = validateInstructions(instructionsPath);
272
+ const openapiResult = validateOpenAPI(openapiPath);
273
+ // Combine results
274
+ const allErrors = [...instructionsResult.errors, ...openapiResult.errors];
275
+ const allWarnings = [...instructionsResult.warnings, ...openapiResult.warnings];
276
+ const passed = instructionsResult.passed && openapiResult.passed;
277
+ // Summary
278
+ console.log('\n' + '='.repeat(50));
279
+ console.log('šŸ“Š VALIDATION SUMMARY');
280
+ console.log('='.repeat(50));
281
+ if (allWarnings.length > 0) {
282
+ console.log('\nāš ļø WARNINGS:');
283
+ allWarnings.forEach(w => console.log(` - ${w}`));
284
+ }
285
+ if (allErrors.length > 0) {
286
+ console.log('\nāŒ ERRORS:');
287
+ allErrors.forEach(e => console.log(` - ${e}`));
288
+ console.log('\nšŸ’” Solutions:');
289
+ console.log(' - Move detailed content from instructions.txt to KB files (KB-*.txt)');
290
+ console.log(' - Reduce number of OpenAPI endpoints (merge or remove unused endpoints)');
291
+ console.log(' - Shorten OpenAPI operation descriptions, reference KB files for details');
292
+ console.log(' - Add missing operationId fields to all operations (e.g., "getTask", "createTask")');
293
+ console.log(' - Define missing schemas in components.schemas section');
294
+ console.log(' - Add x-openai-isConsequential: false to all non-GET endpoints (POST, PUT, PATCH, DELETE)');
295
+ console.log('\nāŒ BUILD FAILED: Fix errors above before proceeding\n');
296
+ return false;
297
+ }
298
+ else {
299
+ console.log('\nāœ… ALL CHECKS PASSED');
300
+ console.log(' Instructions and OpenAPI spec are within ChatGPT limits\n');
301
+ return true;
302
+ }
303
+ }
304
+ // Run if executed directly
305
+ // @ts-ignore
306
+ if (import.meta.url === `file://${process.argv[1]}`) {
307
+ const instructionsPath = process.argv[2] || 'src/openapi/instructions.txt';
308
+ const openapiPath = process.argv[3] || 'src/openapi/openapi.json';
309
+ const passed = validateAll(instructionsPath, openapiPath);
310
+ process.exit(passed ? 0 : 1);
311
+ }
@@ -0,0 +1,262 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * Validation Plan Coverage Checker
5
+ *
6
+ * Extracts validation plan from spec/design documents and verifies evidence coverage.
7
+ * Used by Gate 9 in code-quality-check.sh
8
+ *
9
+ * Usage: npx tsx <this-script> <issue-number>
10
+ */
11
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
+ desc = { enumerable: true, get: function() { return m[k]; } };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
24
+ }) : function(o, v) {
25
+ o["default"] = v;
26
+ });
27
+ var __importStar = (this && this.__importStar) || (function () {
28
+ var ownKeys = function(o) {
29
+ ownKeys = Object.getOwnPropertyNames || function (o) {
30
+ var ar = [];
31
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
+ return ar;
33
+ };
34
+ return ownKeys(o);
35
+ };
36
+ return function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ })();
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const fs = __importStar(require("fs"));
46
+ const path = __importStar(require("path"));
47
+ /**
48
+ * Extract issue number from branch name
49
+ */
50
+ function extractIssueNumberFromBranch() {
51
+ const branchName = process.env.GIT_BRANCH || '';
52
+ const match = branchName.match(/feature\/(\d+)/);
53
+ return match ? parseInt(match[1]) : null;
54
+ }
55
+ /**
56
+ * Find spec or design file for an issue
57
+ */
58
+ function findSpecOrDesignFile(issueNumber) {
59
+ const specDir = path.join(process.cwd(), 'docs', 'feature specs');
60
+ const rfcDir = path.join(process.cwd(), 'docs', 'rfcs');
61
+ // Try feature specs first
62
+ if (fs.existsSync(specDir)) {
63
+ const files = fs.readdirSync(specDir);
64
+ const specFile = files.find(f => f.startsWith(`${issueNumber}-`) && f.endsWith('.md'));
65
+ if (specFile) {
66
+ return path.join(specDir, specFile);
67
+ }
68
+ }
69
+ // Then try RFCs
70
+ if (fs.existsSync(rfcDir)) {
71
+ const files = fs.readdirSync(rfcDir);
72
+ const rfcFile = files.find(f => f.startsWith(`${issueNumber}-`) && f.endsWith('.md'));
73
+ if (rfcFile) {
74
+ return path.join(rfcDir, rfcFile);
75
+ }
76
+ }
77
+ return null;
78
+ }
79
+ /**
80
+ * Extract validation plan table from markdown file
81
+ */
82
+ function extractValidationPlan(filePath) {
83
+ const content = fs.readFileSync(filePath, 'utf-8');
84
+ const scenarios = [];
85
+ // Find "## Validation Plan" section (not "Validation Plan Coverage")
86
+ const validationPlanMatch = content.match(/##\s+Validation Plan\s*\n[\s\S]*?(?=\n##|$)/i);
87
+ if (!validationPlanMatch) {
88
+ return scenarios;
89
+ }
90
+ const validationSection = validationPlanMatch[0];
91
+ // Look for markdown table - find table header row with "User Scenario"
92
+ // Pattern: | User Scenario | Expected outcome | Validation method |
93
+ const tablePattern = /\|[\s\*]*User Scenario[\s\*]*\|[\s\*]*Expected outcome[\s\*]*\|[\s\*]*Validation method[\s\*]*\|[\s]*\n\|[\s:\-|]+\|[\s]*\n((?:\|.*?\|[\s]*\n)+)/i;
94
+ const tableMatch = validationSection.match(tablePattern);
95
+ if (!tableMatch) {
96
+ return scenarios;
97
+ }
98
+ const tableRows = tableMatch[1].trim().split('\n').filter(row => row.trim().startsWith('|'));
99
+ for (const row of tableRows) {
100
+ // Skip separator rows (all dashes/pipes)
101
+ if (row.match(/^\|[\s:\-|]+\|$/)) {
102
+ continue;
103
+ }
104
+ // Parse table row: | Scenario | Outcome | Method |
105
+ // Handle both formats: | **bold** | text | and | text | text |
106
+ const cells = row.split('|').map(c => c.trim()).filter(c => c && c !== '');
107
+ if (cells.length >= 2) {
108
+ // Remove markdown bold (**text**) from cells
109
+ const cleanCell = (cell) => {
110
+ return cell
111
+ .replace(/^\*\*/, '')
112
+ .replace(/\*\*$/, '')
113
+ .replace(/^\*\*/g, '')
114
+ .replace(/\*\*/g, '')
115
+ .trim();
116
+ };
117
+ const userScenario = cleanCell(cells[0] || '');
118
+ const expectedOutcome = cleanCell(cells[1] || '');
119
+ const validationMethod = cleanCell(cells[2] || 'Manual validation');
120
+ // Skip header rows
121
+ const scenarioLower = userScenario.toLowerCase();
122
+ const outcomeLower = expectedOutcome.toLowerCase();
123
+ if (scenarioLower.includes('user scenario') ||
124
+ (scenarioLower.includes('scenario') && outcomeLower.includes('expected')) ||
125
+ scenarioLower === 'user scenario' ||
126
+ outcomeLower === 'expected outcome') {
127
+ continue;
128
+ }
129
+ // Skip empty rows or separator rows
130
+ if (!userScenario || userScenario === '-' || userScenario.length === 0) {
131
+ continue;
132
+ }
133
+ scenarios.push({
134
+ userScenario,
135
+ expectedOutcome,
136
+ validationMethod
137
+ });
138
+ }
139
+ }
140
+ return scenarios;
141
+ }
142
+ /**
143
+ * Check if evidence exists for a scenario
144
+ * Evidence can be in PR comments, test.log, or other sources
145
+ */
146
+ function checkEvidenceForScenario(scenario, issueNumber) {
147
+ // Extract key terms from scenario for searching
148
+ const scenarioKeywords = scenario.userScenario
149
+ .toLowerCase()
150
+ .replace(/\*\*/g, '')
151
+ .split(/\s+/)
152
+ .filter(w => w.length > 3 && !['agent', 'the', 'with', 'without'].includes(w));
153
+ const outcomeKeywords = scenario.expectedOutcome
154
+ .toLowerCase()
155
+ .replace(/\*\*/g, '')
156
+ .split(/\s+/)
157
+ .filter(w => w.length > 3);
158
+ // Method 1: Check test.log for scenario keywords
159
+ const testLogPath = path.join(process.cwd(), 'test.log');
160
+ if (fs.existsSync(testLogPath)) {
161
+ const testLogContent = fs.readFileSync(testLogPath, 'utf-8').toLowerCase();
162
+ // Check if multiple keywords from scenario appear
163
+ const matchingKeywords = scenarioKeywords.filter(kw => testLogContent.includes(kw));
164
+ if (matchingKeywords.length >= 2) {
165
+ return true;
166
+ }
167
+ }
168
+ // Method 2: Check for evidence file (created by agent with scenario validation)
169
+ const evidenceFiles = ['test-evidence.md', 'validation-evidence.md', 'implementation-evidence.md'];
170
+ for (const evidenceFile of evidenceFiles) {
171
+ const evidencePath = path.join(process.cwd(), evidenceFile);
172
+ if (fs.existsSync(evidencePath)) {
173
+ const evidenceContent = fs.readFileSync(evidencePath, 'utf-8').toLowerCase();
174
+ const matchingKeywords = scenarioKeywords.filter(kw => evidenceContent.includes(kw));
175
+ if (matchingKeywords.length >= 2) {
176
+ return true;
177
+ }
178
+ }
179
+ }
180
+ // Method 3: Check server.log for scenario-related activity
181
+ const serverLogPath = path.join(process.cwd(), 'server.log');
182
+ if (fs.existsSync(serverLogPath)) {
183
+ const serverLogContent = fs.readFileSync(serverLogPath, 'utf-8').toLowerCase();
184
+ // Look for validation-related keywords
185
+ if (scenarioKeywords.some(kw => serverLogContent.includes(kw)) ||
186
+ outcomeKeywords.some(kw => serverLogContent.includes('gate') && serverLogContent.includes(kw))) {
187
+ return true;
188
+ }
189
+ }
190
+ // Note: PR comment checking is done in the shell script (Gate 9)
191
+ // This TypeScript tool focuses on file-based evidence
192
+ return false; // Conservative: require evidence
193
+ }
194
+ /**
195
+ * Main function
196
+ */
197
+ function main() {
198
+ const issueNumberArg = process.argv[2];
199
+ const issueNumber = issueNumberArg ? parseInt(issueNumberArg) : extractIssueNumberFromBranch();
200
+ if (!issueNumber) {
201
+ console.error('āŒ ERROR: Could not determine issue number');
202
+ console.error(' Usage: npx tsx validate-coverage.ts <issue-number>');
203
+ console.error(' Or set GIT_BRANCH environment variable with feature/N-* format');
204
+ process.exit(1);
205
+ }
206
+ const specFile = findSpecOrDesignFile(issueNumber);
207
+ if (!specFile) {
208
+ // No spec/design found - Gate 9 warns but doesn't block
209
+ console.log('ā„¹ļø No spec/design found for issue #' + issueNumber);
210
+ console.log(' Skipping validation plan coverage check');
211
+ console.log(' Gate 9: Validation Plan Coverage - SKIPPED (no spec/design)');
212
+ process.exit(0);
213
+ }
214
+ console.log(`Found spec/design: ${specFile}`);
215
+ const scenarios = extractValidationPlan(specFile);
216
+ if (scenarios.length === 0) {
217
+ console.log('ā„¹ļø No validation plan table found in spec/design');
218
+ console.log(' Gate 9: Validation Plan Coverage - SKIPPED (no validation plan)');
219
+ process.exit(0);
220
+ }
221
+ console.log(`Found ${scenarios.length} validation scenario(s)`);
222
+ // Check evidence for each scenario
223
+ const covered = [];
224
+ const missing = [];
225
+ for (const scenario of scenarios) {
226
+ if (checkEvidenceForScenario(scenario, issueNumber)) {
227
+ covered.push(scenario);
228
+ }
229
+ else {
230
+ missing.push(scenario);
231
+ }
232
+ }
233
+ const coverage = {
234
+ complete: missing.length === 0,
235
+ totalScenarios: scenarios.length,
236
+ coveredScenarios: covered.length,
237
+ missingScenarios: missing,
238
+ coverage: `${covered.length}/${scenarios.length} scenarios (${Math.round(covered.length / scenarios.length * 100)}%)`
239
+ };
240
+ // Output results
241
+ console.log('\nšŸ“Š Validation Plan Coverage:');
242
+ console.log(` ${coverage.coverage}`);
243
+ if (coverage.complete) {
244
+ console.log('āœ… PASSED: All validation scenarios have evidence');
245
+ console.log(' Gate 9: Validation Plan Coverage - PASSED');
246
+ process.exit(0);
247
+ }
248
+ else {
249
+ console.log('āŒ FAILED: Missing evidence for validation scenarios:');
250
+ for (const scenario of missing) {
251
+ console.log(` - "${scenario.userScenario}"`);
252
+ console.log(` Expected: ${scenario.expectedOutcome}`);
253
+ console.log(` Method: ${scenario.validationMethod}`);
254
+ }
255
+ console.log('\n Required: Provide evidence for all validation scenarios before marking PR ready');
256
+ console.log(' Evidence can be: PR comment, test output, manual verification log');
257
+ console.log(' Gate 9: Validation Plan Coverage - FAILED');
258
+ process.exit(1);
259
+ }
260
+ }
261
+ // Run main function
262
+ main();
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * Test Coverage Verifier (Diagnostic Tool)
5
+ *
6
+ * Verifies test coverage against validation plans and outputs data to the console.
7
+ * Used by the verify-test-coverage bootstrapping workflow.
8
+ *
9
+ * Usage: npx tsx <this-script>
10
+ */
11
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
+ desc = { enumerable: true, get: function() { return m[k]; } };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
24
+ }) : function(o, v) {
25
+ o["default"] = v;
26
+ });
27
+ var __importStar = (this && this.__importStar) || (function () {
28
+ var ownKeys = function(o) {
29
+ ownKeys = Object.getOwnPropertyNames || function (o) {
30
+ var ar = [];
31
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
+ return ar;
33
+ };
34
+ return ownKeys(o);
35
+ };
36
+ return function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ })();
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const path = __importStar(require("path"));
46
+ const child_process_1 = require("child_process");
47
+ const REGISTRY_SCRIPTS_DIR = __dirname;
48
+ const VALIDATE_COVERAGE_SCRIPT = path.join(REGISTRY_SCRIPTS_DIR, 'validate-test-coverage.ts');
49
+ function verifyCoverage() {
50
+ console.log('šŸš€ Starting Coverage Verification...');
51
+ console.log('šŸ“Š Analyzing scenario coverage...\n');
52
+ // Run the existing validate-coverage script and pipe output to terminal
53
+ const child = (0, child_process_1.spawn)('npx', ['tsx', VALIDATE_COVERAGE_SCRIPT], {
54
+ stdio: 'inherit',
55
+ shell: true // Needed for npx on Windows locally
56
+ });
57
+ child.on('exit', (code) => {
58
+ if (code === 0) {
59
+ console.log('\nāœ… Coverage analysis completed successfully.');
60
+ }
61
+ else {
62
+ console.log(`\nāŒ Coverage analysis failed with exit code ${code}.`);
63
+ }
64
+ });
65
+ }
66
+ verifyCoverage();
@@ -0,0 +1,11 @@
1
+ # FRAIM Workflow: cost-optimization
2
+
3
+ > [!IMPORTANT]
4
+ > This is a **FRAIM-managed workflow stub**.
5
+ > To load the full context (rules, templates, and execution steps), ask your AI agent to:
6
+ > `@fraim get_fraim_workflow("cost-optimization")`
7
+ >
8
+ > DO NOT EXECUTE.
9
+
10
+ ## Intent
11
+ Enable AI agents to systematically analyze Azure subscription costs, identify optimization opportunities, and implement cost-saving measures while maintaining production reliability.
@@ -0,0 +1,11 @@
1
+ # FRAIM Workflow: create-architecture
2
+
3
+ > [!IMPORTANT]
4
+ > This is a **FRAIM-managed workflow stub**.
5
+ > To load the full context (rules, templates, and execution steps), ask your AI agent to:
6
+ > `@fraim get_fraim_workflow("create-architecture")`
7
+ >
8
+ > DO NOT EXECUTE.
9
+
10
+ ## Intent
11
+ To analyze the codebase and author a comprehensive `docs/architecture/architecture.md` document using the standard template. This document captures the system's design, tech stack, and architectural layers to serve as a map for development.
@@ -0,0 +1,11 @@
1
+ # FRAIM Workflow: detect-broken-windows
2
+
3
+ > [!IMPORTANT]
4
+ > This is a **FRAIM-managed workflow stub**.
5
+ > To load the full context (rules, templates, and execution steps), ask your AI agent to:
6
+ > `@fraim get_fraim_workflow("detect-broken-windows")`
7
+ >
8
+ > DO NOT EXECUTE.
9
+
10
+ ## Intent
11
+ Identify and eliminate "broken windows" in codebases by detecting pattern deviations that cause AI agents to learn bad patterns and degrade code quality over time. Focus on finding "needles in the haystack" - files that deviate from established codebase patterns.