Skip to main content
A submission log records one submission against one program: a guideline, or a rater alone. rslc submission writes and reads the log. rslc script plays a whole submission from a script file. Run a submission shows the commands at work.

The example on this page

The examples read the staffing example of the synthetic carrier Example Mutual. Its bind.script plays one submission to a bound quote, and --keep writes the log:

Commands

Each command takes the log as its first argument. contract takes a log or a program file. Each row but the last follows rslc submission. Six commands write entries: open, answer, retract, quote, bind and close. These rules decide who may write:
  • A role acts for itself and for each role below it in Roles.
  • An input that lacks by takes an answer from each declared role.
  • A write replaces only an answer or a sign-off from the writer’s own role or a role below it.
  • An act that Acts leaves out is open to each declared role.
  • A program that lacks Roles, such as a rater alone, accepts each role name.
  • One answer command with several answers records all of them or refuses all of them.
open compiles the program, and then holds it to four more rules: rslc check passes a program that breaks one of these rules. open, contract --program and rslc script then stop with the message and exit code 1. To give a role to an input of another record, write its path on the root record, as in policy.experience by @Role.uw.

Options

rslc submission help prints the usage text, which Commands shows.

Exit codes

These commands read their own arguments. For the other rslc commands, 2 marks a wrong command line.

Log stores

The end of a log’s name selects its store: A name with another ending is an error with exit code 1. Both stores keep the same rules:
  • An entry is the same JSON text in both stores, so a log gives one status and one history in each.
  • Commands only add entries. Entry n has seq n, and each read checks it.
  • A write adds all of its entries, or it adds zero.
  • A write lands only while the log still ends at the entry that the command read. When another writer came first, the command reads the log again and decides again.
  • A .sqlite log refuses a changed entry, a removed entry and an entry out of place, from each program that writes to the database.
copy writes every entry of one log into a new log:
  • The new log starts empty. A target that holds entries is an error.
  • copy keeps each entry as it is, so the copy stores the same path to the program. Put the new log in a folder where that path names the same program file.
  • copy writes the entries only. The refused commands stay with the first log.
Entries lists what each store holds.

Questions and values

A question is one of two things:
  • An input’s path from the program’s root record: field names joined by ., such as policy.payroll.
  • A referral’s name, such as new_venture.
A field name starts with a lowercase letter or _. List items gives the path of one item of a list. A value is JSON. Text that JSON leaves unread, such as a bare word, is a string.
  • The log checks each answer against the input’s type and its rules before it writes.
  • Two spellings of one number, such as 2500000 and 25e5, are the same answer.
  • A record that holds a question of another role is stored field by field, one entry for each field.
  • To retract an answer, name the path that its entry holds.

List items

The log names an item of a list by its key: the field that the program gives after keyed by.
  • A key’s value is a JSON string or a JSON number.
  • An answer under a key that the list lacks adds the item, with that key. The writer also needs the role of the key field.
  • An answer to a whole item is a record. The record leaves the key out, or repeats the key of the path.
  • A key names its item for the life of the log. An answer to the key field itself is refused as BAD_PATH.
  • A place in a list, such as [0], is refused as BAD_PATH. A place moves when an item before it comes or goes.
  • A list that lacks a key has zero item paths. Answer it whole, as one JSON list.
  • A keyed list is a map from key to item. The same items in another order are the same answer, and a quote of them stands.
  • Open questions, declines, the answers that a referral reads, lapsed quotes and STALE messages name items by these paths.
  • In a shell, put the pair in single quotes, as the commands below do.
These commands open a log on the fn-folds example. It is a rater alone and lacks Roles, so each role name writes. Its modifiers list is keyed by number, and its endorsements list lacks a key:
The same answer by place is refused:

Stages

The log stores entries only. Each status computes the stage from the entries and the program. The first row of this table that holds gives the stage:
  • An answer is recorded or refused, and the submission stays open either way.
  • Ineligible takes corrections: a new answer or a retracted sign-off moves the stage again.
  • Declined comes only from close declined, by the role of the quote act, while a rule or a sign-off declines.
  • Bound, Declined and Closed are final: the log refuses each later write as CLOSED.
  • With --in, the stage is the stage of that quote option.

Referral and quote states

A status gives each referral one state: A sign-off stands for the answers that the referral’s condition reads. The status shows those answers, and the signed_off entry records them as read. A sign-off lapses when one of those answers changes after it. A lapsed sign-off stops counting: the state follows the condition alone, and lapsed is set. The sign-off stands again when the answers return to the signed values. A status gives each quote one state:

Quote options

One submission may hold several quotes that stand at once, each on its own terms. --in OPTION puts a command in an option: The setup below opens a log, makes it Quotable and gives a first quote on the shared answers:
The option high then answers the limit, which the rater marks per quote, and gets its own quote:
  • An option’s name starts with a lowercase letter and holds lowercase letters, digits and _.
  • An option begins with its first answer or sign-off. quote in an option that holds zero of them is NOT_QUOTABLE.
  • An answer to a fact in an option is refused as NOT_A_TERM, so every quote prices one risk.
  • A record answer in an option is stored field by field, and each field is a term.
  • A record that the shared answers lack enters an option only when the record itself is a term.
  • A write in an option changes that view alone, so it lapses only the quotes of that option.
  • A write to the shared answers changes each view. Each quote whose view changes lapses.
  • A shared sign-off counts in each view that holds the answers it read. A sign-off in an option counts in that option alone.
  • A command with --in checks roles, values and STALE in the option’s view, and prints the status of that view.
  • A status lists the quotes of every option. Its other blocks read one view: the shared answers, or the option that --in names.
  • status --in with a name that the log lacks prints the shared answers.
  • bind names a quote, and the quote keeps its option. The bound policy is that option’s view.
  • --in with open, bind or close is an error with exit code 1. So is a malformed option name.
  • A role’s answer is always a fact: E-ROLE.

Status output

Each command that writes prints the entries it wrote, and then the status. status prints the status alone. This is the example after entry 10:
The status has up to seven blocks, in this order. A block with an empty list is left out.
  • An open question of every role shows any role. A role shows as @uw.
  • An open signoff line ends with because: and the referral’s reason.
  • Under an open signoff line, each reads line gives one answer that the referral’s condition reads. A sign-off stands for exactly these answers.
  • An open input line ends with one of: and the answers it takes, when a table lookup limits them.
  • A record such as policy stands for its inputs. An input of another role inside it gets its own line.
  • An open list shows as the list. An open input of a keyed item shows by its path.
  • An outcome is listed as soon as the answers decide it. Later answers to open questions leave it as it is.
A submission that breaks rules shows them under declines:. Here one rule is the rater’s and one is the guideline’s:
  • A rule of the root record has an empty path, so its line ends with the message.
  • A sign-off of Declined shows the referral’s name, then declined by and the signer.
  • In the Ineligible stage, the block ends with a line that names the two ways on.
close declined then records the decision, and names the codes it rests on:

JSON output

With --json, a command prints one JSON value on one line:
The same value, laid out for reading:
  • reads lists each answer that the referral’s condition reads now. An unanswered input is left out.
  • With --in, stage, outcomes, declines, open, referrals and invalid describe that option’s view.
The declines of declined.jsonl are these:
  • A rule of the root record has an empty path.
  • A decline by a sign-off has the referral’s name as code, the signer in message, and an empty path.
  • A citation of the rater carries the rater’s short name, as in ts__rules:p1.
  • A number in the JSON keeps the digits that the answer or the program gave it.
Five other values have their own shape:

History output

history prints one line for each entry: its number, its writer as role:name, and what it records. The example shows the lines of a whole submission.
  • Each part after the first appears only when the entry holds it.
  • After on, a sign-off line lists each answer that the signer saw, as path = value.
  • history reads the log alone. It prints a list among those answers as one value.

The contract

contract prints what a program asks, who may write each answer and take each act, and what blocks each act. The value comes from the compiled program, the same one that decides each write. Both forms print the same value for the same program. This excerpt keeps one part of each field:
  • rules lists each rule of a record, and each rule of one input that has a code. A plain range or type of an input sits in questions.
  • A rule of the root record has an empty path.
  • With --json, the value is {"ok": true, "contract": {...}} on one line.
  • After the program’s files change, contract LOG is refused as PROGRAM_CHANGED.

Refusal codes

A refused command leaves the log as it was. The output starts with refused, the code and a message, then a candidates: line when the log knows what it accepts, then the status. The examples below run on a second log that holds the four answers of the application:

ALREADY_OPEN

open ran on a log that is open. Go on with the log, or open a new log.

NOT_OPEN

A script step ran before the script’s open step. Put open first. The script under Script files has such a step. On the command line, a command on a log that is missing or empty is an error. It prints error: and a hint to run open, and it exits with code 1.

PROGRAM_CHANGED

The files of the program differ from the files that the log was opened with. The log holds a hash of each source file and each table of the program. Restore the files, or open a new log. history still reads the log. This is the refusal after one edit to guideline.rsl:

