Skip to content

fix(build): reconcile inherited packages before the manifest and Tier 2 - #182

Draft
openvoiceos-bot wants to merge 1 commit into
devfrom
fix/reconcile-inherited-packages
Draft

openvoiceos-bot wants to merge 1 commit into
devfrom
fix/reconcile-inherited-packages

Conversation

@openvoiceos-bot

@openvoiceos-bot openvoiceos-bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Why an image can hold a package the constraints file forbids

A constraint binds a package the resolver is asked about. A language build asks
about the packages it installs. A package that came from the base image and that
no install line names is never reconsidered, so it keeps the version the base
release froze — however far constraints-alpha.txt has moved since.

T-5125 is that shape. The base release of 2026-07-12 carries
ovos-plugin-common-play 1.3.4a1, which caps padacioso below 2.0.0. The
language stage lifts padacioso to 2.4.1a1 and never names
ovos-plugin-common-play, so pip check failed on all twelve hybrid images
while every install line in the build was correct on its own. The constraints
floor >=1.3.5a1 did not bind, because nothing asked about the package.

The change

scripts/reconcile_constraints.py compares every installed distribution with
the constraints file, upgrades the ones that violate it, proves in a fresh
interpreter that the violation is gone, and then runs pip check. It reports
the next package to drift this way, not this one only.

Each language build calls it before the chown and before the manifest: the
script runs as root and writes into the venv, so the chown must follow it, and
the manifest then records the versions that ship.

Measured

A venv that reproduces the image state, ovos-plugin-common-play 1.3.4a1 then
padacioso 2.4.1a1 installed with --no-deps:

$ python -m pip check
ovos-plugin-common-play 1.3.4a1 has requirement padacioso<2.0.0,>=0.1.1,
  but you have padacioso 2.4.1a1.
rc=1

$ python scripts/reconcile_constraints.py constraints-alpha.txt
constraints: 176 requirements (0 lines skipped), 50 packages installed
1 inherited package(s) violate the constraints file:
  ovos-plugin-common-play 1.3.4a1 violates >=1.3.5a1
+ uv pip install --no-progress --upgrade ... --reinstall-package ovos-plugin-common-play
 - ovos-plugin-common-play==1.3.4a1
 + ovos-plugin-common-play==1.3.14a1
no inherited package violates the constraints file
+ pip check
No broken requirements found.
rc=0

- 1.3.4a1 / + 1.3.14a1 is the value that matters: --reinstall-package is
there because uv can treat an installed prerelease as satisfying the
requirement and move nothing.

Controls

An instrument that cannot fail reports a clean result that means nothing, so
each path was made to fail on purpose:

control result
second run, nothing to do no inherited package violates..., pip check clean, rc=0
packaging<1.0 against packaging 26.3, --verify-only packaging 26.3 violates <1.0, rc=1
padacioso>=99.0.0, a repair that cannot succeed uv reports no solution, ERROR: the reconcile install failed, rc=1
a constraints path that does not exist ERROR: cannot read constraints, rc=2
a broken pair no constraint names detection clean, pip check red, rc=1

The last control is the one that shows why pip check stays: the reconcile
finds only what the constraints file names, and pip check finds what it
misses.

What this does not do

The proof this change needs is a green Tier 2 on a built image, and a language
image builds on a push to dev or a manual dispatch, not on a pull request.
The run is recorded in the audit page.

The second half of T-5141, raising the generated floor to
ovos-plugin-common-play>=1.3.6a1 in OpenVoiceOS/OpenVoiceOS, is not in this
pull request and must not be done by hand yet. That floor is generated from a
resolution, and the resolution cannot reach 1.3.6a1 today:

