---
title: "30. Packages and dependencies"
url: https://una-lang.org/en/docs/spec/30-packages/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/docs/spec/30-packages.md
---

# 30. Packages and dependencies

Status: Normative, edition 0.4 preview (ADR 0122).

From edition `0.4`, a package describes itself in `ita.una`, a declarative file in Una's lexical syntax, and is pinned by `ita.lock`, which only the tool writes. A repository may group packages in a workspace with `itaty.una`. Itá, the package manager, is the command `una ita` of the `una` binary. The rules of ADR 0122 join this chapter as they land, each with its conformance cases. A package loads its path dependencies (§12) and the releases of the sources its `sources` section declares, verified by the registry client (§14); every other need is refused (U7008), so no import ever reaches a package that is not checked with the program.

**Editions.** The rules of this chapter apply only to packages of edition `0.4` and later. Editions `0.1` to `0.3` keep `una.toml` and `verification.lock` (`spec/13 §7`), and a single file has no dependencies. A single file keeps edition `0.1`, except that a file named to `una fmt`, `una check` or another command, with an `ita.una` or `una.toml` in a directory above it, is read, formatted and checked in the edition of the nearest such manifest and is otherwise still its own package (#1175).

## 1. Lexical rules

1. **The lexer of `spec/01`.** `ita.una`, `ita.lock` and `itaty.una` are read by the lexer of `spec/01`: UTF-8 without a byte order mark, two-space indentation, `--` comments, no tabs, the control characters of `spec/01 §1` rule 6 rejected, identifiers, and integer and text literals as `spec/01 §4` and `§6` state. Two differences hold in these files only.
   - **A version token.** `version_lit = num "." num [ "." num ] [ "-" pre { "." pre } ]`, where `num` is `0` or digits without a leading zero, and `pre` is `[0-9A-Za-z]+`, a numeric `pre` without a leading zero. It is matched before integers, so `1.4` and `0.1.0` are versions here. A malformed version, such as `01.2`, `1.2.3.4` or `1.2.3+build`, is an error.
   - **Text without interpolation.** A text literal MUST NOT contain `{` or `}` other than as `\{` and `\}`: nothing is interpolated.
2. **No keywords.** No word of these files is a keyword or a reserved word: `from`, `in`, `trusted` and `profile` are words of the grammar where it names them. No word of these files becomes a keyword of a module.
3. **Nothing runs.** There are no expressions, no interpolation, no conditions, no includes and no environment variables, and nothing else runs when a package is read, checked or built: there are no install scripts, build scripts or hooks of any kind.
4. **Bounds.** `ita.una` and `itaty.una` hold at most 1 MiB, and `ita.lock` at most 16 MiB; past that, the file is refused whole, at its start.

## 2. `ita.una`

1. **The package.** A package of edition `0.4` and later is a directory with `ita.una` and `src/`; its modules are `src/**/*.una`, as in `spec/13 §7`. A directory with both `ita.una` and `una.toml` is U7008 at `ita.una`, so a package never has two manifests that could disagree.
2. **Grammar.**

   ```ebnf
   manifest     = head { section } ;
   head         = "ita" pkg_name NEWLINE INDENT head_line { head_line } DEDENT ;
   head_line    = "version" version_lit NEWLINE
                | "edition" version_lit NEWLINE
                | "profile" ( "app" | "systems" ) NEWLINE
                | "about" text_lit NEWLINE
                | "license" text_lit NEWLINE
                | "home" text_lit NEWLINE
                | "publish" "to" lower_ident NEWLINE ;
   section      = sources | needs | replace | trust | labels | trusted | escapes
                | boundaries | contracts | run | drive | serve ;
   sources      = "sources" NEWLINE INDENT source { source } DEDENT ;
   source       = lower_ident text_lit NEWLINE INDENT "root" text_lit NEWLINE
                  [ "owners" lower_ident { "," lower_ident } NEWLINE ] DEDENT ;
   needs        = "needs" NEWLINE INDENT need { need } DEDENT ;
   need         = pkg_name [ version_lit ] [ "as" lower_ident ] [ origin ] NEWLINE
                  [ INDENT need_line { need_line } DEDENT ] ;
   pkg_name     = lower_ident [ "/" lower_ident ] ;
   origin       = "from" ( lower_ident | "path" text_lit | "workspace" ) ;
   need_line    = "may" cap_type { "," cap_type } NEWLINE
                | "avoid" version_lit NEWLINE
                | "accept" "name" NEWLINE ;
   cap_type     = qualified_upper "[" lower_ident { "," lower_ident } "]" ;
   qualified_upper = { lower_ident "." } upper_ident ;
   replace      = "replace" NEWLINE INDENT
                  { pkg_name version_lit "with" origin NEWLINE } DEDENT ;
   trust        = "trust" NEWLINE INDENT { trust_line } DEDENT ;
   trust_line   = pkg_name [ major ] [ "from" lower_ident ]
                  "modules" module_path { "," module_path } NEWLINE
                  [ INDENT { "may" cap_type { "," cap_type } NEWLINE } DEDENT ] ;
   major        = int_lit | version_lit ;
   labels       = "labels" NEWLINE INDENT { upper_ident NEWLINE } DEDENT ;
   trusted      = "trusted" NEWLINE INDENT { module_path NEWLINE } DEDENT ;
   escapes      = "escapes" NEWLINE INDENT "checked" "per" "module" int_lit NEWLINE DEDENT ;
   boundaries   = "boundaries" NEWLINE INDENT { module_path NEWLINE
                  [ INDENT { "may" cap_type { "," cap_type } NEWLINE } DEDENT ] } DEDENT ;
   contracts    = "contracts" NEWLINE INDENT { module_path NEWLINE
                  INDENT uses_item { uses_item } DEDENT } DEDENT ;
   run          = "run" NEWLINE INDENT [ "entry" module_path NEWLINE ]
                  [ "max_memory" int_lit NEWLINE ]
                  [ "grants" NEWLINE INDENT grant { grant } DEDENT ] DEDENT ;
   grant        = ( "console" | "clock" | "env"
                  | "keys" text_lit
                  | "files" text_lit file_mode { "," file_mode }
                  | "http" text_lit [ http_method { "," http_method } ] ) NEWLINE
                  [ INDENT limit_line { limit_line } DEDENT ]
                | serve_grant ;                          (* spec/31 §2 rule 3 *)
   file_mode    = "read" | "write" ;
   http_method  = "get" | "post" | "put" | "delete" ;
   limit_line   = "at" "most" int_lit ( "per" ( "second" | "minute" | "hour" ) | "at" "once" ) NEWLINE
                | "waiting" "at" "most" int_lit NEWLINE ;      (* spec/27 §9 *)
   drive        = "drive" NEWLINE INDENT "module" module_path NEWLINE
                  "ticks" int_lit NEWLINE [ "budget" int_lit NEWLINE ] DEDENT ;
   serve        = "serve" NEWLINE INDENT "module" module_path NEWLINE
                  [ "within" int_lit NEWLINE ] DEDENT ;
   ```

3. **Closed.** Every section and every line has one of the forms above; anything else is U7008 at the line. The head's lines appear at most once each, `version` and `edition` required. Each section appears at most once, in the order of the production `section`; a repeated or misplaced section is U7008. There is no `foreign` section and no foreign grant, and no `git` origin: each is U7008.
4. **The head.**
   - `ita <name>`: `name` is a `lower_ident` with no `__` and no trailing `_`, of at most 64 bytes, or `owner/name` with an owner of 2 to 39 bytes by the same rule.
   - `version` is a full version, `MAJOR.MINOR.PATCH` with an optional pre-release, each numeric part at most 2^31 − 1, and no build metadata.
   - `edition` is `0.4` or a later edition the release serves. An earlier edition is U7008: that package keeps `una.toml`.
   - `profile` is `app`, the default, or `systems` (ADR 0109): a `systems` package with `entry` declares `max_memory`.
   - `about` and `license` are non-empty texts, `home` an `https://` URL, and `publish to` names `itaty` or a source name that `sources` could declare, never `path`, `git` or `workspace`. A published package has no `sources` section (§15 rule 1), so the source is not checked when `ita.una` is read: `una ita publish` and `una ita yank` check it against the `sources` of the nearest workspace whose `itaty.una` lists the package as a member, after the package's own refusals and its check (§15 rule 3) and before its archive is built or anything is sent, and refuse a source no such workspace declares (U7013). The `ita.una` of a published archive, read at fetch or by `una check`, therefore accepts its `publish to` line.
5. **The sections that `una.toml` has.** Each has the meaning and the checks of `spec/13 §7` and of the records it names. Every error that `spec/13 §7` makes U7002 for a key of `una.toml` is U7008 at the corresponding line of `ita.una`; the codes of other domains stay (U1005 and U1002 for categories, U7005 for trusted modules).
   - `labels`: the categories, one per line.
   - `trusted`: the trusted modules, one per line.
   - `escapes`: `checked per module <n>`, `[escape_budget] checked_per_module`.
   - `boundaries` (ADR 0093): a module path, then its ceiling as `may` lines; no `may` line is the empty ceiling.
   - `contracts` (ADR 0092 rule 8): a function's qualified name, then its locked `uses` clauses, one per line, each parsed by the production a header uses.
   - `run`: `entry`, then `max_memory`, the declared memory budget in MiB from 1 to 4096 (`[run] max_memory`, ADR 0109 rule 4), then `grants`, one grant per line, each the grant spec of `spec/13 §5` it corresponds to: `console`, `clock`, `env`, `keys "<file>"`, `files "<path>" read, write`, and `http "<origin>" get, post`; and `serve "<origin>"` with its item lines (`spec/31 §2` rule 3), whose problems are U7008 at their lines. Paths resolve against the package root. A `max_memory` outside that range, and a `systems` package with `entry` and no `max_memory` (at the `entry` line), are U7008.
   - The limit lines under an `http` grant (ADR 0117 rule 8) have the forms and the meaning of `spec/27 §9`: `at most <n> per second`, `minute` or `hour`, `at most <n> at once`, and `waiting at most <n>`. A line of another form or with lines below it, a count below 1 or above 2^31 − 1, a limit under a grant other than `http`, and a kind of limit given twice are U7008 at the line, or at the count for a count out of range; a grant with such a line is not read, since without its limit it would allow more than written. The lines under a `serve` grant are its items (`spec/31 §2` rule 3), not limit lines. The `drive` section names the module the host drives (`spec/26 §2`): `module`, `ticks` and an optional `budget`, each of `ticks` and `budget` from 1 to 86,400,000 milliseconds; a missing key, a value out of range, a `run entry` beside it and a module that is not in the package are U7008. The `serve` section names the module of the host-driven form of a server and its optional per-request deadline (`spec/31 §7`, ADR 0123 rule 16): `module` and an optional `within` from 1 to 86,400,000 milliseconds; a missing `module`, a value out of range, a `run entry` or a `drive` section beside it and a module that is not in the package are U7008, and a section with such a problem is not read.
6. **Canonical form.** `una fmt ita.una` and `una fmt itaty.una` rewrite the file in its canonical form: two spaces per level; one blank line between top-level blocks and none inside them; the head's lines in the order of the production `head_line`; one space between words, none before `,`, `.`, `:`, `/` or `]`, none after `[`, `.` or `/`, and none between a capability and its `[`; a comment kept before the line it precedes, or two spaces after the line it ends. A line whose tokens this spacing would join into others, such as `1.` before `2`, keeps one space between every two tokens. `una fmt --check ita.una` reports U7001 where the file differs. `una fmt` of a package directory does not touch `ita.una`, and `una fix` never edits `ita.una`, `ita.lock` or `itaty.una`.

## 3. Needs and sources

1. **`needs`** names the packages the package depends on.
   - **The requirement** is a version of two or three parts, the least version that the need admits: `json 2.1` admits `2.1.0` and later on the line `json 2`, `json 0.3` admits `0.3.0` and later on the line `json 0.3`. A pre-release follows a full version. It is required, except with `from path` and `from workspace`, where it MUST NOT be written: the dependency's own `version` is used.
   - **The local name** is the `as` name, or the last segment of the package's name. Two needs with one local name are U7008. A local name, and the last segment of the name of any package, MUST NOT be a reserved name or have the skeleton of one (U7008).
     - The reserved names are the keywords and reserved words of `spec/01 §5` of every edition, `std`, `prelude`, `una`, `ita`, `itaty`, `itaoca`, `itauna`, `path`, `git`, `workspace`, and the host capabilities' names in lower case: `console`, `clock`, `env`, `files`, `keys`, `http`.
     - A name's skeleton removes `_`, maps `0` to `o`; `1` and `i` to `l`; `2` to `z`; `3` to `e`; `4` to `a`; `5` to `s`; `7` to `t`; `8` to `b`; `9` to `g`; then `rn` to `m` and `vv` to `w`, and collapses each run of one letter. So `std_` and `s7d` are refused as `std` is.
   - **`from`** gives the origin: `itaty`, the default, predeclared; a source of `sources`; `path "<dir>"`, a directory relative to the package; or `workspace`. Any other source is U7008, and there are no git dependencies.
   - **`may`** lines write the ceiling that the package grants the dependency at its calls (ADR 0093 rule 1). An operation named twice, or a capability named twice in one ceiling, is U7008.
   - **`avoid`** lines name full versions that resolution never selects.
   - **`accept name`** is written only under a path need (U7008 otherwise).
   - **One identity once.** A package needed twice on one major line from one source is U7008.
2. **`sources`** declares a registry other than `itaty`: its name, its `https://` base URL, the digest of its root metadata, `sha256:` and 64 lowercase hexadecimal digits, and the owners it serves. A source's name is not `itaty`, `path`, `git` or `workspace`; two sources with one name, or two sources that list one owner, are U7008. A need of a name whose owner a source lists names that source with `from` (U7008 otherwise), so a private owner's package never resolves at another registry.
3. **`replace`** takes every package of a name at a full version from another origin; `trust` consents to a dependency's trusted modules by identity: its name, its major line (`2`, or `0.3` for the line `0.3`), and its source. The major line and the source may be left out only for a package the root needs directly (U7008 otherwise); they are then those of that need (§13).
4. **What this release loads.** Path dependencies, by §12, and the releases of the sources of `sources` that the lock pins and that load verified, by §14 rule 10. A need of `itaty`, whose root metadata is not built into this release, or of a workspace member is refused, U7008 at the need, so no import reaches a package that is not checked with the program. `una ita` reports a need of `itaty` as U7013 (§10 rule 7).

## 4. `ita.lock`

1. **Who writes it.** Only `una ita` and `una migrate` write `ita.lock`, through a temporary file and a rename. Every other command only reads it, and `una fix` and `una fmt` never edit it. It is committed with the package.
2. **Grammar.** The lexical rules of §1.

   ```ebnf
   lock        = "lock" int_lit NEWLINE solver { registry } { package } ;
   solver      = "solver" NEWLINE INDENT
                 "encoding" text_lit NEWLINE "name" text_lit NEWLINE
                 "version" text_lit NEWLINE "logic" text_lit NEWLINE
                 "steps" int_lit NEWLINE "seed" int_lit NEWLINE DEDENT ;
   registry    = "registry" lower_ident NEWLINE INDENT
                 "root" text_lit NEWLINE "checkpoint" int_lit text_lit NEWLINE
                 "last" "root" int_lit text_lit NEWLINE                    (* §9 rule 7 *)
                 { "accepted" lower_ident int_lit { int_lit } NEWLINE }     (* §14 rule 8 *)
                 { "effect" lower_ident int_lit { int_lit } NEWLINE } DEDENT ;
   package     = "package" pkg_name version_lit NEWLINE INDENT
                 "from" lock_origin NEWLINE
                 "digest" text_lit NEWLINE
                 [ "signed" text_lit NEWLINE "logged" int_lit NEWLINE ]
                 [ "replaced" NEWLINE ]
                 { "needs" lower_ident pkg_name version_lit NEWLINE }
                 { "granted" "by" pkg_name [ major "from" lower_ident ] "may" cap_type { "," cap_type } NEWLINE }
                 [ "consented" text_lit NEWLINE ]
                 { "trusted" "modules" module_path { "," module_path } NEWLINE }
                 DEDENT ;
   lock_origin = lower_ident | "path" text_lit | "workspace" text_lit ;
   ```

   - `lock` is the format's version, `1`; a release reads every format version it ever wrote.
   - **The solver section** has the six keys of `spec/12 §9`, in this order and with the same values: `encoding "una-smt-1"`, `name "z3"`, a non-empty `version`, `logic "QF_UFLIA"`, `steps` of at least 1, and `seed`. A solver of another version stays U5003.
   - **Canonical.** Packages are sorted by name, then version, each once, and a package's `needs` lines by name. Every digest is `sha256:` and 64 lowercase hexadecimal digits. A package has both `signed` and `logged`, or neither. A `git` origin is an error.
   - An index of an `accepted` or `effect` line is below the registry's checkpoint size.
   - **`last root <n> "<digest>"`** records the last root version the registry client verified when it wrote the lock, from 1, and its digest (ADR 0122, amendment of 2026-11-03, item 4). Every `registry` section has it, after its `checkpoint` line; a section without it is U7009, with the repair `una ita lock`, since the registry client is in no release and no released lock has a `registry` section. A vendored provenance's root chain MUST hold that version with that digest (§9 rule 7). The lock is in the edit set of whoever can edit a vendored package, so the line authenticates nothing: it makes a cut of the root chain a visible change in a reviewed diff. `una ita lock --check`, which reads at the lock's point after any later root version, keeps the line while the chain it walks holds that version with that digest. `una ita lock --check` also verifies each registry package's provenance, vendored or in Itaoca, as §9 rule 7 does, against a root-version floor of at least the last version of the chain it walks, whether or not that floor is stored: a provenance whose chain ends below it is refused (U7010).
   - Every problem of the file is U7009 at its line.
3. **What reading checks.** Every command that loads the package checks, with no network:
   - **the lock** exists and parses (U7009 at the start of `ita.una` when it is missing, with the repair `una ita lock`);
   - **consistency:** every need of `ita.una`, and every `needs` line of every locked package, is met by a locked package of its name on its major line at a version at least the one required; each package is locked once on its major line; and every locked package is reachable from the root by those needs. Each problem is U7009, at the need or at the package line, with the repair `una ita lock`. The walk costs O((n + p + r) log p) for n needs, p packages and r `needs` lines.
   - **presence, integrity and provenance** of each registry package, as §9 rule 9 states (U7011, U7010).
4. **`una ita lock [path]`** resolves the package at `path`, `.` by default, as §10 states, and writes its lock. The solver section is the existing lock's, or the release's default when the package has none yet. An invalid `ita.una` or `ita.lock`, or a need with no resolution (U7013), is reported and nothing is written, so a pin is never replaced silently.
`una ita lock --check` writes nothing, and reports where the lock is missing or not the one `una ita lock` writes (U7009), and a registry package whose provenance ends below the root version it accepted (U7010). `--dry-run` prints the review of §10 rule 8 and writes nothing.

## 5. Workspaces: `itaty.una`

1. **Grammar.**

   ```ebnf
   workspace = "itaty" NEWLINE INDENT "members" NEWLINE INDENT { text_lit NEWLINE } DEDENT DEDENT
               [ sources ] [ replace ] [ trust ] ;
   ```

2. Each member is a directory relative to the workspace, without `.` or `..` segments, listed once. The `sources`, `replace` and `trust` sections have the forms of §2 and §3; a trust line of `itaty.una` names the package's major line and source. Every problem is U7008. The members' loading, with one lock for the workspace, joins this chapter with the rules that load dependencies.

## 6. Commands

With `--json`, each command of `una ita` prints one `una.ita/1` document (rule 1). `una --json ita lock` of a package whose `ita.una` adds the path dependency `util` (§12 rule 6) prints:

```json
{
  "schema": "una.ita/1",
  "command": "lock",
  "written": ["ita.lock"],
  "changes": [
    {
      "change": "add",
      "package": "util",
      "origin": "path deps/util",
      "version_from": null,
      "version_to": "0.2.0",
      "digest_from": null,
      "digest_to": "sha256:628a11aacf38c392c3224401a087d357fbee26abf719488dfdaec055872f1764",
      "ceiling_from": "",
      "ceiling_to": "",
      "trusted_from": [],
      "trusted_to": [],
      "consented_from": null,
      "consented_to": null,
      "authority": []
    }
  ],
  "diagnostics": [],
  "error": null
}
```

1. **`una ita`.** The package manager is the command `una ita` of the `una` binary. The same binary invoked under the name `ita` (its `argv[0]` basename, `ita` or `ita.exe`) behaves as `una ita`: `ita lock` is `una ita lock`. With `--json`, each command prints one document, `una.ita/1`: `schema` first, then `command`, `written` (the files it wrote) and `diagnostics`; a command that resolves (`lock`, `update`, `add`, `remove`) also gives `changes`, the review of §10 rule 8, after `written`, and `error` last, the reason it failed outside its diagnostics, such as a file it could not write, or `null`, and `tree` gives `root` and `packages` in place of `written` (§12 rule 9). The exit code is 1 when a diagnostic is an error, and 2 for a usage error, such as a directory without `ita.una`.
2. **Commands of this release.** `una ita lock [--check [--fresh]] [--dry-run] [--accept-authority <package>]… [--accept-trust <package>@<digest>]… [--accept-key <package>]… [path]` (§4 rule 4, §10 rules 7 and 8, §12 rule 6, §13 rule 2, §14 rule 8); `una ita update [<name>…] [--cooldown <hours>] [--now] [--dry-run] [--accept-authority <package>]… [--accept-trust <package>@<digest>]… [--accept-key <package>]…` and `una ita add <name> [<version>] [--as <local>] [--from <source>] [--now] [--dry-run]`, on the package in the current directory (§10 rules 9 and 10); `una ita tree [path]` and `una ita remove <name> [path]` (§12 rule 9); `una ita fetch [path]` (§14 rule 9); `una ita vendor [path]` (§9 rule 8); `una ita verify [path]` (§10 rule 11); `una ita publish [path]`, `una ita yank <version> [path]`, `una ita audit [path]`, `una ita watch <owner> [<name>…] [--from <source>]`, `una ita bundle <file> [path]` and `una ita unbundle <file> [path]` (§15). `una ita key` joins later.
3. **No network, no other program.** No command of this release opens a network connection: a registry is read from a local mirror directory (§14 rule 1), a submission to an `https://` source stops before anything is sent (§15 rule 1), and a bundle goes through a file. Itá never starts another program.

## 7. The proof cache

For a package of edition `0.4` and later, the key of a proof cache entry (`spec/12 §9`) is the hex SHA-256 of the domain tag `una-proof-cache/2`, then, for each of the canonical text of the lock's `solver` section and the query, its length in decimal, a NUL byte, and the text. It does not cover the packages of the lock, so adding a dependency invalidates no entry, and the tag and the length prefixes keep it apart from the key of editions `0.1` to `0.3`. The entry's HMAC of ADR 0064 authenticates it either way. The build report's lock digest is the SHA-256 of `ita.lock` as written.

## 8. Migration: `una migrate`

`una --json migrate --dry-run` of a package `hello` of edition `0.3`, with a module and no `verification.lock`, prints one `una.migrate/1` document (rule 8):

```json
{
  "schema": "una.migrate/1",
  "dry_run": true,
  "written": [],
  "removed": [],
  "name": {"from": "hello", "to": "hello"},
  "edition": {"from": "0.3", "to": "0.4"},
  "default_lock": true,
  "comments_not_carried": [],
  "ita_una": "ita hello\n  version 0.1.0\n  edition 0.4\n",
  "ita_lock": "-- Written by `una ita`; do not edit.\nlock 1\n\nsolver\n  encoding \"una-smt-1\"\n  name \"z3\"\n  version \"5.1.0\"\n  logic \"QF_UFLIA\"\n  steps 5000000\n  seed 0\n",
  "diagnostics": []
}
```

1. **Edition 0.4 and later are not written in `una.toml`.** `una.toml` naming `edition = "0.4"`, or (ADR 0139) `edition = "0.5"`, is U7002 at the value, with the repair `una migrate`; the package is still checked in the edition it names. No released `una` accepted that form, so this changes no released form (ADR 0122 Question 8.1).
2. **`una migrate [path] [--dry-run] [--name <name>]`** moves the package at `path`, `.` by default, from `una.toml` and `verification.lock`, of any edition from `0.1` to `0.5`, to `ita.una` and `ita.lock` of edition `0.4`, or of edition `0.5` when `una.toml` names it, since no migration lowers an edition, and nothing else: a directory that already has `ita.una`, or that is not a package with `una.toml` and `src/`, is a usage error (exit code 2).
3. **What it maps.**

   | `una.toml` / `verification.lock` | `ita.una` / `ita.lock` |
   | --- | --- |
   | `[package] name = "events-example"` | `ita events_example`: `-` becomes `_`; a name that is still not a package name needs `--name` |
   | `version`, `edition`, `profile` | head lines; `edition` becomes `0.4`, or stays `0.5`; a version that is not `MAJOR.MINOR.PATCH` is refused; `profile` is written when it is `systems` |
   | `[labels] categories` | `labels`, one per line |
   | `[trusted] modules` | `trusted` |
   | `[escape_budget] checked_per_module` | `escapes`, `checked per module <n>`, when not 0 |
   | `[boundaries]` | `boundaries`, with `may` lines |
   | `[contracts]` | `contracts`, the clause strings as lines |
   | `[run] entry`, `grants` | `run`, `entry`, `grants` with one line per spec, as `files "data/" read, write` |
   | `[run] max_memory` | `max_memory`, in `run` after `entry` |
   | `verification.lock` | the `solver` section of `ita.lock`; the release's default when the package has none |

   A text is written with `"`, `\`, `{` and `}` escaped, and every control or bidirectional character as `\u{…}`.
4. **Comments.** A run of comment lines of `una.toml` directly before a table header or a key is carried, as `--` comments, above the line it becomes. Every other comment is listed in the output, with its line.
5. **Refusals.** An invalid `una.toml`, other than its edition `0.4` or `0.5`, or an invalid `verification.lock` is refused, with each problem printed, and nothing is written (exit code 2).
6. **Writing.** It writes `ita.una` and `ita.lock`, each through a temporary file and a rename, rewrites each module in the canonical form of edition `0.4` (`spec/15 §2`), which edition `0.5` keeps, reading it with the keywords of the edition it writes (#1744), then removes `una.toml` and `verification.lock`. The canonical form of edition `0.4` wraps long lines, which earlier editions never do (ADR 0125, amendment of 2026-10-25): a module that differs from that form is written through a temporary file and a rename, and listed in `written` by its path. For a module that was canonical in its own edition, the rewrite changes only white space. A module with a syntax error in that edition has no canonical form and is left as it is. The rewrite is one check of the package, as `una fmt` does.
7. **The clashes of the edition.** It then checks the package, with its modules rewritten, at tier 0 in the edition of the `ita.una` it wrote, and prints every diagnostic the change of edition causes, those the package has in that edition and not in its own, with their repairs, such as a function named `within` (U0103). It applies none: `una fix` does that. Its exit code is 0: the diagnostics are the next steps of the migration.
8. **Output.** `--dry-run` prints the two files and the diagnostics, and writes nothing. `--json` prints one document, `una.migrate/1`: `schema` first, then `dry_run`, `written`, `removed`, `name` (`from`, `to`), `edition` (`from`, `to`), `default_lock`, `comments_not_carried` (`line`, `text`), `ita_una` and `ita_lock` (the files' texts with `--dry-run`, `null` otherwise), and `diagnostics`.
## 9. Package content, digest and archive

1. **What a package holds.** Exactly: `ita.una`; every `src/**/*.una`; `README.md`, `CHANGELOG.md`, and files named `LICENSE` or starting with `LICENSE-` or `LICENSE.`. Nothing else: no library, archive or source file of another language, since Una admits no foreign code, and not `ita.lock`. Every path:
   - is relative, of segments `[A-Za-z0-9_.-]+`, none `.` or `..`, none starting with `.`, none ending with `.`, at most 32 segments and 255 bytes;
   - has no segment that is a reserved device name of Windows, with or without an extension, compared ignoring case: `CON`, `PRN`, `AUX`, `NUL`, `COM1` to `COM9`, `LPT1` to `LPT9`;
   - is unique ignoring ASCII case, and is not, ignoring case, a directory prefix of another path (`a` beside `a/b`);
   - names a regular file; no mode bits are kept.

   A package holds at most 10,000 files and 256 MiB.
2. **The listing and the content digest.** The listing of a package is, for each file in ascending byte order of its path: the path's bytes, a NUL byte, the file's length in decimal, a NUL byte, the lowercase hex SHA-256 of its contents, and a line feed. The content digest is `sha256:` followed by the hex SHA-256 of the listing. It depends only on the files' paths and bytes.
3. **The archive.** A package travels as one file: the line `ita-archive/1`, the listing's length in decimal and a line feed, the listing, then each file's bytes in listing order, and nothing after. There is no compression. The reader reads the archive once into memory and parses and hashes those same bytes; it refuses another first line, a length with a leading zero, above 256 MiB or past the end, a listing that holds a carriage return, whose paths are not in strictly ascending byte order or that rule 1 refuses, a file whose hash differs from the listing's, and trailing bytes.
4. **Costs.** The listing sorts the files, O(f log f); the digest and the reader are one pass over the bytes, O(B), with memory O(listing + archive).
5. **Itaoca.** Fetched packages are stored in `packages/sha256/<hex>/` under `~/.una/itaoca`, or the directory `UNA_ITAOCA` names when it is set and not empty; that directory itself MUST NOT be a symbolic link. A package is written once, from the bytes of its archive as rule 3 read and hashed them, into a fresh private directory:
   - the directory has a name of its own, is created with `mkdir`, which fails when anything is there, and has mode 0700; each directory below it is created the same way, and each file with `O_CREAT`, `O_EXCL` and `O_NOFOLLOW`;
   - each file's permissions are set through its open descriptor (read-only in Itaoca), never by path, and each file and each directory is synced;
   - the fresh directory MUST still be the one created, by the device and inode of its descriptor, before each file is written and before it is renamed into place; otherwise the write fails, and a write that fails removes the fresh directory only while it is still the one created, and leaves it otherwise.

   What is written is then loaded as rule 6 states. The provenance of a release at a resolution point (rule 7) is stored once in `registry/<source>/releases/<release>/checkpoint-<size>-2.provenance`, where `<release>` is the release's directory name of rule 8 and `<size>` the checkpoint's size; one of the earlier format `ita-provenance/1`, written before it, is at `checkpoint-<size>.provenance` beside it, is never replaced or removed, is read only when no provenance of format 2 is stored for that point, and is never written where one of format 2 is. Each is written as one file in a fresh private directory and then hard-linked to its name, which fails when any entry, a symbolic link included, is there, so a stored provenance is never replaced; the entry there is then read, and another document of the same format for the same release and point is refused. A store interrupted after the link leaves the file's second link in its fresh directory; when the provenance is next read, a link in a `.una-fresh-*` directory beside it that is the same file, by device and inode, is removed with its directory, and the file must then have one link.
6. **Reading.** A package is read from Itaoca or a vendor directory, on every load and never once for all:
   - every component below the store's or the root's directory, which is resolved once, MUST be a directory and not a symbolic link;
   - the package is listed: every entry is a directory or a regular file with one link; a symbolic or hard link, a device, a FIFO or a socket refuses the package, and so does every path that rule 1 refuses, before any byte of it is read; at most 20,000 entries are listed;
   - each listed file is read once into memory, through a descriptor opened with `O_NOFOLLOW`, and on macOS also `O_NOFOLLOW_ANY`, which MUST be the entry listed, by device and inode;
   - the digest of the bytes read MUST be the lock's before any of them is used, and every later step (the provenance's check, vendoring, checking and building) MUST use those bytes and MUST NOT read a file of the package by its path again.

   So an entry swapped while the package is read can only make the load fail.
   A path dependency's files (§12 rule 1) are each opened with `O_NOFOLLOW` and checked to be the regular file listed. On a platform whose flag values `una` does not know, no package is read or written. Any failure is U7010; nothing is repaired.
7. **Provenance.** Beside each registry package, in Itaoca (rule 5) or the vendor directory (rule 8), its provenance is a document of these parts, in this order: the line `ita-provenance/2`; one to 64 blocks `root <length>`, each a line followed by that many bytes of root metadata (§11 rule 8), the version that the source's pin names first and each next version after it; a block `checkpoint <length>`, the checkpoint of the lock's resolution point with its signature and cosignatures (§11 rule 4); when that checkpoint names a root version older than the last one stored and the client that wrote the provenance completed the proof that it is a prefix of a checkpoint signed under the last version (§11 rule 9), a block `latest <length>`, the latest checkpoint signed under the last stored version that the client read, with its cosignatures, followed by zero to 64 lines `consistency <base64 hash>`, the consistency proof from the point to it (§11 rule 1); a block `statement <length>`, the release statement (§11 rule 6), whose bytes are its log leaf; `index <n>`, the statement's log index; zero to 64 lines `proof <base64 hash>`, its inclusion proof; and `key <name> <base64 key>`, the publisher key the lock names. Lengths and the index are decimals without a leading zero, each block at most 64 KiB, the whole at most 1 MiB, and nothing follows the key line; a document that is not in this one encoding is refused. A document of the earlier format, whose first line is `ita-provenance/1`, has no `latest` block and is still read, since a stored provenance is never replaced (rule 5): it verifies by the same rules, with no proof. A provenance verifies, offline and with nothing taken on the lock's word, when:
   - the first root metadata has the digest the lock records for the source, which MUST be the root that `ita.una`'s `sources` pins, and the threshold of its own root keys; each next version meets §11 rule 8; the chain holds the version the lock's `last root` line records, with its digest (§4); and the last stored version is not below the root-version floor that Itaoca stores for the registry's identity (§14, Floors), which every load reads, so a provenance whose later root versions were dropped, those that retire or revoke a witness, never loads where a later version was accepted. When the floor stores a digest (§14, Floors), the chain MUST also hold the floor's version with that digest: a chain whose version of the floor has other root metadata is a fork of the root chain, refused (U7010) with a message that says the root chain forked; a floor of the earlier form, the version alone, is compared by version only. A chain below the floor is refused (U7010), and the message says that the provenance's root chain is older than the root version this machine has accepted, never that the log forked; the repair is to lock again at a fresh resolution point, which writes a new provenance, and nothing is rewritten in place. A floor that exists and cannot be read, such as a file in neither form of §14, makes the load unavailable (U7013), never a load without it: an offline load has no registry to fall back on, unlike the online commands, for which such a floor is a note (§14);
   - when the provenance carries a `latest` block, the checkpoint names a root version older than the last stored one, and the latest checkpoint names the last stored version, is of that version's log key name and signed by that key, is cosigned by that version's threshold of its witnesses (§11 rule 9), is larger than the point, since a checkpoint of the point's size naming another version is a second checkpoint of that size, and the consistency proof shows the point its prefix; anything carried that does not verify is refused (U7010), the log having forked or the document having been edited. A `latest` block carried short of cosignatures, or with consistency hashes missing, edited or added, is such a proof, refused (U7010), never unavailable: offline there is no other place to read the rest from. Only a proof that is absent, no `latest` block at all, makes the load unavailable (U7013), and only when the checkpoint carries a retired witness's cosignature (below). A `latest` block beside a checkpoint that names the last stored version is refused;
   - the last stored version has not expired (§11 rule 5) at the witness time of the latest checkpoint carried, which the current witnesses cosign, or, with none carried, at the checkpoint's witness time;
   - the checkpoint's size and root hash, `sha256:` and its hex, are the lock's `checkpoint` line; its origin is the name of the log key of the root version it names (§11 rule 9); it is signed by that key; and it is cosigned by at least k distinct witnesses that count as §11 rule 9 counts them: a witness of the last stored version counts; a witness of the version it names that the last one retired counts only when the consistency proof of the `latest` block is verified at this load (ADR 0122, amendment of 2026-11-03), never on the word of the client that wrote the provenance; a witness whose fingerprint any stored version lists in `witnesses-revoked` never counts (§11 rule 8); and k is the larger of the named version's witness threshold and the last stored version's, so a provenance that holds a later root version is never counted by fewer witnesses, or by a revoked one, than that version allows. When the checkpoint carries a cosignature of a retired witness that no stored version revokes and the provenance carries no `latest` block, as one of format 1 never does, the load is unavailable (U7013), never decided on fewer cosignatures, whatever the witnesses of the last stored version alone would give; a checkpoint with no such cosignature is counted on the witnesses of the last stored version;
   - the statement names the lock's source, name and version and gives the lock's digest; its `manifest` is the digest of the package's `ita.una`, `sha256:` and the hex SHA-256 of its bytes; it is signed by the key stored, whose `signed` form is the lock's: `ed25519:`, the name's owner (`itauna` for a name without one), `:`, and the hex SHA-256 of the public key; and its leaf is included in the checkpoint at the lock's `logged` index.

   Verifying costs O(R + W + log L), for R root versions walked, W signature lines of the point and the latest checkpoint, and O(log L) hashes for the inclusion and the consistency proofs in a log of L entries.

   **Trust on first use.** The floor holds only as far as this machine stores it. Past it, and on a machine whose Itaoca holds no floor for the registry, or that has no Itaoca at all (a fresh clone, or a run that starts empty), the whole vendored root chain past the pin is trusted on first use: whoever edits the vendored package, its provenance and the lock together can drop root versions there that this machine never accepted, and their retired witnesses then count as current ones. `una ita lock --check` refuses such a cut against the last root version that the chain it reads at the lock's point holds, whether or not it stores the floor (§4); `una ita fetch` reads the registry and stores the floor (§14), and the next offline load refuses a provenance below it.

   The owner's key chain and the per-name state at the resolution point (ADR 0122 rules 36.1 and 36.3) are verified by the registry client when the release is resolved and when it is fetched (§14), with the key the statement is signed by valid at its log position; they are not stored beside the package in this release, so loading verifies the provenance above and does not walk them again. A package of `itaty`, whose root metadata is built into `una` and is not in this release, does not verify.
8. **Vendoring.** `una ita vendor [path]` copies each registry package of the lock from Itaoca into `vendor/ita/<source>/<release>/` of the package at `path`, `.` by default, where `<release>` is `<owner>+<name>-<version>`, or `<name>-<version>` for a name without an owner, with its provenance beside it in `vendor/ita/<source>/<release>.provenance`. The copy is written from the verified bytes of Itaoca's copy (rule 6) into a fresh private directory as rule 5 writes, with its files writable, renamed into place, and loaded as every command loads it (rule 9); the provenance is written the same way, as one file. A symbolic link at `vendor`, `vendor/ita` or `vendor/ita/<source>` refuses the copy (U7010), and nothing is written through it. A copy already there that verifies is kept; one whose files verify and whose provenance is missing or does not verify takes Itaoca's provenance; one whose files do not verify is U7010 and is left as it is. A package Itaoca does not hold is U7011. Path dependencies are not copied: they are read from their directory. An invalid `ita.una` or `ita.lock` is reported and nothing is written. With `--json` it prints one `una.ita/1` document whose `written` lists the directories and files written, relative to the package.
9. **What loading checks.** Every command that loads a package of edition `0.4` and later whose lock reads checks each registry package of the lock, with no network, at its line of `ita.lock`:
   - **presence:** it is in the vendor directory or in Itaoca; otherwise U7011. The commands that check, run, build, test or report a package, and the language server, look in Itaoca; the others look in the vendor directory only;
   - **integrity and provenance:** read from the vendor directory when it holds the package, else from Itaoca, it meets rules 6 and 7; otherwise U7010, or U7013 when rule 7 makes the load unavailable: a retired witness's cosignature without the consistency proof, or a root-version floor that cannot be read. A vendored copy that fails is not replaced by Itaoca's. Itaoca holding the package's files without its provenance at the lock's resolution point is an inconsistent store, U7010, not an absence. A file a package may not hold, such as a `.DS_Store`, is U7010 with its path named.

   A package of `itaty` is not checked in this release: its root is not built in yet, so it cannot verify, and its need is refused (§3 rule 4), so it never loads. The check applies to it once that root lands. A release that loads verified and that a need of the root names is mounted (§14 rule 10). A load's result for a registry package is one of: it loads; U7011, absent; U7010, refused; or U7013, unavailable. Each of the three is an error at the package's line of `ita.lock`, the package is not mounted, and `una check`, `una build`, `una run` and `una test` end with exit code 1, as `una ita verify` does for a package it cannot verify; `una ita fetch` fetches again a package whose stored provenance is unavailable, and stores the registry's provenance of format 2 beside it (rule 5).

   So a repository with its vendor directory and lock committed builds with `una` alone, and a change that edits a vendored package together with its digest, key and checkpoint does not load: it would need the root's, the log's and the witnesses' keys.
10. **No connection.** `una check`, `una run`, `una build`, `una test`, `una report`, `una core`, `una lsp`, `una migrate`, `una fmt` and `una fix` never open a connection for a package or read a registry; only `una ita lock` (with `--check`), `update`, `add`, `fetch`, `bundle`, `audit`, `watch` and `unbundle` read one, from a mirror directory (§14). A program whose locked packages are present gives the same result with or without a network. Only a program that `una run` grants `http` reaches the network, through its `Http` capability (`spec/24`).

## 10. Versions and resolution

1. **Versions.** Semantic versioning 2.0.0 without build metadata, each numeric part at most 2^31 − 1, ordered by semver precedence. The identity of a package is its source, its name and its major line: `MAJOR` when it is at least 1, `0.MINOR` otherwise. Two major lines of one package are two identities, which may both be in one program.
2. **Requirements.** A need names the least version it admits on its line. A pre-release is selected only if some requirement names a pre-release of that identity. There are no upper bounds and no ranges.

   Which identities admit a pre-release (ADR 0122 rule 22) is a fixed point, computed before the selection: resolution runs in passes, each with a fixed set of admitted identities, the first with those the root's needs name with a pre-release; when a pass reaches a release whose need names a pre-release of an identity outside the set, the identity is added and the pass is run again from the root, until a pass adds none. A need that names a pre-release admits pre-releases of its identity itself, in every pass. The selection is the last pass's, so it does not depend on the order in which needs are walked (rule 3). A pass that fails and admits no new identity reports its least failure, by identity and version, never the first one its walk met; a pass that admits a new identity is run again, since its failure may be a need that only an admitted pre-release meets. The set only grows, so it may admit an identity that only a release of an earlier pass named; a build list that then holds a pre-release of an identity that no need of the last pass names with one has no resolution (U7013).
3. **Minimal version selection.** The build list holds, for each identity reachable from the root, the highest of the versions the reached needs ask for, each read as the least release at or above it; never a newer one. The result does not depend on the order of any list, and a release published later changes nothing until a need asks for it.
4. **Raises.** A selection that is yanked, named by an advisory not fixed in it, or avoided by the root is raised to the least release of its identity above it that is none of these, is not a pre-release unless one is named, and was logged at least the cooldown before the resolution point, 72 hours of witness time by default. An advisory signed by the threshold that names the fix by digest lifts the cooldown for that fix. With no such release, resolution fails, naming the newest candidate the cooldown holds back. The walk resumes with the needs of the release taken.
5. **Bounds.** 100,000 releases visited, each distinct identity and version counted once over every pass of rule 2, and 400,000 visits over every pass together, each pass's visits counted again, so a chain of pre-releases each naming the next, which forces a pass per link, is refused rather than walked quadratically, 10,000 packages in the list, 1,000 needs per release, 10,000 releases read per name; a release that needs its own identity is refused.
6. **Costs.** O(N + R) time and space per pass for N releases reached and R need edges, with hash maps, each release queued once a pass; O(log K) to find the release a need reaches among the K of its identity, pre-releases not admitted stepped over in O(1) through an index of the next release that is not one; O(S) per raise for the S releases it examines; O(P log P) to sort the list. A pass is repeated only when it discovers an identity named with a pre-release beyond the root. There is no backtracking and no search.

7. **What resolution reads.** `una ita` resolves over each path dependency, as its directory holds it, the one release of its identity, whose source is its directory; and over the releases of each source of `sources` that the root needs, read from the registry at a fresh resolution point and verified (§14 rules 2 to 7), each name's whole chain included, so nothing is ever resolved against a partial view of a registry, which could lack a lower release that rule 3 takes or a yank that rule 4 raises past. A need of `itaty`, whose root metadata is not built into this release, is U7013 at the need, and the source is refused as a whole. A need of a workspace member is U7008. An `avoid` line naming the version a path dependency holds has no later release to raise to (U7013). Every bound of rule 5 is U7013, the root's needs counted as a release's. The walk is rule 6's, and the lock's packages are sorted in O(p log p).
8. **The review and consent** (ADR 0122 rule 25). Before a command writes a lock that differs from the one it replaces, it prints one line per package added, changed or dropped, compared by name and origin: `add util 0.2.0 (path deps/util): digest sha256:…; may Console[print]; uses Console[print]`, with `old -> new` for a version, digest or ceiling that changed, `; trust keys; consented sha256:…` after it for a package with trusted modules before or after, with `old -> new` too, and `drop util 0.2.0 (path deps/util)`. A change of the trusted modules or of the consented digest alone is a change. `uses` is what the package's code uses in the new graph, checked at tier 0: the union of the `uses` of its functions and handlers. With `--json`, each line is an entry of `changes`: `change` (`add`, `change` or `drop`), `package`, `origin`, `version_from`, `version_to`, `digest_from`, `digest_to`, `ceiling_from`, `ceiling_to`, `trusted_from`, `trusted_to`, `consented_from`, `consented_to` and `authority`. Each consent flag names what it accepts, and nothing else: a ceiling wider than the one the lock records for the package, matched by name and origin, needs `--accept-authority <package>` (U7009), and a trust that no recorded consent covers for the package's content as it is now needs `--accept-trust <package>@<digest>`, with the content digest of that content (U7012); a consent to another digest is refused and says so. Both flags repeat, one per package. A bare `--accept-authority`, an `--accept-trust` without a digest, an `--accept-authority` naming a package that no need of `ita.una` names, an `--accept-trust` naming one that neither a need nor a trust line of `ita.una` names, and two `--accept-trust` flags of one package with different digests are usage errors. When consent to a ceiling or a trust is missing, the review is printed all the same, `--dry-run` or not, followed by `to accept, after reviewing: una ita <command> <flags>` with the exact flags to copy, and the command refuses with the diagnostics and writes nothing. A file that cannot be written exits with code 1, and an internal error (U8001) with code 3; with `--json` each prints one `una.ita/1` document whose `error` is the message, `null` otherwise. `una ita add` and `una ita remove` take neither flag: their refusals are repaired by `una ita lock` with it.
9. **`una ita update [<name>…]`** raises the named needs, or all, and writes the lock: a named need is resolved again, every other path need that the lock records keeps its entry as recorded, consents included, and every other registry need keeps the version `ita.una` writes, so `update util` raises no other need and needs no consent for another path package. A name the root does not need, or an `ita.una` that does not parse, is a usage error. `--cooldown <hours>` sets the cooldown of rule 4, 72 by default, and `--now` sets none; the two are one choice. A path dependency is always locked as its directory holds it, so `update` locks it again. A registry need is raised in `ita.una` to the newest release of its identity that is not a pre-release (unless the need names one), not yanked, avoided or signed after its key's stated compromise, and logged at least the cooldown before the resolution point; `update` never changes a major line, and only when the resolution succeeds writes the lock and then `ita.una`, putting the lock back when `ita.una` cannot be written. Rule 26 of ADR 0122, that a release needs no authority or trust the highest earlier release of its identity did not, is checked from the release statements (§14 rule 6 and rule 8); for a path dependency, what it may exercise stays bounded by the ceiling the lock records, whose widening needs `--accept-authority <package>` (rule 8).
10. **`una ita add <name> [<version>]`** adds the need `<name> <version> [as <local>] [from <source>]` at the end of `needs`, or in a new `needs` section before the first section that follows it in the canonical order, and locks; it writes no `may` and no `trust` line. Each word is checked before it is written, the name as `name` or `owner/name` in lower case, the version as a version of two or three parts, and `--as` and `--from` as lower-case names (a usage error otherwise); the edited `ita.una` is read as any other (U7008), and, only when the resolution succeeds, the lock is written and then `ita.una`; when `ita.una` cannot be written, the lock is put back with the bytes it was loaded with. A write that fails exits with code 1 and a message. Without a version, it takes the newest release of the newest major line that is not a pre-release, not signed after its key's stated compromise, and logged at least the cooldown before a fresh resolution point, from the registry's verified state (§14), and writes it as a full version; with none, U7013, naming the newest release the cooldown holds back. Without `--from`, a name whose owner a source of `sources` serves is needed from that source, and `add` writes the `from`. A need of `itaty` has no resolution in this release (rule 7), and nothing is written.
11. **`una ita verify [path]`** reads each registry package of the lock again, in the vendor directory and in Itaoca, wherever it is: first its presence (U7011 for a package in neither place), then each copy as §9 rule 9 states (U7010 for a copy that does not verify). A package whose copies all match the lock is still not verified, since the owner's key chain and its name map proof (ADR 0122 rules 36.1 and 36.3) are not held until the registry client supplies them: it is reported unavailable, U7013, naming where its copies matched, in human and `--json` output alike, and the command exits with code 1. It writes and repairs nothing. A path dependency is the root author's working tree, which `una ita lock --check` compares.

## 11. Verifying a registry's documents

The registry client verifies what it reads with these rules, each a pure function of the bytes; how it reads a registry and applies them is §14.

1. **The log's tree** is that of RFC 9162 §2.1: a leaf's hash is SHA-256 of `0x00` and the leaf, a node's of `0x01` and its children's hashes. An inclusion proof (§2.1.3.2) and a consistency proof (§2.1.4.2) are verified as RFC 9162 states; a consistency proof from a tree of no leaf is empty, and one between equal sizes needs equal roots. Each costs O(log L) hashes for a log of L leaves.
2. **Ed25519 is verified strictly**, by one rule: a key of 32 bytes and a signature of 64; the public key and `R` canonical encodings (`y` below p) of points not of small order; `S` below the group order; and the cofactorless equation.
3. **A signed note** (C2SP `signed-note`) is a text of lines without control characters, ending with a line feed, a blank line, and lines `— <name> <base64>`, whose base64 is canonical and decodes to a 4-byte key hash and the signature. The key hash of an Ed25519 key is the first four bytes of SHA-256 of its name, a line feed, `0x01` and the key; a note is signed by a key when a line of its name and key hash verifies the text. A note is at most 64 KiB, has at most 64 signature lines, and at most one line per key name and key hash; any other note is refused before a signature is verified.
4. **A checkpoint** (C2SP `tlog-checkpoint`) is a note whose text is the origin, the size in decimal without a leading zero and below 2^63, the root hash in base64, and non-empty extension lines. **A cosignature/v1** (C2SP `tlog-cosignature`) of a checkpoint by a witness is a signature line whose key hash uses `0x04`, holding an 8-byte big-endian timestamp and a signature of `cosignature/v1`, `time <t>`, each on its line, then the checkpoint's text.
5. **Witness time** (ADR 0122 rule 36.4). With k the witness threshold:
   - an entry is **logged at** the k-th earliest of the distinct witnesses' earliest cosignatures on checkpoints that include it;
   - the **witness time of a checkpoint** is the k-th latest of the distinct witnesses' cosignatures on it;
   - a wait is the witness time of the later checkpoint minus the logged-at time of the entry;
   - a witness whose timestamps decrease as the log grows is refused (U7010);
   - freshness alone compares a witness time with the local clock, and a local clock more than one hour behind the newest witness time is clock skew (U7010).

   Fewer than k witnesses can move none of these times in an attacker's favor.
6. **A release statement** is a signed note whose text is, in this order and each once: `ita-release/1`; `source <source>`; `name <name>`; `version <full version>`; `previous <index> <leaf hash>`, or `previous none` for a name's first entry; `digest <content digest>`; `manifest <digest of its ita.una>`; `edition <edition>`; one `needs <source> <name> <version>` line per need, sorted by name, each of the release's own source; `authority` with the capabilities and operations its public functions and handlers use, as `Http[get], Store[find, put]`, or `none`; and `trust modules <path>, ...`, or `trust none`.
7. **Authority is part of the interface** (rule 26). Within one identity, a release needs no capability, operation or trusted module that the highest earlier release did not; a statement that does is refused, by the registry and by every client.
8. **Root metadata** is a signed note whose text is, in this order: `ita-root/1`; `source <source>`; `version <n>`, from 1; `expires <seconds>`; `root <threshold>` and one `key <name> <base64 key>` line per root key; `log <name> <base64 key>`; `witnesses <threshold>` and a key line per witness; optionally `witnesses-revoked <fingerprint> …`, one or more fingerprints of witness keys, each the hex SHA-256 of the public key in 64 lowercase hex digits, none twice and none a witness of this version, whose cosignatures count for nothing at any version, under any name; a key whose fingerprint any version of the chain lists there is never a witness of a later version, and a chain where one is, is refused (U7010), checked from the pinned version on, since the pin is trusted and the versions before it are never read; `security <threshold>` and a key line per security key; `itauna <threshold>` and a key line per key of the official set. Each threshold is between 1 and its number of keys, and no name or key appears twice. Its digest, which `sources` pins and the lock records, is `sha256:` and the hex SHA-256 of the whole signed note. The first one a client accepts has the pinned digest and the threshold of its own root keys; a version `n + 1` is accepted only with the thresholds of version `n`'s root keys and of its own. Versions passed may have expired; the last one MUST NOT have, in witness time. A root version that rotates a witness out because its key is, or may be, compromised MUST list that key's fingerprint in `witnesses-revoked`: a retired witness not listed still counts on the checkpoints of its versions that the log binds to the current point.
9. **The name map** (rule 36.1) is a sparse Merkle tree of depth 256 over SHA-256 of each name, whose leaf is SHA-256 of `0x00`, the key, the index of the name's latest entry (8 bytes, big-endian), that entry's leaf hash, and its count of entries (8 bytes); an empty subtree of height 0 is 32 zero bytes, and a node and an empty subtree above it are SHA-256 of `0x01` and its two children. A checkpoint carries the map's root in its extension line `ita-map <base64 root>`. **The root a checkpoint names:** every checkpoint MUST carry exactly one extension line `ita-root <n> sha256:<hex>`, the version and digest of the root metadata it was signed under, inside the note's signed text, so the log's signature and every witness cosignature cover it and stripping or altering it invalidates them. A checkpoint without it, with two, or with one that does not parse, is refused (U7010). The resolution point, the latest checkpoint, MUST name the last root version the place serves: one that names an older version while a newer one is served stands for a newer checkpoint withheld, and is unavailable (U7013), never accepted. The version checkpoints name never decreases as the size grows, across the point and every kept checkpoint a client reads; a decrease is refused (U7010). Every copy of the checkpoint of one size names the same version: copies signed by the log that name different versions are two checkpoints of that size, refused (U7010) and recorded as evidence against the registry, and the version first recorded for a size is never replaced. A client verifies a checkpoint's signature with the log key of the root version it names, and counts its cosignatures so: a witness of the last root counts; a retired witness, one that is not, counts only when all three hold: (1) the checkpoint names a root version this witness belongs to, (2) the checkpoint is proven a prefix of a checkpoint signed under the last root by a consistency proof (every kept checkpoint below a point that names the last root is, by the proof that binds it to the point; a lock's point naming an older version is proven so against the latest checkpoint, one more checkpoint read and O(log L) hashes), and (3) no root of the chain lists it in `witnesses-revoked`; any other line is ignored. The threshold k that counts a checkpoint's cosignatures, for its witness time, is the larger of the threshold of the root version it names and the last root's, so a checkpoint naming an older version never counts by fewer than the current threshold. So an entry's logged time takes the k of its first including checkpoint, a request's start the k of its start checkpoint, and an effect, a freshness or a deadline the k of the checkpoint whose witness time it reads. Too few cosignatures that count on a lock's point make it unavailable (U7013), never refused. When the prefix proof of a lock's point cannot be completed, because no place serves the latest checkpoint, the latest checkpoint served names an older version, or no place serves a tile of the consistency proof, it is an omission of the prefix proof, and every result that would count a retired witness's cosignature, on the point or on any kept checkpoint naming an older version (a logged time, a start, an effect, a cadence), is unavailable (U7013), never decided on fewer cosignatures and never evidence of a missing checkpoint; a proof served that does not verify means the log forked (U7010). A rotation therefore leaves older history usable, a retired witness's cosignatures still counting on the checkpoints the log binds to the current point; a lock's point stays unavailable only when no place serves a later checkpoint signed under the last root to prove it a prefix of, or when its counted witnesses are revoked: a fail-safe cost, never a wrong result. A rotation that raises the witness threshold makes older history unavailable (U7013) wherever an older checkpoint a result reads carries fewer cosignatures than the new threshold, since k never drops below the last root's: a fail-safe cost of the rotation, so a registry SHOULD obtain the extra cosignatures on the kept checkpoints it serves, the pinned ones and the start, deadline and pre-deadline ones, before it raises the threshold. A version past the end of the root chain a place serves means a newer root is hidden, and the result is unavailable (U7013, an omission of a root version), never decided under the older key set; a version before the pinned one, or a digest other than that version's, is refused (U7010). A proof of a name's leaf, or of its absence, is a bitmap of 256 bits, set where the sibling at that height is not empty, and those siblings from the leaf up; its size is O(log M) hashes for M names, and checking it takes 256 hashes.
10. **A name's chain.** Each entry about a name names the previous one by its log index and leaf hash, or none. A client walks it from the map's head back to the last entry it holds, each link the previous one's, and the number of links walked MUST equal the map's count minus the count held, or the whole count on a first walk; otherwise U7010. So a map or chain that omits a yank, an advisory, a revocation, a recovery or a transfer is caught.
11. **Yanks and advisories** are entries of a name's chain. A yank is `ita-yank/1`, `source`, `name`, `version` and `previous`, signed by the owner's threshold. An advisory is `ita-advisory/1`, `source`, `name`, `previous`, `id` (1 to 64 letters, digits, `-`, `_` or `.`), `line` (the major line), `affected` (full versions of that line), `fixed <version> <digest>` or `fixed none`, `severity` (`low`, `medium`, `high` or `critical`) and a one-line `summary`; it names each affected version once and a fix later than every affected version, or the advisory is refused; it stands when one security key of the root metadata signs it, which is enough to hold a release back, and lifts the cooldown for the fix it names by digest only when at least the root's security threshold of distinct security keys signs it, and never fewer than two, or one security key and the owner's threshold (ADR 0122 rules 35 and 41). The two counts are of disjoint keys: the owner's signers are counted without any public key of the root's security set, so one key that is both counts once, as a security key. Folded oldest first, a name's entries give each release its digest, its logged-at time, whether it is yanked, the advisories that name it, and whether a lifting advisory names it as its fix; a second statement for one version, a yank or advisory of a version never released, or an advisory no security key signs is U7010. `una ita audit` reports a locked release that is yanked or named by an advisory (U7014).
12. **Publishing** (rule 43) refuses, before building anything, a package without `publish to`, `about` or `license`, with a `sources`, `replace` or `trust` section, or with a need of a path, a workspace member or another source than the one it is published to. Its release statement lists its needs at their least versions, each of its own source, sorted by name.

## 12. Path dependencies in the program

1. **Loading.** Each need `from path "<dir>"` names a directory relative to the package, which holds `ita.una` and `src/`. It is read with no symbolic link followed, in it or below it; a directory that is the package itself, lies inside its `src/`, or is named by two needs is not read. Its `ita.lock`, `run` and `sources` are not read. A dependency that cannot be read is U7008 at its need.
2. **What the root accepts.** A path dependency is used only when:
   - its `ita.una` names the package the need names (U7008 otherwise);
   - the need says `accept name`, since a local package carries a name a registry may hold, and no client can tell offline which owners a registry serves (U7012 otherwise);
   - its edition is the package's or earlier (U7012 otherwise);
   - and, in this release, it has no needs of its own, no labels, no trusted modules, no boundaries and no contracts, and the need's `may` lines name host capabilities only (U7008 at the need otherwise).

   Each of these problems is reported at the need's line in `ita.una`, from its first column, whichever part of the need it concerns.

   A dependency that is not used is not checked, and its modules are not importable.
3. **Modules.** A dependency's module `m` is the module `<local>.m` of the program, where `<local>` is the need's local name: the root writes `import util.text (shout)`. A dependency's modules import their own modules by their own paths, and the standard modules, never a module of the root (U1001). A module of the root whose first path segment is a local name is U1010. Each module's file path is checked against its own package's `src/` (U1008).
4. **One program.** `una check` checks the root's modules and every used dependency's as one program, under the root's solver pin; a diagnostic in a dependency is reported at its file, and counts as any other. `una fix` never edits a dependency's file, `una fmt` of the package formats the root's modules only, and `una test` runs the root's examples only.
5. **Authority.** Every module of a dependency is in its package's extent, a boundary of ADR 0093 whose ceiling is the one the root writes with `may` lines under the need, empty without them. A call into it takes no capability by name (U3020); each is granted with `with`, within that ceiling (U3021), and no release may be reachable (U3024). A dependency's examples are checked as its own, with no consumer ceiling on their `given` lines, since they never run with the root's authority.
6. **The lock.** `una ita lock` locks each used path dependency as `package <name> <version>`, `from path "<dir>"`, its content digest (§9), and `granted by <root> may <ceiling>` for a non-empty ceiling. Loading checks that each path need has its locked package at the version its `ita.una` gives (U7009), and that every `may` line is within the ceiling the lock records as granted by the root (U7009 at the `may` line). `una ita lock` records a wider ceiling only with `--accept-authority <package>`, naming the package, so every widening is explicit and shows in the lock's diff; `una fix` never applies it. The digest of a path package is recorded for review and compared by `una ita lock --check`; loading does not compare it, since a path package is the root author's own working tree.
7. **The Core export** of a program with dependencies, a later version of the Core document of `spec/13 §8` that ADR 0122 rule 59 describes, is not written by this release: `una core` refuses it as a usage error, and this release defines no schema for it.
8. **Effective ceilings and the report.** The effective ceiling of a package bounds what it can ever exercise: the least fixpoint of `eff(p) = ⋃ over the packages d that need p of (ceiling_d(p) ∩ eff(d))`, computed by a worklist in O((P + R) · C) for P packages, R needs and C capability operations, cycles included (ADR 0122 rule 51). The root may be granted any host capability with `--grant`, so `eff(root)` is taken as every operation, and a direct dependency's effective ceiling is the ceiling of its package extent: the one the root writes for it, or, for a package with consented trusted modules, its intersection with the trust line's (§13 rule 4); a bound never narrower than what the package can exercise. The report (`spec/13 §6`) holds `dependencies`, after `handler_authority`, one entry per package of the program other than the root, in name order: `package`, `version`, `local`, `source` (`"path"`), `path`, `digest` (the content digest of the files analysed, the bytes loaded once, or `null`), `signed` (`null` for a path package), `replaced`, `edition`, `profile` (the package's, `app` when its `ita.una` names none), `granted_by` (per dependent, its name, its `source`, `null` for the root, and the ceiling it writes as `may`), `effective_ceiling`, `authority` (the union of the `uses` of its functions and handlers) and `trust` (`modules`). A package with no dependencies has `"dependencies": []`. `tcb` gains `registries` (each registry source of the program's mounted releases with the digest of its root metadata that the lock records, §14 rule 10) and `dependency_trust` (§13). The human report prints one line per dependency: `util 0.2.0 (path deps/util): may Console[print] (by demo); uses Console[print]; trust none`.
9. **`una ita tree [path]`** checks the program at tier 0 and prints the root's name and version, then one line per dependency, in the form of the report's human line; with `--json`, one `una.ita/1` document with `schema`, `command` (`"tree"`), `root`, `packages`, the report's `dependencies`, and `diagnostics`. **`una ita remove <name> [path]`** removes the need of `name` from `ita.una`, with its indented lines, and the `needs` section when it empties, edited on the text as read, `\r\n` as `\n`; then resolves as `una ita lock` does and, only when the resolution succeeds, writes the lock and then `ita.una`, each through a temporary file and a rename, putting the lock back when `ita.una` cannot be written. A name the root does not need, or an `ita.una` that does not parse, is a usage error and nothing is written. Neither opens a connection.

## 13. Trust a dependency adds

1. **A dependency's trusted modules** (its `trusted` section and `trusted module` headers) are trusted in the program only if a trust line of the root names the package and each of them by its module path in the package (U7012 at the need otherwise). A trust line names a package the root needs directly by its name alone, its major line and source being the need's; a path package has no source, so a trust line with `from` names a registry package, never a path one.
2. **Consent is pinned to the whole package.** The lock records, for the package, `consented "<digest>"` with its content digest, and `trusted modules ...`. Loading compares the recorded digest with the package's content as it is now, and every trusted module with those recorded; any difference, a change of any file of the package included, is U7012 until `una ita lock --accept-trust <package>@<digest>` records it again, with the digest of the content reviewed. The digest is computed from the bytes the package was loaded from, the same ones checked, and never from its files read again. A policy's `via` may call any function of its package, so pinning the trusted module's file alone would not pin the code it runs.
3. **An extent of its own** (rule 53.1). A consented trusted module `m` of the dependency `<local>` is the program's trusted module `<local>.m`, and an extent of its own inside its package's: calls into it from outside it, the package's other modules included, are crossings, granted with `with` (U3020). A release whose policy it declares is not a release into a boundary, whoever reaches it (no U3024); every other release stays U3024.
4. **One ceiling, for now.** Until a crossing's ceiling depends on its direction, the package's extent and its trusted extents share one ceiling: the intersection of the root's `may` lines for the package and those under its trust line. It is never wider than either, so a program this accepts is one rule 53.1 accepts.
5. **The report** lists each dependency's consented trusted modules under its `trust`, and `tcb.dependency_trust` gives them by package, with their line counts; `tcb.trusted_modules` keeps the root's own.

## 14. The registry client

A registry is a set of static files below a base (ADR 0122 rule 34). `una ita lock`, `update`, `add` and `fetch` read the registries of the sources the root's `sources` section declares, and verify every byte they use with the rules of §11 and of this section before any of it is used.

1. **Where a source is read** (ADR 0122 rule 40). Each source is read from its places, in order: the mirrors that Itaoca's `mirrors.una` lists for it, then its own URL, the one its `sources` entry gives. `mirrors.una` has one line `mirrors`, below it one line per source, and below each source one location in quotes per line:

   ```una
   mirrors
     acme
       "https://ita-mirror.example.net"
       "file:///srv/ita-mirror"
   ```

   A location is an `https://` URL or a `file://` URL of a local directory, which holds a copy of the registry's files as its store keeps them; a `file://` URL is an empty host and an absolute path written as it is, with no percent-encoding, so a `%`, `?` or `#` in it is refused. Plain `http://`, every other scheme and a bare path are refused, and so is a source or a location listed twice, at most 64 mirrors per source and 1 MiB in all: a `mirrors.una` that does not read is U7008, naming its line, and no source is read from it. This release has no transport for an `https://` location: such a place cannot serve, which the diagnostic says. The first place whose root metadata and checkpoint verify (rule 3) is the one the command reads; a place that serves a copy that does not verify is skipped and named, U7010, and one that cannot serve is skipped. A place that cannot serve is one that has no transport, cannot be read, or does not serve the root metadata of the pin or the checkpoint asked for; anything else that fails is a copy that does not verify. The client tells the two apart by where the failure arose, never by the text of a message, and a message shows at most 400 characters of the part that may quote what a place served, after the reason it states, with every control character, format character (Unicode category Cf: direction marks and isolates, zero-width characters, U+FEFF, tag characters) and line or paragraph separator written as `\u{…}`. With no place that verifies, the source is U7010, naming each place whose copy did not verify, or U7013 when no place could serve, at the first need of the source. Everything a place serves is verified as from the source itself, by the same rules, so a file changed in a mirror makes the command fail (U7010), never take the change. **Omissions.** An omission by a place or a mirror, a missing document, tile, entry bundle, kept checkpoint, map tile, root version or archive, MUST only make a result unavailable, never change it. The root metadata and the latest `checkpoint` choose the place; every other document below that checkpoint, verified against it by its hash, signature or proof wherever it comes from, is read from the place or, when the place omits it or cannot serve it, from the next place that serves it, in order; with none, the result that needs it is unavailable, U7013 naming the document. A missing tile, entry bundle, kept checkpoint of a size up to the point, map tile on a name's path, or archive is such an omission, never an empty or absent result: a registry keeps the checkpoint of every size it signed. A root version past the last one served is the end of the root chain, which the stored root-version floor (rule 3) keeps from going back. **Withheld cosignatures.** For every kept checkpoint a computation needs, the client MUST read it from every place of the source, verify each cosignature line of each copy that verifies, and merge the verified lines by witness before it computes a witness time, so a place that withholds cosignatures cannot make a time later when another place serves them. And since withheld cosignatures can only make an effect later, the client MUST compare, for each owner, its verdict with every recovery, dispute and co-signer change in effect at its earliest possible position, the first size whose first kept checkpoint with a witness time, at or after it, has a witness time at least seven days after the request's start (the threshold-th earliest of the merged cosignatures on its start checkpoint), with its verdict as the cosignatures served say: when they differ, whether the owner's chain is refused, a release of its names counts, or, for rule 8, which requests took effect and from which position, and so whether its keys changed since a lock's point, the name MUST be unavailable (U7013), an omission of cosignatures, its message naming a place's possible withholding of cosignatures; it is never refused and never resolved on either verdict. **Deadline and cadence.** For each pending recovery, dispute or co-signer change, a registry MUST obtain and keep the witness threshold of verified cosignatures on its deadline checkpoint D, as rule 5 defines it, and on the checkpoint just before it, so that a client can tell where the seven days end; while witnesses are down it keeps trying, and it MUST NOT log anything that relies on the request before D, the name staying unavailable meanwhile, which is the safe direction. A registry MUST publish or serve on D only cosignature lines, by any witness, dated at or after the request's target, MUST NOT let any checkpoint after the request and before D reach the target, and MUST NOT publish or serve a cosignature line dated before the target on any checkpoint from D on: every cosignature the registry publishes or serves on D is then at or after the target, so a place that strips cosignature lines from D cannot bring its witness time below the target while k remain, and with fewer than k the earliest and the served timings differ, which the client records; a D whose witness time dips below the target would need k lines dated before the target from outside the registry, such as leaked or dishonest ones. A registry MUST sign a checkpoint at every size of its log, batched appends included, each size's checkpoint kept, since a client's scans read sizes one by one. A registry MUST obtain and keep the witness threshold of cosignatures on every checkpoint whose size is a multiple of 64, the pinned cadence: when no checkpoint of the threshold exists, every place's copy merged, within 64 sizes after an entry whose logged time a result needs, or a pinned checkpoint a deadline search reads lacks it, short of the point, the result is unavailable (U7013, an omission of the cadence), and the client never takes the point's time instead; and on the start checkpoint of each pending recovery, dispute or co-signer change, the first checkpoint that includes it. The client takes a request's start as the k-th earliest of the merged verified cosignatures on its start checkpoint, so fewer than k witnesses, back-dating or withheld, cannot move it; a start checkpoint with fewer than k, every place's copy merged, is an omission (U7013), and the name is unavailable. With both, an honest registry's served and earliest timings coincide, so a name unavailable by an omission of cosignatures means that cosignatures are withheld or that the registry misbehaves. Every place's copy of each kept checkpoint having been read, the client MUST record, as typed evidence that `una ita audit` reports: a request whose two timings differ, as a missing deadline checkpoint, with the request's index and its target witness time; and a scan of 64 sizes short of the point with no checkpoint of the witness threshold where one is needed, or a pinned checkpoint without it, as a cadence gap, with its range of sizes. **The deadline search.** A client finds a request's deadline D of rule 5 by reading the pinned checkpoints from the request on, up to the first whose witness time reaches the target, or to the point, and then every size after the multiple of 64 below that one up to the first whose witness time reaches the target, where the deadline and pre-deadline checkpoints are kept: O(W/64 + 64) kept checkpoints for W sizes from the request to its deadline, the same search for the served effect, the earliest one, and the record of a missing deadline checkpoint. A pinned checkpoint that reaches the target bounds the search, so a later one whose witness time dips below it changes nothing. The search reads at most 2^23 = 8,388,608 sizes past the request; past them the result is unavailable (U7013, an omission of the scan cap), never a later or absent effect. ADR 0122 sets no publish rate, so the cap is chosen to cover ten times a week of a large registry at 10^5 entries a day: 10^5 × 7 × 10 = 7 × 10^6 < 2^23, so an honest registry never reaches it, and a search reads at most 2^17 pinned checkpoints and 64 more. Each names the places read and the fewest of them that served the same view of the checkpoints it rests on, and is evidence from an absence, which any place read may have caused, two places included, since two mirrors can be one party: it never asserts the registry's fault. Only an owner chain that does not settle, which its signed entries show, is the registry's misbehavior. **The code of a failure** comes from that failure alone: U7013 when no place served what it needed, U7010 when what was served does not verify, never from an omission an earlier failure recorded. A place that cannot serve at all, an `https://` location this release cannot read, or a file a mirror directory cannot read, a symbolic link or one it may not open, serves nothing, so what no other place serves is an omission (U7013); a file larger than its limit is refused (U7010). In `una ita fetch`, an archive that does not verify against its statement or the lock, or a provenance that does not, is U7010, and a failure to store a package in Itaoca is U7011. **The withheld-eligibility delay,** a named and bounded exception to the omissions rule above: cosignatures a place withholds can only make a release's logged time later, so they can delay the release's cooldown eligibility (§10 rule 4), never advance it, never select a version that is yanked or under an advisory, and delay it by at most the time the log takes to grow by 64 sizes, since without a checkpoint of the threshold within 64 sizes of the release its logged time is unavailable, never the point's. It matters when an attacker delays the eligibility of a fix release. Resolution keeps the served, later time, and the client records the delay as an observation, the release, its version and both times, the served one and the earliest the merged cosignatures allow (by each witness's timestamps never decreasing, at least the timestamps on the last kept checkpoint below it), which `una ita audit` reports. No command starts another program or opens a network connection.
2. **The files of a registry** are those of ADR 0122 rule 34, at the paths a registry serves: `root/<n>`, `checkpoint` and `checkpoint/<size>`, the log's tiles and entry bundles in the C2SP `tlog-tiles` layout under `tile/`, the name map's tiles under `map/`, and archives at `blobs/sha256/<hex>`. A copy of a registry's store in a directory keeps `checkpoint` as the file `checkpoint/latest`, a name no size can have. Every document other than an archive is at most 16 MiB, a note at most 64 KiB.
3. **Opening a source.** The root metadata whose digest is the pin of `sources` is read among `root/1` to `root/64`, accepted by the threshold of its own root keys, and each next version `root/<n + 1>` that exists is walked by §11 rule 8, at most 64. The checkpoint is accepted when its origin is the last root's log key name, it is signed by that key, and at least the root's witness threshold of distinct witnesses cosign it; its witness time is §11 rule 5's. The last root MUST NOT have expired at that time (U7010).
   - **Freshness.** For `lock`, `update` and `add`, the checkpoint is `checkpoint`, and its witness time MUST be less than 24 hours before the local clock; a local clock more than one hour behind it is clock skew. Both are U7010, and nothing is written.
   - **A lock's point.** For `fetch` and for `lock --check`, the checkpoint is the lock's resolution point, `checkpoint/<size>` with the root hash the lock records, and no freshness is needed. `lock --check` also reads the newest `checkpoint` a place serves, fresh or not, extending the lock's point, only to find an owner whose chain was refused, or froze, after it (rule 5); when none can be read, a note says that a later freeze is not checked.
   - **Floors.** Itaoca keeps the floors of a registry under its identity, the hex SHA-256 of its pin (`sha256:` and the hex digest of its first root metadata, which names its source), so two names `sources` gives one registry share them and one name given to two registries never mixes theirs: in `registry/<id>/checkpoint`, the largest checkpoint accepted, and in `registry/<id>/root-version`, the highest root version accepted, with the digest of that root metadata. The root-version file is `<n> sha256:<hex>` and exactly one line feed: `<n>` the version in decimal, at least 1 and without a leading zero, then one space, `sha256:` and the 64 lowercase hex digits of the digest of that version's root metadata. A file of the earlier form, `<n>` and one line feed, the version alone, is still read, and is compared by version only. A file in neither form is a floor that cannot be read, never an absent one. A floor is read without any lock. It is written under the kernel-held advisory lock of `registry/<id>/floor.lock`, tried for a few seconds: under the lock, the stored checkpoint is read again, the new one is written, through a fresh file and a rename, only when it is larger and consistent with the stored one by a consistency proof, and a root version, with its digest, only when it is higher: an equal version never replaces the stored floor, whatever its digest or form, so a floor of the earlier form takes a digest when a higher version is accepted. The operating system releases the lock when its holder ends, so the file's existence means nothing and it is never removed. Both floors are stored as soon as a checkpoint is accepted, whatever the command then writes, `--check` and `--dry-run` included; a floor that cannot be stored, or a lock that cannot be had in time, is a note that says so, and never fails a place or a command; on a file system that takes no lock, the note says that rollback floors are not stored there, naming the path, and for any other failure to take the lock, that the lock could not be taken, with the error. A checkpoint is accepted only with a consistency proof (§11 rule 1) between it and the stored one, computed from the tiles, in either direction; a resolution never accepts one below the stored one, and for a resolution of a package with a lock, the checkpoint MUST extend the lock's resolution point, by a consistency proof from its recorded size and root hash. A root chain whose last version is below the stored root version is refused, so a place cannot hide a newer root version; and when the stored floor holds a digest, a root chain that does not hold the floor's version with that digest is refused as a fork of the root chain (ADR 0122, amendment of 2026-11-09, L3). A failure is U7010: it is evidence that the log forked, or that a place hides what the client already saw.
   - **Historical entries** verify against the current root's keys: the log's key for kept checkpoints and for recoveries and disputes, the witnesses, and the keys of Itaúna. A rotation of the root can therefore refuse entries logged before it.
   - **Monotonic witnesses.** Across every cosignature the client holds, a witness's timestamps never decrease as the log grows (U7010).
4. **Entries and chains.** An entry is read from its bundle, and its leaf hash, SHA-256 of `0x00` and its bytes, MUST be included in the checkpoint by an inclusion proof computed from the tiles. A name's state is its head in the name map, read from the map's tiles on the name's path from the root of the checkpoint's `ita-map` extension line, each tile checked against the hash that names it, and proven against that root (§11 rule 9), then its whole chain, walked from the head by §11 rule 10, each entry verified in the log. An entry is a signed note whose text is a release statement (§11 rule 6), an owner's entry (rule 5), or a yank or an advisory (§11 rule 11), read as §15 rule 6 states; an entry of any other kind, a transfer included, refuses the name (U7010), so nothing is resolved from a part of a name's state.
5. **Owners' keys** (ADR 0122 rules 36.3, 38 and 38.1). An owner's chain is the chain of the name-map name `owner:<owner>`, which no package name can be, since a package name has no `:`. Its entries are signed notes of two formats. In each, every line after the format line is `<field> <value>`, one form per line, in the order stated, each once unless stated, and nothing after; an entry longer than a note may be (64 KiB) is refused before it is read. Anything else is refused (U7010).
   - **`ita-owner/1`, the registration,** is the chain's first entry: `source <source>`; `owner <owner>`; `previous none`; `threshold <k>`; one `key <name> <base64 key>` line per key, 1 to 32 of them and at least `k`; then, optionally, the owner's recovery cosigners: one `cosigner <name> <base64 key>` line each, 1 to 32, followed by `cosigners <k>`, `k` from 1 to their number. A key's name is 1 to 128 bytes with no space, control character or `+`; no name or key is listed twice. It is signed by every key it registers.

     ```text
     ita-owner/1
     source itaty
     owner acme
     previous none
     threshold 2
     key acme.laptop 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
     key acme.phone m+aZBhHlVmmPe79aoENK0dCqbiwIpQsMwafH8+0OO9I=
     key acme.backup czG95RFsVbayIzFANGCv/WXvu8KbpTCJYRnkEcW1kgo=
     ```

   - **`ita-key/1`, every later event:** `source <source>`; `owner <owner>`; `previous <index> sha256:<hex>`, the owner's previous entry; one action line; then `threshold <k>`, the owner's threshold once the event takes effect, from 1 to 32. "The current one" and "the keys after" in the table below are those of the state known when the entry is logged ("The requirement as logged", below):

     | Action line | Signed by | `threshold` |
     | --- | --- | --- |
     | `add <name> <base64 key>` | the owner's threshold of current keys, and the key added | 1 to the keys after |
     | `revoke <name>` or `revoke <name> since <p>` | the owner's threshold, or the cosigners' threshold | 1 to the keys after |
     | `cosigners <k> <name> <base64 key> …`, one or more cosigners, `k` at most their number; or `cosigners none`: a pending co-signer change | the owner's threshold | the current one |
     | `recover <name> <base64 key>`: a pending recovery naming the new key | the log's key, and the cosigners' threshold when the owner has cosigners | 1 |
     | `cancel <index>`: of the pending recovery or co-signer change logged at that index | any one current key of the owner | the current one |
     | `overrule <index>`: of the cancellation of a recovery logged at that index | the threshold of the cosigners in effect when the recovery was logged | the current one |
     | `dispute <name> <base64 key>`: a registry dispute naming the new key | the log's key; only for an owner with no cosigners in effect | 1 |

     ```text
     ita-key/1
     source itaty
     owner acme
     previous 48211 sha256:0b7e3c110b7e3c110b7e3c110b7e3c110b7e3c110b7e3c110b7e3c110b7e3c11
     revoke acme.laptop since 48190
     threshold 2
     ```

   **This release.** A client of this release replays, in an owner's chain, only registrations without `cosigner` lines, `add`, `revoke <name>` and `revoke <name> since <p>` on a key held or held before, together with the owner's release and yank statements (ADR 0122 Amendment 14). An owner's chain that holds any other entry, a registration with cosigners, `recover`, `dispute`, `cosigners`, `cancel` or `overrule`, makes the owner's names unavailable (U7013), naming the entry, unless an entry before it is one a registry must not have logged (below), which refuses them (U7010); no release of that owner counts and no yank of it stands. The rules below for those entries, the deadline, co-signer changes and competing requests, and the recovery and dispute paths of rule 38.1, are not in force for clients of this release, which judge no entry by a time; they are kept for a later release, which judges those kinds by its own rule ("What a registry logs", below). Within this release, the key floor of "What a registry logs" bounds every `threshold` of the table below to 2 or more.

   A key's fingerprint is the hex SHA-256 of its public key. A key added, recovered or disputed is never a name or a key the owner holds or held. The client replays the owner's whole chain: an event governs the entries logged after it. A recovery, a dispute or a co-signer change waits: it takes effect at its deadline D, and governs the entries logged after D. **The deadline.** With the target seven days after the time the request was logged, the k-th earliest of rule 7, and a checkpoint's witness time the k-th latest of its witnesses' cosignatures, D is found from the first multiple of 64 at or after the request whose witness time reaches the target, as the first size in the 64 sizes before it, after the previous multiple of 64 and after the request, whose witness time reaches the target, or that multiple itself if none does. With no such multiple below the point, the point stands in its place when its witness time reaches the target; otherwise the request has not taken effect at the point. A checkpoint between two multiples of 64 whose witness time reaches the target before any multiple does is not the deadline, so a client and a registry find the same D whichever witnesses cosign late. Fewer than k witnesses, and a place that leaves cosignatures out, can only make the start later. A registry keeps the checkpoint of every size it signed: a kept checkpoint below the point that a place does not serve is an omission, read from the next place, and with none that serves it the result that needs it is unavailable (U7013), never a later or absent effect. When a recovery or a dispute takes effect, the new key is the owner's only key, with a threshold of one, and the change is a key change (rule 8). A recovery that a current key canceled before it took effect never takes effect, unless the cosigners in effect when it was logged overruled every cancellation of it. An overruling MUST count whenever it is logged before the recovery took effect, after its seven days included: a recovery takes effect at its deadline D, and after its last cancellation was overruled; when its seven days passed before that overruling, it governs the entries logged after the overruling. Once its cosigners overruled a cancellation of a recovery, a later cancellation of it by owner keys MUST NOT count: the cosigners' decision binds, and a thief holding one owner key cannot cancel again at each last moment. A cancellation of a dispute, of a request in effect, or of no request changes nothing, and a dispute cannot be canceled. An owner MUST NOT ask a recovery or a dispute that competes with a request of its own still waiting (below): that freezes its own chain. This release has no command that asks one.

   **Co-signer changes wait.** A `cosigners` entry, a designation, a replacement or a removal, MUST NOT take effect before its seven days have passed, as above, and MUST NOT take effect if any one current key of the owner canceled it before then; a cancellation of a co-signer change cannot be overruled. While it waits, the cosigners in effect are the old ones, for every rule that names them: recoveries, revocations, overrules and disputes, so with none in effect a dispute is available. When a recovery or a dispute takes effect, every co-signer change logged before then and still waiting MUST NOT take effect, since keys it replaces signed it; a recovery leaves in effect the cosigners that were in effect when it was logged, and a dispute leaves none. `una ita lock` and `update` report a co-signer change pending at the resolution point as U7014, as a pending recovery (rule 8).

   **Competing requests.** A recovery or a dispute logged while a dispute of the chain waits competes, and so does a dispute logged while a recovery waits that was logged with cosigners in effect. A request waits from its log position until it takes effect; such a recovery waits even when canceled, since its cosigners may overrule the cancellation. A dispute logged while a recovery logged with no cosigners in effect waits does not compete: both take effect in turn, the later one last. Whether requests compete never depends on a cancellation, which a later claim of compromise can void. No competing request takes effect, and the chain MUST be taken as frozen from the log position of the later one. A frozen chain stays frozen: no later entry changes the owner's keys, its cosigners or its requests, and a dispute or a recovery logged after the freeze changes nothing; a revocation with `since <p>` logged after it, signed as its kind requires by the keys in effect at the freeze, still makes its claim. A name of a frozen owner MUST be refused by resolution (U7010), and the refusal gives the freeze's position; its owner registers anew, under a new owner name. A release logged before the freeze stands, unless it is signed by a key compromised before its position; one logged from the freeze on never counts, whoever signs it, and refuses nothing. Competing requests arise only when an account was taken over, since the registry logs a recovery or a dispute only after it verifies the account; nothing in the log tells the owner's request from the attacker's, so none of them is given the keys.

   **The requirement as logged.** Each entry of an owner's chain is judged once, against the state that the replay of the chain before it reaches at its position: the owner's current keys, its threshold, its former keys, and the entry that brought each key in; its own effect is left out. Its **counted signers** are those of its signers among the current keys that are clean there (below). Its **requirement** is the owner's threshold of counted signers, for every kind, plus the added key's own signature for an `add`; a registration is signed by every key it registers. Both are fixed when the entry is logged, and no later entry changes them. Its `threshold` is checked against the same state, never against one that a later claim rewrote.

   **Claims of compromise.** A revocation with `since <p>` is a claim. It names a key by its name among the keys held then, which it removes, or among the keys held before and held no more, which it does not remove, its `threshold` then the current one. Its `p` MUST be below its own index. A claim MUST NOT carry a signature by the key it names: an owner claims a key's past with its other keys, and retires a key of its own with a plain `revoke`. A claim compromises its key from `p`, taken as no earlier than the index of the entry that brought the key in, so a registration is never undone; a key compromised from `p` signs nothing that counts at a position after `p`.

   **Void entries.** A signer of an entry is **tainted** when a claim that counts compromises it from a position before the entry, or when the entry that brought it in, its registration or its addition, is void. An entry is **void** when its counted signers, less the tainted ones, do not meet its requirement; a void entry changes nothing, and a registration is never void. A revocation, a claim or a plain `revoke`, removes its key, and its stated threshold applies, only when the key is held at its position in the replay; a revocation of a key not held there applies neither the removal nor its threshold.

   **Which claims count.** The client takes the claims from the last to the first, once: a claim **counts** when it is not void under the compromises of the claims after it that count, together with its own. The compromises of the claims that count are the chain's compromises; every other entry is void or not under them, and a claim that does not count is void. Nothing is iterated, and every chain has one result. A chain is **contested** when a claim that counts is void under the chain's compromises: every name of its owner MUST be refused (U7010) while it is, naming the claims; it is not the registry's misbehavior.

   **What a registry logs.** A registry MUST NOT log an entry of an owner's chain unless all of these hold, and a client MUST check every entry of the chain the same way:
   - it is of a kind this release replays ("This release", above) and meets the rules of its kind: a registration first and only there; a name or a key that the chain named before, in a void entry too, never again; its `threshold` right;
   - it meets its requirement as logged;
   - for a claim: it counts on the chain that ends with it, it carries no signature by the key it names, and it changes the keys or the compromises as the chain is known: a claim on a key held removes it, and a claim on a key held before and held no more is logged only when no claim that counts on the chain before it already compromises that key from its `p`, taken as no earlier than the key's introduction, or from an earlier position, so a claim that repeats a compromise already counting is not logged;
   - **the key floor:** after it, as the chain is known with it, the owner's threshold is at least 2 and its current keys number at least one more than its threshold and at most 32, for a registration and for every key event, a claim on a key held included;
   - **the cap of claims:** the chain holds at most 64 claims with it, so a registry MUST NOT log a 65th, and the owner then registers under a new owner name.

   The entries are read in log order. An entry that a registry must not have logged refuses every name of its owner (U7010), and is recorded in a typed form, naming the owner, its log index and the rule it was judged by, that `una ita audit` reports as evidence against the registry; its owner registers under a new owner name, with new keys, since a key that another owner's chain named is refused (§16 rule 2). An entry of a kind this release does not replay, before any such entry, makes the names unavailable instead (U7013), and nothing after it is read. The rule of this paragraph is rule 1 of `ita-key/1`. A later rule applies from the log index the root metadata declares for it: whether an entry could be logged is judged by the rule in force at its position, and which claims count, which entries are void and how releases and yanks are judged follow the new rule for every chain as a whole from the first checkpoint whose size reaches that index. A client that does not know a declared rule makes the owner's names unavailable (U7013). A correction that refuses entries that let an attacker's signatures count applies to the whole log. The replay makes at most C(C + 1)/2 + 2C + 2 forward passes over a chain of C claims, O(C² · E · K) for E entries and K keys held at once, and O(E · K) for a chain with no claim; each signature of an entry by a key is verified once. The unscoped names belong to Itaúna, whose keys and threshold are the root metadata's: it has no chain, no recovery and no dispute.
   **Attackers.** The replay's contract is stated against a key-only attacker, which holds stolen keys of the owner from a log position on and has the registry log any entry that those keys' signatures allow; recoveries and disputes, which need the owner's account, are not logged in this release ("This release", above). The owner **responds** with its claim `revoke <stolen> since <p>`, `p` the position after which the key was stolen, signed by a threshold of its current keys other than the stolen one that are clean as the chain is known, and never by the stolen key; under the key floor, when it holds exactly one key more than its threshold, it first adds a new key, signed by those keys and the new one. A registry MUST notify the owner's verified contact as soon as any key event is logged against the owner's chain.

   **The replay's contract.** A signature is the attacker's when it is by a stolen key at a position after the theft, or by a key that the attacker's entries brought in. An **honest** release or yank is one whose signatures are all by owner keys, none the attacker's except the stolen key at or before `p`, and none by a key that the owner itself claimed before that signature. An owner claim is of the **honest form** when its `p` is at or after the last position where the owner signed with the key it names. The owner is **honest** when, after the theft, none of its entries needs a stolen key's signature, it never signs with a key after it claimed or revoked that key, and each of its other claims is of the honest form. A client MUST replay an owner's chain so that, on every chain the registry logs:
   1. once the owner responded, on the chain and on every chain that extends it in which every claim the owner logs after its response is of the honest form, either the owner's names are refused, or no release counts and no yank stands whose signatures are all the attacker's; an owner claim after the response that is not of the honest form, and that names a key the response or its signers' introduction relied on, can undo the response;
   2. no release or yank, whoever signs it, refuses the owner's names;
   3. against an attacker holding one key and an honest owner that responded, the owner's names resolve, a release signed by its current keys other than the stolen one counts, and every honest release or yank that counted or stood when it was logged still does;
   4. against an attacker holding one key of an owner whose chain the registry logged under the key floor, no entry whose signatures are all the attacker's can be logged, before or after the response; and when the owner is honest and its names resolve, it can log its response at any time while its chain holds fewer than 64 claims, after an addition of a new key when it holds exactly one key more than its threshold, and the response then counts. The key floor counts keys, not keys that can still sign (§16 rule 1): an owner that is not honest can leave a current key compromised by a claim that counts, and with it fewer keys that sign as counted than its threshold, and then no key event of its can be logged; an owner whose chain holds 64 claims logs no further claim (the cap of claims). Either owner registers under a new owner name, with new keys. An attacker holding two keys of such an owner is not covered by this item: it controls the owner's names, and the owner answers by registering a new owner name;
   5. two replays of one chain give the same history, the replay makes a bounded number of passes, and the result depends only on the entries in log order, and not on the order of a note's signature lines.

   An owner that never acts cannot be protected against a valid key. So a refused chain fails every package of its owner: `una ita lock`, `update` and `lock --check` MUST refuse a package whose owner's chain is refused (U7010), as above or, in a later release, frozen, naming the position, `--check` by the newest checkpoint a place serves (rule 3), and `una ita audit` MUST report it. Plain `lock --check` needs no fresh checkpoint, and MUST say in a note how far it looked: that a later freeze was checked at a checkpoint of a witness time it gives in UTC, or that a later freeze was not checked. **`--fresh`:** `una ita lock --check --fresh` MUST read, from a place or a mirror, a checkpoint whose witness time is less than 24 hours before the local clock, as a resolution's (rule 3), extending the lock's resolution point by a consistency proof, and MUST fail when no place serves one (U7013, saying that `--fresh` needs a reachable place or mirror) and when the owner of a locked package has a refused chain there (U7010).

6. **Releases.** A release of a name is a release statement of its chain, of the source and name it is read for, each version once (a second statement of a version is U7010: a release is immutable), signed by the owner's threshold of keys valid at its log position. A statement counts when its owner's chain is not refused (rule 5) and its signers that the owner's keys as logged at its position count, less those tainted under the chain's compromises (rule 5), meet the owner's threshold as logged there. Any other statement is skipped by resolution as a yanked release is, and is neither checked against nor counted by rule 26, so what is not signed as it counts cannot refuse the name; a statement that its owner's keys as logged do not sign is also recorded as evidence against the registry. A statement that met rule 26 against the releases that counted when it was logged, and fails it only against the releases that count now, is skipped and noted, never a refusal of the name. A statement that needs a capability, an operation or a trusted module that the highest release of its identity logged before it did not need breaks rule 26 of ADR 0122, and refuses the name (U7010). The key the lock names is the first signer by fingerprint, as `ed25519:<owner>:<fingerprint>`, `itauna` for an unscoped name.
7. **Logged time.** An entry, a release or an owner's recovery or dispute, is logged at the k-th earliest of the distinct witnesses' earliest cosignatures on the kept checkpoints that include it, k the witness threshold (§11 rule 5). The kept checkpoints are read by size, `checkpoint/<size>` from the entry's index plus one on, each signed by the log's key and a prefix of the resolution point by a consistency proof, until k witnesses are seen, at most 64 of them; past that the resolution point's cosignatures count too, which can only make the time later and a wait longer; the cooldown of §10 rule 4 is measured from it to the witness time of the resolution point, the earliest of the registries' when a program reads several.
8. **Resolution and the lock.** `una ita lock`, `update` and `add` resolve each registry need by §10 over the releases of rule 6, and lock each release of the build list as `package <name> <version>`, `from <source>`, `digest`, `signed`, `logged <index>`, its `needs` lines from its statement, and, for a need of the root with `may` lines, `granted by <root> may <ceiling>`; each source with a release in the lock is recorded as `registry <source>`, `root "<pin>"`, `checkpoint <size> "<root hash>"`. Consent is §10 rule 8's, and for a release with trusted modules, by its statement's `trust`, as §13 states. Beside it:
   - **Keys.** A locked release whose owner's keys changed since the lock it replaces was written, another signing key, or any entry of the owner's chain logged at or after its resolution point, whatever it does, a pending recovery, dispute or co-signer change and one that took effect included, is U7014 at the need until `--accept-key <package>` records it; and a release of the build list whose owner has a recovery, a dispute or a co-signer change pending at the new resolution point is U7014 too, naming it, until `--accept-key <package>`. Nothing is written. Consent is recorded in the lock, in the registry's section: `accepted <owner> <index> …` gives, per owner, the recoveries, disputes and co-signer changes pending at the resolution point whose pending state was consented to, and then `effect <owner> <index> …` those in effect at the resolution point whose taking effect was; owners in order, indices ascending, each below the checkpoint's size. A consent to a pending recovery, dispute or co-signer change covers its pending state only: when it takes effect, that is the moment an account taken over lands, and it is a key change of its own, U7014 until `--accept-key <package>` records it as an `effect`. A later lock, and `una ita lock --check`, take what is recorded as consented; anything pending or in effect that the lock does not record still needs `--accept-key`. A recorded index counts only when it is below the size of the lock's resolution point and is, there, a recovery, a dispute or a co-signer change of the owner's chain: pending and not canceled for an `accepted` index, in effect for an `effect` one; any other is U7009 at its line, reported once per owner, and consents to nothing.
   - **Compromised releases.** A release that counts as signed only with a key compromised before it was logged is never locked or fetched (U7010).
   - **Rule 26 against the lock.** A release that replaces a locked one of its identity and needs more authority or trust than it did is U7010.
   - **The review** of §10 rule 8 gives a registry release's `uses` from its statement, which its archive is checked against when it is fetched (rule 9).
   - **Floors.** The floors of each registry read are stored as soon as its checkpoint is accepted (rule 3).
9. **`una ita fetch [path]`** fills Itaoca with each registry release of the lock that Itaoca does not hold with its provenance: read at the lock's resolution point (rule 3), the release statement at the lock's `logged` index with the lock's digest and signed by the key the lock names, valid at its position; the archive at `blobs/sha256/<hex>`, read and hashed once (§9 rule 3); then the statement is checked against the archive (ADR 0122 rule 37): its `manifest` is the digest of the archive's `ita.una`, which names its package, version and edition; its needs are the archive's, each of the release's own source; its `trust` is the archive's trusted modules; and what the archive's code uses, the union of the `uses` of its functions and handlers, checked at tier 0 from the bytes verified, is within its `authority`. The archive's code MUST check with no diagnostic but those a package read alone has by design: no lock (U7009), registry needs it cannot load (U7008 at its `ita.una`), and imports of their modules (U1001); any other, or a platform the checker cannot run on, refuses it, since what such code uses cannot be counted. A release that counts as signed only with a compromised key is not fetched. The package is then stored with its provenance (§9 rules 5 and 7) and loaded again as every command loads it. Any failure is U7010, and nothing of that release is stored; a source with no mirror is U7013. It prints `fetched <name> <version>`, or `<name> <version> is in Itaoca` for one held already.
10. **Loading.** A registry release that loads verified (§9 rule 9) and that a need of the root names, by its name, its source and its major line, is mounted as a path dependency is (§12 rules 3 to 5), its files the bytes verified, named in diagnostics below `vendor/ita/<source>/<release>/` or `itaoca/<source>/<release>/`. §12 rule 2 applies to it but `accept name`, which a registry package does not need; in this release a registry release with trusted modules is not mounted either (U7008 at the need). The report gives it with its `source`, `null` for `path`, the lock's `digest` and `signed`, and `tcb.registries` names each source of a mounted release with the digest of its root metadata.
11. **Costs.** Opening a source: O(R) root versions and O(log L) hashes and tiles for a consistency proof in a log of L entries. An entry: O(log L). A name: at most 32 map tiles of at most 12 KiB and O(256 + 8 k) hashes for its head, and O(E log L) for its E entries. An owner's keys: O(E) to replay, O(log E) to find the keys at a position. A logged time: at most 64 kept checkpoints; a recovery's effect, and its earliest position: O(W/64 + 64) kept checkpoints for the W sizes from the request to its deadline, by the deadline search of §14 rule 1 over the pinned multiples of 64 and then the sizes up to the deadline, each checkpoint read once and cached, and at most 2^23 sizes, so at most 2^17 + 64 checkpoints (§14 rule 1 gives the derivation); a checkpoint's witness time, the k-th latest of the cosignatures counted, need not grow with the size when the witnesses cosigning differ, so no binary search over it is sound. Every proof is computed from tiles fetched at most once each.

## 15. Publishing, yanks, audit, watch and bundles

The client's side of ADR 0122 rules 33, 36.2 and 41 to 43, on the registry client of §14. Each rule here holds for `una ita`; none changes what `una check` reports, so they are tested as tooling.

1. **Reading and writing a registry.** A source is read as §14 states: from the first of its places, its mirrors (§14 rule 1) and then its own URL, whose copy verifies, every byte verified before it is used. A submission is written through the transport of the source's own URL, below its base: a directory's transport writes each file once: into a fresh private file of its own name, then linked into place with a hard link, which fails when the target exists, so two writers never replace each other's file, and a second write of other bytes at the same path is refused; it never writes `checkpoint` or any path below `checkpoint/`; an `https://` URL has no transport yet, and a command that would send to one stops with a diagnostic saying so (U7013), and sends nothing.
2. **Private sources** (rule 42). Each need resolves at one source, with no fallback (§3 rule 2, §10). `una ita add <owner>/<name>` names the source that serves `<owner>` itself, and `--from` another source is a usage error, so a private owner's package is never looked for at another registry. Only the root and `itaty.una` name sources (§12 rule 1).
3. **Publishing** (rule 43). `una ita publish [path]`:
   - refuses (U7013 at the head) a package that §11 rule 12 refuses; then one whose directory, or any ancestor of it up to the file system's root, holds an entry `.git`, a directory or a file: the check that a workspace member has no uncommitted change is not available yet, so a package in a git repository is not published, and no program is started to look. The check fails closed: a directory that cannot be resolved, and an entry that cannot be probed for any reason but its absence, refuse, and so does `GIT_DIR` or `GIT_WORK_TREE` set in the environment, which can put any directory in a repository; then one whose `una check` at tier 1 reports any diagnostic, an obligation not proven included;
   - publishes `ita.una` and the modules exactly as checked, and `README.md`, `CHANGELOG.md` and the license files at the top of the package, each read once with no link followed; every other file stays out, and a file or a bound that §9 rule 1 refuses refuses the publication;
   - sends to the source that the head's `publish to` names: a published package has no `sources` section, so a source other than `itaty` is the one that the `sources` of the nearest workspace whose `itaty.una` lists the package as a member declares, with its URL and its root's pin, and a source no such workspace declares is refused (U7013). `itaty`'s URL and root are built into `una`. The URL is given to the transport of rule 1, so a source served over HTTPS stops here with U7013, and nothing is sent;
   - reads the name's state at a fresh checkpoint (§14 rule 3): the head of its chain, its releases and its yanks; a version already released, and authority or a trusted module beyond the highest release of its line in log order (§11 rule 7, §14 rule 6), every release of the name being logged before the new one, whether it is above or below the new version, are refused;
   - gives rule 26's advice: each public header of the highest release of the line in log order, a line of one of its modules that starts with `pub ` read up to its ` = `, that the new release no longer has as written, removed or changed, is printed as advice; nothing is refused for it;
   - writes the release statement of §11 rule 6, whose `previous` is the head of the name's chain and whose `authority` is the union of the `uses` of the package's public functions and of its handlers; signs it with the owner's keys of rule 4; and sends the archive, then the statement, as `submit/<leaf>/archive` and `submit/<leaf>/entry` below the source's base, where `<leaf>` is the hex of the statement's leaf hash (RFC 9162: SHA-256 of `0x00` and the signed note); then records `registry/<source>/submitted/<leaf>` in Itaoca, for rule 8: the line `ita-submitted/1`, then `url <url>`, `name <name>`, `time <seconds>`, the witness time of the checkpoint read, and `sent <seconds>`, the local clock when it was sent, each on its line. A submission sent but not recorded fails the command, saying so, since its promise could never be checked.
4. **The owner's keys** (rule 38). The keys that sign a release or a yank are chosen in `.una/keys` of `HOME`, which MUST be a directory, not a link, that grants nothing to the group or to others, against the owner's keys and threshold valid at the checkpoint read (§14 rule 5). As a best-effort bound on a local attacker who can already write `~/.una`, the directory's device and inode, read with no link followed, are recorded before it is listed; each key file opened MUST be on that device; and after every read the directory MUST still be the same one and still private; any change refuses:
   - the owner's key files are the regular files named `<owner>-<id>.key`, `<id>` lowercase hexadecimal, and `itauna-<id>.key` for a name without an owner;
   - every one of them must read: it is opened with no link followed, checked on the opened descriptor to be a regular file of at most 4 KiB that grants nothing to the group or to others, and read through it, at most one byte more; a link, a larger file, one others can read, one encrypted with a passphrase, and one that does not parse each refuse the command (U7013), so no key file of the owner is silently left out or taken. The copies of a secret this client makes are overwritten with zeros once used, a best effort that cannot reach every copy;
   - a key signs only when its name and its public key are those of a key of the owner, so its signature line carries the name and the key hash that a client looks for (§11 rule 3); every such key signs, and fewer distinct ones than the owner's threshold refuse the command (U7013).

   A key file is read in the form written without a passphrase:

   ```text
   ita-keyfile/1
   name acme.publisher
   secret <base64 of the 32-byte Ed25519 secret>
   ```

   A key whose public key fails §11 rule 2 on a signature of its own is refused. A key file encrypted with a passphrase starts with `ita-keyfile-encrypted/1`; it is refused with the reason that passphrase encryption is not implemented yet, and never read as clear.
5. **Promises** (rule 36.2). The registry answers a submission with a promise, written at `submit/<leaf>/promise`: a note signed by the log's key whose text is `ita-promise/1`, `source <source>`, `leaf sha256:<hex>` and `by <seconds>`, each on its line. `by` is the registry's own commitment and no time of anything else. A submission's window starts at its anchor `t`, the later of its recorded witness time and its recorded local clock at sending, so a submission sent at a checkpoint up to 24 hours old is not judged against a window that closed before it was sent; the window ends at `t` plus one hour plus the hour of clock skew §14 rule 3 allows, which leaves the registry's clock and the network their latency. A local clock that runs fast can only widen the window through `sent`, which fails toward leniency, and is accepted:
   - a promise whose `by` is later than the end of the window is itself a broken promise;
   - kept means logged by `by`: the entry is in the name's verified chain at the checkpoint read, by its inclusion proof, and its logged-at time (§14 rule 7) is no later than `by`, or, with no promise, no later than the end of the window;
   - broken: logged later than that; not logged at a checkpoint whose witness time is past `by`; or no promise and not logged at a checkpoint whose witness time is past the end of the window;
   - pending otherwise.

   A promise served that does not verify (its signature, its source or leaf, or its text) is reported, and counts as no promise. The first verified promise of a submission is stored in Itaoca at `registry/<source>/promises/<leaf>`, with the record of the root version it was verified under, `ita-promise-root/1` and `root <version> sha256:<hex>`, at `registry/<source>/promises/<leaf>.root`, written first; a stored promise is verified again against the log key of that root version in the root chain read, so a later rotation of the log's key leaves it verifiable, and one whose root version the chain does not hold does not verify; one stored with no record is verified against the last root's log key; a later promise whose text differs is a replaced promise, reported as evidence against the registry, and the judgment takes the earliest `by` of every verified promise seen, so a replacement never turns broken into kept. Kept is final: the submission is settled in the watch position (rule 8) and never judged again. Broken is provisional, as judged from what the places served, whose kept checkpoints may be incomplete and make a logged-at time later than it is: it is reported on every run, and never settled, until it is kept.
6. **Yanks and advisories** (rule 41, §11 rule 11, and the amendment of ADR 0122 on the yank command).
   - `una ita yank <version> [path]` writes the yank statement of a release of the package, whose `previous` is the head of the name's chain, signs it with the owner's keys of rule 4, at least the owner's threshold, and sends it as `submit/<leaf>/entry` to the source that the head's `publish to` names, through the same transport as `una ita publish` (rule 3), where it is logged in the name's chain; a version not released, or already yanked, is refused (U7013).
   - The client reads a name's yanks and advisories from its chain (§14 rule 4), in log order. A yank stands only when it is of the name and source it is read for, names a release logged before it, its owner's chain is not refused (§14 rule 5), and its signers that the owner's keys as logged at its position count, less those tainted under the chain's compromises (§14 rule 5), meet the owner's threshold as logged there; any other yank is void and ignored, never a refusal of the name; and so is a second yank of a version already yanked; each void yank is noted, and `una ita audit` reports it (rule 7). An advisory stands only when it is of that name and source, at least one security key of the root signs it, and every version it names is a release logged before it; one security key holds a release back, and lifting the cooldown for the fix it names by digest needs at least the root's security threshold of distinct security keys, never fewer than two, or one security key and the owner's threshold (§11 rule 11). The security keys are judged first: the owner's signers, and the check that the timing of the owner's requests does not change how its keys judge the advisory (§14 rule 1, withheld cosignatures), are read only for an advisory with a fix that its security keys alone do not lift, so a doubt about the owner's timing never makes the name unavailable when the owner's signers cannot change what the advisory does. An advisory whose identifier the chain already holds, and any other entry that does not stand, refuse the name (U7010).
   - Resolution (§10 rule 4) reads a release as yanked when a yank of it stands, or when it counts only with a key revoked as compromised before its position; as advised when an advisory names it; and with no cooldown when a lifting advisory names it, by digest, as its fix. The cooldown is a wait in witness time: the witness time of the resolution point's checkpoint minus the release's logged-at time (§14 rule 7).
7. **`una ita audit [path]`** opens each source of the lock's registry packages at a fresh checkpoint (§14 rule 3), which MUST extend the lock's resolution point of that source by a consistency proof, and reads, for each package, the verified state of its name and of its owner. It reports U7014, once per package with every finding, at the root's need when the root needs the package and otherwise at its line of `ita.lock`, for a release that is yanked; named by an advisory, with the advisory's identifier, severity and summary; that counts only with a key revoked as compromised since a log entry before it; for a recovery, a dispute or a change of recovery co-signers pending for its owner (the amendment of ADR 0122 on co-signer changes); and for a key change of its owner from a log position after the lock's resolution point. A package whose owner's chain is frozen by competing recoveries or disputes is U7010, giving the freeze's position. What reading the packages found about a registry is reported apart, from the client's typed records and never from a refusal's text, as `una ita watch` reports a broken or a replaced promise. An owner chain that does not settle (§14 rule 5, invariant (4)), naming the owner, the first log index whose claim differs and the replays made, and an equivocation, two checkpoints of one size that the log signed naming different root versions, naming the size, the versions and the places read, are evidence against the registry, once per record, at the source's `registry` section of `ita.lock` (U7010): two signed copies back an equivocation. A request whose deadline checkpoint no place serves, naming the owner, the request's log index and its target witness time, and a cadence gap, naming the range of sizes over which no checkpoint carries the witnesses' threshold of cosignatures, are evidence from an absence, which a place can cause, and two places can be one party: each is only a note, `unattributed: a place or the registry`, with the places read and how many served the same copy, never U7010 and never a cause of exit code 1. A release of the package's name whose cooldown eligibility a place's withheld cosignatures delay (the client's eligibility-delay observation, §14 rule 1), read on the lines resolution reads for the package, its own and each fix's, is reported for each locked package of the name with the delayed version, its logged time as served and the earliest the merged cosignatures allow: a finding of its U7014 when the delayed version is the fix that an advisory naming the locked release names, and a note otherwise. It also reports a void yank of the release (rule 6). The lock's `accepted` and `effect` indices count only as `una ita lock --check` counts them (§4 rule 2, §14 rule 8): below the lock's resolution point, a recovery or a dispute of the owner's chain there, pending and not canceled for an `accepted` line, in effect for an `effect` line; any other index is not honored. An effect after the resolution point that no `effect` line records is reported (U7014): a recovery or a dispute accepted while pending that has since taken effect needs consent to its effect of its own. The release the registry holds MUST be the one the lock names, by its log index and digest; a lock that names another, and a state that cannot be had verified at a fresh checkpoint, are U7010 at the package, or U7013 when a document that no place serves left it unavailable, told apart by the client's record of omissions (§14 rule 1) and never by a message, so the audit calls nothing clean that it did not verify, and it goes on with the next package, reporting each one. An advisory's identifier, severity and summary, which a registry served, are quoted with every control and direction-changing character escaped, at most 400 characters, as every message quoting a registry is. The exit code is 1 on any. `una build` never calls it. Costs: per package, one state of its name and one of its owner, each read once per source, then O(A + K) for its advisories and its owner's key events.
8. **`una ita watch <owner> [<name>…] [--from <source>]`**, `itaty` by default, reads the source the package in the current directory, or its workspace, declares, at a fresh checkpoint, and follows the owner's chain `owner:<owner>` and the chains of the names named and of those the position holds, from the position stored in Itaoca at `registry/<source>/watch/<owner>.position`:

   ```text
   ita-watch/1
   source acme
   owner acme 12
   name acme/ledger 5
   ```

   the format line, the source, the owner with the count of its entries seen, and one line per name, sorted, with its count, in one encoding; a position that does not read is a usage error. A position MUST name the source and owner asked for, and each `name` line a package's name; a `settled <hex>` line records a submission settled as kept (rule 5). Settled lines whose submission record is gone are pruned; a position holds at most 100,000, and past that settling is refused, telling the user to remove old records in `registry/<source>/submitted/`. It prints each new entry, its chain, format, log index and leaf hash; a chain whose count is below the one stored is U7010 against the registry. For each submission recorded in Itaoca (rule 3) and not settled, whether or not its name is followed, at most 1,000 in one run, the oldest first, the run saying how many wait for a later one, it reads the promise at the place it was sent, verifies it with the log's key of the last root, judges it by rule 5, and prints it kept, broken, pending or unavailable; a place that serves no promise is judged as no promise, by the window, but a promise that cannot be read or does not verify never counts toward a kept verdict: one that would be kept is unavailable, not settled, and judged again on a later run, since what a place failed to give may only leave a verdict unavailable, never change it; a missing entry or checkpoint is a failure to judge, never a verdict, U7013 when the client recorded a document that no place serves; a failure to read or judge one is a line of its own, and the others and the entries are still printed. A broken or replaced promise, an unavailable verdict, a failure, and a position or first promise that cannot be stored exit with code 1; a broken promise is evidence the owner can publish. It then stores the new position, with the submissions settled. Itaoca is the user's own, local store: its records and positions are trusted as the user's files are, and only what the places serve is verified. Costs: one chain per name followed, each verified as §14 rule 4 states.
9. **Bundles** (rule 33). `una ita bundle <file> [path]` reads each source of the lock's registry packages at the lock's resolution point (§14 rule 3), from its first place that verifies, and writes into one file:

    ```text
    ita-bundle/1
    <length of the listing>
    <listing: path NUL length NUL hex SHA-256, one line per entry, in ascending byte order>
    <each entry's bytes, in listing order>
    ```

    whose entries are `packages/<hex>`, the archive (§9 rule 3) of the package of digest `sha256:<hex>`; `provenance/<source>/<hex>/checkpoint-<size>`, its provenance at the lock's resolution point (§9 rule 7); and `registry/<source>/<path>`, every file of the source's registry, but its archives, that the client read to verify those releases: the root chain, the checkpoint of the lock's point and the kept checkpoints with the cosignatures that give each release its logged-at time (§14 rule 7), the log's tiles and entry bundles, and the map's tiles of each name and owner. Of each kept checkpoint, whose cosignatures the client merges across places (§14 rule 1, withheld cosignatures), the bundle carries every place's distinct copy, the first at `registry/<source>/checkpoint/<size>` and the others at `registry/<source>/copies/<n>/checkpoint/<size>`, `n` from 1, at most 65 in all, rather than one copy with the lines merged, since a note holds one signature line per key and two places may serve two cosignatures of one witness; unbundling reads them all as the bundle's copies and merges them as the client does, so it computes the same witness times offline. The bundle carries the whole root chain the client walked, every version included, those that revoke witnesses (`witnesses-revoked`) too, so the last root version every bundled checkpoint names travels with it; and, when the lock's point names an older root version, the latest checkpoint under the current root that the client read and the tiles of the proof that the point is its prefix, so the point's retired witnesses count offline as they count for the client. Unbundling reads root metadata and the latest checkpoint from the bundle alone and applies the client's own rule for a point under an older root (§14 rule 3), never a count of its own: it accepts at the lock's point a checkpoint naming an older version, as the client does at a lock's point, and treats a version a bundled checkpoint names that the bundle lacks as an omission (U7013), never trusting an older root in its place, and a root chain below the root version Itaoca stores, or one that holds that version with another digest than the floor stores (§14, Floors), as a refusal (U7010). A release the registry does not hold at that point as the lock names it, by log index and digest, is U7010, and a source no place serves verified U7010 or U7013; then nothing is written, and the file is written through a fresh file and a rename. At most 100,000 entries and 4 GiB. `una ita unbundle <file> [path]` opens the bundle with no link followed, checks on the opened descriptor that it is a regular file, reads it once into memory, at most one byte more than the largest bundle, and checks its listing (paths of these forms, strictly ascending, each entry's hash, nothing after the last). Then, for each registry package of the lock that Itaoca does not hold verified already, it verifies its archive's digest against the lock and its provenance as every load does (§9 rule 7, with `ita.una`'s pin), and opens the bundle's copy of its source with the client at the lock's resolution point, with no freshness, against the checkpoint and the root version Itaoca stores for the source as its floors (§14 rule 3), and proves that the point extends the lock's by a consistency proof: the release the client reads MUST be the lock's, by log index and digest, and its name's state, its yanks and advisories and its owner's keys included, MUST verify, and its logged-at time is computed from the kept checkpoints the bundle carries. Only when every one verifies does it store them in Itaoca, and then the source's checkpoint and root version as its floors, through Itaoca's floor API, kept under the registry's identity, each replaced only by a larger one under the floor lock, so unbundling never moves either backwards. A floor that cannot be stored is a note, never a failure; one that exists and cannot be read is unavailable (U7013), and nothing is written: unbundling is offline, as every load is (§9 rule 7), and a bundle's root chain is never verified without the floor. The bundle's copy of a source is a place: its listing commits to the entries it holds, not to the registry files it should hold, so a registry file it lacks is an omission, read from the source's places behind it (§14 rule 1) and verified like the rest; one that none of them serves leaves the state unavailable, U7013, never a different result. A package the bundle does not hold is U7011, any other failure U7010, and then nothing is written. Entries that no locked package uses are not stored. Costs: O(B) for a bundle of B bytes, O(e log e) to sort its e entries, and the client's costs of §14 rule 11.

## 16. The registry service

A registry (ADR 0122 rules 34 to 46) logs what it is sent only after verifying it, and serves the log as static files that every client verifies again with §11. Itaty's service is the crate `una-itaty`.

1. **Entries.** Each leaf of the log is a whole signed note, signature lines included, of at most 65,535 bytes: a release statement, a yank or an advisory (§11), an owner's registration or an owner's key event. An owner's registration is `ita-owner/1`, `source`, `owner`, `previous none`, `threshold <k>`, then one `key <name> <base64 key>` line per key, from 3 to 32 keys and at least k + 1, with k at least 2, and no `cosigner` line, each signing the note. A key event is `ita-key/1`, `source`, `owner`, `previous <index> <leaf hash>`, one of `add <name> <base64 key>`, `revoke <name>` or `revoke <name> since <index>`, and `threshold <k>`, the threshold after it; it is signed as §14 rule 5 requires, and a key added also signs it. A key event, a claim included, that would leave a threshold below 2, fewer current keys than the threshold plus one, or more than 32, as the chain is known after it, is refused, and so is a 65th claim of a chain. The floor counts the owner's current keys, not the keys that can still sign: a current key that a claim that counts compromised still counts toward it. With these, one stolen key alone signs nothing that the registry logs on the owner's chain or that counts, and an honest owner answers with its other keys (§14 rule 5, the replay's contract, item 4), adding a key first when it holds exactly one key more than its threshold. An owner whose current keys that sign as counted are fewer than its threshold, because its own claims left a current key compromised or because two of its keys are stolen, can log no key event, and one whose chain holds 64 claims logs no further claim: it registers under a new owner name, with new keys, since a key that another owner's chain named is refused (rule 2). This release's registry logs no recovery, dispute, co-signer change, cancellation or overruling. An owner's entries form the chain of the name `owner:<owner>` in the name map; a package's entries form the chain of its name. A leaf hash in `previous` is `sha256:` and the hex of the RFC 9162 leaf hash of the entry's bytes.
2. **What the registry verifies** before it logs an entry, refusing it otherwise with one sentence:
   - the entry's format, at most 65,535 bytes, and that its `source` is the registry's;
   - that its `previous` is the latest entry of its chain, or `none` for a chain with no entry;
   - for an owner's registration and key event: the rules of §14 rule 5, "What a registry logs", by the same function a client uses, on the chain the registry holds;
   - for a release: that it counts as logged on its owner's chain (§14 rule 6), or its signatures by the threshold of Itaúna's keys of the root metadata for an unscoped name; for a name new to the registry, rules 44 and 45 (form, reserved names and skeletons, a skeleton unique among the owner's names and the unscoped ones); that its version is not logged already; at most 10,000 releases per name; that each need names a release logged at the registry, at most 1,000, none of the release's own identity; rule 26 against the highest earlier release of its identity; and its archive (rule 37, below);
   - for a yank: that it stands as logged on its owner's chain (§15 rule 6), and a version released and not yanked; for an advisory: a security key of the root metadata, and affected versions all released;
   - for a registration: the operator's credential, which stands for the verification of the account; rules 44 and 45 for the owner name; an owner name one edit (an insertion, a deletion, a substitution or a swap of adjacent characters) from one of the 1,000 owners with the most dependents is held for review until the operator accepts it; every key signs; no key is another owner's.
3. **A release's archive.** It is read by §9 rule 3 and must have the statement's `digest`; its `ita.una` must have the statement's `manifest` digest, read with no error, pass the refusals of §11 rule 12, and give the statement's `name`, `version`, `edition`, `source` (its `publish to`) and `needs` (each at its least version). The statement's `authority` must be exactly the union of the `uses` clauses of the package's public functions and of its handlers, each capability with its operations, a clause with no operations counting every operation that the package's declaration of the capability, or the prelude's, lists (with neither, the package is refused); its `trust` must be exactly the modules `ita.una` lists under `trusted` and those whose header is `trusted module`. A module that does not lex or parse refuses the package. The archive is then served at `blobs/sha256/<hex>`.
4. **Promises** (rule 36.2). A logged submission is answered with the note `ita-promise/1`, `source`, `index <n>`, `leaf <leaf hash>`, `by <seconds>`, signed by the log's key; the service logs before it answers, so `by`, one hour after the registry's clock, is always met.
5. **Checkpoints.** After each entry, the log signs the checkpoint `<log key name>`, `<size>`, `<base64 root>`, `ita-map <base64 map root>`, `ita-root <n> sha256:<hex>` naming the root version in force (§11 rule 9), stored at `checkpoint/<size>` and served to witnesses at `witness/next`. A witness's cosignature is taken only from a witness of the root metadata, when it verifies, when its time is not below that witness's previous one nor more than one hour after the registry's clock, and when that witness has not cosigned a larger checkpoint; it is added to `checkpoint/<size>`. The newest checkpoint with the witness threshold of cosignatures is served at `checkpoint`.
6. **Witnesses** replay the entries since the checkpoint they last cosigned, from the entry bundles, recompute the log's root and the name map, checking each entry's `previous` against its name's head and its count rising by one, and cosign only a checkpoint whose two roots they reach, never with a time below their previous one.
7. **Static files** (rule 34): `root/<n>`; `checkpoint`, `checkpoint/<size>`, `witness/next`; the log's tiles in the layout of C2SP `tlog-tiles` (`tile/<L>/<N>` and `tile/entries/<N>`, `.p/<W>` while partial, removed once the tile is full, each entry of a bundle after its 16-bit big-endian length); the name map's tiles; and `blobs/sha256/<hex>`. **A map tile** at tile level t (0 to 31) holds the 256 nodes at depth 8t + 8 under the first t bytes of a key, indexed by its byte t: a bitmap of 32 bytes (bit i of byte i / 8, least significant first, set for each node that is not the empty subtree), then for each such node its hash, or at t = 31 the name's head (index, 8 bytes big-endian; leaf hash; count, 8 bytes). It is stored at `map/<t>/<hex of the root of the tile>`, so a client starts from the `ita-map` root, fetches the tiles on a name's path, recomputes each one's root and compares it with the hash that named it. A lookup reads at most 32 tiles.
8. **Endpoints.** `GET` serves the files of rule 7 and no other. `POST /publish` takes `ita-publish/1`, the statement's length in decimal, each on its line, the signed statement and the archive; `POST /submit` a yank, an advisory or a key event; `POST /register` a registration, with the operator's bearer token; `POST /cosign` a checkpoint's size and a cosignature line. A request's head is at most 16 KiB and 64 headers; a body needs `Content-Length` within its endpoint's bound, checked before it is read; chunked bodies, queries and percent-encoding are refused.
9. **Failure.** A write to the store that fails stops the service from logging until it is opened again. Opening replays the log from its entry bundles, checking each chain and the stored checkpoint, so a store changed by hand refuses to open. The checkpoint of a size is a function of the entries and of the root version it was first signed under: a root rotation takes effect from the checkpoint of the next entry, and a size whose checkpoint is stored keeps the version it names, its log key's signature and its bytes when the service opens again, so a size signed again after a crash is the same, and two log-signed checkpoints of one size never name different versions (§11 rule 9). Opening checks the stored checkpoint of every size: each size below the log's has one, each names a version of the chain with that version's digest, is signed by that version's log key and is the log's text under it, and the versions never decrease as the size grows; otherwise the store refuses to open. A size whose checkpoint was never stored is signed under the version in force. Until the checkpoint of the first entry after a rotation is cosigned, the point names the older version while the newer one is served, which clients treat as unavailable (§11 rule 9, U7013), so a registry logs an entry after a rotation. A store has one writer: the service locks it while open, and a second one refuses to open.
