devclean-cli 0.5.0

Audit and safely remove rebuildable development artifacts
Documentation
<!doctype html>
<html lang="vi">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Completion — devclean xử lý đánh giá codebase và Tier 1</title>
    <link rel="stylesheet" href="/assets/report.css">
    <link rel="stylesheet" href="../../.claude/skills/html-report/assets/report.css">
</head>
<body>
    <header>
        <div class="head-inner">
            <span class="eyebrow">Feature completion · local working tree</span>
            <h1>devclean — <em>Tier 1 + debt trọng yếu đã xử lý</em></h1>
            <p class="subtitle">Dry-run/undo, Python, watcher, multi-language build output, deterministic scanner,
                Git cache, UUID quarantine và refactor entrypoint/measurement.</p>
            <div class="meta">
                <span>📅 2026-07-12 22:12 +07</span>
                <span>📁 <code>/Users/justin/Dev/VibeLab/devclean</code></span>
                <span>🎯 v0.4.1 + Unreleased working tree</span>
                <span><span class="badge ok">Rust + Swift tests green</span></span>
            </div>
        </div>
    </header>

    <main>
        <section class="panel ok">
            <h2>Kết quả</h2>
            <p class="lead"><b>Đã đóng toàn bộ phạm vi hành động hợp lý cho nhánh v0.5.x trong bản đánh giá:</b>
                Tier 1, Python/multi-language scanner, các debt nhỏ có proof và refactor entrypoint/measurement.
                AI Insights cùng cải tiến macOS hiện hữu được giữ nguyên và kiểm chứng chung.</p>
            <div class="cards">
                <div class="card ok"><span class="num">67</span><span class="label">Rust tests pass</span></div>
                <div class="card ok"><span class="num">33</span><span class="label">Swift tests pass</span></div>
                <div class="card info"><span class="num">5</span><span class="label">dòng main.rs</span></div>
                <div class="card info"><span class="num">0</span><span class="label">cleanup commands run</span></div>
            </div>
            <div class="callout warn">
                <span><strong>Release boundary:</strong> toàn bộ kết quả vẫn ở local working tree; chưa commit, chưa push,
                    chưa publish package, chưa notarize hay release.</span>
            </div>
        </section>

        <section class="panel">
            <h2>Mục lục</h2>
            <div class="toc">
                <a href="#matrix">1 — Resolution matrix</a>
                <a href="#safety">2 — Safety contract</a>
                <a href="#architecture">3 — Architecture &amp; debt</a>
                <a href="#proof">4 — Verification</a>
                <a href="#decisions">5 — Product decisions</a>
            </div>
        </section>

        <section id="matrix" class="panel ok">
            <h2><span class="num">1</span>Resolution matrix</h2>
            <table class="zebra">
                <thead><tr><th>Hạng mục</th><th>Thay đổi</th><th>Proof</th><th>Trạng thái</th></tr></thead>
                <tbody>
                    <tr><td>Clean dry-run</td><td><code>clean --dry-run</code> render plan/report rồi exit trước mọi mutation</td><td>CLI fixture còn nguyên</td><td><span class="badge ok">Closed</span></td></tr>
                    <tr><td>Undo UX</td><td><code>clean --undo &lt;ID&gt;</code> restore đúng safety hold</td><td>Round-trip CLI</td><td><span class="badge ok">Closed</span></td></tr>
                    <tr><td>Python</td><td><code>__pycache__</code>, <code>.tox</code>, <code>.nox</code>, <code>.venv</code>/<code>venv</code></td><td>Positive + negative marker tests</td><td><span class="badge ok">Closed</span></td></tr>
                    <tr><td>Watcher</td><td><code>devclean watch</code>, notify events, threshold/interval config, desktop alert</td><td><code>--once --no-notify</code></td><td><span class="badge ok">Closed</span></td></tr>
                    <tr><td>More languages</td><td>Gradle/Kotlin, CMake, Zig; custom absolute <code>GOMODCACHE</code></td><td>Classifier tests</td><td><span class="badge ok">Closed</span></td></tr>
                    <tr><td>Docker testability</td><td>Injectable runner + JSON-lines disk-usage parser</td><td>Success/failure parser tests</td><td><span class="badge ok">Closed</span></td></tr>
                    <tr><td>AI Insights</td><td>Apple on-device + DeepSeek review-only boundary đã có trong worktree</td><td>Swift contract tests</td><td><span class="badge ok">Verified</span></td></tr>
                </tbody>
            </table>
        </section>

        <section id="safety" class="panel info">
            <h2><span class="num">2</span>Safety contract</h2>
            <ol class="steps">
                <li><span class="step-num">1</span><div><strong>Dry-run không có authority</strong><p>Không confirm, không gọi Docker, không quarantine và không delete.</p></div></li>
                <li><span class="step-num">2</span><div><strong>Python env cần evidence trực tiếp</strong><p><code>.venv</code>/<code>venv</code> chỉ hợp lệ khi nằm cạnh manifest Python; cleaner reclassify ngay trước xóa.</p></div></li>
                <li><span class="step-num">3</span><div><strong>Watch chỉ quan sát</strong><p>Threshold crossing chỉ in/notify và yêu cầu review bằng <code>scan</code>; không tự clean.</p></div></li>
                <li><span class="step-num">4</span><div><strong>Git và symlink guards giữ nguyên</strong><p>Git root được cache nhưng <code>git ls-files</code> vẫn chạy cho từng candidate; containment, type và rule vẫn revalidate.</p></div></li>
            </ol>
            <div class="callout ok"><span><strong>Destructive proof:</strong> test dùng thư mục tạm; trong workspace thật không chạy <code>devclean clean</code>, purge hoặc lệnh xóa artifact.</span></div>
        </section>

        <section id="architecture" class="panel">
            <h2><span class="num">3</span>Architecture &amp; debt</h2>
            <table class="kv">
                <tr><th>CLI entrypoint</th><td><code>src/main.rs</code> từ 850 dòng xuống 5 dòng; orchestration chuyển vào <code>src/cli/</code>, watcher đứng module riêng.</td></tr>
                <tr><th>Scanner measurement</th><td>Tách sang <code>src/scanner/measurement.rs</code>; Rayon indexed parallel iterator giữ thứ tự deterministic.</td></tr>
                <tr><th>Category totals</th><td><code>BTreeMap</code> thay <code>HashMap</code>, HTML cards ổn định.</td></tr>
                <tr><th>Git guard</th><td>Cache repository root theo ancestor, bỏ lặp <code>git rev-parse</code>.</td></tr>
                <tr><th>Quarantine IDs</th><td>UUID v4 thay PID + timestamp + sequence.</td></tr>
                <tr><th>macOS views</th><td><code>SettingsView.swift</code>, formatting, Finder actions và notifications đã được tách; trạng thái tích hợp được clean-test.</td></tr>
            </table>
        </section>

        <section id="proof" class="panel ok">
            <h2><span class="num">4</span>Verification</h2>
            <table class="zebra">
                <thead><tr><th>Gate</th><th>Kết quả</th><th>Phạm vi</th></tr></thead>
                <tbody>
                    <tr><td>Rust fmt</td><td><span class="badge ok">Pass</span></td><td>All crate sources</td></tr>
                    <tr><td>Rust clippy</td><td><span class="badge ok">Pass</span></td><td>All targets/features, warnings denied</td></tr>
                    <tr><td>Rust tests</td><td><span class="badge ok">67/67</span></td><td>46 library + 5 binary + 16 CLI</td></tr>
                    <tr><td>Swift format</td><td><span class="badge ok">Pass</span></td><td>Strict recursive lint</td></tr>
                    <tr><td>Swift tests</td><td><span class="badge ok">33/33</span></td><td>Clean SwiftPM build</td></tr>
                    <tr><td>Diff hygiene</td><td><span class="badge ok">Pass</span></td><td><code>git diff --check</code></td></tr>
                    <tr><td>macOS bundle</td><td><span class="badge ok">Pass</span></td><td>Production build, helper executable, deep/strict codesign valid</td></tr>
                </tbody>
            </table>
        </section>

        <section id="decisions" class="panel info">
            <h2><span class="num">5</span>Product decisions từ Open Questions</h2>
            <table class="kv">
                <tr><th>Ưu tiên</th><td>Ship cả ba Tier 1; dry-run/Python trước, watcher sau.</td></tr>
                <tr><th>Refactor hay feature</th><td>Refactor entrypoint/measurement trước và đi kèm test; tránh big-bang rewrite scanner/UI.</td></tr>
                <tr><th>Audience</th><td>Individual developer first; project config hiện hữu vẫn dùng được cho team.</td></tr>
                <tr><th>Platform</th><td>macOS-first ở UI/notification; Rust scanner/watch giữ abstraction cross-platform.</td></tr>
                <tr><th>AI Insights</th><td>Giữ trong Unreleased v0.5 scope với authority review-only, path-redacted facts và Keychain credentials.</td></tr>
            </table>
            <div class="callout warn">
                <span><strong>Không đánh tráo roadmap thành “đã ship”:</strong> full-screen TUI, OS scheduler manager,
                    SQLite stats dashboard, remote team config và VS Code extension là các sản phẩm độc lập của Tier 2/3.
                    Chúng được giữ làm backlog sau khi v0.5 ổn định, không nhồi vào cùng change set an toàn này.</span>
            </div>
        </section>
    </main>

    <footer>
        <div class="foot-inner">
            <span class="foot-brand"><span class="dot"></span>devclean completion</span>
            <span>Generated 2026-07-12 22:12 +07</span><span>·</span>
            <span><code>local working tree</code></span><span>·</span>
            <span>No commit · no push · no release · no cleanup run</span>
        </div>
    </footer>
</body>
</html>