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
@@ -1,6 +1,6 @@
1
1
  # Popeye Full Autonomy Pipeline Spec
2
- Version: 1.0
3
- Goal: 1 idea 1 prompt Popeye production-ready system (PASS Production Gate)
2
+ Version: 1.1 (Autonomy Hardening Gap Fixes)
3
+ Goal: 1 idea -> 1 prompt -> Popeye -> production-ready system (PASS Production Gate)
4
4
 
5
5
  This spec defines the end-to-end autonomous workflow Popeye must execute, including:
6
6
  - Phase sequencing (no skipping)
@@ -90,6 +90,27 @@ Artifacts are never overwritten. New versions create new files.
90
90
  - Each phase may only transition to the next if all required artifacts exist and the gate passes.
91
91
  - Any failure routes to RECOVERY_LOOP, except missing inputs which route back to the phase that needs them.
92
92
 
93
+ ### v1.1 Gate Behaviors (Autonomy Hardening)
94
+
95
+ Between phase execution and transition, the orchestrator now applies three additional checks:
96
+
97
+ 1. **Constitution Verification**: Before every `evaluateGate()` call, verifies that `skills/POPEYE_CONSTITUTION.md` has not been modified since pipeline start (SHA-256 hash comparison). If the constitution is invalid, the gate is blocked.
98
+
99
+ 2. **Gate Result Merge**: After gate evaluation, preserves `score`/`consensusScore` values stored by consensus phase handlers while updating `pass`/`blockers` from the gate engine. Prevents overwriting of consensus scores.
100
+
101
+ 3. **Change Request (CR) Routing**: After REVIEW and AUDIT phases pass their gates, checks `pipeline.pendingChangeRequests` for any `proposed` CRs. If found, deterministically routes to the appropriate consensus phase (based on change type) rather than continuing normal progression. CR lifecycle: `proposed` -> `approved` (when routed) or `rejected`.
102
+
103
+ ### v1.1 Pipeline State Additions
104
+
105
+ ```
106
+ pendingChangeRequests?: Array<{
107
+ cr_id: string;
108
+ change_type: 'scope' | 'architecture' | 'dependency' | 'config' | 'requirement';
109
+ target_phase: PipelinePhase;
110
+ status: 'proposed' | 'approved' | 'rejected';
111
+ }>;
112
+ ```
113
+
93
114
  ---
94
115
 
95
116
  ## 3) Phase-by-Phase Specification
@@ -321,15 +342,24 @@ Artifacts are never overwritten. New versions create new files.
321
342
  - evidence references
322
343
  - no shortcuts
323
344
  - integration wiring
345
+ - Generate fresh repo snapshot and diff against baseline (role-plan-approval snapshot)
346
+ - Detect implementation drift (config changes, significant line deltas)
324
347
 
325
348
  **Outputs**
326
- - Review decision doc `/docs/consensus/review_<id>_<date>.md`
349
+ - Review decision doc -> `/docs/consensus/review_<id>_<date>.md`
327
350
  - If rejected: structured blocking list
351
+ - v1.1: Change Request artifacts for detected drift (stored as `change_request` artifacts)
352
+ - v1.1: Pending CRs registered in `pipeline.pendingChangeRequests` for orchestrator routing
328
353
 
329
354
  **Gate conditions (PASS)**
330
355
  - Reviewer approves with evidence
331
356
  - No Constitution violations
332
357
 
358
+ **v1.1 Post-Gate Behavior**
359
+ - After REVIEW gate passes, orchestrator checks `pendingChangeRequests` for proposed CRs
360
+ - If CRs exist, routes to the appropriate consensus phase (e.g., CONSENSUS_MASTER_PLAN for scope drift)
361
+ - If no CRs, continues to AUDIT normally
362
+
333
363
  ---
334
364
 
335
365
  ### Phase 10 — AUDIT
@@ -339,7 +369,7 @@ Artifacts are never overwritten. New versions create new files.
339
369
  - Everything above + repo snapshot + logs
340
370
 
341
371
  **Actions (Auditor)**
342
- - Integration audit (FEBE, BEDB)
372
+ - Integration audit (FE<->BE, BE<->DB)
343
373
  - Config/env audit
