Home / Docs

Configure a package

Release v0.4.0
text
events/
  una.toml
  verification.lock
  src/
    events/
      types.una
      seating.una
      keys.una
      checkin.una
      main.una

una.toml describes the package. The package of §17 shows every section:

Key Meaning
[package] name, version, edition required; edition is "0.1", "0.2" or "0.3" (a preview); edition 0.4 is described by ita.una, not una.toml, and una migrate moves a package there
[labels] categories the label categories of §8.1
[trusted] modules the trusted modules of §8.5
[escape_budget] checked_per_module how many checked each module may use (default 0)
[run] entry, grants the module whose main runs, and the grants of una run and of the native executable

una.toml and verification.lock

Package layout: una.toml and verification.lock at the root, sources under src/. Module a.b.c lives in src/a/b/c.una (U1008). Module paths whose first segment is std or prelude are reserved for the standard library, in a package and in a single file (U1009, spec/10 §11 rule 8).

toml
[package]
name = "events-example"
version = "0.1.0"
edition = "0.1"

[labels]
categories = ["PII", "Location"]

[trusted]
modules = ["events.keys"]

[escape_budget]
checked_per_module = 1        # default 0

[run]
entry = "events.main"
grants = ["console"]

Commands take a file or a directory, . by default (ADR 0021):

una.toml is a TOML document with these tables and keys, and no others (U7002):

A TOML syntax error, a missing required key, and a value of the wrong type or outside its range are U7002. The default settings are empty [labels], [trusted] and [run] tables and a budget of 0.

verification.lock is a TOML document with exactly the keys of spec/12 §9: encoding_version = "una-smt-1", solver = "z3", solver_version a non-empty string, logic = "QF_UFLIA", step_budget an integer of at least 1, and random_seed an integer of at least 0. A missing file, a TOML syntax error, a missing or unknown key and a wrong value are U7004; a solver of another version is U5003. A single file uses the default lock, which holds the values of the repository's verification.lock.

Project errors do not stop checking: the modules are still checked, with the settings that una.toml gives (#930):

(v0.4, ADR 0122.) Edition 0.4 and later. A package of edition 0.4 describes itself in ita.una and is pinned by ita.lock, in Una's own lexical syntax, by the closed grammars of spec/30; a directory with ita.una is a package with that file in place of una.toml, and one with both is U7008. Every error that this section makes U7002 for a key of una.toml is U7008 at the corresponding line of ita.una; every error of ita.lock is U7009 where verification.lock has U7004. una fmt ita.una formats the file, una fmt of the package leaves it alone, and una fix never edits ita.una, ita.lock or itaty.una.

Keys