Assert the write failure's line, widen the filed shape, drop the premise stated twice

This commit was merged in pull request #40.
This commit is contained in:
2026-09-25 17:31:46 +02:00
parent 1cd1b03793
commit 2a2fff8fad
3 changed files with 10 additions and 2 deletions
+8
View File
@@ -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):
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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.