popeye-cli 1.10.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/CONTRIBUTING.md +15 -1
  3. package/README.md +57 -0
  4. package/dist/pipeline/artifact-manager.d.ts +47 -0
  5. package/dist/pipeline/artifact-manager.d.ts.map +1 -0
  6. package/dist/pipeline/artifact-manager.js +251 -0
  7. package/dist/pipeline/artifact-manager.js.map +1 -0
  8. package/dist/pipeline/artifact-validators.d.ts +29 -0
  9. package/dist/pipeline/artifact-validators.d.ts.map +1 -0
  10. package/dist/pipeline/artifact-validators.js +173 -0
  11. package/dist/pipeline/artifact-validators.js.map +1 -0
  12. package/dist/pipeline/change-request.d.ts +47 -0
  13. package/dist/pipeline/change-request.d.ts.map +1 -0
  14. package/dist/pipeline/change-request.js +91 -0
  15. package/dist/pipeline/change-request.js.map +1 -0
  16. package/dist/pipeline/check-runner.d.ts +47 -0
  17. package/dist/pipeline/check-runner.d.ts.map +1 -0
  18. package/dist/pipeline/check-runner.js +417 -0
  19. package/dist/pipeline/check-runner.js.map +1 -0
  20. package/dist/pipeline/command-resolver.d.ts +9 -0
  21. package/dist/pipeline/command-resolver.d.ts.map +1 -0
  22. package/dist/pipeline/command-resolver.js +140 -0
  23. package/dist/pipeline/command-resolver.js.map +1 -0
  24. package/dist/pipeline/consensus/consensus-runner.d.ts +44 -0
  25. package/dist/pipeline/consensus/consensus-runner.d.ts.map +1 -0
  26. package/dist/pipeline/consensus/consensus-runner.js +212 -0
  27. package/dist/pipeline/consensus/consensus-runner.js.map +1 -0
  28. package/dist/pipeline/constitution.d.ts +45 -0
  29. package/dist/pipeline/constitution.d.ts.map +1 -0
  30. package/dist/pipeline/constitution.js +82 -0
  31. package/dist/pipeline/constitution.js.map +1 -0
  32. package/dist/pipeline/gate-engine.d.ts +55 -0
  33. package/dist/pipeline/gate-engine.d.ts.map +1 -0
  34. package/dist/pipeline/gate-engine.js +270 -0
  35. package/dist/pipeline/gate-engine.js.map +1 -0
  36. package/dist/pipeline/index.d.ts +26 -0
  37. package/dist/pipeline/index.d.ts.map +1 -0
  38. package/dist/pipeline/index.js +35 -0
  39. package/dist/pipeline/index.js.map +1 -0
  40. package/dist/pipeline/migration.d.ts +15 -0
  41. package/dist/pipeline/migration.d.ts.map +1 -0
  42. package/dist/pipeline/migration.js +76 -0
  43. package/dist/pipeline/migration.js.map +1 -0
  44. package/dist/pipeline/orchestrator.d.ts +28 -0
  45. package/dist/pipeline/orchestrator.d.ts.map +1 -0
  46. package/dist/pipeline/orchestrator.js +238 -0
  47. package/dist/pipeline/orchestrator.js.map +1 -0
  48. package/dist/pipeline/packets/audit-report-builder.d.ts +11 -0
  49. package/dist/pipeline/packets/audit-report-builder.d.ts.map +1 -0
  50. package/dist/pipeline/packets/audit-report-builder.js +32 -0
  51. package/dist/pipeline/packets/audit-report-builder.js.map +1 -0
  52. package/dist/pipeline/packets/consensus-packet-builder.d.ts +35 -0
  53. package/dist/pipeline/packets/consensus-packet-builder.d.ts.map +1 -0
  54. package/dist/pipeline/packets/consensus-packet-builder.js +80 -0
  55. package/dist/pipeline/packets/consensus-packet-builder.js.map +1 -0
  56. package/dist/pipeline/packets/index.d.ts +12 -0
  57. package/dist/pipeline/packets/index.d.ts.map +1 -0
  58. package/dist/pipeline/packets/index.js +8 -0
  59. package/dist/pipeline/packets/index.js.map +1 -0
  60. package/dist/pipeline/packets/plan-packet-builder.d.ts +21 -0
  61. package/dist/pipeline/packets/plan-packet-builder.d.ts.map +1 -0
  62. package/dist/pipeline/packets/plan-packet-builder.js +27 -0
  63. package/dist/pipeline/packets/plan-packet-builder.js.map +1 -0
  64. package/dist/pipeline/packets/rca-packet-builder.d.ts +19 -0
  65. package/dist/pipeline/packets/rca-packet-builder.d.ts.map +1 -0
  66. package/dist/pipeline/packets/rca-packet-builder.js +22 -0
  67. package/dist/pipeline/packets/rca-packet-builder.js.map +1 -0
  68. package/dist/pipeline/phases/architecture.d.ts +7 -0
  69. package/dist/pipeline/phases/architecture.d.ts.map +1 -0
  70. package/dist/pipeline/phases/architecture.js +60 -0
  71. package/dist/pipeline/phases/architecture.js.map +1 -0
  72. package/dist/pipeline/phases/audit.d.ts +8 -0
  73. package/dist/pipeline/phases/audit.d.ts.map +1 -0
  74. package/dist/pipeline/phases/audit.js +144 -0
  75. package/dist/pipeline/phases/audit.js.map +1 -0
  76. package/dist/pipeline/phases/consensus-architecture.d.ts +7 -0
  77. package/dist/pipeline/phases/consensus-architecture.d.ts.map +1 -0
  78. package/dist/pipeline/phases/consensus-architecture.js +84 -0
  79. package/dist/pipeline/phases/consensus-architecture.js.map +1 -0
  80. package/dist/pipeline/phases/consensus-master-plan.d.ts +7 -0
  81. package/dist/pipeline/phases/consensus-master-plan.d.ts.map +1 -0
  82. package/dist/pipeline/phases/consensus-master-plan.js +81 -0
  83. package/dist/pipeline/phases/consensus-master-plan.js.map +1 -0
  84. package/dist/pipeline/phases/consensus-role-plans.d.ts +7 -0
  85. package/dist/pipeline/phases/consensus-role-plans.d.ts.map +1 -0
  86. package/dist/pipeline/phases/consensus-role-plans.js +85 -0
  87. package/dist/pipeline/phases/consensus-role-plans.js.map +1 -0
  88. package/dist/pipeline/phases/done.d.ts +7 -0
  89. package/dist/pipeline/phases/done.d.ts.map +1 -0
  90. package/dist/pipeline/phases/done.js +45 -0
  91. package/dist/pipeline/phases/done.js.map +1 -0
  92. package/dist/pipeline/phases/implementation.d.ts +8 -0
  93. package/dist/pipeline/phases/implementation.d.ts.map +1 -0
  94. package/dist/pipeline/phases/implementation.js +42 -0
  95. package/dist/pipeline/phases/implementation.js.map +1 -0
  96. package/dist/pipeline/phases/index.d.ts +20 -0
  97. package/dist/pipeline/phases/index.d.ts.map +1 -0
  98. package/dist/pipeline/phases/index.js +19 -0
  99. package/dist/pipeline/phases/index.js.map +1 -0
  100. package/dist/pipeline/phases/intake.d.ts +8 -0
  101. package/dist/pipeline/phases/intake.d.ts.map +1 -0
  102. package/dist/pipeline/phases/intake.js +40 -0
  103. package/dist/pipeline/phases/intake.js.map +1 -0
  104. package/dist/pipeline/phases/phase-context.d.ts +30 -0
  105. package/dist/pipeline/phases/phase-context.d.ts.map +1 -0
  106. package/dist/pipeline/phases/phase-context.js +33 -0
  107. package/dist/pipeline/phases/phase-context.js.map +1 -0
  108. package/dist/pipeline/phases/production-gate.d.ts +8 -0
  109. package/dist/pipeline/phases/production-gate.d.ts.map +1 -0
  110. package/dist/pipeline/phases/production-gate.js +84 -0
  111. package/dist/pipeline/phases/production-gate.js.map +1 -0
  112. package/dist/pipeline/phases/qa-validation.d.ts +7 -0
  113. package/dist/pipeline/phases/qa-validation.d.ts.map +1 -0
  114. package/dist/pipeline/phases/qa-validation.js +50 -0
  115. package/dist/pipeline/phases/qa-validation.js.map +1 -0
  116. package/dist/pipeline/phases/recovery-loop.d.ts +7 -0
  117. package/dist/pipeline/phases/recovery-loop.d.ts.map +1 -0
  118. package/dist/pipeline/phases/recovery-loop.js +91 -0
  119. package/dist/pipeline/phases/recovery-loop.js.map +1 -0
  120. package/dist/pipeline/phases/review.d.ts +8 -0
  121. package/dist/pipeline/phases/review.d.ts.map +1 -0
  122. package/dist/pipeline/phases/review.js +127 -0
  123. package/dist/pipeline/phases/review.js.map +1 -0
  124. package/dist/pipeline/phases/role-planning.d.ts +7 -0
  125. package/dist/pipeline/phases/role-planning.d.ts.map +1 -0
  126. package/dist/pipeline/phases/role-planning.js +75 -0
  127. package/dist/pipeline/phases/role-planning.js.map +1 -0
  128. package/dist/pipeline/phases/stuck.d.ts +7 -0
  129. package/dist/pipeline/phases/stuck.d.ts.map +1 -0
  130. package/dist/pipeline/phases/stuck.js +51 -0
  131. package/dist/pipeline/phases/stuck.js.map +1 -0
  132. package/dist/pipeline/repo-snapshot.d.ts +24 -0
  133. package/dist/pipeline/repo-snapshot.d.ts.map +1 -0
  134. package/dist/pipeline/repo-snapshot.js +343 -0
  135. package/dist/pipeline/repo-snapshot.js.map +1 -0
  136. package/dist/pipeline/role-execution-adapter.d.ts +59 -0
  137. package/dist/pipeline/role-execution-adapter.d.ts.map +1 -0
  138. package/dist/pipeline/role-execution-adapter.js +159 -0
  139. package/dist/pipeline/role-execution-adapter.js.map +1 -0
  140. package/dist/pipeline/skill-loader.d.ts +34 -0
  141. package/dist/pipeline/skill-loader.d.ts.map +1 -0
  142. package/dist/pipeline/skill-loader.js +156 -0
  143. package/dist/pipeline/skill-loader.js.map +1 -0
  144. package/dist/pipeline/skills/defaults.d.ts +16 -0
  145. package/dist/pipeline/skills/defaults.d.ts.map +1 -0
  146. package/dist/pipeline/skills/defaults.js +189 -0
  147. package/dist/pipeline/skills/defaults.js.map +1 -0
  148. package/dist/pipeline/type-defs/artifacts.d.ts +202 -0
  149. package/dist/pipeline/type-defs/artifacts.d.ts.map +1 -0
  150. package/dist/pipeline/type-defs/artifacts.js +66 -0
  151. package/dist/pipeline/type-defs/artifacts.js.map +1 -0
  152. package/dist/pipeline/type-defs/audit.d.ts +256 -0
  153. package/dist/pipeline/type-defs/audit.d.ts.map +1 -0
  154. package/dist/pipeline/type-defs/audit.js +54 -0
  155. package/dist/pipeline/type-defs/audit.js.map +1 -0
  156. package/dist/pipeline/type-defs/checks.d.ts +81 -0
  157. package/dist/pipeline/type-defs/checks.d.ts.map +1 -0
  158. package/dist/pipeline/type-defs/checks.js +38 -0
  159. package/dist/pipeline/type-defs/checks.js.map +1 -0
  160. package/dist/pipeline/type-defs/enums.d.ts +43 -0
  161. package/dist/pipeline/type-defs/enums.d.ts.map +1 -0
  162. package/dist/pipeline/type-defs/enums.js +55 -0
  163. package/dist/pipeline/type-defs/enums.js.map +1 -0
  164. package/dist/pipeline/type-defs/index.d.ts +12 -0
  165. package/dist/pipeline/type-defs/index.d.ts.map +1 -0
  166. package/dist/pipeline/type-defs/index.js +12 -0
  167. package/dist/pipeline/type-defs/index.js.map +1 -0
  168. package/dist/pipeline/type-defs/packets.d.ts +806 -0
  169. package/dist/pipeline/type-defs/packets.d.ts.map +1 -0
  170. package/dist/pipeline/type-defs/packets.js +109 -0
  171. package/dist/pipeline/type-defs/packets.js.map +1 -0
  172. package/dist/pipeline/type-defs/snapshot.d.ts +52 -0
  173. package/dist/pipeline/type-defs/snapshot.d.ts.map +1 -0
  174. package/dist/pipeline/type-defs/snapshot.js +35 -0
  175. package/dist/pipeline/type-defs/snapshot.js.map +1 -0
  176. package/dist/pipeline/type-defs/state.d.ts +449 -0
  177. package/dist/pipeline/type-defs/state.d.ts.map +1 -0
  178. package/dist/pipeline/type-defs/state.js +88 -0
  179. package/dist/pipeline/type-defs/state.js.map +1 -0
  180. package/dist/pipeline/types.d.ts +16 -0
  181. package/dist/pipeline/types.d.ts.map +1 -0
  182. package/dist/pipeline/types.js +16 -0
  183. package/dist/pipeline/types.js.map +1 -0
  184. package/dist/types/audit.d.ts +6 -6
  185. package/dist/workflow/index.d.ts.map +1 -1
  186. package/dist/workflow/index.js +48 -0
  187. package/dist/workflow/index.js.map +1 -1
  188. package/package.json +1 -1
  189. package/skills/PHASE_GATE_ENGINE_SPEC.md +113 -20
  190. package/skills/POPEYE_FULL_AUTONOMY_PIPELINE.md +66 -13
  191. package/src/pipeline/artifact-manager.ts +339 -0
  192. package/src/pipeline/artifact-validators.ts +224 -0
  193. package/src/pipeline/change-request.ts +119 -0
  194. package/src/pipeline/check-runner.ts +504 -0
  195. package/src/pipeline/command-resolver.ts +168 -0
  196. package/src/pipeline/consensus/consensus-runner.ts +317 -0
  197. package/src/pipeline/constitution.ts +109 -0
  198. package/src/pipeline/gate-engine.ts +347 -0
  199. package/src/pipeline/index.ts +82 -0
  200. package/src/pipeline/migration.ts +91 -0
  201. package/src/pipeline/orchestrator.ts +314 -0
  202. package/src/pipeline/packets/audit-report-builder.ts +47 -0
  203. package/src/pipeline/packets/consensus-packet-builder.ts +112 -0
  204. package/src/pipeline/packets/index.ts +15 -0
  205. package/src/pipeline/packets/plan-packet-builder.ts +52 -0
  206. package/src/pipeline/packets/rca-packet-builder.ts +38 -0
  207. package/src/pipeline/phases/architecture.ts +73 -0
  208. package/src/pipeline/phases/audit.ts +193 -0
  209. package/src/pipeline/phases/consensus-architecture.ts +104 -0
  210. package/src/pipeline/phases/consensus-master-plan.ts +100 -0
  211. package/src/pipeline/phases/consensus-role-plans.ts +105 -0
  212. package/src/pipeline/phases/done.ts +68 -0
  213. package/src/pipeline/phases/implementation.ts +48 -0
  214. package/src/pipeline/phases/index.ts +21 -0
  215. package/src/pipeline/phases/intake.ts +54 -0
  216. package/src/pipeline/phases/phase-context.ts +86 -0
  217. package/src/pipeline/phases/production-gate.ts +113 -0
  218. package/src/pipeline/phases/qa-validation.ts +63 -0
  219. package/src/pipeline/phases/recovery-loop.ts +118 -0
  220. package/src/pipeline/phases/review.ts +149 -0
  221. package/src/pipeline/phases/role-planning.ts +92 -0
  222. package/src/pipeline/phases/stuck.ts +62 -0
  223. package/src/pipeline/repo-snapshot.ts +395 -0
  224. package/src/pipeline/role-execution-adapter.ts +238 -0
  225. package/src/pipeline/skill-loader.ts +192 -0
  226. package/src/pipeline/skills/defaults.ts +215 -0
  227. package/src/pipeline/type-defs/artifacts.ts +81 -0
  228. package/src/pipeline/type-defs/audit.ts +67 -0
  229. package/src/pipeline/type-defs/checks.ts +47 -0
  230. package/src/pipeline/type-defs/enums.ts +62 -0
  231. package/src/pipeline/type-defs/index.ts +12 -0
  232. package/src/pipeline/type-defs/packets.ts +131 -0
  233. package/src/pipeline/type-defs/snapshot.ts +55 -0
  234. package/src/pipeline/type-defs/state.ts +165 -0
  235. package/src/pipeline/types.ts +16 -0
  236. package/src/workflow/index.ts +48 -0
  237. package/tests/pipeline/artifact-manager.test.ts +183 -0
  238. package/tests/pipeline/artifact-validators.test.ts +207 -0
  239. package/tests/pipeline/change-request.test.ts +180 -0
  240. package/tests/pipeline/check-runner.test.ts +157 -0
  241. package/tests/pipeline/command-resolver.test.ts +159 -0
  242. package/tests/pipeline/consensus-runner.test.ts +206 -0
  243. package/tests/pipeline/consensus-scoring.test.ts +163 -0
  244. package/tests/pipeline/constitution.test.ts +122 -0
  245. package/tests/pipeline/gate-engine.test.ts +195 -0
  246. package/tests/pipeline/migration.test.ts +133 -0
  247. package/tests/pipeline/orchestrator.test.ts +614 -0
  248. package/tests/pipeline/packets/builders.test.ts +347 -0
  249. package/tests/pipeline/repo-snapshot.test.ts +189 -0
  250. package/tests/pipeline/role-execution-adapter.test.ts +299 -0
  251. package/tests/pipeline/skill-loader.test.ts +186 -0
  252. package/tests/pipeline/start-env-checks.test.ts +123 -0
  253. package/tests/pipeline/types.test.ts +156 -0
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Artifact Completeness Validators — deterministic structural checks.
3
+ * Runs BEFORE LLM review in consensus phases to catch obvious issues.
4
+ * Each validator checks for required sections, minimum content length,
5
+ * and structural integrity specific to its artifact type.
6
+ */
7
+ // ─── Section Patterns ────────────────────────────────────
8
+ /** Regex patterns for detecting markdown sections (case-insensitive) */
9
+ function hasSection(content, patterns) {
10
+ return patterns.some((p) => p.test(content));
11
+ }
12
+ function findMissingSections(content, required) {
13
+ const missing = [];
14
+ for (const { name, patterns } of required) {
15
+ if (!hasSection(content, patterns)) {
16
+ missing.push(name);
17
+ }
18
+ }
19
+ return missing;
20
+ }
21
+ // ─── Per-Type Validators ─────────────────────────────────
22
+ function validateMasterPlan(content) {
23
+ const errors = [];
24
+ const warnings = [];
25
+ if (content.length < 200) {
26
+ errors.push('Master plan is too short (min 200 characters)');
27
+ }
28
+ const missing = findMissingSections(content, [
29
+ { name: 'Goals/Objectives', patterns: [/#+\s*(goals?|objectives?)/i, /\bgoals?\b.*:/i] },
30
+ { name: 'Milestones', patterns: [/#+\s*milestones?/i, /\bmilestone\s+\d/i] },
31
+ { name: 'Success Criteria', patterns: [/#+\s*success\s+criteria/i, /\bsuccess\s+criteria\b/i, /#+\s*acceptance\s+criteria/i] },
32
+ ]);
33
+ for (const section of missing) {
34
+ errors.push(`Missing required section: ${section}`);
35
+ }
36
+ // Check for empty sections (heading followed by another heading or end)
37
+ const emptyHeadings = content.match(/^(#+\s+.+)\n(?=#+\s+|\s*$)/gm);
38
+ if (emptyHeadings && emptyHeadings.length > 2) {
39
+ warnings.push(`${emptyHeadings.length} potentially empty sections detected`);
40
+ }
41
+ return { valid: errors.length === 0, errors, warnings };
42
+ }
43
+ function validateArchitecture(content) {
44
+ const errors = [];
45
+ const warnings = [];
46
+ if (content.length < 200) {
47
+ errors.push('Architecture document is too short (min 200 characters)');
48
+ }
49
+ const missing = findMissingSections(content, [
50
+ { name: 'Components/Modules', patterns: [/#+\s*(components?|modules?|services?)/i, /\bcomponent\b/i] },
51
+ { name: 'Data Flow/Contracts', patterns: [/#+\s*(data\s+flow|contracts?|api|interfaces?)/i, /\bcontract\b/i, /\bdata\s+flow\b/i] },
52
+ { name: 'Tech Stack', patterns: [/#+\s*(tech\s+stack|technology|stack)/i, /\btech\s+stack\b/i] },
53
+ ]);
54
+ for (const section of missing) {
55
+ errors.push(`Missing required section: ${section}`);
56
+ }
57
+ // Must reference at least one file path
58
+ const hasFilePath = /(?:src\/|app\/|pages\/|lib\/|\.ts|\.js|\.py|\.go)/.test(content);
59
+ if (!hasFilePath) {
60
+ warnings.push('Architecture should reference at least one file path');
61
+ }
62
+ return { valid: errors.length === 0, errors, warnings };
63
+ }
64
+ function validateRolePlan(content) {
65
+ const errors = [];
66
+ const warnings = [];
67
+ if (content.length < 100) {
68
+ errors.push('Role plan is too short (min 100 characters)');
69
+ }
70
+ const missing = findMissingSections(content, [
71
+ { name: 'Tasks/Responsibilities', patterns: [/#+\s*(tasks?|responsibilities?|work\s+items?)/i, /\btask\b/i] },
72
+ { name: 'Dependencies', patterns: [/#+\s*(dependenc|prerequisites?|requires?)/i, /\bdepend/i] },
73
+ { name: 'Acceptance Criteria', patterns: [/#+\s*(acceptance|done\s+when|completion)/i, /\bacceptance\b/i, /\bdone\s+when\b/i] },
74
+ ]);
75
+ for (const section of missing) {
76
+ errors.push(`Missing required section: ${section}`);
77
+ }
78
+ // Should reference a role name
79
+ const rolePatterns = /\b(DISPATCHER|ARCHITECT|DB_EXPERT|BACKEND|FRONTEND|WEBSITE|QA_TESTER|REVIEWER|AUDITOR|JOURNALIST)\b/i;
80
+ if (!rolePatterns.test(content)) {
81
+ warnings.push('Role plan should reference the role name');
82
+ }
83
+ return { valid: errors.length === 0, errors, warnings };
84
+ }
85
+ function validateQaValidation(content) {
86
+ const errors = [];
87
+ const warnings = [];
88
+ const missing = findMissingSections(content, [
89
+ { name: 'Test Results', patterns: [/#+\s*(test\s+results?|results?)/i, /\btest\s+results?\b/i, /\bpass(?:ed|ing)?\b/i] },
90
+ { name: 'Coverage', patterns: [/#+\s*coverage/i, /\bcoverage\b/i, /\d+\s*%/] },
91
+ ]);
92
+ for (const section of missing) {
93
+ errors.push(`Missing required section: ${section}`);
94
+ }
95
+ // Should contain pass/fail counts
96
+ const hasPassFail = /\b\d+\s*(pass|fail|error|skip)/i.test(content);
97
+ if (!hasPassFail) {
98
+ warnings.push('QA validation should include pass/fail counts');
99
+ }
100
+ return { valid: errors.length === 0, errors, warnings };
101
+ }
102
+ function validateAuditReport(content) {
103
+ const errors = [];
104
+ const warnings = [];
105
+ // Try JSON parsing
106
+ try {
107
+ const parsed = JSON.parse(content);
108
+ if (!Array.isArray(parsed.findings)) {
109
+ errors.push('Audit report must have a "findings" array');
110
+ }
111
+ if (typeof parsed.overall_status !== 'string') {
112
+ errors.push('Audit report must have "overall_status"');
113
+ }
114
+ if (typeof parsed.system_risk_score !== 'number') {
115
+ errors.push('Audit report must have "system_risk_score"');
116
+ }
117
+ }
118
+ catch {
119
+ // Not JSON — check for markdown-style audit
120
+ if (!content.includes('findings') && !content.includes('finding')) {
121
+ errors.push('Audit report must contain findings');
122
+ }
123
+ if (!content.includes('status') && !content.includes('PASS') && !content.includes('FAIL')) {
124
+ errors.push('Audit report must contain overall status');
125
+ }
126
+ if (!content.includes('risk') && !content.includes('score')) {
127
+ warnings.push('Audit report should include risk score');
128
+ }
129
+ }
130
+ return { valid: errors.length === 0, errors, warnings };
131
+ }
132
+ // ─── Validator Registry ──────────────────────────────────
133
+ const VALIDATORS = {
134
+ master_plan: validateMasterPlan,
135
+ architecture: validateArchitecture,
136
+ role_plan: validateRolePlan,
137
+ qa_validation: validateQaValidation,
138
+ audit_report: validateAuditReport,
139
+ };
140
+ // ─── Public API ──────────────────────────────────────────
141
+ /**
142
+ * Validate artifact content completeness based on type-specific rules.
143
+ * Returns a ValidationResult with errors (blocking) and warnings (non-blocking).
144
+ *
145
+ * Args:
146
+ * type: The artifact type to validate against.
147
+ * content: The artifact content string.
148
+ *
149
+ * Returns:
150
+ * ValidationResult with valid flag, errors, and warnings.
151
+ */
152
+ export function validateArtifactCompleteness(type, content) {
153
+ const validator = VALIDATORS[type];
154
+ if (!validator) {
155
+ // No validator for this type — pass by default
156
+ return { valid: true, errors: [], warnings: [] };
157
+ }
158
+ if (!content || content.trim().length === 0) {
159
+ return {
160
+ valid: false,
161
+ errors: [`${type} artifact has empty content`],
162
+ warnings: [],
163
+ };
164
+ }
165
+ return validator(content);
166
+ }
167
+ /**
168
+ * Get all artifact types that have validators.
169
+ */
170
+ export function getValidatableArtifactTypes() {
171
+ return Object.keys(VALIDATORS);
172
+ }
173
+ //# sourceMappingURL=artifact-validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-validators.js","sourceRoot":"","sources":["../../src/pipeline/artifact-validators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,4DAA4D;AAE5D,wEAAwE;AACxE,SAAS,UAAU,CAAC,OAAe,EAAE,QAAkB;IACrD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,mBAAmB,CAC1B,OAAe,EACf,QAAgD;IAEhD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B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SACb,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAmB,CAAC;AACnD,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Change Request mechanism — structured change tracking for mid-pipeline modifications.
3
+ * CRs are created when drift is detected (REVIEW) or architectural issues found (AUDIT).
4
+ * Each CR routes to the appropriate consensus phase for approval.
5
+ */
6
+ import type { PipelinePhase, PipelineRole, ArtifactRef, ChangeRequest } from './types.js';
7
+ export interface BuildChangeRequestArgs {
8
+ originPhase: PipelinePhase;
9
+ requestedBy: PipelineRole;
10
+ changeType: ChangeRequest['change_type'];
11
+ description: string;
12
+ justification: string;
13
+ affectedArtifacts: ArtifactRef[];
14
+ affectedPhases: PipelinePhase[];
15
+ riskLevel: 'low' | 'medium' | 'high';
16
+ }
17
+ /**
18
+ * Build a change request with generated ID and timestamp.
19
+ *
20
+ * Args:
21
+ * args: Change request parameters.
22
+ *
23
+ * Returns:
24
+ * A fully formed ChangeRequest in 'proposed' status.
25
+ */
26
+ export declare function buildChangeRequest(args: BuildChangeRequestArgs): ChangeRequest;
27
+ /**
28
+ * Determine which consensus phase should review a change request.
29
+ *
30
+ * Args:
31
+ * cr: The change request to route.
32
+ *
33
+ * Returns:
34
+ * The pipeline phase that should handle the CR approval.
35
+ */
36
+ export declare function routeChangeRequest(cr: ChangeRequest): PipelinePhase;
37
+ /**
38
+ * Format a change request as markdown for inclusion in artifacts.
39
+ *
40
+ * Args:
41
+ * cr: The change request to format.
42
+ *
43
+ * Returns:
44
+ * Markdown-formatted string.
45
+ */
46
+ export declare function formatChangeRequest(cr: ChangeRequest): string;
47
+ //# sourceMappingURL=change-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-request.d.ts","sourceRoot":"","sources":["../../src/pipeline/change-request.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACd,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,aAAa,CAAC;IAC3B,WAAW,EAAE,YAAY,CAAC;IAC1B,UAAU,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,WAAW,EAAE,CAAC;IACjC,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CACtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,sBAAsB,GAAG,aAAa,CAgB9E;AAaD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,aAAa,GAAG,aAAa,CAEnE;AAID;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,aAAa,GAAG,MAAM,CA4B7D"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Change Request mechanism — structured change tracking for mid-pipeline modifications.
3
+ * CRs are created when drift is detected (REVIEW) or architectural issues found (AUDIT).
4
+ * Each CR routes to the appropriate consensus phase for approval.
5
+ */
6
+ import { randomUUID } from 'node:crypto';
7
+ /**
8
+ * Build a change request with generated ID and timestamp.
9
+ *
10
+ * Args:
11
+ * args: Change request parameters.
12
+ *
13
+ * Returns:
14
+ * A fully formed ChangeRequest in 'proposed' status.
15
+ */
16
+ export function buildChangeRequest(args) {
17
+ return {
18
+ cr_id: `CR-${randomUUID().split('-')[0].toUpperCase()}`,
19
+ timestamp: new Date().toISOString(),
20
+ origin_phase: args.originPhase,
21
+ requested_by: args.requestedBy,
22
+ change_type: args.changeType,
23
+ description: args.description,
24
+ justification: args.justification,
25
+ impact_analysis: {
26
+ affected_artifacts: args.affectedArtifacts,
27
+ affected_phases: args.affectedPhases,
28
+ risk_level: args.riskLevel,
29
+ },
30
+ status: 'proposed',
31
+ };
32
+ }
33
+ // ─── CR Routing ──────────────────────────────────────────
34
+ /** Maps change types to the consensus phase that must approve them */
35
+ const CHANGE_TYPE_ROUTING = {
36
+ scope: 'CONSENSUS_MASTER_PLAN',
37
+ architecture: 'CONSENSUS_ARCHITECTURE',
38
+ dependency: 'CONSENSUS_ROLE_PLANS',
39
+ config: 'QA_VALIDATION',
40
+ requirement: 'CONSENSUS_MASTER_PLAN',
41
+ };
42
+ /**
43
+ * Determine which consensus phase should review a change request.
44
+ *
45
+ * Args:
46
+ * cr: The change request to route.
47
+ *
48
+ * Returns:
49
+ * The pipeline phase that should handle the CR approval.
50
+ */
51
+ export function routeChangeRequest(cr) {
52
+ return CHANGE_TYPE_ROUTING[cr.change_type];
53
+ }
54
+ // ─── CR Formatting ───────────────────────────────────────
55
+ /**
56
+ * Format a change request as markdown for inclusion in artifacts.
57
+ *
58
+ * Args:
59
+ * cr: The change request to format.
60
+ *
61
+ * Returns:
62
+ * Markdown-formatted string.
63
+ */
64
+ export function formatChangeRequest(cr) {
65
+ const lines = [
66
+ `# Change Request ${cr.cr_id}`,
67
+ '',
68
+ `**Status:** ${cr.status}`,
69
+ `**Type:** ${cr.change_type}`,
70
+ `**Origin Phase:** ${cr.origin_phase}`,
71
+ `**Requested By:** ${cr.requested_by}`,
72
+ `**Risk Level:** ${cr.impact_analysis.risk_level}`,
73
+ `**Timestamp:** ${cr.timestamp}`,
74
+ '',
75
+ '## Description',
76
+ cr.description,
77
+ '',
78
+ '## Justification',
79
+ cr.justification,
80
+ '',
81
+ '## Impact Analysis',
82
+ `- Affected phases: ${cr.impact_analysis.affected_phases.join(', ')}`,
83
+ `- Affected artifacts: ${cr.impact_analysis.affected_artifacts.length}`,
84
+ `- Risk level: ${cr.impact_analysis.risk_level}`,
85
+ ];
86
+ if (cr.approval_artifact) {
87
+ lines.push('', `## Approval: ${cr.approval_artifact.artifact_id}`);
88
+ }
89
+ return lines.join('\n');
90
+ }
91
+ //# sourceMappingURL=change-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-request.js","sourceRoot":"","sources":["../../src/pipeline/change-request.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAsBzC;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAA4B;IAC7D,OAAO;QACL,KAAK,EAAE,MAAM,UAAU,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE;QACvD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,YAAY,EAAE,IAAI,CAAC,WAAW;QAC9B,YAAY,EAAE,IAAI,CAAC,WAAW;QAC9B,WAAW,EAAE,IAAI,CAAC,UAAU;QAC5B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,eAAe,EAAE;YACf,kBAAkB,EAAE,IAAI,CAAC,iBAAiB;YAC1C,eAAe,EAAE,IAAI,CAAC,cAAc;YACpC,UAAU,EAAE,IAAI,CAAC,SAAS;SAC3B;QACD,MAAM,EAAE,UAAU;KACnB,CAAC;AACJ,CAAC;AAED,4DAA4D;AAE5D,sEAAsE;AACtE,MAAM,mBAAmB,GAAwD;IAC/E,KAAK,EAAE,uBAAuB;IAC9B,YAAY,EAAE,wBAAwB;IACtC,UAAU,EAAE,sBAAsB;IAClC,MAAM,EAAE,eAAe;IACvB,WAAW,EAAE,uBAAuB;CACrC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAiB;IAClD,OAAO,mBAAmB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;AAC7C,CAAC;AAED,4DAA4D;AAE5D;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAiB;IACnD,MAAM,KAAK,GAAG;QACZ,oBAAoB,EAAE,CAAC,KAAK,EAAE;QAC9B,EAAE;QACF,eAAe,EAAE,CAAC,MAAM,EAAE;QAC1B,aAAa,EAAE,CAAC,WAAW,EAAE;QAC7B,qBAAqB,EAAE,CAAC,YAAY,EAAE;QACtC,qBAAqB,EAAE,CAAC,YAAY,EAAE;QACtC,mBAAmB,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE;QAClD,kBAAkB,EAAE,CAAC,SAAS,EAAE;QAChC,EAAE;QACF,gBAAgB;QAChB,EAAE,CAAC,WAAW;QACd,EAAE;QACF,kBAAkB;QAClB,EAAE,CAAC,aAAa;QAChB,EAAE;QACF,oBAAoB;QACpB,sBAAsB,EAAE,CAAC,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACrE,yBAAyB,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,MAAM,EAAE;QACvE,iBAAiB,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE;KACjD,CAAC;IAEF,IAAI,EAAE,CAAC,iBAAiB,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAgB,EAAE,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Check Runner — executes build/test/lint/typecheck commands
3
+ * and produces GateCheckResult artifacts.
4
+ *
5
+ * Safety: command sanitization, cwd enforcement, stream caps,
6
+ * configurable timeouts (P2-G).
7
+ */
8
+ import type { GateCheckResult, GateCheckType, ResolvedCommands, RepoSnapshot, ArtifactEntry, PipelinePhase } from './types.js';
9
+ import { ArtifactManager } from './artifact-manager.js';
10
+ /** Execute a single check command */
11
+ export declare function runCheck(checkType: GateCheckType, command: string, projectDir: string, timeoutOverride?: number): Promise<GateCheckResult>;
12
+ /** Run all applicable checks based on resolved commands */
13
+ export declare function runAllChecks(resolvedCommands: ResolvedCommands, projectDir: string): Promise<GateCheckResult[]>;
14
+ /** Store check results as artifacts */
15
+ export declare function storeCheckResults(results: GateCheckResult[], artifactManager: ArtifactManager, phase: PipelinePhase): ArtifactEntry[];
16
+ /** Scan project for placeholder/TODO/mock content */
17
+ export declare function runPlaceholderScan(projectDir: string, allowlistPath?: string): GateCheckResult;
18
+ /**
19
+ * Attempt to start the application and verify it does not crash immediately.
20
+ * Optionally checks a health endpoint if a port is detected.
21
+ *
22
+ * Args:
23
+ * startCommand: The command to start the app (e.g., "npm run start").
24
+ * projectDir: Project root directory.
25
+ * options: Optional port, health path, and timeout.
26
+ *
27
+ * Returns:
28
+ * GateCheckResult with pass/fail status.
29
+ */
30
+ export declare function runStartCheck(startCommand: string, projectDir: string, options?: {
31
+ port?: number;
32
+ healthPath?: string;
33
+ timeoutMs?: number;
34
+ }): Promise<GateCheckResult>;
35
+ /**
36
+ * Validate that required environment variables exist.
37
+ * Reads .env.example for required var names and checks .env has them set.
38
+ *
39
+ * Args:
40
+ * projectDir: Project root directory.
41
+ * _snapshot: Repo snapshot (for future use).
42
+ *
43
+ * Returns:
44
+ * GateCheckResult with pass/fail status.
45
+ */
46
+ export declare function runEnvCheck(projectDir: string, _snapshot?: RepoSnapshot): GateCheckResult;
47
+ //# sourceMappingURL=check-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-runner.d.ts","sourceRoot":"","sources":["../../src/pipeline/check-runner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,aAAa,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAuDxD,qCAAqC;AACrC,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,aAAa,EACxB,OAAO,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