refactor(deps): isolate optional dependency environments - #336
Conversation
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.
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.
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.
Jake Present (jakepresent)
left a comment
There was a problem hiding this comment.
Two blockers on exact head ed539e3:
-
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 checkBoth install commands exit successfully, but
pip checkfails becauselangchain-azure-ai>=1.2.4pullsazure-ai-projects 2.5.0, which requiresopenai>=3.0.0, while the installedlitellm 1.98.0requiresopenai>=2.20.0,<3.0.0. The resulting environment hasopenai 3.5.0and 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 bypip check. -
The package silently removes existing public extras without a compatibility or release migration. The built wheel no longer provides
langgraph,dspy,examples, orregression, and it changes the meaning ofall, whileCHANGELOG.mdhas no Unreleased entry. A cleanpip install -e ".[langgraph]"exits 0 withWARNING: assert-ai 0.2.0 does not provide the extra 'langgraph', then leaveslanggraphuninstalled. 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]plusexamples/phoenix_auto_trace/requirements.txt) emitsDependencyConflict: requested: "langchain_core >= 0.1.0" but found: "None"because theotelextra 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-26still says Matplotlib is a baseassert-aidependency, although this PR moves it toscripts/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.
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.
|
Jake Present (@jakepresent) Ready for re-review at The commits after your
All current-head checks are green, and an independent exact-head review found no remaining blocker. It also verified that Please re-review the current head. We need #336’s dependency boundary merged before applying the approved article-faithful reset to #313. |
Jake Present (jakepresent)
left a comment
There was a problem hiding this comment.
The prior Bank Manager resolver conflict, 0.3 migration notes, instrumentor ownership, and script dependency text are fixed on exact head 8561aa2. I found these remaining blockers:
-
The non-GPT Bank Manager route uses the wrong OpenAI endpoint.
examples/bank_manager_agent_control/agent.py:173-180givesChatOpenAIa base URL ending in/models, so it sends the request tohttps://<resource>.openai.azure.com/models/chat/completions. I confirmed that path with a mock HTTP transport. The current Microsoft migration contract for the OpenAI SDK requireshttps://<resource>.openai.azure.com/openai/v1/chat/completions: https://learn.microsoft.com/en-us/azure/foundry/how-to/model-inference-to-openai-migration. This breaks the advertised DeepSeek, Mistral, Llama, Phi, and Cohere branch. Please use the OpenAI v1 base path and add a transport-level request test; the current constructor test only asserts the incorrect URL. -
The documented LangGraph gallery evals do not install their target dependencies.
examples/phoenix_auto_trace/README.md:101-113presents two LangGraph configs as independently runnable after the quickstart, butexamples/phoenix_auto_trace/requirements.txtcontains only OpenAI and its instrumentor. In a clean Python 3.11 environment, the documented install passespip check, then importingexamples.phoenix_auto_trace.travel_langgraphfails withModuleNotFoundError: No module named 'langchain_core'. The new CI job imports onlytravel_openai, so it misses this path. Please add or reference an adjacent LangGraph requirements set and exercise the configured target in CI. -
The Science Research Agent silently loses its required Tavily search capability.
examples/science_research_agent/README.md:66-86now installs base ASSERT only, whiletools.py:295-301importsTavilyClient. Tavily is absent from the package extras and there is no adjacent requirements file. With caching disabled andTAVILY_API_KEYset, I reproducedstatus: errorwithModuleNotFoundError: No module named 'tavily'. Because that exception becomes a tool result, the eval continues without its advertised public-web channel. Please add an adjacent requirements file and a clean install/tool check. -
Empty target responses still drop the new trace diagnostic from
inference_set.jsonl.assert_ai/core/otel_session.py:278-285attachesspan_validationonly to the final assistant interaction, whileassert_ai/stages/inference.py:366-388records that interaction only whencontentis non-empty. My empty-response repro completed withstop_reason="completed"and one artifact event, but it persisted nospan_validation. Please preserve raw-only diagnostic metadata on an always-written event or row and add an empty-response regression test. -
The supported
collector=path now records a false missing-span failure.OTelTracedSessiondocumentscollectoras the preferred interface and stores it atassert_ai/core/otel_session.py:66-105, butrun_turn()always reads_exporterat line 215. WithListCollector([valid_span]), direct validation returnedtrue, while the session returnedvalid:false, zero trace events, and “No OpenTelemetry spans were captured.” Ignoring the collector is pre-existing, but this PR turns it into a newly persisted false failure. Please consume the supplied collector or avoid reporting its data as missing. -
The canonical banking CI instructions point to a nonexistent path in the linked repository.
examples/bank_manager_agent_control/ci/README.md:11-16points readers toresponsibleai/assert-ci-banking-demo, then tells them to installexamples/bank_manager_agent_control/requirements.txt. That path returns 404 in the external repository. Its actual root requirements still pinassert-ai[acs,langgraph,otel,regression]==0.1.0. Please coordinate the external-repo migration or make the in-repo text accurately describe which checkout each command applies to.
One smaller formatting issue also needs cleanup: the changed two-space indentation in .claude/skills/run-assert-eval/SKILL.md:102-111, .github/prompts/run-assert-eval.prompt.md:39-42, and .cursor/rules/assert.mdc:67-70 breaks list/fence rendering. A CommonMark render puts the install command outside its fence and treats following preconditions as code until the next fence. Restoring the list indentation fixes it.
Verification on 8561aa2: the full local suite passed with 1,454 tests, 24 skips, and 840 subtests; a synthetic merge with current main passed the focused 207-test check; the clean Bank Manager install and pip check passed; Python and npm vulnerability audits found no known vulnerabilities; and the viewer, website, package, and current GitHub checks passed.
Route compatible non-GPT Foundry deployments through the documented\n/openai/v1 endpoint. Add a mock transport assertion for the final chat\ncompletions URL and model request field.
Persist assistant events when they carry raw trace metadata even if the\nresponse text is empty. This keeps span validation in inference artifacts\nfor empty target responses.
Consume injected collectors, prevent span replay and concurrent sharing,\nand merge backend validation warnings into persisted trace diagnostics.\nKeep the legacy exporter path unchanged and cover each behavior.
Add separate LangGraph and Science dependency profiles rather than an\nall-framework environment. Exercise both clean installs in CI and verify\nthe Science Tavily tool without network access.
Keep PyPI install guidance nested correctly in all three assistant entry\npoints. Distinguish ASSERT checkout commands from the standalone banking\ndemo's root dependency manifest.
Jake Present (jakepresent)
left a comment
There was a problem hiding this comment.
Approved at exact head 75987cd. I rechecked the six blockers from my prior review: the Foundry OpenAI v1 route, isolated LangGraph and Tavily dependency ownership plus CI coverage, empty-response trace diagnostics, injected collector consumption, external banking-repo setup wording, and Markdown rendering are all fixed.
The synthetic merge with current main passed 1,487 tests, 22 skips, and 840 subtests, and all current checks are passing. PhoenixCollector still needs repair, but its broken client construction and retrieval calls are inherited unchanged from main, it is not wired into the CLI/config path, and this PR improves the supported injected-collector path. I do not consider that inherited defect a merge blocker for this dependency-boundary change; it should be handled in a focused follow-up.
Resolves CHANGELOG.md conflict by merging both Fixed lists: kept main's already-numbered entries (#334, #336, #330, #335, #337, #342) and added the Phoenix fix as (#339), removing the 4 duplicate un-numbered copies that existed on this branch before those PRs landed on main. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 313f00c0-362c-4152-bcde-17cadaf0ac3a
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
file-entry-cache.langgraph,dspy, andexamplesextras from published ASSERT metadata.regressionextra and script-only packages from base andanalysis.assert-ai[embeddings].GenerationEngineAPI.alllimited to product features: tracing, analysis, embeddings, Azure identity, and ACS.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
uv lock --checknpm audit,npm ci,npm run check,npm run buildnpm audit,npm ci,npm run buildpython -m build,twine check dist/*Checklist