-
-
Notifications
You must be signed in to change notification settings - Fork 3
v3.5.1 Patch #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3.5.1 Patch #234
Conversation
Refactor Flag class and improved functionality and accuracy tracking, and took the `Match.generate_summary_and_graph()` out of beta after minor patching Updated plans for the future 1/3 beta's out!
git should be the one we focus on and use, all history is preserved, and the --backup feature bloats the code Signed-off-by: Shahm Najeeb <[email protected]>
- Fixed crash when Git is not installed by implementing a proper existence check - Resolved issue where --debug misidentified ignored files as extra - Unified file comparison logic in --debug with _dev.py logic to avoid mismatches - Enhanced debug logging for better clarity and traceability - Fixed dev mode bug where, after max attempts, input was ignored even if valid - Added support for Python 3.13 in debug, thus no error will be thrown in the menu Signed-off-by: Shahm Najeeb <[email protected]>
When the init directories for data don't exist, it fails to be made, fixed this by making the first instance create the files (logger module inside the Logicytics module Signed-off-by: Shahm Najeeb <[email protected]>
…bug in zipping - Removed "Beta Mode" label from the --performance-check help text - Flag is now considered stable and ready for general use - Removed the memory usage section as it is unreliable and in very low values and is also influenced by other system apps - Renamed vulnscan folder and items to be bug free, as old name resulted in the files getting zipped - Found bug in vulnscan that causes a critical crash, will fix in next commit Signed-off-by: Shahm Najeeb <[email protected]>
Resolved crash when loading PyTorch model on systems without CUDA by implementing auto-detection of device availability (CPU/GPU). torch.load now uses map_location to ensure compatibility across environments. Signed-off-by: Shahm Najeeb <[email protected]>
WalkthroughThis update fixes directory name capitalization in config and ignore files, removes backup and memory profiling features, refactors flag-matching code into a nested class, improves error handling, updates some utility logic, and tweaks model loading and planned tasks. Mostly internal cleanup and reorganizing, no flashy new features. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Flag.Match
participant Model
participant History
User->>Flag.Match: Provide input query
Flag.Match->>Model: Compute semantic similarity scores
Model-->>Flag.Match: Return similarity results
Flag.Match->>History: Update usage stats and history
Flag.Match->>User: Return best flag match or suggestions
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements version 3.5.1 patch updates, focusing on device compatibility improvements, flag enhancements, and code cleanup. The main purpose is to stabilize Logicytics by fixing critical compatibility issues, promoting beta features to production, and removing deprecated functionality.
- PyTorch device compatibility fixes for non-CUDA systems
- Flag system enhancements including promotion of performance-check and addition of usage flag
- Removal of deprecated backup functionality and code refactoring
Reviewed Changes
Copilot reviewed 9 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| PLANS.md | Updates project roadmap with version reassignments and task reprioritization |
| CODE/vulnscan.py | Adds device detection and compatibility fixes for PyTorch model loading |
| CODE/logicytics/init.py | Adds comments and ensures directory initialization |
| CODE/logicytics/Logger.py | Ensures FileManagement.mkdir() is called during logger initialization |
| CODE/logicytics/Flag.py | Major refactoring of Flag class structure and removal of beta labels |
| CODE/logicytics/FileManagement.py | Removes backup-related functionality and updates file exclusion patterns |
| CODE/_dev.py | Fixes version validation logic and removes redundant mkdir call |
| CODE/_debug.py | Updates file checking logic and Python version compatibility |
| CODE/Logicytics.py | Removes backup functionality and memory usage tracking from performance checks |
Files not reviewed (2)
- .idea/Logicytics.iml: Language not supported
- .idea/webResources.xml: Language not supported
Comments suppressed due to low confidence (1)
CODE/_debug.py:135
- Python 3.14 does not exist yet. The latest stable Python version is 3.13. Consider using (3, 14) only if you're intentionally future-proofing for unreleased versions, otherwise use (3, 13) as the maximum.
MAX_VERSION = (3, 14)
Signed-off-by: Shahm Najeeb <[email protected]>
❌ 3 blocking issues (17 total)
@qltysh one-click actions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
CODE/_dev.py (1)
150-163: Fix the version validation logic - it can cause infinite loopsThere's a problem with how the max attempts check works now. The
attemptscounter gets incremented on line 162, but the max attempts check on line 157 only happens after the regex passes. This means if someone keeps entering invalid versions, they'll never hit the max attempts limit and get stuck in an infinite loop.The logic should be:
while True: version = color_print(f"[?] Enter the new version of the project (Old version is {VERSION}): ", "cyan", is_input=True) + attempts += 1 + + if attempts > max_attempts: + color_print("[x] Maximum attempts reached. Please run the script again.", "red") + exit() if re.match(r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$", version): _update_ini_file("config.ini", version, "version") break - elif attempts >= max_attempts: - color_print("[x] Maximum attempts reached. Please run the script again.", "red") - exit() else: color_print("[!] Please enter a valid version number (e.g., 1.2.3)", "yellow") - attempts += 1 color_print(f"[!] {max_attempts - attempts} attempts remaining", "yellow")
🧹 Nitpick comments (1)
CODE/logicytics/Flag.py (1)
473-477: New --usage flag looks good, but the help text could be clearerThe flag implementation is solid! Just a tiny suggestion - the help text could be a bit clearer about what it actually shows.
- help="Run's script that shows and gives your local statistics, on the flags used by you" + help="Shows statistics and graphs of your flag usage history"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
CODE/vulnscan/vectorizer.3n3.pklis excluded by!**/*.pkl
📒 Files selected for processing (12)
.gitignore(1 hunks).idea/Logicytics.iml(1 hunks).idea/webResources.xml(1 hunks)CODE/Logicytics.py(4 hunks)CODE/_debug.py(4 hunks)CODE/_dev.py(2 hunks)CODE/logicytics/FileManagement.py(2 hunks)CODE/logicytics/Flag.py(5 hunks)CODE/logicytics/Logger.py(2 hunks)CODE/logicytics/__init__.py(2 hunks)CODE/vulnscan.py(3 hunks)PLANS.md(1 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: DefinetlyNotAI
PR: DefinetlyNotAI/Logicytics#225
File: CODE/logicytics/Flag.py:583-592
Timestamp: 2025-05-31T12:42:30.615Z
Learning: In the Logicytics codebase, DefinetlyNotAI prefers using exit() over sys.exit() and doesn't want suggestions to change this pattern.
Learnt from: DefinetlyNotAI
PR: DefinetlyNotAI/Logicytics#225
File: CODE/logicytics/Flag.py:583-592
Timestamp: 2025-05-31T12:42:30.615Z
Learning: In the Logicytics codebase, DefinetlyNotAI prefers to allow lines longer than 100 characters when they make sense contextually, rather than enforcing strict line length limits.
CODE/logicytics/FileManagement.py (1)
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v2-deprecated/_generate_data.py:12-20
Timestamp: 2024-12-11T09:55:02.216Z
Learning: In CODE/VulnScan/v2-deprecated/_generate_data.py, the create_sensitive_file function doesn't need to include warnings about legality or sensitive data in the docstring.
CODE/logicytics/Logger.py (1)
Learnt from: ski-sketch
PR: #160
File: CODE/bluetooth_details.py:5-6
Timestamp: 2024-12-12T08:36:07.659Z
Learning: In the Logicytics project, the logger must be initialized under if __name__ == "__main__": in bluetooth_details.py, and should not be moved into functions or accept parameters.
CODE/logicytics/__init__.py (1)
Learnt from: DefinetlyNotAI
PR: #225
File: CODE/logicytics/Flag.py:583-592
Timestamp: 2025-05-31T12:42:30.615Z
Learning: In the Logicytics codebase, DefinetlyNotAI prefers using exit() over sys.exit() and doesn't want suggestions to change this pattern.
.gitignore (4)
Learnt from: DefinetlyNotAI
PR: #229
File: CODE/vulnscan.py:187-188
Timestamp: 2025-07-26T15:27:01.141Z
Learning: In CODE/vulnscan.py, the model and vectorizer file paths "vulnscan/Model SenseMini .3n3.pth" and "vulnscan/Vectorizer .3n3.pkl" intentionally include trailing spaces before the file extensions, and these match the actual file names on disk. The files will be renamed in the future to remove the trailing spaces.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v2-deprecated/_generate_data.py:106-109
Timestamp: 2024-12-11T09:55:36.823Z
Learning: The script CODE/VulnScan/v2-deprecated/_generate_data.py is designed to generate files and should not delete the generated files after generation.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v3/_generate_data.py:45-69
Timestamp: 2024-12-11T10:01:14.449Z
Learning: In CODE/VulnScan/v3/_generate_data.py, the script is not supposed to handle security concerns.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v3/_train.py:393-394
Timestamp: 2024-12-11T10:44:02.233Z
Learning: In CODE/VulnScan/v3/_train.py, path existence checks are performed in the validate_data() function.
.idea/webResources.xml (2)
Learnt from: DefinetlyNotAI
PR: #229
File: CODE/vulnscan.py:187-188
Timestamp: 2025-07-26T15:27:01.141Z
Learning: In CODE/vulnscan.py, the model and vectorizer file paths "vulnscan/Model SenseMini .3n3.pth" and "vulnscan/Vectorizer .3n3.pkl" intentionally include trailing spaces before the file extensions, and these match the actual file names on disk. The files will be renamed in the future to remove the trailing spaces.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v3/_train.py:393-394
Timestamp: 2024-12-11T10:44:02.233Z
Learning: In CODE/VulnScan/v3/_train.py, path existence checks are performed in the validate_data() function.
.idea/Logicytics.iml (1)
Learnt from: DefinetlyNotAI
PR: #229
File: CODE/vulnscan.py:187-188
Timestamp: 2025-07-26T15:27:01.141Z
Learning: In CODE/vulnscan.py, the model and vectorizer file paths "vulnscan/Model SenseMini .3n3.pth" and "vulnscan/Vectorizer .3n3.pkl" intentionally include trailing spaces before the file extensions, and these match the actual file names on disk. The files will be renamed in the future to remove the trailing spaces.
CODE/_dev.py (1)
Learnt from: DefinetlyNotAI
PR: #225
File: CODE/logicytics/Flag.py:583-592
Timestamp: 2025-05-31T12:42:30.615Z
Learning: In the Logicytics codebase, DefinetlyNotAI prefers using exit() over sys.exit() and doesn't want suggestions to change this pattern.
CODE/vulnscan.py (9)
Learnt from: DefinetlyNotAI
PR: #229
File: CODE/vulnscan.py:187-188
Timestamp: 2025-07-26T15:27:01.141Z
Learning: In CODE/vulnscan.py, the model and vectorizer file paths "vulnscan/Model SenseMini .3n3.pth" and "vulnscan/Vectorizer .3n3.pkl" intentionally include trailing spaces before the file extensions, and these match the actual file names on disk. The files will be renamed in the future to remove the trailing spaces.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/vulnscan.py:48-48
Timestamp: 2024-12-11T10:49:03.037Z
Learning: In CODE/vulnscan.py, when using PyTorch 2.5.1, it's appropriate to include the weights_only=False parameter in torch.load() to prevent deprecation warnings during the False to True migration.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v3/_generate_data.py:0-0
Timestamp: 2024-12-11T10:30:48.699Z
Learning: In CODE/VulnScan/v3/_generate_data.py, the deprecation due to memory issues will occur only when the type is Model SenseMacro, and it won't be fixed in the current PR.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v3/_generate_data.py:177-197
Timestamp: 2024-12-11T10:05:34.954Z
Learning: The _generate_data.py function in CODE/VulnScan/v3/_generate_data.py will be deprecated due to memory issues and won't be fixed in the current PR.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v2-deprecated/_generate_data.py:12-20
Timestamp: 2024-12-11T09:55:02.216Z
Learning: In CODE/VulnScan/v2-deprecated/_generate_data.py, the create_sensitive_file function doesn't need to include warnings about legality or sensitive data in the docstring.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v3/_train.py:393-394
Timestamp: 2024-12-11T10:44:02.233Z
Learning: In CODE/VulnScan/v3/_train.py, path existence checks are performed in the validate_data() function.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v3/_generate_data.py:172-175
Timestamp: 2024-12-11T10:52:39.417Z
Learning: In CODE/VulnScan/v3/_generate_data.py, the config section 'VulnScan.generate Settings' always exists, and any installation issues are handled elsewhere. No need to add error handling for missing config sections in this file.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v3/_generate_data.py:45-69
Timestamp: 2024-12-11T10:01:14.449Z
Learning: In CODE/VulnScan/v3/_generate_data.py, the script is not supposed to handle security concerns.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/VulnScan/v3/_generate_data.py:45-69
Timestamp: 2024-12-11T10:01:31.708Z
Learning: In CODE/VulnScan/v3/_generate_data.py, it's intentional to generate realistic sensitive data, and security considerations for data generation aren't a concern.
CODE/Logicytics.py (2)
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/dump_memory.py:93-152
Timestamp: 2024-12-11T09:54:12.940Z
Learning: In the 'Logicytics' project, scripts like dump_memory.py are not supposed to consider legality concerns during code reviews.
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/dump_memory.py:87-91
Timestamp: 2024-12-11T10:45:11.595Z
Learning: In CODE/dump_memory.py, for functions like get_system_info(), prefer to handle exceptions and logging manually, rather than adding additional error handling as suggested.
🧬 Code Graph Analysis (1)
CODE/logicytics/Logger.py (1)
CODE/logicytics/FileManagement.py (2)
FileManagement(12-220)mkdir(36-53)
🔇 Additional comments (24)
CODE/_debug.py (4)
12-12: Good refactoring move!Adding the
getmodule to your imports makes sense since you're using it later for file listing. This helps centralize file operations instead of having duplicate logic everywhere.
50-57: Smart move replacing manual file walking!Using
get.list_of_filesinstead of doing the directory walk yourself is way cleaner. The exclusions for specific files and directories make sense, and normalizing the paths helps avoid those annoying Windows vs Linux path issues.
135-142: Nice Python version compatibility update!Bumping the max supported version to 3.14 keeps you future-ready. I like how you're now differentiating between the "Perfect" 3.11.x version (your main testing target) and just "Supported" for the others - gives users a clear idea of what's been tested most thoroughly.
213-214: Much cleaner logging approach!Breaking out those inline conditionals into separate if/else statements makes the code way easier to read. Plus using different log levels (info vs warning) for the different states makes more sense than the old inline approach.
CODE/vulnscan.py (3)
11-11: Good IDE housekeeping!Adding the noinspection comment for PyPackageRequirements makes sense to clean up IDE warnings about torch imports. Small but helpful for dev experience.
58-66: Excellent device compatibility fix!This is exactly what was needed! The explicit device mapping prevents those annoying crashes on systems without CUDA, and the warning about NVIDIA GPUs without proper CUDA setup is super helpful for users trying to optimize performance. The debug logging is a nice touch too for troubleshooting.
196-196: File paths updated and verified – looks good!I checked the CODE/vulnscan folder and both files are present with the new names:
- vulnscan/SenseMini.3n3.pth
- vulnscan/vectorizer.3n3.pkl
Great job removing those stray spaces and normalizing the casing. Everything’s consistent and ready to go!
.gitignore (1)
322-322: Perfect case consistency fix!Updating the gitignore to match the lowercase "vulnscan" directory keeps everything aligned with the naming standardization you're doing across the project. Simple but important for maintaining clean ignore patterns.
CODE/logicytics/Logger.py (2)
14-14: Good addition for directory management!Adding the FileManagement import makes sense since you need it for the mkdir() call. Keeps the imports organized and follows the existing pattern.
43-43: Smart proactive fix for directory issues!Adding the mkdir() call right at the start of the logger constructor is brilliant - it prevents those crashes from missing directories that were mentioned in the PR. The comment makes it crystal clear why it's there too. This kind of defensive programming is exactly what makes code more reliable.
CODE/logicytics/FileManagement.py (2)
38-38: Good documentation cleanup!Updating the docstring to remove the backup directory reference keeps the docs accurate with the actual functionality. Makes sense since you're removing backup features in favor of Git version control.
95-95: Essential case consistency update!Changing "VulnScan" to "vulnscan" in the excluded prefixes keeps the zip functionality working correctly with the new directory naming. Without this change, the exclusion wouldn't match the actual directory name anymore.
CODE/logicytics/__init__.py (2)
16-22: Great job adding clear documentation!These inline comments make it super easy to understand what each module instance does. This kind of documentation really helps when someone new looks at the code.
24-24: Nice descriptive comments for classes and functionsAdding these comments above the
ObjectLoadErrorclass anddeprecateddecorator makes the code much more readable and self-documenting.Also applies to: 42-42
.idea/Logicytics.iml (1)
11-12: Perfect consistency fix for directory casingAll the path updates from "VulnScan" to "vulnscan" are exactly what's needed to keep the IDE configuration in sync with the actual directory structure. This prevents any confusion or broken references.
Also applies to: 15-21
CODE/_dev.py (1)
9-9: Good cleanup removing unused importRemoving the unused
file_managementimport keeps the code clean and makes dependencies clearer.PLANS.md (1)
11-14: Smart planning updates for better project timelineMoving the complex tasks like the Logger.py replacement to v4.0.0 makes sense - it gives more time to do them right. The clearer task descriptions (like specifying "to be 1 tool" for the merge) also help avoid confusion later.
CODE/Logicytics.py (4)
211-221: Cleaner performance tracking, but memory metrics are goneThe removal of memory profiling makes the code simpler, which is good! But just heads up - users who were checking memory usage before won't be able to anymore. If that's intentional (seems like it from the PR description), then this change looks solid.
240-251: Nice error handling upgrade! 🎯Adding these try-except blocks is smart - now the script won't crash if git isn't installed or if someone runs it outside a git repo. The error messages are clear and helpful too.
352-355: New usage tracking feature looks good!The implementation follows the same pattern as other special actions, which keeps things consistent. Nice addition for users who want to see their flag usage stats!
420-425: Cleaner logic for skipping sub-actionsThe new conditional approach is easier to read than the old early return pattern. Makes it super clear that performance checks shouldn't trigger shutdowns/reboots.
CODE/logicytics/Flag.py (3)
31-369: Smart refactoring with the nested Match class! 👍Moving all the matching and history stuff into
Flag.Matchmakes the code way more organized. It's like putting all your matching tools in one toolbox - makes it easier to find what you need. The implementation looks clean and all the methods kept their original logic intact.
555-556: Exclusivity logic properly updatedGood catch adding
args.usageto the action flags! This prevents users from accidentally combining it with other actions, keeping the "one action at a time" rule intact.
640-743: All Match class references updated correctlyEvery place that used to call the old
_Matchmethods now properly usesFlag.Match. The refactoring is super consistent throughout the file - no missed spots!
The condition logic is incorrect. If torch.cuda.is_available() returns False, then torch.backends.cudnn.is_available() will also return False, making this condition always False. Consider simplifying to just check if CUDA is not available but the system has CUDA capabilities. Co-authored-by: Copilot <[email protected]> Signed-off-by: Shahm Najeeb <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Shahm Najeeb <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Shahm Najeeb <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
CODE/logicytics/Flag.py (1)
787-789: Potential bug: Early return when preferences are disabled.This early return means the method won't return any flags when
SAVE_PREFERENCESis False, which seems wrong. The method should still return the parsed flags even if it doesn't save history.- # Update history with the matched flag(s) - if not SAVE_PREFERENCES: - return None + # Update history with the matched flag(s) if preferences are enabledThen move the history updating logic inside the SAVE_PREFERENCES check but still return the flags at the end.
🧹 Nitpick comments (2)
CODE/logicytics/Flag.py (2)
144-250: Cool visualization feature! The fallback saving logic could be cleaner though.The statistics generation and graph creation look solid. The multiple try-except blocks for saving work, but you could simplify this with a list of paths to try.
Consider simplifying the save logic:
- try: - plt.savefig("../ACCESS/DATA/Flag_usage_summary.png") - log.info( - "Flag Usage Summary Graph saved to 'ACCESS/DATA/Flag_usage_summary.png'" - ) - except FileNotFoundError: - try: - plt.savefig("../../ACCESS/DATA/Flag_usage_summary.png") - log.info( - "Flag Usage Summary Graph saved to 'ACCESS/DATA/Flag_usage_summary.png'" - ) - except FileNotFoundError: - plt.savefig("Flag_usage_summary.png") - log.info( - "Flag Usage Summary Graph saved in current working directory as 'Flag_usage_summary.png'" - ) + save_paths = [ + ("../ACCESS/DATA/Flag_usage_summary.png", "ACCESS/DATA/Flag_usage_summary.png"), + ("../../ACCESS/DATA/Flag_usage_summary.png", "ACCESS/DATA/Flag_usage_summary.png"), + ("Flag_usage_summary.png", "current working directory as 'Flag_usage_summary.png'") + ] + + for path, description in save_paths: + try: + plt.savefig(path) + log.info(f"Flag Usage Summary Graph saved to '{description}'") + break + except FileNotFoundError: + continue
251-350: Good history management system! Consider adding error handling for device name.The gzipped JSON approach is smart for saving space, and the history tracking looks comprehensive. However,
os.getlogin()can sometimes fail in certain environments (like some Docker containers or CI systems).Consider adding fallback for device name:
- "device_name": os.getlogin(), + "device_name": os.getlogin() if hasattr(os, 'getlogin') else os.environ.get('USER', 'unknown'),Or use a try-except block:
+ try: + device_name = os.getlogin() + except OSError: + device_name = os.environ.get('USER', 'unknown') + interaction = { "timestamp": datetime.now().strftime("%H:%M:%S - %d/%m/%Y"), "user_input": user_input, "accuracy": accuracy, - "device_name": os.getlogin(), + "device_name": device_name, }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
CODE/Logicytics.py(14 hunks)CODE/_debug.py(9 hunks)CODE/_dev.py(8 hunks)CODE/logicytics/FileManagement.py(4 hunks)CODE/logicytics/Flag.py(12 hunks)CODE/logicytics/Logger.py(13 hunks)CODE/logicytics/__init__.py(4 hunks)CODE/vulnscan.py(7 hunks)PLANS.md(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- CODE/logicytics/init.py
🚧 Files skipped from review as they are similar to previous changes (7)
- PLANS.md
- CODE/_debug.py
- CODE/logicytics/FileManagement.py
- CODE/_dev.py
- CODE/Logicytics.py
- CODE/logicytics/Logger.py
- CODE/vulnscan.py
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: DefinetlyNotAI
PR: DefinetlyNotAI/Logicytics#225
File: CODE/logicytics/Flag.py:583-592
Timestamp: 2025-05-31T12:42:30.615Z
Learning: In the Logicytics codebase, DefinetlyNotAI prefers using exit() over sys.exit() and doesn't want suggestions to change this pattern.
Learnt from: DefinetlyNotAI
PR: DefinetlyNotAI/Logicytics#225
File: CODE/logicytics/Flag.py:583-592
Timestamp: 2025-05-31T12:42:30.615Z
Learning: In the Logicytics codebase, DefinetlyNotAI prefers to allow lines longer than 100 characters when they make sense contextually, rather than enforcing strict line length limits.
🔇 Additional comments (6)
CODE/logicytics/Flag.py (6)
15-36: Nice refactoring! The nested class structure looks clean.Moving the Match functionality inside the Flag class makes the code more organized and easier to understand. The configuration setup remains solid.
38-93: Solid implementation of semantic similarity matching!The method handles model loading errors properly and configures logging based on debug mode. The similarity computation using sentence transformers looks correct.
95-142: Smart history-based suggestion system!The method properly checks preferences, uses a reasonable similarity threshold (0.3), and limits suggestions to the top 3 most relevant ones. Good duplicate handling too.
352-421: Excellent core matching logic!The method combines flags with descriptions for better context, which is really smart. The accuracy threshold checking and history-based suggestions make this a robust flag matching system.
440-690: Great argument handling with proper validation!The new
--usageflag addition and the exclusivity logic look solid. The flag suggestion system using the Match class is well integrated. Nice work removing the backup functionality as mentioned in the PR objectives.
36-821: Excellent refactoring work! The nested class structure makes everything much cleaner.Moving all the matching functionality into
Flag.Matchis a smart organizational choice. The code maintains all existing functionality while being more maintainable and easier to understand. Great job keeping this consistent with the PR goals of removing backup features and adding usage tracking.
Signed-off-by: Shahm Najeeb <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
CODE/logicytics/Flag.py (1)
22-22: Consider extracting the repeated "Flag Settings" string to a constantThe string "Flag Settings" appears multiple times throughout the config access calls. Following DRY principles, you could define it once at the top.
+FLAG_SETTINGS_SECTION = "Flag Settings" + # Debug mode for Sentence Transformer -DEBUG_MODE = config.getboolean( - "Flag Settings", "model_debug" -) # Debug mode for Sentence Transformer +DEBUG_MODE = config.getboolean( + FLAG_SETTINGS_SECTION, "model_debug" +) # Debug mode for Sentence TransformerThen update the other occurrences to use the constant too.
Also applies to: 30-30, 71-71, 76-76
🧹 Nitpick comments (1)
README.md (1)
194-194: Fix the list indentation to match markdown standardsThe static analysis tool caught an indentation issue here. The list item should have 2 spaces instead of 4 to follow proper markdown formatting.
- - Note: The version used to develop, test and run the script is 3.11 + - Note: The version used to develop, test and run the script is 3.11
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (26)
.github/ISSUE_TEMPLATE/bug_report.yml(1 hunks).github/ISSUE_TEMPLATE/dev_bug_report.yml(1 hunks).github/ISSUE_TEMPLATE/feature_request.yml(1 hunks).github/PULL_REQUEST_TEMPLATE.md(1 hunks).github/workflows/codeql.yml(2 hunks).github/workflows/dependency-review.yml(1 hunks).github/workflows/greetings.yml(2 hunks).github/workflows/stale.yml(2 hunks).pre-commit-config.yaml(1 hunks)CODE/Logicytics.py(14 hunks)CODE/_debug.py(9 hunks)CODE/_dev.py(8 hunks)CODE/browser_miner.ps1(2 hunks)CODE/logicytics/FileManagement.py(4 hunks)CODE/logicytics/Flag.py(12 hunks)CODE/logicytics/__init__.py(4 hunks)CODE/property_scraper.ps1(1 hunks)CODE/sensitive_data_miner.py(1 hunks)CODE/sys_internal.py(1 hunks)CODE/vulnscan.py(7 hunks)CONTRIBUTING.md(2 hunks)CREDITS.md(2 hunks)MODS/_MOD_SKELETON.py(1 hunks)PLANS.md(1 hunks)README.md(8 hunks)SECURITY.md(0 hunks)
💤 Files with no reviewable changes (1)
- SECURITY.md
✅ Files skipped from review due to trivial changes (16)
- CODE/sensitive_data_miner.py
- MODS/_MOD_SKELETON.py
- CODE/property_scraper.ps1
- .pre-commit-config.yaml
- .github/ISSUE_TEMPLATE/bug_report.yml
- .github/workflows/dependency-review.yml
- .github/workflows/greetings.yml
- CODE/sys_internal.py
- .github/PULL_REQUEST_TEMPLATE.md
- CONTRIBUTING.md
- CODE/browser_miner.ps1
- .github/ISSUE_TEMPLATE/dev_bug_report.yml
- .github/ISSUE_TEMPLATE/feature_request.yml
- CREDITS.md
- .github/workflows/stale.yml
- .github/workflows/codeql.yml
🚧 Files skipped from review as they are similar to previous changes (7)
- CODE/_dev.py
- PLANS.md
- CODE/logicytics/FileManagement.py
- CODE/logicytics/init.py
- CODE/vulnscan.py
- CODE/Logicytics.py
- CODE/_debug.py
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: DefinetlyNotAI
PR: DefinetlyNotAI/Logicytics#225
File: CODE/logicytics/Flag.py:583-592
Timestamp: 2025-05-31T12:42:30.615Z
Learning: In the Logicytics codebase, DefinetlyNotAI prefers using exit() over sys.exit() and doesn't want suggestions to change this pattern.
Learnt from: DefinetlyNotAI
PR: DefinetlyNotAI/Logicytics#225
File: CODE/logicytics/Flag.py:583-592
Timestamp: 2025-05-31T12:42:30.615Z
Learning: In the Logicytics codebase, DefinetlyNotAI prefers to allow lines longer than 100 characters when they make sense contextually, rather than enforcing strict line length limits.
README.md (3)
Learnt from: DefinetlyNotAI
PR: #158
File: CODE/dump_memory.py:93-152
Timestamp: 2024-12-11T09:54:12.940Z
Learning: In the 'Logicytics' project, scripts like dump_memory.py are not supposed to consider legality concerns during code reviews.
Learnt from: ski-sketch
PR: #160
File: CODE/bluetooth_details.py:5-6
Timestamp: 2024-12-12T08:36:07.659Z
Learning: In the Logicytics project, the logger must be initialized under if __name__ == "__main__": in bluetooth_details.py, and should not be moved into functions or accept parameters.
Learnt from: DefinetlyNotAI
PR: #225
File: CODE/logicytics/Flag.py:583-592
Timestamp: 2025-05-31T12:42:30.615Z
Learning: In the Logicytics codebase, DefinetlyNotAI prefers to allow lines longer than 100 characters when they make sense contextually, rather than enforcing strict line length limits.
🪛 LanguageTool
README.md
[style] ~103-~103: Consider a different adverb to strengthen your wording.
Context: ...e running!
[!TIP]
Although it's really recommended to use admin, by setting de...
(REALLY_STRONGLY)
[style] ~154-~154: Consider a more concise word here.
Context: ...ey are located in the MODS directory. In order to make a mod,
you need to create a pytho...
(IN_ORDER_TO_PREMIUM)
[style] ~270-~270: Consider using a more concise synonym.
Context: ...ous sources, Logicytics can be used for a variety of purposes,
from forensics to system inf...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.17.2)
README.md
194-194: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
🔇 Additional comments (7)
README.md (2)
3-3: Nice formatting cleanup! 👍Breaking up those super long lines makes the README way easier to read. Good call on making it more digestible!
Also applies to: 25-26, 32-33, 35-36, 38-39
53-77: Installation section looks much cleaner now! 🚀The step-by-step formatting and the .sys.ignore explanation are way easier to follow. Users won't get lost in walls of text anymore.
Also applies to: 82-101
CODE/logicytics/Flag.py (5)
36-37: Sweet refactor! The nested class structure makes way more sense 🏗️Moving the Match functionality inside the Flag class is a solid architectural choice. Everything flag-related is now properly organized in one place instead of being scattered around.
38-93: AI similarity matching looks solid! 🤖The semantic similarity computation is well-implemented with proper error handling for model loading and good debug mode support. The tensor operations look correct too.
252-296: History management is clean and robust 📚The gzipped JSON approach for storing user history is smart - saves space while keeping it readable. Error handling for missing files is spot-on too.
144-250: The new usage stats feature is pretty cool! 📊This gives users awesome insights into their flag usage patterns. The graph generation with multiple fallback save paths is smart, and the detailed statistics output looks super helpful for understanding usage trends.
524-528: New usage flag integration looks perfect! ✨The --usage flag is properly defined and integrated into the exclusivity logic. Nice descriptive help text too - users will know exactly what it does.
Also applies to: 608-609
Pull Request Template
Prerequisites
--devflag, if required.PR Type
update
Description
Device Compatibility Fixes:
vulnscan.map_locationwithtorch.load.Flag Promotions & Enhancements:
--performance-checkto official, removing the "Beta Mode" label.--usageflag to provide a summary of a user's flag usage history.Match.generate_summary_and_graph()out of beta after patching.Critical Fixes & File Handling:
vulnscanfolder to prevent accidental zipping and misbehavior.--debugand_dev.py, resolving discrepancies and false positives.Refactors & Removals:
--backupfeature. Git will handle all versioning and history.Motivation and Context
This set of changes aims to cleanly elevate Logicytics from an experimental utility into a more stable, production-ready tool. The main driving force was solving issues - most critically, the PyTorch model crash on non-GPU systems. Removing unnecessary bloat like the backup feature keeps the codebase lean, while flag promotions and new tools like
--usagefurther empower users without compromising simplicity. Refactors were driven by the need for consistent behavior, and compatibility upgrades (like Python 3.13 and Git absence handling) make it ready for a broader developer ecosystem. Overall, this is a foundational update geared toward robustness, usability, and long-term maintenance.Credit
N/A
Issues Fixed
N/A
Summary by CodeRabbit
New Features
Bug Fixes
Improvements
Removals
Documentation
Chores