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
0 comments
muse hub commit comment sha256:761347ed8917eb6e319c62db6482e402c7bdc2ee47756870d19b79e5c35f7a0d --body "your comment"
No comments yet. Be the first to start the discussion.