344
374
  - Tests/coverage audit
345
375
  - Migration audit
@@ -347,8 +377,10 @@ Artifacts are never overwritten. New versions create new files.
347
377
  - Deployment readiness audit
348
378
 
349
379
  **Outputs (required)**
350
- - Audit Report `/docs/audit/audit_<id>_<date>.md`
351
- - Audit Report schema (optional json)
380
+ - Audit Report -> `/docs/audit/audit_<id>_<date>.md`
381
+ - Audit Report schema (JSON)
382
+ - v1.1: Change Request artifacts for blocking architectural/security findings
383
+ - v1.1: Pending CRs registered in `pipeline.pendingChangeRequests` for orchestrator routing
352
384
 
353
385
  **Gate conditions (PASS)**
354
386
  - No P0/P1 findings open
@@ -356,6 +388,13 @@ Artifacts are never overwritten. New versions create new files.
356
388
  - No hardcoded secrets
357
389
  - End-to-end wiring verified
358
390
 
391
+ **v1.1 Post-Gate Behavior**
392
+ - After AUDIT gate passes, orchestrator checks `pendingChangeRequests` for proposed CRs
393
+ - Architectural findings (integration/schema blocking issues) create CRs targeting CONSENSUS_ARCHITECTURE
394
+ - Security findings create CRs targeting CONSENSUS_MASTER_PLAN
395
+ - If CRs exist, routes to the appropriate consensus phase before PRODUCTION_GATE
396
+ - If no CRs, continues to PRODUCTION_GATE normally
397
+
359
398
  **If FAIL**
360
399
  - Enter RECOVERY_LOOP
361
400
 
@@ -389,7 +428,7 @@ Artifacts are never overwritten. New versions create new files.
389
428
 
390
429
  ---
391
430
 
392
- ## 4) Recovery Loop (FAIL Debugger Plan Fix Retest)
431
+ ## 4) Recovery Loop (FAIL -> Debugger -> Plan -> Fix -> Retest)
393
432
 
394
433
  ### Phase 12 — RECOVERY_LOOP (conditional)
395
434
  **Purpose**: Self-heal deterministically using RCA, not guesswork.
@@ -406,6 +445,7 @@ Artifacts are never overwritten. New versions create new files.
406
445
  - ownership (which role must fix)
407
446
  - recommended corrective actions
408
447
  - prevention suggestion
448
+ - v1.1: `requires_phase_rewind_to` field specifying which phase to rewind to
409
449
 
410
450
  2) **Dispatcher generates Recovery Plan**
411
451
  - targeted tasks mapped to responsible role(s)
@@ -416,19 +456,23 @@ Artifacts are never overwritten. New versions create new files.
416
456
 
417
457
  4) **Implement fixes** (by responsible role)
418
458
 
419
- 5) **Retest only the failed gate first**, then proceed forward:
420
- - If failed at Audit rerun Audit
421
- - If failed at Production Gate rerun Production checks
422
- - If failed tests rerun tests + QA validation
459
+ 5) **Post-recovery routing** (v1.1 RCA-driven rewind):
460
+ - Orchestrator reads latest RCA JSON artifact from disk
461
+ - If RCA specifies `requires_phase_rewind_to`, pipeline rewinds to that phase
462
+ - Otherwise, retests the originally failed phase, then proceeds forward:
463
+ - If failed at Audit -> rerun Audit
464
+ - If failed at Production Gate -> rerun Production checks
465
+ - If failed tests -> rerun tests + QA validation
466
+ - If no failed phase is tracked, defaults to QA_VALIDATION
423
467
 
424
468
  **Outputs (required)**
425
- - RCA report `/docs/incidents/rca_<id>_<date>.md`
469
+ - RCA report -> `/docs/incidents/rca_<id>_<date>.md` (both markdown and JSON, JSON includes `requires_phase_rewind_to`)
426
470
  - Recovery plan packet + consensus packet
427
471
  - Updated artifacts if scope/contracts changed
428
472
 
429
473
  **Stop conditions**
430
474
  - Max recovery iterations (default: 5)
