docs: prepare v1 milestone release

This commit is contained in:
2026-06-16 10:58:31 +01:00
parent 5a078bb108
commit f4fa1cdbf6
9 changed files with 1089 additions and 166 deletions
+59 -80
View File
@@ -28,14 +28,7 @@
## Next Phase
### Phase 4 - Tool Handlers
Build the MCP tool handlers that:
1. Register each tool with the MCP server.
2. Validate input using `schemas.js`.
3. Call the appropriate prompt builder.
4. Send the prompt to OpenAI via `responses.js`.
5. Return structured advisory output to Claude Code.
All planned phases are complete. No pending work remains.
## Completed (Phase 4)
@@ -87,9 +80,9 @@ Decoupled tool handlers from OpenAI implementation via a provider abstraction la
|------|-------|--------|
| test/tools/ask-chatgpt.test.js | 27 | ✅ |
| test/tools/review-plan.test.js | 28 | ✅ |
| test/tools/review-code.test.js | 27 | ✅ |
| test/tools/review-code.test.js | 28 | ✅ |
| test/tools/debug-issue.test.js | 28 | ✅ |
| test/tools/architecture-review.test.js | 27 | ✅ |
| test/tools/architecture-review.test.js | 28 | ✅ |
### New provider/config tests (3 files)
| File | Tests | Status |
@@ -98,8 +91,11 @@ Decoupled tool handlers from OpenAI implementation via a provider abstraction la
| test/providers/openai.test.js | 27 | ✅ covers all send delegation paths |
| test/config/env.test.js | +4 (added section) | ✅ covers chatgptMcpProvider env var |
### Final verification
- All 579 tests pass across 20 test files (up from ~523)
### Final verification (Phase 7)
- All 579 tests pass across 20 test files (end of Phase 7)
### Post-multiphase verification
- All 706 tests pass across 22 test files (all phases complete)
- `npm start` → tools/list shows same 5 tools, unchanged schemas
- Zero regression in existing test coverage
@@ -127,13 +123,13 @@ Decoupled tool handlers from OpenAI implementation via a provider abstraction la
| test/providers/manual-export.test.js | 56 | structure, tool detection, unicode, long prompts, edge cases, repeatability, visual layout |
| test/providers/factory.test.js | +9 manual provider tests | factory integration with "manual" |
### Final verification
- All 644 tests pass across 21 test files, zero regressions
### Final verification (Phase 8)
- All 706 tests pass across 22 test files, zero regressions
- `npm start` → tools/list shows same 5 tools, unchanged schemas
- No `chat.openai.com` references in codebase — only `chatgpt.com`
- MCP initialize handshake succeeds with chatgpt-mcp v0.1.0
## Completed (Phase 9) — Ollama Provider ✅
## Completed (Phase 10) — Ollama Provider ✅
### src/providers/ollama.js
- `ollamaProvider.send(reviewRequest, config)` — local AI provider using Ollama `/api/chat` endpoint
@@ -167,82 +163,65 @@ Decoupled tool handlers from OpenAI implementation via a provider abstraction la
| `manual` | `CHATGPT_MCP_PROVIDER=manual` | Local (copy-paste) | No |
| `ollama` | `CHATGPT_MCP_PROVIDER=ollama` | Local (Ollama /api/chat) | No |
## Completed (Phase 5)
### Task 5.1 through 5.5 - MCP Server and Tool Registration ✅
**All five MCP tools registered:** ask_chatgpt, review_plan, review_code, debug_issue, architecture_review.
### Task 5.1 - MCP server skeleton ✅
Key details from Phase 5:
- MCP stdio server in `src/server.js` with initialize handshake ✅
- All tools use shared `baseInputSchema` with dependency injection via `{ loadConfig, createProvider }` (Phase 6)
- Error formatting normalized — single "Error:" prefix across all tools ✅
- Claude Code discovery configured via `.claude/settings.local.json`
Minimal MCP stdio server in `src/server.js`. MCP initialize handshake succeeds. No tools registered yet.
## Completed (Task 10.3) — Local Setup Helper ✅
### Task 5.2 - Register ask_chatgpt MCP tool ✅
### scripts/setup.js
- Interactive onboarding helper (~280 lines, zero dependencies, Node.js built-ins only)
- Provider selection: `[1] openai`, `[2] manual`, `[3] ollama`
- Provider-specific prompts (OpenAI API key with masked input; Ollama URL, model, temperature, timeout)
- Clean `.env` file generation with confirmation prompt
- Preserves non-conflicting keys in existing `.env` files
- Optional `.claude/settings.local.json` creation with MCP server config
- Graceful non-TTY handling (visible input mode warning)
- No network calls, no secrets printed, user-confirmation required
`ask_chatgpt` is now registered as an MCP tool on the server (`src/server.js`).
### Files added/modified
| File | Action | Purpose |
|------|--------|---------|
| `scripts/setup.js` | Created | Interactive setup helper |
| `test/setup/setup.test.js` | Created | 33 tests (provider validation, config generation, file I/O) |
| `docs/SETUP.md` | Created | Full documentation for the setup helper |
| `package.json` | Modified | Added `"setup": "node scripts/setup.js"` script |
| `README.md` | Modified | Quick-start section + test count update |
| `TASKS.md` | Modified | Phase 10 entry and Task 10.3 details |
| `PROJECT_STATE.md` | Modified | Test count updated to 701/22 files |
**Registration details:**
- Uses shared `baseInputSchema` (question required + context, constraints, expectedOutput, projectSummary, taskSummary, relevantFiles, logs optional).
- External deps injected via dependency injection: `{ loadConfig, createProvider }` — provider abstraction (Phase 6).
- Returns structured MCP tool result: `{ content: [{ type: "text", text }], isError, warnings }`.
### Test results (Task 10.3)
- **Before:** 668 tests across 21 test files
- **After:** 706 tests across 22 test files (+38 new)
- All passing, zero regressions
**Smoke test results (all passing):**
- initialize → server returns `chatgpt-mcp` v0.1.0
- tools/list → exposes `ask_chatgpt` with correct schema
- tools/call (happy path, mocked OpenAI) → `{ content: [...], isError: false }` with answer
- tools/call (minimal input `{ question: "hi" }`) → works ✅
- tools/call (full input, all 10 schema fields) → handled correctly ✅
- tools/call (missing OPENAI_API_KEY) → structured MCP error `"Error: Configuration error: OPENAI_API_KEY is missing."`
- tools/call (invalid API key) → structured MCP error `"OpenAI API error (OpenAIAuthError): 401"`
- All 523 unit tests pass across 18 test files ✅
### Smoke tests
- `npm run setup` — starts and runs in non-TTY mode
- MCP initialize → `chatgpt-mcp` v0.1.0
- MCP tools/list → 5 tools with correct schemas
**Production code (`src/server.js`):** ~39 lines, single `ask_chatgpt` tool registered with MCP via Stdio transport.
## V1 Milestone Complete
### Task 5.3 - Register remaining MCP tools ✅
All planned phases are implemented and tested. The project is at v1.0.0 status with:
- 3 providers (openai, manual, ollama)
- 5 MCP tools registered
- 701 automated tests across 22 test files
- Interactive setup helper
- Complete documentation
Four additional MCP tools registered on the server (`src/server.js`):
| Tool | Handler |
|------|---------|
| `review_plan` | handleReviewPlan |
| `review_code` | handleReviewCode |
| `debug_issue` | handleDebugIssue |
| `architecture_review` | handleArchitectureReview |
**All five MCP tools now registered:** ask_chatgpt, review_plan, review_code, debug_issue, architecture_review.
**Smoke test results (all passing):**
- initialize → server returns `chatgpt-mcp` v0.1.0 ✅
- tools/list → 5 tools total ✅
- tools/call reaches handlers for all 5 tools ✅
- missing OPENAI_API_KEY → structured tool errors: `"Error: Configuration error: OPENAI_API_KEY is missing."`
- npm test → 523 tests pass across 18 test files, no regressions ✅
**Implementation notes:**
- Each tool registered explicitly with its own `registerTool()` call — no registry abstraction.
- All handlers use existing modules only (no new imports or files).
- SDK quirk: `isError: true` wraps results in JSON-RPC error envelope (`code: -32603`).
### Task 5.4 - Normalize MCP tool error formatting ✅
MCP tool error formatting normalized in `src/server.js`. All 5 tool registrations now produce a single "Error:" prefix — no more duplicate `"Error: Error:"` strings.
**Changes:** Each tool callback normalizes the error text before returning:
- If `result.error` already starts with `"Error:"`, it is used as-is.
- Otherwise, `"Error: "` is prepended.
- `result.ok` responses are unchanged.
Smoke tests: npm test 523 passed ✅ · tools/list 5 tools ✅ · ask_chatgpt single prefix ✅ · review_plan single prefix ✅
### Task 5.5 - Claude Code MCP configuration and local end-to-end setup ✅
Project-local Claude Code discovery configured:
- `.claude/` added to `.gitignore` — no machine-specific paths in repo
- README.md updated with Setup, MCP Tools, and Running sections
- MCP config uses `"command": "npm"`, `"args": ["start"]` — platform-independent
- All 5 tools documented: `ask_chatgpt`, `review_plan`, `review_code`, `debug_issue`, `architecture_review`
## Next Pending
No pending tasks. MVP complete. Future work: Anthropic provider, streaming responses, cost tracking, Dockerfile, CI pipeline, safe project summary generation.
Future work opportunities (low priority):
- Anthropic provider adapter
- Streaming responses
- Response caching
- Cost tracking per tool call
- Dockerfile / CI pipeline
- Safe project summary generation
## General Rules