CLOSED

The submission is Bound, Declined or Closed, and the three stages are final. Open a new log for a new submission.

UNKNOWN_ROLE

The role in --as is outside the program’s Roles. The candidates are the declared roles.

NOT_AUTHORIZED

The writer’s role is below the role that the question or the act needs. The candidates are the roles that may write. Ask a person in one of them.
The log gives the same code in three more cases:
  • A write replaces an answer or a sign-off of a higher role, or of a role beside the writer’s role.
  • close declined comes from a role below the role of the quote act.
  • An answer adds a list item, and the item’s key field belongs to a higher role.

BAD_PATH

The question is other than an input’s path or a referral’s name. The candidates are the open questions.
The log gives the same code to each path that names a list item another way than by its key: A whole item whose record holds another key than its path gets the same code.

INVALID_VALUE

The value breaks the input’s type, its precision, its range or another rule that lacks a code. The message names the input and quotes the rule, and it ends with nothing was written. A sign-off value other than Approved or Declined gets the same code.
A value that breaks a rule with a code is a different case. The log records the answer, and the stage is Ineligible.

NOT_REFERRED

The sign-off names a referral whose state is NotReferred or Unknown. Sign off a referral that the status lists as open. Here the premium is still unknown:

NOT_ANSWERED

retract names a question whose answer or sign-off is missing. The candidates are the paths that hold one. The payroll’s answer sits at policy.payroll, so a retract of policy finds it missing:
With --in, retract looks at the option’s own answers and sign-offs, and the candidates are those.

NOT_A_TERM

An answer in a quote option names a fact: an input that lacks the per quote mark. Every quote shares a fact. Give the answer again with --in left out, and it reaches each option.
The log gives the same code to a record that an option would make present, when the record itself is a fact.

NOT_DECLINABLE

close declined ran while zero rules and zero sign-offs decline: the stage is Open or Quotable. A decline rests on a rule or a sign-off. The candidates are the other reasons to close.

NOT_QUOTABLE

quote ran outside the Quotable stage. The candidates are the open questions. Answer them first.
The log gives the same code in three more cases:
  • The stage is Ineligible. The candidates are then the codes that decline.
  • The log holds the quote name already, or the name is malformed. A name starts with a lowercase letter and holds lowercase letters, digits and _.
  • --in names an option that holds zero answers and zero sign-offs. The candidates are then the options of the log.

NOT_QUOTED

bind names a quote that the log lacks, or a quote that lapsed. The candidates are the quotes that stand. Bind one of them, or quote again under a new name.

STALE

The command names the last entry that its writer read, with --based-on, and what the command reads changed after that entry. The message names each changed answer. Read the status again, then decide on what it holds.
  • A change elsewhere in the log passes.
  • An entry number past the end of the log is STALE for each command.
  • With --in, the log compares the option’s view at the named entry and now.

Entries

Two more commands give the second log a retracted entry and a closed entry:
An entry is one JSON object. A .jsonl log holds it as one line. A .sqlite log holds it as the text of the entry column, in the table entries, beside its seq. A read of a log stops with an error when an entry is out of place, or when a path names a list place. The seven types follow, each with a line from a log of this page.

opened entry

answered entry

An answer in an option under a union counts while each union in arms keeps that arm.

signed_off entry

The sign-off stands while the referral’s present key equals key. So it stands for the answers in read, which are the answers that the status showed to the signer.

retracted entry

quoted entry

The quote stands while the present key of its view equals key.

bound entry

closed entry

Refused commands

The log keeps each refused command beside its entries. A .jsonl log writes one JSON line for each to a second file. The file’s name is the log’s name with .refused.jsonl in place of .jsonl. A .sqlite log writes the same JSON to the record column of its table refusals. These are two lines of second.refused.jsonl:
rslc script keeps its log in memory and leaves this record unwritten.

Script files

A script file plays one submission and checks what it expects. It is a plain text file with one line for each step. Save this script beside the staffing/ folder as lines.script. It uses every form of line:
lines.script
  • A step that the log refuses fails the script, unless its line starts with refused and the code.
  • A line with both prefixes puts refused CODE: first.
  • A step is written as the command is. Spaces around = are optional.
  • A script’s log lives in memory, and each of its entries has at set to script.
  • --keep LOG writes that log to a new log. A log that holds entries is an error.
  • A line outside these forms stops the script with error: and exit code 1.
rslc script prints one FAIL line and a note for each step that fails, then a summary line. The summary counts the steps and expect lines, the failures and the log entries, and names the last stage. With --json, the value has four fields: