# Conventions for Specifications and TRMs

> How Peios specifications (the PCDS, PGSS, PSPK, and PSPU books) and technical reference manuals are written and read, covering normative language, required structure, citation and addressing, and the style rules they add to Core Style.

---

# 1.1 Scope

_Standards and Conventions / Conventions / Introduction_

> The two classes of technical document this book governs, what it leaves to other documents, and how it relates to Core Style.

This document defines how the technical documents of Peios are written
and how they are read. It governs two classes of document:

- **Specifications.** The PCDS, PGSS, PSPK, and PSPU books, which state
  what must be true for a Peios system and for the parties that
  interoperate with one.
- **Technical reference manuals.** The per-component books that describe
  exhaustively how one piece of Peios actually behaves.

Together, the specifications and the technical reference manuals are the
corpus this book refers to.

It covers normative language, the structure a document of each class
takes, how any part of either is cited, and the style rules both share.

## 1.1.1 What this document does not cover

This document does not cover four things:

- **The other forms of Peios documentation.** Learn, man pages, regman,
  and evman follow [Core Style](/psc/style/core-style.md) and their own form
  pages. Neither the normative apparatus of a specification nor the
  exhaustiveness of a reference manual applies to them.
- **Any behavior of Peios itself.** Nothing here specifies what a
  Peios system does. This document constrains documents.
- **The renderer.** The static site generator that builds these books
  supplies the chapter and article numbering this document's addressing
  scheme relies on, and is specified separately.
- **Editorial process.** How a document is reviewed, by whom, and when
  it is considered ready are project conventions rather than document
  conventions.

## 1.1.2 Relationship to Core Style

This book sits in the Documentation shelf of Developing for Peios,
beside Core Style, and is the form-specific guide for specifications and
technical reference manuals. Core Style applies to specifications and
technical reference manuals too, except where this book says otherwise.
This book adds to it rather than repeating it, so an author reads Core
Style first and then the chapters here for the class they are writing.

This book departs from Core Style deliberately in five places:

- **Normative keywords.** A specification states each requirement with
  an RFC 2119 keyword (§2.1), and a technical reference manual uses
  none at all, in uppercase or in a lowercase form that reads as an
  obligation (§4.2).
- **Notes.** In a specification, a `[!NOTE]` callout marks informative
  text and carries the reasoning behind a rule, not only an aside (§2.2,
  §6.3).
- **Lowercase hexadecimal.** Hash values and byte sequences are written
  in lowercase hexadecimal, as they appear in the files and tool output
  a reader compares them with (§3.3).
- **Interim states.** A technical reference manual can describe the
  intended end state of deliberately provisional behavior, marked as
  such, as an exception to Core Style's rule against writing about time
  (§4.4).
- **This book's own rules.** This book is not a specification, but it
  states its rules with RFC 2119 keywords so that what it requires of a
  document is unambiguous (§1.3).

This book is not itself a specification: it defines no Peios behavior,
and no implementation conforms to it. What conforms to it are documents.

---

# 1.2 The Two Document Classes

_Standards and Conventions / Conventions / Introduction_

> The test that decides whether a document is a specification or a manual, based on how many independently written parties have to agree, and why most subsystems need both.

Every technical document in this corpus is either a **specification** or
a **technical reference manual**, and the difference is not a matter of
subject, length, or tone. It is a matter of how many independently
written parties have to reproduce the same computation to agree:

- If one party computes something and everyone else calls it, that is a
  manual.
- If a second party must reproduce it identically, or the two produce
  divergent results, that is a specification.

## 1.2.1 The sharper form of the test

A third party wanting to interact with something directly is necessary,
but it is not sufficient. What makes something a specification is a
second **role**: a party whose behavior the other side depends on.

A system-call surface has no second role. It has callers, and callers
are documented rather than specified. The question that settles it is
which party is the one asking. A registry source answers the kernel's
questions, and a package producer emits what a consumer validates, so
both of those are specifications. Nobody serves `mount(2)`, so that is a
manual.

## 1.2.2 Most subsystems split

The expected outcome for any given subsystem is both: a specification
stating the contract, and a manual covering the nuances of how one
implementation fulfills it.

Binary signing is a specification because a third party can sign
binaries; the kernel's verification machinery behind it is a manual.
Security descriptor inheritance is a specification even though there is
one kernel, because the kernel does not propagate a descriptor change
and every userspace tool that propagates one has to agree. A package's
manifest schema is a specification; how a package manager decides which
of several candidates to install is a manual.

A subsystem whose only external surface is its own syscalls contributes
no specification at all, and that is a legitimate outcome rather than an
oversight.

## 1.2.3 Consequences for the reader

A specification states what an implementation and its peers can rely
on. Its statements are commitments, and an implementation that
contradicts one has a defect.

A manual describes what a component does. Its authority comes from the
software: where the two disagree, the software is right and the manual
is stale. A manual makes no stability commitment, and nothing in one is
a promise about a future version.

That difference is why the two classes are written so differently, and
why a reader must be able to tell at a glance which one is in front of
them (§4.2).

---

# 1.3 How to Read This Book

_Standards and Conventions / Conventions / Introduction_

> The normative keywords this book uses, why its specification and manual halves carry different weight, and the order to read its chapters in.

This book states its rules with RFC 2119 keywords, and its chapters carry
different weight depending on the class of document they govern.

## 1.3.1 Normative keywords

The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY in this
document are to be interpreted as described in RFC 2119. Their meaning
within a specification is defined in §2.1.

Text set off as a note is informative.

## 1.3.2 The two halves carry different weight, deliberately

Chapters 2 and 3 govern specifications and are normative throughout.
A specification that violates one of their requirements is malformed,
and the requirement is stated as such.

Chapter 4 governs technical reference manuals and is deliberately
lighter. Most of it is SHOULD and MAY, and some of it is offered as
guidance carrying no normative weight at all. A manual is a description
of software rather than a contract, so prescribing its shape tightly
would be prescribing the shape of the software.

Two rules in chapter 4 are exceptions and are stated as MUST NOT,
because they are what makes the class a class rather than a matter of
taste: a manual carries no RFC 2119 keywords (§4.2), and a manual does
not narrate the difference between itself and a specification (§4.4).

Chapters 5 and 6 apply to both classes.

## 1.3.3 Reading order

An implementer needs §2.1 and chapter 5, and nothing else.

An author needs [Core Style](/psc/style/core-style.md), then the chapter for
the class they are writing, then chapters 5 and 6.

A reader trying to work out which class a document belongs to, or why a
given fact is documented in one place rather than another, wants §1.2.

---

# 2.1 RFC 2119 Keywords

_Standards and Conventions / Conventions / Normative Language_

> How uppercase MUST, SHOULD, and MAY carry their RFC 2119 meanings while lowercase forms carry none, why requirements are stated against a role, and what a SHOULD has to mean.

A specification MUST declare its use of RFC 2119 keywords in its
conventions article (§3.1).

The following keywords, when they appear in uppercase, MUST be
interpreted as described in RFC 2119:

| Keyword | Meaning |
|---|---|
| MUST, MUST NOT | An absolute requirement or prohibition |
| SHALL, SHALL NOT | Synonyms for MUST and MUST NOT |
| SHOULD, SHOULD NOT | A requirement that can be set aside for a stated reason, the consequences of which are understood |
| MAY | Genuinely optional |
| REQUIRED, OPTIONAL | Synonyms for MUST and MAY, used adjectivally |