$ uv pip compile --pre lists/*.list ocp>=1.3.6a1 -c constraints-alpha.txt
error: No solution found when resolving dependencies
  cause: Because ovos-workshop==8.3.0a1 depends on padacioso>=1.0.0,<2.0.0
  and ovos-plugin-common-play>=1.3.6a1 depends on padacioso>=2.2.1a1 ...
  And because ovos-skill-homescreen>=3.0.4a2 depends on
  ovos-workshop>=8.0.0,<9.0.0 ... your requirements are unsatisfiable.

ovos-skill-homescreen 3.0.4a2, its newest release, caps ovos-workshop below
9.0.0. That holds the whole alpha channel at ovos-workshop 8.3.0a1,
padacioso 1.1.1a1 and ovos-plugin-common-play 1.3.5a1. A hand-raised floor
would make the shared constraints file unsatisfiable and red every build that
reads it. The cap is filed with the lane that owns the skill; the floor then
rises by regeneration, which is where a generated value belongs.

ovos-skill-homescreen is not in this repository's skills.list, so an image
built here is free of that cap and the reconcile reaches 1.3.14a1.

Review round (reviewer-c, SHIP-WITH-FIXES at 99c55f8) and rebase

Rebased onto dev after #176, #179 and #172 landed. One conflict, in
lang_builds/hybrid/build_raspOVOS_ca.sh, where #172 added the phoonnx
install at the same place this change adds the reconcile call. Both are kept,
the install first and the reconcile after it, which is the order the reconcile
needs. The ordering invariant was re-checked on the rebased tree:

scripts calling reconcile: 34; out of order: 0

C1, fixed. The message printed when a violation survives the upgrade said
only a system install could replace the copy. That is false for the case it
named, and this change's own run 36204852657 is the counter-example: seven
packages read through --system-site-packages survived, and naming the floor
in the requirement fixed every one by shadowing. The message now names both
causes and says plainly not to install into the system python.

Forced through the surviving-violation path with a PYTHONPATH copy the venv
cannot shadow, which is the case the new text describes:

  pyyaml 6.0 violates >=6.0.2  <- outside the venv: .../fake
+ uv pip install ... --reinstall-package pyyaml pyyaml>=6.0.2
 + pyyaml==6.0.3
  pyyaml 6.0 violates >=6.0.2  <- outside the venv: .../fake
ERROR: a violation survived the upgrade
Two causes are possible, and they need opposite fixes. ...

A second fix, found while proving C1. pip_check() reported "broken
requirements" when pip itself was missing, because -m pip check exits
non-zero either way. A check that cannot run must not report the failure it
looks for. The two cases are now separate, both proven:

pip absent:  ERROR: pip is not installed in this interpreter, so pip check
             could not run. This is not a broken requirement: the check did
             not happen.
pip present: No broken requirements found.   rc=0

./scripts/ci/run_shellcheck.sh passes on the rebased tree: 50 *.sh files
and 16 shebang scripts, shellcheck OK.

Merging this starts two builders that publish

Read from the rebased diff against the path triggers, because it decides when
this can merge:

build_hybrid_lang_images.yml    FIRES   create-release if=None, upload-images if=None
build_offline_lang_images.yml   FIRES   create-release if=None, upload-images if=None
build_lite_lang_images.yml      no
build_raspOVOS_full.yml         no
build_raspOVOS_lite.yml         no

So a merge starts both language builders, and neither publish job is guarded.
This pull request therefore waits on the open decision
raspovos-dev-push-publishes-release, exactly as #180 does.

Worth a separate look, not fixed here: this change edits eleven
lang_builds/lite/* scripts, and build_lite_lang_images.yml filters on
lang_builds/lite/build_raspOVOS_.sh — a literal name, no *, matching none
of the eleven. So no change to a lite script starts that builder. The typo is
dev's, not this pull request's; it entered dev at 52883496 on
2025-12-18, and it is fixed on branch fix/lite-lang-builder-path-glob.

The consequence for this change, raised by reviewer-c and worth stating here:
after it merges, the eleven lite images keep being built without the
inherited-package reconcile, and nothing in the run list says so. The reconcile
is precisely about packages inherited from the base image, and the lite images
inherit from the same base. They are the arm least likely to be noticed and the
one this change silently skips.

Found after the rebase: the reconcile runs twice in every offline build

Not fixed here, and the re-review should weigh it. Every one of the eleven
offline build scripts starts by running its hybrid counterpart:

lang_builds/offline/build_raspOVOS_ca.sh:14
  RASPOVOS_TIER=offline bash /mounted-github-repo/lang_builds/hybrid/build_raspOVOS_ca.sh

offline scripts that call their hybrid counterpart: 11 of 11
lite scripts that do:                                0 of 11

So after this change an offline build runs the reconcile pass twice: once
inside the hybrid script, before the offline tier installs citrinet, onnx-asr,
phoonnx and its models, and once in the offline script itself.

The second run is harmless; the audit's own first control is "second run,
nothing to do". The first one is the question. It ends in pip check, and the
script carries set -e, so an offline build now stops at the hybrid stage for
any inconsistency the offline stage would have gone on to replace. That may be
the wanted behaviour — fail early, name the cause — but it is a change to when
offline builds fail, it was not in the original evidence, and no offline image
has been built with it.

The cost is real too: a full uv pip install --upgrade over roughly 300
packages, twice per offline language, eleven languages.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JarbasAl
JarbasAl force-pushed the fix/reconcile-inherited-packages branch from 7e68c6b to 99c55f8 Compare September 26, 2026 00:35
A constraint binds a package the resolver is asked about. A language build asks
about the packages it installs, so a package that came from the base image and
is named by no install line is never reconsidered: it keeps the version the base
release froze, however far constraints-alpha.txt has moved since.

That is T-5125. The base release of 2026-07-12 carries ovos-plugin-common-play
1.3.4a1, which caps padacioso below 2.0.0. The language stage lifts padacioso to
2.4.1a1 and never names ovos-plugin-common-play, so pip check failed on all
twelve hybrid images while every install line was correct on its own. The
constraints floor of >=1.3.5a1 did not bind, because nothing asked.

scripts/reconcile_constraints.py compares every installed distribution with the
constraints file, upgrades the ones that violate it, proves the violation is
gone in a fresh interpreter, and then runs pip check. It names the next package
to drift this way, not this one only.

Every language build calls it before the chown and before the manifest: the
script runs as root and writes into the venv, so the chown must follow it, and
the manifest then records the versions that ship.

Measured on a venv that reproduces the image state (ovos-plugin-common-play
1.3.4a1, then padacioso 2.4.1a1 with --no-deps):

    pip check -> ovos-plugin-common-play 1.3.4a1 has requirement
                 padacioso<2.0.0,>=0.1.1, but you have padacioso 2.4.1a1
    reconcile -> ovos-plugin-common-play 1.3.4a1 violates >=1.3.5a1
                 - ovos-plugin-common-play==1.3.4a1
                 + ovos-plugin-common-play==1.3.14a1
                 No broken requirements found.

Review round (reviewer-c, SHIP-WITH-FIXES at 99c55f8):

C1. The message printed when a violation survives the upgrade named the
system python as the only cure. That is false for the case it described.
On run 36204852657 seven packages read through --system-site-packages
survived, and naming the floor in the requirement fixed them: a venv
install shadowed every one. The message now names both causes and says
plainly not to install into the system python.

Found while proving C1: pip_check() reported "broken requirements" when
pip itself was absent, because `-m pip check` exits non-zero either way.
A check that cannot run must not report the failure it looks for, so the
two cases are now separate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@JarbasAl
JarbasAl force-pushed the fix/reconcile-inherited-packages branch from 99c55f8 to a402b22 Compare September 26, 2026 20:13
@github-actions

Copy link
Copy Markdown
Contributor

Reporting for duty! The automated checks have completed. 🎖️

I've aggregated the results of the automated checks for this PR below.

🔍 Lint

Everything looks good so far! ✅

✅ actionlint: 10 workflow file(s), no finding


Your loyal script, at your command 🫡

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants