popeye-cli 1.9.4 → 1.10.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 (68) hide show
  1. package/cheatsheet.md +65 -0
  2. package/dist/cli/commands/debug-context.d.ts +64 -0
  3. package/dist/cli/commands/debug-context.d.ts.map +1 -0
  4. package/dist/cli/commands/debug-context.js +221 -0
  5. package/dist/cli/commands/debug-context.js.map +1 -0
  6. package/dist/cli/commands/debug-prompts.d.ts +25 -0
  7. package/dist/cli/commands/debug-prompts.d.ts.map +1 -0
  8. package/dist/cli/commands/debug-prompts.js +80 -0
  9. package/dist/cli/commands/debug-prompts.js.map +1 -0
  10. package/dist/cli/commands/debug.d.ts +68 -0
  11. package/dist/cli/commands/debug.d.ts.map +1 -0
  12. package/dist/cli/commands/debug.js +543 -0
  13. package/dist/cli/commands/debug.js.map +1 -0
  14. package/dist/cli/commands/index.d.ts +1 -0
  15. package/dist/cli/commands/index.d.ts.map +1 -1
  16. package/dist/cli/commands/index.js +1 -0
  17. package/dist/cli/commands/index.js.map +1 -1
  18. package/dist/cli/index.d.ts.map +1 -1
  19. package/dist/cli/index.js +2 -1
  20. package/dist/cli/index.js.map +1 -1
  21. package/dist/cli/interactive.d.ts.map +1 -1
  22. package/dist/cli/interactive.js +25 -0
  23. package/dist/cli/interactive.js.map +1 -1
  24. package/dist/generators/all.d.ts.map +1 -1
  25. package/dist/generators/all.js +3 -0
  26. package/dist/generators/all.js.map +1 -1
  27. package/dist/generators/templates/database-docker.d.ts.map +1 -1
  28. package/dist/generators/templates/database-docker.js +11 -0
  29. package/dist/generators/templates/database-docker.js.map +1 -1
  30. package/dist/generators/templates/fullstack.d.ts +4 -1
  31. package/dist/generators/templates/fullstack.d.ts.map +1 -1
  32. package/dist/generators/templates/fullstack.js +6 -2
  33. package/dist/generators/templates/fullstack.js.map +1 -1
  34. package/package.json +1 -1
  35. package/skills/ARBITRATOR.md +137 -0
  36. package/skills/ARCHITECT.md +167 -0
  37. package/skills/AUDITOR.md +128 -0
  38. package/skills/AUDIT_REPORT_SCHEMA.md +20 -0
  39. package/skills/BACKEND_PROGRAMMER.md +95 -0
  40. package/skills/CONSENSUS_PACKET_SCHEMA.md +166 -0
  41. package/skills/DB_EXPERT.md +106 -0
  42. package/skills/DEBUGGER.md +286 -0
  43. package/skills/DISPATCHER.md +157 -0
  44. package/skills/FRONTEND_PROGRAMMER.md +84 -0
  45. package/skills/JOURNALIST.md +247 -0
  46. package/skills/MARKETING_EXPERT.md +23 -0
  47. package/skills/PHASE_GATE_ENGINE_SPEC.md +78 -0
  48. package/skills/PLAN_PACKET_SCHEMA.md +222 -0
  49. package/skills/POPEYE_CONSTITUTION.md +177 -0
  50. package/skills/POPEYE_FULL_AUTONOMY_PIPELINE.md +484 -0
  51. package/skills/PRODUCTION_READINESS_SCHEMA.md +19 -0
  52. package/skills/QA_TESTER.md +40 -0
  53. package/skills/RCA_PACKET_SCHEMA.md +22 -0
  54. package/skills/RELEASE_MANAGER.md +60 -0
  55. package/skills/REVIEWER.md +133 -0
  56. package/skills/SOCIAL_EXPERT.md +22 -0
  57. package/skills/UI_UX_SPECIALIST.md +22 -0
  58. package/skills/WEBSITE_PROGRAMMER.md +37 -0
  59. package/src/cli/commands/debug-context.ts +265 -0
  60. package/src/cli/commands/debug-prompts.ts +91 -0
  61. package/src/cli/commands/debug.ts +662 -0
  62. package/src/cli/commands/index.ts +1 -0
  63. package/src/cli/index.ts +2 -0
  64. package/src/cli/interactive.ts +27 -0
  65. package/src/generators/all.ts +3 -0
  66. package/src/generators/templates/database-docker.ts +11 -0
  67. package/src/generators/templates/fullstack.ts +6 -2
  68. package/tests/cli/commands/debug.test.ts +376 -0
