Skip to content

Production Version: ruff CI, PyInstaller packaging, ANSI UX, release workflow - #5

Merged
LoveDoLove merged 35 commits into
mainfrom
lovedolove
Jul 5, 2026
Merged

Production Version: ruff CI, PyInstaller packaging, ANSI UX, release workflow#5
LoveDoLove merged 35 commits into
mainfrom
lovedolove

Conversation

@LoveDoLove

Copy link
Copy Markdown
Owner

概述

将项目提升到生产就绪状态,涵盖四个阶段:代码加固、UX 打磨、打包与发布、文档。

变更内容

新增

  • .github/workflows/ci.yml — 每次 push/PR 自动运行 ruff 检查
  • .github/workflows/release.yml — 打标签时自动 PyInstaller 构建 + GitHub Release
  • LDLWinToolBox.spec — PyInstaller 打包配置
  • scripts/check.ps1 — 统一的 ruff lint/format/isort 检查脚本

改进

  • oolbox_base.py — 新增 Color 类、cprint() 彩色输出、Spinner 进度指示器
  • ldlwintoolbox.py — 彩色主菜单、版本号显示、框架字符装饰
  • pyproject.toml — 新增 ruff 配置(lint/format/isort)
  • README.md — 使用 Best-README-Template 格式重写,覆盖全部 23 项功能
  • TOOLBOX_VERSION 从 pyproject.toml 动态读取

修复

  • 移除 _print_header 中未使用的 G 变量
  • 修正 check.ps1 注释中的依赖说明
  • 清理冗余 ANSI 包裹

Introduce LDLWinToolBox.bat (menu-driven Windows maintenance tool) plus supporting documentation (ANALYSIS.md and PROMPT_GUIDE.md). The batch script adds an admin elevation check, an Advanced System Cleanup (stops wuauserv/bits, purges Temp/Prefetch/SoftwareDistribution, rebuilds directories, flushes DNS), an Event Viewer log clearer using wevtutil, and a Manual SSD TRIM workflow (lists volumes with PowerShell, sanitizes drive input, runs defrag /L). Documentation provides a technical analysis of functionality and a user prompt guide for the tool.
Clean up and expand documentation in ANALYSIS.md and PROMPT_GUIDE.md. Removed inline citation markers and reorganized several sections into clearer bullet points for Privilege Elevation, Cleanup Methodology, Log Management, SSD TRIM, and Safety Assessment. Added a new Project & Prompt Analysis and a Rules/Guidelines section to ANALYSIS.md, and appended a Rules for Better Prompts section to PROMPT_GUIDE.md. Minor wording edits improve readability and preserve existing guidance about admin elevation, input sanitization, and preserving history.
Initialize a timestamped run log and route verbose command output into it while keeping console messages high-level and user-friendly. LDLWinToolBox.bat: add LOGFILE setup, switch menu/input handling to delayed expansion, emit brief console echoes and append detailed outputs (del, rd, net, wevtutil, defrag, ipconfig) to the log, refactor cleanup loops to log actions, and capture defrag output to a temp file for display+logging. ANALYSIS.md and PROMPT_GUIDE.md: document the new logging/verbosity behavior, add guidance for UX and future prompt rules regarding logging and safe verbosity. Overall goal: preserve existing functionality while improving auditing and avoiding overwhelming console output.
Expand LDLWinToolBox functionality: menu increased from 4 to 8 options and added System Integrity Repair (SFC + DISM), Windows Component Store cleanup (DISM StartComponentCleanup), Winget-based app updates, and a Complete Network Reset. Implement a PowerShell-based free-space measurement (Win32_LogicalDisk) before/after cleanup to calculate and display total MB freed. Update event log and SSD TRIM messages, add confirmations/warnings for long-running tasks, and ensure verbose output continues to be redirected to the timestamped log. Update ANALYSIS.md and PROMPT_GUIDE.md to reflect the new features, updated numbering, and revised rules for verbosity and process warnings.
Fix Log History pager
…e menu

- Split monolithic ldlwintoolbox.py into toolbox_base.py + features/
- Added Low Latency Mode (ViVeTool) with arch detection and auto-download
- Reorganized main menu into logical groups (Cleanup / Repair / Network / Performance / Security / Tools)
- Updated /tools to .gitignore for downloaded binaries
- Updated AGENTS.md, MEMORY.md, and memory session files
- AGENTS.md: added Project Architecture section, feature file references, Python Logger rule
- MEMORY.md: updated commit hash, menu numbering, Low Latency menu position
- README.md: rewritten using BLANK_README.md template reflecting modular architecture and grouped menu
- Advanced System Cleanup, Clear Event Viewer Logs, Manual SSD TRIM,
  and Exit now all require Y/N confirmation before executing.
