Skip to content

Commit ffb910f

Browse files
committed
chore: close remaining audit and instruction gaps
1 parent 6a9176c commit ffb910f

5 files changed

Lines changed: 193 additions & 140 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ jobs:
136136
cache-dependency-path: universal-refiner/package-lock.json
137137
- run: npm ci --no-fund
138138
- run: npm run security:audit
139+
- run: npm run security:audit:all
139140
- run: npm run security:secrets
140141
- run: npm run build
141142
- run: npm run package:check

CLAUDE.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# PromptImprover
2+
3+
MCP server middleware for prompt governance. The active implementation is the Universal Refiner package, which provides prompt refinement, local memory, commit-correlated learning, dashboard review workflows, and evidence capture for agent runs.
4+
5+
## Project Hierarchy
6+
7+
This project has a `context.md` tree. Always read the nearest context file before changing files in a directory.
8+
9+
- Root: `context.md` - project-wide mandates and submodule index.
10+
- `universal-refiner/context.md` - active MCP server, refinement engine, history, learning, hooks, and dashboard.
11+
- `gemini-extension/context.md` - Gemini CLI integration.
12+
- `mcp-server/context.md` - legacy standalone MCP server.
13+
- `docs/context.md` - architecture specs, roadmaps, and release-gate documentation.
14+
- `archive/context.md` - deprecated code and historical experiments.
15+
16+
## Tech Stack
17+
18+
| Layer | Technology |
19+
|---|---|
20+
| Language | TypeScript, strict mode |
21+
| Runtime | Node.js >= 22 |
22+
| MCP transport | stdio via `@modelcontextprotocol/sdk` |
23+
| Storage | SQLite via `better-sqlite3` |
24+
| Build | `tsc` plus dashboard asset copy |
25+
| Test | Vitest |
26+
27+
## Active Entry Points
28+
29+
| Path | Purpose |
30+
|---|---|
31+
| `universal-refiner/src/` | Active source code |
32+
| `universal-refiner/dist/src/index.js` | Built MCP server used by global CLI registrations |
33+
| `universal-refiner/hooks/` | Claude/Gemini hook runtime and fragments |
34+
| `universal-refiner/scripts/operations/register-global.ps1` | Global Codex, Claude, and Gemini registration doctor |
35+
| `universal-refiner/scripts/acceptance/` | Real-process and package-runtime acceptance gates |
36+
37+
## Standard Workflow
38+
39+
1. Read the relevant `context.md`, `AGENTS.md`, `GEMINI.md`, and this file before changing behavior.
40+
2. Prefer the active `universal-refiner` package for new work. Avoid expanding legacy `mcp-server` unless the task explicitly targets it.
41+
3. Keep changes scoped and preserve unrelated user work.
42+
4. After code or package changes in `universal-refiner`, run the strongest proportionate gate. For broad hardening, use:
43+
44+
```powershell
45+
cd C:\PersonalRepo\portfolio\Promptimprover\universal-refiner
46+
npm.cmd run release:verify
47+
```
48+
49+
5. Restart the local background runtime after rebuilding:
50+
51+
```powershell
52+
$repo = 'C:\PersonalRepo\portfolio\Promptimprover\universal-refiner'
53+
$env:PROMPT_REFINER_BACKGROUND = 'true'
54+
Start-Process -WindowStyle Hidden -FilePath node -ArgumentList (Join-Path $repo 'dist\src\index.js') -WorkingDirectory $repo
55+
```
56+
57+
6. Smoke-test runtime health:
58+
59+
```powershell
60+
Invoke-RestMethod http://127.0.0.1:3000/api/health
61+
```
62+
63+
## Release Gates
64+
65+
The authoritative local gate is:
66+
67+
```powershell
68+
npm.cmd run release:verify
69+
```
70+
71+
It includes build, 100% coverage, MCP acceptance, semantic fallback, tracked-turn acceptance, stress/recovery/soak, production and full audit checks, secret scanning, package dry-run, and packaged runtime startup smoke.
72+
73+
## Global Registration
74+
75+
Use the registration doctor after changes that affect global MCP wiring:
76+
77+
```powershell
78+
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\register-global.ps1 -Check
79+
```
80+
81+
Apply only when the check reports real drift:
82+
83+
```powershell
84+
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\register-global.ps1 -Apply
85+
```
86+
87+
The expected global MCP registrations are:
88+
89+
- Codex: `prompt-refiner`, `obsidian`
90+
- Claude Code: `prompt-refiner`, `obsidian`, plus PromptImprover hooks
91+
- Gemini: `prompt-refiner`, `obsidian`
92+
93+
## Security
94+
95+
- Never commit secrets, tokens, credentials, private prompts, or raw sensitive payloads.
96+
- Treat `npm audit` failures as defects. Production audit is mandatory; full audit is also part of the release gate.
97+
- If a plaintext token was ever present in local configuration, remove it and rotate it externally.

docs/enterprise-release-gates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Passing unit tests alone does not prove that PromptImprover is operationally rea
1919
6. SQLite restart, migration, backup/restore, contention, and multi-process tests pass.
2020
7. Claude and Gemini hook pre/post flows pass; Codex MCP-first flow passes.
2121
8. Dashboard API security, review mutation, health telemetry, and browser smoke flows pass.
22-
9. Dependency audit reports no known production vulnerabilities.
22+
9. Dependency audit reports no known production or development vulnerabilities at high severity or above.
2323
10. Package dry-run plus `acceptance:package-runtime` global installation, runtime startup, and health smoke tests pass.
2424
11. Secret scanning finds no committed credentials.
2525
12. Linux and Windows CI jobs pass before merge.

0 commit comments

Comments
 (0)