diff --git a/runtime/history/CLUSTER-REFERENCE-CORE-INVENTORY-161.json b/runtime/history/CLUSTER-REFERENCE-CORE-INVENTORY-161.json new file mode 100644 index 0000000..50ef589 --- /dev/null +++ b/runtime/history/CLUSTER-REFERENCE-CORE-INVENTORY-161.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "channel": "homelab-runtime", + "command_id": "CLUSTER-REFERENCE-CORE-INVENTORY-161", + "status": "FAIL", + "rc": 1, + "host": "pve01", + "mode": "change", + "component": "reference-update", + "started_at_utc": "2026-07-22T08:47:05Z", + "finished_at_utc": "2026-07-22T08:47:05Z", + "reference_register_checked": true, + "reference_sha256": "5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e", + "error_register_checked": true, + "error_register_sha256": "08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752", + "command_sha256": "9f9a4398c63fdddddd53865e69da2f8af6ff9c9c69398ec28d530d5449d7296e", + "duplicate_failed_command_blocked": false, + "block_reason": null, + "execution_started": true, + "changes_made": true, + "sanitized": true, + "secrets_included": false, + "private_addresses_included": false, + "raw_evidence_retained_locally": true, + "raw_evidence_sha256": "45b8d84f9e819bf717f6a1d7cf029f793f6f32c545ac2a017f9af091da4c2152", + "sanitized_output_sha256": "45b8d84f9e819bf717f6a1d7cf029f793f6f32c545ac2a017f9af091da4c2152", + "output_truncated_in_json": false, + "full_sanitized_output_url": "https://git.gram1.ru/.well-known/homelab-runtime/latest.txt", + "output": " File \"\", line 1\n import datetime,json,os,pathlib,re,shutil,socket,subprocess,urllib.request;root=pathlib.Path(\"/etc/homelab/reference\");assert (root/\"manifest.json\").is_file() and (root/\"state/current.json\").is_file();u=\"https://git.gram1.ru/homelab-admin/homelab-public-context/raw/commit/321a330f9e5c8696e6e8bf1e147ce5386f3de352/runtime/history/CLUSTER-REFERENCE-CORE-INVENTORY-156.json\";prev=json.load(urllib.request.urlopen(urllib.request.Request(u,headers={\"User-Agent\":\"homelab-reference/3\"}),timeout=60));assert prev.get(\"command_id\")==\"CLUSTER-REFERENCE-CORE-INVENTORY-156\" and prev.get(\"status\")==\"FAIL\" and int(prev.get(\"rc\"))==1 and \"SyntaxError\" in str(prev.get(\"output\",\"\"));manifest=json.loads((root/\"manifest.json\").read_text(encoding=\"utf-8\"));now=datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0);now_s=now.isoformat();sections=[\"cluster\",\"nodes\",\".json\").read_text(encoding=\"utf-8\"));now=datetime.datetime.now(datetimeguests\",\"containers\",\"storage\",\"networks\",\"dns\"];snap=root/\"snapshots\"/(\"core-\"+now.strftime(\"%Y%m%dT%H%M%SZ\"));snap.mkdir(parents=True,exist_ok=False);[(shutil.copy2(root/\"observed\"/(s+\".json\"),snap/(s+\".json\"))) for s in sections if (root/\"observed\"/(s+\".json\")).is_file()];out=lambda a:subprocess.check_output(a,text=True,stderr=subprocess.STDOUT,timeout=90);txt=lambda a:(lambda r:r.stdout+r.stderr)(subprocess.run(a,stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True,timeout=90,check=False));nodes=json.loads(out([\"pvesh\",\"get\",\"/nodes\",\"--output-format\",\"json\"]));guests=json.loads(out([\"pvesh\",\"get\",\"/cluster/resources\",\"--type\",\"vm\",\"--output-format\",\"json\"]));storage=json.loads(out([\"pvesh\",\"get\",\"/storage\",\"--output-format\",\"json\"]));addresses=json.loads(out([\"ip\",\"-j\",\"address\"]));routes=json.loads(out([\"ip\",\"-j\",\"route\",\"show\",\"table\",\"all\"]));slug=lambda v:re.sub(\"[^a-z0-9._-]+\",\"-\",str(v).lower()).strip(\"-\") or \"unknown\";fresh=lambda s:(now+datetime.timedelta(seconds=int(manifest.get(\"freshness_seconds\",{}).get(s,3600)))).isoformat();decorate=lambda s,x:{**x,\"observed_at\":now_s,\"fresh_until\":fresh(s),\"source\":\"core-internal-collector\"};resolv=pathlib.Path(\"/etc/resolv.conf\");records={\"cluster\":[decorate(\"cluster\",{\"id\":\"cluster-homelab\",\"hostname\":socket.gethostname(),\"kernel\":os.uname().release,\"pve_version\":txt([\"pveversion\",\"--verbose\"]),\"quorum_status\":txt([\"pvecm\",\"status\"])})],\"nodes\":[decorate(\"nodes\",{**x,\"id\":\"node-\"+slug(x.get(\"node\") or x.get(\"id\"))}) for x in nodes],\"guests\":[decorate(\"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\"),\"template\":x.get(\"template\"),\"uptime\":x.get(\"uptime\"),\"cpus\":x.get(\"maxcpu\"),\"memory_bytes\":x.get(\"maxmem\"),\"disk_bytes\":x.get(\"maxdisk\"),\"tags\":x.get(\"tags\")}) for x in guests],\"containers\":[decorate(\"containers\",{\"id\":\"container-\"+slug(x.get(\"vmid\")),\"vmid\":x.get(\"vmid\"),\"name\":x.get(\"name\"),\"node\":x.get(\"node\"),\"status\":x.get(\"status\"),\"uptime\":x.get(\"uptime\"),\"cpus\":x.get(\"maxcpu\"),\"memory_bytes\":x.get(\"maxmem\"),\"disk_bytes\":x.get(\"maxdisk\"),\"tags\":x.get(\"tags\")}) for x in guests if x.get(\"type\")==\"lxc\"],\"storage\":[decorate(\"storage\",{**x,\"id\":\"storage-\"+slug(x.get(\"storage\") or x.get(\"id\"))}) for x in storage],\"networks\":[decorate(\"networks\",{\"id\":\"network-state-\"+slug(socket.gethostname()),\"hostname\":socket.gethostname(),\"interfaces\":addresses,\"routes\":routes})],\"dns\":[decorate(\"dns\",{\"id\":\"resolver-state-\"+slug(socket.gethostname()),\"hostname\":socket.gethostname(),\"resolv_conf\":resolv.read_text(encoding=\"utf-8\",errors=\"replace\").splitlines() if resolv.is_file() else []})]};[(root/\"observed\"/(s+\".json\")).write_text(json.dumps({\"schema_version\":2,\"section\":s,\"layer\":\"observed\",\"updated_at\":now_s,\"source\":\"core-internal-collector\",\"records\":v},ensure_ascii=False,indent=2)+\"\\n\",encoding=\"utf-8\") for s,v in records.items()];state=json.loads((root/\"state/current.json\").read_text(encoding=\"utf-8\"));state.update({\"schema_version\":2,\"status\":\"CORE_INTERNAL_INVENTORY_READY\",\"updated_at\":now_s,\"last_snapshot\":str(snap),\"core_internal_counts\":{s:len(v) for s,v in records.items()},\"previous_command_id\":\"CLUSTER-REFERENCE-CORE-INVENTORY-156\",\"previous_immutable_commit\":\"321a330f9e5c8696e6e8bf1e147ce5386f3de352\"});(root/\"state/current.json\").write_text(json.dumps(state,ensure_ascii=False,indent=2)+\"\\n\",encoding=\"utf-8\");[json.loads(p.read_text(encoding=\"utf-8\")) for p in root.rglob(\"*.json\")];[os.chmod(p,0o750 if p.is_dir() else 0o640) for p in [root,*root.rglob(\"*\")]];print(\"PREVIOUS_FAILURE=CONFIRMED\");print(\"REFERENCE_SNAPSHOT=\"+str(snap));print(\"CORE_INTERNAL_SECTIONS=\"+str(len(records)));print(\"CORE_INTERNAL_RECORDS=\"+str(sum(len(v) for v in records.values())));print(\"REFERENCE_STATUS=CORE_INTERNAL_INVENTORY_READY);print(\"CLUSTER_REFERENCE_CORE_INVENTORY=COMPLETE\")\n ^\nSyntaxError: closing parenthesis ')' does not match opening parenthesis '['\n" +} diff --git a/runtime/history/CLUSTER-REFERENCE-CORE-INVENTORY-161.txt b/runtime/history/CLUSTER-REFERENCE-CORE-INVENTORY-161.txt new file mode 100644 index 0000000..651acb4 --- /dev/null +++ b/runtime/history/CLUSTER-REFERENCE-CORE-INVENTORY-161.txt @@ -0,0 +1,28 @@ +CHAT_OUTPUT_BEGIN +COMMAND_ID=CLUSTER-REFERENCE-CORE-INVENTORY-161 +STATUS=FAIL +RC=1 +HOST=pve01 +MODE=change +COMPONENT=reference-update +REFERENCE_REGISTER_CHECK=OK +REFERENCE_SHA256=5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e +ERROR_REGISTER_CHECK=OK +ERROR_REGISTER_SHA256=08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752 +COMMAND_SHA256=9f9a4398c63fdddddd53865e69da2f8af6ff9c9c69398ec28d530d5449d7296e +DUPLICATE_FAILED_COMMAND_BLOCKED=false +EXECUTION_STARTED=true +CHANGES_MADE=true +SANITIZED=yes +SECRETS_INCLUDED=no +PRIVATE_ADDRESSES_INCLUDED=no +RAW_EVIDENCE_SHA256=45b8d84f9e819bf717f6a1d7cf029f793f6f32c545ac2a017f9af091da4c2152 +SANITIZED_OUTPUT_SHA256=45b8d84f9e819bf717f6a1d7cf029f793f6f32c545ac2a017f9af091da4c2152 +OUTPUT_BEGIN + File "", line 1 + import datetime,json,os,pathlib,re,shutil,socket,subprocess,urllib.request;root=pathlib.Path("/etc/homelab/reference");assert (root/"manifest.json").is_file() and (root/"state/current.json").is_file();u="https://git.gram1.ru/homelab-admin/homelab-public-context/raw/commit/321a330f9e5c8696e6e8bf1e147ce5386f3de352/runtime/history/CLUSTER-REFERENCE-CORE-INVENTORY-156.json";prev=json.load(urllib.request.urlopen(urllib.request.Request(u,headers={"User-Agent":"homelab-reference/3"}),timeout=60));assert prev.get("command_id")=="CLUSTER-REFERENCE-CORE-INVENTORY-156" and prev.get("status")=="FAIL" and int(prev.get("rc"))==1 and "SyntaxError" in str(prev.get("output",""));manifest=json.loads((root/"manifest.json").read_text(encoding="utf-8"));now=datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0);now_s=now.isoformat();sections=["cluster","nodes",".json").read_text(encoding="utf-8"));now=datetime.datetime.now(datetimeguests","containers","storage","networks","dns"];snap=root/"snapshots"/("core-"+now.strftime("%Y%m%dT%H%M%SZ"));snap.mkdir(parents=True,exist_ok=False);[(shutil.copy2(root/"observed"/(s+".json"),snap/(s+".json"))) for s in sections if (root/"observed"/(s+".json")).is_file()];out=lambda a:subprocess.check_output(a,text=True,stderr=subprocess.STDOUT,timeout=90);txt=lambda a:(lambda r:r.stdout+r.stderr)(subprocess.run(a,stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True,timeout=90,check=False));nodes=json.loads(out(["pvesh","get","/nodes","--output-format","json"]));guests=json.loads(out(["pvesh","get","/cluster/resources","--type","vm","--output-format","json"]));storage=json.loads(out(["pvesh","get","/storage","--output-format","json"]));addresses=json.loads(out(["ip","-j","address"]));routes=json.loads(out(["ip","-j","route","show","table","all"]));slug=lambda v:re.sub("[^a-z0-9._-]+","-",str(v).lower()).strip("-") or "unknown";fresh=lambda s:(now+datetime.timedelta(seconds=int(manifest.get("freshness_seconds",{}).get(s,3600)))).isoformat();decorate=lambda s,x:{**x,"observed_at":now_s,"fresh_until":fresh(s),"source":"core-internal-collector"};resolv=pathlib.Path("/etc/resolv.conf");records={"cluster":[decorate("cluster",{"id":"cluster-homelab","hostname":socket.gethostname(),"kernel":os.uname().release,"pve_version":txt(["pveversion","--verbose"]),"quorum_status":txt(["pvecm","status"])})],"nodes":[decorate("nodes",{**x,"id":"node-"+slug(x.get("node") or x.get("id"))}) for x in nodes],"guests":[decorate("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"),"template":x.get("template"),"uptime":x.get("uptime"),"cpus":x.get("maxcpu"),"memory_bytes":x.get("maxmem"),"disk_bytes":x.get("maxdisk"),"tags":x.get("tags")}) for x in guests],"containers":[decorate("containers",{"id":"container-"+slug(x.get("vmid")),"vmid":x.get("vmid"),"name":x.get("name"),"node":x.get("node"),"status":x.get("status"),"uptime":x.get("uptime"),"cpus":x.get("maxcpu"),"memory_bytes":x.get("maxmem"),"disk_bytes":x.get("maxdisk"),"tags":x.get("tags")}) for x in guests if x.get("type")=="lxc"],"storage":[decorate("storage",{**x,"id":"storage-"+slug(x.get("storage") or x.get("id"))}) for x in storage],"networks":[decorate("networks",{"id":"network-state-"+slug(socket.gethostname()),"hostname":socket.gethostname(),"interfaces":addresses,"routes":routes})],"dns":[decorate("dns",{"id":"resolver-state-"+slug(socket.gethostname()),"hostname":socket.gethostname(),"resolv_conf":resolv.read_text(encoding="utf-8",errors="replace").splitlines() if resolv.is_file() else []})]};[(root/"observed"/(s+".json")).write_text(json.dumps({"schema_version":2,"section":s,"layer":"observed","updated_at":now_s,"source":"core-internal-collector","records":v},ensure_ascii=False,indent=2)+"\n",encoding="utf-8") for s,v in records.items()];state=json.loads((root/"state/current.json").read_text(encoding="utf-8"));state.update({"schema_version":2,"status":"CORE_INTERNAL_INVENTORY_READY","updated_at":now_s,"last_snapshot":str(snap),"core_internal_counts":{s:len(v) for s,v in records.items()},"previous_command_id":"CLUSTER-REFERENCE-CORE-INVENTORY-156","previous_immutable_commit":"321a330f9e5c8696e6e8bf1e147ce5386f3de352"});(root/"state/current.json").write_text(json.dumps(state,ensure_ascii=False,indent=2)+"\n",encoding="utf-8");[json.loads(p.read_text(encoding="utf-8")) for p in root.rglob("*.json")];[os.chmod(p,0o750 if p.is_dir() else 0o640) for p in [root,*root.rglob("*")]];print("PREVIOUS_FAILURE=CONFIRMED");print("REFERENCE_SNAPSHOT="+str(snap));print("CORE_INTERNAL_SECTIONS="+str(len(records)));print("CORE_INTERNAL_RECORDS="+str(sum(len(v) for v in records.values())));print("REFERENCE_STATUS=CORE_INTERNAL_INVENTORY_READY);print("CLUSTER_REFERENCE_CORE_INVENTORY=COMPLETE") + ^ +SyntaxError: closing parenthesis ')' does not match opening parenthesis '[' + +OUTPUT_END +CHAT_OUTPUT_END diff --git a/runtime/latest.json b/runtime/latest.json index aff1a75..50ef589 100644 --- a/runtime/latest.json +++ b/runtime/latest.json @@ -1,30 +1,30 @@ { "schema_version": 1, "channel": "homelab-runtime", - "command_id": "CLUSTER-REFERENCE-EXECUTION-TRACE-160", - "status": "OK", - "rc": 0, + "command_id": "CLUSTER-REFERENCE-CORE-INVENTORY-161", + "status": "FAIL", + "rc": 1, "host": "pve01", - "mode": "read-only", - "component": "cluster-audit", - "started_at_utc": "2026-07-22T08:39:47Z", - "finished_at_utc": "2026-07-22T08:39:47Z", + "mode": "change", + "component": "reference-update", + "started_at_utc": "2026-07-22T08:47:05Z", + "finished_at_utc": "2026-07-22T08:47:05Z", "reference_register_checked": true, "reference_sha256": "5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e", "error_register_checked": true, "error_register_sha256": "08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752", - "command_sha256": "3bec9660d1a8779abfd4014550248f51d4aa51116f90e0871333bb7e68a03bf8", + "command_sha256": "9f9a4398c63fdddddd53865e69da2f8af6ff9c9c69398ec28d530d5449d7296e", "duplicate_failed_command_blocked": false, "block_reason": null, "execution_started": true, - "changes_made": false, + "changes_made": true, "sanitized": true, "secrets_included": false, "private_addresses_included": false, "raw_evidence_retained_locally": true, - "raw_evidence_sha256": "1cac0139466313836a6d1217f2fd1962d17d741c29118e089ad79eac49fb3b36", - "sanitized_output_sha256": "1cac0139466313836a6d1217f2fd1962d17d741c29118e089ad79eac49fb3b36", + "raw_evidence_sha256": "45b8d84f9e819bf717f6a1d7cf029f793f6f32c545ac2a017f9af091da4c2152", + "sanitized_output_sha256": "45b8d84f9e819bf717f6a1d7cf029f793f6f32c545ac2a017f9af091da4c2152", "output_truncated_in_json": false, "full_sanitized_output_url": "https://git.gram1.ru/.well-known/homelab-runtime/latest.txt", - "output": "=== LOCAL_COMMAND_TRACES ===\n--- COMMAND_ID=CLUSTER-REFERENCE-CORE-INVENTORY-158 ---\nFILE=/var/lib/homelab-chat-run/raw/CLUSTER-REFERENCE-CORE-INVENTORY-158-20260722T083224Z.log SIZE=260 MTIME=2026-07-22 11:32:26.396905694 +0300\n3:CORE_INTERNAL_SECTIONS=7\n4:CORE_INTERNAL_RECORDS=24\n5:REFERENCE_SNAPSHOT=/etc/homelab/reference/snapshots/core-20260722T083224Z\n6:CLUSTER_REFERENCE_CORE_INVENTORY=COMPLETE\n--- COMMAND_ID=CLUSTER-REFERENCE-SERVICE-SOURCE-AUDIT-159 ---\nFILE=/var/lib/homelab-chat-run/raw/CLUSTER-REFERENCE-SERVICE-SOURCE-AUDIT-159-20260722T083543Z.log SIZE=1180 MTIME=2026-07-22 11:35:45.879008704 +0300\n4:PREVIOUS_STATUS=OK\n5:PREVIOUS_RC=0\n6:PREVIOUS_REASON=\n9:REFERENCE_REGISTER_CHECK=OK\n10:REFERENCE_SHA256=5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e\n11:CORE_INTERNAL_SECTIONS=7\n12:CORE_INTERNAL_RECORDS=24\n13:REFERENCE_SNAPSHOT=/etc/homelab/reference/snapshots/core-20260722T083224Z\n14:CLUSTER_REFERENCE_CORE_INVENTORY=COMPLETE\n15:=== REFERENCE_STATE ===\n16:REFERENCE_MANIFEST=PRESENT\n17:REFERENCE_SECTIONS=24\n18:REFERENCE_SCHEMA_VERSION=2\n19:REFERENCE_STATUS=CORE_INTERNAL_INVENTORY_READY\n20:REFERENCE_UPDATED_AT=2026-07-22T08:32:24+00:00\n21:REFERENCE_JSON_FILES=0\n40:CLUSTER_REFERENCE_SERVICE_SOURCE_AUDIT=COMPLETE\n=== REFERENCE_STATE ===\nREFERENCE_ROOT=PRESENT\nREFERENCE_FILES=84\nREFERENCE_JSON_FILES=0\nREFERENCE_SCHEMA_VERSION=2\nREFERENCE_SECTIONS=24\nREFERENCE_STATUS=CORE_INTERNAL_INVENTORY_READY\nREFERENCE_UPDATED_AT=2026-07-22T08:32:24+00:00\nCORE_INTERNAL_COUNTS={'cluster': 1, 'nodes': 3, 'guests': 12, 'containers': 4, 'storage': 2, 'networks': 1, 'dns': 1}\nOBSERVED_CLUSTER_RECORDS=1\nOBSERVED_NODES_RECORDS=3\nOBSERVED_GUESTS_RECORDS=12\nOBSERVED_CONTAINERS_RECORDS=4\nOBSERVED_STORAGE_RECORDS=2\nOBSERVED_NETWORKS_RECORDS=1\nOBSERVED_DNS_RECORDS=1\n=== TOOLING_STATE ===\nREFERENCE_CLI=ABSENT\nCLUSTER_REFERENCE_EXECUTION_TRACE=COMPLETE\n" + "output": " File \"\", line 1\n import datetime,json,os,pathlib,re,shutil,socket,subprocess,urllib.request;root=pathlib.Path(\"/etc/homelab/reference\");assert (root/\"manifest.json\").is_file() and (root/\"state/current.json\").is_file();u=\"https://git.gram1.ru/homelab-admin/homelab-public-context/raw/commit/321a330f9e5c8696e6e8bf1e147ce5386f3de352/runtime/history/CLUSTER-REFERENCE-CORE-INVENTORY-156.json\";prev=json.load(urllib.request.urlopen(urllib.request.Request(u,headers={\"User-Agent\":\"homelab-reference/3\"}),timeout=60));assert prev.get(\"command_id\")==\"CLUSTER-REFERENCE-CORE-INVENTORY-156\" and prev.get(\"status\")==\"FAIL\" and int(prev.get(\"rc\"))==1 and \"SyntaxError\" in str(prev.get(\"output\",\"\"));manifest=json.loads((root/\"manifest.json\").read_text(encoding=\"utf-8\"));now=datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0);now_s=now.isoformat();sections=[\"cluster\",\"nodes\",\".json\").read_text(encoding=\"utf-8\"));now=datetime.datetime.now(datetimeguests\",\"containers\",\"storage\",\"networks\",\"dns\"];snap=root/\"snapshots\"/(\"core-\"+now.strftime(\"%Y%m%dT%H%M%SZ\"));snap.mkdir(parents=True,exist_ok=False);[(shutil.copy2(root/\"observed\"/(s+\".json\"),snap/(s+\".json\"))) for s in sections if (root/\"observed\"/(s+\".json\")).is_file()];out=lambda a:subprocess.check_output(a,text=True,stderr=subprocess.STDOUT,timeout=90);txt=lambda a:(lambda r:r.stdout+r.stderr)(subprocess.run(a,stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True,timeout=90,check=False));nodes=json.loads(out([\"pvesh\",\"get\",\"/nodes\",\"--output-format\",\"json\"]));guests=json.loads(out([\"pvesh\",\"get\",\"/cluster/resources\",\"--type\",\"vm\",\"--output-format\",\"json\"]));storage=json.loads(out([\"pvesh\",\"get\",\"/storage\",\"--output-format\",\"json\"]));addresses=json.loads(out([\"ip\",\"-j\",\"address\"]));routes=json.loads(out([\"ip\",\"-j\",\"route\",\"show\",\"table\",\"all\"]));slug=lambda v:re.sub(\"[^a-z0-9._-]+\",\"-\",str(v).lower()).strip(\"-\") or \"unknown\";fresh=lambda s:(now+datetime.timedelta(seconds=int(manifest.get(\"freshness_seconds\",{}).get(s,3600)))).isoformat();decorate=lambda s,x:{**x,\"observed_at\":now_s,\"fresh_until\":fresh(s),\"source\":\"core-internal-collector\"};resolv=pathlib.Path(\"/etc/resolv.conf\");records={\"cluster\":[decorate(\"cluster\",{\"id\":\"cluster-homelab\",\"hostname\":socket.gethostname(),\"kernel\":os.uname().release,\"pve_version\":txt([\"pveversion\",\"--verbose\"]),\"quorum_status\":txt([\"pvecm\",\"status\"])})],\"nodes\":[decorate(\"nodes\",{**x,\"id\":\"node-\"+slug(x.get(\"node\") or x.get(\"id\"))}) for x in nodes],\"guests\":[decorate(\"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\"),\"template\":x.get(\"template\"),\"uptime\":x.get(\"uptime\"),\"cpus\":x.get(\"maxcpu\"),\"memory_bytes\":x.get(\"maxmem\"),\"disk_bytes\":x.get(\"maxdisk\"),\"tags\":x.get(\"tags\")}) for x in guests],\"containers\":[decorate(\"containers\",{\"id\":\"container-\"+slug(x.get(\"vmid\")),\"vmid\":x.get(\"vmid\"),\"name\":x.get(\"name\"),\"node\":x.get(\"node\"),\"status\":x.get(\"status\"),\"uptime\":x.get(\"uptime\"),\"cpus\":x.get(\"maxcpu\"),\"memory_bytes\":x.get(\"maxmem\"),\"disk_bytes\":x.get(\"maxdisk\"),\"tags\":x.get(\"tags\")}) for x in guests if x.get(\"type\")==\"lxc\"],\"storage\":[decorate(\"storage\",{**x,\"id\":\"storage-\"+slug(x.get(\"storage\") or x.get(\"id\"))}) for x in storage],\"networks\":[decorate(\"networks\",{\"id\":\"network-state-\"+slug(socket.gethostname()),\"hostname\":socket.gethostname(),\"interfaces\":addresses,\"routes\":routes})],\"dns\":[decorate(\"dns\",{\"id\":\"resolver-state-\"+slug(socket.gethostname()),\"hostname\":socket.gethostname(),\"resolv_conf\":resolv.read_text(encoding=\"utf-8\",errors=\"replace\").splitlines() if resolv.is_file() else []})]};[(root/\"observed\"/(s+\".json\")).write_text(json.dumps({\"schema_version\":2,\"section\":s,\"layer\":\"observed\",\"updated_at\":now_s,\"source\":\"core-internal-collector\",\"records\":v},ensure_ascii=False,indent=2)+\"\\n\",encoding=\"utf-8\") for s,v in records.items()];state=json.loads((root/\"state/current.json\").read_text(encoding=\"utf-8\"));state.update({\"schema_version\":2,\"status\":\"CORE_INTERNAL_INVENTORY_READY\",\"updated_at\":now_s,\"last_snapshot\":str(snap),\"core_internal_counts\":{s:len(v) for s,v in records.items()},\"previous_command_id\":\"CLUSTER-REFERENCE-CORE-INVENTORY-156\",\"previous_immutable_commit\":\"321a330f9e5c8696e6e8bf1e147ce5386f3de352\"});(root/\"state/current.json\").write_text(json.dumps(state,ensure_ascii=False,indent=2)+\"\\n\",encoding=\"utf-8\");[json.loads(p.read_text(encoding=\"utf-8\")) for p in root.rglob(\"*.json\")];[os.chmod(p,0o750 if p.is_dir() else 0o640) for p in [root,*root.rglob(\"*\")]];print(\"PREVIOUS_FAILURE=CONFIRMED\");print(\"REFERENCE_SNAPSHOT=\"+str(snap));print(\"CORE_INTERNAL_SECTIONS=\"+str(len(records)));print(\"CORE_INTERNAL_RECORDS=\"+str(sum(len(v) for v in records.values())));print(\"REFERENCE_STATUS=CORE_INTERNAL_INVENTORY_READY);print(\"CLUSTER_REFERENCE_CORE_INVENTORY=COMPLETE\")\n ^\nSyntaxError: closing parenthesis ')' does not match opening parenthesis '['\n" } diff --git a/runtime/latest.txt b/runtime/latest.txt index 4f778c3..651acb4 100644 --- a/runtime/latest.txt +++ b/runtime/latest.txt @@ -1,69 +1,28 @@ CHAT_OUTPUT_BEGIN -COMMAND_ID=CLUSTER-REFERENCE-EXECUTION-TRACE-160 -STATUS=OK -RC=0 +COMMAND_ID=CLUSTER-REFERENCE-CORE-INVENTORY-161 +STATUS=FAIL +RC=1 HOST=pve01 -MODE=read-only -COMPONENT=cluster-audit +MODE=change +COMPONENT=reference-update REFERENCE_REGISTER_CHECK=OK REFERENCE_SHA256=5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e ERROR_REGISTER_CHECK=OK ERROR_REGISTER_SHA256=08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752 -COMMAND_SHA256=3bec9660d1a8779abfd4014550248f51d4aa51116f90e0871333bb7e68a03bf8 +COMMAND_SHA256=9f9a4398c63fdddddd53865e69da2f8af6ff9c9c69398ec28d530d5449d7296e DUPLICATE_FAILED_COMMAND_BLOCKED=false EXECUTION_STARTED=true -CHANGES_MADE=false +CHANGES_MADE=true SANITIZED=yes SECRETS_INCLUDED=no PRIVATE_ADDRESSES_INCLUDED=no -RAW_EVIDENCE_SHA256=1cac0139466313836a6d1217f2fd1962d17d741c29118e089ad79eac49fb3b36 -SANITIZED_OUTPUT_SHA256=1cac0139466313836a6d1217f2fd1962d17d741c29118e089ad79eac49fb3b36 +RAW_EVIDENCE_SHA256=45b8d84f9e819bf717f6a1d7cf029f793f6f32c545ac2a017f9af091da4c2152 +SANITIZED_OUTPUT_SHA256=45b8d84f9e819bf717f6a1d7cf029f793f6f32c545ac2a017f9af091da4c2152 OUTPUT_BEGIN -=== LOCAL_COMMAND_TRACES === ---- COMMAND_ID=CLUSTER-REFERENCE-CORE-INVENTORY-158 --- -FILE=/var/lib/homelab-chat-run/raw/CLUSTER-REFERENCE-CORE-INVENTORY-158-20260722T083224Z.log SIZE=260 MTIME=2026-07-22 11:32:26.396905694 +0300 -3:CORE_INTERNAL_SECTIONS=7 -4:CORE_INTERNAL_RECORDS=24 -5:REFERENCE_SNAPSHOT=/etc/homelab/reference/snapshots/core-20260722T083224Z -6:CLUSTER_REFERENCE_CORE_INVENTORY=COMPLETE ---- COMMAND_ID=CLUSTER-REFERENCE-SERVICE-SOURCE-AUDIT-159 --- -FILE=/var/lib/homelab-chat-run/raw/CLUSTER-REFERENCE-SERVICE-SOURCE-AUDIT-159-20260722T083543Z.log SIZE=1180 MTIME=2026-07-22 11:35:45.879008704 +0300 -4:PREVIOUS_STATUS=OK -5:PREVIOUS_RC=0 -6:PREVIOUS_REASON= -9:REFERENCE_REGISTER_CHECK=OK -10:REFERENCE_SHA256=5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e -11:CORE_INTERNAL_SECTIONS=7 -12:CORE_INTERNAL_RECORDS=24 -13:REFERENCE_SNAPSHOT=/etc/homelab/reference/snapshots/core-20260722T083224Z -14:CLUSTER_REFERENCE_CORE_INVENTORY=COMPLETE -15:=== REFERENCE_STATE === -16:REFERENCE_MANIFEST=PRESENT -17:REFERENCE_SECTIONS=24 -18:REFERENCE_SCHEMA_VERSION=2 -19:REFERENCE_STATUS=CORE_INTERNAL_INVENTORY_READY -20:REFERENCE_UPDATED_AT=2026-07-22T08:32:24+00:00 -21:REFERENCE_JSON_FILES=0 -40:CLUSTER_REFERENCE_SERVICE_SOURCE_AUDIT=COMPLETE -=== REFERENCE_STATE === -REFERENCE_ROOT=PRESENT -REFERENCE_FILES=84 -REFERENCE_JSON_FILES=0 -REFERENCE_SCHEMA_VERSION=2 -REFERENCE_SECTIONS=24 -REFERENCE_STATUS=CORE_INTERNAL_INVENTORY_READY -REFERENCE_UPDATED_AT=2026-07-22T08:32:24+00:00 -CORE_INTERNAL_COUNTS={'cluster': 1, 'nodes': 3, 'guests': 12, 'containers': 4, 'storage': 2, 'networks': 1, 'dns': 1} -OBSERVED_CLUSTER_RECORDS=1 -OBSERVED_NODES_RECORDS=3 -OBSERVED_GUESTS_RECORDS=12 -OBSERVED_CONTAINERS_RECORDS=4 -OBSERVED_STORAGE_RECORDS=2 -OBSERVED_NETWORKS_RECORDS=1 -OBSERVED_DNS_RECORDS=1 -=== TOOLING_STATE === -REFERENCE_CLI=ABSENT -CLUSTER_REFERENCE_EXECUTION_TRACE=COMPLETE + File "", line 1 + import datetime,json,os,pathlib,re,shutil,socket,subprocess,urllib.request;root=pathlib.Path("/etc/homelab/reference");assert (root/"manifest.json").is_file() and (root/"state/current.json").is_file();u="https://git.gram1.ru/homelab-admin/homelab-public-context/raw/commit/321a330f9e5c8696e6e8bf1e147ce5386f3de352/runtime/history/CLUSTER-REFERENCE-CORE-INVENTORY-156.json";prev=json.load(urllib.request.urlopen(urllib.request.Request(u,headers={"User-Agent":"homelab-reference/3"}),timeout=60));assert prev.get("command_id")=="CLUSTER-REFERENCE-CORE-INVENTORY-156" and prev.get("status")=="FAIL" and int(prev.get("rc"))==1 and "SyntaxError" in str(prev.get("output",""));manifest=json.loads((root/"manifest.json").read_text(encoding="utf-8"));now=datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0);now_s=now.isoformat();sections=["cluster","nodes",".json").read_text(encoding="utf-8"));now=datetime.datetime.now(datetimeguests","containers","storage","networks","dns"];snap=root/"snapshots"/("core-"+now.strftime("%Y%m%dT%H%M%SZ"));snap.mkdir(parents=True,exist_ok=False);[(shutil.copy2(root/"observed"/(s+".json"),snap/(s+".json"))) for s in sections if (root/"observed"/(s+".json")).is_file()];out=lambda a:subprocess.check_output(a,text=True,stderr=subprocess.STDOUT,timeout=90);txt=lambda a:(lambda r:r.stdout+r.stderr)(subprocess.run(a,stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True,timeout=90,check=False));nodes=json.loads(out(["pvesh","get","/nodes","--output-format","json"]));guests=json.loads(out(["pvesh","get","/cluster/resources","--type","vm","--output-format","json"]));storage=json.loads(out(["pvesh","get","/storage","--output-format","json"]));addresses=json.loads(out(["ip","-j","address"]));routes=json.loads(out(["ip","-j","route","show","table","all"]));slug=lambda v:re.sub("[^a-z0-9._-]+","-",str(v).lower()).strip("-") or "unknown";fresh=lambda s:(now+datetime.timedelta(seconds=int(manifest.get("freshness_seconds",{}).get(s,3600)))).isoformat();decorate=lambda s,x:{**x,"observed_at":now_s,"fresh_until":fresh(s),"source":"core-internal-collector"};resolv=pathlib.Path("/etc/resolv.conf");records={"cluster":[decorate("cluster",{"id":"cluster-homelab","hostname":socket.gethostname(),"kernel":os.uname().release,"pve_version":txt(["pveversion","--verbose"]),"quorum_status":txt(["pvecm","status"])})],"nodes":[decorate("nodes",{**x,"id":"node-"+slug(x.get("node") or x.get("id"))}) for x in nodes],"guests":[decorate("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"),"template":x.get("template"),"uptime":x.get("uptime"),"cpus":x.get("maxcpu"),"memory_bytes":x.get("maxmem"),"disk_bytes":x.get("maxdisk"),"tags":x.get("tags")}) for x in guests],"containers":[decorate("containers",{"id":"container-"+slug(x.get("vmid")),"vmid":x.get("vmid"),"name":x.get("name"),"node":x.get("node"),"status":x.get("status"),"uptime":x.get("uptime"),"cpus":x.get("maxcpu"),"memory_bytes":x.get("maxmem"),"disk_bytes":x.get("maxdisk"),"tags":x.get("tags")}) for x in guests if x.get("type")=="lxc"],"storage":[decorate("storage",{**x,"id":"storage-"+slug(x.get("storage") or x.get("id"))}) for x in storage],"networks":[decorate("networks",{"id":"network-state-"+slug(socket.gethostname()),"hostname":socket.gethostname(),"interfaces":addresses,"routes":routes})],"dns":[decorate("dns",{"id":"resolver-state-"+slug(socket.gethostname()),"hostname":socket.gethostname(),"resolv_conf":resolv.read_text(encoding="utf-8",errors="replace").splitlines() if resolv.is_file() else []})]};[(root/"observed"/(s+".json")).write_text(json.dumps({"schema_version":2,"section":s,"layer":"observed","updated_at":now_s,"source":"core-internal-collector","records":v},ensure_ascii=False,indent=2)+"\n",encoding="utf-8") for s,v in records.items()];state=json.loads((root/"state/current.json").read_text(encoding="utf-8"));state.update({"schema_version":2,"status":"CORE_INTERNAL_INVENTORY_READY","updated_at":now_s,"last_snapshot":str(snap),"core_internal_counts":{s:len(v) for s,v in records.items()},"previous_command_id":"CLUSTER-REFERENCE-CORE-INVENTORY-156","previous_immutable_commit":"321a330f9e5c8696e6e8bf1e147ce5386f3de352"});(root/"state/current.json").write_text(json.dumps(state,ensure_ascii=False,indent=2)+"\n",encoding="utf-8");[json.loads(p.read_text(encoding="utf-8")) for p in root.rglob("*.json")];[os.chmod(p,0o750 if p.is_dir() else 0o640) for p in [root,*root.rglob("*")]];print("PREVIOUS_FAILURE=CONFIRMED");print("REFERENCE_SNAPSHOT="+str(snap));print("CORE_INTERNAL_SECTIONS="+str(len(records)));print("CORE_INTERNAL_RECORDS="+str(sum(len(v) for v in records.values())));print("REFERENCE_STATUS=CORE_INTERNAL_INVENTORY_READY);print("CLUSTER_REFERENCE_CORE_INVENTORY=COMPLETE") + ^ +SyntaxError: closing parenthesis ')' does not match opening parenthesis '[' OUTPUT_END CHAT_OUTPUT_END