aaronsb_obsidian-mcp-plugin/tests
Aaron Bockelie 535dfd1c53 fix(mcp): stop debug route shadowing the GET /mcp SSE stream + two-row Levenshtein
Reimplemented from PR #126 (djsplice, who also reported #125), reduced to
the parts that are verified-clean. The worker-offload half of #126 is split
out to a tracking issue (inert as wired + correctness divergences — see PR
discussion / the follow-up issue).

SSE route deconfliction
  In @modelcontextprotocol/sdk@1.29.0 (the pinned version), `GET /mcp` is
  the standalone server->client SSE stream for server-initiated messages —
  verified in webStandardStreamableHttp.js:handleGetRequest (opens
  `_GET_stream`, Content-Type text/event-stream, gated on
  Accept: text/event-stream + session + protocol version). A debug route
  returning application/json on `GET /mcp` shadowed it, so any client that
  opens the standalone stream (mcp-remote-class bridges — #128's logs show
  one in use here) received JSON instead of an SSE stream and treated it as
  failed. Moved debug to `GET /mcp-info`; `GET /mcp` and `POST /mcp` both
  reach handleMCPRequest. Unlike #126's `app.all('/mcp')`, GET/POST are
  registered individually so the existing explicit `app.delete('/mcp')`
  session-close handler is preserved.

  Scope note: this restores the server-initiated-notification channel (a
  real latent defect on its own). It is NOT claimed to fix #128 — per the
  #190 investigation that is a separate SDK-1.29 compat-init problem — and
  #125's "SSE reconnection loop" is the reporter's un-reproduced diagnosis.

Two-row Levenshtein
  fuzzy-match.ts rewritten from a full (m+1)x(n+1) matrix to a two-row
  formulation (O(n) memory, no per-line array-of-arrays allocation) plus
  length heuristics and a 0.95 early-exit. Pure CPU/memory win on the
  main-thread edit.window path; behaviour-preserving. Adds the first
  fuzzy-match tests (classic Levenshtein distances, symmetry,
  heuristic-preservation).

build.yml: PR-status-comment step set continue-on-error so it cannot red an
otherwise-green build on fork/limited-token PRs.

Co-authored-by: djsplice <barrows.jeff@gmail.com>
2026-05-18 21:05:22 -05:00
..
__mocks__ fix(vault): Recurse listFiles into subfolders (#154) 2026-05-15 13:16:45 -05:00
fixtures harden(bases): runtime-computed-member escape test + scope scanner claim 2026-05-16 23:03:43 -05:00
security fix(tls): drop inert rejectUnauthorized:false default, clears scorecard Risk 2026-05-16 11:59:51 -05:00
validation test: Add comprehensive unit tests for input validation 2025-12-03 12:55:01 -06:00
bases-expression-evaluator.test.ts feat(bases): replace new Function with expression-eval (ADR-201) 2026-05-16 22:57:43 -05:00
bases-yaml.test.ts test(bases): address #182 review — accurate date-safety rationale + explicit divergences 2026-05-16 14:20:23 -05:00
combine-inline-router.test.ts fix(vault): inline combine sourceFiles must match combined order 2026-05-18 12:20:48 -05:00
combine-inline.test.ts feat(vault): return combined content inline when destination is omitted 2026-05-18 08:10:12 -05:00
dataview-integration.test.ts fix(dataview): serialize Luxon dates and propagate Dataview-internal errors 2026-05-15 15:00:11 -05:00
fuzzy-match.test.ts fix(mcp): stop debug route shadowing the GET /mcp SSE stream + two-row Levenshtein 2026-05-18 21:05:22 -05:00
graph-search-traversal.test.ts fix: Fix test failures by properly mocking TFile class 2025-07-05 10:37:24 -05:00
list-files-recursive.test.ts fix(vault.list): Align paginated recursive sort with flat listFiles 2026-05-15 13:40:35 -05:00
mcp-server.test.ts fix: Mock fs module in tests to prevent certificate directory creation (v0.9.0a) 2025-08-12 10:52:39 -05:00
patch-operations.test.ts feat: Implement structured patch targeting for headings, blocks, and frontmatter 2025-07-06 22:47:02 -05:00
read-only-mode.test.ts refactor: Remove concurrent mode toggle, simplify connection setup (ADR-100) 2026-03-14 23:13:35 -05:00
recursive-copy.test.ts fix: Eliminate all eslint any-type violations for Obsidian plugin review 2026-02-03 21:51:55 -06:00
search-tag-operator.test.ts feat: add tests for searches with the tag operator 2025-08-16 15:46:55 +01:00
setup.ts feat: Add linting, testing, and development documentation 2025-06-27 11:18:36 -05:00