semantic-js-mcp 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/.prettierrc.json +1 -0
  3. package/CHANGELOG.md +43 -0
  4. package/CONTRIBUTING.md +23 -3
  5. package/README.md +44 -69
  6. package/ROADMAP.md +2 -2
  7. package/docs/architecture-decisions.md +35 -22
  8. package/docs/distribution.md +19 -0
  9. package/docs/getting-started.md +72 -0
  10. package/docs/result-schema-migration.md +67 -0
  11. package/lib/doctor.mjs +3 -2
  12. package/lib/file-identity.mjs +18 -0
  13. package/lib/pending-requests.mjs +38 -0
  14. package/lib/runtime.mjs +4 -2
  15. package/lib/semantic-evidence.mjs +44 -0
  16. package/lib/stable-collection.mjs +10 -0
  17. package/lib/temporary-directory.mjs +15 -0
  18. package/package.json +28 -4
  19. package/protocol.mjs +112 -3
  20. package/scripts/agent-evaluation-contract.mjs +165 -0
  21. package/scripts/agent-evaluation-smoke.mjs +44 -0
  22. package/scripts/agent-evaluation.mjs +37 -0
  23. package/scripts/check-protocol-literals.mjs +30 -0
  24. package/scripts/ci-smoke.mjs +77 -5
  25. package/scripts/codex-plugin-verification.mjs +129 -0
  26. package/scripts/distribution-policy.mjs +28 -7
  27. package/scripts/distribution-smoke.mjs +19 -14
  28. package/scripts/doctor-smoke.mjs +40 -0
  29. package/scripts/documentation-contract.mjs +39 -0
  30. package/scripts/documentation-gate-smoke.mjs +55 -0
  31. package/scripts/documentation-gate.mjs +110 -0
  32. package/scripts/generate-protocol-reference.mjs +32 -3
  33. package/scripts/lifecycle-memory-benchmark.mjs +300 -0
  34. package/scripts/lifecycle-memory-contract.mjs +53 -0
  35. package/scripts/lifecycle-memory-observer.mjs +29 -0
  36. package/scripts/lifecycle-smoke.mjs +309 -0
  37. package/scripts/negative-verification-smoke.mjs +243 -0
  38. package/scripts/postpublication-smoke.mjs +245 -0
  39. package/scripts/release-contract.mjs +78 -0
  40. package/scripts/release-smoke.mjs +123 -0
  41. package/scripts/release-verify.mjs +64 -0
  42. package/scripts/repository-matrix-contract.mjs +80 -0
  43. package/scripts/repository-matrix-smoke.mjs +153 -0
  44. package/scripts/repository-matrix.mjs +276 -0
  45. package/scripts/semantic-js-mcp-ci.mjs +40 -26
  46. package/scripts/smoke.mjs +307 -47
  47. package/scripts/vue-smoke.mjs +352 -7
  48. package/server.mjs +736 -315
  49. package/skills/semantic-navigation/SKILL.md +23 -10
  50. package/skills/semantic-navigation/references/protocol-literals.md +110 -4
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-js-mcp",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "description": "Semantic understanding of JavaScript codebases for AI agents",
5
5
  "author": {
6
6
  "name": "Jonathan Muñoz Lucas"
package/.prettierrc.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "bracketSpacing": false,
3
+ "endOfLine": "lf",
3
4
  "printWidth": 140,
4
5
  "proseWrap": "preserve",
5
6
  "semi": true,
package/CHANGELOG.md CHANGED
@@ -4,6 +4,49 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.10.0] - 2026-07-17
8
+
9
+ ### Added
10
+
11
+ - Add a deterministic semantic-evidence usability status to named counts and audits, with explicit follow-up reasons for incomplete collection or ambiguous definition selection.
12
+ - Add a repeated post-disposal memory benchmark that separates MCP heap, MCP resident memory, and child-provider resident memory under an explicitly scoped measurement method.
13
+ - Add cross-platform CI coverage for supported Node.js LTS lines.
14
+ - Add focused negative-verification and public-documentation gates.
15
+ - Add concise starter prompts and evidence examples for common agent workflows.
16
+
17
+ ### Fixed
18
+
19
+ - Recover with fresh language-server and Vue tsserver clients after an initialized provider exits, while settling pending requests and diagnostics without leaving timeout handles active.
20
+ - Resolve cross-project import aliases consistently when a language server first returns the local import binding.
21
+ - Canonicalize Windows source positions when verifying and grouping cross-project references.
22
+ - Make release verification portable across Windows paths, executable shims, temporary-file locking, and checkout line endings.
23
+ - Keep declaration filtering and language-server client eviction stable across platform-specific provider output and slow initialization.
24
+
25
+ ## [0.9.0] - 2026-07-16
26
+
27
+ ### Changed
28
+
29
+ - Make count and audit results compact by default while preserving complete requested reference collections for paged follow-up tools.
30
+ - Centralize concise, tool-specific continuation guidance in the versioned protocol vocabulary.
31
+ - Consolidate server and schema identity under `producer`, and represent document fingerprints as `sha256:<hex>`.
32
+ - Return continuation guidance as exact tool-name lists, expose one reusable reference-set identifier per logical response, and remove page fields derivable from the normalized request and presentation counts.
33
+ - Group verified page locations by source file while preserving explicit ranges, discovery methods, location-based pagination, and evidence accounting.
34
+ - Advance the canonical result schema to version 6 for the compact audit presentation contract.
35
+ - Document migration from schema 5 and reject legacy envelopes in canonical-result validation.
36
+ - Report whether named-symbol filtering selected zero, one, or multiple exact definitions, and recommend only continuation tools supported by the returned evidence.
37
+ - Verify import and usage bindings against `fileHint` during named audits without treating the hinted filename as a declaration.
38
+ - Share concurrent diagnostic acquisition, negotiate provider pull support, and reject evidence when file content changes during acquisition.
39
+ - Report the owning diagnostic provider and document language once per result, with source region and embedded language on each diagnostic when its range establishes them.
40
+ - Order continuation tools so position-based disambiguation and unresolved-candidate inspection precede broader follow-up pages when those uncertainties are present.
41
+
42
+ ### Added
43
+
44
+ - Add deterministic release verification, isolated postpublication package verification, and externally configured repository-matrix commands.
45
+ - Reject repository-matrix diagnostic paths whose canonical target escapes the configured repository root.
46
+ - Add model-independent fixtures for compact-result continuation and coverage decisions.
47
+ - Cover named symbol discovery and audits for standalone JavaScript modules at workspace-root and nested source locations.
48
+ - Add npm keywords for MCP, language-server, JavaScript, and semantic-navigation discovery.
49
+
7
50
  ## [0.8.1] - 2026-07-15
