Skip to content

feat(text): bounded similarity scoring for application name suggestions #184

Closed

Description

@zackees

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

  1. zackees commented on Sep 13, 2026

    @zackees
    CollaboratorAuthor

    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.

  2. zackees commented on Sep 16, 2026

    @zackees
    CollaboratorAuthor

    Complete and adopted on both sides; closing with the evidence rather than leaving it open.

    kernal-api — gated behind text-similarity, implemented in src/text.rs. with tests/text_similarity.rs as its contract tests, and documented in docs/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions