CHAT_OUTPUT_BEGIN
COMMAND_ID=HOMELAB-DUPLICATE-EXACT-LOGIC-427
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=7e4f72d9877110d6d6d4ef926a611b1bd8ad15fa4b2ad3ef17e9027ba49bc111
DUPLICATE_FAILED_COMMAND_BLOCKED=false
EXECUTION_STARTED=true
CHANGES_MADE=false
SANITIZED=yes
SECRETS_INCLUDED=no
PRIVATE_ADDRESSES_INCLUDED=no
RAW_EVIDENCE_SHA256=8480bb49baedd9fdebe212ee204d07d772e707d3c09045de0c3334fde723f6e9
SANITIZED_OUTPUT_SHA256=5e8f3e2de086ae3c1d1bf84dcffbcb8dc8770ebefb00aa959db1ff15db3468b9
OUTPUT_BEGIN
DETAIL=FILE=/usr/local/sbin/homelab-chat-run-linked
DETAIL=SHA256=5e8725e129fd2055b36fe2fae13fc95fc4b3271074a0e0d4bb7347e7b2f270a1
DETAIL=EXACT_LOGIC_BEGIN
DETAIL=TOTAL_LINES=39
DETAIL=EXACT_LOGIC_END
DETAIL=FILE=/usr/local/sbin/homelab-chat-run
DETAIL=SHA256=2a88defef9517f89bc60934dce82097f8e316b08af9417e95167ea5d759a10d9
DETAIL=EXACT_LOGIC_BEGIN
DETAIL=SOURCE_LINE=0048:esac
DETAIL=SOURCE_LINE=0049:
DETAIL=SOURCE_LINE=0050:case "$MODE" in
DETAIL=SOURCE_LINE=0051:    read-only|verify|change|transport-test)
DETAIL=SOURCE_LINE=0052:        ;;
DETAIL=SOURCE_LINE=0053:    *)
DETAIL=SOURCE_LINE=0054:        echo 'RESULT=FAIL'
DETAIL=SOURCE_LINE=0055:        echo 'REASON=INVALID_MODE'
DETAIL=SOURCE_LINE=0056:        exit 67
DETAIL=SOURCE_LINE=0057:        ;;
DETAIL=SOURCE_LINE=0058:esac
DETAIL=SOURCE_LINE=0059:
DETAIL=SOURCE_LINE=0060:for TOOL in \
DETAIL=SOURCE_LINE=0061:    awk \
DETAIL=SOURCE_LINE=0062:    curl \
DETAIL=SOURCE_LINE=0063:    flock \
DETAIL=SOURCE_LINE=0064:    python3 \
DETAIL=SOURCE_LINE=0065:    scp \
DETAIL=SOURCE_LINE=0066:    sha256sum \
DETAIL=SOURCE_LINE=0067:    ssh
DETAIL=SOURCE_LINE=0068:do
DETAIL=SOURCE_LINE=0069:    command -v "$TOOL" >/dev/null 2>&1 || {
DETAIL=SOURCE_LINE=0070:        echo 'RESULT=FAIL'
DETAIL=SOURCE_LINE=0071:        echo "REASON=REQUIRED_TOOL_MISSING:$TOOL"
DETAIL=SOURCE_LINE=0072:        exit 68
DETAIL=SOURCE_LINE=0073:    }
DETAIL=SOURCE_LINE=0074:done
DETAIL=SOURCE_LINE=0075:
DETAIL=SOURCE_LINE=0076:REFERENCE=/etc/pve/31_HOMELAB_REFERENCE.md
DETAIL=SOURCE_LINE=0077:ERROR_REGISTER=/etc/pve/HOMELAB_ASSISTANT_ERROR_REGISTER.md
DETAIL=SOURCE_LINE=0078:
DETAIL=SOURCE_LINE=0079:[ -r "$REFERENCE" ] || {
DETAIL=SOURCE_LINE=0080:    echo 'RESULT=FAIL'
DETAIL=SOURCE_LINE=0081:    echo 'REASON=REFERENCE_NOT_READABLE'
DETAIL=SOURCE_LINE=0082:    exit 69
DETAIL=SOURCE_LINE=0083:}
DETAIL=SOURCE_LINE=0084:
DETAIL=SOURCE_LINE=0085:[ -r "$ERROR_REGISTER" ] || {
DETAIL=SOURCE_LINE=0086:    echo 'RESULT=FAIL'
DETAIL=SOURCE_LINE=0087:    echo 'REASON=ERROR_REGISTER_NOT_READABLE'
DETAIL=SOURCE_LINE=0088:    exit 70
DETAIL=SOURCE_LINE=0089:}
DETAIL=SOURCE_LINE=0090:
DETAIL=SOURCE_LINE=0091:STATE_DIR=/var/lib/homelab-chat-run
DETAIL=SOURCE_LINE=0092:RAW_DIR="$STATE_DIR/raw"
DETAIL=SOURCE_LINE=0093:PUBLIC_DIR="$STATE_DIR/public"
DETAIL=SOURCE_LINE=0094:LEDGER="$STATE_DIR/state/command-ledger.tsv"
DETAIL=SOURCE_LINE=0095:LOCK="$STATE_DIR/state/runner.lock"
DETAIL=SOURCE_LINE=0096:
DETAIL=SOURCE_LINE=0097:mkdir -p "$RAW_DIR" "$PUBLIC_DIR" "$(dirname "$LEDGER")"
DETAIL=SOURCE_LINE=0098:chmod 0700 "$STATE_DIR" "$RAW_DIR" "$PUBLIC_DIR" "$(dirname "$LEDGER")"
DETAIL=SOURCE_LINE=0099:touch "$LEDGER"
DETAIL=SOURCE_LINE=0100:chmod 0600 "$LEDGER"
DETAIL=SOURCE_LINE=0101:
DETAIL=SOURCE_LINE=0102:exec 9>"$LOCK"
DETAIL=SOURCE_LINE=0103:
DETAIL=SOURCE_LINE=0104:flock -w 60 9 || {
DETAIL=SOURCE_LINE=0105:    echo 'RESULT=FAIL'
DETAIL=SOURCE_LINE=0106:    echo 'REASON=RUNNER_LOCK_TIMEOUT'
DETAIL=SOURCE_LINE=0107:    exit 71
DETAIL=SOURCE_LINE=0108:}
DETAIL=SOURCE_LINE=0109:
DETAIL=SOURCE_LINE=0110:STARTED_AT="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
DETAIL=SOURCE_LINE=0111:STAMP="$(date -u +%Y%m%dT%H%M%SZ)"
DETAIL=SOURCE_LINE=0112:HOST_SHORT="$(hostname -s 2>/dev/null || hostname)"
DETAIL=SOURCE_LINE=0113:
DETAIL=SOURCE_LINE=0114:RAW_FILE="$RAW_DIR/${COMMAND_ID}-${STAMP}.log"
DETAIL=SOURCE_LINE=0115:SANITIZED_FILE="$PUBLIC_DIR/${COMMAND_ID}-${STAMP}.txt"
DETAIL=SOURCE_LINE=0116:JSON_FILE="$PUBLIC_DIR/${COMMAND_ID}-${STAMP}.json"
DETAIL=SOURCE_LINE=0117:TXT_FILE="$PUBLIC_DIR/${COMMAND_ID}-${STAMP}-latest.txt"
DETAIL=SOURCE_LINE=0118:
DETAIL=SOURCE_LINE=0119:REFERENCE_SHA256="$(sha256sum "$REFERENCE" | awk '{print $1}')"
DETAIL=SOURCE_LINE=0120:ERROR_REGISTER_SHA256="$(sha256sum "$ERROR_REGISTER" | awk '{print $1}')"
DETAIL=SOURCE_LINE=0121:
DETAIL=SOURCE_LINE=0122:COMMAND_SHA256="$(
DETAIL=SOURCE_LINE=0123:    {
DETAIL=SOURCE_LINE=0124:        printf '%s\0' "$MODE"
DETAIL=SOURCE_LINE=0125:        printf '%s\0' "$COMPONENT"
DETAIL=SOURCE_LINE=0126:        printf '%s\0' "$@"
DETAIL=SOURCE_LINE=0127:    } |
DETAIL=SOURCE_LINE=0128:    sha256sum |
DETAIL=SOURCE_LINE=0129:    awk '{print $1}'
DETAIL=SOURCE_LINE=0130:)"
DETAIL=SOURCE_LINE=0131:
DETAIL=SOURCE_LINE=0132:PREVIOUS_FAILED_RC="$(
DETAIL=SOURCE_LINE=0133:    awk -F '\t' -v hash="$COMMAND_SHA256" '
DETAIL=SOURCE_LINE=0134:        $3 == hash && $4 != "0" {
DETAIL=SOURCE_LINE=0135:            value=$4
DETAIL=SOURCE_LINE=0136:        }
DETAIL=SOURCE_LINE=0137:
DETAIL=SOURCE_LINE=0138:        END {
DETAIL=SOURCE_LINE=0139:            print value
DETAIL=SOURCE_LINE=0140:        }
DETAIL=SOURCE_LINE=0141:    ' "$LEDGER"
DETAIL=SOURCE_LINE=0142:)"
DETAIL=SOURCE_LINE=0143:
DETAIL=SOURCE_LINE=0144:RUN_STARTED=true
DETAIL=SOURCE_LINE=0145:REPEAT_BLOCKED=false
DETAIL=SOURCE_LINE=0146:BLOCK_REASON=''
DETAIL=SOURCE_LINE=0147:CHANGES_MADE=false
DETAIL=SOURCE_LINE=0148:
DETAIL=SOURCE_LINE=0149:case "$MODE" in
DETAIL=SOURCE_LINE=0150:    change)
DETAIL=SOURCE_LINE=0151:        CHANGES_MADE=true
DETAIL=SOURCE_LINE=0152:        ;;
DETAIL=SOURCE_LINE=0153:esac
DETAIL=SOURCE_LINE=0154:
DETAIL=SOURCE_LINE=0155:if [ -n "$PREVIOUS_FAILED_RC" ] &&
DETAIL=SOURCE_LINE=0156:   [ "${HOMELAB_ALLOW_REPEAT:-0}" != 1 ]; then
DETAIL=SOURCE_LINE=0157:
DETAIL=SOURCE_LINE=0158:    RUN_STARTED=false
DETAIL=SOURCE_LINE=0159:    REPEAT_BLOCKED=true
DETAIL=SOURCE_LINE=0160:    BLOCK_REASON='EXACT_FAILED_COMMAND_REPEAT'
DETAIL=SOURCE_LINE=0161:    RC=73
DETAIL=SOURCE_LINE=0162:    STATUS='BLOCKED'
DETAIL=SOURCE_LINE=0163:
DETAIL=SOURCE_LINE=0164:    {
DETAIL=SOURCE_LINE=0165:        echo 'COMMAND_EXECUTION_BLOCKED=yes'
DETAIL=SOURCE_LINE=0166:        echo 'REASON=EXACT_FAILED_COMMAND_REPEAT'
DETAIL=SOURCE_LINE=0167:        echo "PREVIOUS_RC=$PREVIOUS_FAILED_RC"
DETAIL=SOURCE_LINE=0168:        echo "COMMAND_SHA256=$COMMAND_SHA256"
DETAIL=SOURCE_LINE=0169:        echo
DETAIL=SOURCE_LINE=0170:        echo 'Set HOMELAB_ALLOW_REPEAT=1 only after reviewing the previous failure.'
DETAIL=SOURCE_LINE=0171:    } >"$RAW_FILE"
DETAIL=SOURCE_LINE=0172:else
DETAIL=SOURCE_LINE=0173:    set +e
DETAIL=SOURCE_LINE=0174:
DETAIL=SOURCE_LINE=0175:    if [ -n "${HOMELAB_TIMEOUT:-}" ]; then
DETAIL=SOURCE_LINE=0176:        case "$HOMELAB_TIMEOUT" in
DETAIL=SOURCE_LINE=0177:            *[!0-9]*|'')
DETAIL=SOURCE_LINE=0178:                echo 'RESULT=FAIL'
DETAIL=SOURCE_LINE=0179:                echo 'REASON=INVALID_HOMELAB_TIMEOUT'
DETAIL=SOURCE_LINE=0180:                exit 74
DETAIL=SOURCE_LINE=0181:                ;;
DETAIL=SOURCE_LINE=0182:        esac
DETAIL=SOURCE_LINE=0183:
DETAIL=SOURCE_LINE=0184:        timeout \
DETAIL=SOURCE_LINE=0185:            --foreground \
DETAIL=SOURCE_LINE=0186:            --preserve-status \
DETAIL=SOURCE_LINE=0187:            "$HOMELAB_TIMEOUT" \
DETAIL=SOURCE_LINE=0188:            "$@" >"$RAW_FILE" 2>&1
DETAIL=SOURCE_LINE=0189:        RC=$?
DETAIL=SOURCE_LINE=0190:    else
DETAIL=SOURCE_LINE=0191:        "$@" >"$RAW_FILE" 2>&1
DETAIL=SOURCE_LINE=0192:        RC=$?
DETAIL=SOURCE_LINE=0193:    fi
DETAIL=SOURCE_LINE=0194:
DETAIL=SOURCE_LINE=0195:    set -e
DETAIL=SOURCE_LINE=0196:
DETAIL=SOURCE_LINE=0197:    if [ "$RC" -eq 0 ]; then
DETAIL=SOURCE_LINE=0198:        STATUS='OK'
DETAIL=SOURCE_LINE=0199:    else
DETAIL=SOURCE_LINE=0200:        STATUS='FAIL'
DETAIL=SOURCE_LINE=0201:    fi
DETAIL=SOURCE_LINE=0202:fi
DETAIL=SOURCE_LINE=0203:
DETAIL=SOURCE_LINE=0204:FINISHED_AT="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
DETAIL=SOURCE_LINE=0205:RAW_SHA256="$(sha256sum "$RAW_FILE" | awk '{print $1}')"
DETAIL=SOURCE_LINE=0206:
DETAIL=SOURCE_LINE=0207:python3 - "$RAW_FILE" "$SANITIZED_FILE" <<'PY'
DETAIL=SOURCE_LINE=0208:import re
DETAIL=SOURCE_LINE=0209:import sys
DETAIL=SOURCE_LINE=0210:from pathlib import Path
DETAIL=SOURCE_LINE=0211:
DETAIL=SOURCE_LINE=0212:source = Path(sys.argv[1])
DETAIL=SOURCE_LINE=0213:target = Path(sys.argv[2])
DETAIL=SOURCE_LINE=0214:
DETAIL=SOURCE_LINE=0215:text = source.read_bytes().decode("utf-8", errors="replace")
DETAIL=SOURCE_LINE=0216:
DETAIL=SOURCE_LINE=0217:patterns = [
DETAIL=SOURCE_LINE=0218:    (
DETAIL=SOURCE_LINE=0219:        re.compile(
DETAIL=SOURCE_LINE=0220:            r"-----BEGIN (?:RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----"
DETAIL=SOURCE_LINE=0221:            r".*?"
DETAIL=SOURCE_LINE=0222:            r"-----END (?:RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----",
DETAIL=SOURCE_LINE=0223:            re.IGNORECASE | re.DOTALL,
DETAIL=SOURCE_LINE=0224:        ),
DETAIL=SOURCE_LINE=0225:        "[PRIVATE_KEY_REDACTED]",
DETAIL=SOURCE_LINE=0226:    ),
DETAIL=SOURCE_LINE=0227:    (
DETAIL=SOURCE_LINE=0228:        re.compile(
DETAIL=SOURCE_LINE=0229:            r"(?im)^(\s*(?:password|passwd|passphrase|authorization|"
DETAIL=SOURCE_LINE=...
DETAIL=SOURCE_LINE=0292:maximum = 900_000
DETAIL=SOURCE_LINE=0293:
DETAIL=SOURCE_LINE=0294:if len(encoded) > maximum:
DETAIL=SOURCE_LINE=0295:    first = encoded[:440_000].decode("utf-8", errors="ignore")
DETAIL=SOURCE_LINE=0296:    last = encoded[-440_000:].decode("utf-8", errors="ignore")
DETAIL=SOURCE_LINE=0297:
DETAIL=SOURCE_LINE=0298:    text = (
DETAIL=SOURCE_LINE=0299:        first
DETAIL=SOURCE_LINE=0300:        + "\n\n"
DETAIL=SOURCE_LINE=0301:        + "===== PUBLIC OUTPUT TRUNCATED; FULL RAW LOG RETAINED LOCALLY ====="
DETAIL=SOURCE_LINE=0302:        + "\n\n"
DETAIL=SOURCE_LINE=0303:        + last
DETAIL=SOURCE_LINE=0304:    )
DETAIL=SOURCE_LINE=0305:
DETAIL=SOURCE_LINE=0306:target.write_text(text, encoding="utf-8")
DETAIL=SOURCE_LINE=0307:PY
DETAIL=SOURCE_LINE=0308:
DETAIL=SOURCE_LINE=0309:SANITIZED_SHA256="$(
DETAIL=SOURCE_LINE=0310:    sha256sum "$SANITIZED_FILE" |
DETAIL=SOURCE_LINE=0311:    awk '{print $1}'
DETAIL=SOURCE_LINE=0312:)"
DETAIL=SOURCE_LINE=0313:
DETAIL=SOURCE_LINE=0314:python3 - \
DETAIL=SOURCE_LINE=0315:    "$JSON_FILE" \
DETAIL=SOURCE_LINE=0316:    "$SANITIZED_FILE" \
DETAIL=SOURCE_LINE=0317:    "$COMMAND_ID" \
DETAIL=SOURCE_LINE=0318:    "$STATUS" \
DETAIL=SOURCE_LINE=0319:    "$RC" \
DETAIL=SOURCE_LINE=0320:    "$HOST_SHORT" \
DETAIL=SOURCE_LINE=0321:    "$MODE" \
DETAIL=SOURCE_LINE=0322:    "$COMPONENT" \
DETAIL=SOURCE_LINE=0323:    "$STARTED_AT" \
DETAIL=SOURCE_LINE=0324:    "$FINISHED_AT" \
DETAIL=SOURCE_LINE=0325:    "$REFERENCE_SHA256" \
DETAIL=SOURCE_LINE=0326:    "$ERROR_REGISTER_SHA256" \
DETAIL=SOURCE_LINE=0327:    "$COMMAND_SHA256" \
DETAIL=SOURCE_LINE=0328:    "$RAW_SHA256" \
DETAIL=SOURCE_LINE=0329:    "$SANITIZED_SHA256" \
DETAIL=SOURCE_LINE=0330:    "$RUN_STARTED" \
DETAIL=SOURCE_LINE=0331:    "$REPEAT_BLOCKED" \
DETAIL=SOURCE_LINE=0332:    "$BLOCK_REASON" \
DETAIL=SOURCE_LINE=0333:    "$CHANGES_MADE" <<'PY'
DETAIL=SOURCE_LINE=0334:import json
DETAIL=SOURCE_LINE=0335:import sys
DETAIL=SOURCE_LINE=0336:from pathlib import Path
DETAIL=SOURCE_LINE=0337:
DETAIL=SOURCE_LINE=0338:(
DETAIL=SOURCE_LINE=0339:    json_path,
DETAIL=SOURCE_LINE=0340:    output_path,
DETAIL=SOURCE_LINE=0341:    command_id,
DETAIL=SOURCE_LINE=0342:    status,
DETAIL=SOURCE_LINE=0343:    rc,
DETAIL=SOURCE_LINE=0344:    host,
DETAIL=SOURCE_LINE=0345:    mode,
DETAIL=SOURCE_LINE=0346:    component,
DETAIL=SOURCE_LINE=0347:    started,
DETAIL=SOURCE_LINE=0348:    finished,
DETAIL=SOURCE_LINE=0349:    reference_sha,
DETAIL=SOURCE_LINE=0350:    error_sha,
DETAIL=SOURCE_LINE=0351:    command_sha,
DETAIL=SOURCE_LINE=0352:    raw_sha,
DETAIL=SOURCE_LINE=0353:    sanitized_sha,
DETAIL=SOURCE_LINE=0354:    run_started,
DETAIL=SOURCE_LINE=0355:    repeat_blocked,
DETAIL=SOURCE_LINE=...
DETAIL=SOURCE_LINE=0416:    )
DETAIL=SOURCE_LINE=0417:    + "\n",
DETAIL=SOURCE_LINE=0418:    encoding="utf-8",
DETAIL=SOURCE_LINE=0419:)
DETAIL=SOURCE_LINE=0420:PY
DETAIL=SOURCE_LINE=0421:
DETAIL=SOURCE_LINE=0422:{
DETAIL=SOURCE_LINE=0423:    echo 'CHAT_OUTPUT_BEGIN'
DETAIL=SOURCE_LINE=0424:    echo "COMMAND_ID=$COMMAND_ID"
DETAIL=SOURCE_LINE=0425:    echo "STATUS=$STATUS"
DETAIL=SOURCE_LINE=0426:    echo "RC=$RC"
DETAIL=SOURCE_LINE=0427:    echo "HOST=$HOST_SHORT"
DETAIL=SOURCE_LINE=0428:    echo "MODE=$MODE"
DETAIL=SOURCE_LINE=0429:    echo "COMPONENT=$COMPONENT"
DETAIL=SOURCE_LINE=0430:    echo 'REFERENCE_REGISTER_CHECK=OK'
DETAIL=SOURCE_LINE=0431:    echo "REFERENCE_SHA256=$REFERENCE_SHA256"
DETAIL=SOURCE_LINE=0432:    echo 'ERROR_REGISTER_CHECK=OK'
DETAIL=SOURCE_LINE=0433:    echo "ERROR_REGISTER_SHA256=$ERROR_REGISTER_SHA256"
DETAIL=SOURCE_LINE=0434:    echo "COMMAND_SHA256=$COMMAND_SHA256"
DETAIL=SOURCE_LINE=0435:    echo "DUPLICATE_FAILED_COMMAND_BLOCKED=$REPEAT_BLOCKED"
DETAIL=SOURCE_LINE=0436:    echo "EXECUTION_STARTED=$RUN_STARTED"
DETAIL=SOURCE_LINE=0437:    echo "CHANGES_MADE=$CHANGES_MADE"
DETAIL=SOURCE_LINE=0438:    echo 'SANITIZED=yes'
DETAIL=SOURCE_LINE=0439:    echo 'SECRETS_INCLUDED=no'
DETAIL=SOURCE_LINE=0440:    echo 'PRIVATE_ADDRESSES_INCLUDED=no'
DETAIL=SOURCE_LINE=0441:    echo "RAW_EVIDENCE_SHA256=$RAW_SHA256"
DETAIL=SOURCE_LINE=0442:    echo "SANITIZED_OUTPUT_SHA256=$SANITIZED_SHA256"
DETAIL=SOURCE_LINE=0443:    echo 'OUTPUT_BEGIN'
DETAIL=SOURCE_LINE=0444:    cat "$SANITIZED_FILE"
DETAIL=SOURCE_LINE=0445:    echo
DETAIL=SOURCE_LINE=0446:    echo 'OUTPUT_END'
DETAIL=SOURCE_LINE=0447:    echo 'CHAT_OUTPUT_END'
DETAIL=SOURCE_LINE=0448:} >"$TXT_FILE"
DETAIL=SOURCE_LINE=0449:
DETAIL=SOURCE_LINE=0450:chmod 0600 \
DETAIL=SOURCE_LINE=0451:    "$RAW_FILE" \
DETAIL=SOURCE_LINE=0452:    "$SANITIZED_FILE" \
DETAIL=SOURCE_LINE=0453:    "$JSON_FILE" \
DETAIL=SOURCE_LINE=0454:    "$TXT_FILE"
DETAIL=SOURCE_LINE=0455:
DETAIL=SOURCE_LINE=0456:TARGET=debian@[PRIVATE_IP]
DETAIL=SOURCE_LINE=0457:REMOTE_PREFIX="/tmp/homelab-runtime-${COMMAND_ID}-$$"
DETAIL=SOURCE_LINE=0458:
DETAIL=SOURCE_LINE=0459:SSH_OPTS=(
DETAIL=SOURCE_LINE=...
DETAIL=SOURCE_LINE=0509:        PUBLIC_VISIBLE=true
DETAIL=SOURCE_LINE=0510:        break
DETAIL=SOURCE_LINE=0511:    fi
DETAIL=SOURCE_LINE=0512:
DETAIL=SOURCE_LINE=0513:    sleep 2
DETAIL=SOURCE_LINE=0514:done
DETAIL=SOURCE_LINE=0515:
DETAIL=SOURCE_LINE=0516:if [ "$PUBLIC_VISIBLE" != true ]; then
DETAIL=SOURCE_LINE=0517:    echo 'RESULT=FAIL'
DETAIL=SOURCE_LINE=0518:    echo 'REASON=PUBLIC_RUNTIME_RESULT_NOT_VISIBLE'
DETAIL=SOURCE_LINE=0519:    echo "COMMAND_ID=$COMMAND_ID"
DETAIL=SOURCE_LINE=0520:    echo "LOCAL_RAW_FILE=$RAW_FILE"
DETAIL=SOURCE_LINE=0521:    exit 75
DETAIL=SOURCE_LINE=0522:fi
DETAIL=SOURCE_LINE=0523:
DETAIL=SOURCE_LINE=0524:printf '%s\t%s\t%s\t%s\t%s\t%s\n' \
DETAIL=SOURCE_LINE=0525:    "$FINISHED_AT" \
DETAIL=SOURCE_LINE=0526:    "$COMMAND_ID" \
DETAIL=SOURCE_LINE=0527:    "$COMMAND_SHA256" \
DETAIL=SOURCE_LINE=0528:    "$RC" \
DETAIL=SOURCE_LINE=0529:    "$STATUS" \
DETAIL=SOURCE_LINE=0530:    "$COMPONENT" >>"$LEDGER"
DETAIL=SOURCE_LINE=0531:
DETAIL=SOURCE_LINE=0532:echo
DETAIL=SOURCE_LINE=0533:echo '===== HOMELAB CHAT RUN COMPLETE ====='
DETAIL=SOURCE_LINE=0534:echo "COMMAND_ID=$COMMAND_ID"
DETAIL=SOURCE_LINE=0535:echo "STATUS=$STATUS"
DETAIL=SOURCE_LINE=0536:echo "RC=$RC"
DETAIL=SOURCE_LINE=0537:echo 'REFERENCE_REGISTER_CHECK=OK'
DETAIL=SOURCE_LINE=0538:echo 'ERROR_REGISTER_CHECK=OK'
DETAIL=SOURCE_LINE=0539:echo "DUPLICATE_FAILED_COMMAND_BLOCKED=$REPEAT_BLOCKED"
DETAIL=SOURCE_LINE=0540:echo 'GITEA_PUBLICATION=OK'
DETAIL=SOURCE_LINE=0541:echo "PUBLIC_URL=$PUBLIC_URL"
DETAIL=SOURCE_LINE=0542:echo "LOCAL_RAW_FILE=$RAW_FILE"
DETAIL=SOURCE_LINE=0543:echo 'SHELL_SESSION_PRESERVED=yes'
DETAIL=SOURCE_LINE=0544:
DETAIL=SOURCE_LINE=0545:exit "$RC"
DETAIL=TOTAL_LINES=545
DETAIL=EXACT_LOGIC_END
DETAIL=DUPLICATE_EXACT_LOGIC_AUDIT=PASS
DETAIL=SECRET_VALUES_OUTPUT=NONE
CHANGES_MADE=NO

OUTPUT_END
CHAT_OUTPUT_END
