feat(spacing): per-keystroke spacing-policy signals (#24 foundation)#92
Merged
Conversation
Phase 2 of the spacing-policy epic (#14), per docs/SPACING_POLICY.md. Computes the two free signals from the existing suggestion results every keystroke (zero extra native calls), in a pure static helper for testability: - complete = typed word is a real dictionary word (mTypedWordValid AND source != user_typed) - prefixRichScore = fraction of candidates that are KIND_COMPLETION, [0..1] computeSpacingSignals(SuggestedWords) -> SpacingSignals; wired into setSuggestedWords to store mSpacingComplete / mSpacingPrefixRichScore. No behavior change yet — the signal-driven graceMs + two-gate Assisted tier (and the A11 insight readout) consume these next. SpacingSignalsTest: 6 cases (complete for real-dict / not for user-typed / not for invalid; prefix-rich fraction; empty). All green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 foundation of the spacing-policy epic (#14), per
docs/SPACING_POLICY.md. Start of #24.What
Computes the two free per-keystroke signals from the existing
mSuggestedWords(zero extra native calls), in a pure static helper so it's unit-testable without a liveInputLogic:complete= the typed word is a real dictionary word (mTypedWordValidand source!= user_typed)prefixRichScore= fraction of candidates that areKIND_COMPLETION, in[0..1](high = lots left to extend to → keep open; low = little left → safe to commit)computeSpacingSignals(SuggestedWords) → SpacingSignals, wired intosetSuggestedWordsto storemSpacingComplete/mSpacingPrefixRichScore.No behavior change yet
This just lays the signal layer. The signal-driven
graceMs+ the two-gate Assisted tier + the A11 insight readout consumemSpacingComplete/mSpacingPrefixRichScorein the next increments (still all behind the experimental flag / default-off). The two fields are intentionally write-only for now.Verification
New
SpacingSignalsTest— 6 cases (complete for real-dict, not for user-typed, not for invalid; the prefix-rich fraction; empty input). All green. No other behavior touched.