From bf6a817d0710f34dce69398ffd078d27380683f0 Mon Sep 17 00:00:00 2001 From: Nubenetes Bot Date: Sun, 17 May 2026 12:45:54 +0200 Subject: [PATCH] feat(ops): make hierarchy depth configurable and finalize recursive O'Reilly architecture documentation --- README.md | 6 +++--- src/v2_optimizer.py | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 51aec45c..2c864271 100644 --- a/README.md +++ b/README.md @@ -269,7 +269,7 @@ To embrace the diverse global Cloud Native community while maintaining internati * `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. - * `area` / `topic` / `subtopic`: Persistent architectural classification for hierarchical grouping. + * `hierarchy`: Persistent, **recursive technical classification** (list of up to 10 levels) for O'Reilly-style grouping. - **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. @@ -438,7 +438,7 @@ graph TD ### 7.6. Strategic Benefits - **Technical Immutability (V1)**: AI agents are strictly forbidden from overwriting human-curated titles, manual 🌟 stars, or additional descriptive comments in the V1 archive, ensuring the bot respects and preserves manual engineering effort. -- **Structural Intelligence Persistence**: High-precision architectural classification (Area, Topic, Subtopic) is stored as persistent metadata. This allows all workflows to reuse structural insights, reducing AI costs by >90% and ensuring perfect consistency between V1 reorganization and V2 portal generation. +- **Structural Intelligence Persistence**: High-precision technical classification is stored as a persistent, **recursive hierarchy** (up to 10 levels deep). This allows all workflows to reuse deep structural insights, reducing AI costs by >90% and ensuring perfect consistency between V1 reorganization and V2 portal generation. - **Self-Healing Infrastructure**: The engine automatically detects and rescues broken links (e.g., GitHub `master` -> `main` branch migration) and identifies parked/expired domains that bypass standard health checks. - **Zero-to-Hero Learning Paths**: V2 resources are systematically grouped by complexity level (Fundamentals, Intermediate, Advanced, Architect), transforming the portal into a structured educational journey for Cloud Native engineering. - **Special Assets Preservation**: High-value documents (Introduction, YAML, Awesome repos) undergo high-precision semantic grouping in V1 and exhaustive inclusion in V2 to ensure 100% technical preservation. @@ -681,7 +681,7 @@ Certain files are designated as **Special Assets** (defined in [`data/special_as - **Awesome Repositories**: Preserved curation lists that act as gateways to specialized sub-ecosystems. **Rules of Engagement:** -1. **High-Precision Grouping**: AI agents use nested hierarchies (Areas -> Topics -> Subtopics) to organize these files without losing any technically valid reference, following a **Professional Technical Book** (O'Reilly style) structure. +1. **High-Precision Grouping**: AI agents use **recursive nested hierarchies** (up to 10 levels) to organize these files without losing any technically valid reference, following a **Professional Technical Book** (O'Reilly style) structure. 2. **Elite Curation**: For the V2 Portal, `introduction.md` undergoes a specialized "Elite selection" (Impact ≥ 4) to ensure a high-density entry point for global users. ### 🎓 O'Reilly-style Knowledge Architecture diff --git a/src/v2_optimizer.py b/src/v2_optimizer.py index 8758e059..49eb43e0 100644 --- a/src/v2_optimizer.py +++ b/src/v2_optimizer.py @@ -19,6 +19,8 @@ class V2VisionEngine: def __init__(self): # Load Special Assets & Rules self.special_assets_rules = self._load_special_assets() + self.link_rules = self._load_link_rules() + self.max_depth = self.link_rules.get("hierarchy_rules", {}).get("max_depth", 10) # 100% Comprehensive 2026 Taxonomy self.dimensions = { @@ -41,7 +43,7 @@ class V2VisionEngine: "PHASE 1: TECHNICAL PRESERVATION & CURATION\n" "- KEEP >90% of technical resources (except for 'introduction.md' where only high-impact links are kept).\n" "PHASE 2: SOPHISTICATED HIERARCHICAL CLASSIFICATION\n" - "- Identify TECHNICAL_HIERARCHY: A list of strings (max 10) representing Area > Topic > Subtopics.\n" + "- Identify TECHNICAL_HIERARCHY: A list of strings (max depth configured) representing Area > Topic > Subtopics.\n" "- For 'introduction.md', set is_microservice: true if context matches.\n" "PHASE 3: KNOWLEDGE ASSIMILATION FLOW\n" "- Order hierarchy to facilitate a structured learning journey: from foundations to advanced internals.\n" @@ -60,6 +62,14 @@ class V2VisionEngine: except: return {} return {} + def _load_link_rules(self) -> Dict: + path = "data/link_rules.yaml" + if os.path.exists(path): + try: + with open(path, "r") as f: return yaml.safe_load(f) or {} + except: return {} + return {} + def _load_inventory(self) -> Dict: if os.path.exists(INVENTORY_PATH): try: @@ -221,7 +231,7 @@ class V2VisionEngine: hierarchy = item.get("hierarchy", []) if hierarchy and (hierarchy[0] == dim or hierarchy[0] == cat_name): hierarchy = hierarchy[1:] current = v2_structure[dim]["categories"][cat_name] - for h_name in hierarchy[:10]: + for h_name in hierarchy[:self.max_depth]: if h_name not in current: current[h_name] = {"__links__": []} current = current[h_name] current["__links__"].append(item)