Commit Graph
2 Commits
Author SHA1 Message Date
VERSE f54e97a6c0 fix: enhance prompt (#36)
* Enforce verbatim input buffer prefix and add few-shot examples in
system prompt
* Omit empty context fields and format recent commands line by line
* Wrap untrusted data (`GitStatus`, `RecentCmds`, `DynamicContext`, and
`PreviousCommand`) in an explicit security boundary to prevent prompt
injection vectors
* Optimize string formatting with direct `fmt.Fprintf` inside
`BuildCompletionPrompt` to resolve `QF1012` staticcheck warnings
* Restore exact character prefix in `NormalizeSuggestion` to keep
`ShouldOverwrite` logic accurate
* Auto-join all continuation suffix completions (flags, quotes, regular
word arguments, and filenames) and insert a separating space whenever
the buffer ends in an ordinary word character
* Replace byte-indexed slicing with rune-safe slices (`[]rune`) and
`strings.EqualFold` to guarantee valid UTF-8 boundaries and prevent
panics on multi-byte characters
* Update and verify all unit tests (`go test -race ./internal/ai/...`)
with zero impact on other branches
2026-07-13 10:15:43 +07:00
VERSE 1e04949242 refactor: better project structure (#35)
This project is starting to grow, and I've seen flaws in the initial
project structure design
I think I'll restructure the entire project directory for better
scalability and also cleaner
2026-07-11 16:15:05 +07:00