Repository navigation
Description
Finding
The two SLM installers create the SLM backend venv with bare python3. On a host where python3 is older than the project floor declared in .python-version (3.14), the SLM gets a venv below that floor.
Sites (verified against origin/main @ 7b3358f)
| Installer | Line | Code |
|---|---|---|
autobot-infrastructure/autobot-slm-backend/scripts/bootstrap-slm.sh |
395 | remote_exec_sudo "python3 -m venv ${REMOTE_BACKEND}/venv" |
autobot-infrastructure/shared/scripts/install-slm.sh |
382 | sudo -u autobot python3 -m venv "$SLM_SERVER_DIR/venv" |
The drift guard repo_tests/python_version_declaration_drift_test.py does not sweep either installer: _SWEEPS covers only the docker ARG PYTHON_VERSION defaults and pyproject.toml's python_version.
Scope (widened; maintainer ruling): EVERY node-side venv builder
The two installers are kept. The scope now also covers every builder in the table in the rollout comment on this issue: the slm_agent role (roles/slm_agent/tasks/main.yml:139), both enroll-node paths (playbooks/enroll-node.yml:268, :285), dependency_patching (update-venv.yml:84, :93), deploy-autobot-native.sh:179, deploy_autobot.py:226, setup_repair.sh:439, code_analysis/install.sh:66, plus the roles that hard-code python3.14 for the create step (npu-worker, tts-worker, agent_config, backend, ai-stack, slm_manager, redis/chromadb, deploy-native-services). Each builds with the floor interpreter derived from .python-version, using the python_interpreter role pattern (python_interpreter_binary), not bare python3 and not a literal.
Blocks #20903 / #20929: #20929 boards only after this lands, or host evidence shows every node venv is 3.14 or newer.
Impact
Once #20929 lands, a venv below the floor is refused at import by autobot_shared (per #20929's refusal of interpreters below the .python-version floor). A fresh SLM install on a host with an older system python3 therefore produces a venv that the SLM backend cannot import.
Canonical pattern to mirror
The backend Ansible role is the reference:
autobot-slm-backend/ansible/roles/python_interpreter/derives the interpreter from.python-version(tasks/main.yml).- It provisions python3.14 when it is missing (the deadsnakes step in
install.sh).
Both installers should use the same derivation and provisioning rather than python3.
Overlap and ordering
install-slm.sh is also touched by open PRs #20777 and #20587 (both verified to modify that file). The fix to install-slm.sh lands after them to avoid conflicts.
Acceptance criteria
- Both installers derive the interpreter from
.python-versionand provision it if it is missing. - The drift guard
repo_tests/python_version_declaration_drift_test.pysweeps both installers. - Every node-side venv builder in the rollout table builds with the floor interpreter derived from
.python-version(thepython_interpreterrole pattern); none uses barepython3or a restated literal. - Each of those builders is swept by
repo_tests/python_version_declaration_drift_test.py(min_files and min_declarations floors, plus a planted-drift control). - Host evidence comes from a fresh SLM install (venv interpreter version and SLM backend import output).
Related
- bug(shared): prompt_rules regex fails to compile on Python 3.10 (re.error: multiple repeat) #20903
- fix(python): refuse interpreters below the .python-version floor (#20903) #20929
- See also (not a duplicate): bug(deps): the dependency-floor check can only inspect its own interpreter, so no deployed venv is ever checked — and one is below its floor #17449, which covers the dependency-floor check not inspecting deployed venvs.
Activity
mrveiss commentedon Nov 6, 2026
Rollout evidence for #20929 (read-only; component names only, no paths or hosts).
Live venvs on the test host (interpreter version of each venv): autobot-ai-stack, autobot-backend, autobot-browser-worker, autobot-npu-worker, autobot-slm-agent, autobot-slm-backend, autobot-tts-worker, autobot-db-stack/chromadb are all 3.14.6; all 10 retained backend/SLM snapshots are also 3.14.6. None is below the floor. This is one host; it says nothing about nodes that were enrolled earlier or by a different path.
Node-side venv builders in the repo (origin/main at the time of the check). Floor interpreter = derived from
.python-versionvia thepython_interpreterrole (python_interpreter_binary); literal = hard-codedpython3.14(right today, drifts on a floor bump); bare =python3, whatever the node ships.roles/slm_agent/tasks/main.yml:139python3playbooks/enroll-node.yml:268python3playbooks/enroll-node.yml:285python3roles/dependency_patching/tasks/update-venv.yml:84,:93python3deploy-autobot-native.sh:179python3autobot-infrastructure/shared/scripts/deploy_autobot.py:226python3autobot-infrastructure/shared/scripts/setup/setup_repair.sh:439python3autobot-backend/code_analysis/install.sh:66python3autobot-infrastructure/autobot-slm-backend/scripts/bootstrap-slm.sh:395python3autobot-infrastructure/shared/scripts/install-slm.sh:382python3roles/npu-worker/tasks/main.yml:172(create),:194,:233(pip)python3.14create; floor-derived piproles/tts-worker/tasks/main.yml:171(create),:193,:218,:264,:330(pip)python3.14create; floor-derived piproles/agent_config/tasks/python_env.yml:22(create),:34;python_deps.yml:32;openvino.yml:100;playwright.yml:54python3.14create; floor-derived piproles/backend/tasks/main.yml:851,:880,:892,:973python3.14roles/ai-stack/tasks/main.yml:93,:129,:224python3.14roles/slm_manager/tasks/main.yml:302,:411python3.14roles/redis/tasks/chromadb.yml:34,:48,:74python3.14:442,:477,:638python3.14roles/browser/tasks/main.yml:192,roles/backend_services/tasks/main.yml:71roles/backend/tasks/prefetch_models.yml:16,:29Finding: the tasks that build a venv with bare
python3are the slm_agent role, both enroll-node paths, dependency_patching (if it ever creates one), and the five scripts. A node enrolled or repaired through these on a host whosepython3is below 3.14 gets a venv thatautobot_sharedwill refuse at import once #20929 deploys.[-]bug(install): SLM installers build the venv with bare python3 instead of the declared 3.14 floor[/-][+]bug(install): every node-side venv builder must use the declared floor interpreter, not bare python3 (SLM installers, slm_agent, enroll-node, ...)[/+]mrveiss commentedon Nov 6, 2026
Follow-up, kept open on purpose. PR #20969 boards with
install-slm.shandplaybooks/deploy-native-services.ymlallowlisted in the venv-builder guard, because open PR #20777 also edits both files. Once #20777 lands, a follow-up push converts both onto the floor interpreter and removes their allowlist entries. This issue closes only after that.fix(deploy): tag resolve always, rebuild stale venvs, gate deadsnakes…
mrveiss commentedon Nov 7, 2026
PR #20969 landed via merge train #21031. Verified on main: bootstrap-slm.sh now builds the venv via
python_floor_remote_venv_cmd(scripts/lib/python_floor.sh), andrepo_tests/venv_builders_use_floor_interpreter_20932_test.pyexists. Not done:autobot-infrastructure/shared/scripts/install-slm.sh:382still runs barepython3 -m venv(ordered after #20777 and #20587), so no AC is ticked; the remaining builders in the rollout table were not all verified, and the host-evidence AC needs a fresh SLM install. Issue stays open.fix(deploy): build every node venv on the .python-version floor inter…
fix(deploy): declare the venv-builder guard's reach so an empty sweep…
fix(deploy): record the venv-builder guard's declared scope in both r…
fix(train): venv-builder guard resolves the repo root through repo_te…
mrveiss commentedon Nov 7, 2026
Host evidence (2026-11-07, install at a0b419b)
AC "Host evidence comes from a fresh SLM install (venv interpreter version and SLM backend import output)": NOT PROVEN, left unticked.
Commands and output (read-only):
cat .python-version(repo) ->3.14grep ^version <node>/venv/pyvenv.cfgfor ai-stack, backend, browser-worker, npu-worker, slm-agent, slm-backend, tts-worker -> all3.14.6<slm-backend venv>/bin/python --version->Python 3.14.6;systemctl is-activefor the SLM backend and the backend ->activepyvenv.cfgfiles: 2026-07-09 .. 2026-09-14, all older than this fix.What this shows: the existing venvs already run the floor interpreter. It does not show the fix's code path did it, because no venv was built after the fix landed, and this is an updated install, not a fresh one.
Missing: a fresh SLM install (or a forced venv rebuild through the builtin updater) after this fix, with the new venv's interpreter version and the SLM backend import output. Also, the install is not a git checkout, so the deployed SHA could not be confirmed with
git logormerge-base.fix(install): install-slm.sh builds its venv on the .python-version f…
test(install): cover python_floor_build_venv (#20932)
mrveiss commentedon Nov 8, 2026
Code from #20777 landed on main via #21176 (merge train T96b, merge commit 250ddc4). This issue is left open: the PR used Refs, so its remaining acceptance criteria and any host-behaviour evidence (a merge is not host evidence) are not verified here.