From 5020c031a34879ef43d8eee362fd5c7531f43cdb Mon Sep 17 00:00:00 2001 From: thepra Date: Sun, 18 Oct 2026 10:30:28 +0200 Subject: [PATCH] instance.sh: the staff's log may hold acts that name nobody Since R6 an act on one of the acting login's own personas is logged without its name, and every persona of the pasture is the root's, so the scenario's log check takes an entry with no name too. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof --- tools/pasture/scenarios/instance.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/pasture/scenarios/instance.sh b/tools/pasture/scenarios/instance.sh index 0540f35..65cb883 100644 --- a/tools/pasture/scenarios/instance.sh +++ b/tools/pasture/scenarios/instance.sh @@ -207,9 +207,10 @@ missing=$(echo "$log" | j " seen={i['action'] for i in d['items']} print(' '.join(sorted({'root.promote','settings.update','rule.insert','rule.update','rule.delete','domain_block.insert','domain_block.delete','report.resolve','announcement.insert','announcement.update','announcement.delete','settings.thumbnail','relay.insert','relay.delete'} - seen)))") [ -z "$missing" ] && [ -n "$log" ] && ok "it lists every act of the scenario" || ko "the log misses: $missing" -[ "$(echo "$log" | j "print(all(i.get('by') in ('$ROOT_USER', 'cli') for i in d['items']))")" = True ] \ +# an act on one of the acting login's own personas names nobody (R6), and the pasture's personas are all the root's +[ "$(echo "$log" | j "print(all(i.get('by') in ('$ROOT_USER', 'cli', None) for i in d['items']))")" = True ] \ && [ "$(echo "$log" | j "print(any(i['action'] == 'root.promote' and i.get('by') == 'cli' for i in d['items']))")" = True ] \ - && ok "each by the administrator's login, or the command line's" || ko "the log names someone else" + && ok "each by the administrator's login, the command line's, or nobody's" || ko "the log names someone else: $(echo "$log" | j "print(sorted({str(i.get('by')) for i in d['items']}))")" echo "$log" | grep -qE '127\.0\.0\.1|11\.42\.|::1' && ko "the log holds an address" || ok "and holds no address" page=$(api "$ADMIN" GET "/clientapi/moderator/log?limit=2") next=$(echo "$page" | j "print(d['next'])")