From 7d99d49ffbb8eba68e4dce7805be01ba2848439d Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sat, 26 Sep 2026 15:17:37 +0200 Subject: [PATCH] Quote the projects key in the wrong-shape message and record the one-message decline --- AGENTS.md | 1 + bin/loop-claude | 2 +- bin/test_loop_claude.py | 2 +- docs/decisions.md | 4 ++++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ee700c08..b8bf121e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,6 +7,7 @@ Decisions live in `docs/decisions.md`: - loop-claude: one session per project, at a fixed id - loop-claude: the trust file is rewritten before an interrupt - loop-claude: a reload into an older file is unsupported +- loop-claude: a wrong-shape trust file gets one message, naming the shape - bin/: host python, no container - comprehension floor: the 2026-09-25 four-seat score is the ratchet, and 0.1.0 waits on what caps it - larv-review: a re-entered loop takes a fresh round cap diff --git a/bin/loop-claude b/bin/loop-claude index 3dd9f796..988cb0f1 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -417,7 +417,7 @@ def trust(paths): return projects = data.setdefault("projects", {}) if isinstance(data, dict) else None if not isinstance(projects, dict) or not all(isinstance(record, dict) for record in projects.values()): - print(f"could not read {config}: not an object whose projects maps paths to objects", file=sys.stderr) + 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: diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index 783b5357..a8f78c20 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -227,7 +227,7 @@ class Trust(unittest.TestCase): config.write_text(json.dumps(shape)) with contextlib.redirect_stderr(io.StringIO()) as err: loop.trust(["/a"]) - self.assertEqual(err.getvalue(), f"could not read {config}: not an object whose projects maps paths to objects\n") + self.assertEqual(err.getvalue(), f"could not read {config}: not an object whose \"projects\" maps paths to objects\n") self.assertEqual(json.loads(config.read_text()), shape) data = {"other": 1, "projects": {"/a": {"hasTrustDialogAccepted": True, "kept": 2}}} config.write_text(json.dumps(data)) diff --git a/docs/decisions.md b/docs/decisions.md index 9764e8a5..4a4beb26 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -16,6 +16,10 @@ 2026-09-21, lilleman; the lost-write risk accepted 2026-09-24 by larv-review. Serves goal 4. A write by another claude inside `trust`'s read-modify-write window is lost. Valid while no flag skips the dialog. +## loop-claude: a wrong-shape trust file gets one message, naming the shape + +2026-09-26, larv-review, declining a product-owner nit. Serves goal 4 through the comprehension floor below. `trust` says `not an object whose "projects" maps paths to objects` for every wrong shape; naming the failing path would add a branch to `trust`, the unit three of four seats least want to modify, and the interrupt still lands in Claude Code's own dialog. Valid while `trust` caps the floor. + ## bin/: host python, no container 2026-09-24, larv-review. Serves goals 1 and 4. The tools drive the host's claude CLI and read the host's session files, which a container cannot see; the tests run the same way. Valid while claude runs on the host.