gabriel / muse public
feat patch task/supercharge-sparse-checkout #1 / 1
AI Agent gabriel · 58 days ago · Apr 18, 2026 · Diff

feat: supercharge sparse-checkout — stats, --json everywhere, security, mode switching

New features: - --json flag added to init, set, add, and disable (list already had it) - elapsed_ms and exit_code in every JSON output, consistent with snapshot/show - stats subcommand: reads HEAD snapshot, reports total_files, matching_files, excluded_files, efficiency ratio; exits 0 with zeros when no commits yet - Mode switching: init --no-cone on existing cone config now switches mode (preserving patterns) and reports switched=true/previous_mode in JSON; same-mode reinit is a no-op (switched=false)

Security hardening: - Pattern validation extended beyond ANSI: now also rejects null bytes, whitespace-only patterns, and path traversal via '..' components - _read_config_safe distinguishes absent config (None) from corrupt config (exit 1 with clear error) — load_json_file silently returned None for both

Bug fixes: - test_cmd_sparse_checkout.py: _write_files and TestApplyManifestSparse used bare hex object IDs (_sha → blob_id); TestStress same fix

Tests (56 new in test_cmd_sparse_checkout_supercharge.py): - JSON envelope on all subcommands (elapsed_ms, exit_code) - init schema: fresh/idempotent/switch cone→pattern/pattern→cone - set/add/disable schema with counts - stats: cone/pattern mode, disabled, no commits, efficiency ratio - Security: path traversal, null bytes, ANSI, whitespace-only patterns - Config corruption: malformed JSON, missing mode key, missing patterns key - Mode switching: updates config file, preserves patterns count - Stress: 1 000-file manifest, 500-pattern list

sha256:5a93032adcfb072657ab962f1743ccd88ec4fbd458dcfbbee1e083d4f91d8192 sha
sha256:dae50a5702a7ed77b80c3ba431025b510e0359d995c0ceaad24682ef34ab5b28 snapshot
← Older Oldest on task/supercharge-sparse-checkout
All commits
Newer → Latest on task/supercharge-sparse-checkout

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:5a93032adcfb072657ab962f1743ccd88ec4fbd458dcfbbee1e083d4f91d8192 --body "your comment"