Skip to content

Upstream dev omits top-level ObjectivePkg re-export, so MSPackageManager.getpkg('ObjectivePkg') fails (kbdl-target e1155a4) #81

Closed

Description

@cshenry

Summary

On upstream ModelSEEDpy dev (the kbdl-target pin, cshenry/ModelSEEDpy e1155a41fa53b921185b20c6cfbd083e5e3739a4 = upstream c0b94e3 + the alias commit), model.pkgmgr.getpkg("ObjectivePkg") raises PackageError("Package ObjectivePkg does not exist!"). The fork (0.4.2, production venv) does not.

Evidence (measured)

Source: KBUtilLib task-924f89ea (kbu-fva-panel), work record agent-io/work-records/kbu-fva-panel.md on branch maestro/developer/kbdl-recon-kbu-fva-panel @ b132407, section "The real finding".

MSPackageManager.__init__ builds available_packages from inspect.getmembers(sys.modules["modelseedpy"]), which is the TOP-LEVEL namespace.

modelseedpy.fbapkg.ObjectivePkg top-level modelseedpy.ObjectivePkg
fork 0.4.2 (production) present present
upstream dev 0.4.3 e1155a4 present absent

Consequence: every caller of KBUtilLib MSFBAUtils.set_objective_from_string (and so run_fva) fails on upstream. In the FVA parity run it silently produced zero FVA rows per medium.

What was done

kbu-fva-panel worked around it narrowly (_ensure_objective_package in KBUtilLib fva_panel.py, which registers the class on that model's own per-model registry; no global patch; ms_fba_utils.py unchanged). Nothing else is fixed.

Why it matters now

PRD kbdl-recon-thin-layer-v1 task 8 (cutover) moves the KBDL venv to kbdl-target. Any other MSFBAUtils objective/FVA caller in the deployed stack will hit this. The Q10 venv-regression gate should catch it, but it is better fixed before cutover than discovered there.

Options (a design decision, not made here)

  1. Upstream-shaped fix in ModelSEEDpy: re-export ObjectivePkg (and audit the other *Pkg classes the fork exposed at top level) from modelseedpy/__init__.py, as a commit on kbdl-target. That gives a new pin SHA, re-published to cshenry/ModelSEEDpy, and KBUtilLib's [model] extra re-pinned. Coordinate with kbdl-fitness-off-gaa-v1, which also plans to fast-forward kbdl-target.
  2. KBUtilLib-side fix in ms_fba_utils.py (register on demand, as the workaround does), leaving ModelSEEDpy untouched.
  3. Both.

Activity

  1. cshenry commented on Nov 16, 2026

    @cshenry
    OwnerAuthor

    Decision: option 1, the upstream fix. ModelSEED#173 (ModelSEED#173) adds ObjectivePkg to the top-level fbapkg import in modelseedpy/init.py, commit 46ca956 on upstream dev c0b94e3. It also adds tests/fbapkg/test_package_manager_exports.py, which asserts that every *Pkg class exported by modelseedpy.fbapkg is also exported at top level. The new tests fail without the fix, and tests/fbapkg passes 26/26 with it.

    Leaving this open until kbdl-target (currently e1155a4) carries 46ca956. The kbdl-fitness-off-gaa-v1 fast-forward of kbdl-target has been asked to include it. After that, KBUtilLib's _ensure_objective_package workaround in fva_panel.py can be removed.

  2. cshenry commented on Nov 19, 2026

    @cshenry
    OwnerAuthor

    Resolved.

    Closing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions