Type to search pages and rules.

Browse pages

Record Identifiers

Every record carries one identifier naming its type, home, and name.

Markdown8 rules

Intent#

Every record carries one identifier naming its type, home, and name. One form per type lets a reader find the record from the identifier alone, by reading or by searching.

Concepts#

Forms per record type#

TypeFormExample
productproduct/<name>product/clinic-booking
constraintconstraint/<name>constraint/clinic-data-retention-law
researchresearch/<name>research/late-fee-benchmarks
decisiondecision/<number>-<name>decision/0047-extend-loan-period
requirementrequirement/<topic>.<name>requirement/fees.flat-late-fee
problemproblem/<name>problem/overdue-books-block-holds
featurefeature/<name>feature/hold-queue
actoractor/<name>actor/borrower
rolerole/<name>role/librarian
permissionpermission/<name>permission/manage-hold
journeyjourney/<name>journey/borrow-a-book
modulemodule/<name>module/loans
business-recordbusiness-record/<module>.<name>business-record/loans.book-loan
rulerule/<home>.<name>rule/book-loan.only-an-active-loan-renews
use-caseuse-case/<module>.<name>use-case/loans.renew-loan
resultresult/<use-case-name>.<name>result/renew-loan.loan-not-active
casecase/<use-case-name>.<name>case/renew-loan.renewing-twice-is-refused
eventevent/<business-record-name>.<past-tense>event/book-loan.loan-renewed
entry-pointentry-point/<name>entry-point/admin
limitlimit/<name>limit/holds-per-borrower
runbookrunbook/<name>runbook/restore-a-backup
standardstandard/<home>.<name>standard/review.two-reviewers-per-change
exceptionexception/<name>exception/single-reviewer-hotfix
known-gapknown-gap/<name>known-gap/renewal-cases-unproved
termterm/<name>term/borrower

A rule home is a business record name or a module name. A project standard home is the rule page stem holding it.

Name rules#

A name follows these rules:

  • Write one to six lowercase words joined by hyphens.
  • Place digits inside a word, never as the whole name.
  • Count the decision number as a word.
  • Keep a use case name unique across the project.
  • Keep the negation in a rule name when its statement negates.
  • Let a person choose the name; no tool strips words into one.

Wire codes#

Wire codes are not identifiers and never change shape: failure codes such as failure/orders.not_found, audit action codes, and permission codes in code.

Resolution#

Every citation of an identifier resolves to a written record. Unresolved citations fail the check.

Shared provisions keep their published litespec/<page>#<slug> form.

Standards#

Follow the identifier form of each record type#

rulecheckable

Requirement A record identifier MUST follow the form its type row names.

Rationale One form per type lets a reader name the type and home from the identifier alone.

Example event/book-loan.loan-renewed names an event of the book loan record.

litespec/backend/identifiers#follow-the-identifier-form-of-each-record-type

Name records with one to six words#

rulecheckable

Requirement A name MUST carry one to six lowercase hyphenated words.

Rationale Short hyphenated names read aloud and stay stable across edits.

Example decision/0047-extend-loan-period counts its number as one word.

litespec/backend/identifiers#name-records-with-one-to-six-words

Keep use case names unique across the project#

rulecheckable

Requirement A use case name MUST be unique across the project.

Rationale Results and cases belong to the use case named in their identifier, so a duplicate leaves that home unclear.

litespec/backend/identifiers#keep-use-case-names-unique-across-the-project

Keep business record names unique across the project#

rulecheckable

Requirement A business record name MUST be unique across the project.

Rationale Rules and events take their home from the business record named in their identifier, so two records with one name leave that home unclear.

litespec/backend/identifiers#keep-business-record-names-unique-across-the-project

Keep negation in rule names#

rulecheckable

Requirement A rule name MUST keep the negation its statement makes.

Rationale A reviewer reads the name as a true sentence without opening the statement.

Example A statement with never keeps never in its name.

litespec/backend/identifiers#keep-negation-in-rule-names

Keep wire codes stable#

ruleguidance

Requirement A wire code MUST stay unchanged once clients read it.

Rationale Failure codes, audit action codes, and permission codes are not identifiers. Clients branch on their values, so a change breaks deployed readers.

litespec/backend/identifiers#keep-wire-codes-stable

Resolve every identifier citation#

rulecheckable

Requirement Every identifier citation MUST resolve to a written record.

Rationale A citation naming nothing leaves the reader with no page to open.

litespec/backend/identifiers#resolve-every-identifier-citation

Cite shared provisions in their published form#

rulecheckable

Requirement A shared provision citation MUST use its published identifier.

Rationale Shared provisions keep their published form while project records use the type forms above.

litespec/backend/identifiers#cite-shared-provisions-in-their-published-form

Conventions#

None.

Reference example#

This informative example demonstrates litespec/backend/identifiers#follow-the-identifier-form-of-each-record-type and litespec/backend/identifiers#name-records-with-one-to-six-words.

An ordering system names one module, one record, one rule, and one use case with its results.

Text
module/orders
business-record/orders.order
rule/order.only-paid-orders-ship
use-case/orders.place-order
result/place-order.order-placed
result/place-order.item-out-of-stock

Verification#

IDMarkEvidence
litespec/backend/identifiers#follow-the-identifier-form-of-each-record-typecheckablelitespec model check reports identifier-form.
litespec/backend/identifiers#name-records-with-one-to-six-wordscheckablelitespec model check reports identifier-form.
litespec/backend/identifiers#keep-use-case-names-unique-across-the-projectcheckablelitespec model check reports use-case-name-clash.
litespec/backend/identifiers#keep-business-record-names-unique-across-the-projectcheckablelitespec model check reports business-record-name-clash.
litespec/backend/identifiers#keep-negation-in-rule-namescheckablelitespec model check reports rule-name-negation.
litespec/backend/identifiers#keep-wire-codes-stableguidanceDo clients read the same code values as before?
litespec/backend/identifiers#resolve-every-identifier-citationcheckablelitespec model check reports reference-unresolved.
litespec/backend/identifiers#cite-shared-provisions-in-their-published-formcheckablelitespec validate emits no ID_UNKNOWN_REFERENCE diagnostic.