[Forge] Implement conda environment activation for analysis tool execution done coding:7 reasoning:6

← Analysis Sandboxing
## REOPENED TASK — CRITICAL CONTEXT This task was previously marked 'done' but the audit could not verify the work actually landed on main. The original work may have been: - Lost to an orphan branch / failed push - Only a spec-file edit (no code changes) - Already addressed by other agents in the meantime - Made obsolete by subsequent work **Before doing anything else:** 1. **Re-evaluate the task in light of CURRENT main state.** Read the spec and the relevant files on origin/main NOW. The original task may have been written against a state of the code that no longer exists. 2. **Verify the task still advances SciDEX's aims.** If the system has evolved past the need for this work (different architecture, different priorities), close the task with reason "obsolete: " instead of doing it. 3. **Check if it's already done.** Run `git log --grep=''` and read the related commits. If real work landed, complete the task with `--no-sha-check --summary 'Already done in '`. 4. **Make sure your changes don't regress recent functionality.** Many agents have been working on this codebase. Before committing, run `git log --since='24 hours ago' -- ` to see what changed in your area, and verify you don't undo any of it. 5. **Stay scoped.** Only do what this specific task asks for. Do not refactor, do not "fix" unrelated issues, do not add features that weren't requested. Scope creep at this point is regression risk. If you cannot do this task safely (because it would regress, conflict with current direction, or the requirements no longer apply), escalate via `orchestra escalate` with a clear explanation instead of committing.

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (4)

[Forge] Add setup_conda_envs.sh; document conda env setup in AGENTS.md [task:5e9e7f2e18dc]2026-04-20
[Forge] Add setup_conda_envs.sh; document conda env setup in AGENTS.md [task:5e9e7f2e18dc]2026-04-20
[Forge] Add setup_conda_envs.sh; document conda env setup in AGENTS.md [task:5e9e7f2e18dc]2026-04-20
[Forge] Add setup_conda_envs.sh; document conda env setup in AGENTS.md [task:5e9e7f2e18dc]2026-04-20
Spec File

[Forge] Implement conda environment activation for analysis tool execution

Quest: Analysis Sandboxing Priority: P3 Status: open

Goal

Ensure the conda environments defined in docker/*/environment.yml are actually created and used when tools execute. Currently engine.py maps tools to environments but the environments may not exist. Verify and fix the full tool→environment→execution chain.

This should culminate in real analysis entrypoints using those environments,
not only a mapping table. The critical proof is that a representative
mechanistic analysis can relaunch into the correct runtime and persist
reproducible outputs against the live SciDEX DB.

Acceptance Criteria

☑ All 5 specialized conda environments created (singlecell, genomics, proteomics, cheminformatics, dataml)
☑ engine.py correctly activates the right conda env for each tool
☐ Tool execution in conda env verified with a test suite
☑ Missing packages installed in correct environments
☑ Environment creation script is idempotent and documented
☑ At least one real-data analysis runner uses the runtime path successfully

Approach

  • Check which conda environments exist: conda env list ✅
  • Create missing environments from docker/*/environment.yml ✅ (all existed; setup_conda_envs.sh created for future use)
  • Test engine.py tool routing: does each tool land in the right env? ✅ (verified via engine.py list)
  • Fix any broken imports (e.g., scanpy in forge-singlecell) ✅ (scanpy 1.11.5, pysam 0.23.3, rdkit 2026.03.1 verified)
  • Write setup_conda_envs.sh for reproducible environment creation ✅
  • Add to AGENTS.md as setup requirement ✅
  • Dependencies

    • forge/runtime.py — already implemented by prior agents
    • engine.py — already implemented by prior agents

    Dependents

    • forge/computational_analysis.py — uses run_python_script for mechanistic DE analysis
    • scripts/archive/oneoff_scripts/run_mechanistic_de_analysis.py — analysis runner via run_python_script

    Work Log

    • 2026-04-20: Verified all 6 Forge conda environments exist and are available (forge-singlecell, forge-genomics, forge-proteomics, forge-cheminformatics, forge-dataml, forge-base). Verified engine.py correctly routes tools to environments via RUNTIME_MAP and forge.runtime. Verified key packages (scanpy 1.11.5, pysam 0.23.3, rdkit 2026.03.1) are installed and importable. Created setup_conda_envs.sh (idempotent, --check/--force-update modes). Added setup_conda_envs.sh to AGENTS.md under Development Standards. Remaining gap: tool execution test suite for conda runtime (not HTTP API tools).

    Payload JSON
    {
      "requirements": {
        "coding": 7,
        "reasoning": 6
      }
    }

    Sibling Tasks in Quest (Analysis Sandboxing) ↗