fix(web-app-docs): hold the python base inside requires-python

PR 1448 let the image updater move the docs base to python:3.15-slim, where pip refuses infinito-nexus (requires-python >=3.11,<3.15), so every deploy that builds docs failed. docs now pins python:3.14-slim and sets follow: requires-python; followed_tags then proposes only tags whose Python 3 minor requires-python admits.

One reader, utils/requires_python.py, serves the updater filter, the new requires_python lookup (dev-python gets the same string the old regex produced), the ansible cap test and a lint that makes every role image pip-installing core from the repository declare that follow and pin a supported base.

MEDUSA finding MEDUSA-FTSC-SCAN-089 on utils/requires_python.py:25 (ModelAttackScanner, RLHF reward hacking) accepted as a reviewed false positive: the function only parses the repository own requires-python spec.

🎯 Fix: 93 %
💥 Break: 3 %
💸 Cost: –
⏱️ Time: –
🛡️ Security: 100 %
🏆 Score: 90
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5.5 committed 2026-11-12 00:54:50 +00:00
1 parent a568629421
commit 5322c96891
11 files changed
+280 -26

No files matched your search

@@ -7,8 +7,8 @@ import unittest
from pathlib import Path
import jinja2
from ansible.plugins.filter.core import regex_search
from plugins.lookup.requires_python import LookupModule as RequiresPythonLookup
from utils.cache.files import PROJECT_ROOT, read_text
from utils.cache.yaml import load_yaml_str
@@ -210,16 +210,12 @@ class TestBoundsFromRequiresPython(unittest.TestCase):
)
expression = task["environment"]["DEV_PYTHON_REQUIRES"]
def lookup(name: str, term: str) -> str:
return {
"path_absolute": lambda: str(PROJECT_ROOT / term),
"file": lambda: read_text(term),
}[name]()
def lookup(name: str, *terms: str) -> str:
return {"requires_python": RequiresPythonLookup}[name]().run(list(terms))[0]
environment = jinja2.Environment(
autoescape=jinja2.select_autoescape(default_for_string=False)
)
environment.filters["regex_search"] = regex_search
environment.globals["lookup"] = lookup
spec = tomllib.loads(read_text(str(PROJECT_ROOT / "pyproject.toml")))[
"project"