summaryrefslogtreecommitdiffhomepage
path: root/packaging
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-02 20:46:23 +0900
committerAdam Malczewski <[email protected]>2026-06-02 20:46:23 +0900
commit80212bfb009eaf71a4743310dee6ed08b8f7e1da (patch)
tree81b1873f4a276116cf019cbcdecdd8fcba56beef /packaging
parent09914c6ba15214d5ec05c106d5d11fd14a86f532 (diff)
downloaddispatch-80212bfb009eaf71a4743310dee6ed08b8f7e1da.tar.gz
dispatch-80212bfb009eaf71a4743310dee6ed08b8f7e1da.zip
fix(search_code): fuzzy mid-word matching + Luau/fuzzy live test coverage
Address the remaining real defects from the Luau/cs test reports. The wrapper- level findings (dash-leading queries, context flag, no-match message, empty query, path-is-file) were already fixed in earlier commits and verified through the tool; the two genuinely-open items were engine-level, plus a test-coverage gap (the patch-dependent behaviors were only exercised by live tests that skip without a cs binary). - Engine fix (docker/cs/fuzzy-distance.patch): cs's fuzzy `term~N` only scanned same-length windows, so it matched substitutions but never mid-word insertions/deletions — e.g. `computSlipAngle~1` (a dropped 'e') failed to find `computeSlipAngle`, contradicting cs's own "within 1 or 2 distance" docs. Now scan windows of length termLen±maxDist (true Levenshtein) and keep the best per offset. Updates one pre-existing cs test that encoded the buggy substitution-only behaviour and adds mid-word insert/delete cases. Passes cs's pkg/search + pkg/ranker suites; builds clean against the pinned commit. - Provisioning: apply the new patch everywhere the Luau patch is applied — Dockerfile, Dockerfile.dev, packaging/PKGBUILD build() — so every install path (Docker bin/up, native code-search package via bin/service install) ships both patches. - Tests: add skip-gated live tests for Luau declaration detection (function / local function / type / export type), only=usages exclusion, the Luau language tag, and fuzzy mid-word matching. New capability probes (findLuauCapableCs / findFuzzyCapableCs) run these only on a cs that actually has each patch and skip (never fail) on an unpatched/absent binary. Default suite: 600 pass / 12 skip; with a both-patched cs: 612 pass / 0 skip. - Docs: UPSTREAM_CS_FUZZY_BUG.md documents the unreported upstream defect for a potential boyter/cs PR; CS_ARTIX_DEPLOY.md updated to reflect that sync-dispatch.sh now ships the code-search package (carrying both patches). biome + tsc (core/api/frontend) + svelte-check all green.
Diffstat (limited to 'packaging')
-rw-r--r--packaging/PKGBUILD4
1 files changed, 3 insertions, 1 deletions
diff --git a/packaging/PKGBUILD b/packaging/PKGBUILD
index 8918a30..878b15f 100644
--- a/packaging/PKGBUILD
+++ b/packaging/PKGBUILD
@@ -62,7 +62,8 @@ build() {
bun install --frozen-lockfile --production
# --- Build the patched `cs` code-search binary for the search_code tool ---
- # Clone the pinned cs commit, apply the Luau declaration patch, and build a
+ # Clone the pinned cs commit, apply the Luau declaration + fuzzy-distance
+ # patches, and build a
# statically-linked binary. cs vendors its deps, so `go build -mod=vendor`
# needs no network beyond the clone. Mirrors the Docker cs-builder stage.
#
@@ -76,6 +77,7 @@ build() {
cd "${srcdir}/cs-src"
git checkout "${_cs_commit}"
git apply "${_projectdir}/docker/cs/luau-declarations.patch"
+ git apply "${_projectdir}/docker/cs/fuzzy-distance.patch"
CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPATH="${srcdir}/gopath" GOCACHE="${srcdir}/gocache" \
go build -ldflags="-s -w" -o "${srcdir}/cs" .
"${srcdir}/cs" --version