This document maps the current CLI behavior to implementation.
Primary source files:
apps/nexagauge-apps/ng_cli/main.pyapps/nexagauge-apps/ng_cli/run.pyapps/nexagauge-apps/ng_cli/estimate.pyapps/nexagauge-apps/ng_cli/cache.pypackages/nexagauge-graph/ng_graph/runner.py
nexagauge exposes three top-level command entries:
nexagauge run <node_name>nexagauge estimate <node_name>nexagauge cache <command>
Shared setup in both commands:
- Validate target node name against topology.
- Resolve global/per-node model routing.
- Build cache store (
CacheStoreorNoOpCacheStore). - Resolve dataset adapter and stream selected rows.
- Inject per-case runtime routing config (LLM overrides +
chunker/refiner/refiner_top_k).
run() calls CachedNodeRunner.run_cases_iter(..., execution_mode="run").
Per outcome:
- success: accumulate executed/cached step counters.
- success +
--output-dir: write one<case_id>.jsonreport file whenfinal_state["report"]is present. - failure: collect
(case_id, error)and continue or exit based on--continue-on-error.
Behavior notes:
--debugenables per-node debug logs.- When
--debugis off, a CLI progress bar is shown. --web-searchand--evidence-thresholdare currently accepted for compatibility but not used by currentrunimplementation.
estimate() calls CachedNodeRunner.run_cases_iter(..., execution_mode="estimate").
Per outcome:
- aggregate
estimated_costsby node. - aggregate node stats (executed, cached, estimated, uncached-eligible).
- render branch table + total estimate.
Behavior notes:
--debugenables per-node debug logs.- When
--debugis off, a CLI progress bar is shown.
cache exposes cache-management commands:
nexagauge cache dirprints the resolved cache root.nexagauge cache deletewipes the node-level execution cache.
Cache root resolution:
--cache-dirforcache delete, when provided.NEXAGAUGE_CACHE_DIR, when set.- The per-user platform default from
default_cache_dir().
CachedNodeRunner is the CLI-to-graph bridge.
Key responsibilities:
- Build initial
EvalCasestate from each input row. - Expand target plan from topology prerequisites.
- Read/write node-level cache entries.
- Reuse
runcache entries fromestimatemode when route matches. - Execute metric nodes in parallel for
target=eval. - Stream outcomes in submission order.
Planning note:
- For non-
reporttargets, runner appendsreportto the execution plan so final state can emit report JSON consistently.
create_dataset_adapter(...) behavior:
adapter=local-> local file adapter.adapter=huggingface-> Hugging Face adapter.adapter=auto:hf://...input -> Hugging Face adapter.- existing local path -> local adapter.
- otherwise -> input parse error.