8
51
 
9
52
  ### Fixed
package/CONTRIBUTING.md CHANGED
@@ -19,13 +19,18 @@ npm run doctor
19
19
  npm run smoke:ci
20
20
  npm run smoke
21
21
  npm run smoke:vue
22
+ npm run smoke:lifecycle
23
+ npm run smoke:release
24
+ npm run smoke:evaluation
25
+ npm run smoke:matrix
26
+ npm run smoke:distribution
22
27
  ```
23
28
 
24
- Run `npm run benchmark` for changes that affect repository scanning, reference verification, caching, lifecycle, or memory.
29
+ Run `npm run benchmark` for changes that affect repository scanning, reference verification, caching, lifecycle, or memory. Provider disposal changes should also run `npm run benchmark:lifecycle-memory`; it uses explicit garbage collection and POSIX process metrics, remains separate from the deterministic release gate, and reports its measurement scope.
25
30
 
26
31
  ## Source Of Truth
27
32
 
28
- - `protocol.mjs` owns public literals, server identity, schema identity, runtime components, and defaults.
33
+ - `protocol.mjs` owns public literals, producer identity, schema identity, runtime components, and defaults.
29
34
  - `.prettierrc.json` and the `format` scripts define the public source style.
30
35
  - `skills/semantic-navigation/references/protocol-literals.md` is generated; update it with `node scripts/generate-protocol-reference.mjs`.
31
36
  - `README.md` documents implemented behavior and known limitations.
@@ -34,6 +39,7 @@ Run `npm run benchmark` for changes that affect repository scanning, reference v
34
39
  ## Change Expectations
35
40
 
36
41
  - Centralize public literals in `protocol.mjs`.
42
+ - Keep release, host, fixture, and CI-only literals in their focused modules rather than expanding the public protocol vocabulary.
37
43
  - Run `npm run format` after changing public source or documentation.
38
44
  - Regenerate protocol documentation instead of editing it directly.
39
45
  - Add isolated fixtures for positive, partial, and failed evidence.
@@ -51,10 +57,24 @@ npm run check:runtime
51
57
  npm run smoke:ci
52
58
  npm run smoke
53
59
  npm run smoke:vue
60
+ npm run smoke:lifecycle
61
+ npm run smoke:release
62
+ npm run smoke:evaluation
63
+ npm run smoke:matrix
54
64
  npm run smoke:distribution
55
65
  ```
56
66
 
57
- Also run `npm run benchmark` when collection cost or memory could change. Run `npm run doctor` when changing runtime resolution, provider startup, the CLI, or diagnostic trust. New behavior should use generic fixtures and cover complete, partial, limited, failed, stale, or untrusted outcomes as applicable.
67
+ Also run `npm run benchmark` when collection cost or memory could change, and `npm run benchmark:lifecycle-memory` when provider disposal behavior changes. Run `npm run doctor` when changing runtime resolution, provider startup, the CLI, or diagnostic trust. New behavior should use generic fixtures and cover complete, partial, limited, failed, stale, or untrusted outcomes as applicable.
68
+
69
+ `npm run check:documentation` validates the durable public documentation contract. `npm run smoke:negative` exercises missing runtime providers, invalid workspaces and limits, stale or expired reference sets, repository mutation, unresolved candidates, and diagnostic trust. The complete `npm run release:verify` gate includes both checks.
70
+
71
+ `npm run release:verify` executes the complete local release gate and reports every check in one machine-readable result. It does not publish, tag, or modify an installed plugin.
72
+
73
+ Use `npm run verify:published -- <version>` after publishing npm and the matching `v<version>` repository tag. It queries that exact registry version, installs it with isolated temporary state, verifies the installed executable, runs its doctor, then installs the plugin from the tag-pinned Codex marketplace in a temporary `CODEX_HOME`. Registry or network unavailability returns `blocked` rather than passing or failing the package.
74
+
75
+ Use `npm run validate:repositories -- <configuration.json|yaml>` for authorized real-repository observations. Configuration stays external to the project and contains repository entries with an `id`, absolute `root`, and `probes`. Supported probe kinds are `named-symbol` with `symbol` and optional `fileHint`, and `diagnostics` with a repository-relative `file`. The runner reports tool failures, incomplete evidence, untrusted diagnostics, and unavailable repositories separately.
76
+
77
+ `npm run evaluate:agent` prints model-independent compact-result cases. An answer file can be graded with `npm run evaluate:agent -- --answers <file>`; hosted or local model execution remains optional and outside the fixture contract.
58
78
 
59
79
  ## Changelog And Versioning
60
80
 
package/README.md CHANGED
@@ -6,6 +6,8 @@ Coding agents can generate code quickly, but reliable engineering requires more
6
6
 
7
7
  Semantic JS MCP gives coding agents structured, read-only semantic context so they can navigate, review, and change code with explicit uncertainty.
8
8
 
9
+ Its scope is intentionally narrow: it strengthens an agent's understanding of symbol identity, types, references, diagnostics, and evidence coverage. It does not replace architectural reasoning, source inspection, dependency analysis, tests, or runtime observation.
10
+
9
11
  **Better agents begin with better evidence.**
10
12
 
11
13
  It supports the JavaScript ecosystem, including TypeScript, JavaScript, TSX, JSX, Node module variants, and Vue projects. Language servers provide the underlying semantic data, which the server turns into structured results designed for coding agents.
@@ -14,7 +16,7 @@ For each file, it identifies the owning workspace and uses the corresponding Typ
14
16
 
15
17
  ## Project Status
16
18
 
17
- Version `0.8.1` is the current release. APIs and result contracts may evolve while the project remains on the `0.x` release line. See the [roadmap](ROADMAP.md) for areas under consideration.
19
+ Version `0.10.0` is the current release. APIs and result contracts may evolve while the project remains on the `0.x` release line. See the [roadmap](ROADMAP.md) for areas under consideration.
18
20
 
19
21
  ## Installation
20
22
 
@@ -40,9 +42,11 @@ semantic-js-mcp doctor
40
42
 
41
43
  Configure the host to run `semantic-js-mcp serve`.
42
44
 
45
+ For practical investigation prompts and compact evidence examples, see [Getting started](docs/getting-started.md).
46
+
43
47
  ## Runtime
44
48
 
45
- - Node.js 22 or newer is supported.
49
+ - Node.js 22 or newer is required.
46
50
  - Node.js 24 LTS is recommended for new installations. See the [Node.js release schedule](https://nodejs.org/en/about/previous-releases).
47
51
  - `rg` (ripgrep) must be available on `PATH` for repository-wide discovery.
48
52
  - The nearest workspace TypeScript SDK is used when available; the bundled TypeScript SDK is the fallback.
@@ -64,9 +68,10 @@ npm run doctor
64
68
  npm run smoke:ci
65
69
  npm run smoke
66
70
  npm run smoke:vue
71
+ npm run smoke:lifecycle
67
72
  ```
68
73
 
69
- Run `npm run benchmark` after changes to scanning, references, caching, lifecycle, or memory. Normal analysis is local and read-only; it does not require network access after dependencies are installed.
74
+ Run `npm run benchmark` after changes to scanning, references, caching, lifecycle, or memory. Provider disposal changes can also be characterized with `npm run benchmark:lifecycle-memory`; its output declares the garbage-collection and platform measurement method. Normal analysis is local and read-only; it does not require network access after dependencies are installed.
70
75
 
71
76
  For an MCP host that accepts a direct stdio configuration, point it at the checked-out server using an absolute path:
72
77
 
@@ -108,30 +113,33 @@ Tools are ordered from smaller responses to deeper evidence:
108
113
  | `lsp_hover` | Inferred type and documentation | `lsp_definition`, `lsp_audit_symbol` |
109
114
  | `lsp_diagnostics` | Focused diagnostics for one file | `lsp_definition`, `lsp_hover` |
110
115
  | `lsp_count_text_matches` | Exact identifier text count without semantic verification | `lsp_count_named_symbol`, `lsp_audit_named_symbol` |
111
- | `lsp_count_named_symbol` | Definition and reference counts by name | `lsp_audit_named_symbol`, `lsp_references` |
112
- | `lsp_count_references` | Reference counts at a position | `lsp_audit_symbol`, `lsp_references` |
113
- | `lsp_audit_named_symbol` | Composed summary by symbol name | `lsp_references` |
114
- | `lsp_audit_symbol` | Composed summary at a position | `lsp_references` |
116
+ | `lsp_count_named_symbol` | Definition and reference counts by name | `lsp_audit_named_symbol`, `lsp_reference_page` |
117
+ | `lsp_count_references` | Reference counts at a position | `lsp_audit_symbol`, `lsp_reference_page` |
118
+ | `lsp_audit_named_symbol` | Compact composed summary by symbol name | `lsp_reference_page` |
119
+ | `lsp_audit_symbol` | Compact composed summary at a position | `lsp_reference_page` |
115
120
  | `lsp_references` | First page of verified locations | `lsp_reference_page` |
116
121
  | `lsp_reference_page` | A later page from the same collection | `lsp_definition` |
117
122
  | `lsp_unresolved_reference_page` | Unresolved candidates with locations and literal reasons | `lsp_definition` |
118
123
 
119
- Composite audits reuse the same internal definition, hover, and reference primitives as the narrow tools. Compatible count, audit, and reference calls reuse a short-lived reference set.
124
+ Composite audits reuse the same internal definition, hover, and reference primitives as the narrow tools. Their default response contains definition identity, signature, reference and text-match counts, unresolved count, files affected, collection status, and freshness. Use `lsp_reference_page` with a returned `referenceSetId` for verified locations and detailed collection evidence, or `lsp_unresolved_reference_page` for unresolved candidates. Use `lsp_references` when starting from an exact source position without an existing reference set.
125
+
126
+ Compatible count, audit, and reference calls reuse a short-lived reference set. Compact presentation changes response size, not collection scope.
120
127
 
121
128
  ## Result Contract
122
129
 
123
130
  Every successful result contains:
124
131
 
125
- - `server`: the literal semantic-js-mcp server name and version that produced the response.
126
- - `resultSchema`: the literal canonical result schema name and version.
132
+ - `producer`: the literal semantic-js-mcp name, server version, and result-schema version that produced the response.
127
133
  - `request`: normalized inputs and explicit limit interpretation.
128
134
  - `result`: evidence produced by the tool.
129
135
  - `collection`: how evidence collection completed.
130
136
  - `presentation`: how much collected evidence appears in this response.
131
- - `continueWith`: exact MCP tool names that can add the next kind of evidence.
137
+ - `continueWith`: a list of exact MCP tool names that can add the next kind of evidence.
132
138
 
133
139
  `structuredContent` is the canonical JSON object. The text content is YAML generated from that same object and parses back to the same data.
134
140
 
141
+ Consumers upgrading from result schema 5 should follow the [schema migration guide](docs/result-schema-migration.md).
142
+
135
143
  ### Collection status
136
144
 
137
145
  - `complete`: the requested collection scope completed and every discovered item was classified.
@@ -139,19 +147,17 @@ Every successful result contains:
139
147
  - `partial`: collection completed with explicitly reported items whose definition or owning file could not be resolved.
140
148
  - `failed`: the tool call failed and the error object explains why.
141
149
 
142
- Collection and presentation are independent. A complete collection may use `presentation.mode: page`, `count-only`, `summary-by-file`, or `subset` without weakening its counts.
150
+ Collection and presentation are independent. A complete collection may use `presentation.mode: compact-summary`, `page`, `count-only`, or `subset` without weakening its counts. Audits use `compact-summary` by default and retain their full reference set for focused follow-up calls.
143
151
 
144
152
  For reference results, `includeDeclaration: false` excludes locations that resolve to the requested declaration. It never excludes the source position merely because that position initiated the query. The reported invariant is `verifiedTotal = foundByOwningWorkspaceLanguageServer + verifiedFromOtherWorkspaces` after declaration filtering and deduplication.
145
153
 
146
- ### Vue template definitions
147
-
148
- Definition lookup uses the Vue language server and TypeScript server first. If both leave a Vue template tag unresolved, the server parses the SFC and follows only a matching local import from `<script>` or `<script setup>`. A successful fallback reports `resolutionMethod: vue-template-import-binding-definition`. This proves an imported component binding; it does not infer global component registration or filename-based identity.
154
+ Reference pages group the locations returned in that page under `referenceGroups` by their exact source `file`. Each location keeps its explicit `range` and `discoveryMethod`, while `locationsAvailable` and `locationsReturned` continue to count locations rather than file groups. Pagination selects locations before grouping, so grouping does not change page membership or collection status. File groups follow first appearance in the page, and locations preserve their relative order within each file; cross-file interleaving is not part of the reference contract.
149
155
 
150
- The Vue parser and TypeScript AST dependencies are loaded lazily only when this fallback is needed.
156
+ Named counts and audits report `definitionSelectionStatus` as `no-definition-selected`, `one-definition-selected`, or `multiple-definitions-selected`. This status describes exact declarations remaining after `fileHint` filtering, before any `maxDefinitions` analysis limit. When selection is empty or ambiguous, `continueWith` recommends structural or position-based tools. It recommends `lsp_reference_page` only when the response contains a reusable reference set.
151
157
 
152
- ### Signature source
158
+ They also report `semanticEvidence.status` as `usable-as-requested` or `follow-up-required`. Follow-up reasons combine incomplete collection and ambiguous definition selection without treating a compact, paged, or subset presentation as incomplete evidence. This status evaluates only the requested semantic result; it does not declare the code correct.
153
159
 
154
- Position audits first request hover information at the query position. If that position has a resolved definition but no hover information, the audit requests hover at the resolved declaration. `signatureSource` reports `query-position-hover`, `resolved-definition-hover`, or `not-reported`; `signatureDefinition` identifies the declaration used by the fallback.
160
+ When `fileHint` selects no declaration, a named audit can verify whether source bindings resolve to the hinted file while keeping declaration identity and uncertainty explicit.
155
161
 
156
162
  ### Limits
157
163
 
@@ -162,30 +168,15 @@ Collection limits accept positive integers only:
162
168
 
163
169
  Omitting `maxCandidates` or `maxDefinitions` requests unlimited collection. `pageSize` and `maxResults` only control returned items for tools that expose them as presentation parameters.
164
170
 
165
- ### Text-match accounting
166
-
167
- Repository verification reports:
168
-
169
- - `matchesFound`
170
- - `matchesChecked`
171
- - `matchesToRequestedSymbol`
172
- - `matchesToDifferentSymbols`
173
- - `matchesWhoseDefinitionCouldNotBeResolved`
174
- - `accountingStatus: complete | incomplete`
175
-
176
- `accountingStatus: complete` means every discovered text match appears in exactly one classification. Unresolved matches remain explicit and make semantic collection `partial`.
177
-
178
- Count and audit responses expose the `referenceSetId` and unresolved-candidate count. Use `lsp_unresolved_reference_page` to inspect those candidates without inflating every summary. The server also queries tsserver `projectInfo` for unresolved candidates and reports whether the file belongs to a configured or inferred TypeScript project. Reasons describe only observed behavior; they do not speculate that an alias caused a failure.
179
-
180
171
  ### Freshness
181
172
 
182
- Reusable reference sets store SHA-256 fingerprints for the source file, native reference files, every cross-workspace candidate file, and the relevant `package.json`, `tsconfig.json`, or `jsconfig.json` files. They also store a repository source-inventory fingerprint built from every relevant path, file size, and high-resolution modification time. Reuse and pagination verify both layers, so new, deleted, renamed, or normally modified source files invalidate repository-wide completeness. Changed evidence produces `REFERENCE_SET_CONTENT_CHANGED` and requires a new `lsp_references` collection. Expired or evicted sets produce `REFERENCE_SET_NOT_FOUND_OR_EXPIRED`.
183
-
184
- The inventory is sampled before and after collection. If repository sources change during collection, the server retries once and then returns `REPOSITORY_CHANGED_DURING_COLLECTION` instead of publishing an unstable result.
173
+ Reusable reference sets verify participating file content and the repository
174
+ source inventory before returning another page. Added, removed, renamed, or
175
+ changed sources invalidate stale evidence instead of silently reusing it.
185
176
 
186
- Diagnostics clear their cache on `didChange` and report the analyzed document version and SHA-256 content fingerprint. Only a language-server report for that exact document version appears under `diagnosticsForCurrentDocument`. Otherwise that field is `null`, `evidence.status` is `untrusted`, and any unconfirmed report is isolated under `unconfirmedDiagnosticReport`. Untrusted diagnostics always produce a partial collection.
187
-
188
- Diagnostic severities are preserved literally. If a language server omits severity, the result reports `not-reported`; it is not silently treated as information, warning, or error.
177
+ Diagnostics are current only when the owning provider confirms the analyzed
178
+ document snapshot. Unconfirmed reports remain isolated and explicitly
179
+ `untrusted`; an empty unconfirmed report is never presented as a clean file.
189
180
 
190
181
  ### CI policy adapter
191
182
 
@@ -196,42 +187,21 @@ MCP tools report evidence; they do not decide whether a code change passes. `npm
196
187
  - `untrusted`, exit `2`: collection is partial or limited.
197
188
  - `blocked`, exit `3`: the tool failed or the input is not a semantic-js-mcp result.
198
189
 
199
- Pass `--yaml` after the input path for a YAML representation. The adapter accepts canonical JSON or YAML, validates the server and result-schema identity plus public tool and presentation literals, and never converts incomplete evidence into a pass.
200
-
201
- ### Installation doctor
202
-
203
- `semantic-js-mcp doctor` returns a structured installation report with the same deterministic status vocabulary and exit codes as the CI adapter:
204
-
205
- - `pass`, exit `0`: every installation and semantic fixture check passed;
206
- - `fail`, exit `1`: the server ran, but a functional check returned the wrong result;
207
- - `untrusted`, exit `2`: runtime checks passed, but a provider did not confirm current diagnostic evidence;
208
- - `blocked`, exit `3`: a runtime requirement, provider component, or MCP startup step was unavailable.
209
-
210
- Use `semantic-js-mcp doctor --yaml` for a YAML representation. An `untrusted` result is not converted to a package failure by the distribution smoke test, but the reason remains explicit in the report.
190
+ Pass `--yaml` after the input path for a YAML representation. The adapter accepts canonical JSON or YAML, validates the producer and result-schema version plus public tool and presentation literals, and never converts incomplete evidence into a pass.
211
191
 
212
192
  ### Cost visibility
213
193
 
214
- `lsp_count_text_matches` scans repository text without issuing per-match semantic requests. Use it to measure common identifiers before requesting verified counts or audits. Semantic collections preserve omitted limits as unlimited and report text-search time, semantic-verification time, semantic request count, and maximum concurrency. There is no hidden candidate cap.
215
-
216
- The bundled Codex MCP configuration allows up to 300 seconds for one tool call. Reaching a client or language-server timeout returns a failed call; it never changes collection scope or reports a timed-out collection as complete.
194
+ `lsp_count_text_matches` measures a common identifier before semantic
195
+ verification. Compact tools omit operational metrics; detailed reference calls
196
+ retain timing, semantic request, concurrency, and memory observations. The
197
+ server applies no hidden candidate cap.
217
198
 
218
199
  ## Memory Management
219
200
 
220
- Language-server clients and reusable reference sets are released automatically using idle timeout, TTL, and LRU policies. These policies affect reuse only; they do not cap a collection being computed.
221
-
222
- Environment variables:
223
-
224
- - `SEMANTIC_JS_MCP_CLIENT_IDLE_TIMEOUT_MS` default `60000`
225
- - `SEMANTIC_JS_MCP_CLIENT_MINIMUM_EVICTION_AGE_MS` default `15000`
226
- - `SEMANTIC_JS_MCP_MAXIMUM_ACTIVE_CLIENTS` default `4`
227
- - `SEMANTIC_JS_MCP_REFERENCE_SET_TTL_MS` default `300000`
228
- - `SEMANTIC_JS_MCP_MAXIMUM_REFERENCE_SETS` default `12`
229
- - `SEMANTIC_JS_MCP_MAXIMUM_CHANGED_REFERENCE_SET_MARKERS` default `24`
230
- - `SEMANTIC_JS_MCP_MAXIMUM_CACHED_REFERENCE_LOCATIONS` default `50000`
231
- - `SEMANTIC_JS_MCP_DEFAULT_REFERENCE_PAGE_SIZE` default `100`
232
- - `SEMANTIC_JS_MCP_CROSS_WORKSPACE_CONCURRENCY` default `6`
233
-
234
- A single reference collection may exceed the cache-location budget so it can still be paged. Older collections are evicted first.
201
+ Language-server clients and reusable reference sets use idle timeout, TTL, and
202
+ LRU policies. These policies govern reuse; they never impose a hidden limit on
203
+ the collection in progress. Configuration literals and defaults are listed in
204
+ the generated [protocol reference](skills/semantic-navigation/references/protocol-literals.md).
235
205
 
236
206
  ## Verification
237
207
 
@@ -242,6 +212,7 @@ npm run doctor
242
212
  npm run smoke
243
213
  npm run smoke:ci
244
214
  npm run smoke:vue
215
+ npm run smoke:lifecycle
245
216
  npm run smoke:distribution
246
217
  ```
247
218
 
@@ -251,6 +222,10 @@ npm run smoke:distribution
251
222
 
252
223
  The smoke tests create temporary generic TypeScript and Vue projects. They do not depend on a specific application repository.
253
224
 
225
+ ## Reporting Problems
226
+
227
+ Run `semantic-js-mcp doctor` and include its structured output, the package version, Node.js version, operating system, affected source type, and the smallest reproducible workspace or public repository. Remove proprietary source, credentials, local absolute paths, and customer data before opening an issue. See [Contributing](CONTRIBUTING.md) for validation details and the [Security policy](SECURITY.md) for private vulnerability reports.
228
+
254
229
  ## Current Limitations
255
230
 
256
231
  - The server provides static semantic evidence, not runtime call tracing or behavioral proof.
package/ROADMAP.md CHANGED
@@ -23,12 +23,12 @@ Semantic JS MCP is under active development. This roadmap outlines areas of inve
23
23
  ## Agent-Facing Results
24
24
 
25
25
  - Keep result vocabulary literal, finite, and versioned.
26
- - Improve compact presentation without hiding collection scope or unresolved evidence.
26
+ - Measure compact audit summaries against large real-world symbols and smaller models without hiding collection scope or unresolved evidence.
27
27
  - Expand examples for combining count, audit, reference, diagnostic, text-search, source-inspection, and test evidence.
28
28
 
29
29
  ## Distribution
30
30
 
31
- - Expand reproducible package and plugin release checks across supported Node.js LTS releases and hosted CI.
31
+ - Maintain reproducible package and plugin release checks across supported Node.js LTS releases and operating systems.
32
32
  - Document setup for additional MCP hosts using the same public server contract.
33
33
  - Add immutable release-source, upgrade, rollback, and installed-plugin verification.
34
34
 
@@ -2,30 +2,23 @@
2
2
 
3
3
  This document records accepted product boundaries. These decisions may be revised through an explicit change that documents the reason and migration impact.
4
4
 
5
- ## DEC-001: Independent MCPs By Semantic Domain
6
-
7
- Status: accepted
5
+ ## Independent MCPs By Semantic Domain
8
6
 
9
7
  Semantic support for JavaScript, CSS, PHP, and other domains belongs in independent projects with separate dependencies, processes, releases, installation, and lifecycle management.
10
8
 
11
9
  This project is `semantic-js-mcp`; it does not load or bundle semantic providers for other domains.
12
10
 
13
- ## DEC-002: Composition Belongs To The Consumer
14
-
15
- Status: accepted
11
+ ## Composition Belongs To The Consumer
16
12
 
17
13
  One MCP does not call another MCP. A model, skill, CI adapter, or other consumer decides whether evidence from multiple semantic domains is needed.
18
14
 
19
15
  This avoids runtime coupling, chained failures, implicit configuration, and assumptions that another product exists.
20
16
 
21
- ## DEC-003: Common Representation, Domain-Specific Evidence
22
-
23
- Status: accepted
17
+ ## Common Representation, Domain-Specific Evidence
24
18
 
25
19
  Related semantic MCPs should use a compatible evidence envelope when practical:
26
20
 
27
- - server identity;
28
- - result-schema identity;
21
+ - producer identity and result-schema version;
29
22
  - tool and normalized request;
30
23
  - result;
31
24
  - collection status;
@@ -34,23 +27,27 @@ Related semantic MCPs should use a compatible evidence envelope when practical:
34
27
 
35
28
  Each domain owns the vocabulary inside its result. A CSS class relationship is not represented as a JavaScript LSP reference.
36
29
 
37
- ## DEC-004: Continuations Stay Inside One MCP
38
-
39
- Status: accepted
30
+ ## Continuations Stay Inside One MCP
40
31
 
41
32
  `continueWith` names tools from the server that produced the response. It does not recommend tools from another MCP. Cross-product guidance belongs in consumer documentation or skills.
42
33
 
43
- ## DEC-005: Narrow And Composed Tools Coexist
44
-
45
- Status: accepted
34
+ ## Narrow And Composed Tools Coexist
46
35
 
47
36
  Narrow tools provide one focused fact with a small response. Composed audits reuse the same internal primitives to reduce tool calls for consumers that can use a larger evidence summary.
48
37
 
49
38
  Composed tools do not remove access to narrow tools and do not weaken collection accounting.
50
39
 
51
- ## DEC-006: Preserve Provider-Native Embedded Evidence
40
+ ## Diagnostics Require Current Snapshot Evidence
52
41
 
53
- Status: accepted
42
+ The server uses advertised diagnostic-pull capability when available and push
43
+ notifications otherwise. Concurrent requests for the same document snapshot
44
+ share one acquisition. A version match or completed pull request is not enough
45
+ when the file content changes before the result is returned.
46
+
47
+ Diagnostics that cannot be correlated to the current document remain
48
+ explicitly untrusted.
49
+
50
+ ## Preserve Provider-Native Embedded Evidence
54
51
 
55
52
  The JavaScript ecosystem includes mixed-language documents. When the owning provider reports diagnostics for a Vue template or embedded CSS, SCSS, or Less block, semantic-js-mcp preserves that evidence instead of filtering it according to another provider's domain.
56
53
 
@@ -63,10 +60,26 @@ Where it can be determined safely, diagnostic evidence should identify:
63
60
 
64
61
  Unknown provenance remains explicit. Provider-native style diagnostics do not imply complete CSS graph analysis.
65
62
 
66
- ## DEC-007: Extract Shared Code Only After A Second Implementation
67
-
68
- Status: accepted
63
+ ## Extract Shared Code Only After A Second Implementation
69
64
 
70
65
  The project may document transferable concepts, but it will not create a shared runtime package or universal provider framework before a second semantic MCP demonstrates concrete duplication.
71
66
 
72
67
  Compatibility should begin with result concepts and conformance fixtures, not premature runtime coupling.
68
+
69
+ ## Compact Summaries Preserve Complete Collections
70
+
71
+ Count and audit tools return the smallest summary that preserves symbol identity, signature, reference and text-match accounting, unresolved evidence, collection status, and freshness. They do not include per-file reference groups, locations, performance, or memory observations by default.
72
+
73
+ The complete requested reference set remains available through `lsp_reference_page` and `lsp_unresolved_reference_page` using the returned `referenceSetId`. `lsp_references` creates or reuses a set when the consumer starts from an exact source position.
74
+
75
+ This keeps model context proportional to the question without making a compact response look more complete than its underlying collection. Presentation size never changes `collection.status`.
76
+
77
+ Detailed verified locations may be grouped by their exact source file because the file is a shared property of every location in that group. Pagination and counts remain location-based, and each location keeps its explicit range and discovery method. Reference locations have no cross-file ordering contract. Status, freshness, unresolved candidates, and unlike evidence are not grouped merely to shorten output.
78
+
79
+ ## Named Selection Reports Ambiguity Without Inferring Identity
80
+
81
+ Named-symbol tools report whether exact declaration filtering selected zero, one, or multiple definitions. A `fileHint` narrows declarations already reported by the owning provider; it does not turn a matching filename, Vue component name, import alias, or test double into declaration evidence.
82
+
83
+ When selection is empty or ambiguous, continuation guidance points consumers toward structural or position-based tools. Reference-page guidance appears only when the response contains a reusable reference set. This keeps ambiguity actionable without guessing which homonymous symbol the consumer intended.
84
+
85
+ A named audit may separately verify that an exact text occurrence resolves to a `fileHint` target. This binding evidence retains its source position, target definitions, resolution method, complete classification counts, and unresolved accounting. It does not promote the target filename or local alias into a named declaration, and the lighter count tool does not perform these per-match definition requests.
@@ -45,10 +45,29 @@ Run the complete local validation sequence before reviewing a distribution chang
45
45
  ```bash
46
46
  npm run check
47
47
  npm run check:runtime
48
+ npm run check:documentation
48
49
  npm run smoke:ci
50
+ npm run smoke:negative
51
+ npm run smoke:doctor
49
52
  npm run smoke
50
53
  npm run smoke:vue
54
+ npm run smoke:lifecycle
51
55
  npm run smoke:distribution
52
56
  ```
53
57
 
54
58
  Run `npm run doctor` separately when the structured installation evidence is part of the review. Exit `2` is an explicit untrusted diagnostic result and must not be described as a clean semantic pass.
59
+
60
+ ## Release Verification
61
+
62
+ ```bash
63
+ npm run release:verify
64
+ npm run verify:published -- <version>
65
+ ```
66
+
67
+ The local release gate runs every configured source, runtime, semantic, evaluation, distribution, and benchmark check and reports all failures instead of stopping at the first one. It performs no publication or installed-plugin mutation.
68
+
69
+ Postpublication verification requires an explicit version and the matching `v<version>` repository tag. It queries that immutable registry version, installs it with a fresh temporary npm cache and consumer project, verifies the installed executable and manifest, then runs the installed doctor to cover MCP startup, tool discovery, TypeScript evidence, and Vue navigation. It also installs the plugin from the tag-pinned marketplace inside a temporary `CODEX_HOME` and verifies the enabled plugin version. Temporary state is removed afterward. An unavailable registry, marketplace, or network is reported as `blocked`.
70
+
71
+ ## Continuous Integration
72
+
73
+ GitHub Actions runs the complete release gate on Node.js 22 and 24 across Ubuntu, macOS, and Windows. A second Linux matrix runs the same gate on Node.js 22 across Ubuntu, Fedora, Arch Linux, and openSUSE. The gate verifies ripgrep before running static checks, runtime resolution, documentation, CI policy, negative fixtures, doctor, TypeScript and Vue semantics, provider lifecycle, package installation, and the short benchmark.
@@ -0,0 +1,72 @@
1
+ # Getting Started
2
+
3
+ Semantic JS MCP adds static semantic evidence to an agent's existing code investigation. These prompts are starting points; the agent should still inspect source, search text, and run focused checks when behavior matters.
4
+
5
+ ## Trace A Symbol
6
+
7
+ > Trace the named symbol `parseRequest` across this repository. Measure its scope first, verify the exact declaration and references, then inspect its direct callers and callees. Report unresolved or incomplete evidence explicitly.
8
+
9
+ ## Review A Security-Sensitive Change
10
+
11
+ > Review the authentication changes in this diff. Use semantic evidence to verify every material symbol and cross-workspace reference, corroborate reachability with text search and direct source inspection, and distinguish introduced defects from pre-existing behavior.
12
+
13
+ ## Check Current Diagnostics
14
+
15
+ > Check current diagnostics for `src/handler.ts`. Treat the file as clean only if the language server confirms the current document snapshot; otherwise report the result as untrusted and explain the required follow-up.
16
+
17
+ ## Reading Compact Results
18
+
19
+ The examples below show the decision-bearing fields. Actual responses also identify the producer, normalized request, presentation mode, and exact continuation tools.
20
+
21
+ ### Complete Evidence
22
+
23
+ ```yaml
24
+ result:
25
+ definitionSelectionStatus: one-definition-selected
26
+ semanticEvidence:
27
+ status: usable-as-requested
28
+ followUpReasons: []
29
+ collection:
30
+ status: complete
31
+ ```
32
+
33
+ This supports the requested static symbol claim. It does not prove runtime behavior or approve a change.
34
+
35
+ ### Partial Evidence
36
+
37
+ ```yaml
38
+ result:
39
+ semanticEvidence:
40
+ status: follow-up-required
41
+ followUpReasons:
42
+ - collection-is-partial
43
+ collection:
44
+ status: partial
45
+ continueWith:
46
+ - lsp_unresolved_reference_page
47
+ ```
48
+
49
+ Inspect the unresolved candidates and relevant source before making a coverage claim.
50
+
51
+ ### Untrusted Diagnostics
52
+
53
+ ```yaml
54
+ result:
55
+ evidence:
56
+ status: untrusted
57
+ reason: language-server-did-not-report-current-document
58
+ diagnosticsForCurrentDocument: null
59
+ collection:
60
+ status: partial
61
+ ```
62
+
63
+ An empty unconfirmed report is not a clean diagnostic result.
64
+
65
+ ### Startup Failure
66
+
67
+ ```yaml
68
+ status: blocked
69
+ reason: runtime-component-missing
70
+ ```
71
+
72
+ Run `semantic-js-mcp doctor` and report its structured runtime component evidence. A missing provider or unavailable command is an environment blocker, not a code pass or diagnostic result.
@@ -0,0 +1,67 @@
1
+ # Result Schema Migration
2
+
3
+ Semantic JS MCP increments `producer.resultSchemaVersion` when a tool-result
4
+ shape changes incompatibly. Consumers should validate this value before parsing
5
+ tool-specific evidence.
6
+
7
+ ## Schema 7
8
+
9
+ Schema 7 adds `result.semanticEvidence` to named counts and audits. Its
10
+ `status` is `usable-as-requested` only when collection is complete and exactly
11
+ one definition is selected. Otherwise `follow-up-required` includes every
12
+ applicable collection or definition-selection reason under `followUpReasons`.
13
+
14
+ Presentation mode, page size, and subset presentation never affect this
15
+ status. It summarizes whether the requested semantic result needs another
16
+ semantic step; it does not establish code correctness or runtime behavior.
17
+
18
+ ## Schema 6
19
+
20
+ Schema 6 replaces representational duplication with a compact response while
21
+ preserving collection scope and reusable evidence.
22
+
23
+ | Schema 5 | Schema 6 |
24
+ | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
25
+ | `server` and `resultSchema` objects | one `producer` object with `name`, `version`, and `resultSchemaVersion` |
26
+ | `continueWith` objects containing `tool` and `provides` | a list of exact tool names |
27
+ | `presentation.mode: summary-by-file` for audits | `presentation.mode: compact-summary` |
28
+ | per-file locations and operational metrics in count and audit summaries | `filesContainingReferences` plus a reusable `referenceSetId` |
29
+ | flat `result.locations` in reference pages | `result.referenceGroups`, grouped by exact source file |
30
+ | repeated `referenceSetId` values across result sections | one identifier in the initial count, audit, or reference result |
31
+ | diagnostic algorithm and hash in separate fields | `contentFingerprint: sha256:<hex>` |
32
+ | page offsets, requested page size, and derivable subset flags in presentation | normalized request values, returned counts, and `nextCursor` |
33
+
34
+ Use `lsp_reference_page` with a count or audit `referenceSetId` to retrieve
35
+ verified locations. Use `lsp_references` when starting from an exact source
36
+ position without an existing reference set.
37
+
38
+ Named counts and audits also report `definitionSelectionStatus`. Continuation
39
+ lists include `lsp_reference_page` only when at least one selected definition
40
+ produced a reusable reference set. Empty or multiple selection recommends
41
+ structural or position-based navigation instead of implying that a filename or
42
+ common symbol name established identity.
43
+
44
+ When `fileHint` selects no exact declaration, a named audit may additionally
45
+ return `fileHintResolution`. Its counts classify exact text matches by whether
46
+ their definitions resolve to the hinted path, elsewhere, or not at all. A
47
+ reported `sourcePositionForAudit` is one verified follow-up position and does
48
+ not change `definitionSelectionStatus`.
49
+
50
+ The collection contract is unchanged: omitted collection limits remain
51
+ unlimited, pagination affects presentation only, and unresolved candidates keep
52
+ the collection partial. Schema 6 does not convert incomplete evidence into a
53
+ complete result.
54
+
55
+ The CI adapter accepts only its canonical schema version. A schema 5 result is
56
+ reported as `blocked` rather than being interpreted through schema 6 rules.
57
+
58
+ Schema 6 diagnostic evidence may use
59
+ `current-document-snapshot-confirmed` for a pull result or
60
+ `document-content-changed-during-diagnostic-acquisition` when the source no
61
+ longer matches the analyzed snapshot.
62
+
63
+ Diagnostic results include one `provenance` object with `provider` and
64
+ `documentLanguage`. Each diagnostic item includes `embeddedRegion` and
65
+ `embeddedLanguage`. The finite values are generated in the protocol reference;
66
+ `unknown` means the source range or declared language did not establish a
67
+ supported classification.