From fe1a0f03ca62545fbea67f9ce20b2bab53f93a51 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sat, 26 Sep 2026 15:13:18 +0200 Subject: [PATCH] Say could not read when the trust file is not an object whose projects maps paths to objects --- bin/loop-claude | 5 ++++- todo.md | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/loop-claude b/bin/loop-claude index 56d2a54f..4bdac662 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -415,7 +415,10 @@ def trust(paths): except (OSError, ValueError) as failure: print(f"could not read {config}: {getattr(failure, 'strerror', failure)}", file=sys.stderr) return - projects = data.setdefault("projects", {}) + projects = data.setdefault("projects", {}) if isinstance(data, dict) else None + if not isinstance(projects, dict) or any(not isinstance(entry, dict) for entry in projects.values()): + print(f"could not read {config}: not an object whose projects maps paths to objects", file=sys.stderr) + return granted = [path for path in paths if not projects.get(path, {}).get("hasTrustDialogAccepted")] if not granted: return diff --git a/todo.md b/todo.md index eb3e6ed1..48402339 100644 --- a/todo.md +++ b/todo.md @@ -4,5 +4,4 @@ Ordered by how many seats of the 2026-09-25 scoring panel (`docs/decisions.md`) named the place; each is one chunk. -- Say `could not read` when `~/.claude.json` parses to anything but an object whose `projects` maps paths to objects, today a traceback before the interrupt. - State in `docs/decisions.md` the oldest Python `bin/` must parse on, today unstated and 3.11 by the last review.