smart-drive-os 1.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smart_drive_os-1.4.2/LICENSE +21 -0
- smart_drive_os-1.4.2/PKG-INFO +537 -0
- smart_drive_os-1.4.2/README.md +493 -0
- smart_drive_os-1.4.2/pyproject.toml +103 -0
- smart_drive_os-1.4.2/setup.cfg +4 -0
- smart_drive_os-1.4.2/smart_drive/__init__.py +161 -0
- smart_drive_os-1.4.2/smart_drive/__main__.py +13 -0
- smart_drive_os-1.4.2/smart_drive/cli/__init__.py +6 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_audit.py +66 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_backup.py +103 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_checkup.py +632 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_classify.py +200 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_clean.py +329 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_gitignore.py +403 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_health.py +89 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_init.py +164 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_mcp.py +27 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_mcp_config.py +56 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_offload.py +129 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_organize.py +195 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_path_check.py +204 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_paths.py +413 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_relink.py +347 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_repos.py +100 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_search.py +103 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_sentinel.py +125 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_setup.py +166 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_snapshot.py +171 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_status.py +97 -0
- smart_drive_os-1.4.2/smart_drive/cli/cmd_undo.py +228 -0
- smart_drive_os-1.4.2/smart_drive/cli/main.py +725 -0
- smart_drive_os-1.4.2/smart_drive/cli/smart_organize_runner.py +704 -0
- smart_drive_os-1.4.2/smart_drive/core/__init__.py +2 -0
- smart_drive_os-1.4.2/smart_drive/core/academic_classifier.py +279 -0
- smart_drive_os-1.4.2/smart_drive/core/auditor.py +1790 -0
- smart_drive_os-1.4.2/smart_drive/core/auto_zoner.py +553 -0
- smart_drive_os-1.4.2/smart_drive/core/classifier.py +1309 -0
- smart_drive_os-1.4.2/smart_drive/core/config.py +839 -0
- smart_drive_os-1.4.2/smart_drive/core/drive_detector.py +1107 -0
- smart_drive_os-1.4.2/smart_drive/core/duplicates.py +629 -0
- smart_drive_os-1.4.2/smart_drive/core/exfat_compat.py +332 -0
- smart_drive_os-1.4.2/smart_drive/core/fsinfo.py +237 -0
- smart_drive_os-1.4.2/smart_drive/core/git_locks.py +245 -0
- smart_drive_os-1.4.2/smart_drive/core/gitignore.py +1386 -0
- smart_drive_os-1.4.2/smart_drive/core/health.py +390 -0
- smart_drive_os-1.4.2/smart_drive/core/in_use.py +257 -0
- smart_drive_os-1.4.2/smart_drive/core/initializer.py +318 -0
- smart_drive_os-1.4.2/smart_drive/core/junction.py +192 -0
- smart_drive_os-1.4.2/smart_drive/core/junk_detector.py +738 -0
- smart_drive_os-1.4.2/smart_drive/core/learning_units.py +313 -0
- smart_drive_os-1.4.2/smart_drive/core/move_hint.py +240 -0
- smart_drive_os-1.4.2/smart_drive/core/offloader.py +1118 -0
- smart_drive_os-1.4.2/smart_drive/core/processes.py +69 -0
- smart_drive_os-1.4.2/smart_drive/core/purge_engine.py +1215 -0
- smart_drive_os-1.4.2/smart_drive/core/quick_access.py +113 -0
- smart_drive_os-1.4.2/smart_drive/core/relink.py +3481 -0
- smart_drive_os-1.4.2/smart_drive/core/repos.py +549 -0
- smart_drive_os-1.4.2/smart_drive/core/root.py +258 -0
- smart_drive_os-1.4.2/smart_drive/core/scanner.py +480 -0
- smart_drive_os-1.4.2/smart_drive/core/sentinel.py +382 -0
- smart_drive_os-1.4.2/smart_drive/core/snapshot.py +862 -0
- smart_drive_os-1.4.2/smart_drive/core/system_refs.py +1200 -0
- smart_drive_os-1.4.2/smart_drive/indexer/__init__.py +13 -0
- smart_drive_os-1.4.2/smart_drive/indexer/db.py +191 -0
- smart_drive_os-1.4.2/smart_drive/indexer/learning.py +762 -0
- smart_drive_os-1.4.2/smart_drive/indexer/manager.py +396 -0
- smart_drive_os-1.4.2/smart_drive/mcp/__init__.py +18 -0
- smart_drive_os-1.4.2/smart_drive/mcp/bootstrap.py +1002 -0
- smart_drive_os-1.4.2/smart_drive/mcp/ecosystem.py +112 -0
- smart_drive_os-1.4.2/smart_drive/mcp/proxy.py +39 -0
- smart_drive_os-1.4.2/smart_drive/mcp/registrar.py +424 -0
- smart_drive_os-1.4.2/smart_drive/mcp/server.py +1738 -0
- smart_drive_os-1.4.2/smart_drive/py.typed +1 -0
- smart_drive_os-1.4.2/smart_drive/search/__init__.py +21 -0
- smart_drive_os-1.4.2/smart_drive/search/engine.py +462 -0
- smart_drive_os-1.4.2/smart_drive/search/formatter.py +129 -0
- smart_drive_os-1.4.2/smart_drive/search/parser.py +279 -0
- smart_drive_os-1.4.2/smart_drive_os.egg-info/PKG-INFO +537 -0
- smart_drive_os-1.4.2/smart_drive_os.egg-info/SOURCES.txt +186 -0
- smart_drive_os-1.4.2/smart_drive_os.egg-info/dependency_links.txt +1 -0
- smart_drive_os-1.4.2/smart_drive_os.egg-info/entry_points.txt +5 -0
- smart_drive_os-1.4.2/smart_drive_os.egg-info/requires.txt +3 -0
- smart_drive_os-1.4.2/smart_drive_os.egg-info/top_level.txt +1 -0
- smart_drive_os-1.4.2/tests/test_academic_classifier_precision.py +153 -0
- smart_drive_os-1.4.2/tests/test_adversarial_filesystem.py +522 -0
- smart_drive_os-1.4.2/tests/test_adversarial_m3.py +645 -0
- smart_drive_os-1.4.2/tests/test_adversarial_snapshot.py +640 -0
- smart_drive_os-1.4.2/tests/test_adversarial_tier5.py +615 -0
- smart_drive_os-1.4.2/tests/test_audit_symlinks.py +79 -0
- smart_drive_os-1.4.2/tests/test_auditor.py +333 -0
- smart_drive_os-1.4.2/tests/test_auto_zoner.py +557 -0
- smart_drive_os-1.4.2/tests/test_autozoner_defense.py +470 -0
- smart_drive_os-1.4.2/tests/test_batch_launchers.py +483 -0
- smart_drive_os-1.4.2/tests/test_busy_apps_unknown.py +430 -0
- smart_drive_os-1.4.2/tests/test_checkup.py +281 -0
- smart_drive_os-1.4.2/tests/test_checkup_junk_step.py +164 -0
- smart_drive_os-1.4.2/tests/test_checkup_scan_cost.py +138 -0
- smart_drive_os-1.4.2/tests/test_classifier.py +1094 -0
- smart_drive_os-1.4.2/tests/test_classifier_bundles.py +290 -0
- smart_drive_os-1.4.2/tests/test_classifier_scope.py +120 -0
- smart_drive_os-1.4.2/tests/test_classifier_symlinks.py +390 -0
- smart_drive_os-1.4.2/tests/test_classifier_targets.py +156 -0
- smart_drive_os-1.4.2/tests/test_clean_docs.py +72 -0
- smart_drive_os-1.4.2/tests/test_clean_kept_report.py +136 -0
- smart_drive_os-1.4.2/tests/test_cleaner.py +508 -0
- smart_drive_os-1.4.2/tests/test_cli_clean_json.py +692 -0
- smart_drive_os-1.4.2/tests/test_cli_e2e.py +289 -0
- smart_drive_os-1.4.2/tests/test_cli_internal_e2e.py +481 -0
- smart_drive_os-1.4.2/tests/test_cli_nested_options.py +96 -0
- smart_drive_os-1.4.2/tests/test_compliance.py +371 -0
- smart_drive_os-1.4.2/tests/test_cross_platform_adversarial_m1_2.py +443 -0
- smart_drive_os-1.4.2/tests/test_db_connections_closed.py +128 -0
- smart_drive_os-1.4.2/tests/test_drive_detector.py +739 -0
- smart_drive_os-1.4.2/tests/test_dup_cluster_size.py +214 -0
- smart_drive_os-1.4.2/tests/test_duplicates_real_drive.py +728 -0
- smart_drive_os-1.4.2/tests/test_duplicates_sub_dir_scope.py +310 -0
- smart_drive_os-1.4.2/tests/test_e2e_mcp_distribution.py +947 -0
- smart_drive_os-1.4.2/tests/test_exfat_compat.py +240 -0
- smart_drive_os-1.4.2/tests/test_fsinfo.py +297 -0
- smart_drive_os-1.4.2/tests/test_geometry.py +179 -0
- smart_drive_os-1.4.2/tests/test_git_locks.py +621 -0
- smart_drive_os-1.4.2/tests/test_git_no_fsmonitor.py +161 -0
- smart_drive_os-1.4.2/tests/test_gitattributes.py +165 -0
- smart_drive_os-1.4.2/tests/test_gitignore.py +1295 -0
- smart_drive_os-1.4.2/tests/test_hardlinks.py +147 -0
- smart_drive_os-1.4.2/tests/test_health.py +440 -0
- smart_drive_os-1.4.2/tests/test_in_use.py +517 -0
- smart_drive_os-1.4.2/tests/test_indexer.py +174 -0
- smart_drive_os-1.4.2/tests/test_initializer.py +341 -0
- smart_drive_os-1.4.2/tests/test_install_docs.py +150 -0
- smart_drive_os-1.4.2/tests/test_internal_vault.py +257 -0
- smart_drive_os-1.4.2/tests/test_isolation.py +76 -0
- smart_drive_os-1.4.2/tests/test_junction.py +202 -0
- smart_drive_os-1.4.2/tests/test_junk_core_dumps.py +170 -0
- smart_drive_os-1.4.2/tests/test_junk_dependency_trees.py +258 -0
- smart_drive_os-1.4.2/tests/test_junk_detector_prefilter.py +117 -0
- smart_drive_os-1.4.2/tests/test_junk_dir_sizes.py +160 -0
- smart_drive_os-1.4.2/tests/test_junk_git_tracked.py +309 -0
- smart_drive_os-1.4.2/tests/test_junk_project_roots.py +195 -0
- smart_drive_os-1.4.2/tests/test_junk_sub_path_scope.py +245 -0
- smart_drive_os-1.4.2/tests/test_junk_system_refs.py +281 -0
- smart_drive_os-1.4.2/tests/test_launchers_and_invariants_tier5.py +1515 -0
- smart_drive_os-1.4.2/tests/test_learning.py +774 -0
- smart_drive_os-1.4.2/tests/test_learning_units.py +521 -0
- smart_drive_os-1.4.2/tests/test_mcp_absolute_paths.py +276 -0
- smart_drive_os-1.4.2/tests/test_mcp_adversarial_challenger1.py +393 -0
- smart_drive_os-1.4.2/tests/test_mcp_adversarial_challenger2.py +307 -0
- smart_drive_os-1.4.2/tests/test_mcp_grade_a.py +911 -0
- smart_drive_os-1.4.2/tests/test_mcp_hardening.py +563 -0
- smart_drive_os-1.4.2/tests/test_mcp_protocol_fixes.py +228 -0
- smart_drive_os-1.4.2/tests/test_mcp_proxy.py +226 -0
- smart_drive_os-1.4.2/tests/test_mcp_registry.py +207 -0
- smart_drive_os-1.4.2/tests/test_mcp_server.py +405 -0
- smart_drive_os-1.4.2/tests/test_mcp_setup.py +248 -0
- smart_drive_os-1.4.2/tests/test_mcp_setup_run.py +913 -0
- smart_drive_os-1.4.2/tests/test_mcp_stress.py +526 -0
- smart_drive_os-1.4.2/tests/test_mcp_sub_dir_scope.py +282 -0
- smart_drive_os-1.4.2/tests/test_move_hint.py +734 -0
- smart_drive_os-1.4.2/tests/test_offloader.py +790 -0
- smart_drive_os-1.4.2/tests/test_packaging.py +269 -0
- smart_drive_os-1.4.2/tests/test_path_check.py +220 -0
- smart_drive_os-1.4.2/tests/test_paths_broken.py +442 -0
- smart_drive_os-1.4.2/tests/test_quick_access.py +229 -0
- smart_drive_os-1.4.2/tests/test_readme_vn.py +42 -0
- smart_drive_os-1.4.2/tests/test_registrar_launch.py +396 -0
- smart_drive_os-1.4.2/tests/test_release_workflow.py +497 -0
- smart_drive_os-1.4.2/tests/test_relink.py +2551 -0
- smart_drive_os-1.4.2/tests/test_relink_activation_scripts.py +398 -0
- smart_drive_os-1.4.2/tests/test_relink_console_scripts.py +558 -0
- smart_drive_os-1.4.2/tests/test_relink_ide.py +658 -0
- smart_drive_os-1.4.2/tests/test_relink_up_to_date.py +604 -0
- smart_drive_os-1.4.2/tests/test_repos.py +412 -0
- smart_drive_os-1.4.2/tests/test_root_resolution.py +438 -0
- smart_drive_os-1.4.2/tests/test_same_file.py +62 -0
- smart_drive_os-1.4.2/tests/test_scanner.py +187 -0
- smart_drive_os-1.4.2/tests/test_scanner_paths_and_pruning.py +153 -0
- smart_drive_os-1.4.2/tests/test_search.py +219 -0
- smart_drive_os-1.4.2/tests/test_search_quirks.py +361 -0
- smart_drive_os-1.4.2/tests/test_self_exclusion.py +105 -0
- smart_drive_os-1.4.2/tests/test_sentinel.py +166 -0
- smart_drive_os-1.4.2/tests/test_smoke_script.py +181 -0
- smart_drive_os-1.4.2/tests/test_snapshot.py +439 -0
- smart_drive_os-1.4.2/tests/test_snapshot_hidden_dirs.py +283 -0
- smart_drive_os-1.4.2/tests/test_system_refs.py +692 -0
- smart_drive_os-1.4.2/tests/test_taxonomy_consistency.py +95 -0
- smart_drive_os-1.4.2/tests/test_undo.py +373 -0
- smart_drive_os-1.4.2/tests/test_version_consistency.py +62 -0
- smart_drive_os-1.4.2/tests/test_workstation_hybrid.py +177 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DuongNAD and SmartDrive-OS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: smart-drive-os
|
|
3
|
+
Version: 1.4.2
|
|
4
|
+
Summary: Organize a drive without breaking your coding agents and IDEs: move folders and relink the paths they remember, clean junk safely, and search files instantly. Zero-dependency CLI and MCP server.
|
|
5
|
+
Author-email: DuongNAD <smartdrive.os@proton.me>, SmartDrive Team <smartdrive.os@proton.me>
|
|
6
|
+
Maintainer-email: DuongNAD <smartdrive.os@proton.me>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/DuongNAD/smart-drive-os
|
|
9
|
+
Project-URL: Documentation, https://github.com/DuongNAD/smart-drive-os#readme
|
|
10
|
+
Project-URL: Repository, https://github.com/DuongNAD/smart-drive-os
|
|
11
|
+
Project-URL: Issues, https://github.com/DuongNAD/smart-drive-os/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/DuongNAD/smart-drive-os/releases
|
|
13
|
+
Project-URL: Privacy, https://github.com/DuongNAD/smart-drive-os/blob/main/PRIVACY.md
|
|
14
|
+
Keywords: ssd,exfat,cluster-slack,fts5,mcp,mcp-server,model-context-protocol,duongnad,autonomous-agent,ai-agents,claude-code,antigravity,cursor-ide,storage-audit,junk-cleaner,privacy,zero-telemetry,zero-dependency,local-first,air-gapped,sha256-snapshot,ntfs-junction,cache-offload,ssd-health,relink,file-organizer,vscode,jetbrains,file-search
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: System Administrators
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
20
|
+
Classifier: Operating System :: MacOS
|
|
21
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
22
|
+
Classifier: Programming Language :: Python :: 3
|
|
23
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
29
|
+
Classifier: Topic :: System :: Filesystems
|
|
30
|
+
Classifier: Topic :: System :: Archiving
|
|
31
|
+
Classifier: Topic :: System :: Hardware
|
|
32
|
+
Classifier: Topic :: Utilities
|
|
33
|
+
Classifier: Topic :: Security
|
|
34
|
+
Classifier: Environment :: Console
|
|
35
|
+
Classifier: Environment :: Web Environment
|
|
36
|
+
Classifier: Natural Language :: English
|
|
37
|
+
Classifier: Natural Language :: Vietnamese
|
|
38
|
+
Requires-Python: >=3.9
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
License-File: LICENSE
|
|
41
|
+
Provides-Extra: dev
|
|
42
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
<p align="center"><img src="https://raw.githubusercontent.com/DuongNAD/smart-drive-os/main/docs/banner.jpg" alt="SmartDrive-OS — Saturn and its orderly rings in deep space" width="100%"></p>
|
|
46
|
+
<!-- mcp-name: io.github.DuongNAD/smart-drive-os -->
|
|
47
|
+
|
|
48
|
+
# SmartDrive-OS
|
|
49
|
+
|
|
50
|
+
*Saturn's rings as orderly storage lanes: every file in its lane, across the whole drive.*
|
|
51
|
+
|
|
52
|
+
[](https://www.python.org/)
|
|
53
|
+
[](pyproject.toml)
|
|
54
|
+
[](PRIVACY.md)
|
|
55
|
+
[](https://github.com/DuongNAD/smart-drive-os/actions/workflows/tests.yml)
|
|
56
|
+
[](https://m8ven.ai/mcp/duongnad-smart-drive-os)
|
|
57
|
+
[](https://github.com/DuongNAD/smart-drive-os/releases/tag/v1.4.2)
|
|
58
|
+
[](LICENSE)
|
|
59
|
+
|
|
60
|
+
SmartDrive-OS is a zero-dependency drive operating suite and sub-10ms SQLite FTS5 search engine for external portable SSDs (exFAT 512 KB clusters) and internal secondary workstation drives (NTFS 4 KB clusters). It is built for developers, university students, and AI coding agents (Claude Code, Claude Desktop, Antigravity, Cursor, Codex, Windsurf) to organize drives without breaking agent paths, govern `.gitignore` rules, offload `C:` caches, and verify file integrity with SHA-256 snapshots. Everything runs 100% locally on the Python 3.9+ standard library (`dependencies = []`) with zero telemetry.
|
|
61
|
+
|
|
62
|
+
> 🇻🇳 **Tiếng Việt**: [README_VN.md](README_VN.md) · 🚀 **Internal NTFS Drive & C-Drive Cache Offload Guide**: [README_INTERNAL.md](README_INTERNAL.md)
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Table of Contents
|
|
67
|
+
|
|
68
|
+
- [Quickstart](#quickstart)
|
|
69
|
+
- [Everyday Use](#everyday-use)
|
|
70
|
+
- [Why exFAT Needs This](#why-exfat-needs-this)
|
|
71
|
+
- [Features at a Glance](#features-at-a-glance)
|
|
72
|
+
- [CLI Command Reference](#cli-command-reference)
|
|
73
|
+
- [Folder Moves and Coding Agents](#folder-moves-and-coding-agents)
|
|
74
|
+
- [MCP Server & AI Coding Agents](#mcp-server--ai-coding-agents)
|
|
75
|
+
- [Search Syntax](#search-syntax)
|
|
76
|
+
- [Learning Materials (Aurora Slides and Polaris)](#learning-materials-aurora-slides-and-polaris)
|
|
77
|
+
- [Gitignore Governance](#gitignore-governance)
|
|
78
|
+
- [Safe Junk Cleaner](#safe-junk-cleaner)
|
|
79
|
+
- [Snapshots and Backup](#snapshots-and-backup)
|
|
80
|
+
- [Workstation Hybrid and C-Drive Offload](#workstation-hybrid-and-c-drive-offload)
|
|
81
|
+
- [Launchers](#launchers)
|
|
82
|
+
- [Profiles](#profiles)
|
|
83
|
+
- [Testing](#testing)
|
|
84
|
+
- [Privacy, Security & Data Isolation](#privacy-security--data-isolation)
|
|
85
|
+
- [Contributing & License](#contributing--license)
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Quickstart
|
|
90
|
+
|
|
91
|
+
### 1. Install (or run without installing)
|
|
92
|
+
**uvx** (after the first PyPI release): needs only [uv](https://docs.astral.sh/uv/), which also downloads a Python when the machine has none.
|
|
93
|
+
```bash
|
|
94
|
+
uvx smart-drive-os <subcommand> # runs any subcommand, installs nothing
|
|
95
|
+
uvx smart-drive-os mcp register --all # registers `uvx smart-drive-os mcp` with your coding agents
|
|
96
|
+
```
|
|
97
|
+
**pipx** (after the first PyPI release; Python 3.9+):
|
|
98
|
+
```bash
|
|
99
|
+
pipx install smart-drive-os
|
|
100
|
+
smart-drive <subcommand>
|
|
101
|
+
smart-drive mcp register --all # registers this install with your coding agents
|
|
102
|
+
```
|
|
103
|
+
`pip install smart-drive-os` works too.
|
|
104
|
+
|
|
105
|
+
**From source**:
|
|
106
|
+
```bash
|
|
107
|
+
git clone https://github.com/DuongNAD/smart-drive-os.git
|
|
108
|
+
cd smart-drive-os
|
|
109
|
+
pip install -e . # editable install (`smart-drive` CLI)
|
|
110
|
+
python -m smart_drive <subcommand> # or run directly from the checkout
|
|
111
|
+
py -m smart_drive <subcommand> # Windows Python Launcher (when `python` is not on PATH)
|
|
112
|
+
smart-drive self-path-check # check PATH and print 1-click shell setup
|
|
113
|
+
```
|
|
114
|
+
Editable installs (`pip install -e .`) need pip 21.3 or newer: with an older pip (the Python 3.9 that ships with Xcode on macOS has pip 21.2), run `python -m pip install -U pip` first.
|
|
115
|
+
|
|
116
|
+
### 2. Initialise the drive
|
|
117
|
+
Run `Setup_SSD.bat` / `Setup_SSD.ps1` (Windows), `Setup_SSD.command` (macOS), `./Setup_SSD.sh` (Linux), or `smart-drive init --profile <name>` (see [Profiles](#profiles)):
|
|
118
|
+
- `workstation-hybrid`: your secondary drive (`D:`, `E:`, …) with games, Windows apps, and coursework.
|
|
119
|
+
- `internal-developer-vault`: internal NVMe/SATA SSD receiving offloaded `C:` dev and AI caches.
|
|
120
|
+
- `ai-developer`: portable external SSD for LLM weights, checkpoints, datasets, and AI agents.
|
|
121
|
+
- `data-science`: data engineering pipelines, raw data, and EDA notebooks.
|
|
122
|
+
- `general-workspace` *(default)*: universal active/archive code, learning notes, and utilities.
|
|
123
|
+
```bash
|
|
124
|
+
python -m smart_drive init --profile workstation-hybrid
|
|
125
|
+
python -m smart_drive init --profile ai-developer
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 3. Set up the MCP ecosystem (one command)
|
|
129
|
+
Fetch Constellation, Polaris, Aurora Slides, Vega, Orion, Sirius, and Mira into `~/.smart-drive/mcp` (off the exFAT drive), register them with SmartDrive in every installed coding agent (Claude Code, Antigravity, Cursor, Codex), and health-check them. It lists the servers and asks which ones you want before it downloads or registers anything; safe to repeat:
|
|
130
|
+
```bash
|
|
131
|
+
python3 -m smart_drive setup # macOS / Linux (Windows: python -m smart_drive setup or py -m smart_drive setup)
|
|
132
|
+
```
|
|
133
|
+
Answer `a` (all), `n` (none, the default), or numbers/names such as `1,3` or `polaris,vega`; Constellation, the control plane, always comes with the others while it is not installed yet. A server that is already downloaded is listed too when it would be added to an agent's config, with the agents named. `--yes` skips the question (`--only polaris,vega --yes` installs just those). A coding agent has no terminal to answer in: its run installs nothing, exits with code `4` and lists the servers, and the agent asks you in its own chat before it runs `setup --only <your picks> --yes`.
|
|
134
|
+
|
|
135
|
+
Needs Node.js >= 22.4 and git. `--dry-run` previews; `--check --json` reports state (exit code `3` = setup needed); `--no-clone` stays offline; `--agents claude,cursor` limits targets. Registered servers are reused, never cloned twice (`mcp-agy` is separate: own venv, Python >= 3.10, API key).
|
|
136
|
+
|
|
137
|
+
### 4. Register SmartDrive MCP standalone
|
|
138
|
+
```bash
|
|
139
|
+
smart-drive mcp register --all # Antigravity, Claude, Cursor, Codex, Windsurf, .mcp.json
|
|
140
|
+
```
|
|
141
|
+
Or add the entry yourself. For Claude Desktop (`claude_desktop_config.json`), Cursor (`~/.cursor/mcp.json`), Antigravity (`~/.gemini/antigravity/mcp_config.json`), Windsurf (`~/.codeium/windsurf/mcp_config.json`) and a project's `.mcp.json`:
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"mcpServers": {
|
|
145
|
+
"smart-drive": {
|
|
146
|
+
"command": "uvx",
|
|
147
|
+
"args": ["smart-drive-os", "mcp"],
|
|
148
|
+
"env": { "PYTHONIOENCODING": "utf-8", "PYTHONUTF8": "1" }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
Claude Code:
|
|
154
|
+
```bash
|
|
155
|
+
claude mcp add --scope user smart-drive -- uvx smart-drive-os mcp
|
|
156
|
+
```
|
|
157
|
+
Codex (`~/.codex/config.toml`):
|
|
158
|
+
```toml
|
|
159
|
+
[mcp_servers.smart-drive]
|
|
160
|
+
command = "uvx"
|
|
161
|
+
args = ["smart-drive-os", "mcp"]
|
|
162
|
+
```
|
|
163
|
+
With pipx use `"command": "smart-drive", "args": ["mcp"]` instead. Apps started from the desktop (Claude Desktop on macOS, for example) may not see `~/.local/bin`: if `uvx` or `smart-drive` is not found, put its full path in `command` (`which uvx` or `where uvx`); `smart-drive mcp register` writes full paths by itself. To pin a drive add `"--root", "E:\\"` to `args` or set `SMART_DRIVE_ROOT`; otherwise it looks for a SmartDrive root above the folder the agent starts it in, then on attached drives.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Everyday Use
|
|
168
|
+
|
|
169
|
+
**Checkup (1-screen health score & next steps)** — Get a `0–100` (`A–F`) health score with plain-language status and copy-pasteable commands:
|
|
170
|
+
```bash
|
|
171
|
+
smart-drive checkup
|
|
172
|
+
smart-drive checkup --lang vi
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Search (<10ms)** — Query the SQLite FTS5 index with BM25 ranking instead of recursive `find`/`grep`:
|
|
176
|
+
```bash
|
|
177
|
+
smart-drive search "llama cat:ai_models"
|
|
178
|
+
smart-drive search "exam ext:pdf size:>1MB dir:DBI202"
|
|
179
|
+
smart-drive search --kind slide "vòng lặp"
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Organize & Undo** — Auto-zone root folders into the 6 taxonomies, route coursework, and rebalance slack (or run `Smart_Organize.bat` / `./Smart_Organize.sh` for a guided flow):
|
|
183
|
+
```bash
|
|
184
|
+
smart-drive organize --dry-run
|
|
185
|
+
smart-drive organize --apply
|
|
186
|
+
smart-drive undo --apply # revert the latest organize/classify batch & relink back
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Moving folders without breaking coding agents, IDEs, or shortcuts** — `organize --apply` and `classify --apply` relink automatically. After moving folders by hand (or via menu option `[8]` in `SmartDrive`), run:
|
|
190
|
+
```bash
|
|
191
|
+
smart-drive relink --find --apply --ask --wait
|
|
192
|
+
smart-drive relink "E:\Old\proj" "E:\New\proj" --wait
|
|
193
|
+
smart-drive paths --broken # scan for broken IDE entries, agent configs, and .lnk shortcuts
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Clean (with quarantine & restore)** — Preview junk first (mandatory dry-run default). `--apply` deletes regenerable OS metadata and build caches (Tier 1-2) at once; only logs, temp files, and dumps (Tier 3) go to a restorable `.smart_drive/quarantine/`:
|
|
197
|
+
```bash
|
|
198
|
+
smart-drive clean # dry-run preview (Tier 1 by default)
|
|
199
|
+
smart-drive clean --tier 2 # dry-run preview of Tier 1-2: what --apply would delete permanently
|
|
200
|
+
smart-drive clean --apply --tier 3 # delete Tier 1-2 junk, quarantine Tier 3 junk
|
|
201
|
+
smart-drive clean --list-quarantine
|
|
202
|
+
smart-drive clean --restore latest
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Audit & HTML Treemap** — Inspect storage and cluster slack using actual volume cluster geometry, or export a self-contained offline HTML treemap:
|
|
206
|
+
```bash
|
|
207
|
+
smart-drive audit
|
|
208
|
+
smart-drive audit --html
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Health (Sentinel)** — Verify mount, filesystem geometry, shields (auto-healed), index, and Git status:
|
|
212
|
+
```bash
|
|
213
|
+
smart-drive sentinel
|
|
214
|
+
smart-drive health
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Snapshot and backup** — Create streaming SHA-256 manifests to detect bit rot and run incremental backups:
|
|
218
|
+
```bash
|
|
219
|
+
smart-drive snapshot create pre_release
|
|
220
|
+
smart-drive snapshot verify pre_release
|
|
221
|
+
smart-drive backup --target E:\Backups\SSD_Mirror --dry-run
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Why exFAT Needs This
|
|
227
|
+
|
|
228
|
+
High-capacity external SSDs (such as the Kingston XS2000 2 TB) format exFAT with **512 KB (524,288-byte) clusters**:
|
|
229
|
+
- Physical allocation is $\lceil \text{File Size} / 524,288 \rceil \times 524,288\text{ B}$ (0 B $\rightarrow$ 0 B; 1 B $\rightarrow$ 512 KB / 99.9998% slack; 10 KB $\rightarrow$ 512 KB / 98.05% slack; 100 KB $\rightarrow$ 512 KB / 80.47% slack; 512 KB + 1 B $\rightarrow$ 1,024 KB / 50% slack).
|
|
230
|
+
- A repo with **10,000 source files** (15 MB nominal) consumes **>5.12 GB** on exFAT (>99% cluster slack waste).
|
|
231
|
+
- OS indexers (macOS Spotlight `mds`, Windows Search) write hidden metadata (`.DS_Store`, `Thumbs.db`, `.fseventsd`), causing I/O wear and battery drain.
|
|
232
|
+
- Internal secondary SSDs (`D:`, `E:`, … on NTFS 4 KB) face `C:` exhaustion from 50–200 GB AI/dev caches while your secondary drive (`D:`, `E:`, …) hosts Windows apps, games, and active SQL Server databases that must never be moved or deleted.
|
|
233
|
+
|
|
234
|
+
| Dimension | External Portable SSD (exFAT) | Internal Secondary SSD (NTFS) |
|
|
235
|
+
|---|---|---|
|
|
236
|
+
| **Typical Mount** | `/Volumes/KINGSTON` or `E:\` | `D:\` or `E:\` (Fixed Disk) |
|
|
237
|
+
| **Cluster Size** | **512 KB** (524,288 bytes) | **4 KB** (4,096 bytes) |
|
|
238
|
+
| **Primary Bottleneck** | Catastrophic cluster slack on small files | C-drive disk exhaustion & cache fragmentation |
|
|
239
|
+
| **Symlink Support** | ❌ Unsupported (corrupts cross-platform) | ⚡ Supported via NTFS Junctions (`mklink /J`) |
|
|
240
|
+
| **Specialized Strategy** | Bundling, anti-slack auto-zoning, anti-indexing shields | 7-Phase transactional cache offload, service protection |
|
|
241
|
+
| **Protected Assets** | Root manifests, scripts, 6 core taxonomies | Windows apps, game libraries, active SQL Server databases |
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Features at a Glance
|
|
246
|
+
|
|
247
|
+
| Capability | One-Line Summary | Main Command | Section |
|
|
248
|
+
|---|---|---|---|
|
|
249
|
+
| **Unified CLI & Storage Audit** | 25 commands for checkup, setup, FTS5 indexing, real-cluster slack math, HTML treemap, and drive governance | `smart-drive checkup` / `smart-drive audit --html` | [CLI Command Reference](#cli-command-reference) |
|
|
250
|
+
| **Agent, IDE & Shortcut Relinking** | Keeps coding agents, VS Code/JetBrains/Obsidian, `.lnk` shortcuts, worktrees, and `.venv` working after moves (plus `undo` & `paths --broken`) | `smart-drive relink --find --apply --ask --wait` | [Folder Moves and Coding Agents](#folder-moves-and-coding-agents) |
|
|
251
|
+
| **MCP Server & Setup** | 9 JSON-RPC 2.0 stdio tools (M8ven Grade A 100/100) and 1-command ecosystem setup | `python -m smart_drive setup` | [MCP Server & AI Coding Agents](#mcp-server--ai-coding-agents) |
|
|
252
|
+
| **Sub-10ms FTS5 Search** | SQLite FTS5 `unicode61` BM25 search with extension, binary size, category, dir filters | `smart-drive search "<query>"` | [Search Syntax](#search-syntax) |
|
|
253
|
+
| **Learning Materials** | Indexes Aurora Slides & Polaris (`slide`, `fact`, `capture`) and pins learning units | `smart-drive search --kind slide "<q>"` | [Learning Materials](#learning-materials-aurora-slides-and-polaris) |
|
|
254
|
+
| **Gitignore Governance** | Stack-aware `.gitignore` blocks, Constellation `personal-data` guard, secret/leak audits | `smart-drive gitignore audit` | [Gitignore Governance](#gitignore-governance) |
|
|
255
|
+
| **3-Tier Safe Cleaner & Quarantine** | Dry-run-first junk cleaner with reversible quarantine, restore, and inviolable system/app whitelist | `smart-drive clean` | [Safe Junk Cleaner](#safe-junk-cleaner) |
|
|
256
|
+
| **Snapshots, Backup & Repos** | Streaming SHA-256 bit-rot verification, incremental backup, duplicate & clone audits | `smart-drive snapshot create` | [Snapshots and Backup](#snapshots-and-backup) |
|
|
257
|
+
| **Workstation Hybrid & Offload** | Adaptive exFAT/NTFS geometry, `AcademicClassifier` (FPTU), `protected_by_system` guard, `C:` offload | `smart-drive offload --scan` | [Workstation Hybrid and C-Drive Offload](#workstation-hybrid-and-c-drive-offload) |
|
|
258
|
+
| **24 Portable Launchers** | Zero-Git 1-click `.bat`, `.ps1`, `.command`, `.sh` scripts (including `Smart_Organize`) plus `self-path-check` | `Smart_Organize.bat` / `SmartDrive.bat` | [Launchers](#launchers) |
|
|
259
|
+
| **5 Preset Profiles** | Layouts for hybrid workstations, C-drive vaults, AI, data science, and general use | `smart-drive init --profile <name>` | [Profiles](#profiles) |
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## CLI Command Reference
|
|
264
|
+
|
|
265
|
+
All commands run via `smart-drive <command>`, `python -m smart_drive <command>`, or `py -m smart_drive <command>` (Windows when `python` is not on `PATH`):
|
|
266
|
+
|
|
267
|
+
| Command | Key Arguments | Description |
|
|
268
|
+
|---|---|---|
|
|
269
|
+
| `self-path-check` | *(none)* | Inspects Python CLI script paths on system `PATH` and outputs 1-click setup commands. |
|
|
270
|
+
| `checkup` | `--root <path>`, `--dup`, `--lang {en,vi}`, `--json` | 1-screen drive health score (`0–100`), comparison against previous run, and prioritized next-step commands. |
|
|
271
|
+
| `init` | `--profile <name>`, `--root <path>`, `--force`, `--json` | 1-touch drive setup, taxonomy creation, anti-indexing shield installation, and FTS5 DB seeding. |
|
|
272
|
+
| `status` | `--root <path>`, `--json` | Inspect SSD mount point, detected filesystem, geometry, shield health, and taxonomy status. |
|
|
273
|
+
| `audit` | `--root <path>`, `--html [file]`, `--json`, `--markdown`, `--export <file>` | Storage & cluster slack audit using the drive's real cluster size (4 KB NTFS, 512 KB exFAT, etc.). `--html` exports a self-contained offline treemap report (default `<root>/.smart_drive/reports/audit.html`). Hard links counted once; symlinks/junctions skipped and counted. |
|
|
274
|
+
| `clean` | `--dry-run` *(default)*, `--apply`, `--tier {1,2,3}`, `--only-tier {1,2,3}`, `--no-quarantine`, `--list-quarantine`, `--restore <batch\|latest>`, `--purge-quarantine`, `--older-than <days>` *(default 30, `0` = every batch)*, `--log`, `--json` | Junk cleaner with mandatory dry-run and inviolable whitelist; it skips installed packages, folders the system depends on and git-tracked entries, and reports what it kept. `--apply` deletes regenerable Tier 1-2 junk permanently and at once (preview first) and quarantines only Tier 3 junk to `<root>/.smart_drive/quarantine/<batch_id>/` (restorable via `--restore`; `--no-quarantine` deletes Tier 3 too). |
|
|
275
|
+
| `search` | `<query>`, `--ext <ext>`, `--size <spec>`, `--category <cat>`, `--kind <k>`, `--limit <n>`, `--json` | Sub-10ms SQLite FTS5 multi-criteria query parser with BM25 ranking. |
|
|
276
|
+
| `organize` | `--dry-run`, `--apply`, `--clean`, `--json` | Auto-zoning, loose-file relocation, `AcademicClassifier` routing, `protected_by_system` guard, and agent/IDE/shortcut relinking; logs move batches to `.smart_drive/moves.jsonl`. |
|
|
277
|
+
| `undo` | `--apply`, `--dry-run`, `--root <path>`, `--json` | Reverses the latest `organize`/`classify` move batch that has not been undone yet, skips items instead of overwriting when the original place is taken, and relinks agents/IDEs/shortcuts back to the original paths (dry-run default). |
|
|
278
|
+
| `relink` | `[OLD NEW]`, `--find`, `--apply`, `--ask`, `--wait [MIN]`, `--root <path>`, `--dry-run`, `--json` | Rewrites project/MCP paths in coding agents, VS Code/Cursor/Windsurf/Antigravity (`storage.json` & `state.vscdb`), JetBrains (`recentProjects.xml`), Obsidian (`obsidian.json`), Windows `.lnk` shortcuts, Claude Code history, git worktrees, and `.venv`. |
|
|
279
|
+
| `paths` | `--broken`, `--fix`, `--dry-run`, `--root <path>`, `--json` | Scans IDE histories, coding agent configs, Obsidian vaults, Windows `.lnk` shortcuts, and `PATH` for broken paths; suggests where moved folders went and repairs sure matches with `--fix`. |
|
|
280
|
+
| `sentinel` | `--root <path>`, `--auto-heal`, `--no-heal`, `--json` | 1-touch health audit (detected filesystem, git repo status) and shield self-healing (alias: `agent-check`). |
|
|
281
|
+
| `mcp` | `[{serve,register}]`, `--root <path>`, `--all`, `--auth-token <token>`, `--require-auth` | Starts the JSON-RPC 2.0 stdio MCP server (`serve`) or registers configs for AI agents (`register`). |
|
|
282
|
+
| `mcp-config` | `--all`, `--antigravity`, `--claude`, `--cursor`, `--windsurf`, `--workspace`, `--json` | Auto-registers SmartDrive MCP Server in AI coding agent config files. |
|
|
283
|
+
| `setup` | `--check`, `--dry-run`, `--json`, `--agents <list>`, `--only <list>`, `--dest <dir>`, `--no-clone`, `--no-health`, `--repair`, `--yes` | Asks which MCP servers to install (Constellation, Polaris, Aurora Slides, Vega, Orion, Sirius, Mira), then fetches them, registers them with installed coding agents (Claude Code, Antigravity, Cursor, Codex), and health-checks them. `--yes` skips the question. Exit code `3` from `--check` = setup needed; `4` = without a terminal and without `--yes`, user approval is needed (nothing installed). |
|
|
284
|
+
| `snapshot create` | `[name]`, `--partitions <list>`, `--include-hidden`, `--root <path>`, `--json` | Generates a point-in-time manifest with 64KB-chunk streaming SHA-256 hashes. |
|
|
285
|
+
| `snapshot list` | `--root <path>`, `--json` | Lists recorded point-in-time snapshots with sizes and file counts. |
|
|
286
|
+
| `snapshot verify` | `<name>`, `--no-untracked`, `--root <path>`, `--json` | Validates file integrity against snapshot manifest to detect tampering or bit rot. |
|
|
287
|
+
| `backup` | `--target <path>`, `--dry-run`, `--hash`, `--partitions <list>`, `--include-hidden`, `--json` | Safe incremental backup copying only modified/new files to target directory. |
|
|
288
|
+
| `classify` | `[path]`, `--suggest`, `--dry-run`, `--apply`, `--recursive`, `--json` | Deep content inspection (magic bytes & markers) for AI models, datasets, docs, and code repos. Looks only at the files directly in the scanned folder; `--recursive` also visits subfolders. It never takes apart an app, library or project folder (programs, launcher scripts, manifests, `.git`) or a folder holding a program folder, so a document tree with an installer subfolder is skipped too; each is listed as `skipped_bundles`, and a folder you name gets the same check (only the drive root is exempt; `--no-recursive` is still accepted). Never follows/moves symlinks or junctions, or moves SmartDrive scripts/system files. |
|
|
289
|
+
| `offload` | `--scan`, `--move <name>`, `--target <drive>`, `--revert <name>`, `--wait [MIN]`, `--force`, `--dry-run`, `--json` | Developer/AI cache discovery and transactional offloading to your secondary drive (`D:`, `E:`, …) via NTFS junction (Windows) or symlink (macOS/Linux); refuses when cache-using processes are running, or when the list of running programs cannot be read, unless `--wait` or `--force` is passed. |
|
|
290
|
+
| `health` | `[drive]`, `--root <path>`, `--json` | SSD health, TRIM check (Windows), partition geometry, and utilization monitor (drive letter on Windows or `/Volumes/MySSD` on macOS/Linux). |
|
|
291
|
+
| `dup` | `--root <path>`, `--min-size <bytes>`, `--json` | 3-phase SHA-256 duplicate detector with real-cluster slack reclamation preview: the slack is worked out at the volume's allocation unit (512 KB when it cannot be read) and `--json` says which as `cluster_size`. Hard links to the same data are one file, never offered for deletion. Dependency, environment and cache trees (`node_modules`, `site-packages`, virtualenvs, folders tagged `CACHEDIR.TAG` such as Cargo's `target`, `__pycache__`, `.git`, …) and folders Windows or installed apps depend on (`protected_by_system`) are not scanned; the plan counts what was skipped. Files are opened only when another file has their size, several at a time, and progress goes to stderr every ~2 s so `--json` on stdout stays parseable. |
|
|
292
|
+
| `repos` | `[paths...]`, `--root <ssd>`, `--portable <path>`, `--max-depth <n>`, `--json` | Read-only report of git clones: duplicates in the same place (keep / remove / worktree suggestions) and sync state of SSD-vs-machine mirrors. |
|
|
293
|
+
| `gitignore audit` | `[repo]`, `--root <path>`, `--all`, `--owner <name>`, `--keep <pat>`, `--json` | Audit repos for missing `.gitignore` patterns, tracked junk (`.agents`, pycache), and tracked personal learning data in public repos. |
|
|
294
|
+
| `gitignore apply` | `<repo>`, `--yes`, `--untrack`, `--keep <pat>`, `--json` | Apply SmartDrive-managed `.gitignore` block for repo stack (dry-run default; `--yes` to apply; `--untrack` to remove matching files from git index). |
|
|
295
|
+
| `index` | `--root <path>`, `--db <path>`, `--batch <n>` | Full SQLite FTS5 index creation (>15,000 files/sec). |
|
|
296
|
+
| `update` | `[path]`, `--root <path>`, `--db <path>`, `--quiet`, `--json` | Fast $O(1)$ incremental search index synchronization (<2s). |
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Folder Moves and Coding Agents
|
|
301
|
+
|
|
302
|
+
Coding agents, IDEs, and desktop shortcuts remember projects and MCP servers by absolute path, and exFAT cannot leave a link at the old place. When `organize` or `classify` moves a folder, SmartDrive protects system-referenced folders first and rewrites paths everywhere else:
|
|
303
|
+
- **System & App Protection (`protected_by_system`)**: Before planning any move, SmartDrive scans Windows User/System `PATH`, Windows Services (`ImagePath`), Installed Apps (`Uninstall` registry `InstallLocation` / `DisplayIcon` / `UninstallString`), Startup (`Run`), `.lnk` shortcuts (Desktop, Start Menu, Quick Launch, drive root), folders containing `unins000.exe` / `uninstall.exe`, and game libraries (`SteamLibrary`, `Riot Games`, `Epic Games`, `XboxGames`, `GOG Galaxy`, `Battle.net`, `Ubisoft Game Launcher`, `EA Games`, `HoYoPlay`, `Genshin Impact`, `LDPlayer`). Any matching folder is pinned in place with its exact reason in `protected_by_system`.
|
|
304
|
+
- **Keeping a folder of your own in place**: `organize` only moves what lies directly in the drive root, so a folder you keep inside one of the taxonomy folders (for example `03_Development_Projects\my-app`) stays where it is. On Windows, a folder is also `protected_by_system` when a shortcut (`.lnk`) on the Desktop, in the Start Menu or on the taskbar points at it or at something inside it: `organize`, `classify`, `clean` and `dup` leave it alone, and `organize --dry-run` lists it as skipped. A shortcut in the drive root counts too, but `classify --apply` files loose root files, `.lnk` included, and the protection leaves with the shortcut.
|
|
305
|
+
- **Agent, IDE & Shortcut Settings**: Claude Code (`~/.claude.json`), Claude desktop (config, sessions, worktrees, including Microsoft Store MSIX), Codex (`config.toml`), Gemini CLI, Antigravity, Cursor, Windsurf, VS Code, VSCodium, Positron (`storage.json` and SQLite `state.vscdb`), JetBrains IDEs (`recentProjects.xml` including `$USER_HOME$` macros), Obsidian (`obsidian.json`), Windows `.lnk` shortcuts, Constellation manifest, and the drive's `.mcp.json`. Each file is backed up to `<file>.bak.smart-drive` before writing; SQLite `state.vscdb` is skipped with a warning (`busy_apps`) if the IDE currently holds it open.
|
|
306
|
+
- **History and repositories**: Claude Code history and memory move to the new project folder, git worktrees are repaired, and editable installs in a moved `.venv` point at the new place.
|
|
307
|
+
- **Locked folders (git fsmonitor)**: Windows refuses to rename a folder while a process holds a handle inside it, and a repository with `core.fsmonitor=true` gets a background `git fsmonitor--daemon` that does exactly that after its first `git status` (`[WinError 5] Access is denied`). SmartDrive's own git commands run with `-c core.fsmonitor=false`, so they never start one, and every move stops the daemons of the repositories inside the folder first (`--dry-run` lists them as `fsmonitor_to_stop`, `--apply` reports `fsmonitor_stopped`; git starts a daemon again by itself at the next `git status`). If a move is still refused, the error says what may be holding the folder: a program, a terminal, an Explorer window or a daemon that is still running, and on Windows the processes that have files of the folder open. Windows also refuses to rename a folder while anything *below* it is open, so a read-only probe (at most 8 levels, 20,000 entries and 5 seconds; it renames and keeps open nothing) tries to open every folder and file exclusively and names the deepest ones that are in use (`in use: E:\project\...\Images`, and `in_use` in the `--json` output of `organize`, `undo`, `classify` and the MCP tool `ssd_auto_organize`). When a folder inside is pinned in Explorer's Quick Access, the hint says so (Explorer keeps a handle on every pinned folder and opens it again at each logon, so restarting Windows alone does not help): unpin it, then restart Windows Explorer from Task Manager. When no process can be named for what is in use, the hint points at `explorer.exe` (an open Explorer window or Quick Access) and at Resource Monitor as administrator (`resmon` → CPU → Associated Handles).
|
|
308
|
+
- **Reversible Journal (`undo`)**: Every batch of moves is recorded in `.smart_drive/moves.jsonl` (identified by its `time`) so `smart-drive undo --apply` can move the latest `organize`/`classify` batch back and relink agents/IDEs/shortcuts to the original paths. Moves logged by `relink` and `paths` are not undoable.
|
|
309
|
+
|
|
310
|
+
How to run it:
|
|
311
|
+
```bash
|
|
312
|
+
smart-drive organize --dry-run # preview moves, protected folders, and which agents/IDEs follow
|
|
313
|
+
smart-drive organize --apply # move, then relink agents, IDEs, Obsidian, and shortcuts
|
|
314
|
+
smart-drive undo # preview reversing the latest move batch
|
|
315
|
+
smart-drive undo --apply # undo the latest batch and relink back to original paths
|
|
316
|
+
smart-drive relink # re-apply latest batch (after closing an open IDE/agent)
|
|
317
|
+
smart-drive relink "E:\Old\proj" "E:\New\proj" --dry-run # a folder moved by hand: preview
|
|
318
|
+
smart-drive relink "E:\Old\proj" "E:\New\proj" # ...then apply
|
|
319
|
+
smart-drive relink --find # list stale agent/IDE paths and where folders went
|
|
320
|
+
smart-drive relink --find --apply --wait # relink sure (?) matches after open apps close
|
|
321
|
+
smart-drive relink --find --apply --ask --wait # ...and ask y/N for each ? match first
|
|
322
|
+
smart-drive paths --broken # inspect broken shortcuts, IDE entries, PATH, and agent configs
|
|
323
|
+
smart-drive paths --broken --fix # repair sure matches via relink
|
|
324
|
+
```
|
|
325
|
+
Menu option `[8]` in `SmartDrive` (or `[10]` / `Smart_Organize.*` for the guided organizer with 1-key `U` undo) handles this interactively, and `[11]` re-applies the latest `organize`/`classify` batch: it previews `smart-drive relink --dry-run`, asks `[y/N]`, then runs `smart-drive relink --wait`. Use `[11]` after running `organize --apply` from inside a coding agent: quit the agent first (a running one may write its old paths back), then open `SmartDrive` and pick `[11]`. Close open coding agents and IDEs before relinking, or pass `--wait` so SmartDrive waits for them to close, then reopen them. If a command in a moved `.venv` still points at the old place, run `uv sync --reinstall` in that project.
|
|
326
|
+
|
|
327
|
+
`--find` marks a folder ✓ only when the move journal, or what the agents remember inside the old folder, shows where it went. A folder found by its name alone is marked `?` and never relinked by `--apply` on its own, since it may be another project and the old one deleted: check it, then run the `smart-drive relink "OLD" "NEW"` command printed next to it. Or add `--ask` (menu option `[8]` does): it asks `Relink OLD -> NEW? [y/N]` for each `?` folder with one candidate, and relinks the ones you answer `y` together with the ✓ ones. Enter means no. It asks only in a terminal: with `--json` or piped input it asks nothing.
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## MCP Server & AI Coding Agents
|
|
332
|
+
|
|
333
|
+
SmartDrive-OS exposes a JSON-RPC 2.0 `stdio` MCP server with **9 tools**:
|
|
334
|
+
|
|
335
|
+
1. `ssd_search`: Instant FTS5 search returning compact tokens (<2,000 tokens/query). *(read-only)*
|
|
336
|
+
2. `ssd_audit`: Storage breakdown and cluster slack waste analytics with compact formatting. *(read-only)*
|
|
337
|
+
3. `ssd_clean`: Whitelist-protected safe junk cleaner with dry-run support. A `sub_dir` is judged like the whole-drive scan, folders above it included: inside an installed app nothing is scanned and `scan_skipped` names the folder and why; the result also lists what was `kept` and the `protected_by_system` folders. *(destructive)*
|
|
338
|
+
4. `ssd_find_duplicates`: 3-phase SHA-256 duplicate detection with pagination and preview capping. `min_size` drops small files before anything is hashed, slack is worked out at the drive's real allocation unit (`cluster_size`), and a `sub_dir` inside an installed app or a dependency tree is not scanned (`scan_skipped`). *(read-only)*
|
|
339
|
+
5. `ssd_update_index`: Fast incremental index synchronization (<2s). *(idempotent)*
|
|
340
|
+
6. `ssd_check_safety`: exFAT compatibility validator (9 Win32 forbidden chars, 22 DOS stems, symlinks). *(read-only)*
|
|
341
|
+
7. `ssd_status`: SSD mount root status, shield health, and taxonomy status. *(read-only)*
|
|
342
|
+
8. `ssd_auto_organize`: Autonomous drive auto-zoning and anti-slack relocation with `AcademicClassifier`. *(destructive)*
|
|
343
|
+
9. `ssd_gitignore`: Stack-aware `.gitignore` governance, personal data defense, secrets audit, and safe untracking. *(idempotent)*
|
|
344
|
+
|
|
345
|
+
Register across all agents via `smart-drive mcp register --all` (or `smart-drive mcp-config --all`). A pipx or pip install registers its own Python, a `uvx smart-drive-os` run registers `uvx smart-drive-os mcp`, and from a source checkout (without `pip install`) each entry sets `PYTHONPATH` to the checkout so clients can launch from any folder. Templates in `configs/`: `.mcp.json` (workspace), `mcp_config.json` (Antigravity), `claude_desktop_config.json` (Claude Desktop & Code), `cursor_mcp.json` (Cursor / Codex), `windsurf_mcp.json` (Windsurf).
|
|
346
|
+
|
|
347
|
+
<details>
|
|
348
|
+
<summary>M8ven MCP Directory Certification (Grade A 100/100) & Token Efficiency</summary>
|
|
349
|
+
|
|
350
|
+
Certified on the [M8ven MCP Directory](https://m8ven.ai/mcp/duongnad-smart-drive-os) with a **Grade A (100/100) Trust Score** (token: `duongnad-smart-drive-os-1kxkwu`):
|
|
351
|
+
- **Static AST Handler Isolation**: Mapped via `SmartDriveMCPServer.TOOL_HANDLERS` without dynamic reflection.
|
|
352
|
+
- **Paged Compact JSON**: Paginated (`limit`, `offset`, `total_groups`, `returned_group_count`, `has_more`, `next_offset`) with duplicate previews capped at 10 paths/group (`truncated_files_count`).
|
|
353
|
+
- **HMAC Auth & Rate Limiting**: `hmac.compare_digest` via `auth/handshake` (`--auth-token`, `--require-auth`, `SMART_DRIVE_MCP_AUTH_TOKEN`) and thread-safe `SlidingWindowRateLimiter` (`-32000` with `Retry-After`).
|
|
354
|
+
- **Path Sanitizers, Loopback & Tool Hints**: `_resolve_safe_path` blocks `../`, `\0`, and cross-drive jumps; web helpers enforce `ALLOWED_LOOPBACK_HOSTS = ("127.0.0.1", "localhost")`; all 9 tools declare `readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`.
|
|
355
|
+
- **Zero Hidden Outbound Calls**: 100% offline `stdio`; only explicit opt-in `git clone` in `smart-drive setup` accesses the network (skipped with `--no-clone`).
|
|
356
|
+
|
|
357
|
+
</details>
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## Search Syntax
|
|
362
|
+
|
|
363
|
+
The SQLite FTS5 engine (`unicode61` + BM25) executes multi-criteria queries in <10ms:
|
|
364
|
+
|
|
365
|
+
- **Free Text**: `smart-drive search "machine learning"`
|
|
366
|
+
- **File Extension**: `smart-drive search "weights ext:gguf"`
|
|
367
|
+
- **Size Filter**: `smart-drive search "dataset size:>100MB"` (`size:<1MB`, `size:0`). `>`/`<` exclude the bound, `>=`/`<=` include it; binary units (`1KB = 1024` bytes). Unreadable filters (`size:>abc`, `size:>10 MB`) emit a warning (CLI stderr, MCP `warnings`) instead of being ignored silently.
|
|
368
|
+
- **Taxonomy Category**: `smart-drive search "llama cat:ai_models"`
|
|
369
|
+
- **Directory Constraint**: `smart-drive search "assignment dir:FPTU"`
|
|
370
|
+
- **Learning Kind**: `smart-drive search --kind slide "vòng lặp"` (or `kind:fact`, `--kind capture`, `--kind lesson`)
|
|
371
|
+
- **Compound Query**: `smart-drive search "exam ext:pdf size:>1MB dir:DBI202"`
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Learning Materials (Aurora Slides and Polaris)
|
|
376
|
+
|
|
377
|
+
SmartDrive-OS integrates with [Aurora Slides MCP](https://github.com/DuongNAD/aurora-slides-mcp) and [Polaris MCP](https://github.com/DuongNAD/polaris-mcp) across the DuongNAD learning ecosystem:
|
|
378
|
+
|
|
379
|
+
| Project | Role | Repository |
|
|
380
|
+
| :--- | :--- | :--- |
|
|
381
|
+
| **Polaris** | Course architect: sources, facts with locators, roadmap, schedule, error log | [polaris-mcp](https://github.com/DuongNAD/polaris-mcp) |
|
|
382
|
+
| **Aurora Slides** | Keynote-style lessons: quizzes, predict and trace slides, progress events | [aurora-slides-mcp](https://github.com/DuongNAD/aurora-slides-mcp) |
|
|
383
|
+
| **Vega** | FSRS memory engine and the single review queue (card inbox) | [vega-mcp](https://github.com/DuongNAD/vega-mcp) |
|
|
384
|
+
| **Orion** | Practice labs with real tests, tutoring ladder and PRIMM warm-up | [orion-mcp](https://github.com/DuongNAD/orion-mcp) |
|
|
385
|
+
| **Mira** | Code-tracing lab: real Python traces, line-by-line players with prediction gates | [mira-mcp](https://github.com/DuongNAD/mira-mcp) |
|
|
386
|
+
| **Rigel** | Grounded tutor: answers from the learner's lesson materials with [ref] citations | [rigel-mcp](https://github.com/DuongNAD/rigel-mcp) |
|
|
387
|
+
| **Sirius** | Execution loop: deadlines, triage, today router, session timer, weekly review | [sirius-mcp](https://github.com/DuongNAD/sirius-mcp) |
|
|
388
|
+
| **Constellation** | MCP registration, health checks and shared contracts | [constellation-mcp](https://github.com/DuongNAD/constellation-mcp) |
|
|
389
|
+
| **SmartDrive-OS** | SSD governance, index and learning search | [smart-drive-os](https://github.com/DuongNAD/smart-drive-os) |
|
|
390
|
+
|
|
391
|
+
SmartDrive-OS serves Polaris (learning search), Sirius, and Rigel (file discovery), receives post-write updates (`smart-drive update <dir> --quiet`) from Aurora ($\ge$ 0.6.2), Polaris ($\ge$ 0.3.2), and Mira, and enforces the `personal-data` ignore rules of [Constellation's contracts](https://github.com/DuongNAD/constellation-mcp/tree/main/contracts).
|
|
392
|
+
|
|
393
|
+
<details>
|
|
394
|
+
<summary>Indexed learning artifact kinds & Atomic Learning-Unit Protection</summary>
|
|
395
|
+
|
|
396
|
+
| Kind | Target Artifact | Extracted Content |
|
|
397
|
+
|---|---|---|
|
|
398
|
+
| `slide` | `deck.json` (Aurora Slides) | Slide titles, bullets, speaker notes, key takeaways |
|
|
399
|
+
| `lesson` | `course.json` (Aurora Courses) | Lesson syllabus, objectives, prerequisites, modules |
|
|
400
|
+
| `module` | `polaris/roadmap.json` (Polaris) | Roadmap modules, milestones and prerequisites |
|
|
401
|
+
| `fact` | `polaris/facts.json` (Polaris) | Atomic facts, statements, concepts, confidence scores |
|
|
402
|
+
| `source` | `polaris/sources.json` (Polaris) | Bibliographic citations, URLs, author notes, digests |
|
|
403
|
+
| `capture` | `polaris/captures/` (Polaris) | Extracted excerpts, highlights, study pages, quotes |
|
|
404
|
+
| `outline` | `polaris/lessons/*.outline.md` (Polaris) | Lesson outlines (headings) |
|
|
405
|
+
| `research` | `polaris/research/*.md` (Polaris) | Deep research syntheses, literature summaries, analyses |
|
|
406
|
+
| `error` | `polaris/errorlog.md` (Polaris) | Bug retrospectives, misconceptions, fixes |
|
|
407
|
+
| `learning` | All learning artifacts | Consolidated search across all educational kinds |
|
|
408
|
+
|
|
409
|
+
Aurora deck/course folders and Polaris subject dirs (`polaris/brief.json`) are pinned as atomic **Learning Units** (`pinned: Aurora course/deck or Polaris subject`): AutoZoner never splits/moves them, Cleaner and Duplicate Detector never delete their files, and legacy `polaris/.cache/**` files are cleaned as Tier-2 dev-cache junk (*"Polaris regenerable API cache (Polaris 0.3.2+ keeps it on C:)"*).
|
|
410
|
+
|
|
411
|
+
</details>
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## Gitignore Governance
|
|
416
|
+
|
|
417
|
+
`smart-drive gitignore` audits and applies stack-aware `.gitignore` rules across Git repos on the drive (<5ms shallow detection for Python, Node.js, Jupyter, Java, Rust, .NET, LaTeX, AI Models, Learning). It maintains an idempotent block between `# >>> smart-drive managed (do not edit inside) >>>` and `# <<< smart-drive managed <<<`, preserving user rules and CRLF/LF line endings:
|
|
418
|
+
- **exFAT Cluster Slack Defense**: Ignores `**/.agents/*` (500+ scratch files waste >260 MB on 512 KB clusters; `.agents/skills/`, `.agents/workflows/`, `.agents/rules/` stay tracked), `.claude/settings.local.json`, `__pycache__/`, `.pytest_cache/`, `node_modules/`, `target/`/`dist/`/`bin/`/`obj/`.
|
|
419
|
+
- **Constellation `personal-data` Protection**: Locks down `.vega/`, `**/progress.jsonl`, `aurora-progress-*.jsonl`, `orion-attempts.jsonl`, `**/polaris/.cache/`, `**/polaris/captures/`, `.polaris/`, and `.sirius/`, alerting if tracked in public or unconfigured remotes.
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
smart-drive gitignore audit # audit own & local repos (--all includes third-party)
|
|
423
|
+
smart-drive gitignore apply D:\teamwork_projects\my_project # dry-run preview
|
|
424
|
+
smart-drive gitignore apply D:\teamwork_projects\my_project --yes --untrack
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
<details>
|
|
428
|
+
<summary>Ownership classes, GitHub CLI visibility, intentional build outputs, secrets & safe untracking</summary>
|
|
429
|
+
|
|
430
|
+
- **Ownership Classes**: `own` (matches `--owner`, `SMART_DRIVE_GIT_OWNER`, `smartdrive.owner`, or drive consensus), `third-party` (`open_source/`, `vendor/`, `third_party/`, or external owner—upstream `dist/`/`build/` respected), and `local` (no remote).
|
|
431
|
+
- **Live GitHub Visibility (`gh`)**: Queries `public`, `private`, `internal`, or `missing` ("remote not found on GitHub") with per-run caching so private/deleted remotes never trigger false public-leak alarms.
|
|
432
|
+
- **Intentional Build Outputs & Keep Lists**: Files in `package.json` (`bin`, `main`, `module`, `types`, `exports`), `.gitignore` negations (`!dist/bundle.mjs`), or `smartdrive.keep` / `--keep <pattern>` are never flagged or untracked. Direct intentional files in `dist/` emit `<dir>/*` plus `!<file>` lines (or omit the pattern if nested).
|
|
433
|
+
- **High-Severity Secrets & Safe Untracking**: Tracked `.env`, `.env.*`, `*.pem`, `*.key`, and `credentials*.json` alert with **variable/key names only** (no secret values). `--untrack` runs `git rm -r --cached` (keeping disk files) and refuses when uncommitted staged changes exist.
|
|
434
|
+
|
|
435
|
+
</details>
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## Safe Junk Cleaner
|
|
440
|
+
|
|
441
|
+
Purgeable files are grouped into 3 tiers with a mandatory dry-run default (`--apply` required to move or delete):
|
|
442
|
+
1. **Tier 1 (Safe OS Metadata & Bytecode)**: macOS `.DS_Store`, `._*` AppleDouble, `.Spotlight-V100`, `.Trashes`, `.TemporaryItems`; Windows `Thumbs.db`, `desktop.ini`, `ehthumbs.db`, `ehthumbs_vista.db`, `$RECYCLE.BIN`; Python `__pycache__`, `*.pyc`, `*.pyo`.
|
|
443
|
+
2. **Tier 2 (Developer Caches)**: `.pytest_cache`, `.ruff_cache`, `.mypy_cache`, `.tox`, `.nox`, `.coverage`, `htmlcov`, `*.egg-info`; `build`, `dist` and `.cache` folders next to a project file; legacy `polaris/.cache/**`.
|
|
444
|
+
3. **Tier 3 (Transient & Dumps)**: `*.tmp`, `*.temp`, `*.swp`, `*.swo`, `*~`, `*.dmp`, `core` and `core.<pid>` (a Unix core dump; `core.py` or `core.js` is a source file and never matches), `hs_err_pid*.log`.
|
|
445
|
+
|
|
446
|
+
`clean` lists only what is really regenerable. It never lists anything of Tier 2-3 inside a dependency folder (`node_modules`, `bower_components`, `site-packages`, `.venv`, `vendor`...): that is installed package code, and `npm install` does not notice a deleted `dist/`. It never lists anything inside a folder that Windows or an installed app depends on (the same `protected_by_system` index `organize` uses: PATH, Services, Installed Apps, shortcuts, uninstallers). A `build`, `dist` or `.cache` folder counts only when a project file (`package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `pom.xml`, `*.csproj`...) lies beside it, and a Tier 2-3 entry that git tracks (or sits in a repository git cannot be asked about) is kept. The report says how many look-alikes were kept and why (`kept` and `protected_by_system` in `--json`).
|
|
447
|
+
|
|
448
|
+
`smart-drive clean --apply` permanently deletes Tier 1 and Tier 2 items at once: they are regenerable (OS metadata, build caches), so they are never quarantined, and nothing can bring them back. Preview with `smart-drive clean --tier 2` first (`smart-drive checkup` recommends the same order). Only Tier 3 items (`--tier 3`: temp files, swap files, crash dumps) move into a reversible quarantine batch under `<root>/.smart_drive/quarantine/<batch_id>/` (with `manifest.json`) instead of being unlinked:
|
|
449
|
+
- Quarantine Tier 3 junk alone and delete nothing else (`--tier 3 --apply` also deletes every Tier 1-2 item permanently): preview with `smart-drive clean --only-tier 3`, then run `smart-drive clean --only-tier 3 --apply`
|
|
450
|
+
- Inspect quarantined batches: `smart-drive clean --list-quarantine`
|
|
451
|
+
- Restore a batch to its original paths: `smart-drive clean --restore latest` (or `--restore <batch_id>`)
|
|
452
|
+
- Permanently purge old quarantine batches: preview with `smart-drive clean --purge-quarantine`, then `smart-drive clean --purge-quarantine --apply` permanently deletes the batches older than 30 days (`--older-than <days>` sets another age, and `--older-than 0` purges every batch)
|
|
453
|
+
- Delete Tier 3 items outright instead of quarantining them (for example when free space is critically low): `smart-drive clean --apply --tier 3 --no-quarantine`
|
|
454
|
+
|
|
455
|
+
> **Inviolable Whitelist**: Root manifests (`AGENTS.md`, `GEMINI.md`, `CLAUDE.md`, `README.md`, `PRIVACY.md`), launcher scripts (`Setup_*`, `Quick_*`, `Smart_Organize.*`, `SmartDrive.*`), the 6 taxonomies, Windows folders (`WindowsApps`, `Program Files`, `DumpStack.log.tmp`), system-referenced folders (`protected_by_system`: Windows `PATH`, Services, Installed Apps, Startup, `.lnk` targets, uninstallers), game libraries (`SteamLibrary`, `Riot Games`, `Epic Games`, `XboxGames`, `GOG Galaxy`, `Battle.net`, `Ubisoft Game Launcher`, `EA Games`, `HoYoPlay`, `Genshin Impact`, `LDPlayer`), active SQL Server databases (`Microsoft SQL Server 2022`), and `smart-drive-os` are permanently protected.
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
## Snapshots and Backup
|
|
460
|
+
|
|
461
|
+
- **SHA-256 Snapshots (`smart-drive snapshot`)**: Streaming 64 KB-chunk ($O(1)$ memory) point-in-time manifests in `.smart_drive/snapshots/<name>.json` to detect bit rot or tampering.
|
|
462
|
+
- **Incremental Backup (`smart-drive backup`)**: Copies modified/new files while excluding OS junk. Default coverage: `02_Learning_Knowledge`, `03_Development_Projects`, `05_Dev_Toolbox` (override with `--partitions`); hidden dirs (`.git`, `.github`, `.vscode`) are skipped unless `--include-hidden` is passed, and every run lists what was not covered.
|
|
463
|
+
- **Duplicates (`smart-drive dup`) & Git Clones (`smart-drive repos`)**: 3-phase SHA-256 duplicate finder (hard links counted once; `node_modules`, virtualenvs, caches and installed apps are never scanned) and read-only Git clone auditor checking SSD-vs-machine **mirrors** (`commit`, `push`, `pull`, `fetch to compare`) and same-drive **duplicates** (newest commit to keep, redundant same-branch copies, or `git worktree` with `--relative-paths` on git 2.48+; dirty/unpushed/stashed clones are blocked from removal).
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
## Workstation Hybrid and C-Drive Offload
|
|
468
|
+
|
|
469
|
+
`FilesystemAdapter` and `DriveDetectorBackend` adapt between **exFAT 512 KB** (slack guard, anti-symlink rules, Spotlight/FSEvents shields) and **NTFS 4 KB** (4,096-byte math, `fsutil` TRIM check, `C:` cache offload). `smart-drive offload` migrates heavy caches (HuggingFace, Ollama, PyTorch, Docker WSL2, pip, uv, npm, Conda, Gradle, Cargo) from `C:` to `<target>\04_System_Offload_Caches\<name>` on your secondary drive (`D:`, `E:`, …) in a **7-phase transactional workflow** with running-process detection (`--wait`, `--force`), rollback safety, and unprivileged NTFS Directory Junctions (`mklink /J`). See [README_INTERNAL.md](README_INTERNAL.md).
|
|
470
|
+
|
|
471
|
+
<details>
|
|
472
|
+
<summary>AcademicClassifier (FPTU), Non-Code Routing & AutoZoner Self-Defense</summary>
|
|
473
|
+
|
|
474
|
+
- **AcademicClassifier (FPTU)**: Extracts course codes (`DBI202`, `WED201c`, `SWE202c`, `PRN211`, `PRJ301`, `OSG`), detects exams/labs (`PE`, `de thi`, `on luyen`, `lab1_sp26`, `sp26`, `fa25`, `su25`), zones into `02_Learning_Knowledge/FPTU/Ky_1/` .. `Ky_7/`, and repairs ZIP mojibake (`h?c k? 3 fptu` $\rightarrow$ `Hoc_Ky_3_fptu`, `n luy?n pe dbi202` $\rightarrow$ `On_Luyen_pe_dbi202`, `k 1 fptu` $\rightarrow$ `Ky_1_fptu`, `dich truyen` $\rightarrow$ `Dich_Truyen`).
|
|
475
|
+
- **Non-Code Routing**: `dich truyen` $\rightarrow$ `02_Learning_Knowledge/Personal_Books/dich truyen`, `lenovo` $\rightarrow$ `05_Dev_Toolbox/OEM_Drivers/LENOVO`, `sql2022` $\rightarrow$ `05_Dev_Toolbox/Installers/SQL2022`.
|
|
476
|
+
- **AutoZoner Self-Defense & System Reference Guard (`protected_by_system`)**: Anchors `_CURRENT_FILE` through `_SMART_DRIVE_REPO_DIR` and ancestors so `smart-drive-os` never moves itself; pre-filters Windows folders (`WindowsApps`, `Program Files`, `Program Files (x86)`, `$Recycle.Bin`, `System Volume Information`, `WpSystem`, `DeliveryOptimization`, `WUDownloadCache`, `DumpStack.log.tmp`), folders referenced by Windows `PATH`, Services, Installed Apps (`Uninstall` registry), Startup (`Run`), `.lnk` shortcuts, folders with `unins000.exe`/`uninstall.exe`, game libraries (`SteamLibrary`, `Riot Games`, `Epic Games`, `XboxGames`, `GOG Galaxy`, `Battle.net`, `Ubisoft Game Launcher`, `EA Games`, `HoYoPlay`, `Genshin Impact`, `LDPlayer`, `fo4`, `32837`, `Downloads`), and active SQL Server (`MSSQL16.MSSQLSERVER`, `MSSQLSERVER`, `MSSQL`).
|
|
477
|
+
|
|
478
|
+
</details>
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## Launchers
|
|
483
|
+
|
|
484
|
+
All 24 portable launchers reside in both the repo root and `launchers/` (zero Git required):
|
|
485
|
+
|
|
486
|
+
| Workflow | Windows CMD | PowerShell | macOS App | Linux/POSIX | Purpose |
|
|
487
|
+
|---|---|---|---|---|---|
|
|
488
|
+
| **Drive Setup** | `Setup_SSD.bat` | `Setup_SSD.ps1` | `Setup_SSD.command` | `Setup_SSD.sh` | Interactive 1-touch initialization & profile selector |
|
|
489
|
+
| **Quick Search** | `Quick_Search.bat` | `Quick_Search.ps1` | `Quick_Search.command` | `Quick_Search.sh` | Instant interactive SQLite FTS5 search prompt |
|
|
490
|
+
| **Quick Clean** | `Quick_Clean.bat` | `Quick_Clean.ps1` | `Quick_Clean.command` | `Quick_Clean.sh` | Dry-run junk preview followed by confirmed Tier 1 deletion |
|
|
491
|
+
| **Quick Audit** | `Quick_Audit.bat` | `Quick_Audit.ps1` | `Quick_Audit.command` | `Quick_Audit.sh` | Instant storage breakdown and cluster slack audit |
|
|
492
|
+
| **Safe Guided Organizer** | `Smart_Organize.bat` | `Smart_Organize.ps1` | `Smart_Organize.command` | `Smart_Organize.sh` | Step-by-step dry-run preview, busy-app wait, `YES` confirmation, post-move verification, and 1-key `U` undo (EN/VI) |
|
|
493
|
+
| **Interactive Menu** | `SmartDrive.bat` | `SmartDrive.ps1` | `SmartDrive.command` | `SmartDrive.sh` | Full interactive TUI menu (including `[8]` Relink Agents after hand moves, `[9]` Checkup, `[10]` Safe Guided Organizer, `[11]` Relink to the latest move) |
|
|
494
|
+
|
|
495
|
+
`smart-drive self-path-check` checks the running Python environment (venv, pyenv, user scripts) and prints the PowerShell `SetEnvironmentVariable`, `~/.bashrc`/`~/.zshrc` export, or `pyenv rehash` command if `smart-drive` is not on `PATH`.
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
## Profiles
|
|
500
|
+
|
|
501
|
+
| Profile | Target Architecture | Included Taxonomies & Subdirectories |
|
|
502
|
+
|---|---|---|
|
|
503
|
+
| **`workstation-hybrid`** *(Recommended)* | Your secondary drive (`D:`, `E:`, …) with games, apps, coursework | `01_AI_Models`, `02_Learning_Knowledge` (`FPTU/`, `Personal_Books/`, `Notes/`), `03_Development_Projects` (`active/`, `archive/`), `04_System_Workspaces`, `05_Dev_Toolbox` (`OEM_Drivers/`, `Installers/`, `scripts/`), `06_Archives_Storage` |
|
|
504
|
+
| **`internal-developer-vault`** | Internal NVMe/SATA SSD (`D:`, `E:`, …) for offloaded `C:` caches | `01_AI_Models`, `02_Development_Workspaces`, `03_Data_Vault`, `04_System_Offload_Caches` (`huggingface/`, `ollama/`, `pip/`, `uv/`), `05_Dev_Toolbox`, `06_Archives_Storage` |
|
|
505
|
+
| **`ai-developer`** | External SSD for LLMs, fine-tuning, AI agents | `01_AI_Models` (`checkpoints/`, `gguf/`, `safetensors/`, `datasets/`), `02_Learning_Knowledge`, `03_Development_Projects` (`ai_agents/`), `04_System_Workspaces`, `05_Dev_Toolbox`, `06_Archives_Storage` |
|
|
506
|
+
| **`data-science`** | Data engineering, pipelines, EDA notebooks | `01_AI_Models`, `02_Learning_Knowledge`, `03_Development_Projects` (`notebooks/`, `data_raw/`, `pipelines/`), `04_System_Workspaces`, `05_Dev_Toolbox`, `06_Archives_Storage` |
|
|
507
|
+
| **`general-workspace`** *(Default)* | Universal code, docs, notes, utilities | Standard 6 taxonomies with `Notes/`, `References/`, `active/`, `archive/`, `scripts/` |
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
## Testing
|
|
512
|
+
|
|
513
|
+
1,150+ automated tests run in CI on Windows, macOS and Linux with Python 3.9 and 3.13 using `unittest`:
|
|
514
|
+
|
|
515
|
+
```bash
|
|
516
|
+
python -m unittest discover tests -v
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
Coverage spans gitignore governance (ownership, intentional build outputs, negations, keep lists, `gh` visibility, secret variable names, CRLF preservation, staged-change guard), atomic learning units, system reference protection (`protected_by_system`), agent/IDE/Obsidian/shortcut relinking (`storage.json`, `state.vscdb`, `recentProjects.xml`, `.lnk`, MSIX Claude desktop, `--find`, `--wait`), `undo`, `checkup`, `paths --broken`, `clean` quarantine/restore, HTML treemap audit, `Smart_Organize` (`SD_SELFTEST=1`), cluster geometry (512 B–32 MB), self-defense, and `AcademicClassifier`.
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
|
|
523
|
+
## Privacy, Security & Data Isolation
|
|
524
|
+
|
|
525
|
+
SmartDrive-OS is engineered with a **local-first, zero-trust** architecture:
|
|
526
|
+
- **100% Local-Only Operations**: All scanning, SQLite FTS5 indexing, and SHA-256 snapshotting run exclusively on local storage.
|
|
527
|
+
- **Zero Telemetry & Zero PII Logging**: No analytics, network beacons, or harvesting of file contents/secrets; only basic metadata is stored in `.smart_drive/index.db`.
|
|
528
|
+
- **Air-Gap Ready & Defensive Safeguards**: Zero external pip dependencies (`dependencies = []`), local `stdio` MCP transport, offline `setup --no-clone`, mandatory dry-run cleanup defaults, and an inviolable whitelist (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `README.md`, `PRIVACY.md`).
|
|
529
|
+
|
|
530
|
+
For full details and compliance specifications, read [PRIVACY.md](PRIVACY.md).
|
|
531
|
+
|
|
532
|
+
---
|
|
533
|
+
|
|
534
|
+
## Contributing & License
|
|
535
|
+
|
|
536
|
+
- 🌟 **Star & Fork** on GitHub: [DuongNAD/smart-drive-os](https://github.com/DuongNAD/smart-drive-os) · 🐛 [GitHub Issues](https://github.com/DuongNAD/smart-drive-os/issues) · 🔀 [Pull Requests](https://github.com/DuongNAD/smart-drive-os/pulls) · 📖 [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
537
|
+
- 📄 Licensed under the **MIT License** — see [LICENSE](LICENSE).
|