In this section
- Spider Maya — V1 Page render · spiders / spider_maya/v1/index.html lines 1–36
- Scan Areas Menu storage · spiders / spider_maya/v1/scripts/scan_areas_menu.py lines 1–235
- Validate ingest · spiders / spider_maya/v1/scripts/validate.py lines 1–103
- Llama Advisory storage · spiders / tools/llama-advisory.mjs lines 1–93
- Maya Hunter render · spiders / tools/maya-hunt/maya-hunter.mjs lines 1–79
- Test Cloud Workflows test · spiders / tools/test-cloud-workflows.mjs lines 1–63
Spider Maya — V1 Page
A web page in Spiders covering battery storage (BESS), solar and cables, and uses data from the data-federation-map-for-GlobalGrid2050-all-repos repository. Published at https://ventusltd.github.io/spiders/spider_maya/v1/.
renderspiders / spider_maya/v1/index.html · lines 1–36 of 36 · Entry point
- What it does
- It draws battery storage (BESS), solar and cables. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage agent_infra (path word 'spider'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief). Domain terms in the code: battery storage (BESS), solar, cables.
- Inputs & outputs
- Out: web page; SVG drawing.
- Downstream impact
- It is itself an entry point, published at https://ventusltd.github.io/spiders/spider_maya/v1/.
- What it achieves
- It responds to click events.
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- spiders · spider_maya/v1 · page
- Uses
- Spider Full Po Test (estate URL), Solar Battery Energy Storage System (BESS) Topology V7 — DC AC LV Topology Review Page (estate URL), Solar Battery Energy Storage System (BESS) Topology V7 — Cable Geometry Visualiser Page (estate URL), Solar Battery Energy Storage System (BESS) Topology V7 — GIS Single-Line Diagram (SLD) Financial Sandbox Page (estate URL), GlobalGrid2050 — Renewable Energy Planning Database (REPD) Grid Atlas v8 Page (estate URL), Dashboard (estate URL), Demonstration Videos (estate URL), GlobalGrid2050 — Solar Battery Energy Storage System (BESS) Topology V7 Page (estate URL), and 1 more
- Used by
- none found
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- spiders@78fc0f90bd5ca73f3d5d7c0e0b7b5712cfe781e5 spider_maya/v1/index.html:1-36 · blob 6c8226fc61ce9134ba69e565586b7c1f45efa234 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: agent_infra · users: ai_agent · canonical: unknown
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<title>spider_maya v1</title>
<style>
:root{--bg:#0b0d12;--panel:#12151c;--line:#262b36;--text:#eef2fb;--muted:#9aa3b5;--cyan:#00e5ff;--gold:#ffd54a;--green:#00ff88;--blue:#3aa0ff;--grey:#9298a6;--shell:1040px}*{box-sizing:border-box}html,body{margin:0;min-height:100%}body{background:radial-gradient(1200px 700px at 50% -10%,rgba(0,229,255,.06),transparent 60%),var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,"Sego … [line shortened here: 3,627 characters; full line on GitHub]
</style>
</head>
<body>
<div class="top"><div class="bar"><div class="brand"><span class="ey">Ventus · Global Grid 2050</span><h1>spider_maya v1</h1></div><span class="src">declared cartridge</span></div><div class="controls"><span class="seg"><button data-action="explore" aria-pressed="true">Explore</button><button data-action="github" aria-pressed="false">GitHub</button><button data-action="external" aria-pressed="fals … [line shortened here: 705 characters; full line on GitHub]
<main class="stage" id="stage"></main>
<script>
const CART={schemaVersion:"spider_maya.declared_cartridge.v1",provenance:"declared",methodState:"human-insertion",nodes:[
{id:"catalogue",label:"spider_maya v1 declared live apps",type:"data",rag:"green",reason:"Human-declared live app cartridge; no guessed doors",gh:"https://github.com/Ventusltd/spiders/tree/main/spider_maya/v1",ext:"https://github.com/Ventusltd/spiders/tree/main/spider_maya/v1"},
{id:"spider-sandbox",label:"Spider Maya · Federation Sandbox",type:"served_surface",rag:"green",reason:"Working federation sandbox live surface",ext:"https://ventusltd.github.io/data-federation-map-for-globalgrid2050-all-repos/dashboard/sandbox/spider_full_po_test.html",gh:"https://github.com/Ventusltd/data-federation-map-for-globalgrid2050-all-repos/blob/main/dashboard/sandbox/spider_full_po_test … [line shortened here: 408 characters; full line on GitHub]
{id:"dc-ac-lv-v7",label:"DC AC LV Topology Review V7",type:"eye_app",rag:"green",reason:"DC AC LV topology review live app",ext:"https://globalgrid2050.com/solar-bess-topology-v7/dc-ac-lv-topology-review/index.html",gh:"https://github.com/Ventusltd/globalgrid2050/blob/main/solar-bess-topology-v7/dc-ac-lv-topology-review/index.html"},
{id:"cable-geometry-v7",label:"Cable Geometry Visualiser V7",type:"eye_app",rag:"green",reason:"Cable geometry visualiser live app",ext:"https://globalgrid2050.com/solar-bess-topology-v7/cable-geometry-visualiser/index.html",gh:"https://github.com/Ventusltd/globalgrid2050/blob/main/solar-bess-topology-v7/cable-geometry-visualiser/index.html"},
{id:"gis-sld-v7",label:"GIS SLD Financial Model Sandbox V7",type:"eye_app",rag:"green",reason:"GIS SLD financial model sandbox live app",ext:"https://globalgrid2050.com/solar-bess-topology-v7/gis-sld-financial-sandbox/index.html",gh:"https://github.com/Ventusltd/globalgrid2050/blob/main/solar-bess-topology-v7/gis-sld-financial-sandbox/index.html"},
{id:"atlas-v8",label:"UK Region V8 Grid Atlas",type:"eye_app",rag:"green",reason:"UK grid atlas / MapLibre region v8 experimental live app",ext:"https://globalgrid2050.com/repd_grid_atlasv8/",gh:"https://github.com/Ventusltd/globalgrid2050/tree/main/repd_grid_atlasv8"},
{id:"pipeline",label:"UK Renewables Pipeline Dashboard",type:"sense_app",rag:"green",reason:"UK renewables pipeline analytics dashboard live app",ext:"https://globalgrid2050.com/uk_renewables_pipeline/dashboard.html",gh:"https://github.com/Ventusltd/globalgrid2050/blob/main/uk_renewables_pipeline/dashboard.html"},
{id:"demo-videos-v7",label:"V7 Demonstration Videos",type:"served_surface",rag:"green",reason:"V7 demonstration videos live surface",ext:"https://globalgrid2050.com/solar-bess-topology-v7/docs/demonstration-videos.html",gh:"https://github.com/Ventusltd/globalgrid2050/blob/main/solar-bess-topology-v7/docs/demonstration-videos.html"},
{id:"workspace-v7",label:"GlobalGrid2050 V7 Workspace Root",type:"served_surface",rag:"green",reason:"Solar BESS topology V7 workspace root",ext:"https://globalgrid2050.com/solar-bess-topology-v7/",gh:"https://github.com/Ventusltd/globalgrid2050/tree/main/solar-bess-topology-v7"},
{id:"bess-gis-sld-v8",label:"BESS GIS SLD Financial Sandbox V8",type:"eye_app",rag:"green",reason:"BESS GIS SLD financial sandbox V8 live app",ext:"https://globalgrid2050.com/solar-bess-topology-v8/bess-gis-sld-financial-sandbox/index.html",gh:"https://github.com/Ventusltd/globalgrid2050/blob/main/solar-bess-topology-v8/bess-gis-sld-financial-sandbox/index.html"},
{id:"v6-grid-machine",label:"UK Energy Tracking V6 Grid Machine",type:"sense_app",rag:"green",reason:"V6 grid machine live app",ext:"https://globalgrid2050.com/uk_energy_tracking_v6/",gh:"https://github.com/Ventusltd/globalgrid2050/tree/main/uk_energy_tracking_v6"},
{id:"v6-generation-history",label:"UK Energy Tracking V6 Generation History",type:"sense_app",rag:"green",reason:"V6 generation history live app",ext:"https://globalgrid2050.com/uk_energy_tracking_v6/generation_history/",gh:"https://github.com/Ventusltd/globalgrid2050/tree/main/uk_energy_tracking_v6/generation_history"}
].map(n=>({...n,provenance:"declared",methodState:"human-insertion",schemaVersion:"spider_maya.declared_cartridge.v1"})),edges:[]};
CART.edges=CART.nodes.slice(1).map(n=>({from:"catalogue",to:n.id,type:"contains",provenance:"declared",methodState:"human-insertion",schemaVersion:CART.schemaVersion}));
const colour={green:"#00ff88",amber:"#ffcc00",red:"#ff5555",blue:"#3aa0ff",grey:"#9298a6"}, badge={data:"DB",eye_app:"EYE",sense_app:"SENSE",served_surface:"PAGE"};let action="explore",view="column";
function target(n){return action==="github"?(n.gh||n.ext):action==="external"?(n.ext||n.gh):null}function card(n,cls=""){const go=target(n)?'<span class="go">open ↗</span>':'';return `<div class="card ${cls}" data-id="${n.id}"><div class="row"><span class="badge">${badge[n.type]||"NODE"}</span><span class="name">${n.label}</span><span class="dot" style="color:${colour[n.rag]||colour.grey}"></span> … [line shortened here: 564 characters; full line on GitHub]
function openNode(id){const n=CART.nodes.find(x=>x.id===id);const t=target(n);if(t) window.open(t,"_blank","noopener")}function draw(){const stage=document.getElementById("stage"), root=CART.nodes[0], apps=CART.nodes.slice(1);if(view==="column"){stage.innerHTML=card(root,"focus")+`<div class="sect">Contains → ${apps.length} declared live doors</div><div class="grid">${apps.map(n=>card(n)).join("") … [line shortened here: 1,188 characters; full line on GitHub]
document.querySelectorAll("[data-action]").forEach(b=>b.onclick=()=>{action=b.dataset.action;document.querySelectorAll("[data-action]").forEach(x=>x.setAttribute("aria-pressed",String(x===b)));draw()});document.querySelectorAll("[data-view]").forEach(b=>b.onclick=()=>{view=b.dataset.view;document.querySelectorAll("[data-view]").forEach(x=>x.setAttribute("aria-pressed",String(x===b)));draw()});draw … [line shortened here: 403 characters; full line on GitHub]
</script>
</body>
</html>Scan Areas Menu
A Python command-line tool in the scripts folder of Spiders that fetches sources, using SHA-256 from the GlobalGrid2050 repository.
storagespiders / spider_maya/v1/scripts/scan_areas_menu.py · lines 1–235 of 235 · Entry point · pattern stable_id (shared by 2 files)
- What it does
- It fetches sources. Defines 12 functions or classes, including slug, stable_id, fetch_text, source_url, extract_areas_block. Uses libraries __future__, argparse, hashlib, json, re. Side effects: reads or writes files; makes network requests.
- Why it exists in the grid workflow
- Domain stage agent_infra (path word 'spider'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Inputs & outputs
- In: data source: globalgrid2050 data; JSON file sources.json; JSON file nodes.json; JSON file edges.json; command-line arguments.
- Downstream impact
- Used directly by 1 file: Spider Maya V1 Scan Workflow (spiders).
- What it achieves
- It fetches text (`fetch_text`), extracts areas block (`extract_areas_block`) and parses areas (`parse_areas`). Build a declared `spider_maya` graph from the GlobalGrid2050 AREAS menu. It writes `nodes.json`. It accepts `--globalgrid-ref` and `--input-html`.
- Why it matters
- Run by Spider Maya V1 Scan Workflow.
- Application
- spiders · spider_maya/v1/scripts · Python CLI
- Uses
- __future__, argparse, hashlib, json, re, sys, urllib.request, datetime
- Used by
- run by Spider Maya V1 Scan Workflow (workflow run)
- Produces
- slug, stable_id, fetch_text, source_url, extract_areas_block, parse_areas, node, edge, build_graph, write_json, logical_hash, main
- Defines here
- slug, stable_id, fetch_text, source_url, extract_areas_block, parse_areas, node, edge, build_graph, write_json, logical_hash, main
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- spiders@78fc0f90bd5ca73f3d5d7c0e0b7b5712cfe781e5 spider_maya/v1/scripts/scan_areas_menu.py:1-235 · blob b5526495e655c2e1acc946d1704af67bc45b996d · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: filesystem, network · domain stage: agent_infra · users: ai_agent · canonical: supporting_data
#!/usr/bin/env python3
"""Build a declared spider_maya graph from the globalgrid2050 AREAS menu.
This scanner is intentionally conservative. It reads only the hand-authored
AREAS menu from the GlobalGrid2050 homepage and emits declared graph rows.
It does not perform git-tree discovery, URL probing, dependency inference or
promotion of derived facts.
"""
from __future__ import annotations
import argparse
import hashlib
import json
import re
import sys
import urllib.request
from datetime import datetime, timezone
from pathlib import Path
from urllib.parse import urljoin
ROOT = Path(__file__).resolve().parents[1]
CONFIG_PATH = ROOT / "config" / "sources.json"
DERIVED_DIR = ROOT / "data" / "derived"
AUDIT_DIR = ROOT / "audit"
SCHEMA_VERSION = "spider-graph/1.0.0"
AREA_RE = re.compile(r'^\s*\{\s*name:\s*"(?P<name>[^"]+)"\s*,\s*children:\s*\[')
ROW_RE = re.compile(
r'^\s*\{\s*name:\s*"(?P<name>[^"]+)"\s*,\s*url:\s*"(?P<url>[^"]+)"'
r'(?:\s*,\s*note:\s*"(?P<note>[^"]+)")?\s*\}\s*,?\s*$'
)
DIRECT_RE = re.compile(r'^\s*\{\s*name:\s*"(?P<name>[^"]+)"\s*,\s*url:\s*"(?P<url>[^"]+)"')
def slug(value: str) -> str:
value = value.strip().lower()
value = re.sub(r"[^a-z0-9]+", "-", value)
return value.strip("-") or "unnamed"
def stable_id(prefix: str, value: str) -> str:
return f"{prefix}:{slug(value)}"
def fetch_text(url: str) -> str:
req = urllib.request.Request(url, headers={"User-Agent": "spider-maya-v1"})
with urllib.request.urlopen(req, timeout=30) as response:
return response.read().decode("utf-8")
def source_url(ref: str) -> str:
return f"https://raw.githubusercontent.com/Ventusltd/globalgrid2050/{ref}/index.html"
def extract_areas_block(html: str) -> str:
marker = "const AREAS = ["
start = html.find(marker)
if start < 0:
raise ValueError("Could not find const AREAS = [ in homepage")
start = html.find("[", start)
if start < 0:
raise ValueError("Could not find opening AREAS bracket")
depth = 0
for idx in range(start, len(html)):
char = html[idx]
if char == "[":
depth += 1
elif char == "]":
depth -= 1
if depth == 0:
return html[start : idx + 1]
raise ValueError("Could not find closing AREAS bracket")
def parse_areas(block: str) -> list[dict]:
areas: list[dict] = []
current: dict | None = None
for line in block.splitlines():
area = AREA_RE.match(line)
if area:
current = {"name": area.group("name"), "children": []}
areas.append(current)
continue
if current is not None:
row = ROW_RE.match(line)
if row:
child = {"name": row.group("name"), "url": row.group("url")}
if row.group("note"):
child["note"] = row.group("note")
current["children"].append(child)
continue
if line.strip().startswith("},") or line.strip().startswith("}]}"):
current = None
continue
direct = DIRECT_RE.match(line)
if direct and current is None:
areas.append({"name": direct.group("name"), "url": direct.group("url"), "children": []})
return areas
def node(node_id: str, kind: str, node_type: str, label: str, attrs: dict, source: str, run_id: str) -> dict:
return {
"id": node_id,
"kind": kind,
"type": node_type,
"label": label,
"attrs": attrs,
"provenance": "declared",
"methodState": "areas_menu_v1",
"schemaVersion": SCHEMA_VERSION,
"source": source,
"firstSeenRun": run_id,
"lastSeenRun": run_id,
}
def edge(edge_id: str, source_id: str, target_id: str, rel: str, source: str, run_id: str) -> dict:
return {
"id": edge_id,
"source": source_id,
"target": target_id,
"rel": rel,
"provenance": "declared",
"methodState": "areas_menu_v1",
"schemaVersion": SCHEMA_VERSION,
"sourceLabel": source,
"firstSeenRun": run_id,
"lastSeenRun": run_id,
}
def build_graph(areas: list[dict], pages_base_url: str, run_id: str) -> tuple[list[dict], list[dict]]:
nodes: dict[str, dict] = {}
edges: dict[str, dict] = {}
root_id = "repo:globalgrid2050"
nodes[root_id] = node(
root_id,
"repo",
"monolith",
"globalgrid2050",
{"repository": "Ventusltd/globalgrid2050", "pagesBaseUrl": pages_base_url},
"AREAS menu",
run_id,
)
for area in areas:
area_id = stable_id("area", f"globalgrid2050/{area['name']}")
nodes[area_id] = node(area_id, "area", "homepage_menu_area", area["name"], {}, "AREAS menu", run_id)
e_id = f"e:contains:{root_id}->{area_id}"
edges[e_id] = edge(e_id, root_id, area_id, "contains", "AREAS menu", run_id)
for child in area.get("children", []):
url = child["url"]
clean_path = url.replace("./", "", 1)
app_id = stable_id("app", f"globalgrid2050/{clean_path}")
attrs = {
"path": clean_path,
"declaredUrl": url,
"liveUrl": urljoin(pages_base_url, clean_path),
}
if child.get("note"):
attrs["devStatus"] = child["note"]
nodes[app_id] = node(app_id, "app", "launch_surface", child["name"], attrs, "AREAS menu", run_id)
contains_id = f"e:contains:{area_id}->{app_id}"
edges[contains_id] = edge(contains_id, area_id, app_id, "contains", "AREAS menu", run_id)
launch_id = f"e:declares_launch_surface:{app_id}->{app_id}"
edges[launch_id] = edge(launch_id, app_id, app_id, "declares_launch_surface", "AREAS menu", run_id)
return sorted(nodes.values(), key=lambda r: r["id"]), sorted(edges.values(), key=lambda r: r["id"])
def write_json(path: Path, value) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(json.dumps(value, ensure_ascii=False, indent=2, sort_keys=True) + "\n", encoding="utf-8")
def logical_hash(rows: list[dict]) -> str:
canonical = json.dumps(rows, ensure_ascii=False, sort_keys=True, separators=(",", ":"))
return hashlib.sha256(canonical.encode("utf-8")).hexdigest()
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("--globalgrid-ref", default=None, help="Git ref for Ventusltd/globalgrid2050 index.html")
parser.add_argument("--input-html", default=None, help="Optional local index.html path for offline tests")
args = parser.parse_args()
cfg = json.loads(CONFIG_PATH.read_text(encoding="utf-8"))
src = cfg["sources"]["globalgrid2050Homepage"]
ref = args.globalgrid_ref or src["defaultRef"]
run_id = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
if args.input_html:
html = Path(args.input_html).read_text(encoding="utf-8")
source_ref = f"local:{args.input_html}"
else:
source_ref = source_url(ref)
html = fetch_text(source_ref)
areas = parse_areas(extract_areas_block(html))
nodes, edges = build_graph(areas, src["pagesBaseUrl"], run_id)
write_json(DERIVED_DIR / "nodes.json", nodes)
write_json(DERIVED_DIR / "edges.json", edges)
audit = {
"runId": run_id,
"source": source_ref,
"schemaVersion": SCHEMA_VERSION,
"areas": len(areas),
"nodes": len(nodes),
"edges": len(edges),
"nodeHash": logical_hash(nodes),
"edgeHash": logical_hash(edges),
"provenance": {"declared": len(nodes) + len(edges), "derived": 0},
}
write_json(AUDIT_DIR / f"{run_id}.json", audit)
md = [
f"# spider_maya v1 scan receipt {run_id}",
"",
f"Source: `{source_ref}`",
"",
f"Areas: {audit['areas']}",
f"Nodes: {audit['nodes']}",
f"Edges: {audit['edges']}",
"Derived rows: 0",
f"Node logical hash: `{audit['nodeHash']}`",
f"Edge logical hash: `{audit['edgeHash']}`",
"",
"This run reads only the declared GlobalGrid2050 AREAS menu.",
]
(AUDIT_DIR / f"{run_id}.md").write_text("\n".join(md) + "\n", encoding="utf-8")
print(json.dumps(audit, indent=2))
return 0
if __name__ == "__main__":
raise SystemExit(main())Validate
A Python command-line tool in the scripts folder of Spiders that reads sources. It validates nodes (`validate_nodes`), validates edges (`validate_edges`) and validates config (`validate_config`).
ingestspiders / spider_maya/v1/scripts/validate.py · lines 1–103 of 103 · Entry point
- What it does
- It loads sources. Defines 6 functions or classes, including load, assert_unique, validate_nodes, validate_edges, validate_config. Uses libraries __future__, json, sys, collections, pathlib. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage agent_infra (path word 'spider'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Inputs & outputs
- In: JSON file sources.json; JSON file nodes.json; JSON file edges.json.
- Downstream impact
- Used directly by 1 file: Spider Maya V1 Scan Workflow (spiders).
- What it achieves
- Validate `spider_maya` v1 graph artefacts.
- Why it matters
- Run by Spider Maya V1 Scan Workflow.
- Application
- spiders · spider_maya/v1/scripts · Python CLI
- Uses
- __future__, json, sys, collections, pathlib
- Used by
- run by Spider Maya V1 Scan Workflow (workflow run)
- Produces
- load, assert_unique, validate_nodes, validate_edges, validate_config, main
- Defines here
- load, assert_unique, validate_nodes, validate_edges, validate_config, main
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- spiders@78fc0f90bd5ca73f3d5d7c0e0b7b5712cfe781e5 spider_maya/v1/scripts/validate.py:1-103 · blob c54300dbda48d3ee1a472c2e970ae8b2bc44a637 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: ingest · effects: filesystem · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/usr/bin/env python3
"""Validate spider_maya v1 graph artefacts.
This validator is deliberately small and strict. It validates the renderer-ready
JSON payloads emitted by scan_areas_menu.py and checks that v1 contains only
legal provenance states.
"""
from __future__ import annotations
import json
import sys
from collections import Counter
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
DERIVED_DIR = ROOT / "data" / "derived"
CONFIG_PATH = ROOT / "config" / "sources.json"
LEGAL_NODE_KINDS = {"repo", "area", "app", "surface", "file", "dataset", "external_source", "workflow"}
LEGAL_RELS = {"contains", "serves", "declares_launch_surface", "depends_on", "references_source", "data_feed", "child_scope"}
LEGAL_PROVENANCE = {"declared", "derived"}
REQUIRED_NODE_KEYS = {"id", "kind", "type", "label", "attrs", "provenance", "methodState", "schemaVersion", "source"}
REQUIRED_EDGE_KEYS = {"id", "source", "target", "rel", "provenance", "methodState", "schemaVersion"}
def load(path: Path):
if not path.exists():
raise AssertionError(f"Missing required file: {path}")
return json.loads(path.read_text(encoding="utf-8"))
def assert_unique(rows: list[dict], field: str, label: str) -> None:
counts = Counter(row[field] for row in rows)
dupes = [key for key, count in counts.items() if count > 1]
if dupes:
raise AssertionError(f"Duplicate {label} {field}: {dupes[:10]}")
def validate_nodes(nodes: list[dict]) -> None:
if not isinstance(nodes, list) or not nodes:
raise AssertionError("nodes.json must be a non-empty array")
assert_unique(nodes, "id", "node")
ids = [row["id"] for row in nodes]
if ids != sorted(ids):
raise AssertionError("nodes.json is not sorted by id")
for row in nodes:
missing = REQUIRED_NODE_KEYS - row.keys()
if missing:
raise AssertionError(f"Node {row.get('id')} missing keys {sorted(missing)}")
if row["kind"] not in LEGAL_NODE_KINDS:
raise AssertionError(f"Node {row['id']} has illegal kind {row['kind']}")
if row["provenance"] not in LEGAL_PROVENANCE:
raise AssertionError(f"Node {row['id']} has illegal provenance {row['provenance']}")
if not isinstance(row["attrs"], dict):
raise AssertionError(f"Node {row['id']} attrs must be an object")
def validate_edges(edges: list[dict], node_ids: set[str]) -> None:
if not isinstance(edges, list) or not edges:
raise AssertionError("edges.json must be a non-empty array")
assert_unique(edges, "id", "edge")
ids = [row["id"] for row in edges]
if ids != sorted(ids):
raise AssertionError("edges.json is not sorted by id")
for row in edges:
missing = REQUIRED_EDGE_KEYS - row.keys()
if missing:
raise AssertionError(f"Edge {row.get('id')} missing keys {sorted(missing)}")
if row["rel"] not in LEGAL_RELS:
raise AssertionError(f"Edge {row['id']} has illegal rel {row['rel']}")
if row["provenance"] not in LEGAL_PROVENANCE:
raise AssertionError(f"Edge {row['id']} has illegal provenance {row['provenance']}")
if row["source"] not in node_ids:
raise AssertionError(f"Edge {row['id']} source missing node {row['source']}")
if row["target"] not in node_ids:
raise AssertionError(f"Edge {row['id']} target missing node {row['target']}")
def validate_config() -> None:
cfg = load(CONFIG_PATH)
loved = cfg["sources"]["lovedSpiderPage"]
if loved["path"] != "dashboard/sandbox/spider_full_po_test.html":
raise AssertionError("Loved page source path changed")
if not loved.get("gitBlobSha"):
raise AssertionError("Loved page git blob SHA missing")
def main() -> int:
validate_config()
nodes = load(DERIVED_DIR / "nodes.json")
edges = load(DERIVED_DIR / "edges.json")
validate_nodes(nodes)
validate_edges(edges, {row["id"] for row in nodes})
print(json.dumps({"status": "pass", "nodes": len(nodes), "edges": len(edges)}, indent=2))
return 0
if __name__ == "__main__":
try:
raise SystemExit(main())
except Exception as exc:
print(f"VALIDATION FAIL: {exc}", file=sys.stderr)
raiseLlama Advisory
A JavaScript module in the tools folder of Spiders that reads bounded (`readBounded`), using SHA-256. It reads bounded (`readBounded`) and is built from the atomic JSON helper (`atomicJson`).
storagespiders / tools/llama-advisory.mjs · lines 1–93 of 93 · Entry point · pattern readBounded (shared by 2 files)
- What it does
- It loads data. Defines option, readBounded, hash, atomicJson. Uses libraries node:crypto, node:fs, node:path. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'spiders'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Inputs & outputs
- In: command-line arguments.
- Downstream impact
- Used directly by 1 file: Llama Advisory Workflow (spiders).
- What it achieves
- Defines `option`, `readBounded`, `hash` and 1 more.
- Why it matters
- Run by Llama Advisory Workflow.
- Application
- spiders · tools · JavaScript module
- Uses
- node:crypto, node:fs, node:path
- Used by
- run by Llama Advisory Workflow (workflow run)
- Produces
- option, readBounded, hash, atomicJson
- Defines here
- option, readBounded, hash, atomicJson
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- spiders@78fc0f90bd5ca73f3d5d7c0e0b7b5712cfe781e5 tools/llama-advisory.mjs:1-93 · blob b391d7f2d581169c5b366344466f806b8ef76bc1 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: filesystem · domain stage: agent_infra · users: ai_agent · canonical: supporting_data
#!/usr/bin/env node
import { createHash } from 'node:crypto';
import { mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
const [mode, ...args] = process.argv.slice(2);
const option = name => {
const index = args.indexOf(name);
if (index < 0 || !args[index + 1]) throw new Error(`missing ${name}`);
return resolve(args[index + 1]);
};
const readBounded = (path, limit) => {
const bytes = statSync(path).size;
if (bytes > limit) throw new Error(`${path} is ${bytes} bytes; limit is ${limit}`);
return readFileSync(path);
};
const hash = bytes => createHash('sha256').update(bytes).digest('hex');
const atomicJson = (path, value) => {
mkdirSync(dirname(path), { recursive: true });
writeFileSync(path, JSON.stringify(value, null, 2) + '\n');
};
if (mode === 'prepare') {
const programPath = option('--program');
const validationPath = option('--validation');
const outputPath = option('--out');
const programBytes = readBounded(programPath, 131072);
const validation = JSON.parse(readBounded(validationPath, 65536));
if (validation.schema !== 'spiders.autonomous-build-receipt.v1'
|| validation.status !== 'pass'
|| validation.program_sha256 !== hash(programBytes)) {
throw new Error('authoritative pre-validation is absent, failed, or bound to different bytes');
}
const program = JSON.parse(programBytes);
const compact = program.queue.map(item => ({
slot: item.slot, lane: item.lane, state: item.state, qualifies: item.qualifies,
commit: item.commit, improvement: item.improvement,
tests: item.tests.map(test => ({ command: test.command, result: test.result })),
}));
const prompt = [
'You are an advisory fault finder. You have no authority to pass, fail, edit, run, or promote anything.',
'Inspect only the supplied data. Return at most 12 concise bullets. Cite slot numbers and fields.',
'Look for inconsistent identities, false-green claims, missing receipts, duplicate work, and broken state delivery.',
'Treat pending review as pending. Never upgrade a state. If no issue is supported, say no supported issue.',
'',
JSON.stringify({
schema: program.schema,
program_id: program.program_id,
program_sha256: validation.program_sha256,
promotion: program.promotion,
state_delivery: program.state_delivery,
retained_attempts: program.retained_attempts,
queue: compact,
}),
].join('\n');
const bytes = Buffer.from(prompt);
if (bytes.length > 65536) throw new Error(`prompt is ${bytes.length} bytes; limit is 65536`);
mkdirSync(dirname(outputPath), { recursive: true });
writeFileSync(outputPath, bytes);
console.log(JSON.stringify({ mode, bytes: bytes.length, sha256: hash(bytes) }));
} else if (mode === 'seal') {
const promptPath = option('--prompt');
const outputPath = option('--output');
const statusPath = option('--runtime-status');
const receiptPath = option('--receipt');
const prompt = readBounded(promptPath, 65536);
const output = readBounded(outputPath, 32768);
const runtimeStatus = readBounded(statusPath, 4096);
atomicJson(receiptPath, {
schema: 'spiders.llama-advisory-receipt.v1',
authority: 'advisory-only',
can_change_gate: false,
prompt: { bytes: prompt.length, sha256: hash(prompt) },
output: { bytes: output.length, sha256: hash(output) },
runtime_status: { bytes: runtimeStatus.length, sha256: hash(runtimeStatus), value: runtimeStatus.toString('utf8').trim() },
});
console.log(JSON.stringify({ mode, receipt: receiptPath }));
} else if (mode === 'validate') {
const receipt = JSON.parse(readBounded(option('--receipt'), 65536));
const prompt = readBounded(option('--prompt'), 65536);
const output = readBounded(option('--output'), 32768);
const status = readBounded(option('--runtime-status'), 4096);
const errors = [];
if (receipt.schema !== 'spiders.llama-advisory-receipt.v1') errors.push('unknown receipt schema');
if (receipt.authority !== 'advisory-only' || receipt.can_change_gate !== false) errors.push('advisory authority boundary changed');
for (const [name, bytes] of [['prompt', prompt], ['output', output], ['runtime_status', status]]) {
if (receipt[name]?.bytes !== bytes.length || receipt[name]?.sha256 !== hash(bytes)) errors.push(`${name} hash/size mismatch`);
}
if (errors.length) throw new Error(errors.join('; '));
console.log(JSON.stringify({ mode, status: 'pass', output_sha256: receipt.output.sha256 }));
} else {
throw new Error('usage: llama-advisory.mjs prepare|seal|validate ...');
}Maya Hunter
A JavaScript module in the maya hunt folder of Spiders that fetches blocks, reactions, maya cards and solar from the ventus-grid-engine and stars repositories.
renderspiders / tools/maya-hunt/maya-hunter.mjs · lines 1–79 of 79 · Entry point · pattern blockOf (shared by 3 files)
- What it does
- It fetches blocks, reactions, maya cards and solar. Defines now, get, blockOf, compatOf. Uses libraries node:fs. Side effects: reads or writes files; makes network requests.
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'spiders'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief). Domain terms in the code: solar. README: "`maya-hunter.mjs` (read-only, no network writes) reads the VENTUS GRID ENGINE manifest (https://ventusltd.github.io/ventus-grid-engine/spider/manifest.json) and every registered graph, finds every leaf (out-degree 0), and writes `data/maya-cards.json`: for each dead end, its function, purpose, relationships and reason for existing, plus a next click (its periodic-table block, its source, or back to its parent)."
- Inputs & outputs
- In: data source: ventus-grid-engine data; data source: stars data; JSON file blocks.json; JSON file reactions.json; command-line arguments. Out: JSON file maya-cards.json.
- Downstream impact
- Used directly by 1 file: Maya Hunt Workflow (spiders).
- What it achieves
- It is built from the now step (`now`), the get step (`get`) and the block of helper (`blockOf`). Hunt every dead end (leaf node) across all registered Spider graphs and assign each a Maya card that explains its function, purpose, relationships and reason for existing. It writes `/maya-cards.json`.
- Why it matters
- Run by Maya Hunt Workflow.
- Application
- spiders · tools/maya-hunt · JavaScript module
- Uses
- Stars — Index Page (estate URL), node:fs
- Used by
- run by Maya Hunt Workflow (workflow run)
- Produces
- now, get, blockOf, compatOf
- Defines here
- now, get, blockOf, compatOf
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- spiders@78fc0f90bd5ca73f3d5d7c0e0b7b5712cfe781e5 tools/maya-hunt/maya-hunter.mjs:1-79 · blob 51466ca9ac9d88100901f4b552e5b0de295d883e · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: filesystem, network · domain stage: agent_infra · users: ai_agent · canonical: unknown
// maya-hunter.mjs — hunt every dead end (leaf node) across all registered Spider graphs and assign each
// a Maya card that explains its function, purpose, relationships and reason for existing.
// Reads only; writes maya-cards.json + MAYA-REPORT.md. Run weekly (see maya-cards.yml) or on demand.
// Usage: node maya-hunter.mjs [outDir] (default: Dropbox/GLOBALGRID2050-LAB-FINDINGS/maya)
import fs from 'node:fs';
const OUT = process.argv[2] || 'C:/Users/vikra/Dropbox/GLOBALGRID2050-LAB-FINDINGS/maya';
fs.mkdirSync(OUT, { recursive: true });
const DASH = 'https://ventusltd.github.io/ventus-grid-engine/';
const STARS = 'https://ventusltd.github.io/stars/';
const now = () => new Date().toISOString().replace(/\.\d+Z$/, 'Z');
const get = async (u) => { const r = await fetch(u, { cache: 'no-cache' }); if (!r.ok) throw new Error(u + ' ' + r.status); return r.json(); };
const TYPE_IS = { element:'a value the code keeps', constant:'a value the whole platform must agree on', canonical:'the one true copy of a piece of code, the one others should import', copy:'a copy of code that also lives elsewhere', fragment:'a fragment of code found inside a file', reference:'a reference copy kept for comparison', cartridge:'a plug-in part of the interactive GridAtlas map', app: … [line shortened here: 1,073 characters; full line on GitHub]
const CLASS_DOES = { Data:'holds information the platform reads and writes', Computation:'works something out from numbers', Flow:'moves data from one place to another', Movement:'moves the map or the view', Structure:'holds everything in place' };
const GRID_PURPOSE = { geodesy:'turns coordinates into real distances and bearings', 'grid-network':'models substations, circuits and ratings', capacity:'decides whether a project can connect, and how much', cartridges:'a plug-in part of the map every project is seen on', layers:'a map layer the reader can turn on', pages:'a page a non-coder uses to read the estate', constants:'a value the whole p … [line shortened here: 667 characters; full line on GitHub]
const manifest = await get(DASH + 'spider/manifest.json');
let blocks = {}, reactions = [];
try { const b = await get(STARS + 'blocks/blocks.json'); for (const x of b.blocks) blocks[x.symbol] = x; } catch (e) {}
try { const r = await get(STARS + 'blocks/reactions.json'); reactions = r.reactions || []; } catch (e) {}
const blockOf = (label) => { const m = String(label || '').match(/^([A-Z][a-z]?\d?)\s/); return m ? blocks[m[1]] : null; };
const compatOf = (sym) => reactions.filter(p => p.a === sym || p.b === sym).map(p => ({ other: p.a === sym ? p.b : p.a, verdict: p.verdict, basis: p.basis })).slice(0, 6);
const cards = {}; let leafCount = 0, nodeCount = 0; const perGraph = [];
for (const g of manifest.graphs) {
const url = g.path.startsWith('http') ? g.path : DASH + g.path.replace(/^\.\//, '');
let raw; try { raw = await get(url); } catch (e) { perGraph.push({ id: g.id, error: e.message }); continue; }
const nodes = Array.isArray(raw) ? raw : raw.nodes;
if (!Array.isArray(nodes) || !nodes.length || typeof nodes[0] !== 'object') { perGraph.push({ id: g.id, skipped: 'not a node graph' }); continue; }
let edges = (raw.edges || raw.links || []);
if (g.edges_path) { try { edges = await get(g.edges_path.startsWith('http') ? g.edges_path : DASH + g.edges_path.replace(/^\.\//, '')); } catch (e) {} }
const id2i = {}; nodes.forEach((n, i) => { id2i[n.id !== undefined ? n.id : i] = i; });
const out = new Array(nodes.length).fill(0), parents = new Array(nodes.length).fill(null);
for (const e of edges) {
const f = e.from !== undefined ? e.from : e.source, t = e.to !== undefined ? e.to : e.target;
const fi = id2i[f] ?? (typeof f === 'number' ? f : null), ti = id2i[t] ?? (typeof t === 'number' ? t : null);
if (fi != null) out[fi]++; if (ti != null && parents[ti] == null) parents[ti] = fi;
}
const gcards = {};
nodes.forEach((n, i) => {
nodeCount++;
if (out[i] !== 0) return; // not a dead end
leafCount++;
const b = blockOf(n.label);
const cls = String(n.reason || '').split('·').map(x => x.trim()).find(x => CLASS_DOES[x]);
const parent = parents[i] != null ? nodes[parents[i]] : null;
const compat = b ? compatOf(b.symbol) : [];
// the four faces the card must explain
const fn = b ? (b.description || TYPE_IS[n.type] || 'part of the estate') : (TYPE_IS[n.type] || 'part of the estate');
const purpose = b && GRID_PURPOSE[b.category] ? GRID_PURPOSE[b.category] : (cls ? CLASS_DOES[cls] : 'part of how the estate is read and checked');
const rel = [];
if (parent) rel.push('classified under ' + parent.label + (out[parents[i]] ? ' (with ' + (out[parents[i]] - 1) + ' siblings)' : ''));
if (b && (b.depends_on || []).length) rel.push('depends on ' + b.depends_on.slice(0, 4).map(d => d.symbol).join(', '));
if (b && (b.used_by || []).length) rel.push('used by ' + b.used_by.slice(0, 4).join(', '));
if (compat.length) rel.push('proven to work with ' + compat.map(c => c.other).join(', '));
const reason = b
? `${n.type === 'canonical' ? 'The canonical home' : 'One form'} of ${b.title}; first written ${(b.first_written || '').slice(0, 10) || 'unknown'}, lives in ${(b.repos || []).map(r => r.split('/')[1]).join(', ') || 'the estate'}${b.functions ? `, ${b.functions} functions inside` : ''}.`
: `A ${n.type || 'part'} recorded because it exists in the code; ${n.rag === 'red' ? 'currently failing, kept visible so it is not hidden' : n.rag === 'amber' ? 'not yet settled' : 'in good standing'}.`;
const next = b ? { label: 'See it on the periodic table', href: STARS + 'table.html?block=' + b.symbol }
: n.ext ? { label: 'Open the reference', href: n.ext }
: n.gh ? { label: 'Read the source', href: n.gh }
: parent ? { label: 'Back to ' + parent.label, focus: parent.label } : null;
gcards[n.label] = {
label: n.label, type: n.type, rag: n.rag,
function: fn, purpose, relationships: rel, reason,
next, backTo: parent ? parent.label : null
};
});
cards[g.id] = gcards;
perGraph.push({ id: g.id, title: g.title, nodes: nodes.length, deadEnds: Object.keys(gcards).length });
}
const outObj = { generated_utc: now(), source: 'maya-hunter.mjs', note: 'A Maya card for every dead end (leaf) in every registered graph: what it is, its function, its purpose, its relationships, and its reason for existing. The dashboard reads this to explain a leaf and offer a next click.', counts: { graphs: manifest.graphs.length, nodes: nodeCount, deadEnds: leafCount }, perGraph, cards };
fs.writeFileSync(OUT + '/maya-cards.json', JSON.stringify(outObj, null, 1));
const md = `# Maya cards — dead ends hunted and explained\n\nGenerated ${now()} by maya-hunter.mjs.\n\n**${leafCount} dead ends** across ${manifest.graphs.length} graphs (${nodeCount} nodes total) each now carry a Maya card.\n\n| graph | title | nodes | dead ends |\n|---|---|---|---|\n${perGraph.map(p => `| ${p.id} | ${p.title || ''} | ${p.nodes ?? '-'} | ${p.deadEnds ?? (p.error ? 'ERROR ' + p.er … [line shortened here: 635 characters; full line on GitHub]
fs.writeFileSync(OUT + '/MAYA-REPORT.md', md);
console.log(`DONE: ${leafCount} dead ends carded across ${manifest.graphs.length} graphs; ${nodeCount} nodes scanned.`);
console.log(perGraph.map(p => ` ${p.id}: ${p.deadEnds ?? (p.error || p.skipped)}`).join('\n'));Test Cloud Workflows
A JavaScript module in the tools folder of Spiders that works with no patch operands (`noPatchOperands`) and pinned actions (`pinnedActions`).
testspiders / tools/test-cloud-workflows.mjs · lines 1–63 of 63 · Entry point · pattern assert (shared by 7 files)
- What it does
- It tests its inputs. Defines read, assert, noPatchOperands, pinnedActions. Uses libraries node:fs. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'spiders'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Downstream impact
- Used directly by 3 files: 60x Program Proof Workflow (spiders); Estate Survey Workflow (spiders); Llama Advisory Workflow (spiders).
- What it achieves
- It is built from the no patch operands helper (`noPatchOperands`) and the pinned actions helper (`pinnedActions`). Defines `read`, `assert`, `noPatchOperands` and 1 more.
- Why it matters
- Run by 60x Program Proof Workflow, Estate Survey Workflow and Llama Advisory Workflow.
- Application
- spiders · tools · JavaScript module
- Uses
- node:fs
- Used by
- run by 60x Program Proof Workflow (workflow run), run by Estate Survey Workflow (workflow run), run by Llama Advisory Workflow (workflow run)
- Produces
- read, assert, noPatchOperands, pinnedActions
- Defines here
- read, assert, noPatchOperands, pinnedActions
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- spiders@78fc0f90bd5ca73f3d5d7c0e0b7b5712cfe781e5 tools/test-cloud-workflows.mjs:1-63 · blob 180a858a3691542d351cb5cf5902fd57fcccda83 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/usr/bin/env node
import { readFileSync } from 'node:fs';
const read = file => readFileSync(file, 'utf8');
const assert = (condition, message) => {
if (!condition) throw new Error(message);
};
const noPatchOperands = (text, file) => {
assert(!/\+\s+(?:--|["'])/.test(text), `${file} contains a stray patch '+' shell operand`);
};
const pinnedActions = (text, file) => {
for (const match of text.matchAll(/uses:\s*([^\s]+)@([^\s#]+)/g))
assert(/^[0-9a-f]{40}$/.test(match[2]), `${file} action ${match[1]} is not pinned to a full commit`);
};
const llamaFile = '.github/workflows/20260904-llama-advisory.yml';
const llama = read(llamaFile);
const llamaTriggers = llama.split('\npermissions:\n', 1)[0];
noPatchOperands(llama, llamaFile);
pinnedActions(llama, llamaFile);
for (const token of [
'workflow_dispatch:', 'default: false', 'push:', '- main', 'contents: read',
'cancel-in-progress: true', 'timeout-minutes: 25',
"github.event_name == 'push' || inputs.enable_advisory",
'ff067f76dd8e9e05f0528056f1274adf01a54d70',
'9217f5db79a29953eb74d5343926648285ec7e67',
'74a4da8c9fdbcd15bd1f6d01d621410d31c6fc00986f5eb687824e7b93d7a9db',
'timeout 180', '--n-predict 384', 'head -c 32768',
]) assert(llama.includes(token), `${llamaFile} missing ${token}`);
assert(!/^\s*schedule:/m.test(llamaTriggers), 'Llama workflow must not schedule itself');
assert(!/actions\/deploy|git push|permissions:\s*[\s\S]*contents:\s*write/.test(llama), 'Llama workflow acquired publication authority');
const proofFile = '.github/workflows/20260904-60x-program-proof.yml';
const proof = read(proofFile);
const proofTriggers = proof.split('\npermissions:\n', 1)[0];
noPatchOperands(proof, proofFile);
pinnedActions(proof, proofFile);
for (const token of ['workflow_dispatch:', 'pull_request:', 'push:', '- main', 'contents: read', 'cancel-in-progress: true', 'persist-credentials: false'])
assert(proof.includes(token), `${proofFile} missing ${token}`);
assert(!/^\s*schedule:/m.test(proofTriggers), '60x proof must not schedule itself');
assert(!/actions\/deploy|git push|contents:\s*write/.test(proof), '60x proof acquired publication authority');
const surveyFile = '.github/workflows/20260904-estate-survey.yml';
const survey = read(surveyFile);
const surveyTriggers = survey.split('\npermissions:\n', 1)[0];
noPatchOperands(survey, surveyFile);
pinnedActions(survey, surveyFile);
for (const token of [
'workflow_dispatch:', 'pull_request:', 'push:', '- main', 'contents: read',
"- 'codex/**'",
'cancel-in-progress: true', 'fail-fast: false', 'max-parallel: 4',
'shard: [0, 1, 2, 3]', 'persist-credentials: false', 'if: always()',
'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1',
'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a',
'actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c',
'tools/test-estate-survey.mjs', 'tools/test-cloud-workflows.mjs',
'estate-survey.mjs registry', 'estate-survey.mjs survey', 'estate-survey.mjs aggregate',
]) assert(survey.includes(token), `${surveyFile} missing ${token}`);
assert(!/^\s*schedule:/m.test(surveyTriggers), 'estate survey must not schedule itself');
assert(!/actions\/deploy|git push|contents:\s*write|continue-on-error|llama|ollama|model[_ -]/i.test(survey),
'estate survey acquired deploy, write, bypass or model authority');
console.log(JSON.stringify({ schema: 'spiders.cloud-workflow-test.v1', status: 'pass', workflows: 3 }));