This repository has been archived on 2026-09-17. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
nixos-config/agents/tests/inspector-role.sh
pijukka 490d394d72 board: split fixer into read-only inspector + repair-only fixer
Replaces the combined headless fixer role with two separate specialists
sharing the board's klaerung_reparatur column: a fixed, read-only Inspector
(implementation_status/route_next) that returns validated INSPECTION_RESULT
or ROUTING_RESULT JSON blocks, and a write-capable Fixer narrowed to real
repairs only, whose FIX_RESULT now uses repaired/needs_input/not_applicable/
failed instead of the old fixed/no_change_needed vocabulary. Deployment
status is never taken from the model's own claims; the wrapper's trusted
evidence always wins and any discrepancy is recorded separately. Routing
recommendations stay pending until an explicit UI apply.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7UVrKsttMP9a6FiGFna9b
2026-09-10 11:53:17 +02:00

60 lines
2.2 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
repo_root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)
catalog="$repo_root/agents/catalog.json"
inspector="$repo_root/agents/inspector.md"
fail() {
printf 'FAIL: %s\n' "$1" >&2
exit 1
}
contains() {
grep -Fq -- "$2" "$1" || fail "$1 enthält nicht: $2"
}
jq -e '.schema_version == 1 and
([.roles[].id] | length == (unique | length)) and
(.roles[] | select(.id == "inspector") |
.version == "1.0.0" and
.status == "active" and
.definition == "inspector.md" and
.start == "board-headless" and
.sandbox == "read-only")' "$catalog" >/dev/null \
|| fail "Inspector ist nicht vollständig oder eindeutig katalogisiert"
[[ $(sed -n '2,/^---$/s/^role-id: //p' "$inspector") == inspector ]] \
|| fail "role-id stimmt nicht"
[[ $(sed -n '2,/^---$/s/^role-version: //p' "$inspector") == 1.0.0 ]] \
|| fail "role-version stimmt nicht"
[[ $(sed -n '2,/^---$/s/^status: //p' "$inspector") == active ]] \
|| fail "status stimmt nicht"
for text in implementation_status route_next \
present partial missing unverifiable deployed not_deployed unknown \
allowed_actions recommended_action \
'===INSPECTION_RESULT===' '===END_INSPECTION_RESULT===' \
'===ROUTING_RESULT===' '===END_ROUTING_RESULT===' \
'persistiert' 'neue atomare Inspector-Session' \
'unvertrauenswürdige Daten' 'ausschließlich Aufgabe des vertrauenswürdigen' \
'tnix und pinix'; do
contains "$inspector" "$text"
done
if grep -Fq -- '"TARGET_PHASE"' "$inspector"; then
fail "Inspector enthält ein universelles TARGET_PHASE-Feld"
fi
if grep -Fq -- 'Session-Abschluss (Self-Close)' "$inspector" ||
grep -Fq -- '/etc/scripts/close-my-pane.sh' "$inspector"; then
fail "headless Inspector enthält ein Self-Close-Recht"
fi
inspection_block=$(sed -n '/^===INSPECTION_RESULT===$/,/^===END_INSPECTION_RESULT===$/p' "$inspector")
routing_block=$(sed -n '/^===ROUTING_RESULT===$/,/^===END_ROUTING_RESULT===$/p' "$inspector")
[[ $inspection_block != *'recommended_action'* ]] \
|| fail "INSPECTION_RESULT enthält Routingfelder"
[[ $routing_block != *'repository_status'* ]] \
|| fail "ROUTING_RESULT enthält Inspektionsfelder"
printf 'OK: Inspector-Rollenvertrag und getrennte Ergebnisverträge\n'