Repository navigation
Description
Context
Coordinated with FastLED/cli#229 and draft FastLED/cli#242. Two source investigations found one direct strsim caller: project::best_sketch_match, used by selection.rs for interactive sketch suggestions. FastLED first case-folds names and prefers substring matches, then scores candidates with Jaro-Winkler and retains every highest-score tie within 1e-9 in stable input order. Empty candidates return empty. No existing kernel similarity API or duplicate issue was found.
Proposal
Add a feature-gated, facade-owned bounded string similarity operation backed by one private exact strsim version. Keep candidate discovery, case folding, substring preference, tie tolerance/order, selection prompts and error presentation in FastLED. Generic scoring tests belong upstream; application suggestion policy regressions stay downstream.
Acceptance criteria
- Focused RED before implementation and GREEN afterward in both repositories.
- Public semantic API exposes only standard/facade-owned types, finite normalized scores and explicit invalid-limit/input-size errors; no backend re-export.
- Bound both input storage and worst-case comparison work before backend allocation; document UTF-8/scalar semantics, empty strings, Unicode and no implicit normalization.
- Preserve current scores and FastLED substring/tie behavior for accepted inputs, and propagate oversized-input errors explicitly instead of silently changing ranking or truncating text.
- Test known score vectors, symmetry, empty/equal/disjoint strings, Unicode, boundary sizes and rejected oversized work upstream; test substring precedence, case folding, stable ties and interactive integration downstream.
- Remove direct strsim manifests/imports, enforce boundary, pass feature isolation, lint/review and supported-platform CI.
- Consume an exact usable published release before closing the migration issue; no build-speed claim without measurements.
Decisions
- Use one semantic similarity operation, not a general matching framework or public backend module: the verified consumer needs scores only.
- Preserve Jaro-Winkler scoring rather than substitute a cheaper metric that could change selection.
- An explicit resource bound requires fallible downstream matching; update callers to propagate that error, not fallback to approximate/truncated scores.
- Heavy GUI/network dependencies must not be activated by the text feature; default remains useful and minimal.
Related issues
#155 tracks the complete FastLED dependency migration.
Activity
zackees commentedon Sep 13, 2026
Initial implementation is local in feat/text-similarity: facade-owned name_similarity with fixed 4096-byte per-input and 1,048,576 scalar-product bounds, private exact strsim0.11.1, no normalization/ranking policy. Choosing fixed limits removes the need for an invalid-configuration error; resource errors remain explicit. Observed RED missing kernal_api::text, then three focused tests GREEN, strict all-target Clippy GREEN. Broad tests and dependency isolation are running; review, FastLED fallible-call integration, publication and exact adoption remain outstanding.
zackees commentedon Sep 16, 2026
Complete and adopted on both sides; closing with the evidence rather than leaving it open.
kernal-api — gated behind
text-similarity, implemented insrc/text.rs. withtests/text_similarity.rsas its contract tests, and documented indocs/text-similarity.md. It landed with #220's application-foundations rebase.FastLED — adopted through the pinned release tag: crates/fastled-cli/src/project.rs:
kernal_api::text::name_similarity(&q_lower, &c.to_lowercase())🤖 Generated with Claude Code