# Style

---

# Core Style

_Standards and Conventions / Style_

> The writing rules every form of Peios documentation shares, covering voice, word choice, spelling, capitalization, punctuation, numbers, formatting, page structure, procedures, and code examples.

These rules apply to every form of Peios documentation: learn, man pages,
command-line help, regman, evman, technical reference manuals, and
specifications. Each form has its own page that adds to them or adjusts
them, and where a form's page disagrees with this one, the form's page wins
for that form:

- [Learn](/psc/style/learn.md)
- [Man Pages](/psc/style/man-pages.md)
- [Command-Line Help and Errors](/psc/style/command-line-help-and-errors.md)
- [regman and evman](/psc/style/regman-and-evman.md)
- Specifications and technical reference manuals:
  [Conventions for Specifications and TRMs](/psc/conventions.md)

This page is the canonical source. If a rule is not written here or on a
form's page, it is not a Peios rule. When something comes up that no rule
covers, choose the clearest option for the reader and propose a rule.

## Voice and tone

**Be direct.** Say what something does, or what to do, in as few words as
possible. Lead with the point; put background after it, or link to it.

- Do: "Run `svctl restart netd` to apply the change."
- Don't: "In order to apply the change, it will be necessary to restart the
  netd service, which can be done using svctl."

**Use active voice.** Name who or what does the thing. Use passive voice
only when the actor is unknown or truly does not matter.

- Do: "The kernel rejects the request."
- Don't: "The request is rejected."

**Use present tense.** Documentation describes what the system does now.

- Do: "netd reads the configuration at startup."
- Don't: "netd will read the configuration at startup."

**Use the imperative for instructions.** Start the sentence with the verb.

- Do: "Open the Registry Editor."
- Don't: "You should open the Registry Editor." or "Please open the Registry
  Editor."

**Address the reader as "you"** in learn and in man page prose where a
person is the subject. Specifications and technical reference manuals
describe the system and do not address the reader; see their form pages.

**Don't use "we", "our", or "us".** The documentation speaks for Peios, not
for a team. Give recommendations directly.

- Do: "Use a group, not individual accounts, in the access control list."
- Don't: "We recommend using a group."

**Don't write about time.** Avoid "new", "now", "currently", "recently",
"soon", "in a future release", and "no longer". They go stale silently. When a
change in behavior matters to the reader, state the version it applies to.

**Don't condescend.** Avoid "simply", "just", "easily", "obviously", "of
course", and "it's easy to". If a step is not simple for the reader, the word
is wrong; if it is, the word is unnecessary.

**No humor, idioms, or cultural references.** They do not translate and they
date quickly.

- Do: "This setting has no effect until netd restarts."
- Don't: "This setting is a bit of a damp squib until netd restarts."

**Use contractions where they read naturally** in learn and man page prose:
"don't", "isn't", "you're". Don't use them in specifications or technical
reference manuals, and never contract a negative in a sentence that states a
requirement or a warning: "Do not remove the key", not "Don't remove the key".

## Sentences and paragraphs

**Keep sentences short.** Aim for under 25 words. Split a sentence that
carries two ideas into two sentences.

**Keep paragraphs short.** One idea per paragraph; three or four sentences is
usually enough. A paragraph that needs a fifth sentence often wants to be a
list.

**Put the condition before the instruction.** The reader should know whether
a sentence applies to them before they act on it.

- Do: "If the service is running, stop it first."
- Don't: "Stop the service first if it is running."

**Keep "that" when it helps the reader parse the sentence.** "Check that the
key exists", not "Check the key exists".

**Make every pronoun unambiguous.** If "it" or "this" could refer to two
things, name the thing.

- Do: "The token carries the user's SID. The kernel compares the SID with
  each access control entry."
- Don't: "The token carries the user's SID. It compares it with each entry."

**Avoid noun stacks.** Break up chains of three or more nouns.

- Do: "the cache for registry layer metadata"
- Don't: "the registry layer metadata cache"

**Avoid "there is" and "there are" openings.** Start with the subject.

- Do: "Three layers apply to every key."
- Don't: "There are three layers that apply to every key."

## Spelling and word choice

**Use US English spelling**: "behavior", "color", "initialize", "license"
(noun and verb), "canceled", "catalog". Identifiers, quoted output, and names
of external standards keep their own spelling.

**Prefer the short, common word.**

| Use | Instead of |
|---|---|
| use | utilize, leverage |
| start | initiate, commence |
| end, stop | terminate (unless it is the literal name of an operation) |
| help | facilitate, assist |
| about | approximately, in regard to |
| to | in order to |
| if | in the event that |
| because | due to the fact that |
| can | is able to |
| need, must | is required to |
| enough | sufficient |

**Don't use Latin abbreviations.** Write the English.

| Use | Instead of |
|---|---|
| for example | e.g. |
| that is | i.e. |
| and so on (or end the list) | etc. |
| through, by using | via |
| compared with, or | vs. |
| namely | viz. |
| about (for dates) | circa, ca. |

**Use "can", "might", and "must" for their one meaning each.**

- "can" is ability: "You can grant the privilege to a group."
- "might" is possibility: "The request might time out."
- "must" is necessity: "The value must be a string."
- Don't use "may" in prose. It is ambiguous between permission and
  possibility. Specifications use **MAY** as a defined keyword; outside that
  use, write "can" or "might".

**Use "select" for choosing anything in a graphical interface**, whether by
mouse, keyboard, or touch. Don't use "click", "tap", "hit", or "press" for UI
elements. Use "press" only for keys on a keyboard.

**Use "enter" for typing a value into a field**, and "type" only when the
reader types characters that are not submitted.

**Use "turn on" and "turn off"** for toggles and features. Don't use
"enable" and "disable" in learn prose; keep them where they are the literal
name of an option, flag, or registry value.

**Spell out an acronym on first use on each page**, followed by the acronym
in parentheses: "security identifier (SID)". After that, use the acronym.
Acronyms every reader knows (CPU, URL, USB, HTTP) need no expansion.

**Choose "a" or "an" by pronunciation.** "a SID" (said as a word), "an ACL"
(said as letters), "an HTTP request". The [word list](/psc/style/word-list.md)
records the decided form for Peios terms.

**Pluralize acronyms without an apostrophe**: "SIDs", "ACLs", "PIDs".

**Use Peios terms as the word list defines them.** Where Peios uses a word
that means something different in Windows, Linux, or elsewhere, the
[word list](/psc/style/word-list.md) is the authority.

## Inclusive language

**Use "they" for a person of unknown gender**, including the singular.
Better still, address the reader as "you" or name a role: "the
administrator".

**Don't use terms with harmful associations** when a neutral term is equally
precise.

| Use | Instead of |
|---|---|
| allowlist, denylist | whitelist, blacklist |
| primary, replica | master, slave |
| main | master (branch) |
| placeholder, sample value | dummy value |
| confidence check, quick check | sanity check |
| stop responding | hang (of a program, in prose) |

A literal identifier keeps its literal name. If an upstream command, flag, or
field uses one of these words, write it exactly as it is, in code
formatting.

**Don't refer to ability or disability unless it is the subject.** "Turn on
the screen reader", not "for blind users, turn on the screen reader", unless
the page is about accessibility.

## Capitalization

**Titles use title case.** A title is the name of a page, topic, shelf,
anthology, book, product, or chapter, wherever it is set: frontmatter
`title:`, a `trail.toml` `title`, or a man page `NAME` header. Capitalize the
first and last words and every major word. Lowercase these unless they are
the first or last word:

- articles: a, an, the
- coordinating conjunctions: and, but, or, nor, for, so, yet
- prepositions of any length: to, of, in, on, at, by, for, from, with,
  about, between, through, without
- "to" in infinitives and "as" in any role

So: "Developing for Peios", "Writing Policy for the Network Firewall", "What
an Event Is".

**Headings within a page use sentence case.** Capitalize the first word and
proper nouns only.

- Do: "## Choosing a registry layer"
- Don't: "## Choosing a Registry Layer"

**Lowercase common nouns, even important ones.** "access token", "security
descriptor", "registry key", "service". Capitalize product and component
names: "Peios", "GXWI", "Registry Editor" (the application). Components
whose names are written in lowercase keep it, even at the start of a
sentence: "netd", "peinit", "regman". Rephrase if that reads badly.

**Write identifiers exactly as they are.** Code formatting keeps the case:
`svctl`, `Machine\System\KMES`, `KACS_ACCESS_DENIED`.

**After a colon, lowercase the next word** unless it is a proper noun or
begins a complete sentence.

**Expanded acronyms are lowercase** unless the expansion is a proper noun:
"access control list (ACL)", not "Access Control List (ACL)".

## Punctuation

**Use the serial (Oxford) comma**: "users, groups, and services".

**Use em dashes sparingly, with a space on each side**:
"the kernel — not the service — makes the decision". Prefer commas,
parentheses, or a second sentence. Never
use more than one pair in a sentence. Write the em dash as the character
`—`, not as `--`.

**Use an en dash for ranges in tables and compact contexts**: "0–65535",
"pages 4–9". In running prose, write "from 0 through 65535".

**Use hyphens for compound modifiers before a noun**: "a read-only key", but
"the key is read only". Don't hyphenate after an adverb ending in "-ly": "a
widely used flag".

**Put commas and periods inside closing quotation marks** in prose. Text the
reader types or sees literally goes in code formatting, not quotation marks,
so its punctuation is never in doubt.

**Don't use exclamation points.**

**Don't use "and/or".** Write "A, B, or both".

**Don't use the ampersand** in prose or titles, except in a literal name.

**Use semicolons sparingly.** Usually a period is clearer.

**End list items with a period only when they are complete sentences.** In a
single list, either every item is a sentence or none is.

**Use one space after a period.**

**Use straight quotes and apostrophes** (`"` and `'`), not typographic ones.
Use a normal space and a normal hyphen, and no zero-width characters. They
render the same and search differently.

## Numbers and units

**In prose, spell out zero through nine and use numerals for 10 and above.**
Exceptions, which always take numerals:

- any technical quantity: sizes, counts in a specification, limits, ports,
  versions, offsets, durations ("3 seconds", "a 2-byte field")
- anything with a unit or symbol ("4 KiB", "5%")
- any number in a table, list of values, step, or code example
- a number that sits next to another number in the same sentence ("between
  2 and 12 entries")

**Don't start a sentence with a numeral.** Rephrase or spell it out.

**Use commas in numbers of five or more digits** in prose: "65,535", but
"4096". Never in code, values, hexadecimal, or anything the reader types.

**Use IEC binary prefixes for binary quantities**: KiB, MiB, GiB, TiB. Use
KB, MB, and GB only for decimal quantities, such as disk capacity as sold or
network throughput. Put a space between the number and the unit: "64 KiB",
"100 ms". Percentages take no space: "5%".

**Write hexadecimal with a `0x` prefix and uppercase digits** in prose and
tables: `0x1F`, `0xC0000022`. Code examples follow the code's own style.

**Write dates as "October 15, 2026"** in prose. Use ISO 8601 (`2026-10-15`,
`2026-10-15T08:30:00Z`) in tables, frontmatter, logs, and anything machine
read. Don't write dates as `15/10/2026` or `10/15/2026`.

**Write times in 24-hour form with a time zone** where one matters: "14:30
UTC".

## Formatting text

**Use code formatting for anything literal**: commands, flags, file names
and paths, registry paths and value names, event and field names,
identifiers, data types, constants, environment variables, and values the
reader enters or sees.

- Do: "Set `LogLevel` under `Machine\System\Network` to `3`."
- Don't: "Set LogLevel under Machine\System\Network to 3."

Code spans are not prose. Don't translate them, inflect them, or split them:
`size_installed`, not "size installed" or "`size_installed`s". Write "the
`--force` flag", "each `Precedence` value".

**Use bold for UI elements the reader acts on**, written exactly as they
appear: "Select **Apply**." Bold also marks the term being defined in a
definition list. Use it sparingly for anything else.

**Use italics only for a placeholder in prose** ("replace *name* with the
service's name") and for the titles of external books. Don't use italics
for emphasis; restructure the sentence instead.

**Write keyboard keys with a capital and join combinations with `+`**:
<kbd>Ctrl</kbd>+<kbd>C</kbd>, <kbd>Enter</kbd>, <kbd>Super</kbd>.

**Write placeholders in code as `<name>`**: lowercase, hyphenated, in angle
brackets: `svctl status <service-name>`. Explain each placeholder directly
after the example that uses it. Optional parts go in square brackets:
`[--verbose]`.

## Links

**Make the link text say where it goes.** The text should make sense read
on its own, as screen readers present it.

- Do: "Check the term in the [word list](/psc/style/word-list.md)."
- Don't: "To check the term, [click here](/psc/style/word-list.md)."

**Use `~` page references for links within the site**, never a pasted URL.
Trail checks them at build time.

**Link the first useful mention on a page**, not every mention.

**Don't use bare URLs in prose.** Give the link a name.

**Don't refer to position.** Avoid "above", "below", "the previous section",
and "the following". Name or link the thing instead: "the table of exit
statuses". The one exception is a sentence that directly introduces a list,
table, example, or set of steps.

## Page structure

**Every article has frontmatter with `title` and `description`.** Articles
in topics also carry `type`.

- `title` names the subject in title case. "Registry Layers", not "How
  Registry Layers Work" or "About Layers".
- `description` is one sentence saying what is on the page, naming the
  specific things it covers. It is what search results and link previews
  show. Don't restate the title.
- `type` is `concept` (explains how something works or why), `how-to`
  (walks through a task), or `reference` (lists facts to look up). Choose the
  one that describes most of the page; if a page is evenly two types, split
  it.

**Start with the point.** The first paragraph says what the page is about
and why the reader cares. Don't open with a heading; the title is already
there. Don't repeat the title as a heading.

**Use `##` for top-level headings and don't skip levels.** Use `###` only
under a `##`, and avoid `####`; a page that needs it should be split.

**Make headings short and specific.** No end punctuation, no code-only
headings unless the page is a reference to that identifier. Don't put two
headings in a row with no text between them.

**Wrap prose at 78 columns** in the source. Tables, code blocks, and lines
dominated by a link are exempt. A one-word change then produces a one-line
diff.

## Lists

**Use a bulleted list for items in no particular order** and a numbered
list for a sequence or a ranking.

**Introduce every list** with a sentence or fragment ending in a colon.

**Keep items parallel.** Every item starts with the same part of speech:
all verbs, all nouns, all complete sentences.

**Capitalize the first word of every item.**

**Keep lists short.** Two to seven items. A list with one item is a
sentence; a list with more than seven usually wants grouping, a table, or
subheadings.

**Use a list with bold lead-ins** when each item needs a label and a short
explanation:

- **Machine layer.** Settings that apply to every user.
- **User layer.** Settings that apply to one account.

## Tables

**Use a table when items share two or more attributes.** A list of names
with one description each is a list, not a table.

**Introduce every table** with a sentence.

**Give every table a header row.** Header cells use sentence case.

**Don't leave a cell empty.** Write "None", "Not applicable", or `—` (an em
dash alone means "none") and use that choice consistently within the table.

**Keep cells short.** If a cell needs more than one sentence, the content
probably belongs in prose with a heading.

## Procedures

**Number the steps of a procedure that has two or more steps.** A
single-step procedure is a sentence, not a list.

**Put prerequisites before the first step**, as a list headed by a short
sentence: "Before you start:" or a `## Before you start` heading.

**Write one action per step.** Two very short actions on the same screen
can share a step: "Select **Users**, then select **Add**."

**Say where before what.** "In the Registry Editor, select
**Machine**." The reader finds the place first, then acts.

**Start each step with the verb**, or with the location then the verb.

**State the result when it is not obvious**, as the last sentence of the
step or as a new step: "The service restarts and its status changes to
**Running**."

**Keep procedures to 10 steps or fewer.** Split a longer one into
procedures with their own headings.

**Put optional steps in the step itself**: "Optional: set a description."

## Code examples

**Every example works.** Copy it, run it, and it does what the text says.
Don't publish an example that has not been run against the version of
Peios the page describes.

**Tag every fenced block with its language**: `sh`, `c`, `rust`, `go`,
`toml`, `json`, and so on. Use `text` for output and for anything with no
language.

**Write shell commands without a prompt.** The copy button copies the whole
block, and a `$` breaks the pasted command.

```sh
svctl restart netd
```

**Put output in a separate `text` block** after the command, introduced by
a sentence such as "The output looks like this:".

**Show only what the example needs.** Cut unrelated lines and mark the cut
with a comment in the example's language.

**Use the placeholder rules in code**: `<service-name>`, never `foo`,
`bar`, or `example123`. Use realistic sample values where a placeholder
would make the example harder to follow, and use the reserved example
ranges: `example.com`, `192.0.2.0/24`, `2001:db8::/32`.

**Introduce every example** with a sentence saying what it does, and explain
anything non-obvious after it.

## Admonitions

Admonitions interrupt the reader. Use them only when the text would be
missed or misread without one, and never two in a row. Each type has one
job:

| Type | Use for |
|---|---|
| `> [!NOTE]` | An aside worth knowing that doesn't belong in the flow. |
| `> [!TIP]` | A better or faster way to do what the page describes. |
| `> [!IMPORTANT]` | Something a reader who skims will regret missing. |
| `> [!WARNING]` | Something that will go wrong if the reader ignores it. |
| `> [!CAUTION]` | Something that will go irreversibly wrong, such as data loss or lock-out. |

**State the consequence and the action.** "Removing this key locks every
account out of sign-in. Export the key before you change it."

**Don't use an admonition to hold ordinary content** that happens to be
important. If everything on a page is important, nothing is.

## Images and diagrams

**Use a diagram when a relationship is easier to see than to read**: a
flow, a hierarchy, a state machine. Don't use one to decorate.

**Give every image alt text** that says what it shows, not what it is:
"The token passes the DACL check, then the SACL check", not "Diagram".

**Don't use screenshots for anything the reader could copy.** Show commands,
output, and code as text.

**Crop screenshots to the relevant part of the window** and don't include
personal data.

## Sources

The rules on this page are based on the
[Microsoft Writing Style Guide](https://learn.microsoft.com/style-guide/welcome/)
and, for man page conventions, on
[man-pages(7)](https://man7.org/linux/man-pages/man7/man-pages.7.html).
They are restated here so that this page is the one place to look. Where
this page and either source differ, this page is correct for Peios.

---

# Word List

_Standards and Conventions / Style_

> How Peios documentation spells, capitalizes, and uses its own terms and common technical words, including logon and sign in, set up, back up, principal, token, and registry key, value, and layer.

This list records the decided form of words that Peios documentation uses
often or that are easy to get wrong. Where a term means something different
in Windows, Linux, or another project, the meaning here is the one Peios
documentation uses. Add to the list whenever a question about a word is
settled.

## Peios terms

| Term | Use | Notes |
|---|---|---|
| Peios | Peios | Not "PeiOS", "PEIOS", or "peios" in prose. |
| access control list | access control list (ACL) | "an ACL". |
| access token | access token, token | "token" alone once the context is clear. |
| principal | principal | Any entity that can be granted access: a user, a group, a service, or the machine. Not a synonym for "user". |
| registry key | key | A node in the registry tree. Not "folder". |
| registry value | value | A named, typed piece of data in a key. Not "entry" or "setting" when the value itself is meant. |
| registry layer | layer | One source of registry data that is merged with others. |
| discretionary access control list | discretionary access control list (DACL) | "a DACL". |
| logon frontend | logon frontend | A program a person signs in through, such as sshd or the console sign-in, which then asks authd for a logon. authd performs the logon; the frontend handles the sign-in. Not "login frontend". |
| logon | logon (noun and adjective) | The system creating a logon session and token for a principal: "logon session", "logon type", "logon SID", "each logon". A logon needs no sign-in; services and scheduled jobs get logons too. Not "login". There is no verb: the system "creates a logon", it does not "log the user on". |
| security descriptor | security descriptor (SD) | "an SD". |
| security identifier | security identifier (SID) | "a SID". |
| system access control list | system access control list (SACL) | "a SACL". |

## General terms

| Term | Use | Notes |
|---|---|---|
| afterwards, towards | afterward, toward | Also forward, backward, upward, and downward. No final "s". |
| back up, backup | back up (verb), backup (noun and adjective) | "Back up the key." "Restore the backup." |
| log in, login, log on | Don't use, except in literal names such as the `login` program. | Use "sign in" for providing credentials and "logon" for what the system creates. |
| set up, setup | set up (verb), setup (noun and adjective) | "Set up the network." "The setup program." |
| shut down, shutdown | shut down (verb), shutdown (noun and adjective) | |
| sign in, sign-in | sign in (verb), sign-in (noun and adjective) | Providing credentials to start a logon, by a person or a client acting for one: "Sign in to the desktop." "The sign-in screen." "An SSH client signs in with a key." A program using its own stored credentials does not sign in; it gets a logon. |
| sign out, sign-out | sign out (verb), sign-out (noun and adjective) | Not "log off" or "log out". |
| startup, start up | startup (noun and adjective), start (verb) | "At startup." "Start the service." Avoid "start up" as a verb. |
| file name | file name | Two words, except as a literal identifier. |
| home folder | home directory | Use "directory" for file system paths throughout. |
| command line | command line (noun), command-line (adjective) | |
| run, execute | run | "execute" only for the literal permission or operation. |

---

# Learn

_Standards and Conventions / Style_

> How to write learn pages, the educational form of Peios documentation, covering the three page types, titles, page openings, references to prior art, how-to structure, linking to the forms that own each fact, and when a page should be split.

Learn is the educational form of Peios documentation. It is what a reader
opens to understand something: how a part of Peios works, why it is built
that way, and how to get a task done with it. Everything in
[Core Style](/psc/style/core-style.md) applies; this page adds the rules specific to
learn.

## Who learn is for

Learn is written for a reader who is new to the subject, not new to
computers. Assume they can use a terminal and read a configuration file.
Don't assume they know any other operating system: every page has to make
sense to a reader who has used neither Windows nor Linux.

Address the reader as "you". Use contractions where they read naturally.
Explain the reason behind a rule or a design decision whenever the reader
would otherwise have to take it on trust.

## Learn explains; other forms own the facts

Learn is never the authority for an interface detail. When a learn page
touches a flag, a registry value, or an event, it says what the reader needs
for the task in hand and links to the form that owns the full detail:

- **Commands, files, system calls, and library functions:** the man page.
  Refer to it by name and section, as `svctl(8)`.
- **Registry keys and values:** the regman page. Give the path, as
  `Machine\System\Network`.
- **Events and fields:** the evman page. Give the event or field name, as
  `kacs.audit.access.checked`.
- **Shared protocols and formats:** the specification section.
- **How one component works inside:** its technical reference manual.

Show the one or two flags or values a task needs. Don't reproduce an option
table, a list of every value under a key, or every field of an event; those
go stale in the copy and stay correct in the original.

Don't use the specification keywords **MUST**, **SHOULD**, or **MAY** in
learn. A learn page that needs to state a requirement links to the
specification that makes it.

## Page types

Every learn article is one of three types, set in its `type:` frontmatter.
Choose the type before writing; a page that tries to be two types does
neither well.

| Type | Answers | Title form | Example title |
|---|---|---|---|
| `concept` | How does this work, and why? | Noun phrase naming the subject | Logon Sessions |
| `how-to` | How do I get this done? | Gerund phrase naming the task | Configuring Network Profiles |
| `reference` | What are the values or options? | Noun phrase naming the set | Logon Types |

### Concept pages

A concept page explains one idea. Start with what the thing is and why it
exists, in two or three sentences, before any detail.

Use a diagram when the idea is a flow, a hierarchy, or a set of states. Keep
procedures out of concept pages; link to the how-to page instead.

### How-to pages

A how-to page gets one task done. Use this structure:

1. **The goal.** One or two sentences saying what the reader will have
   achieved and when they would want to.
2. **Before you start.** Prerequisites as a list: required privileges,
   packages, and anything that must already be configured. Leave the
   section out if there are none.
3. **The steps.** A numbered procedure, following the procedure rules in
   Core Style. Use subheadings when the task has distinct stages, each with
   its own procedure.
4. **Check the result.** How the reader confirms it worked: a command and
   its expected output, or what they will see.
5. **See also.** Optional. Two to five related pages.

Write for the common case. Put variations after the main procedure under
their own headings, rather than branching inside the steps.

### Reference pages

A reference page in learn collects facts that support understanding: the
set of logon types, the well-known SIDs, and the privileges and what each one
allows. It is not an interface reference; that belongs to man, regman,
and evman.

Open with one paragraph saying what the set is and how it is used, then
present it as a table or a list with bold lead-ins. Sort entries in the
order a reader is most likely to look for them: alphabetical by default,
numeric where the values are numbers.

## Openings

The first paragraph of every learn page says what the page covers and why
the reader would care, in plain terms. It is the paragraph a reader uses to
decide whether they are on the right page.

- Do: "A security descriptor records who owns an object and who can do what
  to it. Every access check Peios makes reads one, so understanding them
  explains most access-denied errors you will meet."
  <!-- lint-disable-next-line spelling -->
- Don't: "In this article, we will discuss logon sessions."

## Prior art

The opening can orient the reader by pointing to something they have almost
certainly met: a Windows or Linux equivalent, or a Peios concept covered
elsewhere. One or two sentences are enough to say "this is like that", and
where the likeness stops if that would otherwise mislead.

- Do: "If you have used Windows, a security descriptor will be familiar:
  Peios uses the same model of an owner, a discretionary access control list,
  and a system access control list."

After the opening, the page stands alone. Explain Peios in its own terms,
and don't refer to other operating systems or alternative software again. A
reader who skipped the comparison, or never knew the system it names, has
to be able to follow everything that comes after it.

- Do: "A deny entry takes effect only if it comes before any entry that
  grants the same access."
- Don't: "As on Windows, a deny entry takes effect only if it comes before
  any entry that grants the same access."

Software that Peios ships or interoperates with is not prior art. A how-to
page about configuring sshd names sshd throughout.

## Size and splitting

Keep a page readable in about 10 minutes. Split a page when:

- it covers two ideas that a reader could want separately,
- a how-to has become two tasks, or
- it needs a heading deeper than `###`.

Give each topic a clear scope and order its articles so a reader can go
through them in sequence: concepts first, then how-to pages, then
reference.

## Links and related pages

Link the first useful mention of another Peios concept to its page. Use
`related:` frontmatter for two to four pages a reader is likely to want
next. End a page with a **See also** section only when the related pages
need a sentence of explanation each; otherwise `related:` is enough.

## Examples

Use realistic examples drawn from a real Peios system: real paths, real
service names, real output. Every command must work as written on the
version of Peios the page describes. When an example depends on earlier
state, such as a service being installed, say so in the text before it.

---

# Man Pages

_Standards and Conventions / Style_

> How to write Peios man pages, covering sections, the header and NAME lines, the required section order, roff formatting conventions, the CONFIGURATION, SECURITY, and EVENTS sections, API pages, and patching pages adopted from upstream.

Man pages are the thorough technical reference for everything a user,
administrator, or developer touches directly: commands, daemons, files,
system calls, and library functions. A man page records every flag, exit
status, file, environment variable, and error, including the edge cases
learn leaves out. [Core Style](/psc/style/core-style.md) applies to the prose; this page
adds the structure and formatting rules of the form.

## Where pages live

Each component keeps its man pages in its own repository, at
`man/<name>.<section>`, beside the code they describe. A change to the
behavior and the change to its page go in the same commit.

Pages are written in roff, using the `man(7)` macros (`.TH`, `.SH`, `.TP`,
`.B`, `.I`, `.BR`, and so on). Don't use the `mdoc(7)` macros.

## Sections

Put each page in the section that matches what it documents:

| Section | Contents |
|---|---|
| 1 | Commands any user can run |
| 2 | System calls, including Peios kernel interfaces |
| 3 | Library functions, including libpeios |
| 4 | Device and special files |
| 5 | File formats and configuration files |
| 7 | Overviews, conventions, and miscellaneous topics |
| 8 | Administration commands and daemons |

A command that only an administrator can usefully run goes in section 8,
even if any user can start it.

## The header and NAME lines

The `.TH` line gives the page name in uppercase, the section, the date of
the last change to the page's content in ISO 8601 form, and the source as
`Peios` followed by the package name and version:

```text
.TH NET 1 2026-09-14 "Peios netd 0.1.1"
```

Leave out the fifth argument; the formatter supplies the standard manual
title for the section.

The NAME section is one line: the name, an escaped dash, and a description
in lowercase with no final period. The description is what `apropos` and
`whatis` show, so make it specific.

```text
.SH NAME
net \- inspect and control the Peios network manager
```

## Section order

Use these sections, in this order, and only those that apply. Section
headings are in uppercase.

| Section | Required for | Contents |
|---|---|---|
| NAME | All | One line, as described in the header and NAME rules. |
| SYNOPSIS | All | Every form of invocation, or the declarations a program uses. |
| DESCRIPTION | All | What it is and what it does, starting with the common case. |
| COMMANDS | Commands with subcommands | Each subcommand, as a tagged paragraph. |
| OPTIONS | Commands with options | Every option, as a tagged paragraph. |
| CONFIGURATION | Programs that read the registry | The registry keys read, pointing to regman. |
| SECURITY | Anything that checks access | The rights, privileges, and descriptors involved. |
| EXIT STATUS | Sections 1 and 8 | Every exit status and what it means. |
| RETURN VALUE | Sections 2 and 3 | What the call returns on success and failure. |
| ERRORS | Sections 2 and 3 | Every error value and the condition that produces it. |
| ENVIRONMENT | Anything that reads environment variables | Every variable and its effect. |
| FILES | Anything that reads or writes files | Every path and what it holds. |
| SIGNALS | Daemons | Every signal handled and its effect. |
| EVENTS | Anything that emits events | The event types emitted, pointing to evman. |
| NOTES | Optional | Details that matter but fit nowhere else. |
| BUGS | Optional | Known defects that a user is likely to meet. |
| EXAMPLES | Commands beyond the trivial | Worked invocations with explanation. |
| SEE ALSO | All | Related pages. |

A page that needs a section not in this list can add one, placed where it
reads best. Keep its heading short and in the same style, such as
READINESS or MULTICALL NAMES.

## Writing the sections

**SYNOPSIS** shows syntax, not explanation. Literal text is bold, arguments
the reader replaces are italic, and optional parts are in square brackets.
Put each form of a command with subcommands on its own line.

**DESCRIPTION** opens with a sentence saying what the program does, with the
program's name as its subject: "**net** is the stateless operator client for
**netd**(8)." Describe behavior in the present tense. Address the reader as
"you" only where a sentence is about what the reader does.

**OPTIONS** documents every option. For each one, give:

- the short and long forms, and the argument it takes,
- what it does, including its default when not given,
- how it interacts with other options, and
- any right or privilege it needs.

Order options alphabetically by their long form, unless a different order
is clearer for the reader, such as grouping by purpose on a page with many
options.

**CONFIGURATION** names the registry keys the program reads and says what
they control as a whole. It doesn't document individual values; regman owns
those. End the section by pointing the reader there:
"Each value is documented in **regman**(1); run
**regman Machine\\System\\Network**."

**SECURITY** says what access the program checks, and against which security
descriptor: which rights each operation needs, which privileges change its
behavior, and what the default descriptor allows. Say also what the program
deliberately does not allow, when a reader coming from another system would
expect it.

**EXIT STATUS**, **RETURN VALUE**, and **ERRORS** list every value, each as a
tagged paragraph. Don't write "a non-zero value on failure" when the program
uses distinct values. A first-party program's exit statuses follow
[Command-Line Help and Errors](/psc/style/command-line-help-and-errors.md): 0 for
success, 1 for failure, 2 for a usage error, and 3 upward for anything more
specific.

**SYNOPSIS** and **OPTIONS** must agree with the program's `--help` output.
Change them in the same commit.

**EVENTS** lists the event types the program emits, one per line, and
points to **evman**(1) for their meaning and fields. Don't describe the
fields in the man page.

**EXAMPLES** gives each example as a command in bold, followed by a sentence
saying what it does and what to expect.

**SEE ALSO** lists related pages as `.BR name (section)`, separated by
commas, ordered by section number and then alphabetically, with no final
period. A relevant learn page can follow as a URL on its own line.

## Formatting conventions

roff has no code formatting, so the typeface rules differ from the rest of
Peios documentation:

| Bold (`.B`) | Italic (`.I`) |
|---|---|
| Command, program, and function names | Arguments and placeholders the reader replaces |
| Options and literal keywords | File and directory paths |
| Registry paths and value names | Titles of external documents |
| Event names, constants, rights, and privileges | |
| Environment variable names | |
| Literal input and output | |

Refer to another man page as the name in bold followed by the section in
parentheses: `.BR netd (8)`. Placeholders are italic words, such as
*interface*, not the `<name>` form used elsewhere.

Escape characters that roff treats specially:

- Write a hyphen-minus in an option or command as `\-`, so `--force` is
  `\-\-force`. A plain `-` can render as a hyphen that doesn't paste.
- Write a backslash as `\\`, so `Machine\System\Network` is
  `Machine\\System\\Network`.
- Start a line with `\&` when it would otherwise begin with a period or an
  apostrophe.

Start every sentence on a new line in the source. roff then spaces
sentences correctly, and a change to one sentence changes one line. This
replaces the 78-column wrapping rule for man page sources; still break a
sentence that runs past 78 columns at a natural phrase boundary.

Don't use admonitions, or tables built with `tbl` where a list of tagged
paragraphs would do. Avoid em dashes, because they render inconsistently in
terminals; where one is truly needed, write `\(em` with a space on each
side.

## API pages

Pages in sections 2 and 3 document programming interfaces.

- **One page per function**, or per group of functions that are always used
  together, such as a create and destroy pair. Give every function in a
  group its own NAME entry.
- **SYNOPSIS** shows the `#include` lines and full prototypes exactly as the
  header declares them.
- **DESCRIPTION** covers every argument, every flag value, ownership of
  memory and handles, and thread safety.
- **ERRORS** lists every error the call can return, with the condition that
  produces it. If the call can return errors the page does not list, the
  page is incomplete.
- Bindings for other languages, such as Rust or Go, document themselves with
  their language's own tools and point to the man page for the semantics.

## Pages adopted from upstream

Peios ships man pages from upstream projects, such as coreutils. Where Peios
behaves differently from upstream, the page is patched to describe Peios.
Peios does not ship a page it knows is inaccurate.

- **Correct, don't restyle.** Change only what is inaccurate for Peios.
  Leave upstream's wording, structure, and style alone, so the patch stays
  small and survives the next upstream update.
- **Describe Peios, not the difference.** Write the patched text as if the
  page had always described Peios. Don't add "On Peios, …" notes or a
  separate Peios section.
- **Keep the patch with the package.** The change lives in the package's
  patch series, beside any code patches, with a description saying what
  behavior it corrects.
- **Patch when the behavior changes.** A Peios change that makes an adopted
  page inaccurate includes the patch to that page.

Core Style's spelling and wording rules don't apply to upstream text you
leave unchanged. Text you add or replace follows them where it can do so
without reading oddly against the surrounding page.

---

# regman and evman

_Standards and Conventions / Style_

> How to write the prose in regman and evman records, covering summary lines for keys, values, events, and fields, what a body explains, header field wording, the markup each tool renders, and referring to other records without links.

regman and evman records document the registry and the event stream: every
key, value, event, and field. Each record is read in a terminal by someone
who has a specific path or event name in front of them and wants to know
what it means. [Core Style](/psc/style/core-style.md) applies to the prose; this
page adds the rules for writing it.

The file formats, the tools, and their lint checks are defined elsewhere:

- regman: [Writing regman pages](/peios/developing-for-peios/documenting-configuration/writing-regman-pages.md)
- evman: [Writing evman pages](/peios/developing-for-peios/documenting-events/writing-evman-pages.md)
  and PGSS §6.10, which defines the catalog normatively

## The first line is the summary

Each tool shows the first line or sentence of a record's body in its indexes
and search results, beside the name. Write it to stand on its own: someone
scanning a list of 50 values reads only this line. End it with a period.

The form of the summary depends on what the record documents:

| Record | Summary form | Example |
|---|---|---|
| Key | A noun phrase naming what the subtree holds | "Tuning parameters for the Exampled spooler." |
| Value | A noun phrase saying what the value is | "Maximum number of jobs held in the spool queue before new submissions are rejected." |
| Event | A past-tense sentence saying what happened | "A snapshot was written, or an attempt to write one failed." |
| Field | A noun phrase saying what the field holds | "The snapshot an event concerns, by the GUID the backup tool assigned it." |

Don't start a summary with the record's own name, or with "This value",
"This key", or "This event". The name is already printed beside it.

- Do: "Maximum number of jobs held in the spool queue."
- Don't: "MaxQueueDepth sets the maximum number of jobs in the queue."

## What the body explains

After the summary, explain what the reader needs to set the value or
interpret the event correctly:

- **For a value:** what changing it does, the trade-off involved, how it
  interacts with other values, and anything that makes a valid value a bad
  choice. Say why a limit exists when it is not obvious.
- **For a key:** the meaning shared by everything under it, such as how the
  owning component reads and validates the subtree, and where security is
  applied.
- **For an event:** when it is emitted and when it is not, what an operator
  would typically do on seeing it, and how it relates to other events.
- **For a field:** what the value means, its units, and when it is absent.

Don't describe the state of any particular machine. A record documents what
a value means and what it should be, never what it is set to now.

Don't record history. There is no "added in" or "previously"; the package
version records when a record changed.

When the meaning of each value of an enumeration is not obvious from its
name, document every value in the body as a list:

```text
- `full`: every file, regardless of earlier snapshots.
- `incremental`: files changed since the last snapshot of any kind.
```

In evman, the `values:` header line also lists the values. It says which
values exist; the body list says what each one means.

## Header fields

Header fields are shown verbatim in a fixed layout, so keep them short and
consistent.

- **`default`:** the exact value, as the reader would enter it. If there is
  no default, write `(required)` or say what absence means, in parentheses.
- **`valid`:** a short human-readable constraint. Write ranges with an en
  dash and no spaces (`16–65536`), sets with commas, and units in full after
  the number (`1–3600 seconds`).
- **`applies`:** exactly `live`, `restart`, or `reboot`. A short parenthetical
  is allowed when it helps: `live (at the next generation)`.

## Markup

Both tools render the same small set of Markdown: paragraphs, headings,
bullet lists, `**bold**`, and `` `code` ``. Prose is rewrapped to the
terminal width, so the source's line breaks within a paragraph don't show.

Use code formatting for every path, value name, event name, field name, and
literal value, as in any other form. Use bold sparingly, for the one warning
in a record that matters most. Don't use italics: both tools strip the
markers without styling the text, so the emphasis is lost.

## Referring to other records

Records are read in a terminal, so they cannot link. Refer to another
record by its full path or name in code formatting, and to a man page by name
and section. The reader can look up either directly.

<!-- lint-disable-next-line line-length -->
- Do: "The limit applies per interface; see `Machine\System\Network\Interfaces\<ifid> MaxRoutes`."
- Don't: "See the interface settings for the per-interface limit."

Document a key or event only in the package that owns it. When your
component reads another package's key, mention that key by path in your own
record's body; don't add a record for it.

## Wording

- Use the [word list](/psc/style/word-list.md) terms: a key holds values, a value
  has a type.
- Write "the value" or "the field", not "this setting", "this option", or
  "this parameter".
- Describe effects in the present tense, from the component's side: "netd
  rereads the key", not "the key will be reread".
- Write numbers as numerals, with units: "60 seconds", "4 KiB".

---

# Command-Line Help and Errors

_Standards and Conventions / Style_

> How first-party Peios programs print help, version, and error messages, covering the help layout, option descriptions, placeholders, the required flags, output streams, exit statuses, and the form of an error message.

Every first-party Peios program, from a command a user runs to a daemon,
prints help, its version, and error messages in the same way. Help is the
shortest form of Peios documentation: a reminder of what a program accepts,
printed by the program itself. [Core Style](/psc/style/core-style.md) applies to its
wording; this page adds the layout and the rules for output and exit
statuses.

These rules cover what a program writes to a terminal. Messages a daemon
logs are events, which evman documents, and this page doesn't cover them.

## Help summarizes the man page

The man page is the authority for a program's interface; help is a summary
of it. Help lists every command, argument, and option, with one line each,
and leaves explanation, examples, and edge cases to the man page.

Help and the man page must never disagree. Change both in the same commit.

Where the argument parser can generate help from its own definitions, as
clap can, let it. A program that writes its help by hand keeps one copy of
the text and builds any other usage message from it, so the two can't drift
apart.

## Layout

Help has these parts, in this order, separated by blank lines:

1. **Description.** One line: the description from the man page's NAME
   line, with its first letter capitalized and no final period.
2. **Usage.** `Usage:` followed by the program's invocation forms.
3. **Commands, arguments, and options.** One section each, for those that
   apply, headed `Commands:`, `Arguments:`, and `Options:`.
4. **Pointer.** One line saying where the full documentation is.

The help for a print spooler's control program looks like this:

```text
Inspect and control the Exampled print spooler

Usage: spoolctl [options] <command>

Commands:
  status            Show the spooler's state and queue length
  pause             Stop accepting new jobs
  resume            Start accepting jobs again
  cancel <job-id>   Cancel a queued or running job
  help [<command>]  Print help for spoolctl or one of its commands

Options:
  -j, --json        Print output as JSON
  -h, --help        Print help
  -V, --version     Print version

See spoolctl(8).
```

Indent entries by two spaces, and align the descriptions in a column at
least two spaces after the longest entry. Keep every line within 80
columns, or wrap to the terminal width when the parser does that.

## Usage lines

Write one usage form per line. When there are several, start the first on
the `Usage:` line and indent the rest to line up under it:

```text
Usage: spoolq list [--all]
       spoolq submit <file>
       spoolq cancel <job-id>
```

A program with many commands gives one general form, `<command>`, and lists
the commands in the `Commands:` section instead.

## Entries and descriptions

Write each description as a fragment that starts with a capital letter and
a verb in the imperative, with no final period: "Print output as JSON", not
"prints output as JSON." or "Output format". These are the same rules Core
Style gives for list items, and they match clap's own "Print help" and
"Print version".

Write placeholders in lowercase, in angle brackets, and hyphenated, as Core
Style requires: `<job-id>`, not `JOB_ID` or `<JOB-ID>`. Put optional parts
in square brackets. clap uppercases placeholders by default, so set the name
of each one explicitly.

Show the short and long forms of an option together, short first, and the
placeholder after the long form: `-f, --format <format>`. When an option
has a default, end its description with it in parentheses:
`Set the output format (default: text)`.

List commands and options in the same order as the man page, with `-h,
--help` and `-V, --version` last.

## Required flags

Every first-party program accepts these flags, including daemons:

| Flag | Prints | Stream | Exit status |
|---|---|---|---|
| `-h`, `--help` | The help | stdout | 0 |
| `-V`, `--version` | The program name and package version, such as `spoolctl 0.4.2` | stdout | 0 |

`-h` and `--help` print the same text. Don't give `--help` a longer version.

A program with commands also accepts `help` and `help <command>`, and
`<command> --help` prints the same text as `help <command>`. A command's help
follows the same layout, with a usage line for that command alone.

Running a program with commands and no arguments is a usage error, unless
the man page documents a default command.

## Error messages

Print every error to stderr, as one line in this form:

```text
<program>: <what went wrong>
```

Use the name the program was invoked as, without its directory. A
multicall binary uses the applet name.

Name the thing that failed before saying what went wrong, separated by a
colon, so the reader sees the object first:

```text
reg: Machine\System\Spooler: access denied
spoolctl: cancel 4127: no such job
```

- **Start in lowercase**, unless the first word is a proper noun or an
  identifier.
- **End without a period.**
- **Don't add a prefix** such as `Error:` or `error:`. The program name
  already marks the line as a message from the program.
- **Quote a value the reader supplied** with straight single quotes when it
  appears mid-message: `spoolctl: unknown command 'stauts'`. Don't quote it
  when it is the object at the start of the message.
- **Keep the system's own wording** for an error from the operating system,
  such as `No such file or directory`, so first-party messages match those
  of adopted tools. Don't add an error number such as `(os error 2)`.
- **Never print a debug representation**, such as Rust's `{:?}` output or a
  stack trace. A Rust `main` that returns `Result` prints `Error:` and the
  debug form, so handle the error and print the message instead.

When the reader can fix the problem and the fix isn't obvious, add one line
after the error, with no program-name prefix, saying what to do. Write it as
a sentence, ending in a period.

### Warnings

Print a warning to stderr as `<program>: warning: <message>`, following the
same rules. A warning doesn't change the exit status.

### Usage errors

A usage error is a problem with the arguments: an unknown option, a missing
argument, or a value of the wrong form. Print the error, then this line, to
stderr:

```text
spoolctl: unknown option '--jsno'
Try 'spoolctl --help' for more information.
```

Don't print the full help after a usage error; it pushes the error off the
screen. The one exception is running a program with commands and no
arguments, which prints the help to stderr in place of an error message.

Neither clap nor uucore prints usage errors in this form by default, so
render them yourself: use the error's kind and context to build the
message.

## Exit statuses

| Status | Meaning |
|---|---|
| 0 | Success, including printing help or the version |
| 1 | Failure |
| 2 | Usage error |

A program can define more specific failure statuses, from 3 upward, and
lists them in the man page's EXIT STATUS section. Don't use 2 for anything
but a usage error.

## The pointer line

End the help with a pointer to the full documentation:

- **A program installed on Peios** points to its man page: `See spoolctl(8).`
- **A tool that runs on a developer's machine**, such as pekit, points to its
  learn page by URL, because the man page might not be installed there.

Don't point to a path in a source repository. It doesn't exist on an
installed system.
