diff --git a/.github/workflows/07.1.pr_guardian.yml b/.github/workflows/07.1.pr_guardian.yml index f1f1f5bf..5d2624af 100644 --- a/.github/workflows/07.1.pr_guardian.yml +++ b/.github/workflows/07.1.pr_guardian.yml @@ -59,7 +59,10 @@ jobs: run: | git config --global user.name "nubenetes-bot" git config --global user.email "bot@nubenetes.com" - git add docs/ v2-docs/ README.md data/inventory.yaml data/inventory.sql src/memory/ + # NOTE: v2-docs/ is deliberately excluded. It is generated by + # src/v2_optimizer.py (single source of truth); re-formatting it here + # caused a perpetual cosmetic develop<->master drift (see pr_guardian.py). + git add docs/ README.md data/inventory.yaml data/inventory.sql src/memory/ if ! git diff --cached --quiet; then git commit -m "style(cleaner): auto-correcting formatting & URL normalization" git push origin HEAD:${{ github.event.pull_request.head.ref }} || echo "⚠️ Push failed (likely fork permission limit)." diff --git a/src/pr_guardian.py b/src/pr_guardian.py index 473b3a55..b630bf94 100644 --- a/src/pr_guardian.py +++ b/src/pr_guardian.py @@ -95,7 +95,13 @@ def main(): files = pr.get_files() modified_files = [f.filename for f in files if f.status in ["modified", "added"]] for filepath in modified_files: - if filepath.endswith(".md"): + # The v2-docs/ tree is generated by src/v2_optimizer.py, which is its + # single source of truth for formatting. Auto-formatting it here + # ("&"->"and" in headings, URL trailing-slash stripping) only fights + # the generator: the rewrite lands on develop via the PR while master + # gets the generator's raw form via release merges, producing a + # perpetual cosmetic develop<->master drift. Skip the generated tree. + if filepath.endswith(".md") and not filepath.startswith("v2-docs/"): auto_format_file(filepath) except Exception as e: print(f"Warning: Failed to fetch files for auto-formatting: {e}")