naming

Naming things in nife

What the tree's names mean, which conventions are rules, and which of those a machine checks.

This page states every naming rule in force, per §155 (the naming conventions move out of the constitution, and the note becomes the rule). Each appendix it links holds the reasons, the full lists and the prior art for one topic, and states no rule this page does not. Where this page and AGENTS.md disagree, this page is the rule and AGENTS.md is the bug. The headline rule is §39 (a component is named for what it is).

Who names things

An architect names the crates, the programs, the shared modules and the public functions. A name is global to the tree, so an architect, who can see the whole tree, decides it. In a capability system a name is often the only thing that says what a program may do.

A name is a claim

A name is a claim, made before a reader sees a line of code, and every reader of every call site reads it. Name a thing for what it is, in a word that parses without prior Unix exposure. Name against three failure modes:

Acronyms and abbreviations

Lists, exceptions and reasons: acronyms-and-abbreviations.md.

Units

A name that holds a quantity ends with its unit, spelled out: _HERTZ, _MILLISECONDS, _NANOSECONDS, _SECONDS, _BYTES, megabits_per_second. No SI symbol is valid in a name (_HZ, _MS, _NS, _US, mbps), because uppercase erases the case SI symbols depend on: MHZ could be megahertz or millihertz. The IEC binary prefixes (kib, mib, gib) are symbols too: a name says kibibytes, mebibytes or gibibytes. The symbols are the [units] list in the same file.

Registers and constants

Vocabulary

The tests behind each word, the stems kept, and examples: vocabulary.md.

Shapes

Functions that answer yes or no

A function that answers a question and changes nothing takes is_ (before an adjective, participle or noun phrase), has_ (before a thing held), can_ (before a verb), or a third-person verb phrase (contains, starts_with, allows). A bare adjective, participle or noun (enabled, pending, read_only) reads as a getter. Exempt: a function that acts and reports whether it worked (insert, push, claim, a take_), test functions, fields, a trait method or a name another project owns, and an extern symbol. Prior art and the hard cases: functions-that-answer-yes-or-no.md.

Command-line names

The jig verbs, their prior art and the builtins: command-line-names.md.

Crates

Reasons and what crates/ holds: crates.md.

Programs, scripts and directories

Domain Form
Crates, programs, modules snake_case
script/ and helpers/ entry points hyphens
Ordinary markdown (notes/, design/) hyphens
Repo-root markdown SCREAMING_SNAKE_CASE
A directory holding a Rust package exactly the package's name
Any other directory hyphens if it needs two words

Reasons: programs-scripts-and-directories.md.

Documents, numbers and branches

Reasons and the appendix file-name cases: documents-numbers-and-branches.md.

Rules a script can check

A revised rule lands with its check in helpers/name_checks.py. A new or renamed unratified name passes every check; an existing violator sits in a baseline that only shrinks, and lanes rename it, still provisional. A ratified name is exempt. The gates, the worklist and what no script can judge: rules-a-script-can-check.md.

Where a name's provenance lives

Every name carries its own Name: block at the name, in one of four states (provisional, unrecorded, recorded, ratified), with what was refused. A lane never writes ratified; the maintainer writes it in the commit that applies the name. script/names computes the table on demand and checks presence and form, never ratified. A rule that ratifies a class of names lives in convention-rulings.md, which script/names reads; a ruled name nobody renamed fails --check after 45 days. The forms and commands: provenance.md; what the record cannot see: provenance-limits.md.

Performing a ratified rename

Enumerate before sweeping, hold the refusal count, and let status decide what moves: a quotation and a closed record keep their names, and a path is fixed everywhere. The checklist and its incidents: rename-what-moves.md, rename-where-names-hide.md and rename-traps.md.

Appendices

naming/README.md indexes them.

BUGS