CHAT_OUTPUT_BEGIN
COMMAND_ID=CLUSTER-REFERENCE-RUNNER-COMPONENT-AUDIT-190
STATUS=OK
RC=0
HOST=pve01
MODE=read-only
COMPONENT=cluster-audit
REFERENCE_REGISTER_CHECK=OK
REFERENCE_SHA256=5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e
ERROR_REGISTER_CHECK=OK
ERROR_REGISTER_SHA256=08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752
COMMAND_SHA256=2c58a67f72680af3ac4b0b98fdc27f29c9fc2595425de099c209563f3d68fcce
DUPLICATE_FAILED_COMMAND_BLOCKED=false
EXECUTION_STARTED=true
CHANGES_MADE=false
SANITIZED=yes
SECRETS_INCLUDED=no
PRIVATE_ADDRESSES_INCLUDED=no
RAW_EVIDENCE_SHA256=50c5288fafe435b80b8e9de4846b79a183a0c833a6bf62f029861c02cbf5e713
SANITIZED_OUTPUT_SHA256=50c5288fafe435b80b8e9de4846b79a183a0c833a6bf62f029861c02cbf5e713
OUTPUT_BEGIN
validation=PASS
AUTHORITATIVE_PREVIOUS=CLUSTER-REFERENCE-PUBLISHER-GIT-HISTORY-RECOVERY-182:OK
PREVIOUS_REJECTION=INVALID_COMPONENT
PREVIOUS_PAYLOAD_EXECUTED=NO
MODE_CONFIRMED=change
=== COMPONENT_VALIDATION_SOURCE ===
#!/usr/bin/env bash
set -Eeuo pipefail
umask 077

usage() {
    cat >&2 <<'USAGE'
Usage:
  homelab-chat-run COMMAND_ID MODE COMPONENT -- command [arguments...]

MODE:
  read-only
  verify
  change
  transport-test

Environment:
  HOMELAB_ALLOW_REPEAT=1   Allow exact repeat of a previously failed command.
  HOMELAB_TIMEOUT=SECONDS  Optional command timeout.
USAGE
    exit 64
}

[ "$#" -ge 5 ] || usage

COMMAND_ID="$1"
MODE="$2"
COMPONENT="$3"
shift 3

[ "${1:-}" = '--' ] || usage
shift
[ "$#" -ge 1 ] || usage

case "$COMMAND_ID" in
    ''|*[!A-Za-z0-9._-]*)
        echo 'RESULT=FAIL'
        echo 'REASON=INVALID_COMMAND_ID'
        exit 65
        ;;
esac

case "$COMPONENT" in
    ''|*[!A-Za-z0-9._-]*)
        echo 'RESULT=FAIL'
        echo 'REASON=INVALID_COMPONENT'
        exit 66
        ;;
esac

case "$MODE" in
    read-only|verify|change|transport-test)
        ;;
    *)
        echo 'RESULT=FAIL'
        echo 'REASON=INVALID_MODE'
        exit 67
        ;;
esac

for TOOL in \
    awk \
    curl \
    flock \
    python3 \
    scp \
=== USAGE_SOURCE ===
7:Usage:
REFERENCE_CHECK=OK
ERROR_REGISTER_CHECK=OK
SECRET_PRINTED=NO
PRIVATE_ADDRESS_PRINTED=NO
RUNNER_COMPONENT_AUDIT=COMPLETE

OUTPUT_END
CHAT_OUTPUT_END
