From 2a2fff8fade2568229c56e1d2cbc29c8289442c1 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 25 Sep 2026 17:31:46 +0200 Subject: [PATCH] Assert the write failure's line, widen the filed shape, drop the premise stated twice --- bin/test_loop_claude.py | 8 ++++++++ docs/decisions.md | 2 +- todo.md | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index 57a1fe05..ee984536 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -1,4 +1,5 @@ import contextlib +import errno import importlib.machinery import importlib.util import io @@ -222,6 +223,13 @@ class Trust(unittest.TestCase): self.assertEqual(err.getvalue(), "trusted for the interrupt: /b\n") data["projects"]["/b"] = {"hasTrustDialogAccepted": True} self.assertEqual(json.loads(config.read_text()), data) + with ( + contextlib.redirect_stderr(io.StringIO()) as err, + unittest.mock.patch("os.replace", side_effect=OSError(errno.EACCES, "Permission denied")), + ): + loop.trust(["/c"]) + self.assertEqual(err.getvalue(), f"could not write {config}: Permission denied\n") + self.assertEqual(json.loads(config.read_text()), data) class Parse(unittest.TestCase): diff --git a/docs/decisions.md b/docs/decisions.md index 11748e2c..0d107485 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -14,7 +14,7 @@ ## loop-claude: the trust file is rewritten before an interrupt -2026-09-21, lilleman; the lost-write risk accepted 2026-09-24 by larv-review. Serves goal 4. No CLI flag skips the trust dialog. A write by another claude inside `trust`'s read-modify-write window is lost. Valid while no flag skips the dialog. +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. ## bin/: host python, no container diff --git a/todo.md b/todo.md index 680c616a..5b7bb780 100644 --- a/todo.md +++ b/todo.md @@ -22,4 +22,4 @@ Ordered by how many seats of the 2026-09-25 scoring panel (`docs/decisions.md`) - Group `bin/loop-claude` by the Claude Code internals it rests on, in the docstring's order, with `main` and `run_cycle` above what they call, today 36 flat names with the adapter scattered. - Exit `loop-claude` with a message, today a traceback, when `README.md` is not UTF-8. - Say under `CLAUDE.md` → "One spelling per goal" that one spelling in two places is the same case, and what its rejection names. -- Say `could not read` when `~/.claude.json` parses but `projects` is not an object, today a traceback before the interrupt. +- 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.