A specification MAY use a subset. Its conventions article MUST list
which keywords it uses.

## 2.1.1 Lowercase is not a keyword

The same words in lowercase carry no normative weight. This is not a
loophole to be exploited: a lowercase "must" in a passage that reads as
a requirement is an editing defect, because the reader cannot tell
whether an obligation was intended.

<!-- lint-disable spelling -->
An author writing a requirement MUST use the uppercase form. An author
writing description SHOULD reach for a verb that is not a keyword at
all, such as "is," "carries," or "produces," rather than relying on case
to carry the distinction. Where a description needs a modal, the rule
in [Core Style](/psc/style/core-style.md) applies: "can" for ability, "might" for possibility, and
never a lowercase "may."
<!-- lint-enable spelling -->

## 2.1.2 Requirements are stated against a role

A specification with more than one party MUST state each requirement
against the role rather than the program (§3.2). An obligation on a
consumer binds whatever process is acting as the consumer, and one
program can serve different roles on different interfaces.

## 2.1.3 SHOULD means something

A SHOULD is not a soft MUST and not a decorative MAY. It marks a
requirement with a real exception, and a specification using one SHOULD
say what the exception is, either inline or in an adjacent note.

> [!NOTE]
> A SHOULD whose exception nobody can name is a MUST that the author
> was not confident enough to write. A SHOULD that nothing would ever
> satisfy is a MAY. Both are worth catching before publication, because
> an implementer reading either has to guess at an intent that was never
> formed.

---

# 2.2 Informative Text

_Standards and Conventions / Conventions / Normative Language_

> Why everything in a specification is normative unless marked otherwise, how to mark informative text, what it must not contain, and what it is for.

All text in a specification is normative unless it is explicitly marked
otherwise. Informative text is the exception, and it is marked so that a
reader never has to guess which kind of statement they are reading.

## 2.2.1 Marking

Informative text MUST be marked, using a note callout:

```markdown
> [!NOTE]
> This paragraph gives context and defines no behavior.
```

An inline aside introduced by "For example" or "Note:" is also
informative.

[Core Style](/psc/style/core-style.md) treats a note as an occasional aside. In a specification the
note callout also marks text as informative and carries the reasoning
behind a rule, which is a deliberate departure from Core Style (§1.1).

## 2.2.2 Limits on informative text

Informative text MUST NOT contain an RFC 2119 keyword used in its
normative sense. Where a note needs to refer to required behavior, it
MUST cite the normative statement that defines it rather than restating
it.

> [!NOTE]
> The restriction exists because a requirement stated twice is a
> requirement that can drift. When a note paraphrases a rule and the
> rule later changes, the note becomes a second, contradictory
> specification that a reader has no way to rank against the first.

## 2.2.3 What informative text is for

Rationale, worked examples, the attack a rule defends against, and the
alternative that was considered and rejected.

A specification SHOULD carry that material rather than omit it. A rule
whose reason is unrecorded is a rule that a later revision will remove
as redundant, or preserve for the wrong reason — and a wrong reason is
what the revision after that will reason from.

---

# 2.3 Pseudocode

_Standards and Conventions / Conventions / Normative Language_

> Why pseudocode in a specification is normative, and the symbols, operators, and comment syntax it is written in across the corpus.

A specification that includes pseudocode MUST document its conventions
in its conventions article (§3.1).

The conventions in this table are established across the corpus and
SHOULD be used, so that a reader moving between books does not have to
relearn the notation:

| Symbol | Meaning |
|---|---|
| `&` (parameter prefix) | In-out parameter: the caller's value is read and might be modified |
| `\|` | Bitwise OR |
| `&` (in an expression) | Bitwise AND |
| `~` | Bitwise NOT |
| `\|=`, `&=` | Augmented assignment |
| `=` | Assignment |
| `==` | Equality comparison |
| `->` | Field access through a pointer or reference |
| `→` | Return type in a signature |
| `//` | Single-line comment |

Pseudocode MUST appear in a fenced code block.

A specification MAY use further conventions — `and`, `or`, and `not`
for boolean operators, or named error returns — and MUST document any
it uses.

## 2.3.1 Pseudocode is normative

Pseudocode in a specification is a normative statement like any other,
and MUST be read as one. It is not an illustration of a rule stated
elsewhere; where it is meant as illustration, it belongs in a note
(§2.2).

> [!NOTE]
> This matters most for algorithms with an ordering that the prose does
> not make explicit. Two rules that can both fire on one input need a
> stated order, and pseudocode is often where that order actually lives.

---

# 3.1 Required Articles

_Standards and Conventions / Conventions / Specification Structure_

> The articles a specification book and each of its chapters open and close with, how terminology delegates, and what a scope article's exclusions must name.

A specification book and each of its chapters carry a fixed opening and
closing shape, so that a reader arriving at any chapter finds the same
things in the same places.

## 3.1.1 Book level

A book MUST open with an introduction chapter containing:

| Article | Purpose |
|---|---|
| Scope | What the book covers and what it does not, with each exclusion naming the document that does cover it |
| Conventions | The book's RFC 2119 declaration and any notation specific to it (§3.3) |

## 3.1.2 Chapter level

A chapter specifying a protocol or a format MUST open with:

| Article | Purpose |
|---|---|
| Scope and Roles | What the chapter specifies, and the roles that speak it (§3.2) |
| Terminology | Terms specific to the chapter |

and SHOULD close with an Extension article (§3.4) and a Conformance
article (§3.4), in that order, before any appendices.

A chapter defining a data structure rather than a protocol has no roles
and no conformance obligations of its own, and is exempt from both.

## 3.1.3 Terminology delegates rather than repeats

A terminology article MUST define the terms the chapter introduces. A
term already defined elsewhere in the corpus MUST be delegated by
reference rather than redefined:

```markdown
Terms defined in §5.2 (package, manifest, payload, and repository) are
used here with the same meaning and are not redefined.
```

<!-- lint-disable spelling -->
> [!NOTE]
> A redefinition is a second definition, and two definitions of one term
> drift. Delegation costs the reader one click and costs the corpus
> nothing.
<!-- lint-enable spelling -->

## 3.1.4 Scope names its exclusions

A scope article's exclusion list MUST identify, for each excluded item,
which document covers it. An exclusion that names nothing tells a reader
the subject is out of scope without telling them where to go, which is
the least useful thing a scope article can do.

---

# 3.2 Roles

_Standards and Conventions / Conventions / Specification Structure_

> How a multi-party specification names its roles, states every requirement against a role rather than a program, and organizes conformance by role.

A specification with more than one party MUST name its roles in its
scope article, and MUST state every requirement against a role rather
than against a program.

A role is a position in an interaction, not a piece of software. One
program frequently occupies several. A repository operator is usually
also a package producer, and a daemon that answers one protocol might
consume another.

## 3.2.1 Why the distinction is load-bearing

Naming a program in a requirement makes the requirement untestable
against anything else, which defeats the purpose of writing the
specification down. The whole reason a contract is published is that
somebody other than the current implementation might satisfy it.

## 3.2.2 Enumerating roles

A chapter's scope article SHOULD present its roles as a table giving,
for each, the obligation it carries:

| Role | Obligation |
|---|---|
| Producer | Builds the artifact. Everything the artifact contains is a producer obligation. |
| Consumer | Validates and applies it. Every validation and rejection rule binds the consumer. |

Two or three roles is typical. A specification finding itself with six
has probably merged two interactions that want separate chapters.

## 3.2.3 Conformance follows the roles

Because requirements attach to roles, a conformance article (§3.4)
states what each role must do, separately. A reader implementing one
side needs to know which requirements are theirs without reading the
other side's.

---

# 3.3 Data Conventions

_Standards and Conventions / Conventions / Specification Structure_

> The data conventions every specification book inherits, covering byte order, sizes, layout tables, notation, strings, hashes, and timestamps.

The conventions in this article hold across every specification book. A
book MUST NOT restate them, and MUST state any point on which it differs.

## 3.3.1 Byte order

All multi-byte integer fields are little-endian unless explicitly stated
otherwise.

## 3.3.2 Sizes

All sizes and offsets are in bytes. `u8`, `u16`, `u32`, and `u64` denote
unsigned integers of 8, 16, 32, and 64 bits.

## 3.3.3 Layout tables

A field layout is given as a table in declaration order. A layout table
is normative: fields appear on the wire in the order listed, with no
padding between them.

## 3.3.4 Notation

Hexadecimal values carry the `0x` prefix. Byte sequences are written as
space-separated lowercase hex pairs, `0a 0b 0c`, the form hex dump tools
print. Lowercase here is a deliberate departure from the uppercase
hexadecimal of [Core Style](/psc/style/core-style.md) (§1.1).

## 3.3.5 Strings

Strings are UTF-8 (RFC 3629). String comparison is byte-for-byte
equality unless stated otherwise.

## 3.3.6 Hashes and signatures

Hash values are lowercase hexadecimal unless stated otherwise, matching
the form hashing tools print and files carry, and hash algorithms are
named by their IANA-registered identifiers.

## 3.3.7 Timestamps

Timestamps are RFC 3339, in UTC, and end with `Z`.

## 3.3.8 What a book's conventions article carries

Because these conventions are shared, a book's conventions article
(§3.1) is short. It MUST carry the book's RFC 2119 declaration, and
SHOULD carry only:

- Notation the book introduces that this article does not list
- Any point on which the book departs from this article
- Pseudocode conventions, if the book uses pseudocode (§2.3)

> [!NOTE]
> A conventions chapter copied into each of four books does not stay
> identical. Duplicated text is where contradictions breed, and the
> contradiction is invisible because nobody reads two copies of the
> same thing side by side.

---

# 3.4 Extension and Conformance

_Standards and Conventions / Conventions / Specification Structure_

> How a format or protocol chapter states the ways it can grow, and how its closing conformance article summarizes each role's obligations and freedoms.

A format or protocol chapter closes with two articles: one saying how
the thing it specifies can grow, and one summarizing what conformance
requires of each role.

## 3.4.1 Extension

A chapter specifying a wire format, a file format, or a protocol SHOULD
close with an extension article stating how the thing can grow.

An extension article SHOULD distinguish three kinds of change:

- **Additive changes.** Changes an implementation of the current version
  can ignore safely, such as a new optional field or a new entry in an
  open-ended set.
- **Changes requiring a version bump.** Changes it cannot ignore, such
  as a new required field, a new value in a closed enumeration, or any
  change to an algorithm the format has frozen.
- **Reserved space.** Room the format deliberately leaves, and what an
  implementation does when it encounters a value there.

A specification MUST state, for every enumeration it defines, whether
that enumeration is closed. An implementation cannot decide whether to
ignore or reject an unknown value without being told.

> [!NOTE]
> The test for whether a change is additive is not whether it is small.
> It is whether an implementation that ignores it still behaves
> correctly. An optional field whose absence changes what gets
> installed is not additive, however optional it looks.

## 3.4.2 Conformance

A chapter SHOULD close with a conformance article summarizing, per role
(§3.2), what that role must do. The article is a summary and MUST NOT
introduce a requirement stated nowhere else.

A conformance article SHOULD also state plainly what conformance does
not require. A reader who has been given a list of obligations
benefits more from knowing where their freedom lies than from a longer
list.

> [!NOTE]
> The useful shape has two halves: what an implementation must agree on
> with everybody else, and everything it is free to do differently. A
> specification that never says the second half reads as though it
> constrains the whole implementation, and implementers respond by
> over-constraining themselves or by ignoring it.

---

# 4.1 What a TRM Is

_Standards and Conventions / Conventions / Technical Reference Manuals_

> What a technical reference manual is, why each component gets one book, where its authority comes from, and what belongs in one.

A **technical reference manual** (TRM) is an exhaustive descriptive
reference for one component: what it does, how it behaves at every
edge, and what happens when it fails.

The hardware analogy is deliberate. If the specification books are the
architecture reference manual, a TRM is the per-implementation technical
reference manual that sits beside them — the document that says what
one particular thing actually does, given that the architecture says
what any conforming thing must do.

## 4.1.1 One book per component

A TRM covers one component, where the boundary is drawn by what ships
and is maintained together rather than by subject matter. Several
subsystems that live in one codebase and version together are chapters
of one manual, not manuals of their own.

## 4.1.2 Its authority comes from the software

This is the property that governs everything else in this chapter. A
specification is authoritative over its implementations: where the two
disagree, the implementation has a defect. A TRM is the reverse. Where a
manual and the software disagree, the software is right and the manual
is stale.

A TRM therefore makes no stability commitment. Nothing in one is a
promise about a future version, and a reader who needs a promise needs a
specification instead.

## 4.1.3 What belongs in one

Everything about the component that is true and not documented
elsewhere: its architecture, its state, how it uses its configuration,
its algorithms where they are its own, its failure modes, its on-disk
artifacts, and the reasoning behind its design decisions.

A manual SHOULD carry rationale generously. It is the only document in
the corpus with room for it, and a component's design decisions are
otherwise recorded only in the history of the work that produced them.

## 4.1.4 What does not belong

Anything a third party must reproduce to interoperate. That is
a contract, and a contract belongs in a specification (§1.2). A manual
cites it (§4.6) rather than restating it.

Registry keys and values belong to regman, and events and their fields
to evman. A manual links to their pages rather than tabulating them
(§6.2).

---

# 4.2 Voice

_Standards and Conventions / Conventions / Technical Reference Manuals_

> Why a technical reference manual describes and never requires, covering normative keywords, the indicative mood, lowercase keyword hazards, and register.

A technical reference manual (TRM) describes what a component does. Its
voice follows from that: it never states a requirement, in any form.

## 4.2.1 No normative keywords

A TRM MUST NOT use RFC 2119 keywords, either in uppercase or in the
lowercase constructions that read as obligation.

This is the one rule in this chapter with no exceptions, because it is
what makes the class a class. A manual describes; it does not require.
A reader must be able to tell, from the first paragraph of any document
in this corpus, whether they are being told what something does or what
they must do.

## 4.2.2 The indicative mood

Write what the component does.

| Not this | This |
|---|---|
| The daemon MUST reject a malformed request | The daemon rejects a malformed request |
| A client SHOULD retry after a timeout | A client that times out can retry |
| The cache MAY be discarded | The cache can be discarded at any time |
| Callers must hold the lock | Callers hold the lock |

