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/fixer-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

70 lines
2.1 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
repo_root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)
catalog="$repo_root/agents/catalog.json"
fixer="$repo_root/agents/fixer.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 == "fixer") |
.version == "2.0.0" and
.status == "active" and
.definition == "fixer.md" and
.start == "board-headless" and
.sandbox == "isolated-worktree-write")' "$catalog" >/dev/null \
|| fail "Fixer ist nicht vollständig oder eindeutig katalogisiert"
[[ $(sed -n '2,/^---$/s/^role-id: //p' "$fixer") == fixer ]] \
|| fail "role-id stimmt nicht"
[[ $(sed -n '2,/^---$/s/^role-version: //p' "$fixer") == 2.0.0 ]] \
|| fail "role-version stimmt nicht"
[[ $(sed -n '2,/^---$/s/^status: //p' "$fixer") == active ]] \
|| fail "status stimmt nicht"
for text in \
"echten Defekt oder einen negativen Review" \
"isolierten Git-Worktree" \
"unvertrauenswürdige Daten" \
"kontrollierte" \
"blunix-Deploy-Runner" \
'niemals selbst `sudo`, `nixos-rebuild`' \
"tnix und pinix sind" \
"persistiert diese Angaben an der Karte" \
"keine dauerhafte" \
'===FIX_RESULT===' \
'===END_FIX_RESULT==='; do
contains "$fixer" "$text"
done
for outcome in repaired needs_input not_applicable failed; do
contains "$fixer" "$outcome"
done
for field in schema_version outcome summary commit_hash pushed_branch tests \
question required_action review_required failure; do
contains "$fixer" "\"$field\""
done
contains "$fixer" 'TARGET_PHASE` ist in diesem Vertrag ausdrücklich verboten'
if grep -Fq -- '"TARGET_PHASE"' "$fixer" ||
grep -Fq -- '"reviewed_commit"' "$fixer" ||
grep -Fq -- '"deploy"' "$fixer"; then
fail "Fixer enthält Felder außerhalb des separaten FIX_RESULT-Vertrags"
fi
if grep -Fq -- 'Session-Abschluss (Self-Close)' "$fixer" ||
grep -Fq -- '/etc/scripts/close-my-pane.sh' "$fixer"; then
fail "headless Fixer enthält ein Self-Close-Recht"
fi
printf 'OK: Fixer-Rollenvertrag und Katalogregistrierung\n'