Make adversarial generator seedable and random-looking#24
Merged
Conversation
Agent-Logs-Url: https://github.com/daedalus/ImpactGuard/sessions/b770aede-5d17-46d8-828e-3dfd0a29725c Co-authored-by: daedalus <115175+daedalus@users.noreply.github.com>
Agent-Logs-Url: https://github.com/daedalus/ImpactGuard/sessions/b770aede-5d17-46d8-828e-3dfd0a29725c Co-authored-by: daedalus <115175+daedalus@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
daedalus
May 6, 2026 21:08
View session
There was a problem hiding this comment.
Sorry @Copilot, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 4 minor |
| Security | 1 medium 12 high |
🟢 Metrics 20 complexity · 0 duplication
Metric Results Complexity 20 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The adversarial generator always produced identical, hardcoded pairs (fixed module names, parameter names, types), making outputs recognizable and non-reproducible-on-demand. Now every pair is randomized but fully reproducible via an optional
seedparameter.Changes
adversarial_generator.py_MODULES,_FUNC_NAMES,_PARAM_NAMES,_SCALAR_TYPES,_MISLEADING_KWONLY_NAMES,_DECORATOR_NAMES,_VERSION_SUFFIXES_rand_fqname(rng)and_rand_params(rng, n)helpers_strategy_*functions now accept arandom.Randominstance — module names, function names, parameter names, types, and decorators are all drawn from pools via the RNGgenerate()andgenerate_all()accept aseedkeyword argument; arandom.Random(seed)is created and threaded through all strategy callstests/test_adversarial_generator.pyTestSeedingclass covering: same seed → identical output, different seeds → different output, string seeds, unseeded invocation, and fqname variance across 20 seedsUsage