<!-- lint-disable-next-line spelling -->
The third and fourth rows are the ones that catch people. "May" and
"must" survive into descriptive prose readily, because an author
describing something real slips into obligation without noticing,
particularly when the source material was a specification.

## 4.2.3 Lowercase keywords are the actual hazard

Uppercase keywords are trivially caught by searching. Lowercase ones are
not, and they are far more common: a conversion from specification prose
typically leaves more than 10.

<!-- lint-disable spelling -->
An author SHOULD search a finished manual for lowercase `must`,
`should`, `shall`, `may`, and `must not`, and rewrite every instance
that reads as a requirement. Every `may` is rewritten, because
[Core Style](/psc/style/core-style.md) allows no lowercase "may" in prose. Idiomatic uses of the others
survive, such as "what the content should be," and the test is whether
a reader could mistake the sentence for an obligation.
<!-- lint-enable spelling -->

> [!NOTE]
> A validator that flags documents for lacking normative keywords is
> useless here, and worse than useless if it is trusted: for a manual
> the signal is inverted. The check has to be run deliberately and in
> the opposite direction.

## 4.2.4 Register

A manual is plain declarative prose for a competent engineer, neither
tutorial nor chatty. It describes the component and does not address
the reader as "you." A manual SHOULD assume its reader knows the
platform and wants the specifics.

---

# 4.3 Structure

_Standards and Conventions / Conventions / Technical Reference Manuals_

> Guidance on how a manual is shaped, covering the introduction, body chapters, a failure-modes chapter, appendices, and exhaustiveness.

A technical reference manual's (TRM's) chapter structure follows the
component rather than a template. The conventions in this article are
what has worked, offered as guidance.

## 4.3.1 The introduction

A manual SHOULD open with an introduction containing:

| Article | Purpose |
|---|---|
| Overview | What the component is, and what is unusual about it |
| What This Manual Covers | And what is covered elsewhere, naming where |
| Terminology | Terms specific to the component, delegating the rest |
| Compatibility | Versions, architectures, and what interoperates |

The overview article is the most valuable page in the book and the one
most often written last and least. It SHOULD say what is surprising
about the component — the two or three decisions that would not be
guessed from the name — rather than restating the component's purpose in
a paragraph.

## 4.3.2 Body chapters

Body chapters are ordered so that a reader following the component's
own flow reads them in order: what it is made of, then what it does, in
the sequence it does it.

## 4.3.3 A failure-modes chapter

A manual SHOULD close with a chapter describing what goes wrong: the
common failures, what each looks like from outside, what signal is
available, and how to get back to a known state.

This is the chapter readers arrive at from a search engine in the middle
of an incident, and it is the one most often omitted. A manual that
documents every success path and no failure path has documented the
easy half.

## 4.3.4 Appendices

Appendices hold consolidated reference material, such as constants,
paths, and on-disk state (§6.1). Registry keys and events are not
tabulated in a manual; it links to their regman and evman pages (§6.2).

## 4.3.5 Length is not a virtue, but exhaustiveness is

A manual SHOULD document the edge cases. The odd interaction, the
counter-intuitive default, the thing that happens only when two features
meet — those are why the manual exists. A summary of the happy path is
already in the component's README.

---

# 4.4 Describing the True State

_Standards and Conventions / Conventions / Technical Reference Manuals_

> Why a manual describes what the component does now, without narrating its divergences from a specification and without writing around them.

A technical reference manual (TRM) describes what the component does
now. This has a consequence that authors reliably find uncomfortable,
and it is worth stating directly.

## 4.4.1 Divergences are not narrated

A TRM MUST NOT frame anything as a difference between itself and a
specification. No "the specification requires X but the implementation
does Y," anywhere, in any form.

Where an implementation does not satisfy a contract, that is a defect.
It is recorded as one, in the project tracker, against the work that
would fix it — and the manual describes what the software does.

> [!NOTE]
> The reason is that a manual written as a divergence log rots into a
> second changelog nobody maintains, and undermines itself while doing
> it: a reader who is told the document is describing something wrong
> stops trusting the parts that are describing something right.
>
> It is also the wrong audience. The person who needs to know about a
> divergence is whoever will fix it, and they are looking at the
> tracker, not at a reference manual.

## 4.4.2 Which does not mean writing around it

Describing the true state is not the same as being vague about it. A
manual SHOULD state plainly what a component does not do, where a
reader would otherwise assume it did:

> peipkg does not check free space before it starts. Exhaustion is
> discovered when a write fails.

That sentence is descriptive, useful, and carries no comparison to any
contract. The distinction is between what is absent, which a reader
needs, and what was promised, which belongs in the tracker.

## 4.4.3 Interim states

Where behavior is deliberately provisional, a manual MAY say so and
describe the intended end state, provided it describes the current one
first and at greater length. A manual SHOULD NOT let a description of an
intention displace the description of what actually runs.

Describing an intended end state, marked as such, is a deliberate
exception to the rule in [Core Style](/psc/style/core-style.md) against writing
about time (§1.1). It applies only to behavior the component's own
design marks as provisional, and the marking is what keeps the
description from going stale silently.

---

# 4.5 Proposals

_Standards and Conventions / Conventions / Technical Reference Manuals_

> Why a manual can be written for software that does not exist yet, how such a proposal identifies itself, how it graduates in place, and how to review one.

A **technical reference manual proposal** is a technical reference
manual (TRM) for a component that does not exist yet.

It is written exactly as a TRM is written (in the indicative mood, with
no normative keywords, and exhaustively) and it describes software that
has not been built.

## 4.5.1 Why the class exists

A design that has been written out at reference-manual depth is a design
whose gaps are visible. Every field, limit, and interaction has to be
decided before it can be described, and describing it is how the
contradictions surface.

## 4.5.2 Saying what it is

A proposal MUST identify itself as one. It SHOULD do so in two places:
in its description, and in an opening article stating plainly that a
manual's authority comes from the software (§4.1) and that this one has
none of that yet — so a surprising statement in it is a design decision
that has not been tested against an implementation.

The document class carries that warning by itself, which is why no
banner on every page is needed.

## 4.5.3 It graduates in place

A proposal sits alongside the finished manuals and MUST NOT be moved
when the software lands. Moving it breaks every inbound link.
Graduating consists of correcting it against the implementation and
dropping the word "proposal."

## 4.5.4 Reviewing one

A proposal cannot be verified against code, so review is internal
composition instead: for each field, rule, limit, and configured value,
find every other place the document constrains it, and compose them by
hand.

The failure to look for is two rules that are individually right and
jointly wrong — a default stated in one chapter and a validity
constraint stated in another, which together reject the default. The
related one is two rules with no stated order, where both can fire on
one input and the document never says which runs first.

Composing every pair of independently configured size limits on one data
path, at their default values, is worth doing every time. A ceiling on
one side larger than the ceiling on the other is a common result, and
it lets one party accept what the other cannot carry.

A proposal MAY still contribute a specification chapter, where the
component owes one. Publishing a contract with no implementation to keep
it honest is a real cost, and it is a decision to take deliberately
rather than by default.

---

# 4.6 Citing a Specification

_Standards and Conventions / Conventions / Technical Reference Manuals_

> Why a manual cites the contract it implements rather than paraphrasing it, and how it adds the order, limits, and choices that only an implementation has.

