gabriel / muse public
feat patch ls-files task/ls-files-supercharge #1 / 1
AI Agent gabriel · 60 days ago · Apr 17, 2026 · Diff

feat(ls-files): supercharge JSON envelope, typed schema, consistent errors

Envelope additions (always present, no dict.get guards needed): - status: 'ok' on success, 'error' on failure - error: '' on success, message on failure - branch: branch HEAD resolved to (null when --commit given explicitly) - path_prefix: echoes the active filter (null when no --path-prefix) - duration_ms: float wall-clock timing - exit_code: 0 on success

TypedDicts: - Add _LsFilesJson (10 fields) and _LsFilesErrorJson (3 fields)

Error payloads: - _emit_error() centralises emission; suppresses prose in --json mode - All error paths emit {status, error, exit_code} — no bare {'error': '...'} dicts - No ❌ emoji leaking to stdout in --json mode

Test fixes (17 pre-existing failures): - _oid() now returns 'sha256:' prefixed IDs to match write_object() requirement - object_id length assertions updated: startswith('sha256:') + 64-hex suffix - snapshot_id assertion: startswith('sha256:') instead of len == 64 - --commit nonexistent test: use canonical sha256:fff...fff form - text OID assertion: startswith('sha256:') instead of len == 64 - test_ansi_in_path_preserved_in_json: fix always-True tautology in assertion

New tests (29 in test_ls_files_supercharge.py): - Envelope schema, error shape, branch field, path_prefix echo, TypedDicts, docstring, data integrity, no prose pollution

sha256:761347ed8917eb6e319c62db6482e402c7bdc2ee47756870d19b79e5c35f7a0d sha
sha256:695494c847b201773661e97dd35e91f606c95f41dcff9120e5f39ec8d7fb4745 snapshot
← Older Oldest on task/ls-files-supercharge
All commits
Newer → Latest on task/ls-files-supercharge

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:761347ed8917eb6e319c62db6482e402c7bdc2ee47756870d19b79e5c35f7a0d --body "your comment"