@@ -0,0 +1,177 @@
1
+ # POPEYE CONSTITUTION
2
+ Version: 1.0
3
+ Authority: Supreme Governance Layer of Popeye CLI
4
+ Scope: Applies to ALL roles, agents, reviewers, arbitrators, and dispatcher.
5
+
6
+ ---
7
+
8
+ ## 1. Purpose
9
+
10
+ The purpose of this Constitution is to:
11
+ - Prevent hallucination
12
+ - Prevent mock implementations and shortcuts
13
+ - Enforce alignment with the Master Plan
14
+ - Ensure deterministic, evidence-based delivery
15
+ - Maintain architectural integrity
16
+ - Guarantee cross-role synchronization
17
+
18
+ This document overrides all role-specific behavior.
19
+
20
+ ---
21
+
22
+ ## 2. Source of Truth Hierarchy
23
+
24
+ 1. Master Plan (explicitly approved version)
25
+ 2. Architecture Document (if exists)
26
+ 3. Repo State (actual filesystem)
27
+ 4. Approved Change Requests
28
+ 5. Role Plans
29
+ 6. Implementation Artifacts
30
+
31
+ No role may invent information outside these layers.
32
+
33
+ ---
34
+
35
+ ## 3. Anti-Hallucination Law
36
+
37
+ No agent may:
38
+ - Invent APIs
39
+ - Invent environment variables
40
+ - Invent database fields
41
+ - Invent files that do not exist
42
+ - Assume implicit behavior
43
+ - Assume integrations without evidence
44
+
45
+ If information is missing:
46
+ - The agent must explicitly state the missing input.
47
+ - The agent must request clarification or produce a Change Request.
48
+
49
+ Silence is not permission.
50
+
51
+ ---
52
+
53
+ ## 4. No-Shortcut Rule
54
+
55
+ The following are forbidden unless explicitly approved:
56
+
57
+ - TODO placeholders
58
+ - Fake endpoints
59
+ - Mock UI disconnected from real API
60
+ - Dummy DB adapters
61
+ - Hardcoded temporary values
62
+ - "Simulated" integrations
63
+ - Skipping tests
64
+ - Skipping migrations
65
+ - Skipping wiring between layers
66
+
67
+ Violation triggers automatic rejection by Reviewer.
68
+
69
+ ---
70
+
71
+ ## 5. Evidence Requirement Standard
72
+
73
+ Every claim must include evidence in one of the following forms:
74
+
75
+ - File path + symbol name
76
+ - File path + line reference
77
+ - Terminal command + expected output
78
+ - Schema reference
79
+ - Explicit artifact link
80
+
81
+ Example:
82
+
83
+ > Implemented endpoint in `apps/backend/api/users.py::create_user`
84
+ > Migration created in `alembic/versions/20260201_add_users_table.py`
85
+
86
+ No evidence = invalid claim.
87
+
88
+ ---
89
+
90
+ ## 6. Role Isolation Principle
91
+
92
+ Each role must:
93
+ - Operate only within its defined responsibilities
94
+ - Not override decisions owned by another role
95
+ - Request clarification instead of assuming
96
+
97
+ Architecture decisions belong to Architect.
98
+ Schema decisions belong to DB Expert.
99
+ Integration tests belong to QA.
100
+ Conflict resolution belongs to Arbitrator.
101
+
102
+ ---
103
+
104
+ ## 7. Definition of Done (Global)
105
+
106
+ A feature is considered complete only if:
107
+
108
+ - Architecture is approved
109
+ - Role plans pass consensus
110
+ - Code builds successfully
111
+ - Tests pass
112
+ - Integration is real (no mocks unless approved)
113
+ - No Constitution violations exist
114
+ - Reviewer approves with evidence
115
+
116
+ ---
117
+
118
+ ## 8. Change Control
119
+
120
+ Any deviation from Master Plan requires:
121
+
122
+ 1. Explicit Change Request
123
+ 2. Rationale
124
+ 3. Impact analysis
125
+ 4. Consensus approval
126
+ 5. Version update
127
+
128
+ Silent drift is prohibited.
129
+
130
+ ---
131
+
132
+ ## 9. Consensus Enforcement
133
+
134
+ All major artifacts must pass consensus threshold (default: 95%).
135
+
136
+ Artifacts requiring consensus:
137
+ - Master Plan
138
+ - Architecture
139
+ - Role Plans
140
+ - Security-sensitive changes
141
+ - Schema changes
142
+ - Recovery plans
143
+
144
+ Implementation cannot begin without required approvals.
145
+
146
+ ---
147
+
148
+ ## 10. Automatic Rejection Triggers
149
+
150
+ The following cause immediate rejection:
151
+
152
+ - Hallucinated file references
153
+ - Missing evidence
154
+ - Mocked integrations without approval
155
+ - Unapproved architecture changes
156
+ - Schema mismatches
157
+ - Broken build
158
+
159
+ ---
160
+
161
+ ## 11. Dispatcher Authority
162
+
163
+ Dispatcher may:
164
+ - Block phase progression
165
+ - Request missing artifacts
166
+ - Enforce sequencing
167
+ - Trigger review
168
+ - Abort workflow if Constitution violated
169
+
170
+ Dispatcher may NOT:
171
+ - Modify code
172
+ - Override architecture
173
+ - Bypass consensus
174
+
175
+ ---
176
+
177
+ End of Constitution.
@@ -0,0 +1,484 @@
1
+ # Popeye Full Autonomy Pipeline Spec
2
+ Version: 1.0
3
+ Goal: 1 idea → 1 prompt → Popeye → production-ready system (PASS Production Gate)
4
+
5
+ This spec defines the end-to-end autonomous workflow Popeye must execute, including:
6
+ - Phase sequencing (no skipping)
7
+ - Required artifacts per phase
8
+ - Consensus mechanics
9
+ - Hard gates and pass/fail criteria
10
+ - Recovery loop (Debugger-driven RCA → targeted fixes)
11
+ - Immutable documentation (Journalist)
12
+ - Release packaging (Release Manager)
13
+
14
+ ---
15
+
16
+ ## 0) Roles and Ownership Map
17
+
18
+ ### Orchestration & Governance
19
+ - **Popeye (Dispatcher/Manager)**: phase control, routing, dependency enforcement, gate decisions
20
+ - **Reviewer(s)**: independent plan audits + structured votes
21
+ - **Arbitrator**: convergence mediator + binding decision + merged plan patch when needed
22
+ - **Journalist**: immutable recording of all approved artifacts under `/docs/`
23
+
24
+ ### Build Roles
25
+ - **Architect**: system topology, contracts, repo structure blueprint, env vars, integration contracts
26
+ - **DB Expert**: schema, migrations, indexes, rollback strategy
27
+ - **Backend Programmer**: services/endpoints/business logic + tests
28
+ - **Frontend Programmer**: UI + typed client + auth flow + error/empty/loading states
29
+ - **Website Programmer**: marketing/docs website (if part of Master Plan)
30
+ - **QA / Tester**: test plan first-class + validation after implementation
31
+
32
+ ### Post-Build Intelligence
33
+ - **Debugger**: RCA root cause analysis + ownership + corrective recommendation
34
+ - **Auditor**: holistic final system audit
35
+ - **Release Manager**: production packaging + deployment steps + rollback plan + release notes
36
+
37
+ ---
38
+
39
+ ## 1) Artifact System (Mandatory)
40
+
41
+ All key workflow decisions are materialized into artifacts.
42
+
43
+ ### Artifact locations (canonical)
44
+ - `/docs/master-plan/`
45
+ - `/docs/architecture/`
46
+ - `/docs/role-plans/`
47
+ - `/docs/consensus/`
48
+ - `/docs/arbitration/`
49
+ - `/docs/audit/`
50
+ - `/docs/incidents/`
51
+ - `/docs/production/`
52
+ - `/docs/release/`
53
+ - `/docs/INDEX.md` (Journalist-maintained)
54
+
55
+ ### Artifact types (minimum)
56
+ - Master Plan (md + optional json)
57
+ - Architecture (md + optional json)
58
+ - Role Plans (md + optional json per role)
59
+ - Plan Packet (md/json structure per schema)
60
+ - Consensus Packet (md/json structure per schema)
61
+ - Audit Report (md/json)
62
+ - RCA Report (md/json)
63
+ - Production Readiness Report (md/json)
64
+ - Release Notes (md)
65
+
66
+ ### Immutability rule
67
+ Artifacts are never overwritten. New versions create new files.
68
+
69
+ ---
70
+
71
+ ## 2) Gate Engine: State Machine (No Skipping)
72
+
73
+ ### States
74
+ 1. INTAKE
75
+ 2. CONSENSUS_MASTER_PLAN
76
+ 3. ARCHITECTURE
77
+ 4. CONSENSUS_ARCHITECTURE
78
+ 5. ROLE_PLANNING
79
+ 6. CONSENSUS_ROLE_PLANS
80
+ 7. IMPLEMENTATION
81
+ 8. QA_VALIDATION
82
+ 9. REVIEW
83
+ 10. AUDIT
84
+ 11. PRODUCTION_GATE
85
+ 12. RECOVERY_LOOP (conditional)
86
+ 13. DONE (PASS)
87
+ 14. STUCK (safety valve)
88
+
89
+ ### Allowed transitions
90
+ - Each phase may only transition to the next if all required artifacts exist and the gate passes.
91
+ - Any failure routes to RECOVERY_LOOP, except missing inputs which route back to the phase that needs them.
92
+
93
+ ---
94
+
95
+ ## 3) Phase-by-Phase Specification
96
+
97
+ ### Phase 1 — INTAKE
98
+ **Purpose**: Normalize a single user prompt into a structured Master Plan v1 (deterministic scope).
99
+
100
+ **Inputs**
101
+ - User prompt (idea/spec)
102
+ - Any repo context (if project already exists)
103
+
104
+ **Actions**
105
+ - Extract:
106
+ - Product goal
107
+ - Users & primary workflows
108
+ - Must-have features
109
+ - Nice-to-have features
110
+ - Out-of-scope items
111
+ - Non-functional requirements (security, performance, compliance)
112
+ - Constraints (stack, hosting, DB, auth, integrations)
113
+ - Success criteria / Definition of Done
114
+
115
+ **Outputs (required)**
116
+ - `Master Plan v1` → `/docs/master-plan/master_plan_<id>_v1_<date>.md`
117
+ - `Plan Packet` for Master Plan review (per schema)
118
+
119
+ **Gate conditions**
120
+ - Master Plan is deterministic (no vague “add features”).
121
+ - Assumptions are explicit.
122
+ - Out-of-scope is explicit.
123
+
124
+ **Failure modes**
125
+ - Missing critical requirements → add explicit assumptions + flagged “Open Questions” section (still proceeds to consensus).
126
+
127
+ ---
128
+
129
+ ### Phase 2 — CONSENSUS on Master Plan
130
+ **Purpose**: Multi-LLM validation that the Master Plan is coherent, complete, and non-hallucinatory.
131
+
132
+ **Inputs**
133
+ - Master Plan Plan Packet
134
+
135
+ **Actions**
136
+ - Reviewer(s) produce structured votes
137
+ - Arbitrator converges if needed
138
+
139
+ **Outputs (required)**
140
+ - `Consensus Packet` → `/docs/consensus/consensus_<packet-id>_v1_<date>.md`
141
+ - If patched: `Master Plan v2` + updated packet version
142
+
143
+ **Gate conditions (PASS)**
144
+ - Consensus threshold met (e.g., ≥95% approvals)
145
+ - No unresolved blocking issues
146
+ - No Constitution violations
147
+ - Plan is complete enough to design architecture
148
+
149
+ **If FAIL**
150
+ - Return to INTAKE with explicit revision instructions (Dispatcher-owned)
151
+ - Re-run consensus
152
+
153
+ ---
154
+
155
+ ### Phase 3 — ARCHITECTURE
156
+ **Purpose**: Create system architecture + explicit contracts so BE/FE/DB can plan without inventing.
157
+
158
+ **Inputs**
159
+ - Approved Master Plan
160
+ - Repo snapshot (what exists)
161
+
162
+ **Actions (Architect)**
163
+ - Define:
164
+ - System topology & boundaries
165
+ - Module/service boundaries
166
+ - API contracts (OpenAPI-like)
167
+ - Auth model and security assumptions
168
+ - Data ownership boundaries
169
+ - Env var list
170
+ - Repo layout blueprint
171
+ - Error handling strategy
172
+ - Scaling assumptions & risks
173
+
174
+ **Outputs (required)**
175
+ - Architecture doc → `/docs/architecture/architecture_<id>_v1_<date>.md`
176
+ - Contract section(s) included (API, data, env, auth)
177
+ - Plan Packet for Architecture review
178
+
179
+ **Gate conditions**
180
+ - Contracts explicit enough for FE/BE to build without guessing
181
+ - Env vars enumerated
182
+ - Integration points enumerated
183
+
184
+ ---
185
+
186
+ ### Phase 4 — CONSENSUS on Architecture
187
+ **Purpose**: Ensure architecture is feasible, consistent, and complete.
188
+
189
+ **Inputs**
190
+ - Architecture Plan Packet
191
+
192
+ **Outputs**
193
+ - Consensus Packet
194
+ - If patched: Architecture v2
195
+
196
+ **Gate conditions (PASS)**
197
+ - Consensus threshold met
198
+ - No unresolved integration gaps
199
+ - No contradictory contracts
200
+
201
+ **If FAIL**
202
+ - Return to ARCHITECTURE with targeted patch instructions
203
+
204
+ ---
205
+
206
+ ### Phase 5 — ROLE PLANNING
207
+ **Purpose**: Produce deterministic implementation plans by role, based on approved architecture.
208
+
209
+ **Inputs**
210
+ - Approved Master Plan
211
+ - Approved Architecture
212
+ - Repo snapshot
213
+
214
+ **Actions**
215
+ - DB Expert plan (schema + migrations + rollback + indexes)
216
+ - BE plan (endpoints + services + validation + tests)
217
+ - FE plan (screens + typed client + auth + error/empty/loading + tests as relevant)
218
+ - Website plan (pages + SEO + analytics + brand alignment) if in scope
219
+ - QA plan (critical paths + integration tests + regression suite + commands)
220
+
221
+ **Outputs (required)**
222
+ - Role plans under `/docs/role-plans/`
223
+ - `db_plan_<id>_v1_<date>.md`
224
+ - `backend_plan_<id>_v1_<date>.md`
225
+ - `frontend_plan_<id>_v1_<date>.md`
226
+ - `website_plan_<id>_v1_<date>.md` (if relevant)
227
+ - `qa_plan_<id>_v1_<date>.md`
228
+ - Either:
229
+ - One combined Plan Packet referencing all role plans, OR
230
+ - One Plan Packet per role plan
231
+
232
+ **Gate conditions**
233
+ - Ownership respected (schema only by DB Expert, contracts only by Architect)
234
+ - Each plan includes deterministic file-level outputs
235
+ - QA plan lists executable tests (not “write tests”)
236
+
237
+ ---
238
+
239
+ ### Phase 6 — CONSENSUS on Role Plans
240
+ **Purpose**: Prevent downstream gaps and shortcuts by validating each role plan.
241
+
242
+ **Inputs**
243
+ - Role Plan Packet(s)
244
+
245
+ **Outputs**
246
+ - Consensus Packet(s) for role plans
247
+ - Patched role plans if needed
248
+
249
+ **Gate conditions (PASS)**
250
+ - All required plans are approved
251
+ - Dependencies satisfied:
252
+ - FE depends on API contracts
253
+ - BE depends on DB plan if DB exists
254
+ - QA depends on feature list + contracts
255
+
256
+ **If FAIL**
257
+ - Return only the failing plan to ROLE PLANNING (targeted iteration)
258
+
259
+ ---
260
+
261
+ ### Phase 7 — IMPLEMENTATION
262
+ **Purpose**: Build the system according to the approved plans (no drift).
263
+
264
+ **Inputs**
265
+ - Approved Architecture
266
+ - Approved Role Plans
267
+ - Approved QA plan
268
+
269
+ **Actions**
270
+ - BE implements endpoints/services/auth/validation
271
+ - DB implements migrations/models
272
+ - FE implements UI and wires to real endpoints
273
+ - Website implements site pages if in scope
274
+ - Unit tests added as defined in QA/role plans
275
+
276
+ **Outputs**
277
+ - Code changes in repo
278
+ - Build/test command logs captured (for later gates)
279
+ - Updated repo snapshot
280
+
281
+ **Gate conditions**
282
+ - Implementation matches plan (no unapproved changes)
283
+ - No placeholders/mocks unless explicitly approved
284
+
285
+ ---
286
+
287
+ ### Phase 8 — QA VALIDATION
288
+ **Purpose**: Execute QA plan and validate critical paths.
289
+
290
+ **Inputs**
291
+ - QA plan
292
+ - Repo state
293
+ - Build/test outputs
294
+
295
+ **Actions**
296
+ - Run specified tests
297
+ - Validate critical workflows end-to-end
298
+ - Produce QA report
299
+
300
+ **Outputs (required)**
301
+ - QA validation report → `/docs/role-plans/qa_validation_<id>_<date>.md`
302
+ - Any failures captured as incidents (optional early RCA trigger)
303
+
304
+ **Gate conditions (PASS)**
305
+ - All critical path tests pass
306
+ - Any known gaps are explicitly listed (should route to recovery if blocking)
307
+
308
+ ---
309
+
310
+ ### Phase 9 — REVIEW
311
+ **Purpose**: Verify the implementation matches approved plans with evidence.
312
+
313
+ **Inputs**
314
+ - Repo snapshot
315
+ - Approved plans + contracts
316
+ - QA report
317
+
318
+ **Actions**
319
+ - Reviewer checks:
320
+ - plan alignment
321
+ - evidence references
322
+ - no shortcuts
323
+ - integration wiring
324
+
325
+ **Outputs**
326
+ - Review decision doc → `/docs/consensus/review_<id>_<date>.md`
327
+ - If rejected: structured blocking list
328
+
329
+ **Gate conditions (PASS)**
330
+ - Reviewer approves with evidence
331
+ - No Constitution violations
332
+
333
+ ---
334
+
335
+ ### Phase 10 — AUDIT
336
+ **Purpose**: Holistic verification before Production Gate.
337
+
338
+ **Inputs**
339
+ - Everything above + repo snapshot + logs
340
+
341
+ **Actions (Auditor)**
342
+ - Integration audit (FE↔BE, BE↔DB)
343
+ - Config/env audit
344
+ - Tests/coverage audit
345
+ - Migration audit
346
+ - Basic security audit
347
+ - Deployment readiness audit
348
+
349
+ **Outputs (required)**
350
+ - Audit Report → `/docs/audit/audit_<id>_<date>.md`
351
+ - Audit Report schema (optional json)
352
+
353
+ **Gate conditions (PASS)**
354
+ - No P0/P1 findings open
355
+ - Deployment path exists
356
+ - No hardcoded secrets
357
+ - End-to-end wiring verified
358
+
359
+ **If FAIL**
360
+ - Enter RECOVERY_LOOP
361
+
362
+ ---
363
+
364
+ ### Phase 11 — PRODUCTION GATE
365
+ **Purpose**: Binary pass/fail “production-ready” decision.
366
+
367
+ **Inputs**
368
+ - Audit PASS
369
+ - Build/test/lint/typecheck results
370
+ - Deployment instructions present
371
+
372
+ **Required checks (minimum)**
373
+ - Build passes
374
+ - Tests pass (unit + integration as required)
375
+ - Lint/typecheck pass (as applicable)
376
+ - Migrations apply cleanly (if DB)
377
+ - Audit PASS
378
+ - No unresolved incidents
379
+
380
+ **Outputs (required)**
381
+ - Production Readiness Report → `/docs/production/production_readiness_<id>_<date>.md`
382
+ - Final verdict: PASS/FAIL
383
+
384
+ **If PASS**
385
+ - Transition to DONE (with logging + release)
386
+
387
+ **If FAIL**
388
+ - Enter RECOVERY_LOOP
389
+
390
+ ---
391
+
392
+ ## 4) Recovery Loop (FAIL → Debugger → Plan → Fix → Retest)
393
+
394
+ ### Phase 12 — RECOVERY_LOOP (conditional)
395
+ **Purpose**: Self-heal deterministically using RCA, not guesswork.
396
+
397
+ **Inputs**
398
+ - Failure evidence (logs, stack traces, failing tests, audit findings)
399
+ - All `/docs/` artifacts (Journalist record)
400
+ - Repo snapshot
401
+
402
+ **Steps**
403
+ 1) **Debugger produces RCA**
404
+ - root cause (precise)
405
+ - origin phase (architecture / role planning / implementation / config / QA)
406
+ - ownership (which role must fix)
407
+ - recommended corrective actions
408
+ - prevention suggestion
409
+
410
+ 2) **Dispatcher generates Recovery Plan**
411
+ - targeted tasks mapped to responsible role(s)
412
+ - artifacts to update (if needed)
413
+ - whether consensus required (schema/contract changes must re-consensus)
414
+
415
+ 3) **Consensus on Recovery Plan** (recommended; mandatory for architecture/schema changes)
416
+
417
+ 4) **Implement fixes** (by responsible role)
418
+
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
423
+
424
+ **Outputs (required)**
425
+ - RCA report → `/docs/incidents/rca_<id>_<date>.md`
426
+ - Recovery plan packet + consensus packet
427
+ - Updated artifacts if scope/contracts changed
428
+
429
+ **Stop conditions**
430
+ - Max recovery iterations (default: 5)
431
+ - If exceeded → STUCK state with “Stuck Report”
432
+
433
+ ---
434
+
435
+ ## 5) PASS Path: Journalist + Release Notes
436
+
437
+ ### Phase 13 — DONE (PASS)
438
+ **Purpose**: Finalize immutable documentation + release packaging.
439
+
440
+ **Actions**
441
+ - Journalist:
442
+ - logs all final Plan/Consensus/Audit/Production artifacts under `/docs/`
443
+ - updates `/docs/INDEX.md`
444
+ - Release Manager:
445
+ - produces release notes
446
+ - produces deployment instructions
447
+ - produces rollback plan
448
+ - stores under `/docs/release/`
449
+
450
+ **Outputs (required)**
451
+ - `/docs/release/release_notes_<id>_<date>.md`
452
+ - `/docs/release/deployment_<id>_<date>.md`
453
+ - `/docs/release/rollback_<id>_<date>.md`
454
+ - `/docs/INDEX.md` updated
455
+
456
+ ---
457
+
458
+ ## 6) STUCK State (Safety Valve)
459
+
460
+ If recovery iterations exceed max, Popeye must stop and output:
461
+
462
+ **Stuck Report** → `/docs/incidents/stuck_<id>_<date>.md` including:
463
+ - current failing gate
464
+ - last RCA summary
465
+ - top 3 suspected resolution paths
466
+ - what missing human input is required (if any)
467
+ - which artifacts must be updated
468
+
469
+ ---
470
+
471
+ ## 7) Non-Negotiable Rules (Autonomy Hardening)
472
+
473
+ - No skipping phases
474
+ - No “mock until later” unless explicitly approved by consensus
475
+ - Any schema/contract change requires:
476
+ - updated artifact(s)
477
+ - re-consensus
478
+ - Journalist record
479
+ - Every plan claim must be evidenced against repo snapshot
480
+ - Production readiness is binary, not “looks good”
481
+
482
+ ---
483
+
484
+ End of Spec.
@@ -0,0 +1,19 @@
1
+ # PRODUCTION READINESS SCHEMA
2
+
3
+ Required Fields:
4
+
5
+ - production_id
6
+ - timestamp
7
+ - build_status
8
+ - test_status
9
+ - lint_status
10
+ - migration_status
11
+ - audit_status
12
+ - security_status
13
+ - unresolved_blockers[]
14
+ - final_verdict (PASS/FAIL)
15
+
16
+ PASS allowed only if:
17
+ - All statuses green
18
+ - No unresolved blockers
19
+ - Audit PASS
@@ -0,0 +1,40 @@
1
+ # Skill: QA TESTER
2
+ Role Type: Quality Authority
3
+
4
+ ---
5
+
6
+ ## Objective
7
+
8
+ Design and enforce test coverage BEFORE and AFTER implementation.
9
+
10
+ ---
11
+
12
+ ## Responsibilities
13
+
14
+ - Create test plan from Master Plan
15
+ - Define critical paths
16
+ - Define integration tests
17
+ - Define regression suite
18
+ - Validate build
19
+
20
+ ---
21
+
22
+ ## Required Outputs
23
+
24
+ - Test plan document
25
+ - Unit test requirements
26
+ - Integration test requirements
27
+ - Edge case list
28
+
29
+ ---
30
+
31
+ ## Anti-Shortcut Rules
32
+
33
+ - No generic "write tests"
34
+ - Must reference exact endpoints/components
35
+ - Must define expected behavior
36
+
37
+ ---
38
+
39
+ Definition of Done:
40
+ All critical paths covered and validated.