Rename input-file flags from --path to --input-path#69
Conversation
Across the CLI, --path/--out meant "write output here" on some commands and "read this input file" on others (question import, twin-results import, twin-experiment approve, agent-list inspect, ...). That overload is a foot-gun: an agent or user can't tell from the flag whether a command writes or reads, and it blocks a clean "contain all outputs under one directory" guardrail. Fix it before there are external users: every input-file flag is now --input-path (dest input_path), so the invariant holds by construction — any --path/--out is an output, any --input-path is a read. 26 input handlers across ~11 modules now read args.input_path; output handlers are untouched. Also updated: internal callers that synthesize a Namespace to invoke an import handler (twin-study run, import-results-dir, import-plan-results, pew-demo workflow, practitioner-report imports); all next_steps/hint strings that tell users to run an input command (they'd otherwise print a flag that now errors); the guides, skills, README, SPEC, and example scripts; and the test suite. No back-compat alias: this is a deliberate clean break while the surface is still internal. `zwill <cmd> --path` on an input command now errors with the standard argparse "required: --input-path" message. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR renames all input-file CLI flags from
Confidence Score: 5/5This is a clean mechanical rename with no behavioral changes — all 25 input-command parsers, 26 handler functions, internal Namespace synthesizers, hint strings, tests, and docs were updated consistently. The rename is applied exhaustively: every input-command parser definition, every handler that reads the flag, every internal argparse.Namespace(...) call that targets an import handler, and every user-facing hint string were all updated. Output-only --path flags are correctly left untouched. No missed cases were found across the 39 changed files. No files require special attention. The most complex delegation chains (practitioner_reports.py delegating through cmd_twin_benchmark_practitioner_report_import, twin_validation_commands.py and probability_commands.py re-using the same delegate) all correctly propagate args.input_path. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User runs CLI command] --> B{Flag type?}
B -->|--input-path| C[Input command\ne.g. import / inspect / add]
B -->|--path or --out| D[Output command\ne.g. export / run / render]
C --> E[Handler reads args.input_path\nopens file for reading]
D --> F[Handler reads args.path\nwrites file to disk]
E --> G[Internally synthesized Namespace\nuses input_path= keyword]
F --> H[Internally synthesized Namespace\nuses path= keyword]
G --> I[Result: invariant by construction\nany --path/--out is always an output\nany --input-path is always a read]
H --> I
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[User runs CLI command] --> B{Flag type?}
B -->|--input-path| C[Input command\ne.g. import / inspect / add]
B -->|--path or --out| D[Output command\ne.g. export / run / render]
C --> E[Handler reads args.input_path\nopens file for reading]
D --> F[Handler reads args.path\nwrites file to disk]
E --> G[Internally synthesized Namespace\nuses input_path= keyword]
F --> H[Internally synthesized Namespace\nuses path= keyword]
G --> I[Result: invariant by construction\nany --path/--out is always an output\nany --input-path is always a read]
H --> I
Reviews (1): Last reviewed commit: "Rename input-file flags from --path to -..." | Re-trigger Greptile |
What
--path/--outwere overloaded: on some commands they mean write output here, on others read this input file (question import,respondent import,answer import,twin-results import,twin-experiment approve/export-plan/validate,agent-list inspect, the*-importreport commands,context add/set,raw add,agent-material add/import, ...).Every input-file flag is now
--input-path(destinput_path). Output flags (--path/--out) are unchanged. The result is an invariant that holds by construction: any--path/--outis an output; any--input-pathis a read.Why
zwill_work/" resolver can rebase every--path/--outwithout a fragile per-flag input/output classification. This rename is the prerequisite that makes that resolver correct by construction.Doing it now, before external users, means no compatibility burden — a clean break.
Scope
--input-path.args.input_path; output handlers untouched (124args.pathreads remain, all outputs).Namespaceto call an import handler (twin-study run,import-results-dir,import-plan-results, the pew-demo workflow, the delegating practitioner-report imports, the internalrank-results-import) now passinput_path=.next_steps/hintstring that tells the user to run an input command was updated — otherwise the tool would print a command that now errors.Behavior change
zwill question import --survey demo --path q.jsonlnow errors:Use
--input-path. No deprecated alias.Testing
pytest— 242 passed.ruff check zwill/ tests/clean.--pathrejected on input commands,--input-pathworks end-to-end; example scripts (which run real CLI flows) pass.--pathreferences (outside historicalworkdir/snapshots).🤖 Generated with Claude Code