Skip to content

Commit 8c2e462

Browse files
OgeonX-AiAitomates
andauthored
docs: document enterprise testing coverage gates (#18)
* docs: document enterprise testing coverage gates * fix: patch legacy mcp-server qs advisory --------- Co-authored-by: Kim Harjamäki <kim.harjamaki@prosimo.fi>
1 parent abbff59 commit 8c2e462

5 files changed

Lines changed: 101 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ flowchart LR
5858

5959
- [Portfolio proof notes](./docs/portfolio-proof.md)
6060
- [Architecture spec](./docs/promptimprover-autogen-architecture-spec.md)
61+
- [Operator testing guide](./docs/operator-testing.md)
62+
- [Enterprise release gates](./docs/enterprise-release-gates.md)
6163
- [`universal-refiner/package.json`](./universal-refiner/package.json)
6264
- [`universal-refiner/tests`](./universal-refiner/tests)
6365

docs/enterprise-release-gates.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Passing unit tests alone does not prove that PromptImprover is operationally ready. A release is eligible only when every required gate below passes.
44

5+
For exact operator commands, current evidence, and the gate-to-CI mapping, see [Operator Testing Guide](./operator-testing.md).
6+
57
## Quality Target
68

79
- All owned deterministic production logic reaches 100% statements, branches, functions, and lines.
@@ -39,6 +41,10 @@ Initial high-risk gaps include MCP dispatcher behavior, background autonomy, tem
3941

4042
The enforced ratchet is 100% statements, branches, functions, and lines. It cannot be lowered without an approved exception.
4143

44+
## Current Verified Release Baseline
45+
46+
The current release gate baseline is documented in [Operator Testing Guide](./operator-testing.md#current-verified-baseline). At the time this page was updated, `master` commit `abbff59cc6d62b734912e2a98c61ae3dc1d4c6b8` had a successful GitHub CI run (`28030976193`) and a local `npm.cmd run release:verify` pass with 51 test files, 382 tests, and 100% statements, branches, functions, and lines.
47+
4248
## Operator Recovery
4349

4450
Build before invoking the recovery commands. Both operations run SQLite integrity checks and fail closed:

docs/operator-testing.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,69 @@
22

33
Use this guide to verify PromptImprover from a clean Windows operator session.
44

5+
## Current Verified Baseline
6+
7+
This is the latest known-good baseline at the time this guide was updated:
8+
9+
| Evidence | Value |
10+
|---|---|
11+
| Date | 2026-06-23 |
12+
| Branch | `master` |
13+
| Commit | `abbff59cc6d62b734912e2a98c61ae3dc1d4c6b8` |
14+
| GitHub CI run | `28030976193` |
15+
| CI result | `success` |
16+
| Local release gate | `npm.cmd run release:verify` passed |
17+
| Local test count | 51 test files, 382 tests |
18+
| Coverage | 100% statements, branches, functions, and lines |
19+
| Local runtime health | `/api/health` returned `runtime.status: online` |
20+
| Local semantic provider | `http://localhost:11434`, models `gemma3:12b` and `gemma3` |
21+
22+
Treat this table as evidence, not a permanent guarantee. When any product behavior changes, rerun the gate and update this baseline.
23+
24+
## Coverage Policy
25+
26+
Coverage is enforced by `universal-refiner/vitest.config.ts`:
27+
28+
| Metric | Required |
29+
|---|---:|
30+
| Statements | 100% |
31+
| Branches | 100% |
32+
| Functions | 100% |
33+
| Lines | 100% |
34+
35+
The coverage include set is owned deterministic production logic under:
36+
37+
- `hooks/lib/**/*.ts`
38+
- `src/**/*.ts`
39+
40+
The only current exclusion is generated version metadata:
41+
42+
- `src/core/generated-version.ts`
43+
44+
Do not lower coverage thresholds to merge a feature. If a defect is reproduced, add a regression test at the owning boundary before fixing or merging.
45+
46+
## Release Gate Matrix
47+
48+
| Gate | Command | Scope | CI job |
49+
|---|---|---|---|
50+
| Clean install | `npm ci` | Dependency graph from lockfile | All jobs |
51+
| Build | `npm.cmd run build` | TypeScript and dashboard copy | All jobs |
52+
| Coverage | `npm.cmd run test:coverage` | Unit and integration tests with 100% thresholds | `build-and-test`, `windows` |
53+
| MCP acceptance | `npm.cmd run test:acceptance` | Advertised MCP tool schemas and dispatcher paths | `acceptance`, `windows` |
54+
| Semantic fallback | `npm.cmd run acceptance:semantic` | local provider ordering, fallback, malformed response, timeout, outage | `acceptance`, `windows` |
55+
| Tracked turn | `npm.cmd run acceptance:tracked-turn` | prompt ID and SQLite outcome linkage | `acceptance`, `windows` |
56+
| Stress tests | `npm.cmd run test:stress` | concurrent and long-running behavior | `stress`, `windows` |
57+
| EventStore stress | `npm.cmd run stress:event-store` | SQLite contention and multi-process behavior | `stress`, `windows` |
58+
| Abrupt recovery | `npm.cmd run recovery:event-store:abrupt` | interrupted writer recovery | `stress`, `windows` |
59+
| Soak | `npm.cmd run stress:event-store:soak` | long-duration EventStore behavior | `stress`, `windows` |
60+
| Production audit | `npm.cmd run security:audit` | production dependency vulnerabilities, high or above | `supply-chain` |
61+
| Full audit | `npm.cmd run security:audit:all` | production and development dependency vulnerabilities, high or above | `supply-chain` |
62+
| Secret scan | `npm.cmd run security:secrets` | committed credential patterns | `supply-chain` |
63+
| Package dry-run | `npm.cmd run package:check` | npm package contents | `supply-chain` |
64+
| Package runtime | `npm.cmd run acceptance:package-runtime` | packed tarball install plus `/api/health` smoke | `supply-chain`, `windows` |
65+
| Release gate | `npm.cmd run release:verify` | local aggregate of the gates above | local operator |
66+
| CI release gate | GitHub Actions `release-gate` job | all enterprise jobs must pass before merge | `release-gate` |
67+
568
## 1. Enter The Active Package
669

770
```powershell
@@ -27,6 +90,8 @@ Expected result:
2790
- Package dry-run passes.
2891
- `acceptance:package-runtime` installs the packed tarball into a temporary global prefix and serves `/api/health`.
2992

93+
If this command fails, do not bypass it. Fix the failing behavior or document an explicit, reviewed exception in this file and in `docs/enterprise-release-gates.md`.
94+
3095
## 3. Check Global MCP Registration
3196

3297
```powershell
@@ -151,3 +216,22 @@ Expected result:
151216
- `release-gate` passes.
152217

153218
Remote CI is the authoritative proof for Linux and Windows clean-checkout behavior.
219+
220+
## 9. Document New Tests
221+
222+
Every production feature or bug fix should update this guide when it changes how the product is verified.
223+
224+
Use this checklist:
225+
226+
- Add or update tests at the smallest useful boundary.
227+
- Add acceptance or stress coverage for cross-process, CLI, MCP, SQLite, or packaging behavior.
228+
- Update the release gate matrix when a new script becomes part of the release contract.
229+
- Update the current verified baseline after the branch is merged and CI is green.
230+
- Keep limitations explicit. A green gate proves declared checks passed; it does not prove unknown future failures are impossible.
231+
232+
## Known Limitations
233+
234+
- Live Gemma verification depends on a local or external OpenAI-compatible model endpoint. The deterministic release gate covers provider fallback without requiring the operator's live model server.
235+
- MCP tool availability depends on the hosting client exposing a healthy MCP transport. If a live `lint_prompt` or refinement call closes its transport, restart the MCP runtime and rerun the global registration doctor before treating the CLI as healthy.
236+
- External CLI hook behavior depends on each client supporting hooks and trusting the current workspace. Codex currently uses MCP-first operation rather than transparent prompt lifecycle interception.
237+
- "100% coverage" means every currently included deterministic production line, branch, statement, and function is covered. It does not mean every possible integration, environment, timing, or future regression is impossible.

mcp-server/package-lock.json

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

universal-refiner/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ See `.universal-refiner.example.json` for an annotated template.
101101
npm run release:verify
102102
```
103103

104-
Runs build, 100% test coverage, MCP acceptance, semantic fallback, stress/soak, and audit checks.
104+
Runs build, 100% test coverage, MCP acceptance, semantic fallback, stress/soak, audit checks, package dry-run, and package-runtime smoke testing. See the repo-level [operator testing guide](../docs/operator-testing.md) and [enterprise release gates](../docs/enterprise-release-gates.md) for the full release contract.
105105

106106
## Security
107107

0 commit comments

Comments
 (0)