arch: decouple V2 monolith into specialized micro-workflows (Health, Metadata, AI, Publish)

This commit is contained in:
Nubenetes Bot
2026-05-22 10:49:28 +02:00
parent 87d42ea6ac
commit 156c3e4bba
8 changed files with 315 additions and 42 deletions

69
.github/workflows/agentic_v2_ai.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: Nubenetes V2 AI Curator
on:
workflow_dispatch:
inputs:
force_reevaluate:
description: 'Force AI re-evaluation (ignores cache for tags/years)'
type: boolean
default: false
permissions:
contents: write
pull-requests: write
concurrency:
group: v2-ai-${{ github.ref }}
cancel-in-progress: false
jobs:
ai-curation:
runs-on: ubuntu-latest
steps:
- name: Repository Synchronization
uses: actions/checkout@v6
with:
ref: develop
- name: Python 3.11 Environment Provisioning
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
- name: Restore Incremental Inventory Cache
uses: actions/cache/restore@v4
with:
path: data/inventory.yaml
key: inventory-v2-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
inventory-v2-
- name: Installation of Dependencies
run: |
pip install --no-cache-dir pydantic PyGithub httpx fake-useragent pytz python-dotenv pyyaml tenacity
- name: Run V2 AI Curator
env:
GEMINI_API_KEY_1: ${{ secrets.GEMINI_API_KEY_1 }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FORCE_EVAL: ${{ github.event.inputs.force_reevaluate || 'false' }}
PYTHONPATH: .
PYTHONUNBUFFERED: "1"
run: python -u src/v2_ai.py
- name: Create Pull Request for Inventory Update
uses: peter-evans/create-pull-request@v8
with:
branch: bot/v2-ai-sync
base: develop
title: "V2 Data: AI Curator Sync"
commit-message: "chore: update inventory AI analysis [skip ci]"
labels: "v2-data, ai-curator"
- name: Persist Incremental Inventory to Cache
if: always()
uses: actions/cache/save@v4
with:
path: data/inventory.yaml
key: inventory-v2-${{ github.run_id }}-${{ github.run_attempt }}

69
.github/workflows/agentic_v2_health.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: Nubenetes V2 Health Monitor
on:
schedule:
- cron: '0 0 * * 0' # Weekly on Sunday
workflow_dispatch:
inputs:
force_full_check:
description: 'Force full re-validation (bypasses cache)'
type: boolean
default: false
permissions:
contents: write
pull-requests: write
concurrency:
group: v2-health-${{ github.ref }}
cancel-in-progress: false
jobs:
health-check:
runs-on: ubuntu-latest
steps:
- name: Repository Synchronization
uses: actions/checkout@v6
with:
ref: develop
- name: Python 3.11 Environment Provisioning
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
- name: Restore Incremental Inventory Cache
uses: actions/cache/restore@v4
with:
path: data/inventory.yaml
key: inventory-v2-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
inventory-v2-
- name: Installation of Dependencies
run: |
pip install --no-cache-dir pydantic PyGithub httpx fake-useragent pytz python-dotenv pyyaml tenacity
- name: Run V2 Health Monitor
env:
FORCE_FULL_CHECK: ${{ github.event.inputs.force_full_check || 'false' }}
PYTHONPATH: .
PYTHONUNBUFFERED: "1"
run: python -u src/v2_health.py
- name: Create Pull Request for Inventory Update
uses: peter-evans/create-pull-request@v8
with:
branch: bot/v2-health-sync
base: develop
title: "V2 Data: Health Monitor Sync"
commit-message: "chore: update inventory health status [skip ci]"
labels: "v2-data, health-monitor"
- name: Persist Incremental Inventory to Cache
if: always()
uses: actions/cache/save@v4
with:
path: data/inventory.yaml
key: inventory-v2-${{ github.run_id }}-${{ github.run_attempt }}

View File

@@ -0,0 +1,70 @@
name: Nubenetes V2 Metadata Engine
on:
schedule:
- cron: '0 0 1,15 * *' # Bi-weekly
workflow_dispatch:
inputs:
enrich_metadata:
description: 'Enrich GitHub Metadata (fetch stars/license)'
type: boolean
default: true
permissions:
contents: write
pull-requests: write
concurrency:
group: v2-metadata-${{ github.ref }}
cancel-in-progress: false
jobs:
enrich-metadata:
runs-on: ubuntu-latest
steps:
- name: Repository Synchronization
uses: actions/checkout@v6
with:
ref: develop
- name: Python 3.11 Environment Provisioning
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
- name: Restore Incremental Inventory Cache
uses: actions/cache/restore@v4
with:
path: data/inventory.yaml
key: inventory-v2-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
inventory-v2-
- name: Installation of Dependencies
run: |
pip install --no-cache-dir pydantic PyGithub httpx fake-useragent pytz python-dotenv pyyaml tenacity
- name: Run V2 Metadata Engine
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENRICH_METADATA: ${{ github.event.inputs.enrich_metadata || 'true' }}
PYTHONPATH: .
PYTHONUNBUFFERED: "1"
run: python -u src/v2_metadata.py
- name: Create Pull Request for Inventory Update
uses: peter-evans/create-pull-request@v8
with:
branch: bot/v2-metadata-sync
base: develop
title: "V2 Data: Metadata Engine Sync"
commit-message: "chore: update inventory github metadata [skip ci]"
labels: "v2-data, metadata-engine"
- name: Persist Incremental Inventory to Cache
if: always()
uses: actions/cache/save@v4
with:
path: data/inventory.yaml
key: inventory-v2-${{ github.run_id }}-${{ github.run_attempt }}

View File

@@ -1,36 +1,28 @@
name: Nubenetes V2 Agentic Builder
name: Nubenetes V2 Publisher
on:
push:
branches:
- develop
paths:
- 'data/inventory.yaml'
- 'docs/**'
workflow_dispatch:
inputs:
force_full_check:
description: 'Force full re-validation (bypasses cache)'
type: boolean
default: false
force_reevaluate:
description: 'Force AI re-evaluation (ignores cache for tags/years)'
type: boolean
default: false
enrich_metadata:
description: 'Enrich GitHub Metadata (fetch stars/license for V2 logic)'
type: boolean
default: false
permissions:
contents: write
pull-requests: write
concurrency:
group: v2-builder-${{ github.ref }}
group: v2-publisher-${{ github.ref }}
cancel-in-progress: false
jobs:
build-and-pr:
publish-v2:
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' &&
github.ref == 'refs/heads/develop' &&
!contains(github.event.head_commit.message, '[skip ci]') &&
!contains(github.event.head_commit.message, 'bot/v2-elite-sync'))
steps:
@@ -38,7 +30,6 @@ jobs:
uses: actions/checkout@v6
with:
ref: develop
fetch-depth: 0
- name: Python 3.11 Environment Provisioning
uses: actions/setup-python@v6
@@ -46,9 +37,8 @@ jobs:
python-version: '3.11'
cache: 'pip'
- name: Restore Incremental Inventory Cache (Mandate 22)
- name: Restore Incremental Inventory Cache
uses: actions/cache/restore@v4
id: inventory-cache-restore
with:
path: data/inventory.yaml
key: inventory-v2-${{ github.run_id }}-${{ github.run_attempt }}
@@ -57,38 +47,25 @@ jobs:
- name: Installation of Dependencies
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir pydantic PyGithub httpx fake-useragent pytz python-dotenv pyyaml tenacity
- name: Run V2 Agentic Optimizer (Sequential Fast-Track)
- name: Run V2 Publisher (Render-Only)
env:
GEMINI_API_KEY_1: ${{ secrets.GEMINI_API_KEY_1 }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FORCE_FULL_CHECK: ${{ github.event.inputs.force_full_check || 'false' }}
FORCE_EVAL: ${{ github.event.inputs.force_reevaluate || 'false' }}
ENRICH_METADATA: ${{ github.event.inputs.enrich_metadata || 'false' }}
PYTHONPATH: .
PYTHONUNBUFFERED: "1"
run: |
python -u src/v2_optimizer.py
python -u src/v2_optimizer.py --render-only
if [ -f v2_safety_report.md ]; then
cat v2_safety_report.md >> pr_description.md
else
echo "No safety report generated." > pr_description.md
fi
- name: Consolidate README Metrics (Integrated)
env:
PYTHONPATH: .
- name: Consolidate README Metrics
run: |
python src/readme_updater.py
python src/safety_readme.py
- name: Safety Reset for Workflow Files (Security)
run: |
# Prevent security rejection by ensuring no workflow YAMLs are part of the PR
git checkout HEAD -- .github/workflows/
- name: Create Pull Request for V2 Elite Update
id: cpr
uses: peter-evans/create-pull-request@v8
@@ -117,14 +94,13 @@ jobs:
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
run: |
if [ -f v2_decision_matrix.md ]; then
# Split decision matrix if too large for a single comment (approx 60k chars)
split -b 60000 v2_decision_matrix.md matrix_part_
for part in matrix_part_*; do
gh pr comment $PR_NUMBER --body-file $part
done
fi
- name: Persist Incremental Inventory to Cache (Always)
- name: Persist Incremental Inventory to Cache
if: always()
uses: actions/cache/save@v4
with: