Summary
zwill twin-experiment export-plan throws an unhandled AttributeError when the plan's context_questions is a JSON list instead of a comma-separated string. The sibling model field is a list and works fine, so the type contract is inconsistent between adjacent fields, and there is no plan validation to produce a clear error — just a raw traceback.
Repro
Plan defaults with context_questions as a list:
{
"defaults": {
"context_questions": ["AGEFaixas", "GENDER", "SEL", "REGION", "Q1"],
"model": ["openai:gpt-5.5", "google:gemini-2.5-pro"]
}
}
zwill twin-experiment export-plan --path plan.json
Traceback:
File ".../zwill/twin_jobs.py", line 492, in build_edsl_digital_twin_job_dict
context_question_names = deps.selected_question_names(context_args, questions)
File ".../zwill/edsl_integration.py", line 145, in selected_question_names
selected.extend(name.strip() for name in args.questions.split(",") if name.strip())
AttributeError: 'list' object has no attribute 'split'
Fix: use a comma-separated string ("AGEFaixas,GENDER,SEL,REGION,Q1") — but nothing in the scaffold or docs signals this, and model accepting a list sets the opposite expectation.
Suggested fixes
- Accept both a list and a comma-separated string for
context_questions (and normalize other question-list fields consistently — heldout_questions, exclude_question, etc.).
- Validate the plan up front and emit a structured error (
code: invalid_plan_field) instead of letting a .split traceback escape.
- Related: there is no way to lint/validate a hand-edited plan before
approve/export-plan (plan-status requires --survey/--plan-id and only finds records post-export). A twin-experiment validate --path plan.json would catch this class of error early. (Filed separately.)
Summary
zwill twin-experiment export-planthrows an unhandledAttributeErrorwhen the plan'scontext_questionsis a JSON list instead of a comma-separated string. The siblingmodelfield is a list and works fine, so the type contract is inconsistent between adjacent fields, and there is no plan validation to produce a clear error — just a raw traceback.Repro
Plan
defaultswithcontext_questionsas a list:{ "defaults": { "context_questions": ["AGEFaixas", "GENDER", "SEL", "REGION", "Q1"], "model": ["openai:gpt-5.5", "google:gemini-2.5-pro"] } }Traceback:
Fix: use a comma-separated string (
"AGEFaixas,GENDER,SEL,REGION,Q1") — but nothing in the scaffold or docs signals this, andmodelaccepting a list sets the opposite expectation.Suggested fixes
context_questions(and normalize other question-list fields consistently —heldout_questions,exclude_question, etc.).code: invalid_plan_field) instead of letting a.splittraceback escape.approve/export-plan(plan-statusrequires--survey/--plan-idand only finds records post-export). Atwin-experiment validate --path plan.jsonwould catch this class of error early. (Filed separately.)