Where a component implements a published contract, its manual cites the
contract rather than restating it.

## 4.6.1 Cite, do not paraphrase

A manual SHOULD state that the contract exists, name where it is, and
describe what the implementation it documents does about it:

> A dependency is satisfied by a candidate when the conditions of
> PSPU §5.21 hold. Three consequences of those rules shape how
> peipkg behaves.

A manual MUST NOT restate the contract's normative content in
descriptive prose. A paraphrase is a second copy that drifts, and
because the paraphrase carries no normative keywords, a reader cannot
tell which of the two they are supposed to rely on.

## 4.6.2 What the manual adds

A manual adds the nuances of one implementation: the order it does
things in, the limits it applies, what it does where the contract leaves
a choice, and what it does not implement.

A manual is the right place to say that a component is more restrictive
than the contract requires, or that it makes a choice the contract
leaves open. Those are facts about the software, not comparisons against
it.

## 4.6.3 Where the split falls

The recurring question is whether a given fact belongs in the manual or
in the specification, and the test in §1.2 answers it: if a second
independently written party must reproduce it, it is contract.

Worked, from one component: what satisfies a dependency is contract;
which of several satisfying candidates gets chosen is implementation.
The schema of a declaration is contract; the command-line flag that
overrides it is implementation. The layout of an artifact is contract;
where the tool keeps its own database is implementation.

> [!NOTE]
> The most reliable way to settle a borderline case is to read the
> target specification's own scope article. It states what that book
> excludes, and it has overturned a placement more often than any
> argument from first principles.

---

# 4.7 Citing a Manual

_Standards and Conventions / Conventions / Technical Reference Manuals_

> When a specification is allowed to defer to a manual, how the deferral must read, and the Kernel Access Control Subsystem as the standing case.

§4.6 covers the ordinary direction: a manual cites the contract it
implements. The reverse direction needs a rule of its own, because a
specification that defers to a manual has given something up, and a
reader is entitled to know that it did.

## 4.7.1 When it is allowed

A specification MAY cite a manual for material it deliberately does not
specify. It MUST NOT cite one for material within its own scope.

The test of §1.2 decides which case applies. If a second, independently
written party must reproduce the behavior, it is contract, and a
citation to a manual there is a specification failing at its job: the
other party has no manual for their own implementation. If no
second party is expected to reproduce it, because the component is
Peios' alone and is described rather than standardized, then the manual
is the only document that holds the material, and naming it beats
implying a standard exists somewhere.

## 4.7.2 Say that it is a deferral

A specification citing a manual MUST make the deferral legible rather
than let it read as an ordinary cross-reference. "Described in the
Peios Kernel TRM §3.8" says what it is; "see §3.8" does not.

Where a scope article excludes a whole area to a manual, it SHOULD say
why once, in that article, rather than re-arguing it at each citation
site. The sites then only need to name the article.

## 4.7.3 The standing case

The Kernel Access Control Subsystem (KACS) is the case that recurs.
Peios' access-control implementation is described in the Peios Kernel
TRM §3 and is not separately specified. PCDS, which specifies the
structures KACS consumes, therefore defers to that manual wherever a
structure's meaning depends on what KACS does with it. PCDS §1.1
records the arrangement; the individual citations name the articles.

> [!NOTE]
> This is not license to let a specification thin out over time. Each
> deferral is a decision that a given area will not be standardized,
> and the scope article is where that decision is visible. A citation
> to a manual appearing anywhere else, without a scope article behind
> it, is a defect.

---

# 4.8 Anchoring Testable Statements

_Standards and Conventions / Conventions / Technical Reference Manuals_

> Why named citations are the only handle a manual can offer a test suite, where an anchor goes, what deserves one, and why anchoring comes after the prose.

A specification's testable statements are already findable: they carry
RFC 2119 keywords, so `MUST` can be searched for and enumerated. A
manual has none, by the rule that defines the class (§4.2). Nothing in
its text distinguishes a behavioral claim from the prose around it.

A named citation (§5.3) is therefore not a convenience for a manual. It
is the only handle a manual can give a test suite, and the reason to
anchor one is usually that something outside the corpus needs to point
at it.

## 4.8.1 Anchor after writing, not during

An author SHOULD write a manual, or a chapter of one, to completion
first, and add anchors in a separate pass afterward.

Marking anchors while drafting interrupts the writing for a decision
that has nothing to do with the sentence being written. Choosing which
statements are testable is also a different kind of attention from
composing them: it reads the finished text as an implementer would,
looking for what could be observed, and that reading is easier when the
text is finished.

A component's manual is usually written before its tests exist. The
anchoring pass is still worth running, because it is what tells the
test author where to start.

## 4.8.2 Put the anchor on the heading

By default an anchor goes on a section's heading, and a section gets
one. A manual that is well structured already devotes a section to a
behavior, so the section is the thing a test wants to cite, and the
heading is where the anchor belongs:

```markdown
### `ro` [*strata.ro-is-independent-of-filesystem]
```

An anchor on a heading rides the document's structure rather than one
sentence of prose. A sentence gets rewritten in the ordinary course of
keeping a manual true; a section is a more stable thing to have named,
and the anchor moves with it.

The exception is a section that states several distinct behaviors, most
often a table of error conditions or a numbered list of rules that each
hold independently. There the section is the wrong unit: one name for 14
rules tells a test suite no more than the article number did. Anchor
those individually, in the table row or list item that states each rule.

The test is not a count. It is whether a reader asking "which behavior
does this name?" could get more than one answer.

## 4.8.3 Choosing what to anchor

Anchor a statement that could be observed: a rule about what is
accepted or refused, a value, an ordering, a returned error, or an
invariant that holds while the component runs.

Do not anchor rationale, comparison with prior art, an account of how
the source is organized where no behavior follows from it, or a
restatement of something already anchored nearby. An anchor on prose
that no test could ever cite is worse than no anchor: it will be
counted as uncovered forever.

## 4.8.4 Anchor where the rule is defined, once

A manual states its important rules more than once: in the article that
defines a rule, in a summary of consequences, and in a table collecting
every error condition. Only the defining occurrence carries the anchor.

A second anchor on a restatement does not add coverage; it splits it.
Two names for one behavior means two entries in a report, one test
between them, and no way for a reader to tell which name the other tests
were meant to cite.

The signals that a passage is a restatement rather than a definition are
usually explicit: it closes with a `§` reference to the article that
owns the rule, or it sits under a heading that disclaims authority. Where
a section says the articles it summarizes remain authoritative, it
carries no anchors at all.

The mirror of this also has to be checked. A summary left unanchored is
correct only if the rules it summarizes are anchored where they are
defined. A table of error conditions whose rows appear nowhere else in
prose is the definition, however much it looks like a summary, and an
author SHOULD anchor its rows rather than leave the most testable
surface in the manual uncitable.

## 4.8.5 One anchor is not one test

Coverage against a manual asks whether a citation has at least one
passing test. It is not a mapping.

In a specification a normative statement is often close to a single
testable behavior. In a manual it frequently is not. An anchor is as
much a way of dividing a long descriptive document into pieces a test
suite can reason about as it is a single assertion, and several tests
can reasonably cite one name. An author SHOULD move toward one anchor
per behavior where the prose allows it, and SHOULD NOT contort the
prose to achieve it.

> [!NOTE]
> The count of anchors in a manual is not a measure of its quality, and
> a chapter with few is not deficient. Descriptive chapters, such as an
> overview or a discussion of the model, legitimately carry almost none,
> because almost nothing in them is a claim a test could check.

---

# 5.1 Section Addressing

_Standards and Conventions / Conventions / Citation and Addressing_

> The four forms of § reference, how each number derives from the book's own structure, and how stable the numbers are across revisions.

Any part of any book in this corpus is addressable with the `§` symbol
followed by a number derived from the book's structure, in one of four
forms:

| Form | Means | Example |
|---|---|---|
| `§N` | Chapter N | PSPU `§5` |
| `§N.M` | Article M of chapter N | PSPU `§5.23` |
| `§N.A` | Appendix A of chapter N | PSPU `§5.A` |
| `§A` | Appendix A of the book | the peipkg TRM `§A` |

The examples are qualified because a bare `§` reference means "this
book" (§5.2). Within this document, `§2.1` is the RFC 2119 article and
`§A` is the normative-reference list.

## 5.1.1 Where the numbers come from

Chapter and article numbers derive from the ordering of directories and
files, and are supplied by the renderer. An author does not write them
into the text.

A chapter appendix (a file whose name marks it as an appendix, within a
chapter directory) is lettered rather than numbered, and cited in the
form `§N.A`. A book-level appendix, at the book root, is rendered as
"Appendix A" and is cited by its letter alone, with no chapter component
at all.

The two are easy to confuse and produce silently wrong references. An
author adding a second appendix to a chapter SHOULD check the rendered
index before relying on the citation.

## 5.1.2 Stability

Section numbers are positional. Inserting a chapter shifts every later
chapter, and inserting an article shifts the rest of its chapter.

A book that other documents cite SHOULD therefore append rather than
insert, where the choice exists. Where a restructure is unavoidable,
every inbound reference has to be revalidated (§5.4).

---

# 5.2 Citing between Books

_Standards and Conventions / Conventions / Citation and Addressing_

> How to cite within a book, between books, a whole book, and from code, and why the reference, not the prose beside it, is the durable part.

A citation's form depends on where it is written and what it points at.
The `§` reference is the part that has to stay correct.

## 5.2.1 Within a book

A reference to another part of the same book omits the book name:

```markdown
The claim-path set is the union defined in §5.23.
```

## 5.2.2 Between books

A reference to another book leads with that book's short name:

```markdown
A dependency is satisfied when the conditions of PSPU §5.21 hold.
```

The short name is the one declared in the book's own metadata: `PCDS`,
`PGSS`, `PSPK`, or `PSPU`. A reference to a manual names the component:
`the peipkg TRM §7.4`.

## 5.2.3 Referring to a whole book

A reference to a whole book uses the short name alone:

```markdown
All identifiers in this chapter conform to PCDS.
```

## 5.2.4 Prose and the reference are different things

A citation MAY be accompanied by prose naming what is at the other end:

```markdown
Sender authentication is performed by peer credential (§4.18).

The descriptor store article (§4.20) defines the retention rules.
```

The `§` reference is the durable part. The prose is a readability aid,
and it MAY drift across revisions without invalidating the reference.
That is also why prose alone is not a citation.

## 5.2.5 In code and in commit messages

A code comment or a test referring to a documented rule SHOULD carry the
full citation, so that a search finds every site depending on it:

```c
/* Per PCDS §5.6: inherited ACEs precede explicit ones. */
```

Where the rule carries a named citation (§5.3), cite it by name
instead. It resolves to the statement rather than to the article
holding it, so a test says exactly what it verifies:

```rust
// Verifies PCDS *sd.inherited-aces-precede-explicit
```

> [!NOTE]
> This is the mechanism that makes a specification change tractable.
> When a rule moves, the citations show which code was relying on it.
> Prose references — "as the security descriptor spec says" — do not
> survive a grep.

---

# 5.3 Granularity

_Standards and Conventions / Conventions / Citation and Addressing_

> Why the article is the unit a § reference addresses, how a named citation reaches one statement inside it, and why clause numbering and statement extents are not used.

The finest unit a `§` reference addresses is the article, in the `§N.M`
form of §5.1. Headings within an article are not numbered, and there is
no `§` form that reaches inside one.

For prose that is the right size. A reader following a reference wants
the surrounding argument, not one sentence stripped of it.

It is the wrong size for a test. A test verifies one statement, and an
article holds many, so "this test covers §5.9" cannot say which of
§5.9's statements remain unverified. For that there is a second scheme,
addressing a statement by name.

## 5.3.1 Named citations

A document MAY anchor an individual statement with a name:

```markdown
A source MUST reject a relative identifier outside its declared
range. [*psi.rejects-out-of-range-relative-id]
```

A test or a code comment outside the corpus then cites the name by
qualifying it with the book's short name:

```rust
// Verifies PGSS *psi.rejects-out-of-range-relative-id
```

An anchor is a locator, not a delimiter. It marks a place; it does not
record where the statement it names begins or ends, and nothing computes
that. A reader follows the name and reads.

The builder enforces four rules:

- A name MUST be unique within its book. Citations from outside are
  qualified by the book's short name, so book scope is enough.
- A name MUST be lowercase, in dot- or hyphen-separated segments,
  beginning and ending with an alphanumeric.
- An anchor MUST appear only in a book. A citation is addressed through
  its book, so an anchor anywhere else could never be cited.
- An anchor MUST NOT appear inside a code block or inline code, where
  it is shown rather than declared.

A retired name MUST NOT be reused for a different statement. Nothing can
detect the reuse, and every citation that already existed silently comes
to mean something else.

## 5.3.2 Why not clause numbers

A finer `§` form is possible: clauses numbered implicitly by counting
normative statements within the deepest enclosing heading, cited as
`§3.2.1(4)`, with a validation rule for checking that a clause number
still resolves.

The corpus does not use it. Specified in detail for 13 Peios documents,
it was used 18 times. Its cost is real: every editorial change to an
article renumbers the clauses after it, so every citation into that
article has to be checked against a count that nothing computes.

A name is not a count. It is written once, it does not shift when a
statement is inserted before it, and the one change that breaks it —
deleting the statement — is exactly the change that ought to break it.
The failure that rules out clause numbering does not reach the named
form.

## 5.3.3 Why a name and not an extent

A name identifies a statement; it does not describe one. Naming a
statement `copy-up.preserves-ownership` says which statement is meant,
not what it says, and the name does not grow when the statement gains an
exception. This is the same division as §5.2's: the reference is the
durable part, and the prose around it can drift.

An author might be tempted to mark where a statement ends as well as
where it is. The corpus does not offer that, deliberately. A name is
arbitrary, so nobody disputes it and nobody revises it. An extent
appears to have a correct answer, so it invites both, and every revision
of one buys nothing for the test or the code comment that cites it.
Statements also overlap and nest in prose — a rule and its exception —
in ways no bracketing scheme resolves cleanly.

## 5.3.4 Writing for citability

Because the article is the unit a `§` reference reaches, an author
SHOULD size articles so that one is a sensible thing to point at. An
article covering one rule is easy to cite; an article covering nine
unrelated rules forces every citation to be approximate.

The same applies one level down. Where a paragraph holds several
statements that need separate names, an author SHOULD split the
paragraph rather than crowd it, since a paragraph is also the unit of
context a tool can report around an anchor.

Where a single statement needs picking out and no anchor exists, a
citation MAY name it in prose alongside the article reference:

```markdown
the duplicate-key rule of §5.9
```

## 5.3.5 Reading a clause citation

A `(N)` clause suffix, in a document or a code comment, refers to the
clause-numbering scheme the corpus does not use. It SHOULD be resolved
to an article reference, or to a named citation, when the surrounding
text is next touched.

---

# 5.4 Validation

_Standards and Conventions / Conventions / Citation and Addressing_

> Why a published book must contain no reference that fails to resolve, how to check one, what the builder checks, and the two traps that survive a careless check.

A published book MUST NOT contain a reference that does not resolve. A
reference to a chapter, article, or appendix that does not exist is an
error, not a cosmetic defect: it is indistinguishable, to a reader, from
a reference to something that was deleted.

## 5.4.1 Checking

Because section numbers are positional (§5.1), any structural change
invalidates references. That includes references from other books,
which the author making the change is least likely to be looking at.

After a structural change, an author SHOULD:

1. Build the affected books and extract the actual chapter and article
   numbering from the rendered index.
2. Collect every `§` reference in the corpus.
3. Check each against that numbering.

These three steps are mechanical and worth automating. What is not
mechanical is whether a reference that still resolves still means what
the citing text implies. A reference to "the ordering rules of PSPU
`§5.6`" resolves happily after that article is rewritten to cover
something else.

> [!NOTE]
> The failure this catches is specific and common: an article count
> changes by one, every reference past that point is off by one, and
> every one of them still resolves — to the wrong article. Nothing
> reports an error, and the document is wrong in a way that reads as
> correct.

## 5.4.2 Named citations are checked by the builder

Unlike `§` references, named citations (§5.3) are validated by the
builder: a duplicated name, a malformed one, or an anchor outside a book
fails the build. What the builder cannot check is the other direction:
whether a citation from outside the corpus, in a test or a code comment,
still names a statement that exists. Deleting an anchor is therefore a
deliberate act. Search for the name across the repositories that cite
it before removing it.

## 5.4.3 Two traps

Two traps survive a careless check:

- **Line-wrapped references.** A citation split across a line break,
  with the book's short name at the end of one line and the `§` number
  at the start of the next, is easy for a checker to miss and easy for
  an author to introduce.
- **Appendix forms.** A chapter appendix and a book appendix take
  different forms (§5.1), and a reference using the wrong one resolves
  to nothing — or worse, to something.

---

# 6.1 Appendices

_Standards and Conventions / Conventions / Shared Style_

> What earns an appendix, why an appendix and the body must not duplicate each other, and how generated appendices are handled.

An appendix consolidates reference material that is defined in the body:
constants, limits, enumerated values, paths, and wire vocabularies.
Registry keys and events are not consolidated here, because regman and
evman own them (§6.2).

## 6.1.1 Appendices and the body do not duplicate

Where a constant, table, or layout is defined in an appendix, the body
MUST reference it rather than restate it. Where it is defined in the
body, the appendix MUST reference the body instead.

Exactly one of the two is the definition. The other points at it.

> [!NOTE]
> A value written down twice is a value that will eventually be written
> down differently. The appendix is where this bites hardest, because
> an appendix is exactly the kind of page that gets updated in isolation
> by someone who has not read the body — or skipped entirely by someone
> who has.

An appendix entry SHOULD carry a citation to the article that defines
what it lists, so that a reader who needs the semantics can get there in
one step.

## 6.1.2 What earns an appendix

An appendix earns its place with material a reader looks up rather than
reads through: something they arrive at knowing what they want.

A limits appendix is the clearest case. Every size bound, count cap, and
default in one table is genuinely more useful than the same figures
scattered across 20 articles, and the body articles then cite it
rather than repeating the number.

## 6.1.3 Generated appendices

An appendix listing values that exist in source, such as an application
binary interface (ABI) table, a constants list, or an error
enumeration, SHOULD be generated from that source rather than
transcribed, with a check mode that fails when the committed file is
stale.

> [!NOTE]
> The argument is empirical. In one case, a hand-written ABI appendix
> had every numeric value correct and a systematic error in the names.
> Transcription reproduces a wrong name faithfully and produces offsets
> nobody can cheaply re-check; generation cannot.

---

# 6.2 Tables and Enumerations

_Standards and Conventions / Conventions / Shared Style_

> Why every exhaustive table has exactly one home, how subsets are labeled, how disagreeing copies are resolved, and the formatting rules tables need beyond Core Style.

A table that exists in two places will eventually disagree with itself.
The rules in this article keep each exhaustive table in one place and
make every other copy visibly partial.

## 6.2.1 One canonical home

Every exhaustive table or enumeration lives in exactly one place.
Everywhere else that needs it gets a clearly framed subset and a
reference to the canonical one.

This applies across the whole corpus, not within a single book: a table
in a specification is not re-tabulated in a manual.

It also applies across the forms of Peios documentation. Registry
configuration is documented by regman, which owns it, and events by
evman. A technical reference manual does not have a configuration
reference of its own. It links to the regman and evman pages rather than
tabulating keys, values, events, or fields (see
[regman and evman](/psc/style/regman-and-evman.md)).

## 6.2.2 Subsets are labeled as subsets

A partial table MUST be framed as partial. A reader who cannot tell a
subset from the full set will treat the subset as exhaustive, which is
how a table that was correct becomes a document that is wrong.

## 6.2.3 Disagreeing copies are never averaged

Where two copies of a table disagree, the resolution is to check the
source (the implementation, or the specification that defines it) and
then to delete one of the copies. Splitting the difference produces a
third value that matches nothing.

## 6.2.4 Layout tables

A table describing a binary layout is normative in a specification
(§3.3) and descriptive in a manual, and in both cases gives fields in
declaration order.

## 6.2.5 Formatting

[Core Style](/psc/style/core-style.md) covers header rows, empty cells, and
cell length. Tables in this corpus add two rules.

A table row MUST NOT contain an unescaped `|`. A pipe inside a cell —
common when documenting bitwise expressions — silently eats a column,
and the resulting table renders as though it always had one fewer.

Very wide tables SHOULD be broken up or transposed. A table that needs
horizontal scrolling is a table nobody reads the right-hand end of.

---

# 6.3 Notes

_Standards and Conventions / Conventions / Shared Style_

> What a note carries that the surrounding text cannot, namely the reasoning behind a rule, what a note must not be used for, and how often to use one.

A note carries what the surrounding text cannot: why the rule is the way
it is, what it defends against, and what was tried instead. It is
written as a note callout:

```markdown
> [!NOTE]
> Text.
```

In a specification a note is informative and is bound by §2.2. In a
manual, where nothing is normative, a note is a change of register
rather than of authority.

This is a wider job than [Core Style](/psc/style/core-style.md) gives a note, which is an
occasional aside. The departure is deliberate (§1.1): rationale is what
keeps a rule from being removed or misread in a later revision, and the
callout keeps it visibly separate from the rule itself. Core Style's
other admonition rules still apply, including never placing two in a
row.

## 6.3.1 What a good note does

A good note does at least one of three things:

