feat(tui): generate fuzzyMatch/fuzzyFilter via fluessig (f64/uint32 path)#334
feat(tui): generate fuzzyMatch/fuzzyFilter via fluessig (f64/uint32 path)#334zmaril wants to merge 1 commit into
Conversation
…ath) Swap the hand-written `fuzzyMatch`/`fuzzyFilter` napi exports (packages/tui/ src/fuzzy.ts) to fluessig-generated ops, exercising the #77 float/unsigned scalar arms now available at the bumped pin (e056bb9): - `FuzzyMatchResult.score` is authored as `float64` -> lowers to Rust `f64`, crossing to JS `number` (byte-identical `score: number`). - `fuzzyFilter` returns `{ list: uint32 }` -> Rust `Vec<u32>`, crossing to JS `Array<number>` (byte-identical), the ranked surviving indices. Author the two ops + the `FuzzyMatchResult` model in schema/api.json, add the `core_impl` delegations into `pidgin_tui`'s fuzzy layer (same logic the hand-written exports called), regenerate src/generated.rs, and delete the hand-written `#[napi]` exports. The generated `.d.ts`/`.js`/nativeBinding entries for all three symbols are byte-identical to the pre-swap build; pi's own test/fuzzy.test.ts oracle passes 14/14 against the locally-built addon. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xL2W7dkhPsTSRuXQNCDeY
Conformance smoke: agent + ai + tui
Headline is rust-backed: passing cases in files whose module-under-test is a native (Rust addon) module. Raw all-pass is shown secondary — it is inflated by unflipped TypeScript that passes without touching any Rust.
agent: 55/180 (30.6%) · ai: 74/1295 (5.7%) · tui: 375/678 (55.3%) rust-backed = passing / total tests run, per the manifest's per-native-row AttributionA pi test file is rust-backed iff the module it primarily exercises — its module-under-test — is Per-file decisions (from each native manifest row's
CLI conformance (black-box, against the pidgin binary)
The four repointed coding-agent CLI test files spawn the compiled pidgin binary via |
Stacked on
napi-fluessig/fluessig-pin-e056bb9. First module swap to exercise thefluessig #77 float/unsigned scalar arms now available at the bumped pin
(
e056bb9):float64→ JSnumber,uint32→ JSnumber.What
Swap the hand-written
fuzzyMatch/fuzzyFilternapi exports(
packages/tui/src/fuzzy.ts) to fluessig-generated ops:FuzzyMatchResult.scoreauthored asfloat64→ lowers to Rustf64,crosses to JS
number(.d.ts:score: number).fuzzyFilterreturns{ list: uint32 }→ RustVec<u32>, crosses toJS
Array<number>— the ranked surviving indices.Authored the two ops + the
FuzzyMatchResultmodel inschema/api.json, addedcore_impldelegations intopidgin_tui's fuzzy layer (the same logic thehand-written exports called), regenerated
src/generated.rs, and deleted thehand-written
#[napi]exports.The key question: did
float64/uint32byte-match?Yes. All three swapped symbols' generated
.d.tsblock +.jsexport +nativeBinding entry are byte-identical to a pre-swap build of the base
(
704801c):FuzzyMatchResultinterface —matches: boolean,score: number— identical.fuzzyMatch(query, text): FuzzyMatchResult— identical (JSDoc + decl).fuzzyFilter(texts, query): Array<number>— identical (JSDoc + decl).module.exports.fuzzyMatch/fuzzyFilter+ nativeBinding destructuring — identical.Gates
704801cbuild: 3/3 symbols identical.cargo build -p pidgin-napi,cargo fmt --all --check,cargo clippy -p pidgin-napi --all-targets -- -D warnings: clean. codespell: 0.git archive HEAD: 0 errors.packages/tui/test/fuzzy.test.ts(node --test) against thenative shim backed by the locally-built addon: 14/14 pass
(
fuzzyMatch+fuzzyFiltersuites), exercising the f64 score and uint32indices end-to-end.
🤖 Generated with Claude Code
https://claude.ai/code/session_017xL2W7dkhPsTSRuXQNCDeY
Generated by Claude Code