popeye-cli 1.10.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/CONTRIBUTING.md +38 -3
  3. package/README.md +104 -18
  4. package/dist/adapters/gemini.js +3 -3
  5. package/dist/adapters/openai.js +2 -2
  6. package/dist/adapters/openai.js.map +1 -1
  7. package/dist/auth/gemini.js +1 -1
  8. package/dist/cli/commands/create.d.ts.map +1 -1
  9. package/dist/cli/commands/create.js +11 -5
  10. package/dist/cli/commands/create.js.map +1 -1
  11. package/dist/cli/commands/resume.d.ts.map +1 -1
  12. package/dist/cli/commands/resume.js +9 -1
  13. package/dist/cli/commands/resume.js.map +1 -1
  14. package/dist/cli/interactive.d.ts.map +1 -1
  15. package/dist/cli/interactive.js +29 -3
  16. package/dist/cli/interactive.js.map +1 -1
  17. package/dist/config/defaults.d.ts.map +1 -1
  18. package/dist/config/defaults.js +7 -2
  19. package/dist/config/defaults.js.map +1 -1
  20. package/dist/config/index.d.ts +1 -7
  21. package/dist/config/index.d.ts.map +1 -1
  22. package/dist/config/popeye-md.d.ts +32 -0
  23. package/dist/config/popeye-md.d.ts.map +1 -0
  24. package/dist/config/popeye-md.js +111 -0
  25. package/dist/config/popeye-md.js.map +1 -0
  26. package/dist/config/schema.d.ts +3 -21
  27. package/dist/config/schema.d.ts.map +1 -1
  28. package/dist/config/schema.js +21 -8
  29. package/dist/config/schema.js.map +1 -1
  30. package/dist/pipeline/artifact-manager.d.ts +47 -0
  31. package/dist/pipeline/artifact-manager.d.ts.map +1 -0
  32. package/dist/pipeline/artifact-manager.js +251 -0
  33. package/dist/pipeline/artifact-manager.js.map +1 -0
  34. package/dist/pipeline/artifact-validators.d.ts +29 -0
  35. package/dist/pipeline/artifact-validators.d.ts.map +1 -0
  36. package/dist/pipeline/artifact-validators.js +173 -0
  37. package/dist/pipeline/artifact-validators.js.map +1 -0
  38. package/dist/pipeline/bridges/review-bridge.d.ts +70 -0
  39. package/dist/pipeline/bridges/review-bridge.d.ts.map +1 -0
  40. package/dist/pipeline/bridges/review-bridge.js +266 -0
  41. package/dist/pipeline/bridges/review-bridge.js.map +1 -0
  42. package/dist/pipeline/change-request.d.ts +47 -0
  43. package/dist/pipeline/change-request.d.ts.map +1 -0
  44. package/dist/pipeline/change-request.js +91 -0
  45. package/dist/pipeline/change-request.js.map +1 -0
  46. package/dist/pipeline/check-runner.d.ts +47 -0
  47. package/dist/pipeline/check-runner.d.ts.map +1 -0
  48. package/dist/pipeline/check-runner.js +417 -0
  49. package/dist/pipeline/check-runner.js.map +1 -0
  50. package/dist/pipeline/command-resolver.d.ts +9 -0
  51. package/dist/pipeline/command-resolver.d.ts.map +1 -0
  52. package/dist/pipeline/command-resolver.js +140 -0
  53. package/dist/pipeline/command-resolver.js.map +1 -0
  54. package/dist/pipeline/consensus/consensus-runner.d.ts +44 -0
  55. package/dist/pipeline/consensus/consensus-runner.d.ts.map +1 -0
  56. package/dist/pipeline/consensus/consensus-runner.js +212 -0
  57. package/dist/pipeline/consensus/consensus-runner.js.map +1 -0
  58. package/dist/pipeline/constitution.d.ts +45 -0
  59. package/dist/pipeline/constitution.d.ts.map +1 -0
  60. package/dist/pipeline/constitution.js +82 -0
  61. package/dist/pipeline/constitution.js.map +1 -0
  62. package/dist/pipeline/gate-engine.d.ts +55 -0
  63. package/dist/pipeline/gate-engine.d.ts.map +1 -0
  64. package/dist/pipeline/gate-engine.js +270 -0
  65. package/dist/pipeline/gate-engine.js.map +1 -0
  66. package/dist/pipeline/index.d.ts +26 -0
  67. package/dist/pipeline/index.d.ts.map +1 -0
  68. package/dist/pipeline/index.js +35 -0
  69. package/dist/pipeline/index.js.map +1 -0
  70. package/dist/pipeline/migration.d.ts +15 -0
  71. package/dist/pipeline/migration.d.ts.map +1 -0
  72. package/dist/pipeline/migration.js +76 -0
  73. package/dist/pipeline/migration.js.map +1 -0
  74. package/dist/pipeline/orchestrator.d.ts +30 -0
  75. package/dist/pipeline/orchestrator.d.ts.map +1 -0
  76. package/dist/pipeline/orchestrator.js +242 -0
  77. package/dist/pipeline/orchestrator.js.map +1 -0
  78. package/dist/pipeline/packets/audit-report-builder.d.ts +11 -0
  79. package/dist/pipeline/packets/audit-report-builder.d.ts.map +1 -0
  80. package/dist/pipeline/packets/audit-report-builder.js +32 -0
  81. package/dist/pipeline/packets/audit-report-builder.js.map +1 -0
  82. package/dist/pipeline/packets/consensus-packet-builder.d.ts +35 -0
  83. package/dist/pipeline/packets/consensus-packet-builder.d.ts.map +1 -0
  84. package/dist/pipeline/packets/consensus-packet-builder.js +80 -0
  85. package/dist/pipeline/packets/consensus-packet-builder.js.map +1 -0
  86. package/dist/pipeline/packets/index.d.ts +12 -0
  87. package/dist/pipeline/packets/index.d.ts.map +1 -0
  88. package/dist/pipeline/packets/index.js +8 -0
  89. package/dist/pipeline/packets/index.js.map +1 -0
  90. package/dist/pipeline/packets/plan-packet-builder.d.ts +21 -0
  91. package/dist/pipeline/packets/plan-packet-builder.d.ts.map +1 -0
  92. package/dist/pipeline/packets/plan-packet-builder.js +27 -0
  93. package/dist/pipeline/packets/plan-packet-builder.js.map +1 -0
  94. package/dist/pipeline/packets/rca-packet-builder.d.ts +19 -0
  95. package/dist/pipeline/packets/rca-packet-builder.d.ts.map +1 -0
  96. package/dist/pipeline/packets/rca-packet-builder.js +22 -0
  97. package/dist/pipeline/packets/rca-packet-builder.js.map +1 -0
  98. package/dist/pipeline/phases/architecture.d.ts +7 -0
  99. package/dist/pipeline/phases/architecture.d.ts.map +1 -0
  100. package/dist/pipeline/phases/architecture.js +60 -0
  101. package/dist/pipeline/phases/architecture.js.map +1 -0
  102. package/dist/pipeline/phases/audit.d.ts +8 -0
  103. package/dist/pipeline/phases/audit.d.ts.map +1 -0
  104. package/dist/pipeline/phases/audit.js +144 -0
  105. package/dist/pipeline/phases/audit.js.map +1 -0
  106. package/dist/pipeline/phases/consensus-architecture.d.ts +7 -0
  107. package/dist/pipeline/phases/consensus-architecture.d.ts.map +1 -0
  108. package/dist/pipeline/phases/consensus-architecture.js +84 -0
  109. package/dist/pipeline/phases/consensus-architecture.js.map +1 -0
  110. package/dist/pipeline/phases/consensus-master-plan.d.ts +7 -0
  111. package/dist/pipeline/phases/consensus-master-plan.d.ts.map +1 -0
  112. package/dist/pipeline/phases/consensus-master-plan.js +81 -0
  113. package/dist/pipeline/phases/consensus-master-plan.js.map +1 -0
  114. package/dist/pipeline/phases/consensus-role-plans.d.ts +7 -0
  115. package/dist/pipeline/phases/consensus-role-plans.d.ts.map +1 -0
  116. package/dist/pipeline/phases/consensus-role-plans.js +85 -0
  117. package/dist/pipeline/phases/consensus-role-plans.js.map +1 -0
  118. package/dist/pipeline/phases/done.d.ts +7 -0
  119. package/dist/pipeline/phases/done.d.ts.map +1 -0
  120. package/dist/pipeline/phases/done.js +45 -0
  121. package/dist/pipeline/phases/done.js.map +1 -0
  122. package/dist/pipeline/phases/implementation.d.ts +8 -0
  123. package/dist/pipeline/phases/implementation.d.ts.map +1 -0
  124. package/dist/pipeline/phases/implementation.js +45 -0
  125. package/dist/pipeline/phases/implementation.js.map +1 -0
  126. package/dist/pipeline/phases/index.d.ts +20 -0
  127. package/dist/pipeline/phases/index.d.ts.map +1 -0
  128. package/dist/pipeline/phases/index.js +19 -0
  129. package/dist/pipeline/phases/index.js.map +1 -0
  130. package/dist/pipeline/phases/intake.d.ts +8 -0
  131. package/dist/pipeline/phases/intake.d.ts.map +1 -0
  132. package/dist/pipeline/phases/intake.js +49 -0
  133. package/dist/pipeline/phases/intake.js.map +1 -0
  134. package/dist/pipeline/phases/phase-context.d.ts +30 -0
  135. package/dist/pipeline/phases/phase-context.d.ts.map +1 -0
  136. package/dist/pipeline/phases/phase-context.js +33 -0
  137. package/dist/pipeline/phases/phase-context.js.map +1 -0
  138. package/dist/pipeline/phases/production-gate.d.ts +8 -0
  139. package/dist/pipeline/phases/production-gate.d.ts.map +1 -0
  140. package/dist/pipeline/phases/production-gate.js +84 -0
  141. package/dist/pipeline/phases/production-gate.js.map +1 -0
  142. package/dist/pipeline/phases/qa-validation.d.ts +7 -0
  143. package/dist/pipeline/phases/qa-validation.d.ts.map +1 -0
  144. package/dist/pipeline/phases/qa-validation.js +50 -0
  145. package/dist/pipeline/phases/qa-validation.js.map +1 -0
  146. package/dist/pipeline/phases/recovery-loop.d.ts +7 -0
  147. package/dist/pipeline/phases/recovery-loop.d.ts.map +1 -0
  148. package/dist/pipeline/phases/recovery-loop.js +93 -0
  149. package/dist/pipeline/phases/recovery-loop.js.map +1 -0
  150. package/dist/pipeline/phases/review.d.ts +8 -0
  151. package/dist/pipeline/phases/review.d.ts.map +1 -0
  152. package/dist/pipeline/phases/review.js +127 -0
  153. package/dist/pipeline/phases/review.js.map +1 -0
  154. package/dist/pipeline/phases/role-planning.d.ts +7 -0
  155. package/dist/pipeline/phases/role-planning.d.ts.map +1 -0
  156. package/dist/pipeline/phases/role-planning.js +75 -0
  157. package/dist/pipeline/phases/role-planning.js.map +1 -0
  158. package/dist/pipeline/phases/stuck.d.ts +7 -0
  159. package/dist/pipeline/phases/stuck.d.ts.map +1 -0
  160. package/dist/pipeline/phases/stuck.js +51 -0
  161. package/dist/pipeline/phases/stuck.js.map +1 -0
  162. package/dist/pipeline/repo-snapshot.d.ts +24 -0
  163. package/dist/pipeline/repo-snapshot.d.ts.map +1 -0
  164. package/dist/pipeline/repo-snapshot.js +343 -0
  165. package/dist/pipeline/repo-snapshot.js.map +1 -0
  166. package/dist/pipeline/role-execution-adapter.d.ts +59 -0
  167. package/dist/pipeline/role-execution-adapter.d.ts.map +1 -0
  168. package/dist/pipeline/role-execution-adapter.js +159 -0
  169. package/dist/pipeline/role-execution-adapter.js.map +1 -0
  170. package/dist/pipeline/skill-loader.d.ts +34 -0
  171. package/dist/pipeline/skill-loader.d.ts.map +1 -0
  172. package/dist/pipeline/skill-loader.js +156 -0
  173. package/dist/pipeline/skill-loader.js.map +1 -0
  174. package/dist/pipeline/skills/defaults.d.ts +16 -0
  175. package/dist/pipeline/skills/defaults.d.ts.map +1 -0
  176. package/dist/pipeline/skills/defaults.js +189 -0
  177. package/dist/pipeline/skills/defaults.js.map +1 -0
  178. package/dist/pipeline/type-defs/artifacts.d.ts +207 -0
  179. package/dist/pipeline/type-defs/artifacts.d.ts.map +1 -0
  180. package/dist/pipeline/type-defs/artifacts.js +67 -0
  181. package/dist/pipeline/type-defs/artifacts.js.map +1 -0
  182. package/dist/pipeline/type-defs/audit.d.ts +259 -0
  183. package/dist/pipeline/type-defs/audit.d.ts.map +1 -0
  184. package/dist/pipeline/type-defs/audit.js +54 -0
  185. package/dist/pipeline/type-defs/audit.js.map +1 -0
  186. package/dist/pipeline/type-defs/checks.d.ts +82 -0
  187. package/dist/pipeline/type-defs/checks.d.ts.map +1 -0
  188. package/dist/pipeline/type-defs/checks.js +38 -0
  189. package/dist/pipeline/type-defs/checks.js.map +1 -0
  190. package/dist/pipeline/type-defs/enums.d.ts +43 -0
  191. package/dist/pipeline/type-defs/enums.d.ts.map +1 -0
  192. package/dist/pipeline/type-defs/enums.js +55 -0
  193. package/dist/pipeline/type-defs/enums.js.map +1 -0
  194. package/dist/pipeline/type-defs/index.d.ts +12 -0
  195. package/dist/pipeline/type-defs/index.d.ts.map +1 -0
  196. package/dist/pipeline/type-defs/index.js +12 -0
  197. package/dist/pipeline/type-defs/index.js.map +1 -0
  198. package/dist/pipeline/type-defs/packets.d.ts +821 -0
  199. package/dist/pipeline/type-defs/packets.d.ts.map +1 -0
  200. package/dist/pipeline/type-defs/packets.js +109 -0
  201. package/dist/pipeline/type-defs/packets.js.map +1 -0
  202. package/dist/pipeline/type-defs/snapshot.d.ts +52 -0
  203. package/dist/pipeline/type-defs/snapshot.d.ts.map +1 -0
  204. package/dist/pipeline/type-defs/snapshot.js +35 -0
  205. package/dist/pipeline/type-defs/snapshot.js.map +1 -0
  206. package/dist/pipeline/type-defs/state.d.ts +455 -0
  207. package/dist/pipeline/type-defs/state.d.ts.map +1 -0
  208. package/dist/pipeline/type-defs/state.js +90 -0
  209. package/dist/pipeline/type-defs/state.js.map +1 -0
  210. package/dist/pipeline/types.d.ts +16 -0
  211. package/dist/pipeline/types.d.ts.map +1 -0
  212. package/dist/pipeline/types.js +16 -0
  213. package/dist/pipeline/types.js.map +1 -0
  214. package/dist/types/audit.d.ts +6 -6
  215. package/dist/types/consensus.d.ts +5 -1
  216. package/dist/types/consensus.d.ts.map +1 -1
  217. package/dist/types/consensus.js +15 -4
  218. package/dist/types/consensus.js.map +1 -1
  219. package/dist/types/index.d.ts +1 -1
  220. package/dist/types/index.d.ts.map +1 -1
  221. package/dist/types/index.js +1 -1
  222. package/dist/types/index.js.map +1 -1
  223. package/dist/types/project.d.ts +1 -1
  224. package/dist/types/project.d.ts.map +1 -1
  225. package/dist/types/project.js +39 -10
  226. package/dist/types/project.js.map +1 -1
  227. package/dist/types/workflow.d.ts +1 -7
  228. package/dist/types/workflow.d.ts.map +1 -1
  229. package/dist/types/workflow.js +1 -1
  230. package/dist/types/workflow.js.map +1 -1
  231. package/dist/upgrade/handlers.js +5 -5
  232. package/dist/upgrade/handlers.js.map +1 -1
  233. package/dist/workflow/index.d.ts.map +1 -1
  234. package/dist/workflow/index.js +52 -0
  235. package/dist/workflow/index.js.map +1 -1
  236. package/dist/workflow/website-strategy.js +1 -1
  237. package/dist/workflow/website-strategy.js.map +1 -1
  238. package/package.json +1 -1
  239. package/skills/PHASE_GATE_ENGINE_SPEC.md +113 -20
  240. package/skills/POPEYE_FULL_AUTONOMY_PIPELINE.md +66 -13
  241. package/src/adapters/gemini.ts +3 -3
  242. package/src/adapters/openai.ts +2 -2
  243. package/src/auth/gemini.ts +1 -1
  244. package/src/cli/commands/create.ts +12 -6
  245. package/src/cli/commands/resume.ts +9 -1
  246. package/src/cli/interactive.ts +32 -3
  247. package/src/config/defaults.ts +7 -2
  248. package/src/config/popeye-md.ts +139 -0
  249. package/src/config/schema.ts +21 -8
  250. package/src/pipeline/artifact-manager.ts +339 -0
  251. package/src/pipeline/artifact-validators.ts +224 -0
  252. package/src/pipeline/bridges/review-bridge.ts +371 -0
  253. package/src/pipeline/change-request.ts +119 -0
  254. package/src/pipeline/check-runner.ts +504 -0
  255. package/src/pipeline/command-resolver.ts +168 -0
  256. package/src/pipeline/consensus/consensus-runner.ts +317 -0
  257. package/src/pipeline/constitution.ts +109 -0
  258. package/src/pipeline/gate-engine.ts +347 -0
  259. package/src/pipeline/index.ts +82 -0
  260. package/src/pipeline/migration.ts +91 -0
  261. package/src/pipeline/orchestrator.ts +322 -0
  262. package/src/pipeline/packets/audit-report-builder.ts +47 -0
  263. package/src/pipeline/packets/consensus-packet-builder.ts +112 -0
  264. package/src/pipeline/packets/index.ts +15 -0
  265. package/src/pipeline/packets/plan-packet-builder.ts +52 -0
  266. package/src/pipeline/packets/rca-packet-builder.ts +38 -0
  267. package/src/pipeline/phases/architecture.ts +73 -0
  268. package/src/pipeline/phases/audit.ts +193 -0
  269. package/src/pipeline/phases/consensus-architecture.ts +104 -0
  270. package/src/pipeline/phases/consensus-master-plan.ts +100 -0
  271. package/src/pipeline/phases/consensus-role-plans.ts +105 -0
  272. package/src/pipeline/phases/done.ts +68 -0
  273. package/src/pipeline/phases/implementation.ts +52 -0
  274. package/src/pipeline/phases/index.ts +21 -0
  275. package/src/pipeline/phases/intake.ts +68 -0
  276. package/src/pipeline/phases/phase-context.ts +86 -0
  277. package/src/pipeline/phases/production-gate.ts +113 -0
  278. package/src/pipeline/phases/qa-validation.ts +63 -0
  279. package/src/pipeline/phases/recovery-loop.ts +120 -0
  280. package/src/pipeline/phases/review.ts +149 -0
  281. package/src/pipeline/phases/role-planning.ts +92 -0
  282. package/src/pipeline/phases/stuck.ts +62 -0
  283. package/src/pipeline/repo-snapshot.ts +395 -0
  284. package/src/pipeline/role-execution-adapter.ts +238 -0
  285. package/src/pipeline/skill-loader.ts +192 -0
  286. package/src/pipeline/skills/defaults.ts +215 -0
  287. package/src/pipeline/type-defs/artifacts.ts +82 -0
  288. package/src/pipeline/type-defs/audit.ts +67 -0
  289. package/src/pipeline/type-defs/checks.ts +47 -0
  290. package/src/pipeline/type-defs/enums.ts +62 -0
  291. package/src/pipeline/type-defs/index.ts +12 -0
  292. package/src/pipeline/type-defs/packets.ts +131 -0
  293. package/src/pipeline/type-defs/snapshot.ts +55 -0
  294. package/src/pipeline/type-defs/state.ts +167 -0
  295. package/src/pipeline/types.ts +16 -0
  296. package/src/types/consensus.ts +16 -4
  297. package/src/types/index.ts +1 -0
  298. package/src/types/project.ts +39 -10
  299. package/src/types/workflow.ts +1 -1
  300. package/src/upgrade/handlers.ts +5 -5
  301. package/src/workflow/index.ts +52 -0
  302. package/src/workflow/website-strategy.ts +1 -1
  303. package/tests/cli/model-command.test.ts +19 -9
  304. package/tests/config/config.test.ts +3 -3
  305. package/tests/config/popeye-md.test.ts +168 -0
  306. package/tests/pipeline/artifact-manager.test.ts +183 -0
  307. package/tests/pipeline/artifact-validators.test.ts +207 -0
  308. package/tests/pipeline/bridges/review-bridge.test.ts +243 -0
  309. package/tests/pipeline/change-request.test.ts +180 -0
  310. package/tests/pipeline/check-runner.test.ts +157 -0
  311. package/tests/pipeline/command-resolver.test.ts +159 -0
  312. package/tests/pipeline/consensus-runner.test.ts +206 -0
  313. package/tests/pipeline/consensus-scoring.test.ts +163 -0
  314. package/tests/pipeline/constitution.test.ts +122 -0
  315. package/tests/pipeline/gate-engine.test.ts +195 -0
  316. package/tests/pipeline/migration.test.ts +133 -0
  317. package/tests/pipeline/orchestrator.test.ts +614 -0
  318. package/tests/pipeline/packets/builders.test.ts +347 -0
  319. package/tests/pipeline/repo-snapshot.test.ts +189 -0
  320. package/tests/pipeline/role-execution-adapter.test.ts +299 -0
  321. package/tests/pipeline/session-guidance.test.ts +205 -0
  322. package/tests/pipeline/skill-loader.test.ts +186 -0
  323. package/tests/pipeline/start-env-checks.test.ts +123 -0
  324. package/tests/pipeline/types.test.ts +156 -0
  325. package/tests/types/consensus.test.ts +1 -1
  326. package/tests/workflow/pipeline-bootstrap.test.ts +162 -0
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Artifact system types — artifact types, refs, entries, dependency edges.
3
+ */
4
+
5
+ import { z } from 'zod';
6
+ import { PipelinePhaseSchema } from './enums.js';
7
+
8
+ // ─── Artifact Types ──────────────────────────────────────
9
+
10
+ export const ArtifactTypeSchema = z.enum([
11
+ 'master_plan',
12
+ 'architecture',
13
+ 'role_plan',
14
+ 'consensus',
15
+ 'arbitration',
16
+ 'audit_report',
17
+ 'rca_report',
18
+ 'production_readiness',
19
+ 'release_notes',
20
+ 'deployment',
21
+ 'rollback',
22
+ 'repo_snapshot',
23
+ 'build_check',
24
+ 'test_check',
25
+ 'lint_check',
26
+ 'typecheck_check',
27
+ 'placeholder_scan',
28
+ 'qa_validation',
29
+ 'review_decision',
30
+ 'stuck_report',
31
+ 'journalist_trace',
32
+ 'resolved_commands',
33
+ 'constitution',
34
+ 'change_request',
35
+ 'additional_context',
36
+ ]);
37
+ export type ArtifactType = z.infer<typeof ArtifactTypeSchema>;
38
+
39
+ // ─── Content Type ────────────────────────────────────────
40
+
41
+ export const ContentTypeSchema = z.enum(['markdown', 'json']);
42
+ export type ContentType = z.infer<typeof ContentTypeSchema>;
43
+
44
+ // ─── Artifact Reference ──────────────────────────────────
45
+
46
+ /** Universal pointer between packets and artifacts */
47
+ export const ArtifactRefSchema = z.object({
48
+ artifact_id: z.string(),
49
+ path: z.string(),
50
+ sha256: z.string(),
51
+ version: z.number().int().positive(),
52
+ type: ArtifactTypeSchema,
53
+ });
54
+ export type ArtifactRef = z.infer<typeof ArtifactRefSchema>;
55
+
56
+ // ─── Artifact Entry ──────────────────────────────────────
57
+
58
+ /** Immutable artifact entry stored in pipeline state */
59
+ export const ArtifactEntrySchema = z.object({
60
+ id: z.string(),
61
+ type: ArtifactTypeSchema,
62
+ phase: PipelinePhaseSchema,
63
+ version: z.number().int().positive(),
64
+ path: z.string(),
65
+ sha256: z.string(),
66
+ timestamp: z.string(),
67
+ immutable: z.literal(true),
68
+ content_type: ContentTypeSchema,
69
+ group_id: z.string(),
70
+ previous_id: z.string().optional(),
71
+ });
72
+ export type ArtifactEntry = z.infer<typeof ArtifactEntrySchema>;
73
+
74
+ // ─── Dependency Edge ─────────────────────────────────────
75
+
76
+ /** Dependency edge between artifacts */
77
+ export const DependencyEdgeSchema = z.object({
78
+ from: ArtifactRefSchema,
79
+ to: ArtifactRefSchema,
80
+ relationship: z.enum(['depends_on', 'supersedes', 'references']),
81
+ });
82
+ export type DependencyEdge = z.infer<typeof DependencyEdgeSchema>;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Audit types — findings, reports, severity classifications.
3
+ */
4
+
5
+ import { z } from 'zod';
6
+ import { PipelineRoleSchema } from './enums.js';
7
+ import { ArtifactRefSchema } from './artifacts.js';
8
+
9
+ // ─── Audit Severity & Category ───────────────────────────
10
+
11
+ export const AuditSeveritySchema = z.enum(['P0', 'P1', 'P2', 'P3']);
12
+ export type AuditSeverity = z.infer<typeof AuditSeveritySchema>;
13
+
14
+ export const AuditCategorySchema = z.enum([
15
+ 'integration',
16
+ 'config',
17
+ 'tests',
18
+ 'schema',
19
+ 'security',
20
+ 'deployment',
21
+ ]);
22
+
23
+ // ─── Audit Finding ───────────────────────────────────────
24
+
25
+ export const AuditFindingSchema = z.object({
26
+ id: z.string(),
27
+ severity: AuditSeveritySchema,
28
+ category: AuditCategorySchema,
29
+ description: z.string(),
30
+ evidence: z.array(ArtifactRefSchema),
31
+ file_path: z.string().optional(),
32
+ line_number: z.number().int().optional(),
33
+ suggested_owner: PipelineRoleSchema,
34
+ blocking: z.boolean(),
35
+ });
36
+ export type AuditFinding = z.infer<typeof AuditFindingSchema>;
37
+
38
+ // ─── Audit Report ────────────────────────────────────────
39
+
40
+ export const AuditReportSchema = z.object({
41
+ audit_id: z.string(),
42
+ timestamp: z.string(),
43
+ repo_snapshot: ArtifactRefSchema,
44
+ overall_status: z.enum(['PASS', 'FAIL']),
45
+ findings: z.array(AuditFindingSchema),
46
+ system_risk_score: z.number().min(0).max(100),
47
+ recovery_required: z.boolean(),
48
+ });
49
+ export type AuditReport = z.infer<typeof AuditReportSchema>;
50
+
51
+ // ─── Production Readiness ────────────────────────────────
52
+
53
+ export const ProductionReadinessSchema = z.object({
54
+ production_id: z.string(),
55
+ timestamp: z.string(),
56
+ build_status: z.enum(['pass', 'fail', 'skip']),
57
+ test_status: z.enum(['pass', 'fail', 'skip']),
58
+ lint_status: z.enum(['pass', 'fail', 'skip']),
59
+ typecheck_status: z.enum(['pass', 'fail', 'skip']),
60
+ migration_status: z.enum(['pass', 'fail', 'skip', 'n/a']),
61
+ audit_status: z.enum(['PASS', 'FAIL']),
62
+ placeholder_scan_status: z.enum(['pass', 'fail', 'skip']),
63
+ security_status: z.enum(['pass', 'fail', 'skip']),
64
+ unresolved_blockers: z.array(z.string()),
65
+ final_verdict: z.enum(['PASS', 'FAIL']),
66
+ });
67
+ export type ProductionReadiness = z.infer<typeof ProductionReadinessSchema>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Gate check types — check definitions and results.
3
+ */
4
+
5
+ import { z } from 'zod';
6
+ import { ArtifactRefSchema } from './artifacts.js';
7
+
8
+ // ─── Gate Check Types ────────────────────────────────────
9
+
10
+ export const GateCheckTypeSchema = z.enum([
11
+ 'build',
12
+ 'test',
13
+ 'lint',
14
+ 'typecheck',
15
+ 'migration',
16
+ 'placeholder_scan',
17
+ 'start',
18
+ 'env_check',
19
+ ]);
20
+ export type GateCheckType = z.infer<typeof GateCheckTypeSchema>;
21
+
22
+ // ─── Gate Check Result ───────────────────────────────────
23
+
24
+ export const GateCheckResultSchema = z.object({
25
+ check_type: GateCheckTypeSchema,
26
+ status: z.enum(['pass', 'fail', 'skip']),
27
+ command: z.string(),
28
+ exit_code: z.number().int(),
29
+ stdout_artifact: ArtifactRefSchema.optional(),
30
+ stderr_summary: z.string().optional(),
31
+ duration_ms: z.number(),
32
+ timestamp: z.string(),
33
+ });
34
+ export type GateCheckResult = z.infer<typeof GateCheckResultSchema>;
35
+
36
+ // ─── Resolved Commands ───────────────────────────────────
37
+
38
+ export const ResolvedCommandsSchema = z.object({
39
+ build: z.string().optional(),
40
+ test: z.string().optional(),
41
+ lint: z.string().optional(),
42
+ typecheck: z.string().optional(),
43
+ migrations: z.string().optional(),
44
+ start: z.string().optional(),
45
+ resolved_from: z.string(),
46
+ });
47
+ export type ResolvedCommands = z.infer<typeof ResolvedCommandsSchema>;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Pipeline core enums — phase and role definitions.
3
+ */
4
+
5
+ import { z } from 'zod';
6
+
7
+ // ─── Pipeline Phases ─────────────────────────────────────
8
+
9
+ export const PipelinePhaseSchema = z.enum([
10
+ 'INTAKE',
11
+ 'CONSENSUS_MASTER_PLAN',
12
+ 'ARCHITECTURE',
13
+ 'CONSENSUS_ARCHITECTURE',
14
+ 'ROLE_PLANNING',
15
+ 'CONSENSUS_ROLE_PLANS',
16
+ 'IMPLEMENTATION',
17
+ 'QA_VALIDATION',
18
+ 'REVIEW',
19
+ 'AUDIT',
20
+ 'PRODUCTION_GATE',
21
+ 'RECOVERY_LOOP',
22
+ 'DONE',
23
+ 'STUCK',
24
+ ]);
25
+ export type PipelinePhase = z.infer<typeof PipelinePhaseSchema>;
26
+
27
+ /** Ordered list of phases for sequential progression */
28
+ export const PIPELINE_PHASE_ORDER: readonly PipelinePhase[] = [
29
+ 'INTAKE',
30
+ 'CONSENSUS_MASTER_PLAN',
31
+ 'ARCHITECTURE',
32
+ 'CONSENSUS_ARCHITECTURE',
33
+ 'ROLE_PLANNING',
34
+ 'CONSENSUS_ROLE_PLANS',
35
+ 'IMPLEMENTATION',
36
+ 'QA_VALIDATION',
37
+ 'REVIEW',
38
+ 'AUDIT',
39
+ 'PRODUCTION_GATE',
40
+ ] as const;
41
+
42
+ // ─── Pipeline Roles ──────────────────────────────────────
43
+
44
+ export const PipelineRoleSchema = z.enum([
45
+ 'DISPATCHER',
46
+ 'ARCHITECT',
47
+ 'DB_EXPERT',
48
+ 'BACKEND_PROGRAMMER',
49
+ 'FRONTEND_PROGRAMMER',
50
+ 'WEBSITE_PROGRAMMER',
51
+ 'QA_TESTER',
52
+ 'REVIEWER',
53
+ 'ARBITRATOR',
54
+ 'DEBUGGER',
55
+ 'AUDITOR',
56
+ 'JOURNALIST',
57
+ 'RELEASE_MANAGER',
58
+ 'MARKETING_EXPERT',
59
+ 'SOCIAL_EXPERT',
60
+ 'UI_UX_SPECIALIST',
61
+ ]);
62
+ export type PipelineRole = z.infer<typeof PipelineRoleSchema>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Pipeline types — barrel re-export.
3
+ * All existing `from '../pipeline/types.js'` imports continue to work.
4
+ */
5
+
6
+ export * from './enums.js';
7
+ export * from './artifacts.js';
8
+ export * from './packets.js';
9
+ export * from './audit.js';
10
+ export * from './snapshot.js';
11
+ export * from './checks.js';
12
+ export * from './state.js';
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Structured packet types — plans, consensus, RCA, constraints, change requests.
3
+ */
4
+
5
+ import { z } from 'zod';
6
+ import { PipelinePhaseSchema, PipelineRoleSchema } from './enums.js';
7
+ import { ArtifactRefSchema, DependencyEdgeSchema } from './artifacts.js';
8
+
9
+ // ─── Constraint ──────────────────────────────────────────
10
+
11
+ export const ConstraintSchema = z.object({
12
+ type: z.enum(['technical', 'business', 'timeline', 'compliance']),
13
+ description: z.string(),
14
+ source: ArtifactRefSchema,
15
+ });
16
+ export type Constraint = z.infer<typeof ConstraintSchema>;
17
+
18
+ // ─── Plan Packet ─────────────────────────────────────────
19
+
20
+ export const PlanPacketMetadataSchema = z.object({
21
+ packet_id: z.string(),
22
+ timestamp: z.string(),
23
+ phase: PipelinePhaseSchema,
24
+ submitted_by: PipelineRoleSchema,
25
+ version: z.number().int().positive(),
26
+ });
27
+
28
+ export const PlanPacketSchema = z.object({
29
+ metadata: PlanPacketMetadataSchema,
30
+ references: z.object({
31
+ master_plan: ArtifactRefSchema,
32
+ constitution: ArtifactRefSchema,
33
+ repo_snapshot: ArtifactRefSchema,
34
+ }),
35
+ proposed_artifacts: z.array(ArtifactRefSchema),
36
+ acceptance_criteria: z.array(z.string()),
37
+ artifact_dependencies: z.array(DependencyEdgeSchema),
38
+ constraints: z.array(ConstraintSchema),
39
+ open_questions: z.array(z.string()).optional(),
40
+ });
41
+ export type PlanPacket = z.infer<typeof PlanPacketSchema>;
42
+
43
+ // ─── Reviewer Vote ───────────────────────────────────────
44
+
45
+ export const ReviewerVoteSchema = z.object({
46
+ reviewer_id: z.string(),
47
+ provider: z.string(),
48
+ model: z.string(),
49
+ temperature: z.number(),
50
+ prompt_hash: z.string(),
51
+ vote: z.enum(['APPROVE', 'REJECT', 'CONDITIONAL']),
52
+ confidence: z.number().min(0).max(1),
53
+ blocking_issues: z.array(z.string()),
54
+ suggestions: z.array(z.string()),
55
+ evidence_refs: z.array(ArtifactRefSchema),
56
+ });
57
+ export type ReviewerVote = z.infer<typeof ReviewerVoteSchema>;
58
+
59
+ // ─── Consensus Packet ────────────────────────────────────
60
+
61
+ export const ConsensusRulesSchema = z.object({
62
+ threshold: z.number().min(0).max(1),
63
+ quorum: z.number().int().positive(),
64
+ min_reviewers: z.number().int().positive(),
65
+ });
66
+
67
+ export const ConsensusResultSchema = z.object({
68
+ approved: z.boolean(),
69
+ score: z.number().min(0).max(1),
70
+ weighted_score: z.number().min(0).max(1),
71
+ participating_reviewers: z.number().int(),
72
+ });
73
+
74
+ export const ArbitratorResultSchema = z.object({
75
+ decision: z.string(),
76
+ merged_patch: z.string().optional(),
77
+ artifact_ref: ArtifactRefSchema.optional(),
78
+ });
79
+
80
+ export const ConsensusPacketSchema = z.object({
81
+ metadata: z.object({
82
+ packet_id: z.string(),
83
+ timestamp: z.string(),
84
+ plan_packet_id: z.string(),
85
+ }),
86
+ plan_packet_reference: ArtifactRefSchema,
87
+ reviewer_votes: z.array(ReviewerVoteSchema),
88
+ consensus_rules: ConsensusRulesSchema,
89
+ consensus_result: ConsensusResultSchema,
90
+ arbitrator_result: ArbitratorResultSchema.optional(),
91
+ final_status: z.enum(['APPROVED', 'REJECTED', 'ARBITRATED']),
92
+ });
93
+ export type ConsensusPacket = z.infer<typeof ConsensusPacketSchema>;
94
+
95
+ // ─── RCA Packet ──────────────────────────────────────────
96
+
97
+ export const RCAPacketSchema = z.object({
98
+ rca_id: z.string(),
99
+ timestamp: z.string(),
100
+ incident_summary: z.string(),
101
+ symptoms: z.array(z.string()),
102
+ root_cause: z.string(),
103
+ responsible_layer: z.string(),
104
+ origin_phase: PipelinePhaseSchema,
105
+ governance_gap: z.string(),
106
+ corrective_actions: z.array(z.string()),
107
+ prevention: z.string(),
108
+ requires_phase_rewind_to: PipelinePhaseSchema.optional(),
109
+ requires_consensus_on: z.array(PipelinePhaseSchema).optional(),
110
+ });
111
+ export type RCAPacket = z.infer<typeof RCAPacketSchema>;
112
+
113
+ // ─── Change Request ──────────────────────────────────────
114
+
115
+ export const ChangeRequestSchema = z.object({
116
+ cr_id: z.string(),
117
+ timestamp: z.string(),
118
+ origin_phase: PipelinePhaseSchema,
119
+ requested_by: PipelineRoleSchema,
120
+ change_type: z.enum(['scope', 'architecture', 'dependency', 'config', 'requirement']),
121
+ description: z.string(),
122
+ justification: z.string(),
123
+ impact_analysis: z.object({
124
+ affected_artifacts: z.array(ArtifactRefSchema),
125
+ affected_phases: z.array(PipelinePhaseSchema),
126
+ risk_level: z.enum(['low', 'medium', 'high']),
127
+ }),
128
+ status: z.enum(['proposed', 'approved', 'rejected']),
129
+ approval_artifact: ArtifactRefSchema.optional(),
130
+ });
131
+ export type ChangeRequest = z.infer<typeof ChangeRequestSchema>;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Repo snapshot types — project state capture for drift detection.
3
+ */
4
+
5
+ import { z } from 'zod';
6
+
7
+ // ─── Config File Entry ───────────────────────────────────
8
+
9
+ export const ConfigFileEntrySchema = z.object({
10
+ path: z.string(),
11
+ type: z.string(),
12
+ content_hash: z.string(),
13
+ key_fields: z.record(z.string(), z.unknown()),
14
+ });
15
+ export type ConfigFileEntry = z.infer<typeof ConfigFileEntrySchema>;
16
+
17
+ // ─── Port Entry ──────────────────────────────────────────
18
+
19
+ export const PortEntrySchema = z.object({
20
+ port: z.number().int(),
21
+ service: z.string(),
22
+ source: z.string(),
23
+ });
24
+ export type PortEntry = z.infer<typeof PortEntrySchema>;
25
+
26
+ // ─── Repo Snapshot ───────────────────────────────────────
27
+
28
+ export const RepoSnapshotSchema = z.object({
29
+ snapshot_id: z.string(),
30
+ timestamp: z.string(),
31
+ tree_summary: z.string(),
32
+ config_files: z.array(ConfigFileEntrySchema),
33
+ languages_detected: z.array(z.string()),
34
+ package_manager: z.string().optional(),
35
+ scripts: z.record(z.string(), z.string()),
36
+ test_framework: z.string().optional(),
37
+ build_tool: z.string().optional(),
38
+ env_files: z.array(z.string()),
39
+ migrations_present: z.boolean(),
40
+ ports_entrypoints: z.array(PortEntrySchema),
41
+ total_files: z.number().int(),
42
+ total_lines: z.number().int(),
43
+ });
44
+ export type RepoSnapshot = z.infer<typeof RepoSnapshotSchema>;
45
+
46
+ // ─── Snapshot Diff ───────────────────────────────────────
47
+
48
+ /** Diff between two snapshots for drift detection */
49
+ export interface SnapshotDiff {
50
+ files_added: string[];
51
+ files_removed: string[];
52
+ configs_changed: string[];
53
+ lines_delta: number;
54
+ has_drift: boolean;
55
+ }
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Pipeline state types — the core mutable state, gate definitions, gate results.
3
+ */
4
+
5
+ import { z } from 'zod';
6
+ import { PipelinePhaseSchema, type PipelinePhase, PipelineRoleSchema, type PipelineRole } from './enums.js';
7
+ import { ArtifactTypeSchema, ArtifactEntrySchema, ArtifactRefSchema, type ArtifactEntry } from './artifacts.js';
8
+ import { GateCheckTypeSchema, GateCheckResultSchema, ResolvedCommandsSchema, type GateCheckType } from './checks.js';
9
+ import type { ArtifactType } from './artifacts.js';
10
+ import type { ConsensusPacket } from './packets.js';
11
+ import type { RCAPacket } from './packets.js';
12
+
13
+ // ─── Gate Definition ─────────────────────────────────────
14
+
15
+ export const GateDefinitionSchema = z.object({
16
+ phase: PipelinePhaseSchema,
17
+ requiredArtifacts: z.array(ArtifactTypeSchema),
18
+ requiredChecks: z.array(GateCheckTypeSchema),
19
+ consensusThreshold: z.number().min(0).max(1).optional(),
20
+ minReviewers: z.number().int().positive().optional(),
21
+ allowedTransitions: z.array(PipelinePhaseSchema),
22
+ failTransition: PipelinePhaseSchema,
23
+ });
24
+ export type GateDefinition = z.infer<typeof GateDefinitionSchema>;
25
+
26
+ // ─── Gate Result ─────────────────────────────────────────
27
+
28
+ /** Result of evaluating a gate */
29
+ export interface GateResult {
30
+ phase: PipelinePhase;
31
+ pass: boolean;
32
+ score?: number;
33
+ blockers: string[];
34
+ missingArtifacts: ArtifactType[];
35
+ failedChecks: GateCheckType[];
36
+ consensusScore?: number;
37
+ timestamp: string;
38
+ }
39
+
40
+ // ─── Skill Definition ────────────────────────────────────
41
+
42
+ export interface SkillDefinition {
43
+ role: PipelineRole;
44
+ systemPrompt: string;
45
+ constraints: string[];
46
+ outputContract: string[];
47
+ requiredSections: string[];
48
+ }
49
+
50
+ // ─── Phase Result ────────────────────────────────────────
51
+
52
+ export interface PhaseResult {
53
+ success: boolean;
54
+ phase: PipelinePhase;
55
+ artifacts: ArtifactEntry[];
56
+ errors?: string[];
57
+ /** For consensus phases: the consensus packet produced */
58
+ consensusPacket?: ConsensusPacket;
59
+ /** For recovery: the RCA packet produced */
60
+ rcaPacket?: RCAPacket;
61
+ }
62
+
63
+ // ─── Phase Context ───────────────────────────────────────
64
+
65
+ /**
66
+ * Context passed to every phase handler.
67
+ * Defined as an interface so phase implementations can import it.
68
+ * The orchestrator constructs this before entering the phase loop.
69
+ */
70
+ export interface PhaseContext {
71
+ projectDir: string;
72
+ pipeline: PipelineState;
73
+ skillsDir?: string;
74
+ }
75
+
76
+ // ─── Pipeline State ──────────────────────────────────────
77
+
78
+ export const PipelineStateSchema = z.object({
79
+ pipelinePhase: PipelinePhaseSchema,
80
+ artifacts: z.array(ArtifactEntrySchema),
81
+ recoveryCount: z.number().int().min(0),
82
+ maxRecoveryIterations: z.number().int().positive(),
83
+ gateResults: z.record(z.string(), z.object({
84
+ phase: PipelinePhaseSchema,
85
+ pass: z.boolean(),
86
+ score: z.number().optional(),
87
+ blockers: z.array(z.string()),
88
+ missingArtifacts: z.array(ArtifactTypeSchema),
89
+ failedChecks: z.array(GateCheckTypeSchema),
90
+ consensusScore: z.number().optional(),
91
+ timestamp: z.string(),
92
+ })),
93
+ gateChecks: z.record(z.string(), z.array(GateCheckResultSchema)),
94
+ activeRoles: z.array(PipelineRoleSchema),
95
+ constitutionHash: z.string(),
96
+ latestRepoSnapshot: ArtifactRefSchema.optional(),
97
+ resolvedCommands: ResolvedCommandsSchema.optional(),
98
+ /** Tracks which phase failed, for recovery routing */
99
+ failedPhase: PipelinePhaseSchema.optional(),
100
+ /** Session guidance: user steering, upgrade context, or resume instructions */
101
+ sessionGuidance: z.string().optional(),
102
+ /** Pending change requests that force re-routing to consensus phases (v1.1) */
103
+ pendingChangeRequests: z.array(z.object({
104
+ cr_id: z.string(),
105
+ change_type: z.enum(['scope', 'architecture', 'dependency', 'config', 'requirement']),
106
+ target_phase: PipelinePhaseSchema,
107
+ status: z.enum(['proposed', 'approved', 'rejected']),
108
+ })).optional(),
109
+ });
110
+ export type PipelineState = z.infer<typeof PipelineStateSchema>;
111
+
112
+ // ─── Pipeline Result ─────────────────────────────────────
113
+
114
+ export interface PipelineResult {
115
+ finalPhase: PipelinePhase;
116
+ success: boolean;
117
+ artifacts: ArtifactEntry[];
118
+ recoveryIterations: number;
119
+ error?: string;
120
+ }
121
+
122
+ // ─── Consensus Modes ─────────────────────────────────────
123
+
124
+ export type ConsensusMode = 'independent' | 'iterative';
125
+
126
+ // ─── Helper: legacy phase mapping ────────────────────────
127
+
128
+ /**
129
+ * Maps pipeline phases to the legacy 3-phase WorkflowPhase.
130
+ * Used for backward compatibility with existing state/UI code.
131
+ */
132
+ export function toLegacyPhase(phase: PipelinePhase): 'plan' | 'execution' | 'complete' {
133
+ switch (phase) {
134
+ case 'INTAKE':
135
+ case 'CONSENSUS_MASTER_PLAN':
136
+ case 'ARCHITECTURE':
137
+ case 'CONSENSUS_ARCHITECTURE':
138
+ case 'ROLE_PLANNING':
139
+ case 'CONSENSUS_ROLE_PLANS':
140
+ return 'plan';
141
+ case 'IMPLEMENTATION':
142
+ case 'QA_VALIDATION':
143
+ case 'REVIEW':
144
+ case 'AUDIT':
145
+ case 'PRODUCTION_GATE':
146
+ case 'RECOVERY_LOOP':
147
+ case 'STUCK':
148
+ return 'execution';
149
+ case 'DONE':
150
+ return 'complete';
151
+ }
152
+ }
153
+
154
+ // ─── Default pipeline state factory ──────────────────────
155
+
156
+ export function createDefaultPipelineState(): PipelineState {
157
+ return {
158
+ pipelinePhase: 'INTAKE',
159
+ artifacts: [],
160
+ recoveryCount: 0,
161
+ maxRecoveryIterations: 5,
162
+ gateResults: {},
163
+ gateChecks: {},
164
+ activeRoles: [],
165
+ constitutionHash: '',
166
+ };
167
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Pipeline type definitions — barrel re-export from type-defs/ sub-modules.
3
+ *
4
+ * All types are defined in src/pipeline/type-defs/ for modularity:
5
+ * enums.ts — PipelinePhase, PipelineRole
6
+ * artifacts.ts — ArtifactType, ArtifactRef, ArtifactEntry, DependencyEdge
7
+ * packets.ts — PlanPacket, ConsensusPacket, ReviewerVote, RCAPacket, ChangeRequest
8
+ * audit.ts — AuditFinding, AuditReport, ProductionReadiness
9
+ * snapshot.ts — RepoSnapshot, ConfigFileEntry, PortEntry, SnapshotDiff
10
+ * checks.ts — GateCheckType, GateCheckResult, ResolvedCommands
11
+ * state.ts — PipelineState, GateResult, GateDefinition, SkillDefinition
12
+ *
13
+ * This file re-exports everything so existing imports work unchanged.
14
+ */
15
+
16
+ export * from './type-defs/index.js';
@@ -101,8 +101,8 @@ export interface ConsensusConfig {
101
101
  export const DEFAULT_CONSENSUS_CONFIG: Omit<ConsensusConfig, 'openaiKey' | 'geminiKey' | 'grokKey'> = {
102
102
  threshold: 95,
103
103
  maxIterations: 10,
104
- openaiModel: 'gpt-4o',
105
- geminiModel: 'gemini-2.0-flash',
104
+ openaiModel: 'gpt-4.1',
105
+ geminiModel: 'gemini-2.5-flash',
106
106
  grokModel: DEFAULT_GROK_MODEL,
107
107
  reviewer: 'openai',
108
108
  arbitrator: 'gemini',
@@ -122,7 +122,19 @@ export const AIProviderSchema = z.enum(['openai', 'gemini', 'grok']);
122
122
  /**
123
123
  * Known Gemini models (used for suggestions and display, not strict validation)
124
124
  */
125
- export const KNOWN_GEMINI_MODELS = ['gemini-2.0-flash', 'gemini-1.5-pro', 'gemini-1.5-flash'] as const;
125
+ export const KNOWN_GEMINI_MODELS = [
126
+ 'gemini-2.5-pro', 'gemini-2.5-flash', 'gemini-2.5-flash-lite',
127
+ 'gemini-2.0-flash', 'gemini-2.0-pro',
128
+ 'gemini-1.5-pro', 'gemini-1.5-flash',
129
+ ] as const;
130
+
131
+ /**
132
+ * Known Grok models (used for suggestions and display, not strict validation)
133
+ */
134
+ export const KNOWN_GROK_MODELS = [
135
+ 'grok-4-0709', 'grok-3', 'grok-3-mini',
136
+ 'grok-3-fast', 'grok-3-mini-fast', 'grok-2',
137
+ ] as const;
126
138
 
127
139
  /**
128
140
  * Zod schema for Gemini model - accepts any non-empty string to support new models
@@ -144,7 +156,7 @@ export const ConsensusConfigSchema = z.object({
144
156
  geminiKey: z.string().optional(),
145
157
  grokKey: z.string().optional(),
146
158
  openaiModel: OpenAIModelSchema,
147
- geminiModel: GeminiModelSchema.default('gemini-2.0-flash'),
159
+ geminiModel: GeminiModelSchema.default('gemini-2.5-flash'),
148
160
  grokModel: GrokModelSchema.default(DEFAULT_GROK_MODEL),
149
161
  reviewer: AIProviderSchema.default('openai'),
150
162
  arbitrator: AIProviderSchema.default('gemini'),