5.4 Artifact discovery and ambiguity
Artifact discovery answers a provenance question: which control stream, estimates, uncertainty matrices and subject-level results belong together? nlmx offers three main input modes. Use one mode deliberately and record it.
Figure 5.3. Explicit paths have the smallest search surface. A manifest makes a portable run family explicit. Directory discovery is convenient when a folder has one unambiguous control stream or a specified stem.
5.4.1 Explicit files
Supplying --ctl or --ext enters the explicit-file path. The control stream is still required by workflows that need model structure. nlmx looks for optional same-stem files beside the control stream and, in supported cases, in a same-stem fit folder. It can resolve different roles independently, so stale files in both locations are dangerous even when each filename looks reasonable.
Use explicit paths when reproducing a published run:
nlmx inspect `
--ctl documents/ch05/results/fit/base.ctl `
--ext documents/ch05/results/fit/base.ext `
--cov documents/ch05/results/fit/base.cov `
--cor documents/ch05/results/fit/base.cor `
--phi documents/ch05/results/fit/base.phi `
--covariates CL=WT
An explicit table file is not inferred merely because one happens to sit beside the control stream. Pass it when a workflow is meant to use it.
5.4.2 File manifests
--files reads a small TOML manifest. Paths are resolved relative to the manifest itself, which makes a copied run family portable if its internal layout is retained. The generated example is:
[files]
control_stream = "fit/base.ctl"
ext = "fit/base.ext"
cov = "fit/base.cov"
cor = "fit/base.cor"
phi = "fit/base.phi"
It is exercised with:
nlmx inspect `
--files documents/ch05/results/files.txt `
--covariates CL=WT
A manifest is the best default for a validated comparison bundle: it names each role and can be checked into an evidence package with hashes. Keep command-line and settings-file path overrides out of the same invocation unless their precedence has been explicitly tested. Mixed input modes make it harder to explain which file won.
5.4.3 Model-directory discovery
--model-dir scans for control streams and associated artifacts. With one control stream, discovery is convenient. With several, supply --run-stem:
nlmx inspect `
--model-dir documents/ch05/results/ambiguous `
--run-stem base `
--data documents/ch05/analysis.csv `
--covariates CL=WT
The generated directory contains base.ctl and other.ctl. Omitting --run-stem produces input error exit code 3, captured in logs/ambiguous.txt. The resolved command exits successfully.
Directory discovery begins from .ctl or .mod candidates. Recursive scanning is optional. Candidate ordering is deterministic, but deterministic selection is not proof that two auxiliary files belong together. Duplicate or extra auxiliary artifacts can be resolved by scan order in some roles. For high-stakes comparisons, a clean one-run directory or a manifest is safer than a mixed archive.
5.4.4 Missing and optional files
Most inspection and covariate workflows require both a control stream and .ext. The generated input-only directory contains a control stream but no .ext; inspect exits 3. Optional files become required when an option requests their content. For example, a workflow configured to require PHI fails if it is missing rather than silently reconstructing it.
A discovered .lst establishes that the artifact exists; it does not replace .ext parsing. Similarly, a data file inferred from $DATA is a dataset input, not evidence that the numerical result files came from that dataset.
5.4.5 Command-specific differences
The three modes are a foundation, not a universal search algorithm for every command:
fitreads.extinitialization only with--start-from-ext;vpchas a results-directory search path in addition to explicit estimates;simscan use initial values unless final estimates are explicitly selected or requested by its simulation settings;powerdoes not universally assume that a beside-control-stream.extshould replace control-stream values;- posterior workflows have their own PHI preference, reconstruction and requirement settings.
The relevant command chapter is authoritative for these additions. When speed matters, automatic discovery is appealing; when accuracy comparisons matter, explicit provenance usually saves more time than it costs.
Common mistakes
- Pointing at a folder containing several control streams without
--run-stem. - Assuming every duplicate auxiliary artifact is rejected.
- Combining a settings-file run family, explicit paths and directory discovery without checking precedence.
- Treating the presence of a
.lstas a numerical import. - Expecting all commands to discover final estimates in the same way.
Checklist
- One input mode is identifiable from the recorded command.
- The intended run stem is explicit in a multi-run directory.
- All required files exist and their hashes are retained.
- Paths in a manifest resolve relative to that manifest.
- Optional PHI/table inputs are explicit when required.
- Command-specific discovery behavior was checked.
Further reading
Return to Section 4.1 for the project vocabulary. Use Section 5.5 to test a chosen run family numerically. Chapter 7 will cover settings and precedence as a whole.