Skip to content

fix: insert '--' before snakemake targets to prevent --rerun-triggers consuming them#89

Merged
EiffL merged 1 commit into
mainfrom
claude/issue-87-20260430-1115
Apr 30, 2026
Merged

fix: insert '--' before snakemake targets to prevent --rerun-triggers consuming them#89
EiffL merged 1 commit into
mainfrom
claude/issue-87-20260430-1115

Conversation

@EiffL
Copy link
Copy Markdown
Member

@EiffL EiffL commented Apr 30, 2026

Fixes #87

Summary

  • Extracted _build_snakemake_cmd() helper in commands.py that owns snakemake argv construction
  • Inserts -- before any target paths to terminate argparse flag processing
  • Adds three focused regression tests for the command-building logic

Root cause

snakemake's --rerun-triggers uses nargs=+ in argparse, so it greedily consumes the first positional argument after the trigger list as another trigger value. When lc run <output> appends target paths immediately after the trigger values, snakemake rejects the path as "invalid choice".

Test plan

  • test_run_cmd_inserts_separator_before_targets — reproduces the bug; asserts -- appears between triggers and targets
  • test_run_cmd_no_separator_when_no_targets — no -- when running rule all
  • test_run_cmd_multiple_triggers_all_before_separator — all trigger tokens precede --

Generated with Claude Code

… consuming them

snakemake's --rerun-triggers uses nargs=+ in argparse, causing it to greedily
consume the first target path as an extra trigger value when targets immediately
follow the trigger list.

Extract _build_snakemake_cmd() helper and append '--' before any target paths
so argparse stops flag processing before the targets are seen. Add three
regression tests that directly exercise the command-building logic.

Fixes #87

Co-authored-by: Francois Lanusse <EiffL@users.noreply.github.com>
@EiffL EiffL merged commit 677110a into main Apr 30, 2026
5 of 6 checks passed
@github-actions
Copy link
Copy Markdown

✅ Eval Results

Metric Value
Score 1.00
Build complete
Cost $1.66
Turns 57
Duration 422s
lightcone-cli 0.1.dev1+g2320e7b59 (2320e7b5)
Results Download

Graders

✅ spec_valid (1.00)
✅ all_materialized (1.00)

Full output
b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:56 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:56 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:56 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:56 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:56 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:56 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:56 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:56 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:56 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:56 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:57 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:57 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:57 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:57 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:57 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
11:59:57 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/7c0836e0-98dc-4855-b006-e5bd04a36caf/files/bulk-upload "HTTP/1.1 200 OK"
12:07:00 lightcone.eval.sandbox Deleted sandbox for trial build-snae-0
  snae trial 0: score=1.00 complete

lightcone-cli: 0.1.dev1+g2320e7b59 (HEAD 2320e7b5)

  Eval Results: Scores  
┏━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Task ┃     Score     ┃
┡━━━━━━╇━━━━━━━━━━━━━━━┩
│ snae │ 1.00 +/- 0.00 │
│      │ pass@k: 100%  │
└──────┴───────────────┘

   Eval Results: Cost &   
         Duration         
┏━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Task ┃ Cost / Duration ┃
┡━━━━━━╇━━━━━━━━━━━━━━━━━┩
│ snae │      $1.66      │
│      │      422s       │
└──────┴─────────────────┘

Total: 1 trials, $1.66, 422s

Results saved to: eval-results/build-2320e7b5/results.json

@aboucaud aboucaud deleted the claude/issue-87-20260430-1115 branch May 8, 2026 10:47
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.

lc run fails: --rerun-triggers consumes target path as a trigger value

1 participant