Title: mcpx: one definition of 'close' -- a shared near-miss matcher for search, diagnostics and launcher placeholders · Issue #1904 · developing-today/code · GitHub
Open Graph Title: mcpx: one definition of 'close' -- a shared near-miss matcher for search, diagnostics and launcher placeholders · Issue #1904 · developing-today/code
X Title: mcpx: one definition of 'close' -- a shared near-miss matcher for search, diagnostics and launcher placeholders · Issue #1904 · developing-today/code
Description: Relocated from dezren39/darwin-nix#186 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/ni...
Open Graph Description: Relocated from dezren39/darwin-nix#186 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue referenc...
X Description: Relocated from dezren39/darwin-nix#186 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue refe...
Opengraph URL: https://github.com/developing-today/code/issues/1904
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx: one definition of 'close' -- a shared near-miss matcher for search, diagnostics and launcher placeholders","articleBody":"Relocated from dezren39/nix#186 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).\n\nParent: #176\n\n## Summary\n\nmcpx already has **two** \"is this name close to that one?\" implementations, and two open issues propose more: #109's\ntypo tolerance in search and #111's near-miss detection on a failed call. Written separately they diverge, and\nsearch, diagnostics and the launcher end up disagreeing about what \"close\" means -- a user sees \"did you mean\n`list_issues`?\" from one surface and no match from another for the same typo. This issue owns one definition.\n\n**Owns #181 collision 6:** one definition of \"close\" -- normalisation, distance and threshold -- for search (#109),\ndiagnostics (#111 and today's `diagnose`) and the launcher.\n\n## Original notes\n\n> - better natural language processing search\n\nThe other source is the \"they used search instead of query\" clause of the long \"check inputs\" bullet, quoted in full\nin #111.\n\n## Current state (05c78b2)\n\n| Where | What | Used for |\n| --- | --- | --- |\n| `internal/diagnose/diagnose.go:417-455` | `nearest` + plain Levenshtein `editDistance`, lower-cased, accepted within `1+len/3` (`:432`) | \"the closest name it does have is ...\" (`:298`) in deterministic diagnostics (#58) |\n| `internal/launcher/template.go:341-381` | `looksLikePlaceholder`: distance \u003c= 1, or one adjacent swap, or a prefix of length > 2 | refusing a misspelt `@placeholder` (#7) |\n| #109 (proposed) | typo tolerance over tool and namespace names (not descriptions), after exact scoring finds nothing | search ranking |\n| #111 (proposed) | near-miss on a failed call | repair ladder rung 1 |\n\nThe two shipped ones already disagree: the launcher counts a transposition as one edit and accepts prefixes;\ndiagnostics count a transposition as two and do not.\n\n## Approaches\n\n**A -- leave each caller its own.** Zero work now; guaranteed divergence, and the tests of each encode a different\nanswer for the same pair of strings.\n\n**B -- extract `diagnose.editDistance` and have #109 call it.** Small and cheap. Leaves the launcher's (different)\ndefinition in place, and fixes only the distance, not the normalisation (case, `_`/`-`/camelCase splitting) or the\nthreshold, which is where the disagreements actually show.\n\n**C -- recommended: one small package that defines \"close\".** Normalise (case-fold; split `snake_case`, `kebab-case`\nand `camelCase` -- the same splitting #109 proposes for search), measure with Damerau-Levenshtein (a transposition is\none edit, as the launcher already assumes), accept within a length-relative threshold, and break ties\ndeterministically. Diagnostics, the launcher and #109/#111 all call it; a table test pins the examples each issue gives.\n#109 keeps everything that is *ranking* (tags, synonyms, BM25-style scoring); only the near-miss predicate and the\ndistance are shared. Recommended because it is the only option where fixing a false positive in one surface fixes it\nin all of them.\n\n**Out of scope: argument-shape matching.** #111's own example (\"they used search instead of query\") is not a typo:\n`search`->`query` is edit distance 5 and `olderThan`->`olderThanDays` is 4, beyond any sane threshold. Those are found by\nwhich tool's schema the supplied arguments fit, which stays in #111. This issue answers only \"is this string a\nmisspelling of that one\".\n\n## Open questions\n\n- Threshold: absolute (\u003c=1 for short names, \u003c=2 otherwise) or a ratio? Pick using real tool names from the catalogue.\n- Should a namespace be matched separately from the tool (`gihtub.list_issues` vs `github.list_isues`)?\n- Does the launcher's fixed placeholder vocabulary want a stricter threshold than open-ended tool names?\n- The launcher checks near misses against the **built-in** placeholder names only (`internal/launcher/template.go:299-358`), so a misspelt *declared* placeholder (#7) passes silently. The shared matcher should take the corpus as an argument so the launcher can pass built-ins plus declared names.\n- Line numbers above are at 05c78b2. #116 (in flight with SURFACES) edits `CallError` in the same file, below these\n lines; on its current branch `nearest`/`editDistance` are untouched.\n\n## Ease · Impact · Related\n\n**Ease** S · **Impact** med\nRelated: #109, #111 (consumers), #7 (launcher placeholders), #181 (collision 6).\n\nSecurity/auth deferred; see tracker.\n\n## Acceptance criteria\n- One shared near-miss matcher exists and is used by search, diagnostics, and every other surface the issue names; no surface keeps its own definition of 'close'.\n- Tests pin the matcher semantics (thresholds, tie-breaking) once, in the shared implementation.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-28T22:23:57Z","url":"https://github.com/developing-today/code/issues/1904"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a1762375-4fbc-15a2-4937-e9173ebd7780 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8FBA:174DE2:307345:40FAC5:6B06180D |
| html-safe-nonce | e578701b6137ed70b2939f66ad968443c2c03e98dac04575178d600914ebb76f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkJBOjE3NERFMjozMDczNDU6NDBGQUM1OjZCMDYxODBEIiwidmlzaXRvcl9pZCI6IjY3NzgzMjg4MDQzNjU4MzQyNTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6f9fead1de013e797c44fe918e4bd32a4b1dacdba6b35ce21c839292aa70c885 |
| hovercard-subject-tag | issue:6088604766 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/1904/issue_layout |
| twitter:image | https://opengraph.githubassets.com/69127da81638d9e6300a9ea52d2f1fac80fe77503808a443fee716844988d54b/developing-today/code/issues/1904 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/69127da81638d9e6300a9ea52d2f1fac80fe77503808a443fee716844988d54b/developing-today/code/issues/1904 |
| og:image:alt | Relocated from dezren39/darwin-nix#186 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue referenc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width