popeye-cli 1.9.5 → 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 (318) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/CONTRIBUTING.md +15 -1
  3. package/README.md +57 -0
  4. package/cheatsheet.md +65 -0
  5. package/dist/cli/commands/debug-context.d.ts +64 -0
  6. package/dist/cli/commands/debug-context.d.ts.map +1 -0
  7. package/dist/cli/commands/debug-context.js +221 -0
  8. package/dist/cli/commands/debug-context.js.map +1 -0
  9. package/dist/cli/commands/debug-prompts.d.ts +25 -0
  10. package/dist/cli/commands/debug-prompts.d.ts.map +1 -0
  11. package/dist/cli/commands/debug-prompts.js +80 -0
  12. package/dist/cli/commands/debug-prompts.js.map +1 -0
  13. package/dist/cli/commands/debug.d.ts +68 -0
  14. package/dist/cli/commands/debug.d.ts.map +1 -0
  15. package/dist/cli/commands/debug.js +543 -0
  16. package/dist/cli/commands/debug.js.map +1 -0
  17. package/dist/cli/commands/index.d.ts +1 -0
  18. package/dist/cli/commands/index.d.ts.map +1 -1
  19. package/dist/cli/commands/index.js +1 -0
  20. package/dist/cli/commands/index.js.map +1 -1
  21. package/dist/cli/index.d.ts.map +1 -1
  22. package/dist/cli/index.js +2 -1
  23. package/dist/cli/index.js.map +1 -1
  24. package/dist/cli/interactive.d.ts.map +1 -1
  25. package/dist/cli/interactive.js +25 -0
  26. package/dist/cli/interactive.js.map +1 -1
  27. package/dist/generators/all.d.ts.map +1 -1
  28. package/dist/generators/all.js +2 -0
  29. package/dist/generators/all.js.map +1 -1
  30. package/dist/generators/templates/database-docker.d.ts.map +1 -1
  31. package/dist/generators/templates/database-docker.js +10 -0
  32. package/dist/generators/templates/database-docker.js.map +1 -1
  33. package/dist/generators/templates/fullstack.d.ts +4 -1
  34. package/dist/generators/templates/fullstack.d.ts.map +1 -1
  35. package/dist/generators/templates/fullstack.js +6 -2
  36. package/dist/generators/templates/fullstack.js.map +1 -1
  37. package/dist/pipeline/artifact-manager.d.ts +47 -0
  38. package/dist/pipeline/artifact-manager.d.ts.map +1 -0
  39. package/dist/pipeline/artifact-manager.js +251 -0
  40. package/dist/pipeline/artifact-manager.js.map +1 -0
  41. package/dist/pipeline/artifact-validators.d.ts +29 -0
  42. package/dist/pipeline/artifact-validators.d.ts.map +1 -0
  43. package/dist/pipeline/artifact-validators.js +173 -0
  44. package/dist/pipeline/artifact-validators.js.map +1 -0
  45. package/dist/pipeline/change-request.d.ts +47 -0
  46. package/dist/pipeline/change-request.d.ts.map +1 -0
  47. package/dist/pipeline/change-request.js +91 -0
  48. package/dist/pipeline/change-request.js.map +1 -0
  49. package/dist/pipeline/check-runner.d.ts +47 -0
  50. package/dist/pipeline/check-runner.d.ts.map +1 -0
  51. package/dist/pipeline/check-runner.js +417 -0
  52. package/dist/pipeline/check-runner.js.map +1 -0
  53. package/dist/pipeline/command-resolver.d.ts +9 -0
  54. package/dist/pipeline/command-resolver.d.ts.map +1 -0
  55. package/dist/pipeline/command-resolver.js +140 -0
  56. package/dist/pipeline/command-resolver.js.map +1 -0
  57. package/dist/pipeline/consensus/consensus-runner.d.ts +44 -0
  58. package/dist/pipeline/consensus/consensus-runner.d.ts.map +1 -0
  59. package/dist/pipeline/consensus/consensus-runner.js +212 -0
  60. package/dist/pipeline/consensus/consensus-runner.js.map +1 -0
  61. package/dist/pipeline/constitution.d.ts +45 -0
  62. package/dist/pipeline/constitution.d.ts.map +1 -0
  63. package/dist/pipeline/constitution.js +82 -0
  64. package/dist/pipeline/constitution.js.map +1 -0
  65. package/dist/pipeline/gate-engine.d.ts +55 -0
  66. package/dist/pipeline/gate-engine.d.ts.map +1 -0
  67. package/dist/pipeline/gate-engine.js +270 -0
  68. package/dist/pipeline/gate-engine.js.map +1 -0
  69. package/dist/pipeline/index.d.ts +26 -0
  70. package/dist/pipeline/index.d.ts.map +1 -0
  71. package/dist/pipeline/index.js +35 -0
  72. package/dist/pipeline/index.js.map +1 -0
  73. package/dist/pipeline/migration.d.ts +15 -0
  74. package/dist/pipeline/migration.d.ts.map +1 -0
  75. package/dist/pipeline/migration.js +76 -0
  76. package/dist/pipeline/migration.js.map +1 -0
  77. package/dist/pipeline/orchestrator.d.ts +28 -0
  78. package/dist/pipeline/orchestrator.d.ts.map +1 -0
  79. package/dist/pipeline/orchestrator.js +238 -0
  80. package/dist/pipeline/orchestrator.js.map +1 -0
  81. package/dist/pipeline/packets/audit-report-builder.d.ts +11 -0
  82. package/dist/pipeline/packets/audit-report-builder.d.ts.map +1 -0
  83. package/dist/pipeline/packets/audit-report-builder.js +32 -0
  84. package/dist/pipeline/packets/audit-report-builder.js.map +1 -0
  85. package/dist/pipeline/packets/consensus-packet-builder.d.ts +35 -0
  86. package/dist/pipeline/packets/consensus-packet-builder.d.ts.map +1 -0
  87. package/dist/pipeline/packets/consensus-packet-builder.js +80 -0
  88. package/dist/pipeline/packets/consensus-packet-builder.js.map +1 -0
  89. package/dist/pipeline/packets/index.d.ts +12 -0
  90. package/dist/pipeline/packets/index.d.ts.map +1 -0
  91. package/dist/pipeline/packets/index.js +8 -0
  92. package/dist/pipeline/packets/index.js.map +1 -0
  93. package/dist/pipeline/packets/plan-packet-builder.d.ts +21 -0
  94. package/dist/pipeline/packets/plan-packet-builder.d.ts.map +1 -0
  95. package/dist/pipeline/packets/plan-packet-builder.js +27 -0
  96. package/dist/pipeline/packets/plan-packet-builder.js.map +1 -0
  97. package/dist/pipeline/packets/rca-packet-builder.d.ts +19 -0
  98. package/dist/pipeline/packets/rca-packet-builder.d.ts.map +1 -0
  99. package/dist/pipeline/packets/rca-packet-builder.js +22 -0
  100. package/dist/pipeline/packets/rca-packet-builder.js.map +1 -0
  101. package/dist/pipeline/phases/architecture.d.ts +7 -0
  102. package/dist/pipeline/phases/architecture.d.ts.map +1 -0
  103. package/dist/pipeline/phases/architecture.js +60 -0
  104. package/dist/pipeline/phases/architecture.js.map +1 -0
  105. package/dist/pipeline/phases/audit.d.ts +8 -0
  106. package/dist/pipeline/phases/audit.d.ts.map +1 -0
  107. package/dist/pipeline/phases/audit.js +144 -0
  108. package/dist/pipeline/phases/audit.js.map +1 -0
  109. package/dist/pipeline/phases/consensus-architecture.d.ts +7 -0
  110. package/dist/pipeline/phases/consensus-architecture.d.ts.map +1 -0
  111. package/dist/pipeline/phases/consensus-architecture.js +84 -0
  112. package/dist/pipeline/phases/consensus-architecture.js.map +1 -0
  113. package/dist/pipeline/phases/consensus-master-plan.d.ts +7 -0
  114. package/dist/pipeline/phases/consensus-master-plan.d.ts.map +1 -0
  115. package/dist/pipeline/phases/consensus-master-plan.js +81 -0
  116. package/dist/pipeline/phases/consensus-master-plan.js.map +1 -0
  117. package/dist/pipeline/phases/consensus-role-plans.d.ts +7 -0
  118. package/dist/pipeline/phases/consensus-role-plans.d.ts.map +1 -0
  119. package/dist/pipeline/phases/consensus-role-plans.js +85 -0
  120. package/dist/pipeline/phases/consensus-role-plans.js.map +1 -0
  121. package/dist/pipeline/phases/done.d.ts +7 -0
  122. package/dist/pipeline/phases/done.d.ts.map +1 -0
  123. package/dist/pipeline/phases/done.js +45 -0
  124. package/dist/pipeline/phases/done.js.map +1 -0
  125. package/dist/pipeline/phases/implementation.d.ts +8 -0
  126. package/dist/pipeline/phases/implementation.d.ts.map +1 -0
  127. package/dist/pipeline/phases/implementation.js +42 -0
  128. package/dist/pipeline/phases/implementation.js.map +1 -0
  129. package/dist/pipeline/phases/index.d.ts +20 -0
  130. package/dist/pipeline/phases/index.d.ts.map +1 -0
  131. package/dist/pipeline/phases/index.js +19 -0
  132. package/dist/pipeline/phases/index.js.map +1 -0
  133. package/dist/pipeline/phases/intake.d.ts +8 -0
  134. package/dist/pipeline/phases/intake.d.ts.map +1 -0
  135. package/dist/pipeline/phases/intake.js +40 -0
  136. package/dist/pipeline/phases/intake.js.map +1 -0
  137. package/dist/pipeline/phases/phase-context.d.ts +30 -0
  138. package/dist/pipeline/phases/phase-context.d.ts.map +1 -0
  139. package/dist/pipeline/phases/phase-context.js +33 -0
  140. package/dist/pipeline/phases/phase-context.js.map +1 -0
  141. package/dist/pipeline/phases/production-gate.d.ts +8 -0
  142. package/dist/pipeline/phases/production-gate.d.ts.map +1 -0
  143. package/dist/pipeline/phases/production-gate.js +84 -0
  144. package/dist/pipeline/phases/production-gate.js.map +1 -0
  145. package/dist/pipeline/phases/qa-validation.d.ts +7 -0
  146. package/dist/pipeline/phases/qa-validation.d.ts.map +1 -0
  147. package/dist/pipeline/phases/qa-validation.js +50 -0
  148. package/dist/pipeline/phases/qa-validation.js.map +1 -0
  149. package/dist/pipeline/phases/recovery-loop.d.ts +7 -0
  150. package/dist/pipeline/phases/recovery-loop.d.ts.map +1 -0
  151. package/dist/pipeline/phases/recovery-loop.js +91 -0
  152. package/dist/pipeline/phases/recovery-loop.js.map +1 -0
  153. package/dist/pipeline/phases/review.d.ts +8 -0
  154. package/dist/pipeline/phases/review.d.ts.map +1 -0
  155. package/dist/pipeline/phases/review.js +127 -0
  156. package/dist/pipeline/phases/review.js.map +1 -0
  157. package/dist/pipeline/phases/role-planning.d.ts +7 -0
  158. package/dist/pipeline/phases/role-planning.d.ts.map +1 -0
  159. package/dist/pipeline/phases/role-planning.js +75 -0
  160. package/dist/pipeline/phases/role-planning.js.map +1 -0
  161. package/dist/pipeline/phases/stuck.d.ts +7 -0
  162. package/dist/pipeline/phases/stuck.d.ts.map +1 -0
  163. package/dist/pipeline/phases/stuck.js +51 -0
  164. package/dist/pipeline/phases/stuck.js.map +1 -0
  165. package/dist/pipeline/repo-snapshot.d.ts +24 -0
  166. package/dist/pipeline/repo-snapshot.d.ts.map +1 -0
  167. package/dist/pipeline/repo-snapshot.js +343 -0
  168. package/dist/pipeline/repo-snapshot.js.map +1 -0
  169. package/dist/pipeline/role-execution-adapter.d.ts +59 -0
  170. package/dist/pipeline/role-execution-adapter.d.ts.map +1 -0
  171. package/dist/pipeline/role-execution-adapter.js +159 -0
  172. package/dist/pipeline/role-execution-adapter.js.map +1 -0
  173. package/dist/pipeline/skill-loader.d.ts +34 -0
  174. package/dist/pipeline/skill-loader.d.ts.map +1 -0
  175. package/dist/pipeline/skill-loader.js +156 -0
  176. package/dist/pipeline/skill-loader.js.map +1 -0
  177. package/dist/pipeline/skills/defaults.d.ts +16 -0
  178. package/dist/pipeline/skills/defaults.d.ts.map +1 -0
  179. package/dist/pipeline/skills/defaults.js +189 -0
  180. package/dist/pipeline/skills/defaults.js.map +1 -0
  181. package/dist/pipeline/type-defs/artifacts.d.ts +202 -0
  182. package/dist/pipeline/type-defs/artifacts.d.ts.map +1 -0
  183. package/dist/pipeline/type-defs/artifacts.js +66 -0
  184. package/dist/pipeline/type-defs/artifacts.js.map +1 -0
  185. package/dist/pipeline/type-defs/audit.d.ts +256 -0
  186. package/dist/pipeline/type-defs/audit.d.ts.map +1 -0
  187. package/dist/pipeline/type-defs/audit.js +54 -0
  188. package/dist/pipeline/type-defs/audit.js.map +1 -0
  189. package/dist/pipeline/type-defs/checks.d.ts +81 -0
  190. package/dist/pipeline/type-defs/checks.d.ts.map +1 -0
  191. package/dist/pipeline/type-defs/checks.js +38 -0
  192. package/dist/pipeline/type-defs/checks.js.map +1 -0
  193. package/dist/pipeline/type-defs/enums.d.ts +43 -0
  194. package/dist/pipeline/type-defs/enums.d.ts.map +1 -0
  195. package/dist/pipeline/type-defs/enums.js +55 -0
  196. package/dist/pipeline/type-defs/enums.js.map +1 -0
  197. package/dist/pipeline/type-defs/index.d.ts +12 -0
  198. package/dist/pipeline/type-defs/index.d.ts.map +1 -0
  199. package/dist/pipeline/type-defs/index.js +12 -0
  200. package/dist/pipeline/type-defs/index.js.map +1 -0
  201. package/dist/pipeline/type-defs/packets.d.ts +806 -0
  202. package/dist/pipeline/type-defs/packets.d.ts.map +1 -0
  203. package/dist/pipeline/type-defs/packets.js +109 -0
  204. package/dist/pipeline/type-defs/packets.js.map +1 -0
  205. package/dist/pipeline/type-defs/snapshot.d.ts +52 -0
  206. package/dist/pipeline/type-defs/snapshot.d.ts.map +1 -0
  207. package/dist/pipeline/type-defs/snapshot.js +35 -0
  208. package/dist/pipeline/type-defs/snapshot.js.map +1 -0
  209. package/dist/pipeline/type-defs/state.d.ts +449 -0
  210. package/dist/pipeline/type-defs/state.d.ts.map +1 -0
  211. package/dist/pipeline/type-defs/state.js +88 -0
  212. package/dist/pipeline/type-defs/state.js.map +1 -0
  213. package/dist/pipeline/types.d.ts +16 -0
  214. package/dist/pipeline/types.d.ts.map +1 -0
  215. package/dist/pipeline/types.js +16 -0
  216. package/dist/pipeline/types.js.map +1 -0
  217. package/dist/types/audit.d.ts +6 -6
  218. package/dist/workflow/index.d.ts.map +1 -1
  219. package/dist/workflow/index.js +48 -0
  220. package/dist/workflow/index.js.map +1 -1
  221. package/package.json +1 -1
  222. package/skills/ARBITRATOR.md +137 -0
  223. package/skills/ARCHITECT.md +167 -0
  224. package/skills/AUDITOR.md +128 -0
  225. package/skills/AUDIT_REPORT_SCHEMA.md +20 -0
  226. package/skills/BACKEND_PROGRAMMER.md +95 -0
  227. package/skills/CONSENSUS_PACKET_SCHEMA.md +166 -0
  228. package/skills/DB_EXPERT.md +106 -0
  229. package/skills/DEBUGGER.md +286 -0
  230. package/skills/DISPATCHER.md +157 -0
  231. package/skills/FRONTEND_PROGRAMMER.md +84 -0
  232. package/skills/JOURNALIST.md +247 -0
  233. package/skills/MARKETING_EXPERT.md +23 -0
  234. package/skills/PHASE_GATE_ENGINE_SPEC.md +171 -0
  235. package/skills/PLAN_PACKET_SCHEMA.md +222 -0
  236. package/skills/POPEYE_CONSTITUTION.md +177 -0
  237. package/skills/POPEYE_FULL_AUTONOMY_PIPELINE.md +537 -0
  238. package/skills/PRODUCTION_READINESS_SCHEMA.md +19 -0
  239. package/skills/QA_TESTER.md +40 -0
  240. package/skills/RCA_PACKET_SCHEMA.md +22 -0
  241. package/skills/RELEASE_MANAGER.md +60 -0
  242. package/skills/REVIEWER.md +133 -0
  243. package/skills/SOCIAL_EXPERT.md +22 -0
  244. package/skills/UI_UX_SPECIALIST.md +22 -0
  245. package/skills/WEBSITE_PROGRAMMER.md +37 -0
  246. package/src/cli/commands/debug-context.ts +265 -0
  247. package/src/cli/commands/debug-prompts.ts +91 -0
  248. package/src/cli/commands/debug.ts +662 -0
  249. package/src/cli/commands/index.ts +1 -0
  250. package/src/cli/index.ts +2 -0
  251. package/src/cli/interactive.ts +27 -0
  252. package/src/generators/all.ts +2 -0
  253. package/src/generators/templates/database-docker.ts +10 -0
  254. package/src/generators/templates/fullstack.ts +6 -2
  255. package/src/pipeline/artifact-manager.ts +339 -0
  256. package/src/pipeline/artifact-validators.ts +224 -0
  257. package/src/pipeline/change-request.ts +119 -0
  258. package/src/pipeline/check-runner.ts +504 -0
  259. package/src/pipeline/command-resolver.ts +168 -0
  260. package/src/pipeline/consensus/consensus-runner.ts +317 -0
  261. package/src/pipeline/constitution.ts +109 -0
  262. package/src/pipeline/gate-engine.ts +347 -0
  263. package/src/pipeline/index.ts +82 -0
  264. package/src/pipeline/migration.ts +91 -0
  265. package/src/pipeline/orchestrator.ts +314 -0
  266. package/src/pipeline/packets/audit-report-builder.ts +47 -0
  267. package/src/pipeline/packets/consensus-packet-builder.ts +112 -0
  268. package/src/pipeline/packets/index.ts +15 -0
  269. package/src/pipeline/packets/plan-packet-builder.ts +52 -0
  270. package/src/pipeline/packets/rca-packet-builder.ts +38 -0
  271. package/src/pipeline/phases/architecture.ts +73 -0
  272. package/src/pipeline/phases/audit.ts +193 -0
  273. package/src/pipeline/phases/consensus-architecture.ts +104 -0
  274. package/src/pipeline/phases/consensus-master-plan.ts +100 -0
  275. package/src/pipeline/phases/consensus-role-plans.ts +105 -0
  276. package/src/pipeline/phases/done.ts +68 -0
  277. package/src/pipeline/phases/implementation.ts +48 -0
  278. package/src/pipeline/phases/index.ts +21 -0
  279. package/src/pipeline/phases/intake.ts +54 -0
  280. package/src/pipeline/phases/phase-context.ts +86 -0
  281. package/src/pipeline/phases/production-gate.ts +113 -0
  282. package/src/pipeline/phases/qa-validation.ts +63 -0
  283. package/src/pipeline/phases/recovery-loop.ts +118 -0
  284. package/src/pipeline/phases/review.ts +149 -0
  285. package/src/pipeline/phases/role-planning.ts +92 -0
  286. package/src/pipeline/phases/stuck.ts +62 -0
  287. package/src/pipeline/repo-snapshot.ts +395 -0
  288. package/src/pipeline/role-execution-adapter.ts +238 -0
  289. package/src/pipeline/skill-loader.ts +192 -0
  290. package/src/pipeline/skills/defaults.ts +215 -0
  291. package/src/pipeline/type-defs/artifacts.ts +81 -0
  292. package/src/pipeline/type-defs/audit.ts +67 -0
  293. package/src/pipeline/type-defs/checks.ts +47 -0
  294. package/src/pipeline/type-defs/enums.ts +62 -0
  295. package/src/pipeline/type-defs/index.ts +12 -0
  296. package/src/pipeline/type-defs/packets.ts +131 -0
  297. package/src/pipeline/type-defs/snapshot.ts +55 -0
  298. package/src/pipeline/type-defs/state.ts +165 -0
  299. package/src/pipeline/types.ts +16 -0
  300. package/src/workflow/index.ts +48 -0
  301. package/tests/cli/commands/debug.test.ts +376 -0
  302. package/tests/pipeline/artifact-manager.test.ts +183 -0
  303. package/tests/pipeline/artifact-validators.test.ts +207 -0
  304. package/tests/pipeline/change-request.test.ts +180 -0
  305. package/tests/pipeline/check-runner.test.ts +157 -0
  306. package/tests/pipeline/command-resolver.test.ts +159 -0
  307. package/tests/pipeline/consensus-runner.test.ts +206 -0
  308. package/tests/pipeline/consensus-scoring.test.ts +163 -0
  309. package/tests/pipeline/constitution.test.ts +122 -0
  310. package/tests/pipeline/gate-engine.test.ts +195 -0
  311. package/tests/pipeline/migration.test.ts +133 -0
  312. package/tests/pipeline/orchestrator.test.ts +614 -0
  313. package/tests/pipeline/packets/builders.test.ts +347 -0
  314. package/tests/pipeline/repo-snapshot.test.ts +189 -0
  315. package/tests/pipeline/role-execution-adapter.test.ts +299 -0
  316. package/tests/pipeline/skill-loader.test.ts +186 -0
  317. package/tests/pipeline/start-env-checks.test.ts +123 -0
  318. package/tests/pipeline/types.test.ts +156 -0