431
- - If exceeded STUCK state with “Stuck Report”
475
+ - If exceeded -> STUCK state with “Stuck Report”
432
476
 
433
477
  ---
434
478
 
@@ -479,6 +523,15 @@ If recovery iterations exceed max, Popeye must stop and output:
479
523
  - Every plan claim must be evidenced against repo snapshot
480
524
  - Production readiness is binary, not “looks good”
481
525
 
526
+ ### v1.1 Additions
527
+
528
+ - Constitution integrity is verified at every gate (SHA-256 hash comparison). A modified constitution blocks all gate progression until resolved.
529
+ - Consensus scores from phase handlers are never overwritten by gate engine evaluation (gate result merge rule).
530
+ - REVIEW and AUDIT phases must register detected issues as Change Requests in `pipeline.pendingChangeRequests`.
531
+ - CRs are routed deterministically by the orchestrator (not advisory). The routing is a deterministic transition, not a suggestion.
532
+ - RCA packets must include a `requires_phase_rewind_to` field when the root cause originates in a phase earlier than the one that failed. The orchestrator reads this from the JSON artifact on disk.
533
+ - CRs are processed one at a time (first `proposed` CR is routed and marked `approved` before the next is considered).
534
+
482
535
  ---
483
536
 
484
537
  End of Spec.
@@ -16,7 +16,7 @@ export type GeminiModel = string;
16
16
  * Default Gemini configuration
17
17
  */
18
18
  export const DEFAULT_GEMINI_CONFIG = {
19
- model: 'gemini-2.0-flash' as GeminiModel,
19
+ model: 'gemini-2.5-flash' as GeminiModel,
20
20
  temperature: 0.3,
21
21
  maxTokens: 4096,
22
22
  };
@@ -94,7 +94,7 @@ export async function requestArbitration(
94
94
  scores: number[]
95
95
  ): Promise<ArbitrationResult> {
96
96
  const client = await createClient();
97
- const generativeModel = client.getGenerativeModel({ model: 'gemini-2.0-flash' });
97
+ const generativeModel = client.getGenerativeModel({ model: 'gemini-2.5-flash' });
98
98
 
99
99
  const prompt = buildArbitrationPrompt(plan, reviewerFeedback, claudeFeedback, iterations, scores);
100
100
 
@@ -370,7 +370,7 @@ function parseList(text: string): string[] {
370
370
  export async function validateApiKey(): Promise<boolean> {
371
371
  try {
372
372
  const client = await createClient();
373
- const model = client.getGenerativeModel({ model: 'gemini-2.0-flash' });
373
+ const model = client.getGenerativeModel({ model: 'gemini-2.5-flash' });
374
374
  await model.generateContent('Say "OK" if you can hear me.');
375
375
  return true;
376
376
  } catch {
@@ -322,7 +322,7 @@ Be specific and actionable. The specification should be detailed enough that a d
322
322
  }
323
323
 
324
324
  const completion = await client.chat.completions.create({
325
- model: 'gpt-4o',
325
+ model: 'gpt-4.1',
326
326
  messages: [{ role: 'user', content: prompt }],
327
327
  temperature: 0.7,
328
328
  max_tokens: 4096,
@@ -360,7 +360,7 @@ Provide:
360
360
  Format your score as: CONSENSUS: [X]%`;
361
361
 
362
362
  const completion = await client.chat.completions.create({
363
- model: 'gpt-4o',
363
+ model: 'gpt-4.1',
364
364
  messages: [{ role: 'user', content: prompt }],
365
365
  temperature: 0.3,
366
366
  max_tokens: 2048,
@@ -30,7 +30,7 @@ export interface GeminiAuthStatus {
30
30
  export async function validateGeminiToken(apiKey: string): Promise<boolean> {
31
31
  try {
32
32
  const client = new GoogleGenerativeAI(apiKey);
33
- const model = client.getGenerativeModel({ model: 'gemini-2.0-flash' });
33
+ const model = client.getGenerativeModel({ model: 'gemini-2.5-flash' });
34
34
  // Test the key by making a simple request
35
35
  await model.generateContent('Say "OK"');
36
36
  return true;
@@ -10,6 +10,7 @@ import { ProjectSpecSchema, type OutputLanguage, type OpenAIModel } from '../../
10
10
  import { requireAuth } from '../../auth/index.js';
11
11
  import { runWorkflow } from '../../workflow/index.js';
12
12
  import { generateProject, projectDirExists, cleanupProject } from '../../generators/index.js';
13
+ import { readPopeyeMdConfig } from '../../config/popeye-md.js';
13
14
  import {
14
15
  printHeader,
15
16
  printSection,
@@ -41,8 +42,8 @@ export function createCreateCommand(): Command {
41
42
  )
42
43
  .option(
43
44
  '-m, --model <model>',
44
- 'OpenAI model for consensus (gpt-4o, gpt-4o-mini, o1-preview)',
45
- 'gpt-4o'
45
+ 'OpenAI model for consensus (gpt-4.1, gpt-4o, o3, o4-mini)',
46
+ 'gpt-4.1'
46
47
  )
47
48
  .option(
48
49
  '-o, --output <dir>',
@@ -93,9 +94,8 @@ export function createCreateCommand(): Command {
93
94
  }
94
95
 
95
96
  const model = options.model as OpenAIModel;
96
- const validModels = ['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'o1-preview', 'o1-mini'];
97
- if (!validModels.includes(model)) {
98
- printError(`Invalid model: ${model}. Use one of: ${validModels.join(', ')}`);
97
+ if (!model || model.trim().length === 0) {
98
+ printError('Model name must not be empty.');
99
99
  process.exit(1);
100
100
  }
101
101
 
@@ -173,15 +173,21 @@ export function createCreateCommand(): Command {
173
173
  succeedSpinner(`Created ${scaffoldResult.filesCreated.length} files`);
174
174
  }
175
175
 
176
- // Run the workflow
176
+ // Run the workflow — merge CLI flags with popeye.md config
177
177
  printSection('Workflow Execution');
178
178
 
179
+ const popeyeConfig = await readPopeyeMdConfig(projectDir);
179
180
  const workflowResult = await runWorkflow(spec, {
180
181
  projectDir,
181
182
  consensusConfig: {
182
183
  threshold,
183
184
  maxIterations,
184
185
  openaiModel: model,
186
+ reviewer: popeyeConfig?.reviewer ?? 'openai',
187
+ arbitrator: popeyeConfig?.arbitrator,
188
+ enableArbitration: popeyeConfig?.enableArbitration ?? false,
189
+ geminiModel: popeyeConfig?.geminiModel,
190
+ grokModel: popeyeConfig?.grokModel,
185
191
  },
186
192
  onProgress: (phase, message) => {
187
193
  handleProgressUpdate(phase, message);
@@ -12,6 +12,7 @@ import {
12
12
  resetWorkflow,
13
13
  cancelWorkflow,
14
14
  } from '../../workflow/index.js';
15
+ import { readPopeyeMdConfig } from '../../config/popeye-md.js';
15
16
  import type { WorkflowPhase } from '../../types/workflow.js';
16
17
  import {
17
18
  printHeader,
@@ -94,13 +95,20 @@ export function createResumeCommand(): Command {
94
95
  process.exit(1);
95
96
  }
96
97
 
97
- // Resume workflow
98
+ // Resume workflow — merge CLI flags with popeye.md config
98
99
  printSection('Resuming Workflow');
99
100
 
101
+ const popeyeConfig = await readPopeyeMdConfig(projectDir);
100
102
  const result = await resumeWorkflow(projectDir, {
101
103
  consensusConfig: {
102
104
  threshold,
103
105
  maxIterations,
106
+ reviewer: popeyeConfig?.reviewer ?? 'openai',
107
+ arbitrator: popeyeConfig?.arbitrator,
108
+ enableArbitration: popeyeConfig?.enableArbitration ?? false,
109
+ openaiModel: popeyeConfig?.openaiModel,
110
+ geminiModel: popeyeConfig?.geminiModel,
111
+ grokModel: popeyeConfig?.grokModel,
104
112
  },
105
113
  maxRetries,
106
114
  onProgress: (phase, message) => {
@@ -46,7 +46,7 @@ import { upgradeProject } from '../upgrade/index.js';
46
46
  import { buildUpgradeContext } from '../upgrade/context.js';
47
47
  import { OutputLanguageSchema, KNOWN_OPENAI_MODELS } from '../types/project.js';
48
48
  import type { ProjectSpec, OutputLanguage, OpenAIModel } from '../types/project.js';
49
- import { GeminiModelSchema, KNOWN_GEMINI_MODELS } from '../types/consensus.js';
49
+ import { GeminiModelSchema, KNOWN_GEMINI_MODELS, KNOWN_GROK_MODELS } from '../types/consensus.js';
50
50
  import { OpenAIModelSchema } from '../types/project.js';
51
51
  import type { AIProvider, GeminiModel, GrokModel } from '../types/consensus.js';
52
52
  import {
@@ -1205,6 +1205,35 @@ async function handleReviewSlashCommand(state: SessionState, args: string[] = []
1205
1205
  }
1206
1206
 
1207
1207
  try {
1208
+ // Check if project is pipeline-managed — route through bridge
1209
+ const { loadProject } = await import('../state/index.js');
1210
+ const projectState = await loadProject(state.projectDir);
1211
+ const { isPipelineManaged, runReviewBridge } = await import('../pipeline/bridges/review-bridge.js');
1212
+
1213
+ if (isPipelineManaged(projectState)) {
1214
+ printInfo('Pipeline-managed project detected — routing through pipeline bridge');
1215
+ console.log();
1216
+
1217
+ const bridgeResult = await runReviewBridge({
1218
+ projectDir: state.projectDir,
1219
+ depth: options.depth,
1220
+ strict: options.strict,
1221
+ onProgress: (_stage, msg) => printInfo(msg),
1222
+ });
1223
+
1224
+ if (bridgeResult.success) {
1225
+ printSuccess(`Audit score: ${bridgeResult.overallScore}% — ${bridgeResult.recommendation}`);
1226
+ printInfo(`${bridgeResult.findingsCount} finding(s), ${bridgeResult.changeRequestCount} CR(s) created, ${bridgeResult.artifactsCreated} artifact(s) stored`);
1227
+ if (bridgeResult.changeRequestCount > 0) {
1228
+ printInfo('Change Requests filed — run /resume to let the pipeline process them');
1229
+ }
1230
+ } else {
1231
+ printError(bridgeResult.error ?? 'Review bridge failed');
1232
+ }
1233
+ return;
1234
+ }
1235
+
1236
+ // Non-pipeline project — use legacy audit-mode
1208
1237
  const { runReview } = await import('./commands/review.js');
1209
1238
 
1210
1239
  console.log();
@@ -1484,7 +1513,7 @@ function handleLanguage(args: string[], state: SessionState): void {
1484
1513
  const KNOWN_MODELS: Record<string, readonly string[]> = {
1485
1514
  openai: KNOWN_OPENAI_MODELS,
1486
1515
  gemini: KNOWN_GEMINI_MODELS,
1487
- grok: ['grok-3', 'grok-3-mini', 'grok-2'],
1516
+ grok: KNOWN_GROK_MODELS,
1488
1517
  };
1489
1518
 
1490
1519
  /**
@@ -2976,7 +3005,7 @@ export async function startInteractiveMode(): Promise<void> {
2976
3005
  projectDir: process.cwd(),
2977
3006
  language: config.project.default_language,
2978
3007
  openaiModel: config.apis.openai.model,
2979
- geminiModel: 'gemini-2.0-flash',
3008
+ geminiModel: 'gemini-2.5-flash',
2980
3009
  grokModel: config.apis.grok.model,
2981
3010
  claudeAuth: false,
2982
3011
  openaiAuth: false,
@@ -19,10 +19,15 @@ export const DEFAULT_CONFIG: Config = {
19
19
  },
20
20
  apis: {
21
21
  openai: {
22
- model: 'gpt-4o',
22
+ model: 'gpt-4.1',
23
23
  temperature: 0.3,
24
24
  max_tokens: 4096,
25
- available_models: ['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'o1-preview', 'o1-mini'],
25
+ available_models: [
26
+ 'gpt-4.1', 'gpt-4.1-mini', 'gpt-4.1-nano',
27
+ 'o3', 'o3-mini', 'o4-mini',
28
+ 'gpt-4o', 'gpt-4o-mini',
29
+ 'gpt-4-turbo', 'o1-preview', 'o1-mini',
30
+ ],
26
31
  },
27
32
  claude: {
28
33
  model: 'claude-sonnet-4-20250514',
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Shared popeye.md configuration reader.
3
+ * Reads project-local config from the YAML frontmatter in popeye.md.
4
+ * Used by both interactive mode and CLI commands.
5
+ */
6
+
7
+ import { promises as fs } from 'node:fs';
8
+ import path from 'node:path';
9
+ import { OutputLanguageSchema, type OutputLanguage } from '../types/project.js';
10
+ import type { AIProvider, GeminiModel, GrokModel } from '../types/consensus.js';
11
+ import type { OpenAIModel } from '../types/project.js';
12
+
13
+ // ─── Types ───────────────────────────────────────────────
14
+
15
+ /** Project-local configuration stored in popeye.md */
16
+ export interface PopeyeMdConfig {
17
+ language: OutputLanguage;
18
+ reviewer: AIProvider;
19
+ arbitrator: AIProvider;
20
+ enableArbitration: boolean;
21
+ created: string;
22
+ lastRun: string;
23
+ projectName?: string;
24
+ description?: string;
25
+ notes?: string;
26
+ openaiModel?: OpenAIModel;
27
+ geminiModel?: GeminiModel;
28
+ grokModel?: GrokModel;
29
+ }
30
+
31
+ // ─── Reader ──────────────────────────────────────────────
32
+
33
+ /**
34
+ * Read popeye.md from a project directory.
35
+ * Parses YAML frontmatter for project configuration.
36
+ *
37
+ * @param projectDir - Absolute path to the project root
38
+ * @returns Parsed config or null if file doesn't exist or is invalid
39
+ */
40
+ export async function readPopeyeMdConfig(projectDir: string): Promise<PopeyeMdConfig | null> {
41
+ const configPath = path.join(projectDir, 'popeye.md');
42
+
43
+ try {
44
+ const content = await fs.readFile(configPath, 'utf-8');
45
+
46
+ // Parse YAML frontmatter
47
+ const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
48
+ if (!frontmatterMatch) {
49
+ return null;
50
+ }
51
+
52
+ const frontmatter = frontmatterMatch[1];
53
+ const config: Partial<PopeyeMdConfig> = {};
54
+
55
+ // Parse each line of YAML
56
+ for (const line of frontmatter.split('\n')) {
57
+ const match = line.match(/^(\w+):\s*(.+)$/);
58
+ if (match) {
59
+ const [, key, value] = match;
60
+ const cleanValue = value.trim();
61
+
62
+ switch (key) {
63
+ case 'language':
64
+ if (OutputLanguageSchema.safeParse(cleanValue).success) {
65
+ config.language = cleanValue as OutputLanguage;
66
+ }
67
+ break;
68
+ case 'reviewer':
69
+ if (['openai', 'gemini', 'grok'].includes(cleanValue)) {
70
+ config.reviewer = cleanValue as AIProvider;
71
+ }
72
+ break;
73
+ case 'arbitrator':
74
+ if (['openai', 'gemini', 'grok', 'off'].includes(cleanValue)) {
75
+ if (cleanValue === 'off') {
76
+ config.enableArbitration = false;
77
+ } else {
78
+ config.arbitrator = cleanValue as AIProvider;
79
+ config.enableArbitration = true;
80
+ }
81
+ }
82
+ break;
83
+ case 'created':
84
+ config.created = cleanValue;
85
+ break;
86
+ case 'lastRun':
87
+ config.lastRun = cleanValue;
88
+ break;
89
+ case 'projectName':
90
+ config.projectName = cleanValue;
91
+ break;
92
+ case 'openaiModel':
93
+ if (cleanValue.length > 0) {
94
+ config.openaiModel = cleanValue;
95
+ }
96
+ break;
97
+ case 'geminiModel':
98
+ if (cleanValue.length > 0) {
99
+ config.geminiModel = cleanValue;
100
+ }
101
+ break;
102
+ case 'grokModel':
103
+ if (cleanValue.length > 0) {
104
+ config.grokModel = cleanValue;
105
+ }
106
+ break;
107
+ }
108
+ }
109
+ }
110
+
111
+ // Extract notes section if present
112
+ const notesMatch = content.match(/## Notes\n([\s\S]*?)(?=\n## |$)/);
113
+ if (notesMatch) {
114
+ config.notes = notesMatch[1].trim();
115
+ }
116
+
117
+ // Return config only if we have the essential fields
118
+ if (config.language && config.reviewer) {
119
+ return {
120
+ language: config.language,
121
+ reviewer: config.reviewer,
122
+ arbitrator: config.arbitrator || 'gemini',
123
+ enableArbitration: config.enableArbitration ?? true,
124
+ created: config.created || new Date().toISOString(),
125
+ lastRun: config.lastRun || new Date().toISOString(),
126
+ projectName: config.projectName,
127
+ description: config.description,
128
+ notes: config.notes,
129
+ openaiModel: config.openaiModel,
130
+ geminiModel: config.geminiModel,
131
+ grokModel: config.grokModel,
132
+ };
133
+ }
134
+
135
+ return null;
136
+ } catch {
137
+ return null;
138
+ }
139
+ }
@@ -23,14 +23,17 @@ export const ConsensusSettingsSchema = z.object({
23
23
  * OpenAI API settings schema
24
24
  */
25
25
  export const OpenAISettingsSchema = z.object({
26
- model: z
27
- .enum(['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'o1-preview', 'o1-mini'])
28
- .default('gpt-4o'),
26
+ model: z.string().min(1).default('gpt-4.1'),
29
27
  temperature: z.number().min(0).max(2).default(0.3),
30
28
  max_tokens: z.number().min(100).max(32000).default(4096),
31
29
  available_models: z
32
30
  .array(z.string())
33
- .default(['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'o1-preview', 'o1-mini']),
31
+ .default([
32
+ 'gpt-4.1', 'gpt-4.1-mini', 'gpt-4.1-nano',
33
+ 'o3', 'o3-mini', 'o4-mini',
34
+ 'gpt-4o', 'gpt-4o-mini',
35
+ 'gpt-4-turbo', 'o1-preview', 'o1-mini',
36
+ ]),
34
37
  });
35
38
 
36
39
  /**
@@ -55,10 +58,15 @@ export const GrokSettingsSchema = z.object({
55
58
  */
56
59
  export const APISettingsSchema = z.object({
57
60
  openai: OpenAISettingsSchema.default({
58
- model: 'gpt-4o',
61
+ model: 'gpt-4.1',
59
62
  temperature: 0.3,
60
63
  max_tokens: 4096,
61
- available_models: ['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'o1-preview', 'o1-mini'],
64
+ available_models: [
65
+ 'gpt-4.1', 'gpt-4.1-mini', 'gpt-4.1-nano',
66
+ 'o3', 'o3-mini', 'o4-mini',
67
+ 'gpt-4o', 'gpt-4o-mini',
68
+ 'gpt-4-turbo', 'o1-preview', 'o1-mini',
69
+ ],
62
70
  }),
63
71
  claude: ClaudeSettingsSchema.default({
64
72
  model: 'claude-sonnet-4-20250514',
@@ -139,10 +147,15 @@ export const ConfigSchema = z.object({
139
147
  }),
140
148
  apis: APISettingsSchema.default({
141
149
  openai: {
142
- model: 'gpt-4o',
150
+ model: 'gpt-4.1',
143
151
  temperature: 0.3,
144
152
  max_tokens: 4096,
145
- available_models: ['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'o1-preview', 'o1-mini'],
153
+ available_models: [
154
+ 'gpt-4.1', 'gpt-4.1-mini', 'gpt-4.1-nano',
155
+ 'o3', 'o3-mini', 'o4-mini',
156
+ 'gpt-4o', 'gpt-4o-mini',
157
+ 'gpt-4-turbo', 'o1-preview', 'o1-mini',
158
+ ],
146
159
  },
147
160
  claude: {
148
161
  model: 'claude-sonnet-4-20250514',