Skip to content

Let AI predictions fill empty prediction slots - #1038

Merged
enaboapps merged 2 commits into
mainfrom
claude/1037-ai-prediction-slots
Oct 13, 2026
Merged

enaboapps merged 2 commits into
mainfrom
claude/1037-ai-prediction-slots

Conversation

@enaboapps

@enaboapps enaboapps commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1037

What changed

  • model.rs: when the AI refinement arrives, its words follow the normal predictions and take the next free slot, so [help, _, _, helpful, helping, helped] becomes [help, helpful, helping, helped, _, _]. There are still at most three AI words.
  • worker.rs: each shown word takes the next free slot, so a word dropped because it doesn't match the typed prefix no longer leaves a gap. Labels and inserts share the same index, so accepting a slot still inserts the word shown there.
  • Normal predictions keep their order and stay first. They are worked out the same way for the immediate and refined batches, so a refinement never moves a word that's already on screen. While the prediction row is being scanned, the keyboard still holds a refinement back until scanning leaves the row, as before.

Validation

  • Independent review on the first head found that the ignored neural_integration_benchmark still assumed AI words were in slots 3-5. That is fixed, and an end-to-end engine test (generated_words_fill_slots_the_instant_words_left) is added. A second independent review on 7f51619 reported no actionable findings.
  • New tests: generated_words_take_the_next_free_slot (model merge) and unshown_words_leave_no_gap (worker labels and acceptance); refinement_preserves_the_displayed_acceptance_and_retires_it_on_ack updated for the compacted slot.
  • npm run lint, npm test (295 passed), npm run build, cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test (761 passed, 5 ignored): all pass locally on Windows.
  • npm run prediction-model failed locally with an EPERM rename in .cache/prediction-neural, a Windows file lock unrelated to this change. CI runs it on clean runners.

🤖 Generated with Claude Code

Generated words now follow the instant words in the next free slot
instead of always starting at slot four, and words that can't be
shown for the typed prefix no longer leave gaps.

Closes #1037

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enaboapps enaboapps added this to the v1.0.0-rc.25 milestone Oct 13, 2026
The neural benchmark assumed generated words always sit in slots four
to six. Add an engine test for generated words filling instant slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enaboapps
enaboapps marked this pull request as ready for review October 13, 2026 10:18
@enaboapps
enaboapps merged commit 1c000d7 into main Oct 13, 2026
6 checks passed
@enaboapps
enaboapps deleted the claude/1037-ai-prediction-slots branch October 13, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let AI predictions fill empty prediction slots

2 participants