@@ -0,0 +1,247 @@
1
+ # Skill: JOURNALIST (PROJECT RECORDER)
2
+ Role Type: Governance Recorder
3
+ Authority Level: Immutable Documentation Authority
4
+
5
+ ---
6
+
7
+ ## Objective
8
+
9
+ Ensure that every approved Plan Packet and Consensus Packet is:
10
+
11
+ - Persisted under /docs/
12
+ - Versioned
13
+ - Immutable
14
+ - Traceable
15
+ - Linked to Master Plan
16
+ - Cross-referenced for future audits
17
+
18
+ Journalist does NOT influence decisions.
19
+ Journalist ensures history cannot be rewritten.
20
+
21
+ ---
22
+
23
+ ## Primary Responsibilities
24
+
25
+ - Record approved Plan Packets
26
+ - Record Consensus Packets
27
+ - Record Arbitrator decisions
28
+ - Maintain version history
29
+ - Maintain decision index
30
+ - Maintain changelog timeline
31
+ - Detect missing documentation
32
+ - Prevent silent edits
33
+
34
+ ---
35
+
36
+ ## Non-Responsibilities
37
+
38
+ - Does NOT modify plans
39
+ - Does NOT participate in consensus
40
+ - Does NOT interpret scope
41
+ - Does NOT alter artifacts
42
+ - Does NOT summarize differently than source
43
+
44
+ Journalist records. It does not reinterpret.
45
+
46
+ ---
47
+
48
+ ## Trigger Conditions
49
+
50
+ Journalist is triggered ONLY when:
51
+
52
+ - Consensus final_status = APPROVED
53
+ - OR final_status = APPROVED_WITH_PATCH
54
+ - OR final_status = REJECTED
55
+ - OR final_status = REVISION_REQUIRED
56
+
57
+ No packet is allowed to disappear.
58
+
59
+ ---
60
+
61
+ ## Required Inputs
62
+
63
+ 1. Final Plan Packet (approved version)
64
+ 2. Consensus Packet
65
+ 3. Arbitrator Result (if exists)
66
+ 4. Dispatcher Phase Context
67
+ 5. Timestamp
68
+ 6. Version number
69
+
70
+ If any missing → BLOCKED: Missing Inputs
71
+
72
+ ---
73
+
74
+ ## Documentation Structure (Mandatory)
75
+
76
+ All logs must be written under:
77
+ /docs/
78
+ ├── master-plan/
79
+ ├── architecture/
80
+ ├── role-plans/
81
+ ├── consensus/
82
+ ├── arbitration/
83
+ ├── revisions/
84
+ ├── completion/
85
+ └── INDEX.md
86
+
87
+
88
+ ---
89
+
90
+ ## File Naming Convention
91
+
92
+ Format:
93
+
94
+
95
+ <phase>_<packet-id>v<version><timestamp>.md
96
+
97
+
98
+ Example:
99
+
100
+
101
+ architecture_2f8a_v1_2026-02-20.md
102
+ consensus_2f8a_v1_2026-02-20.md
103
+
104
+
105
+ No overwriting allowed.
106
+ Each version creates a new file.
107
+
108
+ ---
109
+
110
+ ## Required Document Content Structure
111
+
112
+ Every recorded document must contain:
113
+
114
+ ### 1. Header Metadata
115
+
116
+ - Project Name
117
+ - Packet ID
118
+ - Version
119
+ - Phase
120
+ - Timestamp
121
+ - Dispatcher reference
122
+ - Constitution version
123
+
124
+ ---
125
+
126
+ ### 2. Master Plan Reference
127
+
128
+ - Master Plan version
129
+ - Scope summary
130
+ - Change Requests (if any)
131
+
132
+ ---
133
+
134
+ ### 3. Plan Content (verbatim)
135
+
136
+ Must include full approved Plan Packet content.
137
+ No summarization.
138
+ No omission.
139
+
140
+ ---
141
+
142
+ ### 4. Consensus Summary
143
+
144
+ - Reviewer verdicts
145
+ - Approval percentage
146
+ - Blocking issues (resolved or not)
147
+ - Hallucination flags
148
+ - Constitution violations (if any)
149
+
150
+ ---
151
+
152
+ ### 5. Arbitrator Decision (if applicable)
153
+
154
+ - Converged patch
155
+ - Final verdict
156
+ - Rationale
157
+ - Dispatcher next step
158
+
159
+ ---
160
+
161
+ ### 6. Execution Traceability Section
162
+
163
+ Must include:
164
+
165
+ - Which artifacts are now authorized
166
+ - Which roles are unblocked
167
+ - Which phase is next
168
+ - Hash or fingerprint (optional but recommended)
169
+
170
+ ---
171
+
172
+ ## INDEX.md Maintenance Rules
173
+
174
+ Journalist must maintain:
175
+
176
+ - Chronological list of all packets
177
+ - Phase grouping
178
+ - Quick link to latest approved version per phase
179
+ - Revision count per artifact
180
+
181
+ Format example:
182
+
183
+ Project Governance Index
184
+ Architecture
185
+
186
+ v1 - APPROVED - 2026-02-20 - Packet 2f8a
187
+
188
+ v2 - APPROVED_WITH_PATCH - 2026-02-21 - Packet 5c91
189
+
190
+ Role Planning
191
+
192
+ v1 - REJECTED - 2026-02-22 - Packet 8a12
193
+
194
+
195
+ INDEX must never be deleted or rewritten.
196
+
197
+ ---
198
+
199
+ ## Anti-Tampering Rules
200
+
201
+ Journalist must detect and flag:
202
+
203
+ - Attempt to overwrite existing file
204
+ - Missing version increment
205
+ - Missing consensus packet
206
+ - Inconsistent packet reference
207
+ - Timestamp anomalies
208
+
209
+ If detected → BLOCKED and notify Dispatcher.
210
+
211
+ ---
212
+
213
+ ## Immutability Principle
214
+
215
+ Once written:
216
+ - Documents are read-only
217
+ - Edits require new version
218
+ - Historical record remains untouched
219
+
220
+ ---
221
+
222
+ ## Definition of Done
223
+
224
+ Journalist is complete when:
225
+
226
+ - Plan Packet is stored
227
+ - Consensus Packet is stored
228
+ - Arbitrator decision stored (if applicable)
229
+ - INDEX.md updated
230
+ - Documentation structure validated
231
+ - No overwrites occurred
232
+
233
+ ---
234
+
235
+ ## Failure Conditions
236
+
237
+ - Missing Plan Packet
238
+ - Missing Consensus Packet
239
+ - Version conflict
240
+ - Overwrite attempt
241
+ - Inconsistent metadata
242
+
243
+ Automatic block if any occur.
244
+
245
+ ---
246
+
247
+ End of Skill.
@@ -0,0 +1,23 @@
1
+ # Skill: MARKETING EXPERT
2
+ Role Type: Positioning Authority
3
+
4
+ ---
5
+
6
+ ## Objective
7
+
8
+ Ensure product messaging aligns with value proposition.
9
+
10
+ ---
11
+
12
+ ## Responsibilities
13
+
14
+ - ICP definition
15
+ - Messaging clarity
16
+ - Pricing logic
17
+ - Conversion strategy
18
+ - Funnel alignment
19
+
20
+ ---
21
+
22
+ Definition of Done:
23
+ Clear, differentiated positioning aligned with product reality.
@@ -0,0 +1,171 @@
1
+ # PHASE GATE ENGINE SPEC
2
+
3
+ Defines the deterministic workflow engine of Popeye.
4
+
5
+ Version: 1.1 (Autonomy Hardening Gap Fixes)
6
+
7
+ ---
8
+
9
+ ## States
10
+
11
+ INTAKE
12
+ CONSENSUS_MASTER_PLAN
13
+ ARCHITECTURE
14
+ CONSENSUS_ARCHITECTURE
15
+ ROLE_PLANNING
16
+ CONSENSUS_ROLE_PLANS
17
+ IMPLEMENTATION
18
+ QA_VALIDATION
19
+ REVIEW
20
+ AUDIT
21
+ PRODUCTION_GATE
22
+ RECOVERY_LOOP (conditional)
23
+ DONE
24
+ STUCK (safety valve)
25
+
26
+ ---
27
+
28
+ ## Gate Rules
29
+
30
+ Each state defines:
31
+
32
+ - Required Artifacts
33
+ - Required Build/Test Commands
34
+ - Required Consensus Status (threshold for consensus phases)
35
+ - Allowed Transitions
36
+ - Fail Transition (always RECOVERY_LOOP, except terminal phases)
37
+
38
+ No state skipping allowed.
39
+
40
+ ---
41
+
42
+ ## Gate Evaluation (v1.1)
43
+
44
+ Before evaluating any gate, the orchestrator performs:
45
+
46
+ 1. **Constitution Verification** - verifies `skills/POPEYE_CONSTITUTION.md` hash matches the stored hash from pipeline start. If the constitution has been modified, the gate is blocked.
47
+
48
+ 2. **Gate Evaluation** - checks required artifacts, check results, and consensus thresholds. The `evaluateGate()` function accepts optional `constitutionValid` and `constitutionReason` options.
49
+
50
+ 3. **Gate Result Merge** - preserves `score`/`consensusScore` values from consensus phase handlers while updating `pass`/`blockers` from the gate engine. This prevents consensus scores from being overwritten.
51
+
52
+ ## GateResult Interface
53
+
54
+ ```typescript
55
+ interface GateResult {
56
+ phase: PipelinePhase;
57
+ pass: boolean;
58
+ score?: number; // Consensus score from phase handler (preserved by merge)
59
+ blockers: string[];
60
+ missingArtifacts: ArtifactType[];
61
+ failedChecks: GateCheckType[];
62
+ consensusScore?: number; // Alternative consensus score field (preserved by merge)
63
+ timestamp: string;
64
+ }
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Change Request Routing (v1.1)
70
+
71
+ After REVIEW and AUDIT phases pass their gates, the orchestrator checks `pipeline.pendingChangeRequests` for any CRs with `status: 'proposed'`. If found, the pipeline routes to the CR's `target_phase` instead of continuing normal progression.
72
+
73
+ ### CR Routing Map
74
+
75
+ | Change Type | Target Phase |
76
+ |---------------|--------------------------|
77
+ | scope | CONSENSUS_MASTER_PLAN |
78
+ | architecture | CONSENSUS_ARCHITECTURE |
79
+ | dependency | CONSENSUS_ROLE_PLANS |
80
+ | config | QA_VALIDATION |
81
+ | requirement | CONSENSUS_MASTER_PLAN |
82
+
83
+ ### CR Lifecycle
84
+
85
+ ```
86
+ proposed -> approved (routed by orchestrator)
87
+ -> rejected
88
+ ```
89
+
90
+ ### CR Sources
91
+
92
+ - **REVIEW phase**: Creates CRs when implementation drift is detected (config changes, large line deltas)
93
+ - **AUDIT phase**: Creates CRs for blocking architectural findings and security issues
94
+
95
+ ---
96
+
97
+ ## Recovery Loop
98
+
99
+ If any gate FAILS:
100
+
101
+ 1. Enter RECOVERY_LOOP
102
+ 2. Trigger Debugger for RCA
103
+ 3. Produce RCA Packet (JSON artifact with `requires_phase_rewind_to` field)
104
+ 4. Dispatcher generates Recovery Plan
105
+ 5. Consensus on Recovery Plan
106
+ 6. Implement fixes
107
+ 7. On RECOVERY_LOOP success:
108
+ - If RCA specifies `requires_phase_rewind_to`, rewind to that phase
109
+ - Otherwise, re-run the originally failed phase
110
+ 8. Max 5 iterations before STUCK
111
+
112
+ ### RCA Rewind (v1.1)
113
+
114
+ After RECOVERY_LOOP succeeds, the orchestrator reads the latest RCA JSON artifact from disk and parses `requires_phase_rewind_to`. This enables root-cause-aware recovery:
115
+
116
+ - Implementation failure caused by architecture gap: rewind to ARCHITECTURE
117
+ - QA failure caused by missing role plan: rewind to ROLE_PLANNING
118
+ - If no rewind target or no RCA found: return to the originally failed phase
119
+
120
+ ---
121
+
122
+ ## Termination Conditions
123
+
124
+ - Production Gate PASS -> DONE
125
+ - Max Recovery Reached -> STUCK REPORT
126
+
127
+ ---
128
+
129
+ ## Stuck Report Must Include
130
+
131
+ - Current failure
132
+ - Root cause summary
133
+ - Failed iterations count
134
+ - Required human input
135
+
136
+ ---
137
+
138
+ ## State Transition Example
139
+
140
+ ARCHITECTURE -> allowed only if:
141
+ - Architecture Plan exists
142
+ - Repo snapshot exists
143
+ - Constitution integrity verified (v1.1)
144
+ - No blocking issues
145
+
146
+ IMPLEMENTATION -> allowed only if:
147
+ - Role Plans approved (consensus threshold met)
148
+ - Constitution integrity verified (v1.1)
149
+ - No pending change requests (v1.1)
150
+
151
+ REVIEW -> AUDIT (or CR target) after:
152
+ - Review decision artifact exists
153
+ - Repo snapshot exists
154
+ - Constitution integrity verified (v1.1)
155
+ - If pending CRs exist -> route to CR target phase (v1.1)
156
+ - If no pending CRs -> normal progression to AUDIT
157
+
158
+ ---
159
+
160
+ ## Pipeline State Schema (v1.1 additions)
161
+
162
+ ```typescript
163
+ pendingChangeRequests?: Array<{
164
+ cr_id: string;
165
+ change_type: 'scope' | 'architecture' | 'dependency' | 'config' | 'requirement';
166
+ target_phase: PipelinePhase;
167
+ status: 'proposed' | 'approved' | 'rejected';
168
+ }>;
169
+
170
+ failedPhase?: PipelinePhase; // Tracks which phase failed for recovery routing
171
+ ```
@@ -0,0 +1,222 @@
1
+ # PLAN PACKET SCHEMA
2
+ Version: 1.0
3
+ Purpose: Standardized artifact required for Reviewer and Arbitrator evaluation.
4
+
5
+ This schema defines the exact structure of a Plan Packet that must be submitted
6
+ for consensus review.
7
+
8
+ No Reviewer may operate without a valid Plan Packet.
9
+
10
+ ---
11
+
12
+ # 1. Required Top-Level Fields
13
+
14
+ A valid Plan Packet MUST contain:
15
+
16
+ 1. metadata
17
+ 2. master_plan_reference
18
+ 3. current_phase
19
+ 4. repo_snapshot
20
+ 5. constraints
21
+ 6. constitution_reference
22
+ 7. proposed_plan
23
+ 8. acceptance_criteria
24
+ 9. artifact_dependencies
25
+
26
+ If any field is missing → BLOCKED: Missing Inputs
27
+
28
+ ---
29
+
30
+ # 2. Field Definitions
31
+
32
+ ## 2.1 metadata
33
+
34
+ Required:
35
+
36
+ - project_name
37
+ - packet_id (UUID)
38
+ - version
39
+ - timestamp
40
+ - author_role (Dispatcher/Popeye)
41
+ - target_phase
42
+
43
+ Example:
44
+ metadata:
45
+ project_name: popeye-cli
46
+ packet_id: 2f8a...
47
+ version: 1.3
48
+ timestamp: 2026-02-20T12:45:00Z
49
+ author_role: Dispatcher
50
+ target_phase: Architecture
51
+
52
+
53
+ ---
54
+
55
+ ## 2.2 master_plan_reference
56
+
57
+ Must include:
58
+
59
+ - master_plan_version
60
+ - summary_of_scope
61
+ - explicit link/path to stored master plan artifact
62
+
63
+ Must confirm:
64
+ - No scope drift
65
+ - No unapproved changes
66
+
67
+ ---
68
+
69
+ ## 2.3 current_phase
70
+
71
+ One of:
72
+
73
+ - MasterPlan
74
+ - Architecture
75
+ - RolePlanning
76
+ - Consensus
77
+ - Implementation
78
+ - QA
79
+ - Review
80
+ - Arbitration
81
+ - Completion
82
+
83
+ ---
84
+
85
+ ## 2.4 repo_snapshot
86
+
87
+ Must include:
88
+
89
+ - existing folders
90
+ - key files
91
+ - declared tech stack
92
+ - declared dependencies
93
+ - env vars currently defined
94
+ - database state (if exists)
95
+ - build status (if known)
96
+
97
+ Must not hallucinate files.
98
+ Must reflect actual filesystem.
99
+
100
+ ---
101
+
102
+ ## 2.5 constraints
103
+
104
+ Include:
105
+
106
+ - Language(s)
107
+ - Framework(s)
108
+ - Hosting constraints
109
+ - Performance requirements
110
+ - Security constraints
111
+ - Backward compatibility requirements
112
+ - Regulatory constraints (if any)
113
+
114
+ ---
115
+
116
+ ## 2.6 constitution_reference
117
+
118
+ Must confirm:
119
+
120
+ - Constitution version used
121
+ - No violations detected prior to review
122
+
123
+ ---
124
+
125
+ ## 2.7 proposed_plan
126
+
127
+ This is the artifact under review.
128
+
129
+ Must include:
130
+
131
+ - Clear phase breakdown
132
+ - Role ownership per task
133
+ - Explicit artifact outputs
134
+ - Integration wiring steps
135
+ - Risk handling
136
+ - Testing plan references
137
+ - Build validation steps
138
+
139
+ Proposed plan MUST be deterministic.
140
+ No vague phrases allowed:
141
+ - "handle errors"
142
+ - "add tests"
143
+ - "connect later"
144
+ - "implement logic"
145
+
146
+ Everything must specify what, where, and how.
147
+
148
+ ---
149
+
150
+ ## 2.8 acceptance_criteria
151
+
152
+ Must list:
153
+
154
+ - Functional requirements
155
+ - Non-functional requirements
156
+ - Integration requirements
157
+ - Test pass conditions
158
+ - Build pass condition
159
+ - Deployment criteria (if relevant)
160
+
161
+ ---
162
+
163
+ ## 2.9 artifact_dependencies
164
+
165
+ Explicit dependency mapping:
166
+
167
+ Example:
168
+
169
+ - Architecture → required before BE
170
+ - DB Schema → required before BE
171
+ - API Contract → required before FE
172
+ - QA Plan → required before Implementation
173
+ - Review Approval → required before Completion
174
+
175
+ Missing dependency mapping → automatic rejection.
176
+
177
+ ---
178
+
179
+ # 3. Plan Packet Validation Rules
180
+
181
+ A Plan Packet is INVALID if:
182
+
183
+ - It references files not present in repo_snapshot
184
+ - It introduces schema changes without DB ownership
185
+ - It begins implementation before architecture approval
186
+ - It omits test strategy
187
+ - It lacks integration wiring steps
188
+ - It includes placeholders or mocks without explicit approval
189
+
190
+ ---
191
+
192
+ # 4. Hallucination Detection Rule
193
+
194
+ If proposed_plan references:
195
+
196
+ - Non-existent modules
197
+ - Non-existent env vars
198
+ - Undefined API routes
199
+ - Undefined DB tables
200
+ - Undefined services
201
+
202
+ Reviewer must flag as Hallucination.
203
+
204
+ ---
205
+
206
+ # 5. Determinism Requirement
207
+
208
+ Plan must be executable step-by-step.
209
+
210
+ If two different engineers could interpret steps differently → it fails determinism.
211
+
212
+ ---
213
+
214
+ # 6. Versioning
215
+
216
+ Every Plan Packet must increment version if modified.
217
+
218
+ No silent edits allowed.
219
+
220
+ ---
221
+
222
+ End of Schema.