Skip to content

refactor(deps): isolate optional dependency environments - #336

Open
tangym wants to merge 13 commits into
mainfrom
tangym/fix-current-dependency-vulnerabilities
Open

refactor(deps): isolate optional dependency environments#336
tangym wants to merge 13 commits into
mainfrom
tangym/fix-current-dependency-vulnerabilities

Conversation

@tangym

@tangym tangym commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updates vulnerable frontend and Python dependencies, then narrows published ASSERT dependency metadata to runtime product features. Framework examples and optional scripts now own their dependencies through adjacent requirements files instead of one combined installation environment.

Motivation / linked issue

Reduce dependency vulnerability exposure, remove cross-framework resolver coupling, and make optional dependency ownership explicit.

Changes

  • Update viewer dependencies and pin patched SvelteKit and PostCSS releases.
  • Replace the website's vulnerable Keyv cache chain through file-entry-cache.
  • Remove framework-only langgraph, dspy, and examples extras from published ASSERT metadata.
  • Remove the unused regression extra and script-only packages from base and analysis.
  • Split heavyweight local embedding support into assert-ai[embeddings].
  • Cap ACS Generator below 0.4 because ASSERT uses the 0.3 GenerationEngine API.
  • Keep all limited to product features: tracing, analysis, embeddings, Azure identity, and ACS.
  • Add independently installable requirements files for the flagship LangGraph planner, Azure Doc QA, Bank Manager, the default OpenAI auto-trace path, Foundry hosting, and optional scripts.
  • Update canonical setup, CI, dev container, assistant guides, and example documentation to use root product extras plus adjacent requirements files.

The multi-framework auto-trace gallery keeps its alternate framework modules as explicit opt-ins: install the framework and matching OpenInference instrumentor named in the gallery table. CrewAI is not committed to a requirements manifest while its ChromaDB dependency has no patched release.

Testing

  • Root and isolated requirements audits: 0 known vulnerabilities
  • Python: 1,453 passed, 22 skipped, 1 Docker-host test deselected
  • Every requirements file resolves and imports on Python 3.11
  • uv lock --check
  • Viewer: npm audit, npm ci, npm run check, npm run build
  • Website: npm audit, npm ci, npm run build
  • Package: python -m build, twine check dist/*

Checklist

  • Tests pass locally.
  • Setup and example documentation updated for the new dependency boundaries.
  • No secrets, credentials, or customer data committed.
  • No breaking runtime API change.

Update Python and frontend dependency locks to patched compatible
versions while preserving the CrewAI and DSPy example integrations.

Repair the unsatisfiable DSPy optional dependency range and document the
remaining upstream advisories in the pull request.
tangym added 2 commits August 26, 2026 08:14
Stop bundling CrewAI while every available ChromaDB release remains
affected by critical and high vulnerabilities. Upgrade DSPy to its patched
3.x line, select fixed JSON Repair, and raise the LangChain Core minimum.

The CrewAI gallery source remains available for explicit framework installs.
Keep published ASSERT metadata focused on runtime product features. Move
framework examples and optional script tools into adjacent requirements
files, split local embeddings from lightweight analysis, and update setup
documentation and CI to use the new ownership boundaries.
@tangym tangym changed the title fix(deps): refresh vulnerable dependency versions refactor(deps): isolate optional dependency environments Aug 26, 2026
tangym added 4 commits August 26, 2026 21:55
Keep fresh pip installs on the 0.3 ACS Generator API used by ASSERT.
Version 0.4 removes GenerationEngine and breaks ACS test collection.
Keep the pip dev extra and uv development group equivalent while removing the Phoenix server stack from general regression tests. Install tracing explicitly in the travel-planner devcontainer and science gate, whose clean-environment imports and focused tests pass.
Explain that the travel planner owns LangGraph, LangChain Core, and its model adapter, while ASSERT owns the tracing extra. This preserves the existing golden path without presenting agent frameworks as ASSERT package features.
Drop the unused langchain-azure-ai hosting extra from Bank Manager and document the direct prerelease declaration required for uv resolution. Keep hosting only in the Foundry-hosted example.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two blockers on exact head ed539e3:

  1. The documented Bank Manager install leaves an incompatible environment. I ran the README sequence in a clean Python 3.11 venv:

    python -m pip install -e ".[acs,otel]"
    python -m pip install -r examples/bank_manager_agent_control/requirements.txt
    python -m pip check

    Both install commands exit successfully, but pip check fails because langchain-azure-ai>=1.2.4 pulls azure-ai-projects 2.5.0, which requires openai>=3.0.0, while the installed litellm 1.98.0 requires openai>=2.20.0,<3.0.0. The resulting environment has openai 3.5.0 and is inconsistent. This contradicts the PR's requirements-resolution claim and can fail after an apparently successful setup. Please use a compatible version set or isolate that provider path, and add a required clean-venv test of the documented two-step install followed by pip check.

  2. The package silently removes existing public extras without a compatibility or release migration. The built wheel no longer provides langgraph, dspy, examples, or regression, and it changes the meaning of all, while CHANGELOG.md has no Unreleased entry. A clean pip install -e ".[langgraph]" exits 0 with WARNING: assert-ai 0.2.0 does not provide the extra 'langgraph', then leaves langgraph uninstalled. Existing setup automation can therefore report a successful install and fail later at import time. Please either preserve safe compatibility aliases for a transition or make this an explicit breaking release change with the appropriate version/migration and changelog treatment. The vulnerable all-framework bundle does not need to be restored merely for compatibility.

Two smaller consistency issues:

  • The new OpenAI auto-trace quickstart (.[otel] plus examples/phoenix_auto_trace/requirements.txt) emits DependencyConflict: requested: "langchain_core >= 0.1.0" but found: "None" because the otel extra still installs the LangChain instrumentor after LangChain moved to target-owned requirements. The framework instrumentor should move with the framework dependency or otherwise stop producing a conflict on the default OpenAI path.
  • scripts/render_trade_off.py:25-26 still says Matplotlib is a base assert-ai dependency, although this PR moves it to scripts/requirements.txt.

Other verification on this head was healthy: the full suite passed (1454 passed, 22 skipped, 840 subtests); viewer and website audits/builds passed with zero known npm vulnerabilities; pip-audit found no known vulnerabilities in the root and isolated requirement environments; the wheel and sdist passed twine check; the Travel Planner, Azure Doc QA, OpenAI auto-trace, scripts, and standalone Foundry-host requirements installed and imported; lockfiles use the public npm registry with SHA-512 integrity; and uv lock --check plus diff checks passed.

tangym added 6 commits August 28, 2026 02:11
Replace implementation-oriented extras with phoenix and azure-auth, keep embeddings isolated, and make direct endpoint and Prompt Agent tracing dependencies explicit. Update runtime install hints and assert the public extra composition; the package version remains 0.2.0 until the dedicated 0.3.0 release PR.
Use LangChain OpenAI for both Azure OpenAI and OpenAI-compatible Azure AI Inference routes so LiteLLM retains its OpenAI <3 constraint. Preserve the non-GPT model field behavior, add constructor tests, and verify the documented two-step install with pip check.
Build the wheel once, install each documented ASSERT/example environment in parallel, run pip check, and import each target without network calls. Exercise Bank Manager routing and the standalone Foundry host on its Python 3.13 minimum.
Treat zero captured spans as invalid trace metadata and emit actionable guidance once per session. Clarify that auto_trace activates installed instrumentors, and move LangChain instrumentation into the LangChain example environments that own it.
Update canonical setup, examples, and assistant guidance for phoenix and azure-auth. Explain target-owned instrumentors, keep embeddings concise and isolated, correct script dependency ownership, and record the breaking 0.2-to-0.3 migration under Unreleased without changing the package version.
Copy trace validation into the final interaction event so zero-span guidance survives inference_set.jsonl serialization. Cover both the session payload and the written artifact; no change for traces that already contain spans.
@changliu2

Copy link
Copy Markdown
Collaborator

Jake Present (@jakepresent) Ready for re-review at 59b9cd91.

The commits after your ed539e3 review address both blockers and both consistency issues:

  • the Bank Manager documented install now resolves a compatible OpenAI/LiteLLM set and its clean install plus pip check is enforced in CI;
  • the removed extras are documented as a planned 0.3.0 breaking migration and locked by the public-extra contract test;
  • the LangChain instrumentor moved with the LangChain-owned example dependencies; and
  • render_trade_off.py now points to the script requirements instead of calling Matplotlib a core dependency.

All current-head checks are green, and an independent exact-head review found no remaining blocker. It also verified that mcp>=1.29.1 is published on public PyPI and receives the <2 cap transitively from langchain-mcp-adapters; the earlier resolution concern came from a stale corporate mirror.

Please re-review the current head. We need #336’s dependency boundary merged before applying the approved article-faithful reset to #313.

@tangym
tangym enabled auto-merge (squash) August 28, 2026 22:29
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.

3 participants