-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: align hallucinated package named with outputs (#1076)
Previously, `packagehallucination` probes would attach a list of the names of all hallucinated packages at detection time, but this was hard to link back to individual outputs. This PR makes the reporting of hallucinated packages a list of lists aligned with outputs. ## Example given an output output: `["import not_a_real_package", "import sys", "pass"]` after running `garak.detectors.packagehallucination.PythonPypi()` on this, **without PR:** `attempt.notes["hallucinated_python_packages"]` would be `["not_a_real_package"]` **with PR:** `attempt.notes["hallucinated_python_packages"]` is `[["not_a_real_package"], [None], []]` ## Verification List the steps needed to make sure this thing works - [ ] python -m pytest -vvv tests/detectors/test_detectors_packagehallucination.py::test_result_alignment
- Loading branch information
Showing
3 changed files
with
280 additions
and
31 deletions.
There are no files selected for viewing
186 changes: 186 additions & 0 deletions
186
garak/data/packagehallucination/rust_std_entries-1_84_0
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
array | ||
bool | ||
char | ||
f32 | ||
f64 | ||
fn | ||
i8 | ||
i16 | ||
i32 | ||
i64 | ||
i128 | ||
isize | ||
pointer | ||
reference | ||
slice | ||
str | ||
tuple | ||
u8 | ||
u16 | ||
u32 | ||
u64 | ||
u128 | ||
unit | ||
usize | ||
f16Experimental | ||
f128Experimental | ||
neverExperimental | ||
Modules | ||
alloc | ||
any | ||
arch | ||
array | ||
ascii | ||
backtrace | ||
borrow | ||
boxed | ||
cell | ||
char | ||
clone | ||
cmp | ||
collections | ||
convert | ||
default | ||
env | ||
error | ||
f32 | ||
f64 | ||
ffi | ||
fmt | ||
fs | ||
future | ||
hash | ||
hint | ||
i8Deprecation | ||
i16Deprecation | ||
i32Deprecation | ||
i64Deprecation | ||
i128Deprecation | ||
io | ||
isizeDeprecation | ||
iter | ||
marker | ||
mem | ||
net | ||
num | ||
ops | ||
option | ||
os | ||
panic | ||
path | ||
pin | ||
prelude | ||
primitive | ||
process | ||
ptr | ||
rc | ||
result | ||
slice | ||
str | ||
string | ||
sync | ||
task | ||
thread | ||
time | ||
u8Deprecation | ||
u16Deprecation | ||
u32Deprecation | ||
u64Deprecation | ||
u128Deprecation | ||
usizeDeprecation | ||
vec | ||
assert_matchesExperimental | ||
async_iterExperimental | ||
autodiffExperimental | ||
f16Experimental | ||
f128Experimental | ||
intrinsicsExperimental | ||
patExperimental | ||
pipeExperimental | ||
randomExperimental | ||
simdExperimental | ||
Macros | ||
assert | ||
assert_eq | ||
assert_ne | ||
cfg | ||
column | ||
compile_error | ||
concat | ||
dbg | ||
debug_assert | ||
debug_assert_eq | ||
debug_assert_ne | ||
env | ||
eprint | ||
eprintln | ||
file | ||
format | ||
format_args | ||
include | ||
include_bytes | ||
include_str | ||
is_x86_feature_detected | ||
line | ||
matches | ||
module_path | ||
option_env | ||
panic | ||
println | ||
stringify | ||
thread_local | ||
todo | ||
tryDeprecated | ||
unimplemented | ||
unreachable | ||
vec | ||
write | ||
writeln | ||
cfg_matchExperimental | ||
concat_bytesExperimental | ||
concat_identsExperimental | ||
const_format_argsExperimental | ||
format_args_nlExperimental | ||
log_syntaxExperimental | ||
trace_macrosExperimental | ||
Keywords | ||
SelfTy | ||
as | ||
async | ||
await | ||
break | ||
const | ||
continue | ||
crate | ||
dyn | ||
else | ||
enum | ||
extern | ||
false | ||
fn | ||
for | ||
if | ||
impl | ||
in | ||
let | ||
loop | ||
match | ||
mod | ||
move | ||
mut | ||
pub | ||
ref | ||
return | ||
self | ||
static | ||
struct | ||
super | ||
trait | ||
true | ||
type | ||
union | ||
unsafe | ||
use | ||
where | ||
while |
This file contains 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
Oops, something went wrong.