This commit is contained in:
eddiesoehnel committed 2026-07-25 13:12:23 -06:00
1 parent ca73bd5690
commit e1d8deb861
23 files changed
+1238 -6

No files matched your search

+58 -1
View File
@@ -6,6 +6,7 @@ Outputs:
- public/llms.txt
- public/agents.md
- public/skills.md
- public/.well-known/ai-catalog.json
- public/.well-known/security.txt
- public/.well-known/agent-card.json
"""
@@ -18,6 +19,7 @@ import re
from dataclasses import dataclass
from datetime import date, datetime, timezone
from pathlib import Path
from urllib.parse import urlparse
from xml.etree import ElementTree as ET
@@ -28,6 +30,7 @@ SKILLS_ROOT = REPO_ROOT / "skills-scripts"
HUGO_PUBLIC = REPO_ROOT / "hugo-html-builder" / "public"
SITE_URL = "https://indx.earth"
SITE_DOMAIN = urlparse(SITE_URL).netloc
SITE_TITLE = "iNDX Earth"
PUBLISHER = "Eddie Soehnel"
SECURITY_CONTACT = "https://indx.earth/#contact-us"
@@ -298,6 +301,7 @@ def build_llms_txt(entries: list[SitemapEntry]) -> str:
"",
"## Machine-Readable URLs",
f"- {SITE_URL}/ai-index.json",
f"- {SITE_URL}/.well-known/ai-catalog.json",
f"- {SITE_URL}/sitemap.xml",
"- /data/open/pages/**/chunks.json",
"- /data/open/pages/**/qa.json",
@@ -327,6 +331,7 @@ Canonical site: {SITE_URL}/
## Retrieval Policy
- Use `{SITE_URL}/.well-known/ai-catalog.json` to discover public agent-usable resources.
- Start with `{SITE_URL}/ai-index.json` to understand resources, artifacts, access type, and retrieval priority.
- Use `{SITE_URL}/sitemap.xml` for canonical human-facing URLs.
- Use `/data/open/pages/**/chunks.json` for semantic retrieval and `/data/open/pages/**/qa.json` for question-answer and workflow hints.
@@ -343,6 +348,7 @@ Canonical site: {SITE_URL}/
## Useful Entry Points
- `{SITE_URL}/.well-known/ai-catalog.json`
- `{SITE_URL}/ai-index.json`
- `{SITE_URL}/llms.txt`
{useful_urls}
@@ -375,6 +381,7 @@ def build_agent_card_json() -> str:
"contact": SECURITY_CONTACT,
"license": f"{SITE_URL}/wiki/license/",
"discovery": {
"ai_catalog": f"{SITE_URL}/.well-known/ai-catalog.json",
"ai_index": f"{SITE_URL}/ai-index.json",
"sitemap": f"{SITE_URL}/sitemap.xml",
"llms": f"{SITE_URL}/llms.txt",
@@ -394,6 +401,33 @@ def build_agent_card_json() -> str:
return json.dumps(payload, indent=2, ensure_ascii=False) + "\n"
def build_ai_catalog_json() -> str:
payload = {
"specVersion": "1.0",
"host": {
"displayName": SITE_TITLE,
"identifier": SITE_DOMAIN,
"documentationUrl": f"{SITE_URL}/",
},
"entries": [
{
"identifier": f"urn:air:{SITE_DOMAIN}:dataset:ai-index",
"displayName": "iNDX AI-Readable Knowledge Index",
"type": "application/json",
"url": f"{SITE_URL}/ai-index.json",
"description": "Discovery and routing metadata for public iNDX content and semantic artifacts.",
"tags": ["knowledge", "structured-content", "semantic-retrieval"],
"capabilities": ["KnowledgeDiscovery", "SemanticArtifactRouting"],
"representativeQueries": [
"What public knowledge and structured content are available from iNDX?",
"Where can I retrieve iNDX semantic chunks and question-answer artifacts?",
],
}
],
}
return json.dumps(payload, indent=2, ensure_ascii=False) + "\n"
def skill_title_from_file(path: Path) -> str:
if path.suffix == ".py":
return path.name
@@ -406,6 +440,7 @@ def skill_title_from_file(path: Path) -> str:
def skill_summary_from_file(path: Path) -> str:
known_summaries = {
"ai-catalog-materialization-skill.md": "Create the public ARD ai-catalog.json capability manifest without duplicating the site's knowledge index.",
"ai-index-discovery-materialization-skill.md": "Create the machine-readable ai-index.json discovery and routing layer from markdown, chunks.json, qa.json, and existing index structure.",
"author-content-structuring-skill.md": "Add lightweight semantic structure, front matter, chunk markers, and stable identifiers to human-authored markdown content.",
"cis-guided-semantic-chunk-generation-skill.md": "Create chunks.json semantic retrieval artifacts using the project-selected subset of the CIS envelope.",
@@ -484,10 +519,31 @@ def validate_outputs() -> None:
raise RuntimeError("sitemap.xml is missing changefreq or priority fields")
if f"Sitemap: {SITE_URL}/sitemap.xml" not in read_text(PUBLIC_ROOT / "robots.txt"):
raise RuntimeError("robots.txt does not reference sitemap.xml")
for filename in ("llms.txt", "agents.md", "skills.md", ".well-known/security.txt", ".well-known/agent-card.json"):
for filename in (
"llms.txt",
"agents.md",
"skills.md",
".well-known/ai-catalog.json",
".well-known/security.txt",
".well-known/agent-card.json",
):
path = PUBLIC_ROOT / filename
if not path.exists() or path.stat().st_size == 0:
raise RuntimeError(f"{filename} was not created")
ai_catalog = json.loads(read_text(PUBLIC_ROOT / ".well-known" / "ai-catalog.json"))
if ai_catalog.get("specVersion") != "1.0" or not ai_catalog.get("entries"):
raise RuntimeError("ai-catalog.json is missing its supported specVersion or entries")
for entry in ai_catalog["entries"]:
required = {"identifier", "displayName", "type"}
if not required.issubset(entry):
raise RuntimeError("ai-catalog.json entry is missing required fields")
if not entry["identifier"].startswith(f"urn:air:{SITE_DOMAIN}:"):
raise RuntimeError("ai-catalog.json entry identifier is not anchored to the site domain")
if ("url" in entry) == ("data" in entry):
raise RuntimeError("ai-catalog.json entry must contain exactly one of url or data")
queries = entry.get("representativeQueries", [])
if not 2 <= len(queries) <= 5:
raise RuntimeError("ai-catalog.json entry must contain 2-5 representativeQueries")
for filename in SITEMAP_ROOT_HELPER_FILES:
path = PUBLIC_ROOT / filename
if path.exists() and f"<loc>{SITE_URL}/{filename}</loc>" not in sitemap_text:
@@ -501,6 +557,7 @@ def main() -> None:
write_text(PUBLIC_ROOT / "llms.txt", build_llms_txt(entries))
write_text(PUBLIC_ROOT / "agents.md", build_agents_md(entries))
write_text(PUBLIC_ROOT / "skills.md", build_skills_md())
write_text(PUBLIC_ROOT / ".well-known" / "ai-catalog.json", build_ai_catalog_json())
write_text(PUBLIC_ROOT / ".well-known" / "security.txt", build_security_txt())
write_text(PUBLIC_ROOT / ".well-known" / "agent-card.json", build_agent_card_json())
validate_outputs()