Bugs Found via Testing
1. Empty/whitespace input returns suggestion instead of nothing
$ aprender-shell suggest ""
git status 1.000
$ aprender-shell suggest " "
git status 1.000
Expected: No output for empty/whitespace-only input
Impact: Widget shows suggestions when user hasn't typed anything
2. Missing model file causes panic instead of graceful error
$ aprender-shell suggest "git " --model /nonexistent.bin
thread 'main' panicked at src/main.rs:424:46:
Failed to load model: Custom { kind: Other, error: "I/O error: No such file or directory (os error 2)" }
Expected: Clean error message with exit code 1, not panic
Fix:
let model = Model::load(&model_path).unwrap_or_else(|e| {
eprintln!("Error: Could not load model '{}': {}", model_path.display(), e);
std::process::exit(1);
});
3. Double-dash prefix causes argument parsing error
$ aprender-shell suggest "--"
error: the following required arguments were not provided:
<PREFIX>
Cause: -- is interpreted as end-of-options separator
Fix: Use -- before the prefix argument in the CLI definition, or require:
$ aprender-shell suggest -- "--help" # This should work
4. Export creates binary file but suggests .json extension
$ aprender-shell export /tmp/model.json
✅ Model exported to: /tmp/model.json
$ file /tmp/model.json
/tmp/model.json: data # Not JSON!
Expected: Either export actual JSON, or use .bin/.aprn extension in examples
5. Null byte in input not sanitized
$ aprender-shell suggest $'git \x00status'
git status 1.000
Impact: Potential security issue with shell injection if suggestion is used unsafely
Environment
- aprender-shell 0.1.0
- Linux x86_64
Bugs Found via Testing
1. Empty/whitespace input returns suggestion instead of nothing
Expected: No output for empty/whitespace-only input
Impact: Widget shows suggestions when user hasn't typed anything
2. Missing model file causes panic instead of graceful error
Expected: Clean error message with exit code 1, not panic
Fix:
3. Double-dash prefix causes argument parsing error
Cause:
--is interpreted as end-of-options separatorFix: Use
--before the prefix argument in the CLI definition, or require:4. Export creates binary file but suggests .json extension
Expected: Either export actual JSON, or use
.bin/.aprnextension in examples5. Null byte in input not sanitized
$ aprender-shell suggest $'git \x00status' git status 1.000Impact: Potential security issue with shell injection if suggestion is used unsafely
Environment