You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,14 @@ Tagged releases are published to npm from GitHub Actions when a **GitHub Release
10
10
11
11
### Changed
12
12
13
+
-**Breaking (MCP):** Experimental tool response fields are nested under `experimental` on success payloads. Affected tools: `query`, `query_documents`, `guided_query`. Fields moved: `degraded`, `degradation_reason`, `hybrid_leg_failed`, `rerank_skipped_reason` (query-shaped tools); `decision_trace` (`guided_query`). Stable fields (`status`, `results`, `namespace`, etc.) are unchanged. See [MIGRATION.md](docs/MIGRATION.md#unreleased-stable-vs-experimental-response-fields).
13
14
-**Breaking (core):**`resolveConfig` requires a Pinecone index name and no longer applies Alliance index/rerank defaults. Removed exported `DEFAULT_INDEX_NAME` and `DEFAULT_RERANK_MODEL` from the package root. Rerank is opt-in when `PINECONE_RERANK_MODEL` / `rerankModel` is unset.
14
15
-**Breaking (core):**`setupCoreServer` MCP `instructions` use `CORE_SERVER_INSTRUCTIONS` (no `guided_query` / `suggest_query_params`). `resolveConfig` defaults `disableSuggestFlow` to `true` so `query` / `count` / `query_documents` work without Alliance tools. Alliance CLI / `resolveAllianceConfig` unchanged: gate on by default, `ALLIANCE_SERVER_INSTRUCTIONS`.
15
16
-**Alliance CLI / `resolveAllianceConfig`:** When index or rerank env/CLI values are omitted, defaults remain `rag-hybrid` and `bge-reranker-v2-m3` (API-key-only MCP configs unchanged). See [examples/alliance/.env.example](examples/alliance/.env.example).
16
17
### Added
17
18
19
+
- Zod schemas for all nine MCP tool success responses (`queryResponseSchema`, `guidedQueryResponseSchema`, etc.) exported from the package root for client-side validation. Success payloads are runtime-validated before return.
20
+
- Stable vs experimental response field taxonomy documented in [docs/TOOLS.md](docs/TOOLS.md) and [docs/deprecation-policy.md](docs/deprecation-policy.md#stable-vs-experimental-mcp-response-fields).
-**`src/alliance/`** — C++ Alliance app tools (`suggest_query_params`, `guided_query`, Boost/Slack URL builtins). Import from `@will-cppa/pinecone-read-only-mcp/alliance`; embed via `resolveAllianceConfig` → `createServer` / `setClient` → `setupAllianceServer({ context: ctx })`(see [Library embedding](#library-embedding)).
107
+
-**`src/alliance/`** — C++ Alliance app tools (`suggest_query_params`, `guided_query`, Boost/Slack URL builtins). Import from `@will-cppa/pinecone-read-only-mcp/alliance` and use `createServer(config)` → `ctx.setClient(...)` → `setupAllianceServer({ context: ctx })`for the full tool surface (what the CLI uses); see [Library embedding](#library-embedding) below.
108
108
109
109
## Configuration
110
110
@@ -198,7 +198,7 @@ A fuller embedding sample lives in [examples/alliance/custom-url-generator.ts](e
Copy file name to clipboardExpand all lines: docs/CONFIGURATION.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ Configuration is built from **CLI flags** (when using the binary), **environment
28
28
29
29
**Throws** if `apiKey` or `indexName` is missing after trim.
30
30
31
-
For the full Alliance tool surface (including `suggest_query_params`, `guided_query`, and built-in URL generators), import from `@will-cppa/pinecone-read-only-mcp/alliance` and follow the [Library embedding](#library-embedding)flow: `resolveAllianceConfig` → `createServer` / `setClient` → `setupAllianceServer({ context: ctx })`.
31
+
For the full Alliance tool surface (including `suggest_query_params`, `guided_query`, and built-in URL generators), import from `@will-cppa/pinecone-read-only-mcp/alliance` and use the three-step instance-first recipe at [Library embedding](#library-embedding)below.
Copy file name to clipboardExpand all lines: docs/CONTRIBUTING.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,14 @@ Follow [deprecation-policy.md](./deprecation-policy.md). In summary:
49
49
-**Breaking** a release (especially while `0.y.z`): use labeled bullets — `**Breaking (MCP):**`, `**Breaking (types):**`, etc. — each with what changed, who is affected, and a link to a MIGRATION anchor.
50
50
-**Removing** deprecated APIs: add `### Removed` only after the deprecation window; keep migration text in MIGRATION.md.
51
51
52
+
## Response field stability
53
+
54
+
When changing MCP tool **success** response shapes:
55
+
56
+
- New fields default to the **`experimental`** nested object unless explicitly promoted (see [deprecation-policy.md § Stable vs experimental](./deprecation-policy.md#stable-vs-experimental-mcp-response-fields)).
57
+
- Update Zod schemas in `src/core/server/response-schemas.ts` and export from `src/core/index.ts`.
58
+
- Update [TOOLS.md](./TOOLS.md) stable/experimental tables for the affected tool(s).
59
+
52
60
## Documentation
53
61
54
62
Authoritative reference lives under [`docs/`](./README.md). When adding tools or config knobs, update `docs/TOOLS.md` and `docs/CONFIGURATION.md` in the same PR when possible.
Copy file name to clipboardExpand all lines: docs/MIGRATION.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,69 @@ This guide is for **library and MCP client authors** upgrading from earlier **0.
6
6
7
7
Under [semver 0.y.z](https://semver.org/spec/v2.0.0.html#spec-item-4), **0.1.x → 0.2.0 is a breaking minor** — pin `@0.2.0` only after reading this guide.
8
8
9
+
## Unreleased: Stable vs experimental response fields
10
+
11
+
**Rationale:** Tool success payloads mixed stable contract fields with experimental diagnostics (`degraded`, `decision_trace`, etc.) at the top level. Experimental fields are now nested under `experimental` so consumers know which fields are safe across minor version bumps.
12
+
13
+
**Who is affected:** MCP clients and integrators parsing `query`, `query_documents`, or `guided_query` success JSON.
When no experimental fields apply, the `experimental` key is **omitted** (not an empty object).
67
+
68
+
**Client-side validation:** Import Zod schemas from the package root, e.g. `import { queryResponseSchema } from '@will-cppa/pinecone-read-only-mcp'`.
69
+
70
+
**Promotion:** Moving a field from `experimental` to stable requires CHANGELOG, TOOLS.md, and schema updates per [deprecation-policy.md § Stable vs experimental](./deprecation-policy.md#stable-vs-experimental-mcp-response-fields).
Copy file name to clipboardExpand all lines: docs/TOOLS.md
+30-12Lines changed: 30 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,24 @@
2
2
3
3
Unless noted, failures return MCP `isError: true` with JSON matching `ToolError` (see [MIGRATION.md](./MIGRATION.md) and [README error table](../README.md#error-responses)).
4
4
5
+
## Response field stability
6
+
7
+
Success payloads separate **stable** fields (safe across minor bumps after `1.0.0`) from **experimental** fields (may change before `1.0.0`). Experimental fields are nested under `experimental` when present; the key is omitted when empty.
When reranking is requested but the rerank API fails, the server still returns **`status: 'success'`** with rows where `reranked: false`, plus envelope fields:
146
+
When reranking is requested but the rerank API fails, the server still returns **`status: 'success'`** with rows where `reranked: false`, plus **experimental**envelope fields:
129
147
130
148
| Field | When set | Meaning |
131
149
| ----- | -------- | ------- |
132
-
|`degraded`|`true`| Rerank was attempted and failed (or another degradation path fired) |
133
-
|`degradation_reason`| string | Human-readable detail for MCP/LLM clients (e.g. `rerank_failed: timeout after 5000ms`) |
134
-
|`hybrid_leg_failed`|`'dense'`\|`'sparse'`\| omitted / `null`| Exactly one hybrid search leg failed while the other returned hits |
150
+
|`experimental.degraded`|`true`| Rerank was attempted and failed (or another degradation path fired) |
151
+
|`experimental.degradation_reason`| string | Human-readable detail for MCP/LLM clients (e.g. `rerank_failed: timeout after 5000ms`) |
152
+
|`experimental.hybrid_leg_failed`|`'dense'`\|`'sparse'`| Exactly one hybrid search leg failed while the other returned hits |
135
153
136
-
Treat **`degraded: true`** as lower confidence even when `status` is `success`. Combine with per-row `reranked`, `preset`, and `use_reranking`. Structured stderr logs may include additional detail.
154
+
Treat **`experimental.degraded: true`** as lower confidence even when `status` is `success`. Combine with per-row `reranked`, `preset`, and `use_reranking`. Structured stderr logs may include additional detail.
137
155
138
-
`query_documents` propagates the same flags on its nested query payload when applicable.
156
+
`query_documents` propagates the same experimental flags when applicable.
139
157
140
158
---
141
159
@@ -167,7 +185,7 @@ Treat **`degraded: true`** as lower confidence even when `status` is `success`.
167
185
|`metadata_filter`| object | no | Filter |
168
186
|`max_chunks_per_document`| int | no | Cap merged chunks per doc (default 200, max 500) |
@@ -184,11 +202,11 @@ Treat **`degraded: true`** as lower confidence even when `status` is `success`.
184
202
|`preferred_tool`|`auto`\|`count`\|`fast`\|`detailed`\|`full`| no | Override automated tool choice |
185
203
|`enrich_urls`| boolean | no (default true) | Run URL generator when metadata lacks `url`|
186
204
187
-
**Success:**`{ status: 'success', decision_trace, result }` where `result` is either a count payload or a `QueryResponse`-shaped query payload.
205
+
**Success:**`{ status: 'success', experimental: { decision_trace }, result }` where `result` is either a count payload or a `QueryResponse`-shaped query payload.
When the inner query path runs, `result` includes the same `degraded`, `degradation_reason`, and `hybrid_leg_failed` fields as `query` (see [Rerank and hybrid degradation](#rerank-and-hybrid-degradation)).
209
+
When the inner query path runs, `result.experimental` includes the same degradation fields as `query` (see [Rerank and hybrid degradation](#rerank-and-hybrid-degradation)).
192
210
193
211
**Example:**
194
212
@@ -227,4 +245,4 @@ Single-shot:
227
245
guided_query
228
246
```
229
247
230
-
Canonical Zod schemas live beside each handler under `src/server/tools/*.ts`.
248
+
Canonical Zod input schemas live beside each handler under `src/core/server/tools/*.ts` and `src/alliance/tools/*.ts`. Success response schemas are in `src/core/server/response-schemas.ts` and exported from the package root (e.g. `queryResponseSchema`, `guidedQueryResponseSchema`).
Copy file name to clipboardExpand all lines: docs/deprecation-policy.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,33 @@ While **`0.y.z`**, a minor release **may** ship breaking changes without a prior
64
64
65
65
Security fixes may break behavior when required; document impact in CHANGELOG and MIGRATION.
66
66
67
+
## Stable vs experimental MCP response fields
68
+
69
+
MCP tool **success** responses separate fields into two tiers:
70
+
71
+
| Tier | Meaning | Location in JSON |
72
+
| ---- | ------- | ---------------- |
73
+
|**Stable**| Safe to depend on across minor version bumps after `1.0.0`| Top-level keys (`status`, `results`, `namespace`, `count`, etc.) |
74
+
|**Experimental**| May change or be removed before `1.0.0`| Nested under `experimental` when present |
75
+
76
+
Current experimental fields (see [TOOLS.md](./TOOLS.md) per tool):
77
+
78
+
-`degraded`, `degradation_reason`, `hybrid_leg_failed`, `rerank_skipped_reason` — query-shaped tools (`query`, `query_documents`, and `guided_query.result` when applicable)
79
+
-`decision_trace` — `guided_query` only
80
+
81
+
The `experimental` key is **omitted** when no experimental fields are set.
82
+
83
+
### Promoting experimental → stable
84
+
85
+
To promote a field from experimental to stable:
86
+
87
+
1.**CHANGELOG** — `### Changed` entry describing the promotion and target release.
88
+
2.**TOOLS.md** — Move the field from the Experimental to Stable table for the affected tool(s).
89
+
3.**Schema** — Move the field out of `experimental` in `response-schemas.ts` and update handler builders.
90
+
4.**MIGRATION.md** — Document before/after for integrators.
91
+
92
+
New response fields added before `1.0.0` default to `experimental` unless explicitly promoted through this process.
93
+
67
94
## Future instance APIs (`ServerContext`)
68
95
69
96
Phase 1 of the **`ServerContext`** / **`createServer(config)`** refactor is available while legacy module-level getters remain supported. See [MIGRATION.md § ServerContext instance APIs](./MIGRATION.md#unreleased-servercontext-instance-apis-phase-1) for upgrade steps.
Copy file name to clipboardExpand all lines: examples/alliance/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
These examples target the **full** MCP surface via `setupAllianceServer` from `@will-cppa/pinecone-read-only-mcp/alliance`:
4
4
5
5
-`suggest_query_params` and the suggest-flow gate
6
-
-`guided_query` with `decision_trace`
6
+
-`guided_query` with `experimental.decision_trace`
7
7
- Built-in URL generators for `mailing` and `slack-Cpplang`
8
8
9
9
They assume a Pinecone index you control with compatible data (not necessarily the C++ Alliance production index). To bootstrap a **neutral** index from scratch, start with [examples/quickstart/README.md](../quickstart/README.md).
@@ -24,7 +24,7 @@ Optional: `PINECONE_RERANK_MODEL`, `PINECONE_SPARSE_INDEX_NAME`, etc. See [docs/
0 commit comments