|
| 1 | +# Enterprise Release Gates |
| 2 | + |
| 3 | +Passing unit tests alone does not prove that PromptImprover is operationally ready. A release is eligible only when every required gate below passes. |
| 4 | + |
| 5 | +## Quality Target |
| 6 | + |
| 7 | +- All owned deterministic production logic reaches 100% statements, branches, functions, and lines. |
| 8 | +- Coverage exclusions are limited to generated artifacts. Bootstrap and integration behavior must be validated through acceptance or end-to-end tests. |
| 9 | +- The coverage threshold is ratcheted upward as gaps close. It must never decrease without an approved, documented exception. |
| 10 | +- Every reproduced defect receives a regression test at the owning boundary. |
| 11 | + |
| 12 | +## Required Gates |
| 13 | + |
| 14 | +1. `npm ci` succeeds from a clean workspace. |
| 15 | +2. TypeScript build succeeds with strict type checking. |
| 16 | +3. Unit and integration tests pass with the enforced coverage threshold. |
| 17 | +4. Every advertised MCP tool schema and dispatcher path passes acceptance tests. |
| 18 | +5. Local semantic-provider primary, fallback, malformed-response, timeout, and outage paths pass. |
| 19 | +6. SQLite restart, migration, backup/restore, contention, and multi-process tests pass. |
| 20 | +7. Claude and Gemini hook pre/post flows pass; Codex MCP-first flow passes. |
| 21 | +8. Dashboard API security, review mutation, health telemetry, and browser smoke flows pass. |
| 22 | +9. Dependency audit reports no known production vulnerabilities. |
| 23 | +10. Package dry-run, global installation, runtime startup, and post-restart smoke tests pass. |
| 24 | +11. Secret scanning finds no committed credentials. |
| 25 | +12. Linux and Windows CI jobs pass before merge. |
| 26 | + |
| 27 | +## Current Coverage Baseline |
| 28 | + |
| 29 | +The first measured baseline on June 14, 2026 exposed substantial untested production behavior: |
| 30 | + |
| 31 | +| Metric | Baseline | Target | |
| 32 | +|---|---:|---:| |
| 33 | +| Statements | 66.33% | 100% | |
| 34 | +| Branches | 61.95% | 100% | |
| 35 | +| Functions | 79.92% | 100% | |
| 36 | +| Lines | 68.09% | 100% | |
| 37 | + |
| 38 | +Initial high-risk gaps include MCP dispatcher behavior, background autonomy, template generation, prompt optimization, configuration failure paths, and operational dashboard branches. |
| 39 | + |
| 40 | +The enforced ratchet is currently 86% statements, 76% branches, 93% functions, and 88% lines. It cannot be lowered without an approved exception. |
| 41 | + |
| 42 | +## Operator Recovery |
| 43 | + |
| 44 | +Build before invoking the recovery commands. Both operations run SQLite integrity checks and fail closed: |
| 45 | + |
| 46 | +```powershell |
| 47 | +npm.cmd run db:backup -- C:\backups\promptimprover-events.db |
| 48 | +npm.cmd run db:restore -- C:\backups\promptimprover-events.db |
| 49 | +``` |
| 50 | + |
| 51 | +Stop the PromptImprover runtime before restoring a backup. |
| 52 | + |
| 53 | +## Meaning Of Green |
| 54 | + |
| 55 | +A green release pipeline means all declared gates passed in the tested environments. It substantially increases confidence but does not claim that unknown failures are impossible. Production incidents must become new automated regression gates. |
0 commit comments