rslc compiler.
E-PROVENANCE
A filed number needs a citation. Each table, constant and rounding states a number from the filing. The check asks each one to cite the region of the source document that prints it. A citation tells a reviewer where to look. A number that the filing leaves unstated, such as a unit conversion, says why with[reason: "…"].
Example
The constant rate_per_1000 carries a filed rate and lacks a citation.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-SOURCE-SCHEMA
A source has an artifact and a kind.Sources declares each document a rater cites. A source has exactly two fields. artifact holds the ID of the stored document, written artifact("<uuid>") with a lowercase UUID. kind is the file type, written bare: pdf, xlsx, csv, html, zip, png or parquet.
A citation such as [cite: manual:p3] names a source and a region inside it. The fixed shape lets every tool open the same stored document at the cited page.
Example
The source manual has a third field, title.
- A source lacks
artifactorkind. - A source states one field twice.
kindis a quoted string such as"pdf", or a file type outside the list.artifactholds something other thanartifact("…"), such as a bare string orfile("manual.pdf").- The ID inside
artifact("…")is something other than a lowercase UUID, such as"rate-manual".
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-CITATION
A citation names a declared source and region. A citation names a source and a region inside it:[cite: manual:p3]. The check asks for a source that Sources declares and a region that fits the source’s kind:
pdf: a pagep33or a page rangepp20-24xlsx: a cell'Sheet name'!A2or a cell range'Sheet name'!A2:F20csvandparquet:row 12orrows 12-20html:anchor "rates"zip:member "rates/manual.pdf"png:image
manual:page3, and manual is a PDF, so the region reads p3.
p3.
- The citation names a source that
Sourceslacks, such asfiling:p3beside a source namedmanual. - A page or row number is 0, or a range runs backwards; pages and rows start at 1.
- A citation sits on a type or a source; cite the table, constant, step, calculation or input that uses the document.
- A table’s
otherwiserow lacks a citation; writeotherwise [cite: manual:p3]: { … }. - A table column maps to the CSV header
cite; that header holds a citation for each row. - A cell of a table’s
citecolumn holds a citation the table leaves undeclared, or text of another shape. - A
then:tie priority of a ranking function such asargmaxlacks a citation; writethen [cite: manual:p3]: …. - A placeholder carries
@manual:p3afternl "…"; cite the calculation in its place. - A calculation’s body is a quoted string; write a placeholder as
nl "…".
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-PROVENANCE-RUNTIME
Provenance stays out of rating data. Provenance says where a number comes from. In RSL it lives in citations, such as[cite: manual:p3] on a table. The compiler checks each citation and leaves it out of the rating calculation.
The check stops provenance that travels as data: a table column of source pages, an input that holds a document, or a flag that says someone verified the rates. A caller would have to supply such a value on every request, and a reviewer would find the evidence in two places.
Example
The table HazardRate declares a source_page column beside its rate.
cite.
- A table’s CSV file has a column headed
source_page,source_part,__citeor a name that starts with_source. - An input has the type
Source. - An enum lists artifact IDs as members; declare each document in
Sources. - A
Boolinput whose name ends in_verified,_suppliedor_confirmedstays unread by every calculation and rule.
Complete files
Complete files
bad/rater.rsl
bad/tables/HazardRate.csv
good/rater.rsl
good/tables/HazardRate.csv
E-PROVENANCE-COMMENT
Evidence belongs in a citation. A comment that starts withsource:, sources: or readiness: records evidence in a place the compiler leaves unread. The check asks for that evidence as a citation on the declaration the comment describes: [cite: manual:p3].
The compiler checks a citation against Sources, and tools open the document at the cited page. A comment drifts as the rater changes around it. Comments that explain a calculation in other words pass the check.
Example
A comment above the constant repeats where the rate comes from.
[cite: …] first.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl