diff --git a/runtime/history/CLUSTER-REFERENCE-RAW-INVENTORY-162.json b/runtime/history/CLUSTER-REFERENCE-RAW-INVENTORY-162.json new file mode 100644 index 0000000..3e514e6 --- /dev/null +++ b/runtime/history/CLUSTER-REFERENCE-RAW-INVENTORY-162.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "channel": "homelab-runtime", + "command_id": "CLUSTER-REFERENCE-RAW-INVENTORY-162", + "status": "OK", + "rc": 0, + "host": "pve01", + "mode": "change", + "component": "reference-update", + "started_at_utc": "2026-07-22T08:55:43Z", + "finished_at_utc": "2026-07-22T08:55:46Z", + "reference_register_checked": true, + "reference_sha256": "5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e", + "error_register_checked": true, + "error_register_sha256": "08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752", + "command_sha256": "fdf890c9434be7e36f93be40a2222e7b7a7e48953ae289d53ebcb4023847d4cb", + "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": "1c5bc93e21bbc62200e05ef26e80adcbc12a773a1d88517b1cf95f7424b09df6", + "sanitized_output_sha256": "1c5bc93e21bbc62200e05ef26e80adcbc12a773a1d88517b1cf95f7424b09df6", + "output_truncated_in_json": false, + "full_sanitized_output_url": "https://git.gram1.ru/.well-known/homelab-runtime/latest.txt", + "output": "PREVIOUS_COMMAND_ID=CLUSTER-REFERENCE-CORE-INVENTORY-161\nPREVIOUS_STATUS=FAIL\nPREVIOUS_RC=1\nPREVIOUS_IMMUTABLE_COMMIT=ebd829897bd530c64c713762a86989b646031956\nPREVIOUS_ERROR_REGISTERED=no\nRAW_INVENTORY_FILES=20\nRAW_INVENTORY_SNAPSHOT=NONE\nCLUSTER_REFERENCE_RAW_INVENTORY=COMPLETE\n" +} diff --git a/runtime/history/CLUSTER-REFERENCE-RAW-INVENTORY-162.txt b/runtime/history/CLUSTER-REFERENCE-RAW-INVENTORY-162.txt new file mode 100644 index 0000000..ec379ac --- /dev/null +++ b/runtime/history/CLUSTER-REFERENCE-RAW-INVENTORY-162.txt @@ -0,0 +1,32 @@ +CHAT_OUTPUT_BEGIN +COMMAND_ID=CLUSTER-REFERENCE-RAW-INVENTORY-162 +STATUS=OK +RC=0 +HOST=pve01 +MODE=change +COMPONENT=reference-update +REFERENCE_REGISTER_CHECK=OK +REFERENCE_SHA256=5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e +ERROR_REGISTER_CHECK=OK +ERROR_REGISTER_SHA256=08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752 +COMMAND_SHA256=fdf890c9434be7e36f93be40a2222e7b7a7e48953ae289d53ebcb4023847d4cb +DUPLICATE_FAILED_COMMAND_BLOCKED=false +EXECUTION_STARTED=true +CHANGES_MADE=true +SANITIZED=yes +SECRETS_INCLUDED=no +PRIVATE_ADDRESSES_INCLUDED=no +RAW_EVIDENCE_SHA256=1c5bc93e21bbc62200e05ef26e80adcbc12a773a1d88517b1cf95f7424b09df6 +SANITIZED_OUTPUT_SHA256=1c5bc93e21bbc62200e05ef26e80adcbc12a773a1d88517b1cf95f7424b09df6 +OUTPUT_BEGIN +PREVIOUS_COMMAND_ID=CLUSTER-REFERENCE-CORE-INVENTORY-161 +PREVIOUS_STATUS=FAIL +PREVIOUS_RC=1 +PREVIOUS_IMMUTABLE_COMMIT=ebd829897bd530c64c713762a86989b646031956 +PREVIOUS_ERROR_REGISTERED=no +RAW_INVENTORY_FILES=20 +RAW_INVENTORY_SNAPSHOT=NONE +CLUSTER_REFERENCE_RAW_INVENTORY=COMPLETE + +OUTPUT_END +CHAT_OUTPUT_END diff --git a/runtime/latest.json b/runtime/latest.json index 50ef589..3e514e6 100644 --- a/runtime/latest.json +++ b/runtime/latest.json @@ -1,19 +1,19 @@ { "schema_version": 1, "channel": "homelab-runtime", - "command_id": "CLUSTER-REFERENCE-CORE-INVENTORY-161", - "status": "FAIL", - "rc": 1, + "command_id": "CLUSTER-REFERENCE-RAW-INVENTORY-162", + "status": "OK", + "rc": 0, "host": "pve01", "mode": "change", "component": "reference-update", - "started_at_utc": "2026-07-22T08:47:05Z", - "finished_at_utc": "2026-07-22T08:47:05Z", + "started_at_utc": "2026-07-22T08:55:43Z", + "finished_at_utc": "2026-07-22T08:55:46Z", "reference_register_checked": true, "reference_sha256": "5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e", "error_register_checked": true, "error_register_sha256": "08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752", - "command_sha256": "9f9a4398c63fdddddd53865e69da2f8af6ff9c9c69398ec28d530d5449d7296e", + "command_sha256": "fdf890c9434be7e36f93be40a2222e7b7a7e48953ae289d53ebcb4023847d4cb", "duplicate_failed_command_blocked": false, "block_reason": null, "execution_started": true, @@ -22,9 +22,9 @@ "secrets_included": false, "private_addresses_included": false, "raw_evidence_retained_locally": true, - "raw_evidence_sha256": "45b8d84f9e819bf717f6a1d7cf029f793f6f32c545ac2a017f9af091da4c2152", - "sanitized_output_sha256": "45b8d84f9e819bf717f6a1d7cf029f793f6f32c545ac2a017f9af091da4c2152", + "raw_evidence_sha256": "1c5bc93e21bbc62200e05ef26e80adcbc12a773a1d88517b1cf95f7424b09df6", + "sanitized_output_sha256": "1c5bc93e21bbc62200e05ef26e80adcbc12a773a1d88517b1cf95f7424b09df6", "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" + "output": "PREVIOUS_COMMAND_ID=CLUSTER-REFERENCE-CORE-INVENTORY-161\nPREVIOUS_STATUS=FAIL\nPREVIOUS_RC=1\nPREVIOUS_IMMUTABLE_COMMIT=ebd829897bd530c64c713762a86989b646031956\nPREVIOUS_ERROR_REGISTERED=no\nRAW_INVENTORY_FILES=20\nRAW_INVENTORY_SNAPSHOT=NONE\nCLUSTER_REFERENCE_RAW_INVENTORY=COMPLETE\n" } diff --git a/runtime/latest.txt b/runtime/latest.txt index 651acb4..ec379ac 100644 --- a/runtime/latest.txt +++ b/runtime/latest.txt @@ -1,7 +1,7 @@ CHAT_OUTPUT_BEGIN -COMMAND_ID=CLUSTER-REFERENCE-CORE-INVENTORY-161 -STATUS=FAIL -RC=1 +COMMAND_ID=CLUSTER-REFERENCE-RAW-INVENTORY-162 +STATUS=OK +RC=0 HOST=pve01 MODE=change COMPONENT=reference-update @@ -9,20 +9,24 @@ REFERENCE_REGISTER_CHECK=OK REFERENCE_SHA256=5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e ERROR_REGISTER_CHECK=OK ERROR_REGISTER_SHA256=08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752 -COMMAND_SHA256=9f9a4398c63fdddddd53865e69da2f8af6ff9c9c69398ec28d530d5449d7296e +COMMAND_SHA256=fdf890c9434be7e36f93be40a2222e7b7a7e48953ae289d53ebcb4023847d4cb 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 +RAW_EVIDENCE_SHA256=1c5bc93e21bbc62200e05ef26e80adcbc12a773a1d88517b1cf95f7424b09df6 +SANITIZED_OUTPUT_SHA256=1c5bc93e21bbc62200e05ef26e80adcbc12a773a1d88517b1cf95f7424b09df6 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 '[' +PREVIOUS_COMMAND_ID=CLUSTER-REFERENCE-CORE-INVENTORY-161 +PREVIOUS_STATUS=FAIL +PREVIOUS_RC=1 +PREVIOUS_IMMUTABLE_COMMIT=ebd829897bd530c64c713762a86989b646031956 +PREVIOUS_ERROR_REGISTERED=no +RAW_INVENTORY_FILES=20 +RAW_INVENTORY_SNAPSHOT=NONE +CLUSTER_REFERENCE_RAW_INVENTORY=COMPLETE OUTPUT_END CHAT_OUTPUT_END