diff --git a/SPECS/ARCHIVE/FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas/FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas.md b/SPECS/ARCHIVE/FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas/FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas.md new file mode 100644 index 00000000..4828f371 --- /dev/null +++ b/SPECS/ARCHIVE/FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas/FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas.md @@ -0,0 +1,78 @@ +# PRD: FU-P12-T1-1 — Remove or document `MCPInitializeParams` in schemas + +**Created:** 2026-02-18 +**Priority:** P3 +**Branch:** `codex/feature/FU-P12-T1-1-remove-or-document-mcpinitializeparams` +**Status:** PLAN + +--- + +## 1. Problem Statement + +`MCPInitializeParams` exists in `src/mcpbridge_wrapper/schemas.py` but has no +usage in runtime code or tests. This creates unnecessary schema surface and can +mislead future maintainers into thinking there is a dedicated initialize-params +model contract in active use. + +--- + +## 2. Scope + +### In Scope +- Remove `MCPInitializeParams` if it is unused and not required for compatibility. +- Ensure existing request parsing (`MCPParams.clientInfo`) remains unchanged. +- Run full project quality gates and capture results. + +### Out of Scope +- Any behavior changes to initialize request handling. +- Broader schema refactors unrelated to this unused model. + +--- + +## 3. Deliverables + +1. `src/mcpbridge_wrapper/schemas.py` +- Remove the unused `MCPInitializeParams` model and related dead comments. + +2. Validation evidence +- Search evidence confirming no remaining references. +- Full quality gate results in validation report. + +3. `SPECS/INPROGRESS/FU-P12-T1-1_Validation_Report.md` +- Record pass/fail outcomes for required checks. + +--- + +## 4. Acceptance Criteria + +- [ ] `MCPInitializeParams` is removed or has a clear, tested usage. +- [ ] `pytest` passes. +- [ ] `ruff check src/` passes. +- [ ] `mypy src/` passes. +- [ ] `pytest --cov` reports coverage >= 90%. + +--- + +## 5. Dependencies + +- P12-T1 ✅ + +--- + +## 6. Risks and Mitigations + +- **Risk:** Hidden imports of `MCPInitializeParams` outside obvious call sites. + - **Mitigation:** Run repository-wide search and full test/type/lint gates. + +--- + +## 7. Validation Plan + +1. Remove model definition from `schemas.py`. +2. Confirm no references remain with `rg "MCPInitializeParams"`. +3. Run required quality gates and record outcomes. + + +--- +**Archived:** 2026-02-18 +**Verdict:** PASS diff --git a/SPECS/ARCHIVE/FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas/FU-P12-T1-1_Validation_Report.md b/SPECS/ARCHIVE/FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas/FU-P12-T1-1_Validation_Report.md new file mode 100644 index 00000000..e0a1b158 --- /dev/null +++ b/SPECS/ARCHIVE/FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas/FU-P12-T1-1_Validation_Report.md @@ -0,0 +1,37 @@ +# Validation Report — FU-P12-T1-1 + +**Task:** FU-P12-T1-1 — Remove or document `MCPInitializeParams` in schemas +**Date:** 2026-02-18 +**Verdict:** PASS + +## Scope + +- Removed unused `MCPInitializeParams` model from + `src/mcpbridge_wrapper/schemas.py`. +- Verified runtime/test code has no remaining symbol references. + +## Evidence + +- Reference scan: + - `rg -n "MCPInitializeParams" src tests` + - Result: no matches. + +## Required Quality Gates + +- `pytest` + - Result: **PASS** (`582 passed, 5 skipped, 2 warnings`) +- `ruff check src/` + - Result: **PASS** (`All checks passed!`) +- `mypy src/` + - Result: **PASS** (`Success: no issues found in 18 source files`) +- `pytest --cov` + - Result: **PASS** (`582 passed, 5 skipped, 2 warnings`; total coverage **92.18%**, threshold 90%) + +## Acceptance Criteria Status + +- [x] `MCPInitializeParams` is either removed or has a clear, tested usage. +- [x] `pytest` suite remains green. + +## Notes + +- Existing third-party deprecation warnings from `websockets`/`uvicorn` were observed during tests and are unrelated to this task. diff --git a/SPECS/ARCHIVE/INDEX.md b/SPECS/ARCHIVE/INDEX.md index f0630794..2f475bdd 100644 --- a/SPECS/ARCHIVE/INDEX.md +++ b/SPECS/ARCHIVE/INDEX.md @@ -1,6 +1,6 @@ # mcpbridge-wrapper Tasks Archive -**Last Updated:** 2026-02-18 (REVIEW_fu_bug_t7_1_pending_methods_cap) +**Last Updated:** 2026-02-18 (REVIEW_fu_p12_t1_1_mcpinitializeparams_archived) ## Archived Tasks @@ -115,6 +115,7 @@ | FU-P13-T2-1 | [FU-P13-T2-1_Replace_run_forever_polling_with_Event_wait/](FU-P13-T2-1_Replace_run_forever_polling_with_Event_wait/) | 2026-02-18 | PASS | | FU-P13-T2-2 | [FU-P13-T2-2_Move_PID_file_write_to_after_successful_upstream_launch/](FU-P13-T2-2_Move_PID_file_write_to_after_successful_upstream_launch/) | 2026-02-18 | PASS | | FU-BUG-T7-1 | [FU-BUG-T7-1_Cap_pending_methods_map_to_guard_unbounded_growth/](FU-BUG-T7-1_Cap_pending_methods_map_to_guard_unbounded_growth/) | 2026-02-18 | PASS | +| FU-P12-T1-1 | [FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas/](FU-P12-T1-1_Remove_or_document_MCPInitializeParams_in_schemas/) | 2026-02-18 | PASS | ## Historical Artifacts @@ -193,6 +194,7 @@ | [REVIEW_FU-P13-T2-1_event_wait_shutdown.md](_Historical/REVIEW_FU-P13-T2-1_event_wait_shutdown.md) | Review report for FU-P13-T2-1 | | [REVIEW_FU-P13-T2-2_pid_write_order.md](_Historical/REVIEW_FU-P13-T2-2_pid_write_order.md) | Review report for FU-P13-T2-2 | | [REVIEW_fu_bug_t7_1_pending_methods_cap.md](_Historical/REVIEW_fu_bug_t7_1_pending_methods_cap.md) | Review report for FU-BUG-T7-1 | +| [REVIEW_FU-P12-T1-1_mcpinitializeparams.md](_Historical/REVIEW_FU-P12-T1-1_mcpinitializeparams.md) | Review report for FU-P12-T1-1 | ## Archive Log @@ -340,3 +342,5 @@ | 2026-02-18 | FU-P13-T2-2 | Archived REVIEW_FU-P13-T2-2_pid_write_order report | | 2026-02-18 | FU-BUG-T7-1 | Archived Cap_pending_methods_map_to_guard_unbounded_growth (PASS) | | 2026-02-18 | FU-BUG-T7-1 | Archived REVIEW_fu_bug_t7_1_pending_methods_cap report | +| 2026-02-18 | FU-P12-T1-1 | Archived Remove_or_document_MCPInitializeParams_in_schemas (PASS) | +| 2026-02-18 | FU-P12-T1-1 | Archived REVIEW_FU-P12-T1-1_mcpinitializeparams report | diff --git a/SPECS/ARCHIVE/_Historical/REVIEW_FU-P12-T1-1_mcpinitializeparams.md b/SPECS/ARCHIVE/_Historical/REVIEW_FU-P12-T1-1_mcpinitializeparams.md new file mode 100644 index 00000000..7ef9c522 --- /dev/null +++ b/SPECS/ARCHIVE/_Historical/REVIEW_FU-P12-T1-1_mcpinitializeparams.md @@ -0,0 +1,34 @@ +## REVIEW REPORT — FU-P12-T1-1 MCPInitializeParams cleanup + +**Scope:** origin/main..HEAD +**Files:** 6 + +### Summary Verdict +- [x] Approve +- [ ] Approve with comments +- [ ] Request changes +- [ ] Block + +### Critical Issues +- None. + +### Secondary Issues +- None. + +### Architectural Notes +- Removing unused `MCPInitializeParams` reduces schema surface area without + changing initialize-handshake behavior (`MCPParams.clientInfo` remains the + active contract). +- Archive bookkeeping and task-tracking updates are consistent with current + FLOW conventions. + +### Tests +- Full quality gates were executed during EXECUTE: + - `pytest` (582 passed, 5 skipped) + - `ruff check src/` (pass) + - `mypy src/` (pass) + - `pytest --cov` (92.18%, threshold 90%) + +### Next Steps +- No actionable findings. +- FOLLOW-UP step is skipped per FLOW rules. diff --git a/SPECS/INPROGRESS/next.md b/SPECS/INPROGRESS/next.md index 3c2d1fc2..508ee001 100644 --- a/SPECS/INPROGRESS/next.md +++ b/SPECS/INPROGRESS/next.md @@ -2,15 +2,15 @@ ## Recently Archived +- 2026-02-18 — FU-P12-T1-1: Remove or document `MCPInitializeParams` in schemas (PASS) - 2026-02-18 — FU-BUG-T7-1: Cap `pending_methods` map to guard against unbounded growth (PASS) - 2026-02-18 — FU-P13-T2-2: Move PID file write to after successful upstream launch (PASS) - 2026-02-18 — FU-P13-T2-1: Replace run_forever() polling loop with asyncio.Event-based wait (PASS) - 2026-02-18 — FU-P13-T4-2: Implement or remove reconnect parameter in BrokerProxy (PASS) - 2026-02-18 — FU-P13-T4-1: Fix asyncio.get_event_loop() deprecation in BrokerProxy (PASS) -- 2026-02-18 — P13-T6: Document broker mode configuration, migration, and rollback (PASS) ## Suggested Next Tasks - P13-T5 follow-up — Complete interactive prompt verification in a desktop session (P1) -- FU-P12-T1-1 — Remove or document `MCPInitializeParams` in schemas (P3) - FU-P12-T1-2 — Add code comment clarifying stdin-only client capture in `on_request` (P3) +- FU-P12-T3-2 — Add `error_code` column to audit CSV export (P3) diff --git a/SPECS/Workplan.md b/SPECS/Workplan.md index f296024a..bafb26c7 100644 --- a/SPECS/Workplan.md +++ b/SPECS/Workplan.md @@ -2203,7 +2203,8 @@ Phase 9 Follow-up Backlog --- -#### FU-P12-T1-1: Remove or document `MCPInitializeParams` in schemas +#### ✅ FU-P12-T1-1: Remove or document `MCPInitializeParams` in schemas +- **Status:** ✅ Completed (2026-02-18) - **Description:** `MCPInitializeParams` was added to `schemas.py` during P12-T1 but is not used anywhere in the codebase — `MCPParams.clientInfo` covers the same purpose. Either remove it to reduce confusion, or add a usage (e.g., a helper or test) that justifies its existence as a public export. - **Priority:** P3 - **Dependencies:** P12-T1 @@ -2211,8 +2212,8 @@ Phase 9 Follow-up Backlog - **Outputs/Artifacts:** - Updated `src/mcpbridge_wrapper/schemas.py` — `MCPInitializeParams` removed or documented with usage - **Acceptance Criteria:** - - [ ] `MCPInitializeParams` is either removed or has a clear, tested usage - - [ ] `pytest` suite remains green + - [x] `MCPInitializeParams` is either removed or has a clear, tested usage + - [x] `pytest` suite remains green --- diff --git a/src/mcpbridge_wrapper/schemas.py b/src/mcpbridge_wrapper/schemas.py index b3d2ed7d..8c3c9c9d 100644 --- a/src/mcpbridge_wrapper/schemas.py +++ b/src/mcpbridge_wrapper/schemas.py @@ -29,18 +29,6 @@ class MCPClientInfo(BaseModel): version: str = Field(default="unknown", description="Client version") -class MCPInitializeParams(BaseModel): - """MCP initialize request parameters. - - Attributes: - clientInfo: Optional client identification - """ - - model_config = {"extra": "allow"} - - clientInfo: Optional[MCPClientInfo] = Field(default=None, description="Client info") # noqa: N815 - - class MCPParams(BaseModel): """MCP tool call parameters.