From ccd6611fc0c2309e84fb4bc7c58ea44b5776d390 Mon Sep 17 00:00:00 2001 From: Nubenetes Bot Date: Sun, 17 May 2026 10:41:33 +0200 Subject: [PATCH] feat(ai): implement V1 immutability rules, rich metadata enrichment, and MkDocs safety guard --- GEMINI.md | 3 ++ README.md | 6 +++- data/link_rules.yaml | 58 +++++++++++++++++++++++-------------- src/agentic_curator.py | 66 +++++++++++++++++++++++++++++++++++++----- src/main.py | 18 ++++++++++++ src/migrate_legacy.py | 44 ---------------------------- src/safety_guard.py | 52 +++++++++++++++++++++++++++++++++ src/v2_optimizer.py | 8 ++++- 8 files changed, 181 insertions(+), 74 deletions(-) delete mode 100644 src/migrate_legacy.py create mode 100644 src/safety_guard.py diff --git a/GEMINI.md b/GEMINI.md index 4f052b72..0fe56303 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -17,6 +17,9 @@ This file contains the accumulated instructions and long-term vision for the aut - **Primary Language**: English is the official language of the Nubenetes ecosystem. - **Native Preservation (V1 Archive)**: For non-English resources (e.g., Spanish repositories, videos, or articles), the V1 description MUST remain in the **resource's native language** to preserve its original context and cater to native speakers. - **Global Synthesis (V2 Portal)**: To ensure 100% global discoverability, the V2 Elite summaries (`ai_summary`) MUST always be in **Professional English**, regardless of the source language. + - **V1 Immutability**: For links already present in the V1 archive, AI agents MUST NOT overwrite manually curated titles, stars, or additional descriptive comments. Only broken URLs or missing metadata fields (like year/language) should be updated. + - **Rich Metadata Enrichment**: AI agents SHOULD attempt to extract technical authors, video durations (YouTube), and reading times (Blogs) to populate high-density dimensions in the V2 portal. + - **Safety Guard Validation**: Every automated PR MUST undergo syntax validation and a test MkDocs build to prevent broken rendering or security vulnerabilities in the final site. - **Explicit Language Tagging**: All non-English resources in the V2 Portal MUST be explicitly tagged (e.g., `[SPANISH CONTENT]`, `[FRENCH CONTENT]`) at the end of the entry to inform global users before they navigate. - **English-First Exceptions**: Global software projects (even if created by Spanish speakers) that use English as their primary interface should be curated entirely in English. Native preservation is for localized content like blogs, videos, and guides. 11. **Workflow-Config Synchronization**: The GitHub Actions curation workflow form (`agentic_cron.yml`) MUST remain perfectly synchronized with the curation sources configuration file (`data/curation_sources.yaml`). Any addition, removal, or renaming of topics/categories in the configuration file requires a corresponding update to the workflow's input fields (checkboxes) to ensure users can toggle those sources manually. This maintains consistency between data-driven sources and the UI trigger. diff --git a/README.md b/README.md index 055c5a83..71d554de 100644 --- a/README.md +++ b/README.md @@ -259,6 +259,8 @@ To embrace the diverse global Cloud Native community while maintaining internati * `language`: The identified source language (e.g., 'Spanish', 'French'). * `resource_type`: Classification (e.g., 'Blog', 'Repository', 'Case Study'). * `complexity`: Target audience level (e.g., 'Beginner', 'Architect'). + * `author`: Technical creator/contributor identification. + * `duration` / `reading_time`: Automatic extraction of content length for videos and articles. - **Separation of Concerns (Data vs. UI)**: * **The Database (Source of Truth)**: Holds raw data, enabling future features like language-based filtering or statistics without re-processing links. * **The Portal (Visual Rendering)**: The `V2VisionEngine` dynamically converts the `language`, `complexity`, and `type` metadata into visual UI tags (e.g., `[SPANISH CONTENT]`, `[ARCHITECT LEVEL]`) during the site build process. @@ -424,7 +426,9 @@ graph TD ``` ### 7.6. Strategic Benefits -- **Linguistic Diversity and Global Access**: AI agents automatically detect the source language. **V1 Archive** preserves descriptions in the resource's native language (e.g., Spanish) to respect original context, while the **V2 Portal** provides professional English summaries and explicit language tagging (e.g., `[SPANISH CONTENT]`) for global accessibility. +- **Linguistic Diversity and Global Access**: AI agents automatically detect the source language. **V1 Archive** preserves descriptions in the resource's native language (e.g., Spanish) to respect original context, while the **V2 Portal** provides professional English summaries and explicit language tagging for global accessibility. +- **Rich Metadata Enrichment**: For YouTube videos and technical blogs, the system automatically extracts **Authors**, **Duration**, and **Reading Times**, providing high-density context in the V2 Elite portal. +- **Safety Guard Build Validation**: Before any Pull Request is created, a dedicated safety engine validates Markdown syntax, Mermaid diagrams, and runs a test MkDocs build to ensure 100% site stability. - **Universal English Curation**: All high-level reasoning and synthesis are curated into professional technical English, maintaining Nubenetes as a truly global resource. - **Semantic Conflict Resolution**: AI identifies multiple URLs pointing to the same technical project (e.g., repository vs. landing page) and automatically consolidates them into a single canonical reference. - **Critical Asset Monitoring**: While the exhaustive health check runs every **3 months**, high-priority assets ([DE FACTO STANDARD]) undergo a specialized pulse check every **3 months (offset by 45 days)** to ensure essential industry tools remain online with maximum reliability. diff --git a/data/link_rules.yaml b/data/link_rules.yaml index 2be9fa9a..35a09564 100644 --- a/data/link_rules.yaml +++ b/data/link_rules.yaml @@ -1,25 +1,41 @@ -# Nubenetes Link Cleaning & Consolidation Rules -# This file defines the strictness of URL transformations. +# Nubenetes Master Policy: V1 (Preservation) vs. V2 (Optimization) +# This file governs how AI agents interact with different layers of the ecosystem. -v1_archive_rules: - deep_link_priority: true # If a deep link (subfolder, wiki, PR) is ALIVE, DO NOT truncate to root. - github_io_preservation: true # Never map .github.io to github.com if the .github.io is ALIVE. +# ----------------------------------------------------------------------------- +# V1 ARCHIVE: THE SOURCE OF TRUTH (Human-Centric / Conservative) +# ----------------------------------------------------------------------------- +v1_preservation_rules: + # IMMUTABILITY: If these exist, the AI MUST NOT touch them + immutable_fields: + - "titles" # AI never renames a link already present in V1. + - "stars" # Manual 🌟 badges have absolute priority. + - "manual_descriptions" # Long-form descriptive notes are sacred. + + link_strictness: + deep_link_priority: true # Always keep subfolders/wikis if ALIVE. + github_io_preservation: true # No auto-mapping to github.com. + forbidden_truncations: ["/pull/", "/wiki/", "/issues/", "/tree/", "/blob/"] consolidation_policy: - allow_on_404: true # Only truncate to root if the specific deep link is a 404. - update_description: true # If consolidated to root, the description MUST be regenerated by AI. - - forbidden_truncations: - - "/pull/" # Pull Requests are specific technical context. - - "/wiki/" # Wikis contain specific documentation. - - "/issues/" - - "/tree/" # Subfolders indicate specific technical focus. - - allowed_truncations: - - "/blob/main/README.md" # READMEs can be consolidated to root. - - "/blob/master/README.md" - - ".git" # Strip .git suffix. + allow_on_404: true # Only truncate to root if deep link is dead. + update_metadata: true # If link changes, update only in the BBDD. - - semantic_deduplication: - prefer_repo_over_page: false # In V1, we keep whatever was manually curated if it works. +# ----------------------------------------------------------------------------- +# V2 PORTAL: THE ELITE SHOWCASE (AI-Centric / Optimized) +# ----------------------------------------------------------------------------- +v2_optimization_rules: + consolidation_strategy: "Executive" # Aggregate deep links to project roots. + maturity_threshold: 30 # Minimum stars for GitHub Elite inclusion. + auto_translate: true # Summaries MUST be in English. + rich_metadata_enrichment: + youtube: ["author", "duration"] + blogs: ["reading_time", "author"] + github: ["stars", "last_commit", "topics"] + +# ----------------------------------------------------------------------------- +# SYSTEM SAFETY: MKDOCS GUARD +# ----------------------------------------------------------------------------- +safety_guard: + validate_mkdocs_syntax: true + forbidden_tags: ["