{
  "schema_version": 1,
  "channel": "homelab-runtime",
  "command_id": "CLUSTER-REFERENCE-PUBLISHER-SOURCE-EXTRACT-175",
  "status": "OK",
  "rc": 0,
  "host": "pve01",
  "mode": "read-only",
  "component": "cluster-audit",
  "started_at_utc": "2026-07-22T10:47:36Z",
  "finished_at_utc": "2026-07-22T10:47:36Z",
  "reference_register_checked": true,
  "reference_sha256": "5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e",
  "error_register_checked": true,
  "error_register_sha256": "08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752",
  "command_sha256": "c7bfd2a11496ee580c4f487ad180de917052a698bfeb10fb1916d2dd2cf2acac",
  "duplicate_failed_command_blocked": false,
  "block_reason": null,
  "execution_started": true,
  "changes_made": false,
  "sanitized": true,
  "secrets_included": false,
  "private_addresses_included": false,
  "raw_evidence_retained_locally": true,
  "raw_evidence_sha256": "dbcffd7aedbdb836ef10a48eecc98523d23e2c0db4017bba124caeeaab4a1b47",
  "sanitized_output_sha256": "f76fc120b3d22cac5e9945e9e3287749dff8d0bdd35bfb2399f961933259130e",
  "output_truncated_in_json": false,
  "full_sanitized_output_url": "https://git.gram1.ru/.well-known/homelab-runtime/latest.txt",
  "output": "validation=PASS\nAUTHORITATIVE_PREVIOUS=CLUSTER-REFERENCE-PUBLISHER-RECOVERY-AUDIT-170:OK\n=== LOCAL_174_EVIDENCE ===\n/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-RUNNER-GAP-AUDIT-174-20260722T104212Z.json\n/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-RUNNER-GAP-AUDIT-174-20260722T104212Z-latest.txt\n/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-RUNNER-GAP-AUDIT-174-20260722T104212Z.txt\nCOMMAND_ID=CLUSTER-REFERENCE-RUNNER-GAP-AUDIT-174\nSTATUS=OK\nRC=0\nERROR_REGISTER_CHECK=OK\nREMOTE_HISTORY=CLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171 PRESENT\nLOCAL_LEDGER=2026-07-22T10:25:15Z\tCLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171\t1299fe30eb30386fec901e120ab525ece490edc5eca767d9216466ecd225bef5\t0\tOK\tcluster-audit\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171-20260722T102515Z.json\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171-20260722T102515Z-latest.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171-20260722T102515Z.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/raw/CLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171-20260722T102515Z.log\nREMOTE_HISTORY=CLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172 PRESENT\nLOCAL_LEDGER=2026-07-22T10:31:23Z\tCLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172\t1732aee566a83403f448dd74bbfed41489b1640081fd869e751d662ce82fabd8\t0\tOK\tcluster-audit\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172-20260722T103123Z.json\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172-20260722T103123Z-latest.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172-20260722T103123Z.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/raw/CLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172-20260722T103123Z.log\nREMOTE_HISTORY=CLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173 PRESENT\nLOCAL_LEDGER=2026-07-22T10:36:43Z\tCLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173\t5cdd947b6f70123b03dde2c7e4e6f2438293bf651fe1cf84f77374b982df1f7e\t141\tFAIL\tcluster-audit\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173-20260722T103643Z.json\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173-20260722T103643Z-latest.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173-20260722T103643Z.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/raw/CLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173-20260722T103643Z.log\nREFERENCE_CHECK=OK\nERROR_REGISTER_CHECK=OK\nGAP_ERROR_REGISTERED=YES\nRUNNER_GAP_AUDIT=COMPLETE\nREMOTE_HISTORY=CLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171 PRESENT\nLOCAL_LEDGER=2026-07-22T10:25:15Z\tCLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171\t1299fe30eb30386fec901e120ab525ece490edc5eca767d9216466ecd225bef5\t0\tOK\tcluster-audit\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171-20260722T102515Z.json\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171-20260722T102515Z-latest.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171-20260722T102515Z.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/raw/CLUSTER-REFERENCE-PUBLISHER-CONTRACT-AUDIT-171-20260722T102515Z.log\nREMOTE_HISTORY=CLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172 PRESENT\nLOCAL_LEDGER=2026-07-22T10:31:23Z\tCLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172\t1732aee566a83403f448dd74bbfed41489b1640081fd869e751d662ce82fabd8\t0\tOK\tcluster-audit\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172-20260722T103123Z.json\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172-20260722T103123Z-latest.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172-20260722T103123Z.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/raw/CLUSTER-REFERENCE-PUBLISHER-IMPLEMENTATION-INPUTS-172-20260722T103123Z.log\nREMOTE_HISTORY=CLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173 PRESENT\nLOCAL_LEDGER=2026-07-22T10:36:43Z\tCLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173\t5cdd947b6f70123b03dde2c7e4e6f2438293bf651fe1cf84f77374b982df1f7e\t141\tFAIL\tcluster-audit\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173-20260722T103643Z.json\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173-20260722T103643Z-latest.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/public/CLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173-20260722T103643Z.txt\nLOCAL_FILE=/var/lib/homelab-chat-run/raw/CLUSTER-REFERENCE-PUBLISHER-GAP-RECONCILE-173-20260722T103643Z.log\nREFERENCE_CHECK=OK\nERROR_REGISTER_CHECK=OK\nGAP_ERROR_REGISTERED=YES\nRUNNER_GAP_AUDIT=COMPLETE\n=== WORKING_RUNTIME_PUBLICATION_SOURCE ===\n    \"raw_evidence_retained_locally\": True,\n    \"raw_evidence_sha256\": raw_sha,\n    \"sanitized_output_sha256\": sanitized_sha,\n    \"output_truncated_in_json\": output_truncated,\n    \"full_sanitized_output_url\": (\n        \"https://git.gram1.ru/.well-known/\"\n        \"homelab-runtime/latest.txt\"\n    ),\n    \"output\": output_preview,\n}\n\nPath(json_path).write_text(\n    json.dumps(\n        document,\n        ensure_ascii=False,\n        indent=2,\n    )\n    + \"\\n\",\n    encoding=\"utf-8\",\n)\nPY\n\n{\n    echo 'CHAT_OUTPUT_BEGIN'\n    echo \"COMMAND_ID=$COMMAND_ID\"\n    echo \"STATUS=$STATUS\"\n    echo \"RC=$RC\"\n    echo \"HOST=$HOST_SHORT\"\n    echo \"MODE=$MODE\"\n    echo \"COMPONENT=$COMPONENT\"\n    echo 'REFERENCE_REGISTER_CHECK=OK'\n    echo \"REFERENCE_SHA256=$REFERENCE_SHA256\"\n    echo 'ERROR_REGISTER_CHECK=OK'\n    echo \"ERROR_REGISTER_SHA256=$ERROR_REGISTER_SHA256\"\n    echo \"COMMAND_SHA256=$COMMAND_SHA256\"\n    echo \"DUPLICATE_FAILED_COMMAND_BLOCKED=$REPEAT_BLOCKED\"\n    echo \"EXECUTION_STARTED=$RUN_STARTED\"\n    echo \"CHANGES_MADE=$CHANGES_MADE\"\n    echo 'SANITIZED=yes'\n    echo 'SECRETS_INCLUDED=no'\n    echo 'PRIVATE_ADDRESSES_INCLUDED=no'\n    echo \"RAW_EVIDENCE_SHA256=$RAW_SHA256\"\n    echo \"SANITIZED_OUTPUT_SHA256=$SANITIZED_SHA256\"\n    echo 'OUTPUT_BEGIN'\n    cat \"$SANITIZED_FILE\"\n    echo\n    echo 'OUTPUT_END'\n    echo 'CHAT_OUTPUT_END'\n} >\"$TXT_FILE\"\n\nchmod 0600 \\\n    \"$RAW_FILE\" \\\n    \"$SANITIZED_FILE\" \\\n    \"$JSON_FILE\" \\\n    \"$TXT_FILE\"\n\nTARGET=debian@[PRIVATE_IP]\nREMOTE_PREFIX=\"/tmp/homelab-runtime-${COMMAND_ID}-$$\"\n\nSSH_OPTS=(\n    -o BatchMode=yes\n    -o ConnectTimeout=10\n    -o ConnectionAttempts=1\n    -o StrictHostKeyChecking=yes\n    -o UserKnownHostsFile=[SENSITIVE_PATH]\n)\n\nscp \\\n    -q \\\n    \"${SSH_OPTS[@]}\" \\\n    \"$JSON_FILE\" \\\n    \"${TARGET}:${REMOTE_PREFIX}.json\"\n\nscp \\\n    -q \\\n    \"${SSH_OPTS[@]}\" \\\n    \"$TXT_FILE\" \\\n    \"${TARGET}:${REMOTE_PREFIX}.txt\"\n\nssh \"${SSH_OPTS[@]}\" \"$TARGET\" \"\n    set +e\n\n    sudo -n /usr/local/sbin/homelab-runtime-receive \\\n        '$COMMAND_ID' \\\n        '${REMOTE_PREFIX}.json' \\\n        '${REMOTE_PREFIX}.txt'\n\n    receiver_rc=\\$?\n\n    rm -f \\\n        '${REMOTE_PREFIX}.json' \\\n        '${REMOTE_PREFIX}.txt'\n\n    exit \\$receiver_rc\n\"\n\nPUBLIC_URL='https://git.gram1.ru/.well-known/homelab-runtime/latest.json'\nPUBLIC_VISIBLE=false\n\nfor ATTEMPT in $(seq 1 30); do\n    CONTENT=\"$(\n        curl -fsS \\\n            --max-time 15 \\\n            \"$PUBLIC_URL\" 2>/dev/null ||\n        true\n    )\"\n\n    if printf '%s\\n' \"$CONTENT\" |\n       grep -Fq \"\\\"command_id\\\": \\\"$COMMAND_ID\\\"\"; then\n        PUBLIC_VISIBLE=true\n        break\n    fi\n\n    sleep 2\ndone\n\nif [ \"$PUBLIC_VISIBLE\" != true ]; then\n    echo 'RESULT=FAIL'\n    echo 'REASON=PUBLIC_RUNTIME_RESULT_NOT_VISIBLE'\n    echo \"COMMAND_ID=$COMMAND_ID\"\n    echo \"LOCAL_RAW_FILE=$RAW_FILE\"\n    exit 75\nfi\n\nprintf '%s\\t%s\\t%s\\t%s\\t%s\\t%s\\n' \\\n    \"$FINISHED_AT\" \\\n    \"$COMMAND_ID\" \\\n    \"$COMMAND_SHA256\" \\\n    \"$RC\" \\\n    \"$STATUS\" \\\n    \"$COMPONENT\" >>\"$LEDGER\"\n\necho\necho '===== HOMELAB CHAT RUN COMPLETE ====='\necho \"COMMAND_ID=$COMMAND_ID\"\necho \"STATUS=$STATUS\"\necho \"RC=$RC\"\necho 'REFERENCE_REGISTER_CHECK=OK'\necho 'ERROR_REGISTER_CHECK=OK'\necho \"DUPLICATE_FAILED_COMMAND_BLOCKED=$REPEAT_BLOCKED\"\necho 'GITEA_PUBLICATION=OK'\necho \"PUBLIC_URL=$PUBLIC_URL\"\necho \"LOCAL_RAW_FILE=$RAW_FILE\"\necho 'SHELL_SESSION_PRESERVED=yes'\n\nexit \"$RC\"\n=== REFERENCE_PUBLISH_CONTRACT ===\n1-# Operations\n2-\n3-List: homelab-reference list\n4-Read: homelab-reference get SECTION ID --layer effective\n5-Add: homelab-reference add SECTION JSON\n6-Edit: homelab-reference edit SECTION ID --set key=value\n7-Remove: homelab-reference remove SECTION ID\n8-Validate: homelab-reference validate\n9-Merge: homelab-reference merge\n10-Refresh: homelab-reference-refresh\n11:Publish: homelab-reference-publish\n12-\n13-Immutable runtime history for the exact COMMAND_ID is authoritative. latest.json is not authoritative.\n5:S=json.loads((R/\"manifest.json\").read_text())[\"sections\"]\n34: f=int(json.loads((R/\"manifest.json\").read_text()).get(\"freshness_seconds\",{}).get(s,3600));z=(t+datetime.timedelta(seconds=f)).isoformat()\n124: rec={\"cluster\":[{\"id\":\"cluster-homelab\",\"hostname\":socket.gethostname(),\"kernel\":os.uname().release,\"pve_version\":pv,\"quorum_status\":qu}],\"nodes\":[{**x,\"id\":\"node-\"+slug(x.get(\"node\") or x.get(\"id\"))} for x in nodes],\"guests\":[{\"id\":\"guest-\"+slug(x.get(\"vmid\")),\"vmid\":x.get(\"vmid\"),\"name\":x.get(\"name\"),\"type\":x.get(\"type\"),\"node\":x.get(\"node\"),\"status\":x.get(\"status\"),\"tags\":x.get(\"tags\")} for x in guests],\"containers\":[{\"id\":\"container-\"+slug(x.get(\"vmid\")),\"vmid\":x.get(\"vmid\"),\"name\":x.get(\"name\"),\"node\":x.get(\"node\"),\"status\":x.get(\"status\"),\"tags\":x.get(\"tags\")} for x in guests if x.get(\"type\")==\"lxc\"],\"services\":list(sv.values()),\"applications\":apps+comp,\"networks\":[{\"id\":\"network-state\",\"interfaces\":addr,\"routes\":routes}],\"dns\":[{\"id\":\"resolver-state\",\"resolv_conf\":dns}],\"domains\":[{\"id\":\"domain-\"+slug(x),\"name\":x} for x in sorted(dom)],\"certificates\":cert,\"ingress\":ing,\"storage\":[{**x,\"id\":\"storage-\"+slug(x.get(\"storage\") or x.get(\"id\"))} for x in stor],\"backups\":bk,\"monitoring\":[x for x in sv.values() if re.search(r\"prometheus|grafana|zabbix|uptime|kuma|alertmanager|exporter|health|monitor\",x.get(\"name\",\"\"),re.I)],\"external_services\":list(eps.values()),\"dependencies\":[{\"id\":\"dependency-\"+slug(x[\"id\"]),\"from\":x[\"id\"],\"to\":x.get(\"image\"),\"type\":\"container-image\"} for x in apps if x.get(\"image\")],\"access\":ac,\"security\":[{\"id\":\"reference-security-policy\",\"status\":\"enforced\",\"secret_values_stored\":False,\"public_mirror_sanitized\":True}]}\n125: cnt={s:write(s,x,\"automatic-reference-collector\",t) for s,x in rec.items()};eff={};pd=R/\"public\"/\"effective\";pd.mkdir(parents=True,exist_ok=True)\n128: atom(R/\"public\"/\"index.json\",{\"schema_version\":2,\"reference_id\":\"homelab-cluster-reference-public\",\"generated_at\":t.isoformat(),\"sections\":eff,\"secrets_included\":False,\"private_addresses_included\":False})\n131: st=load(\"state\",\"current\") if False else json.loads((R/\"state/current.json\").read_text());st.update({\"schema_version\":2,\"status\":\"AUTO_REFRESH_READY\",\"updated_at\":t.isoformat(),\"last_snapshot\":str(snap),\"observed_counts\":cnt,\"effective_counts\":eff,\"public_index\":str(R/\"public/index.json\"),\"collector\":str(pathlib.Path(__file__))});atom(R/\"state/current.json\",st)\n132: print(\"REFERENCE_REFRESH=PASS\");print(\"OBSERVED_RECORDS=\"+str(sum(cnt.values())));print(\"EFFECTIVE_RECORDS=\"+str(sum(eff.values())));print(\"PUBLIC_MIRROR=\"+str(R/\"public\"))\nREFERENCE_CHECK=OK\nERROR_REGISTER_CHECK=OK\nSECRET_PRINTED=NO\nPRIVATE_ADDRESS_PRINTED=NO\nPUBLISHER_SOURCE_EXTRACTION=COMPLETE\n"
}