- **Names the failure the rule prevents.** Concretely, with the
  mechanism. "Without this, an attacker who controls a cache edge
  replays an older signed index and the consumer never notices" is worth
  10 lines of abstract rationale.
- **Records the alternative that was rejected, and why.** The next
  person to look at the design will otherwise propose it again.
- **Flags the counter-intuitive.** Where a reader's first instinct is
  wrong, a note is where to say so.

## 6.3.2 What a note is not

A note is never any of these:

- A restatement, in different words, of the rule it accompanies
- A place to hide a requirement (§2.2)
- An apology for a design

## 6.3.3 Density

Roughly one note per two or three articles is what has worked. A book
with a note under every heading has diluted the marker to the point
where readers skip them, which wastes the ones that matter.

---

# 6.4 Formatting

_Standards and Conventions / Conventions / Shared Style_

> What specifications and technical reference manuals add to Core Style's formatting rules, covering frontmatter without a type, descriptions that name specifics, headings, the strict build, and spelling.

[Core Style](/psc/style/core-style.md) sets the formatting rules every form of
Peios documentation shares, including line length, frontmatter titles,
heading levels and case, code formatting, and text hygiene. This article
records only what specifications and technical reference manuals add.

## 6.4.1 Frontmatter

Every article carries YAML frontmatter with a `title` and a
`description`:

```yaml
---
title: Freshness and Rollback Protection
description: Why an index that verifies is not necessarily current, and
  the monotonic versions, staleness limits, and defenses against rollback
  and freeze that address it.
---
```

The description is one sentence, wrapped at 78 columns with each
continuation line indented by two spaces.

An article in a specification or a manual is an article in a book, so it
carries no `type:` field. Core Style's page types apply to topics, and
the document class (§1.2) does the job for a book.

The description SHOULD name the specific things. "Monotonic versions,
staleness limits" beats "the freshness rules," because a corpus this
size has many articles called Overview, Structure, and Conventions, and
the description is what tells them apart.

The site build takes `--strict`, which fails on any article missing a
description; run it that way.

## 6.4.2 Headings

Because headings are not addressable (§5.3), they are navigation rather
than citation targets, and they SHOULD read as scannable labels.

## 6.4.3 Spelling

US English, as Core Style sets out. Identifiers, code, and the names of
external standards are reproduced exactly as their source spells them.

---

# 6.5 Naming External Constants

_Standards and Conventions / Conventions / Shared Style_

> Why each document uses its own reader's vocabulary for externally named constants, how divergences are tabulated once per book, and how structures are distinguished from the constants that select them.

Much of what this corpus documents already has names, given by an
external standard, by a published header, or by both, spelled
differently. A reader arrives holding one of those names and expects to
find it.

## 6.5.1 Each document uses its own reader's vocabulary

A specification is written for an implementer who has the external
standard and does not have this implementation's source. It uses the
external standard's spelling, exactly as that standard spells it.

A technical reference manual is written for someone reading alongside
the implementation. It uses the implementation's spelling, exactly as
the header declares it.

Neither adopts the other's vocabulary. A specification that named
private headers would be documenting something its reader cannot see,
and a manual that named only the standard would not match the code in
front of the reader.

## 6.5.2 Divergences are recorded once per book

Where the two vocabularies disagree, the disagreement is stated once, in
a table in an appendix, and not repeated at every use. Inline
double-naming makes prose unreadable to both audiences at once.

The table gives both spellings and nothing else. It is a lookup, not an
explanation.

## 6.5.3 Where a standard names a structure and its constant separately

Many standards give one name to a structure and another to the constant
that selects it: a record type and the numeric tag identifying that
record. A reader might arrive with either (one from a declaration, the
other from a hex dump), so a table that gives a value MUST name the
constant that carries it, not only the structure it selects.

Naming the structure in a column headed with the constant's value is the
common form of this mistake. It reads correctly and is unfindable by
half the people who need it.

## 6.5.4 The test

For any name a reader could plausibly arrive with, searching the corpus
for that exact string finds something. A name that appears only as
prose fails this test even though the surrounding text is correct. "The
offset to the owner security identifier (SID)," where the standard
calls the field `OffsetOwner`, is unfindable by the name a reader holds.

Correct and unfindable is the failure this rule exists to prevent.
Reference material is read by search.

---

# Appendix A Normative References

_Standards and Conventions / Conventions_

> The external standards this corpus depends on, and the citation format for referring to them.

This appendix lists the external standards this corpus depends on. A
book MUST NOT restate this list; it cites into it.

## A.1 Deferral

Where a document defers to an external standard, that standard's
requirements apply as though written out. A document citing one MUST
name the specific part it relies on where the whole would be ambiguous.

## A.2 Citation format

An external standard is cited in one of four forms:

| Form | Means |
|---|---|
| `RFC 2119` | The whole document |
| `RFC 8259 §7` | A specific section |
| `Unicode 16.0` | A version of a standard |
| `MS-DTYP §2.4.2` | A section of a Microsoft Open Specification |

## A.3 IETF

The corpus cites these Internet Engineering Task Force (IETF)
documents:

| Reference | Title | Used for |
|---|---|---|
| RFC 2119 | Key words for use in RFCs | Normative keywords (§2.1) |
| RFC 3339 | Date and Time on the Internet | Timestamps (§3.3) |
| RFC 3629 | UTF-8 | String encoding (§3.3) |
| RFC 3986 | Uniform Resource Identifier | URL syntax |
| RFC 4648 | Base16, Base32, Base64 Encodings | Base64, §4 alphabet |
| RFC 7468 | Textual Encodings of PKIX Structures | PEM key files |
| RFC 8032 | EdDSA | Ed25519 signing and verification |
| RFC 8259 | JSON | JSON documents |
| RFC 8478 | Zstandard | Compression |
| RFC 8915 | Network Time Security | Authenticated time |

## A.4 Microsoft Open Specifications

The Windows security model is the design source for several Peios
subsystems, and its documents are cited for parity mappings.

| Identifier | Title |
|---|---|
| MS-DTYP | Windows Data Types |
| MS-ERREF | Windows Error Codes |
| MS-LSAD | Local Security Authority (Domain Policy) Remote Protocol |
| MS-SAMR | Security Account Manager Remote Protocol |
| MS-ADTS | Active Directory Technical Specification |
| MS-GPOL | Group Policy: Core Protocol |
| MS-GPREG | Group Policy: Registry Extension Encoding |

## A.5 Unicode

The corpus cites the Unicode Standard for text handling:

<!-- lint-disable serial-comma -->
| Reference | Used for |
|---|---|
| Unicode 16.0 | Normalization forms, case folding |
| `CaseFolding.txt`, status `S` and `C` entries | Case-insensitive comparison |
<!-- lint-enable serial-comma -->

## A.6 POSIX and other standards

The corpus also cites these standards and specifications:

| Reference | Used for |
|---|---|
| IEEE Std 1003.1-2017, Chapter 14 | The pax interchange format |
| MessagePack specification | Event payload encoding |
| SPDX License List | License identifiers |

## A.7 External conventions

Some documents describe interoperation with conventions that have no
formal specification, such as the `sd_notify` readiness protocol and
the freedesktop `os-release` file. Where a document relies on
one, it MUST describe the behavior it depends on rather than citing the
convention alone, because there is no normative text at the other end of
the citation.
