Quote the projects key in the wrong-shape message and record the one-message decline
This commit was merged in pull request #66.
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
@@ -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:
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user