- This ensures every destructive/system-changing operation is guarded
  by user confirmation, fixing a critical safety gap.
- create_restore_point() in toolbox_base.py uses Checkpoint-Computer
  via PowerShell; logs success/failure without blocking the feature
- 8 features (1-7, 9) now offer (Y/N) to create a restore point before
  executing the destructive operation
- Error 0x80070422 (System Restore disabled) detected with helpful message
- Updated AGENTS.md, MEMORY.md, memory/tasks.md, memory/feature-ideas.md
  with completed Phase 1 roadmap items
- Add [1/2][2/2] progress markers to System Integrity Repair
- Add [1/1] progress markers to WinSxS cleanup and Winget upgrade
- Vendor driver root deletion (AMD/NVIDIA/INTEL) now opt-in (Y/N)
  instead of automatic, making system cleanup more conservative
- Updated memory files with Phase 2 completion status
- System Information (menu 11): OS/CPU/RAM/disk/uptime via stdlib+ctypes+winreg
- Windows Update Status (menu 12): service query, registry config, UsoClient scan
- Defender Status & Scan (menu 13): Get-MpComputerStatus, signature update, quick scan
- Service Health Check (menu 14): 20 critical services via PowerShell Get-Service
- Menu renumbered: Diagnostics (11-14), Tools (15), Exit (16)
- Updated memory files with Phase 3 completion
- Disk Health & SMART (menu 15): Get-PhysicalDisk, Get-StorageReliabilityCounter
- Driver Inventory (menu 16): driverquery /FO CSV parsing with type/date summary
- Network Snapshot (menu 17): ipconfig/route/netsh/netstat capture + file save + diff
- Export Logs & Report (menu 18): session report generation + ZIP archive of all logs
- Menu renumbered: Diagnostics (11-18), Tools (19), Exit (20)
- Updated memory files with Phase 4 completion
- New feature: Check for Updates (menu 20) queries GitHub Releases API,
  compares remote tag with local version (1.0.3), opens browser on newer
- Version bumped to 1.0.3 in pyproject.toml and toolbox_base.py
- Added TOOLBOX_VERSION constant to toolbox_base.py
- Menu renumbered: Tools (19-20), Exit (21)
- Updated memory files with Phase 5 completion
…sion list

- Recovery & Safe Mode Tools (menu 11): bcdedit/reagentc/shutdown sub-menu for
  boot config, safe mode (minimal/networking/cmd-prompt), WinRE, normal boot restore
- Selective cleanup: system_cleanup.py refactored with target sub-menu
  (Windows Temp, User Temp, Prefetch, SoftDist, Vendor Roots)
- Cleanup Exclusion List (menu 22): JSON config in config/exclusions.json,
  paths checked before deletion during cleanup
- Exclusion checks integrated into system_cleanup via cleanup_config.is_excluded
- Menu renumbered: Recovery (11), Diagnostics (12-19), Tools (20-22), Exit (23)
- Read-only mode: diagnostics (12-22) now run without admin privileges;
  admin features (1-11) hidden with [R] restart-as-admin shortcut
- PowerShell optimization: disk_health.py combined 3 calls into 1
  using section markers (# DISKS / # VOLUMES / # SMART)
- Menu system refactored: script_dir and is_admin passed as parameters
- All 6 roadmap phases now complete
- Updated memory files with final Phase 5 status
…workflow

- Phase A: ruff lint/format/isort config in pyproject.toml, scripts/check.ps1, CI workflow
- Phase B: Color class + cprint() + Spinner, colored menu with version display
- Phase C: LDLWinToolBox.spec, release.yml auto-build on tag, TOOLBOX_VERSION from pyproject.toml
- README.md rewritten using Best-README-Template format
- Reviewer fixes: remove unused G variable, fix check.ps1 comment, clean up ANSI wrapping
Copilot AI review requested due to automatic review settings July 5, 2026 07:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

- Run 
uff format on all 22 files to match ruff 0.15.20 formatting
- Fix E501 long lines in disk_health.py, system_info.py, windows_update.py, toolbox_base.py
- Fix E741 ambiguous name l -> line in network_snapshot.py
- Fix F841 unused header/
ows in driver_inventory.py
- Fix N806 uppercase locals in ldlwintoolbox.py (_print_header)
@LoveDoLove
LoveDoLove merged commit 775b615 into main Jul 5, 2026
2 checks passed
@LoveDoLove LoveDoLove self-assigned this Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants