Repository navigation
NMSh Native Suggestions v2 #138
Copy link
Copy link
Closed
Labels
area:performancePerformance and renderingPerformance and renderingarea:shellShell backend and integrationShell backend and integrationtype:featureNew feature or improvementNew feature or improvement
Milestone
Description
Goal
Upgrade the current history-prefix ghost text into a modern predictive engine, using ideas validated by tools such as Deja, zsh-autosuggestions and Atuin.
Target features
- Fuzzy matching (in-order subsequence with sensible spread limits)
- Frecency
- Directory / project affinity
- Previous-command sequence prediction
- Ranked alternatives
- Accept full suggestion
- Accept next word
- Optional empty-prompt prediction (setting)
- Suggestion suppression/dismissal
- Privacy / history-ignore behavior (leading space,
HISTORY_IGNORE) - Local-only storage
- Low-latency per-keystroke results
UX / product direction
- Exact scoring weights are not prescribed. Tune with benchmarks on realistic histories (for example 10k, 100k and 500k entries).
- Failed commands are de-prioritized, not hidden.
Architectural constraints
- Uses Rich history search and metadata #143 metadata (cwd, exit, session, time) when available and falls back to plain zsh history.
- Scoring must be able to move into a persistent process or cache later (for example the Live sessions: local session service owning PTY and zsh #127 service or a worker) if profiling warrants it. TypeScript first (Performance strategy: TypeScript first, native helpers only when measured #155).
Acceptance criteria
- All target features implemented behind the Suggestion providers and predictive ghost text #137 interface.
- A benchmark fixture measures query latency on large histories, and the budget is met without blocking keystrokes.
- Ranking tests cover fuzzy, frecency, directory and sequence cases.
- Ignored commands are never suggested or learned.
Dependencies / related
Part of #137. Related #75, #143, #155.
Research references
- Deja: https://github.com/Giammarco-Ferranti/deja (fuzzy, frecency with decay, directory affinity, sequence prediction)
- zsh-autosuggestions
match_prev_cmd: https://github.com/zsh-users/zsh-autosuggestions - Atuin: https://github.com/atuinsh/atuin
- McFly: https://github.com/cantino/mcfly (ranking ideas only)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:performancePerformance and renderingPerformance and renderingarea:shellShell backend and integrationShell backend and integrationtype:featureNew feature or improvementNew feature or improvement
Activity
raiseCatError commentedon Sep 27, 2026
Merged to dev (PR #160). All target features behind the #137 interface: fuzzy/acronym, frecency, directory affinity, sequence prediction, ranked alternatives, full/next-word accept, dismiss, optional empty-prompt prediction, privacy (leading space, HISTORY_IGNORE, ZSH_AUTOSUGGEST_HISTORY_IGNORE), in-memory only. Replay on real history: top-1 ghost accuracy after 1 char 22.6% → 39.2%. Synthetic worst case 500k unique: p95 15 ms, chunked load. CI green, 474/474.