Chapter 7. The settings system
A reproducible analysis needs an explicit, reviewable account of every effective setting. nlmx accepts convenient command-line options, reusable command-specific settings files and built-in defaults. This chapter explains how those sources combine, how paths are resolved, how errors are reported and which retained artifacts prove what was actually run.
What you will learn
- how defaults, settings files and command-line arguments establish effective values;
- why every settings file contains TOML but uses a command-specific extension;
- how to generate an annotated template and distinguish syntax, type and semantic errors;
- how relative paths, output folders, manifests and SHA-256 hashes support portability;
- how to convert a command into a reviewed settings file and verify equivalent results.
Prerequisites. Read Chapter 4 for conventions and Chapter 5 for control-stream inputs. Dataset semantics are covered in Chapter 6.
Scope and evidence
This chapter is versioned to nlmx 4.3.0. Claims were checked against the live configuration extension registry, command parsers, path-resolution code, output writer and the executable. Reproducible fixtures and captured logs are in documents/ch07; pytools/ch07_examples.py reruns the checks.
The worked experiment generated a .power template, deliberately triggered wrong-extension and unknown-key failures, exported the covariate schema, and ran the same FIM power analysis from CLI arguments and a settings file. power_scenarios.csv and fim_power.csv were identical. A third run confirmed that CLI values replaced file values in power_settings_used.power.
Eighteen pages in this chapter
The broad Chapter 7 outline is divided into 18 Markdown pages:
| Page | Topic |
|---|---|
| 7.1 | Configuration layers and precedence |
| 7.2 | CLI overrides and effective values |
| 7.3 | TOML syntax, tables, arrays and comments |
| 7.4 | Command-specific extensions |
| 7.5 | Templates with --print-config |
| 7.6 | Unknown keys, types and value validation |
| 7.7 | Errors, exit codes and hints |
| 7.8 | Relative, absolute and Windows paths |
| 7.9 | Portable project layouts |
| 7.10 | Input manifests and SHA-256 |
| 7.11 | Output checksums, logs and analysis hashes |
| 7.12 | Common input, execution and output keys |
| 7.13 | Analysis, design and method tables |
| 7.14 | Option-to-setting mapping |
| 7.15 | Effective-settings and rerun records |
| 7.16 | Worked CLI-to-file round trip |
| 7.17 | Reviewing and versioning settings |
The outline's page budget refers to rendered pages; this count is the number of Markdown source pages.
The governing rule
Treat the settings file as reviewed intent and the settings-used file, log, input manifest and checksums as execution evidence. Keep both. Intent alone cannot prove a CLI override was absent; output alone cannot explain why a value was chosen.
Continue with configuration layers and precedence.