Documentation

7.1 Configuration layers and precedence

Most nlmx commands build an effective configuration from three layers:

  1. compiled defaults;
  2. values read from a command-specific settings file;
  3. explicit command-line values.

Later layers replace earlier ones for the fields they set. An omitted CLI option does not erase the corresponding file value. An omitted file key leaves the command default in place. This is a field-by-field merge, not a choice between “CLI mode” and “file mode.”

compiled default  <  settings file  <  explicit CLI option

The exact fields and defaults are command-specific. Generate the current command template instead of copying a setting from a different command. A default is also not a validation target: it is the value used when neither a file nor the CLI supplies a replacement.

Inputs need extra care

Some commands accept a primary input as a positional argument, through a named CLI option, or in a settings table. For those commands, the invocation-level input wins over the file. Where both a positional input and --data-style option exist, consult that command's help; do not generalise the ordering from another command.

Path origin is independent of value precedence. A path read from a settings file is resolved relative to that file's directory. A path supplied on the command line is interpreted from the process working directory. Thus two identical-looking strings can name different files.

Example

The Chapter 7 fixture contains:

[analysis]
target_power = 0.8

[design]
sample_sizes = [12, 24]

This invocation changes only those two values:

nlmx power -c documents/ch07/roundtrip.power `
  --target-power 0.9 --sample-sizes 18 `
  -o documents/ch07/results/override-run

The retained settings show target_power = 0.9 and sample_sizes = [18]; unrelated file values remain. This is direct evidence of precedence, not an inference from filenames.

Accuracy implications

Cross-software comparison requires comparison of effective values, not just the handwritten files. Defaults for approximations, tolerances, censoring and random seeds can differ between programs and releases. Make every result-affecting comparison setting explicit or record the defaults from both systems.

Common mistakes

  • Assuming a settings file suppresses all CLI processing.
  • Comparing source files while ignoring wrapper-supplied CLI arguments.
  • Treating a relative path as though it has one universal base directory.

Checklist

  • Identify all three configuration layers.
  • Record the exact invocation and working directory.
  • Inspect the effective-settings artifact after the run.

Further reading

See CLI overrides, path resolution and effective-settings records.