diff --git a/GEMINI.md b/GEMINI.md index 3b9dfb72..d52aed5f 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -186,9 +186,11 @@ Whenever a significant curation cycle (automatic or manual) is completed, the RE * Update the "Comparison Matrix" if the technical differences between V1 and V2 evolve. ### 5. Automation vs Manual Intervention -* **Automated Updates:** The Agentic Bot should ideally include a step to refresh these metrics in its curation PRs. -* **Manual Fallback:** If a manual update is performed (emergency fixes, structural changes), the human/AI agent is responsible for manually running the metric extraction scripts and updating the `README.md` accordingly. +* **Automated Updates**: The Agentic Bot should ideally include a step to refresh these metrics in its curation PRs. +* **Manual Fallback**: If a manual update is performed (emergency fixes, structural changes), the human/AI agent is responsible for manually running the metric extraction scripts and updating the `README.md` accordingly. +* **README Integrity Guardrail**: Whenever `README.md` is modified, the agent MUST execute `python3 src/safety_readme.py`. This tool verifies the presence and correct numbering of all **15 mandatory technical sections**. Any PR that fails this audit MUST NOT be merged. * **Algorithm-README Sync**: Whenever the AI curation logic, model tiering, or the extraction algorithm is modified (e.g., `src/gemini_utils.py` or `src/v2_optimizer.py`), the `README.md` MUST be updated to reflect these technical changes in the "Agentic Stack" and "Architectural Shift" sections. + * **Hierarchical README Maintenance**: Whenever `README.md` is modified, the Table of Contents (TOC) MUST be updated to reflect all changes in sections (H2) and subsections (H3). All titles in the document MUST include hierarchical numbering (e.g., "1. Section", "1.1. Subsection") perfectly synchronized with the TOC. * **Universal Title Standards**: Emojis and ampersands (&) MUST NOT be used in any section titles or Table of Contents. Ampersands MUST be replaced with "and". All anchors MUST be lowercase slugs (Mandate 30). * **Asset Inventory and Configuration**: The `README.md` MUST maintain a "Repository Inventory and Configuration" section (Section 13) that provides an exhaustive list of all key configuration files, centralized metadata databases, autonomous workflows, and core source code files. Each item MUST be linked using a relative Markdown path (e.g., `[file.yaml](data/file.yaml)`) to facilitate direct navigation. diff --git a/README.md b/README.md index 8993bf66..29119ae7 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,10 @@ * [14.1. Special Assets Management](#141-special-assets-management) * [14.2. O.Reilly-style Knowledge Architecture](#142-oreilly-style-knowledge-architecture) * [14.3. TOC and Structural Exceptions](#143-toc-and-structural-exceptions) +15. [15. Licensing and Legal Disclaimer](#15-licensing-and-legal-disclaimer) + * [15.1. Repository License](#151-repository-license) + * [15.2. Content Ownership](#152-content-ownership) + * [15.3. Legal Disclaimer](#153-legal-disclaimer) --- @@ -718,3 +722,16 @@ The V2 Portal is structured as a sophisticated technical reference guide, moving Certain files are exempt from the mandatory Table of Contents (TOC) and deep-hierarchy requirements. These include configuration-heavy files (e.g., `mkdocs.md`) and large technical tables (e.g., `matrix-table.md`) where a navigational index is unnecessary or distracting. - **Automatic Skip**: The Agentic Curator and V2 Builder automatically bypass these files during structural reorganization cycles. - **Exception Registry**: Exemptions are managed via the `toc_exempt_files` list in [`data/link_rules.yaml`](data/link_rules.yaml). + +--- + +## 15. Licensing and Legal Disclaimer + +### 15.1. Repository License +The core logic, autonomous agents, and documentation of Nubenetes are licensed under the **MIT License**. You are free to use, modify, and distribute the code as long as the original copyright notice is preserved. + +### 15.2. Content Ownership +The technical resources (links, articles, videos) curated in this archive are the intellectual property of their respective authors and organizations. Nubenetes acts solely as a technical directory and does not host or claim ownership over the external content. + +### 15.3. Legal Disclaimer +The information provided in this repository is for educational and professional reference purposes only. While our Agentic AI ensures high-fidelity curation, users should verify production configurations against official vendor documentation (AWS, Red Hat, CNCF) before deployment. diff --git a/src/safety_readme.py b/src/safety_readme.py new file mode 100644 index 00000000..843deb33 --- /dev/null +++ b/src/safety_readme.py @@ -0,0 +1,68 @@ +import re +import sys +import os + +REQUIRED_SECTIONS = [ + "1. Introduction and Motivation", + "2. Repository Metrics and Evolution", + "3. The Agentic Stack", + "4. The 2026 Architectural Shift", + "5. Dual-Edition Architecture (V1 vs V2)", + "6. The Unified Agentic Database (Knowledge Graph)", + "7. AI Economic Architecture and Cost Analysis", + "8. The Agentic AI Engine", + "9. GitHub Workflows and Automation", + "10. Branching Strategy and Lifecycle", + "11. Contributing to the Archive", + "12. Developer Experience and VSCode Setup", + "13. Repository Inventory and Configuration", + "14. Special Assets and Learning Paths", + "15. Licensing and Legal Disclaimer" +] + +def check_readme(): + if not os.path.exists("README.md"): + print("❌ README.md not found!") + return False + + with open("README.md", "r") as f: + content = f.read() + + errors = [] + + # 1. Check for mandatory headers + headers = re.findall(r'^## (.*)', content, re.MULTILINE) + + for section in REQUIRED_SECTIONS: + found = False + for h in headers: + if section in h: + found = True + break + if not found: + errors.append(f"Header missing or misnumbered: '## {section}'") + + # 2. Check for Table of Contents synchronization + toc_links = re.findall(r'\[(\d+\. .*?)\]\(#.*?\)', content) + for section in REQUIRED_SECTIONS: + if section not in toc_links: + errors.append(f"TOC entry missing or misnumbered: '{section}'") + + # 3. Check for drastic size reduction (Safety Guardrail) + # Average size is > 30KB. If it drops below 20KB, it's suspicious. + size_kb = len(content) / 1024 + if size_kb < 20: + errors.append(f"README.md size is suspiciously small ({size_kb:.2f} KB). Possible data loss.") + + if errors: + print("🛡️ README Integrity Audit: ❌ FAILED") + for err in errors: + print(f"- {err}") + return False + else: + print("🛡️ README Integrity Audit: ✅ PASSED (15/15 Sections Validated)") + return True + +if __name__ == "__main__": + if not check_readme(): + sys.exit(1)