rslc is the command-line tool for RSL raters. This page shows each command on the dwelling fire
rater from Write your first rater, with the output it prints.
Each command exits with status 0 when it succeeds and 1 when it fails, so a script or CI job
can stop on a failure.
Check a rater
rslc check reads the rater and its tables, and proves every promise in
What rslc checks and guarantees:
becausegives the reason for the rule.helpshows a rewrite. Replace the example citation with the real one.applicability: manualmeans the author applies the fix by hand.
--json before the command name. The output is one JSON object with
the keys ok, diagnostics, cost and summary, among others:
Format a rater
rslc fmt rewrites the source in the standard layout. --check reports the change and leaves the
file as it is:
Package a rater
rslc export packages the rater as a bundle: one ZIP file that holds the source, the tables and
a manifest.
- Run
rslc checkfirst, and package a rater only after it passes.rslc exportstops on a calculation that can fail, and leaves the citation and outcome checks torslc check. - The command writes a new ZIP file, and stops when the file already exists.
- It also writes
rater-manifest.jsonandrater.pybeside the source.--format pythonwrites onlyrater.py.
Rate from Python
rslc.PreparedRater loads an unpacked bundle folder. rate takes one request as JSON text and
returns a JSON result. The sample download includes this bundle in
relativities-examples/rsl/dwelling-fire:
- A rated request returns
"ok": trueand the outcomes underoutputs. - A refused request returns
"ok": falseand arefusal. Refusals describes it. detailed=Trueadds every calculation tooutputs.
rate_describe returns JSON Schemas for the request, the output and the detailed output. An
integration can build its forms and checks from them:
Rater.load. See
Rate submissions with a rater.
Generate requests from the rules
rslc inputs sample builds requests that pass every rule. --representation rate prints them in
the request form that rate takes:
--nsets the number of requests, and--seedfixes the random choices.--json-linesalso writes each request to a file, one JSON row per line, under the keyinput.--invalidbuilds requests that break one rule each, and records the expected refusal.
Check one request
rslc inputs validate checks one request against the rules. It reads the evaluator form, the default
form of rslc inputs sample:
candidate.json. Save a copy with protection_class set to 11 as
bad-candidate.json:
rate form, rate it with PreparedRater.