adsmd: Manifest and Validator
adsmd is a static checker for ADS-IDAC plant projects. It parses the input files of a project, builds a typed manifest, and reports parse and cross-reference problems before a simulation runs. It only reads files; it does not modify a project.
Why it exists
An ADS-IDAC plant project is a directory of hand-edited text files (tests/BV4/Input/ holds 509 files). The engine's readers are positional and count-driven, and most of them do not verify labels. A typo in a channel name, a wrong section count, or a dangling procedure reference leads either to a late failure or to a simulation that completes on the wrong inputs.
adsmd reports:
- Path errors:
ZiniADS.txtpoints at a deck or a project directory that does not exist. - Structural errors: a missing header keyword, a label in the wrong position, a non-numeric token where a number is expected, or a file that ends in the middle of a row. All of these are reported as
R0. - Dangling cross-references: a name used in one file (a channel symbol, a ControlPanel parameter, an SPDS entry, a procedure step) that is not declared in the file that owns it. Several rules add "did you mean" suggestions for near misses.
- Out-of-range values: probabilities outside
[0, 1], non-positive distribution parameters, non-finite coefficients, unknownsim::*type codes. - Leftover files: editor backups under
Input/and input files that no engine code reads.
What the tool provides
- Eight subcommands:
validate,manifest,schema,xref,rules,stats,diff,completions. See the CLI reference. - 38 rule identifiers:
R0for parse errors and 37 checks numbered betweenR1andR45. The numbering has gaps;adsmd rulesprints the list and the rule catalog documents every entry. - Four report formats for
validate: terminal (default),--json,--sarif(SARIF 2.1.0) and--html(one self-contained page). - A per-project
.adsmd.tomlthat switches rules off or changes their severity. See Integrating adsmd.
| File family parsed | Rules that read it |
|---|---|
ZiniADS.txt | R1, R2 (R33 fires when the file is absent) |
Input/Scheduler/ZCtrlPar.txt | R3, R45 |
Input/System/Initiating_Event.txt | R31, R45 (lookup target of R10, R22) |
Input/System/RELAP5_channels.txt | R5, R6, R29 (lookup target of R7) |
Input/Indicators/ControlPanel.txt | R7, R8, R34, R35, R36 (lookup target of R9, R11, R22, R23, R25, R28) |
Input/Indicators/SPDS_input.txt | R9 (lookup target of R24) |
Input/HardwareReliability/SystemReliability.txt | R10, R11, R31, R42 (lookup target of R22) |
Input/Crew/Calculation_Aid.txt | R28, R43 |
Input/Crew/{DecisionMaker,ActionTaker,Consultant}/<Role>.txt | none (parsed into the manifest only) |
Input/Crew/{DecisionMaker,ActionTaker}/KB_O{D,A}M_*.txt | R22, R23, R24, R25, R31, R37, R38, R39, R41 |
Input/Crew/{DecisionMaker,ActionTaker}/RM/*.txt | none (summary counts in the manifest only) |
Input/Crew/Procedures/ | R12, R13, R14, R20, R21, R31, R40 |
Input/SupportSystemsReliability/*.fta | R26 |
| RELAP5 input deck (card numbers only) | R29 |
Files under Input/ (directory walk) | R30, R32 |
The format reference describes what each parser accepts.
Quick start
cd tools/adsmd
cargo build --release
./target/release/adsmd --version
./target/release/adsmd validate ../../tests/BV4On a fresh checkout the last command ends with
adsmd: 1 error(s), 1 warning(s), 166 info(s)and exits with code 2. The tutorial explains each diagnostic and why the totals change when a local tests/BV4/ZiniADS.txt exists (that file is git-ignored).
adsmd validate exits 0 when no diagnostic reaches the exit threshold and 2 when at least one error is present. By default only errors count, so a run with warnings and infos but no errors exits 0. --exit-on moves the threshold. 65 means the directory is not a plant project. The full table is in the CLI reference.
Where things live
tools/adsmd/: the Rust workspace with the tool's source.docs/tools/adsmd/: this documentation.docs/developer/internals/file-formats.md: the engine-internals reference for procedure step files, separate from the format reference on this site.
Pages
- Tutorial: running
adsmdontests/BV4, reading every diagnostic it produces, and using the other subcommands. It also serves as the annotated example report. - CLI reference: every subcommand, flag and exit code. The manifest's JSON Schema is produced by
adsmd schema. - Format reference: what each input file looks like and which engine code reads it.
- Rule catalog: what each
R<n>checks, its severity, and how to fix a finding. - Integrating adsmd:
.adsmd.toml, GitHub Actions and SARIF, a pre-commit hook, the ctest entry, HTML reports and JSON output.