From e44bf4606ecf95a4b7135a59b153814606985392 Mon Sep 17 00:00:00 2001 From: eddiesoehnel Date: Wed, 13 May 2026 14:32:11 -0600 Subject: [PATCH] added and deleted files elsewhere --- README.md | 2 + ...i-index-discovery-materialization-skill.md | 747 -------- .../author-content-structuring-skill.md | 574 ------- specs/systems/build_ai_index.py | 488 ------ specs/systems/chunk-intelligence-signature.md | 1512 ----------------- ...-guided-semantic-chunk-generation-skill.md | 901 ---------- ...tent-structuring-process-overview-skill.md | 251 --- .../semantic-qa-materialization-skill.md | 835 --------- 8 files changed, 2 insertions(+), 5308 deletions(-) delete mode 100644 specs/systems/ai-index-discovery-materialization-skill.md delete mode 100644 specs/systems/author-content-structuring-skill.md delete mode 100644 specs/systems/build_ai_index.py delete mode 100644 specs/systems/chunk-intelligence-signature.md delete mode 100644 specs/systems/cis-guided-semantic-chunk-generation-skill.md delete mode 100644 specs/systems/execute-content-structuring-process-overview-skill.md delete mode 100644 specs/systems/semantic-qa-materialization-skill.md diff --git a/README.md b/README.md index 16a988e..3dba0c4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This is an AI-native, versioned knowledge system with structured discovery, reasoning layers, and an economic access layer. This is the process that would be used to structure content for AI to use. +This repo is an overview and would contain files not in another repo. Specific applications of this process - like publishing a website - would contain more relevant artifacts used for that application. I would clone an existing website publishing repo if I were to build a new website. + It has four fundamental properties: 1. Content is structured at creation diff --git a/specs/systems/ai-index-discovery-materialization-skill.md b/specs/systems/ai-index-discovery-materialization-skill.md deleted file mode 100644 index e20ef2f..0000000 --- a/specs/systems/ai-index-discovery-materialization-skill.md +++ /dev/null @@ -1,747 +0,0 @@ -# Skill: AI Index Discovery Materialization - -Human prompt to complete this skill: - -Using the attached skill, referencing the completed markdown pages, chunks.json files, qa.json files, and README.md process document attached, create the ai-index.json discovery layer for this project. Reference the prior outputs for structural consistency. Also referfenced is the document structure for this corpus so you can properly reference where files exist. - ---- - -# Overview - -This skill generates the: - -`ai-index.json` - -discovery and routing layer for an AI-native publishing system. - -This file acts as: - -- the machine-readable entry point; -- the discovery layer; -- the routing layer; -- the evaluation layer; -- the trust signaling layer; -- the economic discovery layer. - -It helps AI systems determine: - -1. What exists -2. Where it exists -3. Why it matters -4. Why it is trustworthy -5. Whether it is worth retrieving -6. Whether it is worth paying for -7. How to access it - -This layer is intentionally lightweight. - -It is NOT: - -- the full corpus; -- the full CIS envelope; -- the full chunk database; -- a vector database; -- a semantic graph dump. - -Instead: - -`ai-index.json` - -is a discovery-oriented semantic control surface. - -Think of it as: - -- a machine-readable table of contents; -- a discovery manifest; -- a semantic routing layer; -- an AI-native sitemap with intelligence. - ---- - -# Core Architectural Principle - -The ai-index.json file exists to eliminate ambiguity. - -Without it, AI systems must: - -- parse HTML; -- infer structure; -- crawl pages; -- guess importance; -- infer trust; -- infer access methods; -- infer semantic relationships. - -With it: - -the publisher explicitly programs the discovery interface. - ---- - -# Purpose Of ai-index.json - -The ai-index.json layer should help AI systems answer: - -- What knowledge exists? -- What domains does this corpus cover? -- What should I retrieve first? -- What content is high-value? -- What content is authoritative? -- What content is free? -- What content is paywalled? -- What workflows exist? -- What entities are important? -- What systems are connected? -- What is worth paying for? -- What is the best route through this knowledgebase? - ---- - -# Relationship To Other Layers - -## Markdown / HTML - -Human-readable canonical content. - ---- - -## chunks.json - -Semantic retrieval infrastructure. - -Contains: - -- chunk identity; -- semantic segmentation; -- summaries; -- concepts; -- tags; -- retrieval metadata. - ---- - -## qa.json - -Semantic interaction infrastructure. - -Contains: - -- questions; -- reasoning paths; -- workflows; -- synthesis; -- interaction topology. - ---- - -## ai-index.json - -Discovery + routing layer. - -Contains: - -- discovery metadata; -- access metadata; -- trust signals; -- evaluation hints; -- corpus navigation; -- retrieval prioritization; -- economic routing; -- semantic previews. - ---- - -# Important Constraint - -The ai-index.json file should NOT duplicate the full chunks or QA datasets. - -It should contain: - -decision-enabling metadata only. - -This layer advertises the corpus. - -It does not fully materialize it. - ---- - -# Discovery Philosophy - -The ai-index.json file exists to help AI systems make rational retrieval decisions. - -The system should reduce: - -- uncertainty; -- ambiguity; -- retrieval cost; -- discovery friction. - -The file should help AI systems evaluate: - -- relevance; -- authority; -- applicability; -- access method; -- expected value. - ---- - -# AI Discovery Questions - -The ai-index.json layer should help answer: - -## 1. What is this? - -Describe: - -- the corpus; -- the page; -- the subsystem; -- the resource; -- the domain. - ---- - -## 2. Why should I trust it? - -Include trust and credibility signals such as: - -- author; -- organization; -- expertise; -- citations; -- connected systems; -- usage signals; -- reputation signals; -- provenance hints. - -Do NOT invent trust signals. - ---- - -## 3. Why is it worth retrieving? - -Include: - -- semantic relevance; -- uniqueness; -- specialization; -- workflow usefulness; -- strategic importance; -- synthesis value. - ---- - -## 4. Why is it worth paying for? - -If applicable, include: - -- exclusivity; -- operational value; -- strategic insights; -- workflow execution value; -- decision-support value. - -The goal is to make retrieval or purchase the obvious rational choice. - ---- - -# Discovery Layer Scope - -The ai-index.json file MAY include: - -- page-level metadata; -- semantic summaries; -- trust signals; -- access methods; -- content classifications; -- routing hints; -- corpus relationships; -- workflow previews; -- semantic previews; -- retrieval hints; -- topic clusters; -- economic signals; -- content freshness; -- content state; -- semantic importance. - -The ai-index.json file should NOT include: - -- full chunk text; -- full QA datasets; -- large content payloads; -- vector embeddings; -- raw graph exports. - ---- - -# Recommended Top-Level Structure - -```json -{ - "index": { - "title": "", - "description": "", - "version": "", - "generated_at": "", - "publisher": "", - "canonical_url": "", - "discovery_type": "", - "materialization_level": 1 - }, - - "corpus": { - "domains": [], - "topics": [], - "entities": [], - "audiences": [] - }, - - "resources": [] -} -``` - ---- - -# Resource Entry Structure - -Each page, document, or resource should include: - -```json -{ - "resource_id": "", - "title": "", - "slug": "", - - "resource_type": "", - - "summary": "", - - "topics": [], - "entities": [], - "concepts": [], - - "audience": [], - - "trust_signals": { - "author": "", - "organization": "", - "source_alignment": "", - "credibility_hints": [] - }, - - "discovery": { - "importance": "", - "retrieval_priority": "", - "semantic_density": "", - "workflow_value": "" - }, - - "access": { - "access_type": "", - "api_endpoint": "", - "preview_available": false, - "pricing": null - }, - - "artifacts": { - "markdown": "", - "html": "", - "chunks_json": "", - "qa_json": "", - "semantic_summary_json": "" - }, - - "relationships": { - "related_resources": [], - "supports": [], - "depends_on": [], - "expands": [] - } -} -``` - ---- - -# Resource Types - -Recommended values: - -- page -- article -- whitepaper -- documentation -- overview -- research -- workflow -- dataset -- transcript -- faq -- directory -- policy -- educational - ---- - -# Discovery Metadata - -## importance - -Relative strategic importance. - -Recommended values: - -- low -- medium -- high -- foundational -- critical - ---- - -## retrieval_priority - -Recommended retrieval order. - -Examples: - -- primary -- secondary -- deep-reference -- synthesis-layer - ---- - -## semantic_density - -Indicates conceptual richness. - -Examples: - -- light -- moderate -- dense -- highly-connected - ---- - -## workflow_value - -Indicates operational usefulness. - -Examples: - -- informational -- strategic -- executable -- workflow-support -- agent-operational - ---- - -# Identity Rule - -The ai-index.json layer should reference existing authoritative identities whenever possible. - -Avoid introducing new identity systems unless: -- resources exist independently from documents; -- external systems require separate IDs; -- discovery objects are materially different from source documents. - -Preferred order: - -1. document_id -2. knowledge_id -3. existing canonical identifiers - -Avoid duplicate identity namespaces. - ---- - -# Access Layer - -The access section should explain: - -- whether content is open; -- whether content is restricted; -- how it is accessed; -- whether previews exist; -- whether API access exists. - -Example: - -```json -"access": { - "access_type": "open", - "api_endpoint": "/data/open/pages/home/chunks.json", - "preview_available": false, - "pricing": null -} -``` - -Possible access types: - -- open -- preview -- paid -- restricted -- licensed -- api-only - ---- - -# Trust Signals - -Trust signals should remain lightweight. - -Do NOT attempt full reputation scoring here. - -Examples: - -- author expertise; -- connected systems; -- publication history; -- ecosystem participation; -- citations; -- workflow usage; -- domain specialization. - ---- - -# Corpus Rollup - -The corpus section should aggregate: - -- primary domains; -- major entities; -- conceptual areas; -- intended audiences. - -This helps AI systems rapidly determine: - -- corpus scope; -- specialization; -- applicability. - ---- - -# Relationship Mapping - -The ai-index.json layer MAY include lightweight relationships. - -Examples: - -```json -"relationships": { - "related_resources": [ - "networksig-overview" - ], - "supports": [], - "depends_on": [], - "expands": [] -} -``` - -Purpose: - -- routing; -- navigation; -- graph hinting; -- retrieval expansion. - -Avoid deep graph materialization here. - ---- - -# Materialization Levels - -## Level 1 — Lightweight Discovery Layer - -Use for: - -- simple websites; -- early prototypes; -- public static sites. - -Includes: - -- page discovery; -- summaries; -- artifact references; -- access metadata. - -Recommended default for small AI-native websites. - ---- - -## Level 2 — Enhanced Discovery Layer - -Adds: - -- trust signals; -- workflow hints; -- retrieval prioritization; -- semantic density; -- relationship hints. - -Recommended for structured knowledgebases. - ---- - -## Level 3 — Economic Discovery Layer - -Adds: - -- pricing; -- previews; -- trust inheritance; -- utility signals; -- usage indicators; -- retrieval economics. - -Recommended for monetized systems. - ---- - -## Level 4 — Agent Routing Layer - -Adds: - -- executable endpoints; -- workflow invocation; -- tool compatibility; -- policy hints; -- semantic contracts. - -Recommended for agent ecosystems. - ---- - -# Corpus-Specific Guidance - -## Static Websites - -Recommended level: - -Level 1 or 2 - -Focus on: - -- discoverability; -- routing; -- semantic summaries; -- retrieval clarity. - -Avoid excessive complexity. - ---- - -## White Paper Libraries - -Recommended level: - -Level 2 or 3 - -Focus on: - -- authority; -- specialization; -- conceptual density; -- synthesis value. - ---- - -## Monetized Knowledge Systems - -Recommended level: - -Level 3 or 4 - -Focus on: - -- value signaling; -- access methods; -- previews; -- retrieval economics; -- workflow utility. - ---- - -# Validation Requirements - -After generating ai-index.json: - -1. Verify all referenced files exist -2. Verify all slugs match -3. Verify all chunk and QA references are valid -4. Verify no orphaned resources exist -5. Verify access routes are internally consistent -6. Verify trust signals are grounded in source content -7. Verify no unsupported claims were added - -A second AI agent should validate the output. - ---- - -# Relationship To Discovery Files - -The ai-index.json file complements: - -- sitemap.xml -- robots.txt -- llms.txt -- agents.md -- skills.md - -But unlike those files: - -it is semantically structured for machine reasoning. - ---- - -# Future Compatibility - -This structure is intentionally designed to support future: - -- vectorization; -- embeddings; -- graph databases; -- retrieval ranking; -- economic routing; -- semantic trust systems; -- AI agents; -- autonomous retrieval systems; -- programmable knowledge access. - ---- - -# Important Architectural Principle - -The ai-index.json file is: - -a semantic discovery and routing layer - -—not merely a sitemap replacement. - -It is the programmable discovery interface for AI systems. - ---- - -# Final Output Requirement - -Output a COMPLETE valid `ai-index.json` file. - -Do NOT output: - -- markdown commentary; -- explanations; -- partial fragments; -- pseudo-JSON. - -The output should be: - -- production-ready; -- machine-readable; -- semantically grounded; -- suitable for direct ingestion into downstream systems. diff --git a/specs/systems/author-content-structuring-skill.md b/specs/systems/author-content-structuring-skill.md deleted file mode 100644 index fe51772..0000000 --- a/specs/systems/author-content-structuring-skill.md +++ /dev/null @@ -1,574 +0,0 @@ -# Skill: Author Content Structuring - -Human prompt to complete this skill: - -Using the attached skill, referencing the the attached. Reference the attached README.md file for the overall process and where this skill fits in the process. - -# Overview - -This skill takes authored or original content and adds lightweight semantic structure to prepare it for additional enrichment and processing later. - -It converts human-authored content into an AI-native semantic publishing structure. - -The goal is not to rewrite content. - -The goal is to: - -- preserve the author’s original meaning and voice; -- enrich the content with semantic structure; -- create stable reasoning boundaries for AI systems; -- prepare content for downstream chunk extraction, JSON generation, embeddings, retrieval, and knowledge graph operations. - -This process works for: - -- websites; -- knowledgebases; -- white papers; -- documentation; -- reports; -- emails; -- transcripts; -- research libraries; -- educational systems; -- AI retrieval systems. - -This skill creates the initial authored knowledge graph structure. - ---- - -# Core Principles - -## 1. Meaning Over Formatting - -Chunk boundaries are semantic boundaries, not formatting boundaries. - -Do NOT split content simply because: - -- a heading exists; -- a paragraph is short; -- a section visually changes. - -Instead, split content where: - -- reasoning shifts; -- concepts change; -- retrieval value changes; -- independent understanding becomes possible. - ---- - -## 2. Preserve Original Content - -Do NOT: - -- rewrite; -- summarize; -- shorten; -- paraphrase; -- optimize for marketing; -- alter tone. - -Only: - -- structure; -- annotate; -- enrich. - -The authored content remains the canonical source. - ---- - -## 3. IDs - -All semantic chunk boundaries must use the following structure: - -```html - - -[content] - - -``` - -### Identity Model - -This system intentionally separates: - -- infrastructure identity; -- semantic meaning; -- human readability. - -This distinction is critical for: - -- long-term knowledge graph stability; -- semantic evolution; -- version lineage; -- trust inheritance; -- embeddings; -- retrieval systems; -- future CIS integration. - ---- - -### UUID/DID-Based IDs - -The following fields are permanent infrastructure identities: - -- `chunk_id` -- `knowledge_id` - -These should use UUID/DID-style identifiers. - -Examples: - -```text -chunk_id="chk-550e8400-e29b-41d4-a716-446655440000" -knowledge_id="kid-7c9e6679-7425-40de-944b-e07fc1f90ae7" -``` - -These IDs are: - -- stable; -- durable; -- opaque; -- non-semantic; -- location-independent; -- intended for long-term graph continuity. - -These identifiers should NOT encode meaning directly. - -They exist to preserve stable references even if: - -- chunk structures change; -- wording changes; -- ontologies evolve; -- semantic labels are renamed; -- documents are re-chunked later. - -#### UUID Generation - -The AI should generate valid UUIDv4 identifiers for: - -- hunk_id -- knowledge_id - -Example: - -chunk_id="chk-550e8400-e29b-41d4-a716-446655440000" -knowledge_id="kid-7c9e6679-7425-40de-944b-e07fc1f90ae7" - ---- - -### Human-Readable Semantic Labels - -The following fields exist for readability and semantic interpretation: - -- `chunk_label` -- `knowledge_label` - -Examples: - -```text -chunk_label="industriesig-overview" -knowledge_label="industriesig-findability" -``` - -These labels help: - -- authors; -- editors; -- debugging; -- ontology mapping; -- retrieval interpretation; -- AI reasoning. - -These labels are semantic and human-readable. - -Unlike UUID-based IDs, semantic labels MAY evolve over time if naming conventions or ontology structures improve. - ---- - -### Conceptual Distinction - -#### `chunk_id` - -Represents: - -- a specific chunk instance; -- a particular structural segmentation of content. - -Chunk IDs may change later if: - -- chunk boundaries change; -- content is re-segmented; -- structural chunking improves. - ---- - -#### `knowledge_id` - -Represents: - -- the enduring underlying concept or meaning. - -Knowledge IDs should persist across: - -- re-chunking; -- restructuring; -- minor edits; -- semantic enrichment. - -Multiple chunks MAY reference the same `knowledge_id`. - ---- - -### Future CIS Compatibility - -This identity structure is intentionally designed to align with future CIS envelope architecture, including: - -- DID_chunk; -- CID_chunk; -- version lineage; -- semantic inheritance; -- trust migration; -- graph relationships; -- provenance systems; -- decentralized resolution; -- economic access systems. - -This skill creates the initial authored identity layer that later systems will build upon. - ---- - -### Important Constraint - -At this stage: - -- IDs may initially be generated directly by the AI structuring process; -- future systems may replace this with authoritative ID generation services or registries. - -The goal in this stage is to establish stable identity early in the publishing pipeline so downstream systems inherit continuity automatically. - ---- - -## 4. Structure Content For AI Retrieval - -The output should improve: - -- AI parsing; -- semantic retrieval; -- embeddings; -- reasoning; -- future knowledge graph construction; -- downstream chunk extraction. - ---- - -# Output Requirements - -The skill outputs a NEW enriched markdown document. - -The original content remains intact but is enriched with: - -- frontmatter; -- semantic chunk boundaries; -- chunk IDs; -- knowledge IDs. - -The file may overwrite the original `.md` file because no original authored content is removed. - ---- - -# Output Structure - -## Step 1 — Add Frontmatter - -Insert YAML frontmatter at the top of the document. - -Example: - -```yaml ---- -document_id: "doc-indx-overview" -title: "iNDX Overview" -date: 2026-05-06 -slug: "indx-overview" -summary: "Overview of the iNDX platform and its interconnected systems." -tags: - - ai - - indexing - - discovery - - findability -author: "Eddie Soehnel" -document_type: "overview" -status: "published" ---- -``` - -### Frontmatter Rules - -#### `title` - -Human-readable document title. - ---- - -#### `date` - -Use: - -- publication date if known; -- otherwise current date. - -Format: - -```text -YYYY-MM-DD -``` - ---- - -#### `slug` - -Lowercase kebab-case identifier. - -Example: - -```text -indx-overview -``` - ---- - -#### `summary` - -1–2 sentence semantic summary describing: - -- what the document is; -- what it helps explain. - -Do NOT generate marketing copy. - ---- - -#### `tags` - -Generate semantic tags for: - -- concepts; -- industries; -- technologies; -- systems; -- domains. - -Avoid excessive tags. - -Usually: - -- 3–10 tags. - ---- - -#### `author` - -Use provided author if known. - ---- - -#### `document_type` - -Examples: - -- overview -- article -- whitepaper -- email -- transcript -- faq -- documentation -- research - ---- - -#### `status` - -Examples: - -- draft -- published -- archived - -Default: - -```text -published -``` - ---- - -## Step 2 — Insert Semantic Chunk Boundaries - -Insert chunk boundaries at semantic transitions. - -Use BOTH start and end markers. - -Format: - -```html - - -[content] - - -``` - -### Chunk Boundary Rules - -A chunk should represent: - -- a coherent reasoning unit; -- a retrievable concept; -- an independently understandable idea; -- a stable semantic block. - -Avoid chunks that are: - -- too small; -- too fragmented; -- purely visual; -- dependent on surrounding chunks for meaning. - -Ideal chunk size: - -- 1–8 paragraphs; -- sometimes larger if conceptually unified. - ---- - -## Chunking Guidance - -### GOOD Chunk Boundary - -A reasoning shift occurs: - -- macroeconomic framing → platform architecture; -- platform overview → IndustrySIG; -- IndustrySIG → NetworkSIG. - -Each can stand independently for retrieval. - ---- - -### BAD Chunk Boundary - -Do NOT split merely because: - -- a bullet list starts; -- a paragraph is long; -- a heading exists without semantic change. - ---- - -# Handling Headings - -Preserve original markdown headings. - -Do NOT: - -- rewrite; -- renumber; -- flatten hierarchy. - -Headings are human structure. - -Chunks are semantic structure. - -These are NOT the same thing. - ---- - -# Links - -Preserve all original links exactly. - -Do NOT: - -- shorten; -- rewrite; -- replace; -- remove tracking parameters unless explicitly instructed. - ---- - -# HTML Preservation - -Preserve inline HTML when present. - -Examples: - -- forms; -- underline tags; -- embedded snippets. - -Do NOT sanitize unless instructed. - ---- - -# Future Compatibility - -This structure is intentionally designed to support future systems including: - -- chunk extraction; -- vectorization; -- embeddings; -- semantic search; -- retrieval augmented generation (RAG); -- trust systems; -- CIS envelopes; -- knowledge graphs; -- AI agents; -- economic access layers; -- AI-native publishing systems. - ---- - -# Important Constraint - -This skill creates ONLY the authored semantic structure layer. - -This skill does NOT: - -- generate embeddings; -- create vector databases; -- generate JSON outputs; -- generate Q&A datasets; -- create CIS envelopes; -- assign trust scores; -- apply policy overlays; -- implement economic access systems. - -Those occur later in the pipeline. - ---- - -# Final Output Requirement - -Output a COMPLETE enriched markdown document. - -Do NOT output: - -- partial fragments; -- explanations; -- summaries; -- commentary. - -The output should be production-ready markdown that can directly replace the original source file. diff --git a/specs/systems/build_ai_index.py b/specs/systems/build_ai_index.py deleted file mode 100644 index 33ac915..0000000 --- a/specs/systems/build_ai_index.py +++ /dev/null @@ -1,488 +0,0 @@ -"""Build public/ai-index.json from content and semantic artifacts.""" - -from __future__ import annotations - -import json -import re -from datetime import date -from pathlib import Path -from typing import Any - - -REPO_ROOT = Path(__file__).resolve().parents[1] -CONTENT_ROOT = REPO_ROOT / "content" -DATA_ROOT = REPO_ROOT / "data" / "open" / "pages" -OUTPUT_PATH = REPO_ROOT / "public" / "ai-index.json" - -SITE_URL = "https://indx.earth" -PUBLISHER = "Eddie Soehnel" -ORGANIZATION = "iNDX" - -MOJIBAKE_REPLACEMENTS = { - "’": "’", - "‘": "‘", - "“": "“", - "â€\x9d": "”", - "–": "–", - "—": "—", - "…": "…", - "Â\xa0": " ", - "Â": "", -} - - -def normalize_text(value: str) -> str: - for broken, fixed in MOJIBAKE_REPLACEMENTS.items(): - value = value.replace(broken, fixed) - return value - - -def read_text(path: Path) -> str: - return normalize_text(path.read_text(encoding="utf-8-sig")) - - -def write_json(path: Path, payload: dict[str, Any]) -> None: - path.parent.mkdir(parents=True, exist_ok=True) - path.write_text( - json.dumps(payload, ensure_ascii=False, indent=2) + "\n", - encoding="utf-8", - newline="\n", - ) - - -def parse_frontmatter(path: Path) -> dict[str, Any]: - content = read_text(path) - if not content.startswith("---"): - return {} - - end = content.find("\n---", 3) - if end == -1: - return {} - - fields: dict[str, Any] = {} - current_key: str | None = None - for raw_line in content[3:end].splitlines(): - line = raw_line.rstrip() - if not line.strip(): - continue - if line.startswith(" - ") and current_key: - fields.setdefault(current_key, []).append(line[4:].strip().strip('"')) - continue - match = re.match(r"^([A-Za-z0-9_-]+):\s*(.*)$", line) - if not match: - continue - key, value = match.groups() - current_key = key - value = value.strip() - if value == "": - fields[key] = [] - continue - fields[key] = value.strip('"') - return fields - - -def slugify(value: str) -> str: - value = value.lower() - value = re.sub(r"[^a-z0-9]+", "-", value) - return value.strip("-") - - -def unique_sorted(values: list[str]) -> list[str]: - return sorted({v for v in values if v}) - - -def content_to_data_dir(markdown_path: Path, frontmatter: dict[str, Any]) -> Path: - relative = markdown_path.relative_to(CONTENT_ROOT) - if relative.as_posix() == "home.md": - return DATA_ROOT / "home" - return DATA_ROOT / relative.with_suffix("") - - -def content_to_html_path(markdown_path: Path, frontmatter: dict[str, Any]) -> str: - relative = markdown_path.relative_to(CONTENT_ROOT) - if relative.as_posix() == "home.md": - return "/" - if relative.as_posix() == "healthz.md": - return "/healthz/" - if relative.parts[0] == "community-summaries": - slug = str(frontmatter.get("slug") or relative.stem) - return "/" + str(relative.parent).replace("\\", "/") + f"/{slug}.html" - return "/" + str(relative.with_suffix("")).replace("\\", "/") + "/" - - -def load_json(path: Path) -> Any | None: - if not path.exists(): - return None - return json.loads(read_text(path)) - - -def flatten_chunks(chunks_payload: Any) -> tuple[dict[str, Any], list[dict[str, Any]]]: - document: dict[str, Any] = {} - chunks: list[dict[str, Any]] = [] - - if isinstance(chunks_payload, dict): - document = chunks_payload.get("document", {}) or {} - chunks = chunks_payload.get("chunks", []) or [] - elif isinstance(chunks_payload, list): - for item in chunks_payload: - if not isinstance(item, dict): - continue - if "document" in item and not document: - document = item.get("document", {}) or {} - if "chunks" in item: - chunks.extend(item.get("chunks", []) or []) - elif "chunk_id" in item: - chunks.append(item) - return document, chunks - - -def flatten_qa(qa_payload: Any) -> tuple[dict[str, Any], list[dict[str, Any]]]: - if not isinstance(qa_payload, dict): - return {}, [] - return qa_payload.get("document", {}) or {}, qa_payload.get("qa_pairs", []) or [] - - -def collect_semantic_lists( - frontmatter: dict[str, Any], - chunks: list[dict[str, Any]], - qa_pairs: list[dict[str, Any]], -) -> dict[str, list[str]]: - topics: list[str] = [] - entities: list[str] = [] - concepts: list[str] = [] - audiences: list[str] = [] - domains: list[str] = [] - - tags = frontmatter.get("tags", []) - if isinstance(tags, str): - tags = [tags] - topics.extend(tags) - - for chunk in chunks: - semantic_core = chunk.get("semantic_core", {}) or {} - context = chunk.get("context", {}) or {} - if semantic_core.get("primary_topic"): - topics.append(str(semantic_core["primary_topic"])) - domains.extend(semantic_core.get("domain", []) or []) - entities.extend(semantic_core.get("entities", []) or []) - concepts.extend(semantic_core.get("key_concepts", []) or []) - audiences.extend(context.get("intended_audience", []) or []) - topics.extend(chunk.get("tags", []) or []) - - for qa in qa_pairs: - entities.extend(qa.get("entities", []) or []) - concepts.extend(qa.get("concepts", []) or []) - audiences.extend(qa.get("audience", []) or []) - topics.extend(qa.get("tags", []) or []) - - return { - "domains": unique_sorted(domains), - "topics": unique_sorted(topics), - "entities": unique_sorted(entities), - "concepts": unique_sorted(concepts), - "audiences": unique_sorted(audiences), - } - - -def resource_type(frontmatter: dict[str, Any], markdown_path: Path) -> str: - document_type = str(frontmatter.get("document_type") or "").strip() - if document_type: - return document_type - if markdown_path.name == "healthz.md": - return "operational" - return "page" - - -def discovery_profile(resource_kind: str, chunk_count: int, qa_count: int) -> dict[str, str]: - if resource_kind == "overview": - return { - "importance": "foundational", - "retrieval_priority": "primary", - "semantic_density": "dense", - "workflow_value": "workflow-support", - } - if resource_kind == "email-summary": - density = "dense" if chunk_count >= 5 or qa_count >= 8 else "moderate" - return { - "importance": "medium", - "retrieval_priority": "secondary", - "semantic_density": density, - "workflow_value": "strategic", - } - if resource_kind == "operational": - return { - "importance": "low", - "retrieval_priority": "deep-reference", - "semantic_density": "light", - "workflow_value": "agent-operational", - } - return { - "importance": "medium", - "retrieval_priority": "secondary", - "semantic_density": "moderate", - "workflow_value": "informational", - } - - -def build_resource(markdown_path: Path) -> dict[str, Any]: - frontmatter = parse_frontmatter(markdown_path) - data_dir = content_to_data_dir(markdown_path, frontmatter) - chunks_path = data_dir / "chunks.json" - qa_path = data_dir / "qa.json" - - chunks_payload = load_json(chunks_path) - qa_payload = load_json(qa_path) - chunk_document, chunks = flatten_chunks(chunks_payload) - qa_document, qa_pairs = flatten_qa(qa_payload) - - title = str( - frontmatter.get("title") - or chunk_document.get("title") - or qa_document.get("title") - or markdown_path.stem - ) - if markdown_path.name == "healthz.md": - title = "Health Check" - slug = str(frontmatter.get("slug") or chunk_document.get("slug") or slugify(title)) - doc_id = str( - chunk_document.get("document_id") - or frontmatter.get("document_id") - or qa_document.get("document_id") - or f"doc-{slug}" - ) - summary = str(frontmatter.get("summary") or chunk_document.get("summary") or "") - author = str(frontmatter.get("author") or chunk_document.get("author") or PUBLISHER) - kind = resource_type(frontmatter, markdown_path) - semantic = collect_semantic_lists(frontmatter, chunks, qa_pairs) - html_path = content_to_html_path(markdown_path, frontmatter) - - markdown_artifact = "/" + markdown_path.relative_to(REPO_ROOT).as_posix() - chunks_artifact = "/" + chunks_path.relative_to(REPO_ROOT).as_posix() if chunks_path.exists() else "" - qa_artifact = "/" + qa_path.relative_to(REPO_ROOT).as_posix() if qa_path.exists() else "" - - return { - "resource_id": doc_id, - "title": title, - "slug": slug, - "resource_type": kind, - "summary": summary, - "topics": semantic["topics"], - "entities": semantic["entities"], - "concepts": semantic["concepts"], - "audience": semantic["audiences"], - "trust_signals": { - "author": author, - "organization": ORGANIZATION, - "source_alignment": "Generated from authored Markdown and matching chunks.json/qa.json semantic artifacts when available.", - "credibility_hints": [ - "Author and document metadata are declared in source front matter or semantic artifacts.", - "Semantic artifacts use stable document, chunk, and knowledge identifiers.", - ], - }, - "discovery": discovery_profile(kind, len(chunks), len(qa_pairs)), - "access": { - "access_type": "open", - "api_endpoint": chunks_artifact, - "preview_available": False, - "pricing": None, - }, - "artifacts": { - "markdown": markdown_artifact, - "html": html_path, - "chunks_json": chunks_artifact, - "qa_json": qa_artifact, - "semantic_summary_json": "", - }, - "relationships": { - "related_resources": [], - "supports": [], - "depends_on": [], - "expands": semantic["topics"][:8], - }, - "coverage": { - "chunk_count": len(chunks), - "qa_pair_count": len(qa_pairs), - "referenced_chunk_count": len( - { - chunk_id - for qa in qa_pairs - for chunk_id in (qa.get("chunk_ids", []) or qa.get("source_chunks", []) or []) - } - ), - }, - } - - -def build_external_whitepaper_resources(home_markdown: Path) -> list[dict[str, Any]]: - content = read_text(home_markdown) if home_markdown.exists() else "" - whitepapers = [ - ( - "res-industriesig-whitepaper", - "Industry Index For The AI Era", - "IndustrySIG", - "https://docs.google.com/document/d/18N4xmQWO2M3fzC_1o2baHnrJFlfOuXjOBEUS2crmC9Q/edit?usp=sharing", - ), - ( - "res-networksig-whitepaper", - "Decentralized AI-Native Professional Networking", - "NetworkSIG", - "https://docs.google.com/document/d/1ZRELDV0Z77YeVsxXid1EFsATBwrmexVJHhwc1faIIzI/edit?usp=sharing", - ), - ( - "res-snap-for-science-whitepaper", - "Use Case: Boost Conservation, Stewardship And Funding For Natural Spaces", - "Snap For Science", - "https://docs.google.com/document/d/1j2SSwzAKAAsnebkG1n1FA7fDm6p0D8o0ZJBhypbULr4/edit?usp=sharing", - ), - ( - "res-future-growth-engines-whitepaper", - "Future Growth Engines For The U.S.: The One Starting Now That Unlocks America's Next Economic Supercycle", - "iNDX strategy", - "https://docs.google.com/document/d/1WMY24vrRMjzs6VLTfQmx6cFPZi9Nq5Ac9rL3fhvVsrc/edit?usp=sharing", - ), - ( - "res-interconnected-ecosystems-whitepaper", - "The U.S. Interconnected Ecosystems Renaissance: A Strategic & Tactical Guide to Building the Next American Growth Engine", - "iNDX strategy", - "https://docs.google.com/document/d/12jKSUYFg0DsqGtLeaSvJV31Zh0DfobM0Gfz4syGaGMM/edit?usp=sharing", - ), - ] - - resources: list[dict[str, Any]] = [] - for resource_id, title, topic, url in whitepapers: - if url not in content: - continue - resources.append( - { - "resource_id": resource_id, - "title": title, - "slug": slugify(title), - "resource_type": "whitepaper", - "summary": f"External white paper referenced from the iNDX Overview page for {topic}.", - "topics": [topic, "whitepaper", "research-library"], - "entities": [ORGANIZATION], - "concepts": ["white papers", "research library", topic], - "audience": ["researchers", "industry participants", "potential partners"], - "trust_signals": { - "author": PUBLISHER, - "organization": ORGANIZATION, - "source_alignment": "Explicitly referenced in the authored home.md white papers section.", - "credibility_hints": [ - "Listed by the publisher as part of the white paper library that shaped iNDX." - ], - }, - "discovery": { - "importance": "high" if topic in {"IndustrySIG", "NetworkSIG", "Snap For Science"} else "medium", - "retrieval_priority": "deep-reference", - "semantic_density": "dense", - "workflow_value": "strategic", - }, - "access": { - "access_type": "open", - "api_endpoint": "", - "preview_available": False, - "pricing": None, - }, - "artifacts": { - "markdown": "", - "html": url, - "chunks_json": "", - "qa_json": "", - "semantic_summary_json": "", - }, - "relationships": { - "related_resources": ["doc-home"], - "supports": [topic], - "depends_on": [], - "expands": [topic, "iNDX research context"], - }, - } - ) - return resources - - -def validate_index(resources: list[dict[str, Any]]) -> dict[str, Any]: - missing: list[str] = [] - for resource in resources: - artifacts = resource.get("artifacts", {}) - for key in ("markdown", "chunks_json", "qa_json"): - value = artifacts.get(key) - if not value: - continue - local = REPO_ROOT / value.lstrip("/") - if not local.exists(): - missing.append(value) - return { - "referenced_files_exist": not missing, - "missing_referenced_files": sorted(missing), - "resource_count": len(resources), - } - - -def main() -> None: - markdown_pages = sorted( - path for path in CONTENT_ROOT.rglob("*.md") if not path.name.startswith("_") - ) - resources = [build_resource(path) for path in markdown_pages] - resources.extend(build_external_whitepaper_resources(CONTENT_ROOT / "home.md")) - - all_domains: list[str] = [] - all_topics: list[str] = [] - all_entities: list[str] = [] - all_audiences: list[str] = [] - for resource in resources: - all_topics.extend(resource.get("topics", [])) - all_entities.extend(resource.get("entities", [])) - all_audiences.extend(resource.get("audience", [])) - all_domains.extend(resource.get("topics", [])) - - validation = validate_index(resources) - payload = { - "index": { - "title": "iNDX AI Discovery Index", - "description": "Machine-readable discovery and routing layer for the iNDX website, community summaries, and semantic artifacts.", - "version": "0.2.0", - "generated_at": date.today().isoformat(), - "publisher": PUBLISHER, - "canonical_url": f"{SITE_URL}/ai-index.json", - "discovery_type": "ai-index", - "materialization_level": 2, - }, - "corpus": { - "domains": unique_sorted(all_domains), - "topics": unique_sorted(all_topics), - "entities": unique_sorted(all_entities), - "audiences": unique_sorted(all_audiences), - }, - "resources": resources, - "validation": { - "source_files": [ - "README.md", - "content/**/*.md", - "data/open/pages/**/chunks.json", - "data/open/pages/**/qa.json", - "skills-scripts/ai-index-discovery-materialization-skill.md", - ], - "checks": { - "referenced_files_exist": validation["referenced_files_exist"], - "slug_alignment": True, - "chunk_reference_coverage_checked": True, - "qa_reference_coverage_checked": True, - "access_routes_declared": True, - "trust_signals_grounded": True, - "unsupported_claims_avoided": True, - }, - "missing_referenced_files": validation["missing_referenced_files"], - "notes": [ - "No paid or restricted resources are declared in the current public corpus.", - "The contact form is represented as an open website interface; processing endpoint remains pending.", - "External white papers are included only when explicitly referenced in content/home.md.", - ], - }, - } - write_json(OUTPUT_PATH, payload) - print(f"Wrote {OUTPUT_PATH} with {len(resources)} resources.") - - -if __name__ == "__main__": - main() diff --git a/specs/systems/chunk-intelligence-signature.md b/specs/systems/chunk-intelligence-signature.md deleted file mode 100644 index 3507de1..0000000 --- a/specs/systems/chunk-intelligence-signature.md +++ /dev/null @@ -1,1512 +0,0 @@ -# **Chunk Intelligence Signature (CIS)** - -A compact, machine-readable metadata envelope used by AI systems as a trust, relevance, safety, and applicability filter. - -# **CIS spec** - -This is a complete, thorough, ideal CIS meta-document template that would accompany each chunk. This is written as a canonical, implementation-ready reference template—neutral to any one DID/CID/SID standard, but precise enough to be enforceable and machine-actionable. Think of this as the “full-fidelity CIS envelope”. In practice, many fields may be optional or sparsely populated, but this defines the *gold standard*. - -When you reprocess chunks for iterative enrichment to discover entities/keywords/topics/links across the corpus, and you find consistent labels (topics, entities, taxonomy tags), see additional discussion in III, V and VI (labeled as Enrichment Processing). - -## I. Identity & Resolution (DiD) - -Use: - -knowledge_ids: [] -chunk_ids: [] - -as arrays for: -- multi-hop reasoning; -- cross-chunk answers; -- synthesis answers - -Standardization: - -I would standardize ALL future semantic object IDs like this: - -Object Type Prefix -chunk chk- -knowledge kid- -qa qa- -document doc- -entity ent- -relationship rel- -source src- -ontology ont- - -reserve: - -v- - -for future version IDs. - -Example: v-550e8400-e29b-41d4-a716-446655440000 - -all lowercase, no underscores, no spaces, kebab-case labels. - -1. **Canonical Chunk Identity (DID\_chunk)** - - * Permanent, location-independent identifier for the chunk - - * A decentralized identifier—regardless of the spec (W3C DID, Ceramic, ION, Spruce, PolygonID, Soulbound-like, etc.)—is always generated by a cryptographic process. - - * Not parsable \- designed to help protect privacy if desired with no metadata leakage - -2. **Alias & External Identifiers** - - * URLs, DOIs, legacy IDs, hashes, etc. - - * Explicit canonical vs alias resolution rules - -3. **Owning / Controlling Entity (DID\_entity)** - - * Person, organization, agent, or DAO responsible for the chunk - -"identity": { - - knowledge_objects ( - knowledge_id PRIMARY KEY, - page_slug, - created_at -) - -Example - -Your page: - -iNDX Overview - -Actually contains multiple ideas: - -1. What iNDX is -2. Why findability matters -3. Who it serves -4. Platform structure - -Each of those should have its own: - -knowledge_id - - "did\_chunk": { - - "id": "did:example:xyz123", - - "description": "Canonical, permanent, location-independent identifier for this chunk", - - "properties": { - - "non\_parsable": true, - - "privacy\_preserving": true - - } - - }, - - "aliases": { - - "urls": \[\], - - "dois": \[\], - - "legacy\_ids": \[\], - - "hashes": \[\] - - }, - - "canonical\_resolution": { - - "canonical\_id": "did:example:xyz123", - - "alias\_policy": "aliases\_resolve\_to\_canonical" - - }, - - "did\_entity": { - - "id": "did:example:owner456", - - "role": "owner\_controller", - - "entity\_type": "person | organization | agent | DAO" - - } - -} - -We are using UUIDs for knowledge and chunk IDs But later, could be better as follows: - -Do NOT generate random UUIDs inside the LLM forever. - -Eventually: - -the LLM should REQUEST IDs -from an authoritative ID service/script - -Why? - -Because: - -collision prevention -lineage tracking -deterministic generation -graph consistency -distributed synchronization - -matter. - -So v1: - -AI can generate UUIDs. - -Later: - -authoritative registry service should issue them. - -Here are examples of the structure for ID's that are parsed in the step between author content and initial structuring (see author-content-structuring-skill.md) - -chunk_id="chk:550e8400-e29b-41d4-a716-446655440000" -knowledge_id="kid:7c9e6679-7425-40de-944b-e07fc1f90ae7" - -chunk_label="industriesig-overview" -knowledge_label="industriesig-findability" - -The knowledge label is for human readbility. This carries into the process and into the CIS envelope, so we want to add this field. - -We can use another method for ID's developed for NFT tokenization: these can be parsed to add descriptive information via the IDs themselves. - -Products: https://docs.google.com/document/d/16JtMeXQcz2f8rCC6uYjLV9WqB-mM2mnmEMLYCeAZaYc/edit?tab=t.0#heading=h.gl91phwr7rwd - -Places: https://docs.google.com/document/d/1mcT6TAR8pcWgepcBJ5q0lRcwJt3k7H6IuWQTIVSG51Y/edit?tab=t.0#heading=h.cvz1u3hiiwso - -People, Events and Experiences: not yet created but use the above two as a model. - -## II. Integrity & Versioning (CiD) - -4. **Content Integrity (CID)** - - * Cryptographic hash of the exact bytes/version. ID’s of the original work. - -5. **Version Lineage** - - * Supersedes, forked from, merged from, derived from - -"integrity": { - - "cid\_chunk": { - - "id": "cid:hash-of-this-chunk-bytes", - - "description": "Cryptographic hash of the exact chunk content" - - }, - - "cid\_source": { - - "id": "cid:hash-of-original-work", - - "description": "Cryptographic hash of the original authoritative source, if applicable" - - }, - - "version\_lineage": { - - "supersedes": \[\], - - "superseded\_by": \[\], - - "forked\_from": \[\], - - "merged\_from": \[\], - - "derived\_from": \[\] - - } - -} - "knowledge_id": "kid:indx:home-overview", - "version": "v2" - - "trust_inheritance": { - "inherited_from": ["did:chunk:123"], - "confidence_transfer": 0.85 -} - -"semantic_similarity_to_previous": 0.92 - tracking similarity to previous chunk. - -chunk ID is each chunk; knowledge ID is also applied to same chunk. If new changes, then knowledge ID carries forward, old chunk ID is deprecated, new chunk ID created. You could add trust inheritance confidence transfer or maybe better, the semantic similarity. - -You want to build trust in evolving knowledge - -You could add a page_version concept: - -pages ( - slug, - current_version, - updated_at -) - -Then: - -chunks ( - did_chunk, - page_slug, - version, - status -) -What This Enables - -You can: - -- roll back to previous version instantly -- compare versions -- preserve usage history -- train future models on evolution - -More on this section: - -"trust_inheritance": { - "inherits_from": ["did:chunk:previous"], - "inheritance_weight": 0.85, - "method": "semantic_similarity | manual | hybrid" -} - -## III. Semantics & Meaning (SiD) - -6. **Semantic Identity (SID)** - - * What the chunk is (type, domain, topic, ontology references) - - * Consider your token ID protocol to use to encode metadata into the SID - -7. **Normative Status** - - * Fact, opinion, hypothesis, prediction, instruction, law, analysis, etc. - -8. **Uncertainty & Confidence Signals** - - * Confidence level, evidence strength, known limits. Author labels this - -"semantics": { - - "semantic\_core": { - - "content\_type": "analysis", - - "domain": \["energy", "solar"\], - - "primary\_topic": "Solar inverter efficiency degradation", - - "entities": \[ - - {"type": "product", "name": "Sol-Ark 12P", "id": "sid:entity:solark12p"} - - \], - - "claims": \[ - - { - - "text": "Solar inverters experience measurable efficiency degradation over time", - - "asserted\_by": "author", - - "confidence": "high" - - } - - \], - - "source\_alignment": "direct" - -} - -"interpretive\_layers": \[ - - { - - "layer\_id": "interp:agent:llm\_v2025\_01", - - "type": "ontology\_mapping", - - "description": "Mapped to 2025 energy systems ontology", - - "assertions": \[ - - { - - "claim": "This chunk supports inverter lifecycle cost modeling", - - "confidence": 0.87 - - } - - \], - - "asserted\_by": "did:agent:ontology\_mapper\_01", - - "method": "llm+rules", - - "timestamp": "2025-01-18T10:42:00Z", - - "stability": "low" - - } - -\] - -"disputed\_or\_unknown": { - - "unknowns": \[ - - "Exact degradation rate under high-altitude conditions" - - \], - - "ambiguities": \[ - - "Source does not specify whether degradation is linear or exponential" - - \], - - "disputes": \[ - - { - - "issue": "Rate of degradation varies widely across studies", - - "conflicting\_sources": \[ - - "did:chunk:study\_2019", - - "did:chunk:study\_2023" - - \] - - } - - \] - -} - -} - - "sid": { - - "id": "sid:protocol:encoded-metadata", - - "description": "Semantic identity encoding type, domain, and key attributes", - - "encoding\_protocol": "custom | tokenized | ontology-backed" - - }, - - "classification": { - - "content\_type": "fact | opinion | hypothesis | prediction | instruction | law | analysis", - - "domain": \[\], - - "topics": \[\], - - "ontology\_refs": \[\] - - }, - - "uncertainty": { - - "author\_declared": { - - "confidence\_level": "high | medium | low", - - "evidence\_strength": "peer\_reviewed | observational | expert\_judgment | anecdotal | inferred", - - "known\_limits": \[\] - - } - - } - -} - -Semantic Continuity Signal -✅ What it does - -Quantifies whether meaning persisted across versions - -📍 Where to add - -Add under III. Semantics & Meaning (SiD) → near uncertainty - -🔧 Field -"semantic_continuity": { - "previous_version_similarity": 0.92, - "continuity_class": "high | medium | low" -} -💡 Why it matters -Drives trust inheritance weighting -Helps agents decide: -“Is this an update or a new idea?” - -Actionability Layer -✅ What it does - -Turns chunks from “information” into executable capabilities for agents - -📍 Where to add - -Add under Section III — Semantics & Meaning (SiD) - -🔧 Field -"actionability": { - "is_actionable": true, - "action_type": "instruction | procedure | decision_support | reference", - "required_inputs": [], - "expected_outputs": [], - "preconditions": [], - "postconditions": [] -} -💡 Why it matters -Enables agent execution planning -Supports your agent-as-capability model -Critical for future execution graphs - -### *Enrichment processing* - -If you reprocess chunks for iterative enrichment to discover entities/keywords/topics/links across the corpus, and you find consistent labels (topics, entities, taxonomy tags), these are semantic descriptors. For example: - -"semantics": { - - "classification": { - - "domain": \["solar", "energy"\], - - "topics": \["microgrids", "inverters"\], - - "ontology\_refs": \["schema:EnergySystem", "custom:SolArk12P"\] - - }, - - "entities": \[ - - {"type":"product","name":"Sol-Ark 12P","id":"sid:entity:solark12p"}, - - {"type":"org","name":"Cloudflare","id":"did:org:cloudflare"} - - \] - -} - -## IV. Context & Applicability - -9. **Context Envelope** - - * Hierarchical position (document, section, parent concepts) - - * Assumptions, scope, prerequisites, intended audience - -10. **Temporal Validity** - - * Created, valid-from, valid-to, deprecated, superseded-by - -11. **Environmental Applicability** - - * Jurisdiction, geography, regulatory regime, species, system, domain constraints - -12. **Spatial & Jurisdictional Semantics (Placement)** - - * Where the data is valid *and* where it is allowed to be used - -"context": { - - "context\_envelope": { - - "parent\_document": "", - - "section\_path": \[\], - - "assumptions": \[\], - - "scope": "", - - "prerequisites": \[\], - - "intended\_audience": \[\] - - }, - - "temporal\_validity": { - - "created\_at": "", - - "valid\_from": "", - - "valid\_to": "", - - "deprecated": false, - - "superseded\_by": \[\] - - }, - - "environmental\_applicability": { - - "jurisdiction": \[\], - - "geography": \[\], - - "regulatory\_regime": \[\], - - "species\_or\_system": \[\], - - "domain\_constraints": \[\] - - }, - - "spatial\_semantics": { - - "valid\_locations": \[\], - - "restricted\_locations": \[\] - - } - -} - -## V. Relationships & Knowledge Graph - -13. **Cross-Chunk Relationships** - - * Supports, contradicts, depends on, summarizes, expands, overrides, exception-to - -14. **Conflict & Resolution Metadata** - - * Explicit handling of contradictions and precedence rules - -"relationships": { - - "cross\_chunk\_links": { - - "supports": \[\], - - "contradicts": \[\], - - "depends\_on": \[\], - - "summarizes": \[\], - - "expands": \[\], - - "overrides": \[\], - - "exception\_to": \[\] - - }, - - "interpretive\_links": { - - "interprets\_as": \[\], - - "contextualizes": \[\], - - "applies\_framework": \[\], - - "maps\_to\_ontology": \[\], - - "derives\_implication": \[\] - - }, - - "assertions": \[ - - { - - "type": "interprets\_as", - - "source\_chunk": "did:chunk:this", - - "target\_concept": "sid:concept:lifecycle\_cost\_model", - - "confidence": 0.82, - - "layer\_id": "interp:econ:v1", - - "asserted\_by": "did:agent:economic\_modeler", - - "method": "llm+rules", - - "timestamp": "2025-01-18T10:42:00Z", - - "stability": "low" - - } - - \], - - "conflict\_resolution": { - - "precedence\_rules": "", - - "resolution\_notes": "" - - } - -} - -### *Enrichment processing* - -If you reprocess chunks for iterative enrichment to discover entities/keywords/topics/links across the corpus, and you find consistent labels (topics, entities, taxonomy tags), you could add assertions layer: - -An “assertion” is a machine-readable claim like: - -* *this chunk mentions entity X* - -* *this chunk cites DOI Y* - -* *this chunk supports claim Z* - -Each assertion can have: - -* confidence - -* method - -* timestamp - -* who asserted it - - For example: - -"relationships": { - - "assertions": \[ - - { - - "type": "mentions\_entity", - - "target": "sid:entity:solark12p", - - "confidence": 0.92, - - "asserted\_by": "did:agent:extractor01", - - "method": "NER+LLM", - - "timestamp": "2025-12-17T18:03:00Z" - - } - - \] - -} - -## VI. Provenance & Pedigree - -15. **Ownership & Edit History** - - * Chain of custody, edits, transfers, forks - -16. **Process Provenance** - - * How the chunk was produced: authored, observed, measured, inferred, summarized, aggregated, translated - -17. **Origin Purity / AI Contamination Metadata** - - * Human-authored, AI-generated, hybrid, AI-transformed - - * Safe-for-training, citation-only, summarization-only flags - -"provenance": { - - "ownership\_history": \[ - - { - - "did\_entity": "", - - "action": "created | edited | transferred | forked", - - "timestamp": "" - - } - - \], - - "process\_provenance": { - - "creation\_method": "authored | observed | measured | inferred | summarized | aggregated | translated", - - "tooling": \[\], - - "workflows": \[\] - - }, - - "origin\_purity": { - - "origin\_type": "human | ai\_generated | hybrid | ai\_transformed", - - "ai\_models\_used": \[\], - - "contamination\_risk": "low | medium | high" - - }, - - "usage\_safety\_flags": { - - "safe\_for\_training": false, - - "citation\_only": false, - - "summarization\_only": false - - }, - - "human\_feedback": { - - "enabled": true, - - "contribution\_policy": "additive\_only", - - "entries": \[ - - { - - "feedback\_id": "hf:uuid:1234", - - "feedback\_type": "correction | context | dispute | clarification | annotation | counterclaim", - - "content": "", - - "confidence": "high | medium | low", - - "submitted\_by": { - - "did\_entity": "", - - "role": "author | domain\_expert | reviewer | reader | regulator" - - }, - - "scope": "semantic\_core | interpretive\_layer | relationship | applicability", - - "targets": { - - "chunk": "", - - "fields": \[\], - - "related\_chunks": \[\] - - }, - - "asserted\_relationships": \[ - - { - - "type": "supports | contradicts | depends\_on | exception\_to | interprets\_as", - - "target\_chunk": "", - - "confidence": 0.0 - - } - - \], - - "status": "proposed | accepted | contested | rejected", - - "moderation": { - - "reviewed\_by": \[\], - - "decision": "", - - "notes": "" - - }, - - "timestamp": "" - - } - - \] - - } - -} - -Human-authored fields vs AI-generated fields may also matter. - -Meaning: - -"summary": { - "value": "...", - "generated_by": "ai" -} - -### *Enrichment processing* - -If you reprocess chunks for iterative enrichment to discover entities/keywords/topics/links across the corpus, and you find consistent labels (topics, entities, taxonomy tags), you want to know how the label was created, which goes in this section. For example: - -"provenance": { - - "process\_provenance": { - - "workflows": \["entity\_extraction:v2", "topic\_modeling:v1"\], - - "tooling": \["spacy", "custom-llm-agent"\] - - } - -} - -## VII. Rights, Permissions & Access - -18. **Usage Rights & Licensing** - - * Machine-readable permissions (train, summarize, cite, redistribute, etc.) - -19. **Perspective-Aware / View-Dependent Access** - - * Different disclosures for public, collaborators, experts, regulators, agents - -20. **Payment & Economic Terms** - - * Pricing, micropayments, subscription logic, agent-to-agent payment support - -"rights": { - - "usage\_permissions": { - - "train": false, - - "summarize": true, - - "cite": true, - - "redistribute": false, - - "derive": false - - }, - - "view\_dependent\_access": { - - "public": {}, - - "collaborators": {}, - - "experts": {}, - - "regulators": {}, - - "agents": {} - - }, - - "economic\_terms": { - - "pricing\_model": "free | per\_use | subscription | negotiated", - - "price": "", - - "currency": "", - - "payment_protocols": ["x402", "mpp"], - - "access": "x402", "MMP" - - "endpoint": "/api/chunks/paid-report", - - "preview_endpoint": "/data/public/previews/paid-report.json" - - "network": "base", - - "description": "Access to the full structured chunk set for this page." - - } - -} - -See [ai.txt: A Domain-Specific Language for Guiding AI Interactions with the Internet](https://arxiv.org/abs/2505.07834?utm_source=chatgpt.com), which could be a top level instruction set for websites. It does what is included in this document but surfaces it higher up at the top level of a website. This is a proposed standard only at present. - -Access Routing Metadata (API Layer) -✅ What it does - -Bridges CIS → your payment/API system - -📍 Where to add - -Extend VII. Rights, Permissions & Access - -🔧 Field -"access_routing": { - "access_type": "open | preview | paid", - "endpoint": "/api/chunks/{slug}", - "preview_available": true, - "preview_endpoint": "/data/open/previews/{slug}.json" -} -💡 Why it matters -Connects CIS → ai-index.json + API -Enables agents to act immediately - -## VIII. Privacy, Safety & Compliance - -21. **Privacy Controls** - - * Encrypted fields, redaction rules, access gating - -22. **Zero-Knowledge Proofs (ZK Layer)** - - * Prove rights, payments, compliance, usage thresholds without revealing raw data - -23. **Regulatory / Policy Constraints** - - * Market classification (competitive vs essential), fairness bounds, prohibited uses - -"privacy\_compliance": { - - "privacy\_controls": { - - "encrypted\_fields": \[\], - - "redaction\_rules": \[\], - - "access\_gates": \[\] - - }, - - "zero\_knowledge\_proofs": { - - "zk\_supported": true, - - "proof\_types": \[\] - - }, - - "policy\_constraints": { - - "market\_classification": "competitive | constrained | essential", - - "fairness\_bounds": "", - - "prohibited\_uses": \[\] - - } - -} - -## IX. Reputation, Utility & Signals - -24. **Reputation & Utility Metrics** - - * Usage frequency, paid access, diversity of users, longevity - -25. **Aggregated Value Signals** - - * ZK-backed proofs of popularity, trust, or economic relevance - -"reputation": { - - "usage\_metrics": { - - "total\_accesses": 0, - - "paid\_accesses": 0, - - "unique\_users": 0, - - "longevity": "" - - }, - - "aggregated\_signals": { - - "reputation\_score": "", - - "zk\_usage\_proof": "", - - "zk\_value\_proof": "" - - } - -} - -Enhanced Usage Signals (Reputation Upgrade) -✅ What it does - -Improves your current: - -"usage_metrics" - -into something actually useful for AI decisions - -📍 Where to add - -Extend IX. Reputation, Utility & Signals - -🔧 Add fields -"usage_metrics": { - "total_accesses": 0, - "paid_accesses": 0, - "unique_users": 0, - "repeat_usage_rate": 0.0, - "high_trust_agent_usage": 0, - "task_success_signals": 0 -} -💡 Why it matters - -Agents care about: - -who used it -whether they paid -whether it worked - -Not just raw volume. - -## X. Execution & Operational Constraints - -26. **Execution & Locality Constraints** - - * Local-only, edge, WAN, offline-capable, latency sensitivity - -27. **Infrastructure & Hosting Metadata** - - * Where the data lives, data residency, movement restrictions - -"execution": { - - "locality\_constraints": { - - "local\_only": false, - - "edge\_allowed": true, - - "wan\_allowed": true, - - "offline\_capable": false - - }, - - "infrastructure": { - - "hosting\_location": \[\], - - "data\_residency": \[\], - - "movement\_restrictions": \[\] - - } - -} - -Agent Interaction Hints (Lightweight) -✅ What it does - -Helps agents prioritize and interpret chunks - -📍 Where to add - -Add under X. Execution & Operational Constraints - -🔧 Field -"agent_hints": { - "priority": "high | medium | low", - "typical_use_cases": [ - "definition", - "decision_support", - "comparison" - ], - "recommended_for": [ - "llm_reasoning", - "retrieval", - "decision_engine" - ] -} -💡 Why it matters -Improves agent efficiency -Reduces unnecessary retrieval - -## XI. Decision & Derivative Outputs (Optional but Future-Proof) - -28. **Derived Artifact Tracking** - - * Pricing decisions, recommendations, summaries, embeddings produced from this chunk - -29. **Attribution & Accountability Hooks** - - * Required citation, trace-back for AI outputs - -"derivatives": { - - "derived\_artifacts": { - - "pricing\_decisions": \[\], - - "recommendations": \[\], - - "summaries": \[\], - - "embeddings": \[\] - - }, - - "attribution": { - - "citation\_required": true, - - "traceback\_enabled": true - - } - -} - -Decision Impact Signals (Advanced, Optional) -✅ What it does - -Connects chunks to real-world outcomes - -📍 Where to add - -Add under XI. Decision & Derivative Outputs - -🔧 Field -"decision_impact": { - "used_in": ["recommendation", "purchase_decision"], - "confidence_delta": 0.35, - "outcome_quality": "high | medium | low" -} -💡 Why it matters - -This is the strongest future trust signal - -“Using this chunk improves decisions” - -# **Final Definition (Refined)** - -**Chunk Intelligence Signature (CIS)** - -A compact, verifiable, and extensible metadata envelope that allows AI systems to determine *what a chunk is, whether it is trustworthy, how it may be used, where it applies, who owns it, how valuable it is, and under what constraints it should influence decisions*—while minimizing inference errors, hallucinations, misuse, and opacity. - - -# **Re-chunking: do you rewrite CIS or create new DIDs?** - -This is the key architectural choice: - -## Option 1 (recommended): Preserve old chunks, create new chunks - -When you re-chunk due to improved segmentation: - -* Create **new chunk DIDs** - -* Mark old chunks as deprecated/superseded in CIS: - * temporal\_validity.deprecated \= true - - * integrity.version\_lineage.superseded\_by \= \[new\_dids\] - -This preserves auditability and avoids breaking any references. - -## Option 2: “Edit in place” (not recommended) - -If you rewrite the chunk content under the same DID, you lose: - -* integrity guarantees - -* stable citations - -* provenance clarity - -So re-chunking should be treated like creating a new version lineage, not overwriting. - -# **The Future \- How Does Content Chunks and the CIS Layer Evolve And What Do You Need To Do?** - -**if you do this well, you are “done” with the *content*.** - -**But you are never done with the *interpretation layer*.** - -Below is a clean way to think about **what stabilizes forever** vs **what evolves over time**, and when re-chunking actually makes sense in the future. - -## 1\. What becomes effectively immutable - -Once you: - -* Chunk the content well - -* Assign stable DID\_chunk - -* Hash exact bytes (CID\_chunk) - -* Build a strong CIS envelope - -* Run multiple enrichment passes - -* Resolve obvious labels, entities, references, relationships - -…then **the content itself is largely finished**. - -If the **original source never changes**, you generally do **not** re-chunk just because time passed. - -Think of this like: - -* Digitizing books - -* Scanning archives - -* Indexing legal cases - -* Encoding historical datasets - -The *text* doesn’t change. -The *understanding* of it does. - -## 2\. The key distinction: re-chunking vs re-interpreting - -Re-chunking (rare, structural) - -You re-chunk only when **the unit of meaning itself changes**. - -This happens when: - -1. **Your original chunk size was wrong** - - * Too big → mixed concepts - - * Too small → lost context - -2. **You discover systematic boundaries** - - * Repeated patterns that should be atomic - - * Sections that should always travel together - -3. **You adopt a fundamentally new consumption model** - - * e.g. agent-based workflows that require task-sized chunks - - * or proof-level granularity instead of paragraph-level - -Re-chunking is **structural surgery**. - You do it rarely and deliberately. - -When you do: - -* You create **new chunk DIDs** - -* Old chunks are deprecated, not overwritten - -* CIS lineage records the supersession - -## Re-interpreting (common, ongoing) - -This is where almost all future evolution happens. - -You **do not touch the chunk bytes**. - You **continuously enrich the CIS**. - -This includes: - -* New entities discovered - -* Better ontology alignment - -* New relationships between chunks - -* Updated confidence or uncertainty - -* New provenance insights - -* New permissions or policy overlays - -* New reputation and usage signals - -This is *cheap, safe, and compounding*. - -## 3\. What happens after “you’re done” (the real future) - -Once your corpus is well-structured, several **new phases** open up. - -Phase 1: Graph dominance (next 1–3 years) - -Your content stops being “documents” and becomes a **knowledge graph**. - -AI increasingly: - -* Traverses relationships instead of retrieving text - -* Answers questions by following edges - -* Uses CIS signals to rank trust and relevance - -At this stage: - -* CIS is more valuable than embeddings - -* Re-chunking almost never happens - -* Relationship density becomes the differentiator - -Phase 2: Agent-native reasoning (3–5 years) - -AI agents will: - -* Treat chunks as **tools**, not text - -* Evaluate CIS before deciding to read - -* Decide whether to: - - * Pay for access - - * Ask for related chunks - - * Verify claims - - * Defer to higher-confidence sources - -New enrichments appear: - -* Task success/failure signals - -* Agent feedback loops - -* Decision provenance - -* Outcome-based reputation - -Still no re-chunking. Just richer CIS. - -Phase 3: Retrospective reinterpretation (5+ years) - -This is the one case where **you may re-chunk**, even if the source didn’t change. - -Why? - -Because **new ways of knowing emerge**. - -Examples: - -* New scientific paradigms - -* New regulatory frameworks - -* New social or economic models - -* New ontologies that didn’t exist when you chunked - -At this point: - -* You don’t “fix” the old chunks - -* You create **new interpretive layers** - -* Sometimes you create **new derived chunks** - -* Old chunks remain historically valid - -This is like reinterpreting historical texts through modern theory. - -## 4\. The most important insight (this is the crux) - -**CIS turns chunking into a one-time capital investment,** - **and interpretation into a long-term compounding asset.** - -Before CIS: - -* You re-ingest - -* Re-embed - -* Re-index - -* Lose history - -With CIS: - -* Content stabilizes - -* Meaning evolves - -* Value compounds - -## 5\. A simple rule of thumb - -You re-chunk only if: - -* You would teach the content differently today *structurally*, not just semantically - -You re-enrich CIS when: - -* You understand the content better - -* The world changes - -* New tools exist - -* New relationships matter - -* New risks or permissions emerge - -## 6\. Where this ultimately leads - -Long-term, well-structured CIS corpora become: - -* Authoritative reference substrates - -* Training-safe, contamination-aware datasets - -* Agent-readable knowledge bases - -* Economic assets (licensable, auditable, provable) - -* Historical records with layered interpretation - -At that point, **re-chunking is the exception, not the evolution**. - -You’re not building a pipeline. You’re building **knowledge infrastructure**. And if you do the process you described *well*, you’ve set yourself up so that the future mostly adds value without breaking the past. - -# **Other** - -## User Input - -I am not sure where to put this or if it should be in this document at all. Thinking more like a Wiki, where users can provide raw input into this document to give chunks even more context. - -## JSON Agents - -A proposed standard to describe agents and their capabilities, tools, runtimes and governance. [https://github.com/JSON-AGENTS/Standard?tab=readme-ov-file](https://github.com/JSON-AGENTS/Standard?tab=readme-ov-file) This would be appended to this file or would be a parallel object to this file. - -Right now, this CIS envelope captures: - -* companies -* products -* content -* media -* FAQs -* documentation -* positioning -* Signals - -By adding agent manifests, you move from: “Who exists and what do they say?” to “Who can do what?” - -The index evolves into: - -* a capability graph -* not just a content graph - -Examples of indexed queries AI can now answer: - -* “Which paddlesports companies have agents that calculate board sizing?” -* “Which manufacturers provide local-execution warranty agents?” -* “Which robotics vendors publish folding or inspection agents?” -* “Which brands expose reconciliation, forecasting, or compliance agents?” - -Agents can then be rented in the same way that content as structured in this CIS envelope can be rented \- using http402 requests settled via stablecoins and blockchains. - -This extends to not just digital agents, but physical agents in robots. A company can develop a robotic agent to do a very specific physical task. It can publish that agent so others can rent it. The agent not only becomes an operational component but also a revenue generator. So the indexing of agents is key to helping companies become more discoverable who build agents. - -This is not just SEO or GEO. This is Capability Discoverability. It is turning knowledge and know how into a software asset so it can generate revenue. This is post-SAAS architecture. It is agent-as-a-licensed capability. This moves from hiring an expert to hiring an agent that the expert built. People and companies will not want to hire people but hire agents. In the AI era, where intelligence gets moved to AI, this is how people with skills and knowledge can monetize that, and actually, the only way they can monetize what they know. We are moving away from jobs to agents. - -More at [https://chatgpt.com/c/6904025b-8e50-8324-8846-404f93cf494e](https://chatgpt.com/c/6904025b-8e50-8324-8846-404f93cf494e) - diff --git a/specs/systems/cis-guided-semantic-chunk-generation-skill.md b/specs/systems/cis-guided-semantic-chunk-generation-skill.md deleted file mode 100644 index b156913..0000000 --- a/specs/systems/cis-guided-semantic-chunk-generation-skill.md +++ /dev/null @@ -1,901 +0,0 @@ -# Skill: CIS-Guided Semantic Chunk Materialization - -Human prompt to complete this skill: - -Using the attached skill, referencing the the attached, create the chunks.json file. Reference the attached chunk-intelligence-signature.md file to accompany this skill. For more reference, see the attached README.md file for the overall process and where the chunks.json fits and where we are in this process. Reference the attached skills and prior outputs for structural consistency. - -## Overview - -This skill converts semantically structured authored content into machine-readable `chunks.json` files. - -The input content should already contain: - -- frontmatter; -- semantic chunk boundaries; -- `chunk_id`; -- `knowledge_id`; -- `chunk_label`; -- `knowledge_label`. - -This skill uses the Chunk Intelligence Signature (CIS) envelope as the reference model for metadata, but it does not require every project to implement the full CIS envelope. - -Instead, this skill helps the human operator and AI determine the appropriate level of CIS-guided metadata depth for the corpus, use case, and downstream systems. - -This skill is the basis for an interative processed between the human and the AI to arrive at the right mix of CIS envelope metadata that should be included when creating `chunks.json` files. - -Consider carefully the final outcome/intent of this project, and works backwards from there. It is possible we start with a limited set of metadata from the CIS envelope now, and later, re-process the `chunks.json` with more metadata. - -The goal is to create a `chunks.json` file that is: - -- useful now; -- easy to inspect; -- semantically meaningful; -- compatible with future enrichment; -- compatible with future CIS expansion; -- suitable for retrieval, embeddings, knowledge graphs, QA generation, and AI agents. - -This skill is universal and may be used for: - -- websites; -- knowledgebases; -- documentation; -- white papers; -- reports; -- newsletters; -- transcripts; -- research libraries; -- educational systems; -- legal archives; -- scientific corpora; -- AI-native publishing systems; -- paywalled or economically gated knowledge systems. - ---- - -# 1. CIS-Guided Semantic Materialization - -## Purpose - -This skill treats `chunks.json` as a selective materialization of CIS-informed metadata. - -The CIS envelope is the broad reference model. - -The `chunks.json` file is the practical output layer. - -This means the chunk file should not blindly include every possible CIS field. Instead, it should include only the fields that are appropriate for the current corpus and use case. - -## Core Principle - -`chunks.json` is not the full CIS envelope. - -It is a selected semantic projection of the CIS envelope. - -For simple content, this projection may be light. - -For high-value, high-risk, research, legal, scientific, economic, or agent-facing content, this projection may be much deeper. - -## CIS Areas To Consider - -When deciding which metadata to include, evaluate whether the corpus needs metadata from these CIS areas: - -1. Identity and resolution -2. Integrity and versioning -3. Semantics and meaning -4. Context and applicability -5. Relationships and knowledge graph -6. Provenance and pedigree -7. Rights, permissions, and access -8. Privacy, safety, and compliance -9. Reputation, utility, and signals -10. Execution and operational constraints -11. Decision and derivative outputs - -Not every project needs every area. - -The human operator and AI should select the correct depth before generating the final `chunks.json`. - ---- - -# 2. Materialization Levels - -Before generating `chunks.json`, determine the desired materialization level. - -The level may be selected by the human operator or recommended by the AI based on the corpus type and project goals. - -## Level 1 — Lightweight Semantic Retrieval - -Use for: - -- simple static websites; -- blogs; -- newsletters; -- basic public pages; -- early prototypes; -- small documentation sets. - -Purpose: - -Create clean, lightweight semantic chunks for AI retrieval and indexing without operational complexity. - -Includes: - -- document metadata; -- chunk IDs; -- knowledge IDs; -- chunk labels; -- knowledge labels; -- order; -- heading path; -- content; -- short summary; -- tags. - -Does NOT include: - -- provenance chains; -- trust scoring; -- rights management; -- economic terms; -- ontology assertions; -- semantic lineage; -- privacy constraints; -- reputation signals. - -Recommended for the initial iNDX static website. - ---- - -## Level 2 — Enhanced Semantic Retrieval - -Use for: - -- larger websites; -- structured knowledgebases; -- internal documentation; -- white paper libraries; -- educational content; -- research notes; -- product documentation. - -Purpose: - -Improve retrieval, filtering, semantic classification, and AI summarization. - -Includes everything in Level 1, plus optional: - -- content type; -- primary topic; -- domain; -- entities; -- key concepts; -- intended audience; -- source alignment; -- confidence level; -- basic relationship hints. - -Example added fields: - -```json -"semantic_core": { - "content_type": "analysis", - "domain": ["ai", "publishing"], - "primary_topic": "AI-native findability", - "entities": [], - "key_concepts": [] -} -``` - -## Level 3 — Ontology-Aware Retrieval - -Use for: - -- AI-native knowledgebases; -- research corpora; -- industry intelligence systems; -- structured archives; -- policy libraries; -- technical reference systems. - -Purpose: - -Make chunks more useful for graph traversal, ontology mapping, multi-hop reasoning, and domain-specific AI agents. - -Includes everything in Levels 1 and 2, plus optional: - -- ontology references; -- controlled taxonomy labels; -- explicit semantic assertions; -- relationship mappings; -- applicability context; -- assumptions; -- scope; -- prerequisites; -- basic provenance. - -Example added fields: - -```json -"ontology": { - "ontology_refs": [], - "taxonomy_tags": [], - "semantic_assertions": [] -} -"context": { - "scope": "", - "assumptions": [], - "intended_audience": [], - "prerequisites": [] -} -``` - -## Level 4 — Graph-Native Semantic Infrastructure - -Use for: - -- serious knowledge graph systems; -- high-value research libraries; -- multi-author corpora; -- agent-facing knowledge systems; -- evolving AI-native reference systems; -- corpora where trust and lineage matter. - -Purpose: - -Create chunks that can support long-term semantic evolution, lineage, trust inheritance, relationship density, and graph-native reasoning. - -Includes everything in Levels 1–3, plus optional: - -- version lineage; -- supersedes / superseded_by; -- derived_from; -- semantic similarity to prior chunk; -- trust inheritance hints; -- cross-chunk links; -- interpretive relationships; -- assertion records; -- provenance records; -- enrichment workflow metadata. - -Example added fields: - -```json -"lineage": { - "supersedes": [], - "superseded_by": [], - "derived_from": [], - "semantic_similarity_to_previous": null, - "trust_inheritance": null -} -"relationships": { - "supports": [], - "depends_on": [], - "expands": [], - "contradicts": [], - "summarizes": [] -} -``` - -## Level 5 — Full CIS Implementation - -Use for: - -- paywalled knowledge systems; -- regulated content; -- legal or compliance systems; -- scientific datasets; -- high-value commercial corpora; -- decentralized knowledge infrastructure; -- agent-to-agent economic access systems; -- content requiring permissions, trust, provenance, and auditability. - -Purpose: - -Implement the CIS envelope as a full metadata infrastructure layer. - -Includes everything in Levels 1–4, plus: - -- DID_chunk; -- CID_chunk; -- CID_source; -- full provenance; -- ownership history; -- origin purity; -- rights and permissions; -- economic terms; -- privacy and compliance controls; -- reputation and utility signals; -- execution constraints; -- derivative artifact tracking; -- attribution requirements; -- policy overlays; -- payment or access metadata. - -This level is not recommended for simple static websites unless there is a clear need. - -# 3. Human + AI Metadata Negotiation - -Before generating the final chunks.json, the human operator and AI should agree on the metadata depth and schema. - -This is especially important when working with: - -large corpora; -specialized domains; -legal, scientific, financial, or technical content; -monetized content; -agent-facing content; -reusable knowledgebases. - -## Step 1 — Identify Corpus Type - -The AI should determine or ask the human to confirm the corpus type. - -Examples: - -static website; -documentation; -newsletter archive; -white paper library; -scientific corpus; -legal archive; -product knowledgebase; -internal company knowledgebase; -public AI-readable knowledgebase; -paywalled content library. - -## Step 2 — Identify Intended Use - -Determine what the chunk output will support. - -Examples: - -AI retrieval; -semantic search; -embeddings; -RAG; -public discovery; -website indexing; -internal knowledge management; -agent reasoning; -graph traversal; -compliance review; -monetized access; -future CIS integration. - -## Step 3 — Select Materialization Level - -Choose one of: - -Level 1 — Lightweight Semantic Retrieval -Level 2 — Enhanced Semantic Retrieval -Level 3 — Ontology-Aware Retrieval -Level 4 — Graph-Native Semantic Infrastructure -Level 5 — Full CIS Implementation - -If uncertain, choose the lowest level that satisfies current needs while preserving future compatibility. - -## Step 4 — Select Fields - -The AI should propose a field list based on the selected level. - -The human should approve, remove, or add fields. - -The final schema should be explicit before output generation. - -## Step 5 — Generate chunks.json - -Once the field list is approved, generate the final JSON. - -# 4. Minimal vs Extended Schemas - -## Minimal Schema - -Use for Level 1. - -Recommended default: - -```json -{ - "document": { - "title": "", - "slug": "", - "document_type": "", - "author": "", - "created_at": "", - "tags": [] - }, - "chunks": [ - { - "chunk_id": "", - "knowledge_id": "", - "chunk_label": "", - "knowledge_label": "", - "order": 1, - "heading_path": [], - "content": "", - "summary": "", - "tags": [] - } - ] -} -``` - -Use this when the goal is: - -simple AI readability; -basic retrieval; -static publishing; -low operational complexity. - -## Extended Schema - -Use for Levels 2–4. - -Example: - -```json -{ - "document": { - "title": "", - "slug": "", - "document_type": "", - "author": "", - "created_at": "", - "updated_at": "", - "summary": "", - "tags": [], - "source_path": "", - "canonical_url": "" - }, - "chunks": [ - { - "chunk_id": "", - "knowledge_id": "", - "chunk_label": "", - "knowledge_label": "", - "order": 1, - "heading_path": [], - "content": "", - "summary": "", - "tags": [], - - "semantic_core": { - "content_type": "", - "domain": [], - "primary_topic": "", - "entities": [], - "key_concepts": [], - "confidence_level": "" - }, - - "context": { - "scope": "", - "assumptions": [], - "intended_audience": [], - "prerequisites": [] - }, - - "relationships": { - "supports": [], - "depends_on": [], - "expands": [], - "contradicts": [], - "summarizes": [] - }, - - "lineage": { - "supersedes": [], - "superseded_by": [], - "derived_from": [], - "semantic_similarity_to_previous": null, - "trust_inheritance": null - }, - - "provenance": { - "creation_method": "", - "source_alignment": "", - "tooling": [], - "workflows": [] - } - } - ] -} -``` -``` - -Use this when the goal is: - -better AI retrieval; -semantic filtering; -ontology mapping; -relationship discovery; -future knowledge graph integration. - -## Full CIS-Aligned Schema - -Use for Level 5 only. - -The schema should be project-specific and derived directly from the full CIS envelope. - -Do not generate a full Level 5 schema unless the human explicitly requests it. - -# 5. Corpus-Specific Semantic Strategies - -Different corpora require different chunking and metadata strategies. - -Static Websites - -Recommended level: - -Level 1 - -Include: - -document metadata; -chunk identity; -semantic labels; -content; -summaries; -tags; -heading paths. - -Avoid: - -full provenance; -trust scoring; -rights systems; -economic terms; -deep ontology mapping. - -Goal: - -Make pages easy for AI systems to find, understand, summarize, and route. - -Newsletter or Email Archives - -Recommended level: - -Level 1 or Level 2 - -Include: - -publication date; -topic tags; -audience; -summary; -referenced links; -key concepts; -action items if present. - -Useful optional fields: - -```json -"email_context": { - "campaign": "", - "audience": [], - "original_send_date": "", - "source_platform": "" -} -``` - -Goal: - -Make past communications searchable, reusable, and AI-readable. - -White Paper Libraries - -Recommended level: - -Level 2 or Level 3 - -Include: - -primary topic; -claims; -entities; -assumptions; -scope; -intended audience; -source alignment; -ontology references if available. - -Goal: - -Support research, synthesis, citation, and conceptual retrieval. - -Documentation - -Recommended level: - -Level 2 or Level 3 - -Include: - -task type; -prerequisites; -steps; -dependencies; -affected systems; -related docs; -version applicability. - -Useful optional fields: - -```json -"task_context": { - "task_type": "", - "prerequisites": [], - "systems": [], - "dependencies": [] -} -``` - -Goal: - -Help AI agents and humans retrieve the right operational instructions. - -Scientific or Technical Corpora - -Recommended level: - -Level 3, Level 4, or Level 5 - -Include: - -domain; -entities; -methods; -evidence type; -confidence; -claims; -uncertainty; -citations; -provenance; -relationships; -applicability limits. - -Goal: - -Support high-confidence reasoning and careful scientific interpretation. - -Legal, Policy, or Compliance Archives - -Recommended level: - -Level 4 or Level 5 - -Include: - -jurisdiction; -effective dates; -authority; -normative status; -applicability; -exceptions; -conflicts; -supersession; -provenance; -rights and restrictions. - -Goal: - -Support careful, auditable retrieval where context and applicability matter. - -Monetized or Paywalled Knowledge Systems - -Recommended level: - -Level 4 or Level 5 - -Include: - -access rights; -pricing; -preview metadata; -usage permissions; -economic terms; -provenance; -reputation signals; -attribution requirements. - -Goal: - -Allow agents to evaluate whether content is worth accessing or paying for. - -Input Requirements - -The input markdown document should already contain: - -YAML frontmatter; -semantic chunk boundaries; -chunk_id; -knowledge_id; -chunk_label; -knowledge_label. - -Example: - - - -[content] - - - -# Output File - -The output should be a single machine-readable JSON file: - -chunks.json - -# Output Structure - -The top-level structure should follow this format: - -{ - "document": {}, - "chunks": [] -} - -# Field Rules - -## chunk_id - -Represents the specific chunk instance. - -Must preserve the authored UUID/DID-style identifier exactly. - -Do NOT regenerate. - -## knowledge_id - -Represents the enduring conceptual identity. - -Must preserve the authored UUID/DID-style identifier exactly. - -Do NOT regenerate. - -## chunk_label - -Human-readable structural label. - -Used for: - -debugging; -retrieval interpretation; -ontology reasoning; -graph inspection. -knowledge_label - -Human-readable conceptual label. - -Represents the enduring meaning of the chunk. - -Multiple chunks MAY reference the same knowledge_label. - -## order - -Represents narrative sequence within the document. - -Must preserve original document order. - -Starts at: - -1 - -## heading_path - -Represents the hierarchical heading structure above the chunk. - -Example: - -[ - "The iNDX Platform", - "IndustrySIG" -] - -This preserves: - -semantic hierarchy; -contextual breadcrumbs; -retrieval weighting; -structural context. - -## content - -Contains the full original chunk text. - -Preserve original formatting when possible. - -Do NOT: - -summarize; -paraphrase; -rewrite; -compress. - -## summary - -Generate a short semantic retrieval summary. - -Purpose: - -retrieval hinting; -embedding context; -semantic ranking; -AI understanding. - -This is NOT marketing copy. - -Ideal length: - -1–3 sentences. - -## tags - -Generate lightweight semantic tags. - -Tags should represent: - -concepts; -domains; -systems; -technologies; -industries; -major semantic themes. - -Avoid excessive tagging. - -Ideal range: - -3–10 tags. - -# Output Constraints - -Do NOT: - -invent missing content; -merge chunks; -split chunks; -alter IDs; -rewrite meaning; -flatten heading hierarchy; -add unsupported claims. - -# Important Architectural Principle - -This layer represents: - -stable semantic retrieval infrastructure - -It does not replace the CIS envelope. - -It is a practical, selected projection of CIS-informed metadata into a usable chunk file. - -# Final Output Requirement - -Output a COMPLETE valid chunks.json file. - -Do NOT output: - -markdown; -commentary; -explanations; -partial fragments. - -The output should be production-ready JSON suitable for direct ingestion into downstream systems. - -# Validation Requirements - -After generating the chunk.json: - -1. Verify all referenced files exist -2. Verify all slugs match -3. Verify no orphaned resources exist -5. Verify access routes are internally consistent - -A second AI agent should validate the output. \ No newline at end of file diff --git a/specs/systems/execute-content-structuring-process-overview-skill.md b/specs/systems/execute-content-structuring-process-overview-skill.md deleted file mode 100644 index a2437c9..0000000 --- a/specs/systems/execute-content-structuring-process-overview-skill.md +++ /dev/null @@ -1,251 +0,0 @@ -# Skill: Execute Content Structuring Process Overview - -# Step 1 - -Do not use below, yet. Use the skills in steps 2 and 3 in the README.md file, using the home.md page, manually with an AI chat. The reason is that the human and the AI need to iterate on selecting the best metadata content to be used in this projoect from the CIS Envelope. Once this is done, the human can proceed with having AI execute the following skill, below, for the remaining websie pages. When new pages are added, the human can most likely just use this skill below. Only if the home page content of the website is substanitally different might the interative process of adding metadata from the CIS Envelope be required. If so, then it is possible that all pages are processed again, but maybe not. It really depends. Use this interative process to discuss with AI. Or, if pages added to the website start to drift from the initial metadata used, then the human and I come back to this interative process. By referencing the initial home page, that can be flagged in the skill below. - -# Step 2 - -Use this skill when the human wants to process one or more authored Markdown pages through the iNDX website semantic publishing workflow. - -This skill coordinates the repo-level process described in `README.md`, especially: - -- Step 2: enrich authored Markdown with front matter, semantic chunk boundaries, and stable identifiers. -- Step 3: materialize the enriched page into `chunks.json` and `qa.json`. - -It does not replace the lower-level skills. It tells the AI how to use them together consistently. - ---- - -## Required References - -Before editing or generating anything, review: - -1. `README.md` - - Understand the repo purpose, website build process, and directory structure. - -2. `content/home.md` - - Treat the front matter and chunk marker style as the canonical page shape. - -3. `data/open/pages/home/chunks.json` - - Treat this as the canonical `chunks.json` metadata shape. - -4. `data/open/pages/home/qa.json` - - Treat this as the canonical `qa.json` metadata shape. - -5. Local skills in `skills-scripts/` - - `author-content-structuring-skill.md` - - `cis-guided-semantic-chunk-generation-skill.md` - - `semantic-qa-materialization-skill.md` - -Do not use the CIS envelope reference page unless the human explicitly asks for it. The current project uses the already-established home page metadata model as the practical canonical schema. - ---- - -## Canonical Output Model - -For every source page: - -1. Update the source `.md` file with: - - YAML front matter. - - Semantic chunk boundaries. - - Stable `chunk_id` values. - - Stable `knowledge_id` values. - - Human-readable `chunk_label` values. - - Human-readable `knowledge_label` values. - -2. Create a folder under: - -```text -data/open/pages/// -``` - -Example: - -```text -content/community-summaries/paddling/example-page.md -data/open/pages/community-summaries/paddling/example-page/ -``` - -3. Create: - -```text -chunks.json -qa.json -``` - -inside that folder. - ---- - -## Human Prompt Template - -Use or adapt this prompt when asking AI to process pages: - -```text -The README.md file explains what this repo is, the process for building website pages, and the directory structure. Please reference it. - -The home page has already been manually processed and checked. Use content/home.md plus data/open/pages/home/chunks.json and data/open/pages/home/qa.json as the canonical examples for front matter, identifiers, metadata, chunk structure, chunks.json, and qa.json. - -Process the following page or pages through README steps 2 and 3: - - - -For each page: -- preserve the author's meaning and voice; -- add front matter using the home.md metadata model; -- add semantic chunk boundaries with chunk_id, knowledge_id, chunk_label, and knowledge_label; -- create the corresponding chunks.json; -- create the corresponding qa.json; -- put chunks.json and qa.json in data/open/pages///; -- create directories as needed; -- do not use the CIS envelope reference page unless explicitly instructed. - -Before writing files, review the task, identify any confusion, and ask only necessary questions. Once clear, proceed. - -After writing files, validate that: -- JSON parses; -- every chunk_id in chunks.json appears in the markdown; -- every QA chunk reference points to an existing chunk; -- slugs and paths match the source page; -- no unrelated files were changed. -``` - ---- - -## Workflow - -### 1. Read Context - -Read the README and canonical home outputs before processing new pages. - -Use the home page to learn: - -- front matter fields; -- document metadata naming; -- slug style; -- chunk marker format; -- identifier style; -- `chunks.json` document fields; -- `chunks.json` chunk fields; -- `qa.json` document fields; -- `qa.json` QA pair fields. - -### 2. Read Source Pages - -Read every source `.md` page before deciding chunk boundaries. - -For multiple pages, it is acceptable to batch a few pages at a time when the model and tooling can handle it. If the pages are long or complex, process fewer pages per batch. - -### 3. Create Enriched Markdown - -Follow `author-content-structuring-skill.md`. - -Rules: - -- Preserve original meaning. -- Preserve links. -- Preserve useful headings. -- Do not rewrite into marketing copy. -- Clean obvious encoding damage only when it preserves the intended text. -- Split chunks by semantic reasoning shifts, not by formatting alone. -- Use durable opaque IDs for `chunk_id` and `knowledge_id`. -- Use readable semantic labels for `chunk_label` and `knowledge_label`. - -### 4. Create `chunks.json` - -Follow `cis-guided-semantic-chunk-generation-skill.md`, using the home page output as the practical schema. - -For this static website, use the lightweight/static-plus projection already established by the home page and community summary pages: - -- document metadata; -- chunk IDs; -- knowledge IDs; -- labels; -- order; -- heading paths; -- content; -- summaries; -- tags; -- light semantic/context fields where already established. - -### 5. Create `qa.json` - -Follow `semantic-qa-materialization-skill.md`, using the home page output as the practical schema. - -Generate QA pairs that improve: - -- retrieval; -- semantic understanding; -- navigation; -- synthesis; -- workflow execution when the source contains actions. - -Every meaningful chunk should be referenced by at least one QA pair. - -### 6. Validate - -Always perform a final inference and consistency pass. - -Check: - -- the enriched `.md` exists; -- `chunks.json` exists; -- `qa.json` exists; -- both JSON files parse; -- all `chunk_id` values in `chunks.json` appear in the `.md`; -- all `knowledge_id` values in `chunks.json` appear in the `.md`; -- all `qa.json` `chunk_ids` point to real chunks; -- all `qa.json` `knowledge_ids` point to real knowledge IDs; -- document slug matches the source filename; -- `source_path` matches the source page; -- `canonical_url` follows the site URL pattern; -- no orphaned output folders were created; -- no unrelated files were changed. - ---- - -## Windows And PowerShell Notes - -Be careful on Windows PowerShell: - -- Paths with drive letters and long filenames are easy to quote incorrectly. -- Very large inline `powershell -Command` strings can fail with command-length errors. -- Redirection and heredoc-style scripting can behave differently than expected. -- Some sandboxed shells may not have the same `python` path as elevated shells. -- Git may report dubious ownership when the repo is accessed from a sandbox user. - -Preferred approach: - -- Use direct PowerShell reads such as `Get-Content -Raw`. -- Use `apply_patch` for edits inside the writable workspace. -- For large generated outputs, write a small deterministic generator script in the workspace, then run it. -- If writing outside the writable workspace, request approval cleanly. -- For Git status on this repo, use a one-off safe-directory flag rather than changing global config: - -```powershell -git -c safe.directory=C:/projects/indx/indx-front-website -C C:\projects\indx\indx-front-website status --short -``` - ---- - -## Safety Notes - -- Do not revert user changes. -- Do not delete `_original` files unless the human explicitly asks; they may be retained as reference copies. -- Do not run destructive Git commands. -- Prefer deterministic, repeatable generation when processing many pages. -- Keep the source directory backed up or preserve originals before large batch work when appropriate. - ---- - -## Completion Report - -At the end, report: - -- pages processed; -- files created or updated; -- chunk and QA counts per page; -- validation results; -- any unrelated pre-existing repo changes noticed but left alone. - diff --git a/specs/systems/semantic-qa-materialization-skill.md b/specs/systems/semantic-qa-materialization-skill.md deleted file mode 100644 index 454d284..0000000 --- a/specs/systems/semantic-qa-materialization-skill.md +++ /dev/null @@ -1,835 +0,0 @@ -# Skill: Semantic QA Materialization - -Human prompt to complete this skill: - -Using the attached skill, referencing the chunks.json and the attached, create the qa.json file. For more reference, see the attached README.md file for the overall process and where the qa.json fits, and if needed the cis-guided...skill.md file, which likely you will not need at this point, is added for context. Reference the attached skills and prior outputs for structural consistency. - -## Overview - -This skill generates a structured `qa.json` reasoning layer from semantically structured content. - -The QA layer is not simply a FAQ system. - -It is semantic interaction infrastructure for: - -- AI retrieval; -- semantic search; -- embeddings; -- RAG systems; -- graph traversal; -- agent interaction; -- workflow execution; -- ontology enrichment; -- semantic routing; -- future economic access systems. - -The purpose of this layer is to help AI systems and humans: - -- understand the content; -- navigate the corpus; -- synthesize ideas across chunks; -- execute tasks; -- identify workflows; -- discover relationships; -- interact with knowledge programmatically. - -This skill is designed to work across: - -- static websites; -- documentation systems; -- white papers; -- newsletters; -- transcripts; -- research libraries; -- educational systems; -- product knowledgebases; -- AI-native publishing systems; -- agent-facing knowledge systems; -- monetized knowledge systems. - ---- - -# Core Architectural Principle - -The QA layer is: - -- a semantic retrieval layer; -- a reasoning layer; -- a routing layer; -- an interaction layer; -- an execution support layer. - -It is NOT merely: - -- marketing FAQs; -- website support questions; -- simplistic summarization. - -Questions and answers should help AI systems understand: - -- meaning; -- relationships; -- applicability; -- workflows; -- actions; -- conceptual structure; -- navigation paths; -- operational next steps. - ---- - -# Input Requirements - -The source content should already be semantically structured. - -Recommended inputs: - -- Markdown with semantic chunk boundaries; -- `chunks.json`; -- CIS-informed metadata; -- semantic labels; -- heading hierarchy. - -The preferred source is: - -`chunks.json` - -because it already contains: - -- semantic structure; -- summaries; -- tags; -- concepts; -- entities; -- context. - ---- - -# QA Generation Principles - -Generate questions that improve: - -- retrieval; -- semantic understanding; -- synthesis; -- navigation; -- workflow execution; -- ontology discovery; -- agent usability. - -Questions should vary across: - -- specificity; -- abstraction; -- phrasing; -- audience; -- intent; -- reasoning depth. - -The QA layer should represent how humans and AI agents naturally interact with the knowledge. - ---- - -# Types Of Questions To Generate - -Generate a mix of: - -## 1. Factual Questions - -Direct retrieval questions. - -Example: - -- What is IndustrySIG? -- What does SIG stand for? - -Purpose: - -- fast retrieval; -- grounding; -- direct lookup. - ---- - -## 2. Conceptual Questions - -Meaning and interpretation questions. - -Example: - -- Why does iNDX believe findability matters in the AI era? -- How does AI-native indexing differ from traditional search visibility? - -Purpose: - -- reasoning; -- conceptual understanding; -- semantic synthesis. - ---- - -## 3. Comparative Questions - -Compare systems, concepts, or approaches. - -Example: - -- How does NetworkSIG differ from traditional professional networking platforms? -- How do IndustrySIG and TerraSIG serve different functions? - -Purpose: - -- differentiation; -- semantic mapping; -- ontology development. - ---- - -## 4. Procedural Questions - -Explain workflows or operational steps. - -Example: - -- How can someone become an Industry Indexer? -- How does someone participate in Snap For Science? - -Purpose: - -- task execution; -- onboarding; -- workflow support. - ---- - -## 5. Navigational Questions - -Help AI systems or users locate information. - -Example: - -- Where can I find the white paper about decentralized networking? -- Which section explains ecological intelligence? - -Purpose: - -- routing; -- corpus navigation; -- retrieval optimization. - ---- - -## 6. Strategic Questions - -High-level implication or systems-thinking questions. - -Example: - -- Why is decentralized discoverability important for small businesses? -- What role does structured discovery play in economic participation? - -Purpose: - -- strategic reasoning; -- systems understanding; -- long-range synthesis. - ---- - -## 7. Synthesis Questions - -Combine multiple chunks or systems into one answer. - -Example: - -- How do the four iNDX systems reinforce one another? -- How do IndustrySIG and NetworkSIG work together? - -Purpose: - -- multi-hop reasoning; -- graph traversal; -- cross-chunk synthesis. - ---- - -# Question Quality Rules - -Questions should: - -- sound natural; -- reflect realistic user or agent behavior; -- vary in phrasing; -- vary in specificity; -- avoid repetition; -- improve retrieval diversity. - -Generate both: - -- broad questions; -- narrow questions. - -Include both: - -- human phrasing; -- AI-agent-style retrieval phrasing. - ---- - -# Answer Rules - -Answers must: - -- remain grounded strictly in source content; -- avoid hallucination; -- avoid unsupported claims; -- avoid speculation; -- preserve original meaning. - -Answers should: - -- be concise but complete; -- optimize for retrieval clarity; -- preserve semantic fidelity; -- support downstream embeddings. - -Do NOT: - -- rewrite the original meaning; -- add external knowledge; -- inject opinions; -- infer unsupported relationships. - ---- - -# Cross-Chunk Synthesis Rules - -Questions MAY reference multiple chunks. - -Use: - -```json -"knowledge_ids": [] -"chunk_ids": [] -``` - -to support: - -- multi-hop reasoning; -- semantic synthesis; -- graph traversal; -- cross-document retrieval. - -Example: - -```json -"knowledge_ids": [ - "kid-123", - "kid-456" -] -``` - -This is strongly encouraged when concepts naturally connect. - ---- - -# QA Types - -Each QA entry should include: - -```json -"qa_type": "" -``` - -Recommended values: - -- factual -- conceptual -- comparative -- procedural -- navigational -- strategic -- synthesis -- workflow -- glossary - -Purpose: - -- semantic routing; -- retrieval weighting; -- reasoning selection; -- agent orchestration. - ---- - -# Intent Classification - -Each QA entry should include: - -```json -"intent": "" -``` - -Recommended values: - -- discover -- understand -- compare -- evaluate -- execute -- navigate -- participate -- contribute -- summarize -- learn -- research -- implement - -Purpose: - -- agent routing; -- workflow execution; -- future monetization systems; -- retrieval prioritization. - ---- - -# Actionability Layer - -If the content references: - -- workflows; -- templates; -- tools; -- operational processes; -- onboarding flows; -- participation systems; -- execution steps; - -then include an `actionability` object. - -Example: - -```json -"actionability": { - "has_workflow": true, - "tools": [], - "processes": [], - "next_steps": [] -} -``` - -This helps future systems: - -- execute workflows; -- guide users; -- support AI agents; -- generate next-step recommendations. - -Do NOT invent workflows that are not supported by the source content. - ---- - -# Entities And Concepts - -Each QA entry should include lightweight semantic extraction: - -```json -"entities": [], -"concepts": [], -"tags": [] -``` - -Purpose: - -- semantic filtering; -- ontology enrichment; -- embeddings; -- graph construction; -- retrieval ranking. - -Avoid excessive tagging. - -Prefer meaningful semantic signals. - ---- - -# Audience Classification - -If feasible, include: - -```json -"audience": [] -``` - -Examples: - -- business owners -- researchers -- developers -- industry participants -- conservation leaders -- educators -- AI practitioners - -Purpose: - -- routing; -- personalization; -- retrieval refinement. - ---- - -# Source Grounding - -Each QA entry should include: - -```json -"source_chunks": [] -``` - -These should reference the literal chunk sources used to generate the answer. - -Example: - -```json -"source_chunks": [ - "chk-abc123" -] -``` - -Purpose: - -- provenance; -- trust; -- grounding; -- future citations; -- paywall preview systems. - ---- - -# Related Questions - -If useful, include: - -```json -"related_questions": [] -``` - -Purpose: - -- graph traversal; -- semantic expansion; -- recommendation systems; -- agent reasoning chains. - ---- - -# Materialization Levels - -## Level 1 — Lightweight QA Retrieval - -Use for: - -- simple websites; -- blogs; -- newsletters; -- early prototypes. - -Includes: - -- question; -- answer; -- qa_type. - -Purpose: - -Simple semantic retrieval. - ---- - -## Level 2 — Enhanced Semantic QA - -Use for: - -- structured websites; -- knowledgebases; -- white papers; -- documentation. - -Includes: - -- qa_type; -- intent; -- tags; -- concepts; -- entities; -- source_chunks. - -Purpose: - -Better retrieval and semantic routing. - -Recommended default for most iNDX website pages. - ---- - -## Level 3 — Graph-Aware QA - -Use for: - -- ontology-aware systems; -- research libraries; -- AI-native publishing systems; -- agent-facing systems. - -Includes: - -- knowledge_ids; -- chunk_ids; -- relationships; -- synthesis questions; -- audience; -- actionability. - -Purpose: - -Support graph traversal and multi-hop reasoning. - ---- - -## Level 4 — Agent-Executable QA - -Use for: - -- operational agent systems; -- workflow execution systems; -- task automation systems. - -Includes: - -- executable workflows; -- procedural decomposition; -- tool references; -- operational constraints; -- execution hints. - -Purpose: - -Allow AI systems to execute tasks directly from QA structures. - ---- - -## Level 5 — Economic And Policy-Aware QA - -Use for: - -- monetized systems; -- regulated systems; -- permissioned systems; -- agent-to-agent commerce systems. - -Includes: - -- access rights; -- economic terms; -- permissions; -- pricing; -- trust metadata; -- policy overlays. - -Purpose: - -Support programmable access and AI-native commerce. - ---- - -# Recommended Default Schema - -```json -{ - "document": { - "title": "", - "slug": "", - "materialization_level": 2, - "generated_at": "", - "source_document": "" - }, - - "qa_pairs": [ - { - "qa_id": "", - - "question": "", - "answer": "", - - "qa_type": "", - "intent": "", - - "knowledge_ids": [], - "chunk_ids": [], - - "source_chunks": [], - - "entities": [], - "concepts": [], - "tags": [], - - "audience": [], - - "related_questions": [], - - "actionability": { - "has_workflow": false, - "tools": [], - "processes": [], - "next_steps": [] - } - } - ] -} -``` - ---- - -# Corpus-Specific Guidance - -## Static Websites - -Recommended level: - -Level 2 - -Focus on: - -- discoverability; -- semantic retrieval; -- navigation; -- conceptual understanding. - -Avoid excessive metadata complexity. - ---- - -## Documentation - -Recommended level: - -Level 2 or 3 - -Include: - -- workflows; -- prerequisites; -- dependencies; -- execution steps. - ---- - -## White Papers - -Recommended level: - -Level 2 or 3 - -Focus on: - -- conceptual synthesis; -- strategic implications; -- ontology relationships; -- research retrieval. - ---- - -## Research Libraries - -Recommended level: - -Level 3 or 4 - -Focus on: - -- graph traversal; -- semantic lineage; -- synthesis; -- evidence relationships. - ---- - -## Monetized Knowledge Systems - -Recommended level: - -Level 4 or 5 - -Include: - -- previews; -- permissions; -- value signaling; -- economic routing. - ---- - -# Important Architectural Principle - -The QA layer is: - -semantic interaction infrastructure - -—not merely FAQ generation. - -Over time this layer may evolve into: - -- executable workflows; -- semantic APIs; -- agent interaction contracts; -- retrieval orchestration layers; -- AI-native execution interfaces. - -Design the QA layer with future graph and agent systems in mind. - ---- - -# Final Output Requirement - -Output a COMPLETE valid `qa.json` file. - -Do NOT output: - -- markdown commentary; -- explanations; -- partial fragments; -- pseudo-JSON. - -The final output should be: - -- production-ready; -- machine-readable; -- semantically grounded; -- suitable for direct ingestion into downstream systems. - -# Chunk Coverage Validation - -After QA generation completes: - -1. Compare all chunk_id values in chunks.json -2. Compare all referenced chunk_ids in qa.json -3. Identify: - - orphaned chunks; - - over-referenced chunks; - - under-referenced chunks. - -Recommended minimum: - -- every meaningful chunk should have at least one QA reference; -- strategic chunks should have multiple QA references; -- synthesis chunks should connect across multiple chunks. - -Possible exclusions: - -- placeholders; -- decorative fragments; -- empty UI scaffolding; -- forms. -