Add leave-one-cluster-out evaluation workflow#31
Conversation
Adds .github/workflows/run-eval.yml, a workflow_dispatch action that: - takes the held-out dataset id (index, dataset_identifier, list, or a cluster id/name from config/cv_folds.yaml, which is expanded to indices) - builds the self-contained run environment under .runs/<name>/ via src.folds.build_env (held-out cluster removed from exemplars + reference code) - optionally stages the held-out dataset(s) raw inputs - runs the curator+harmonizer agent starting in that run folder - uploads the entire run folder (including all output files) as an artifact Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PwfJQSWjmeiVqk2d65c6xJ
|
Claude finished @cmungall's task —— View job PR Review: Add leave-one-cluster-out evaluation workflowTasks
Overall this is a well-structured, thoughtfully documented workflow. Below are specific observations across the requested dimensions. Security Concerns[High] Unquoted expression in shell command (code injection risk)
cd ${{ steps.resolve.outputs.env_path }}The Similarly, lines 105–106 interpolate --holdout "${{ steps.resolve.outputs.holdout }}" \
--name "${{ steps.resolve.outputs.env_name }}"These are less risky because they're quoted, but any step output originating from user input should ideally be passed via environment variables, not direct expression interpolation. Recommendation: Sanitize or validate [Medium] Line 44: Potential Bugs[Medium] Lines 111–114: uv run python -m src.folds.stage_raw_data \
--indices "${{ steps.resolve.outputs.stage_indices }}" \
--drive-method publicThere is no [Low] Inline Python Lines 95–98 use with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(f"holdout={holdout}\n")(Also: writing to [Low] The inline Python at lines 79–83 matches on cluster Code Quality & Best Practices[Medium] Duplicate prompt vs. The [Low] Action version pinned to Line 117: [Low] Line 58: [Low] No timeout on the agent step The Performance
Test CoverageThere are no automated tests for the workflow logic itself (expected for a workflow file). The inline Python at lines 66–99 is the most logic-dense untested piece — the Summary
The security item around |
- Sanitize env_name in all branches (incl. free-text `name` input) to a safe
charset, closing the shell/path injection flagged in review
- Pass step outputs into run: blocks via env: vars instead of inline
${{ }} interpolation
- Write GITHUB_OUTPUT directly instead of relying on stdout redirect
- Narrow job permission to contents: read (workflow only reads + uploads)
- Add timeout-minutes: 60 to the agent step to cap runaway evals
- Note that the agent prompt mirrors AGENT_INSTRUCTIONS.md, and that raw
staging writes to the home path by design
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PwfJQSWjmeiVqk2d65c6xJ
|
Claude finished @cmungall's task —— View job Tasks
PR Review: Add leave-one-cluster-out evaluation workflow (updated)This review covers the current state of the file, which already addresses several items from the previous review. The diff from
The diff is clean and targeted. The remaining items from the previous review (mostly low-priority quality nits) are addressed below. Remaining Issues[Low] run: uv syncIn CI, run: uv sync --frozen[Low] uses: anthropics/claude-code-action@beta
[Low] No There's no caching of - uses: actions/cache@v4
with:
path: ~/.cache/uv
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}[Low] If a user passes if cluster_id and c.get("description", "").lower().find("exclude") >= 0:
raise SystemExit(f"ERROR: cluster '{cluster_id}' is a global-exclude cluster and cannot be held out.")Observations on New CodeThe injection-safety fix is solid: The The comment on line 144 ( Summary
The high-priority security concern is resolved. The remaining items are all low-priority quality/performance nits — this is ready to merge with those understood as follow-up candidates. |
Summary
This PR adds a new GitHub Actions workflow for running leave-one-cluster-out (LOCO) harmonization evaluations. The workflow enables manual evaluation of the harmonization agent on held-out datasets while excluding them from exemplar mappings and reference code.
Key Changes
.github/workflows/run-eval.yml): Implements a manually-triggered evaluation pipeline that:config/cv_folds.yaml)Notable Implementation Details
5,dataset_id,1,2,3,6,cluster_1,sg_ph_micromet) with automatic resolution via YAML cluster configurationsrc.folds.build_envto create self-contained run folders that exclude held-out data from training materialshttps://claude.ai/code/session_01PwfJQSWjmeiVqk2d65c6xJ