Commands
--card <kind>prints the card for the document type with that id, as JSON.--format markdownprints the readable card.--kindsprints the id, name, other names, purpose, users and timing of every document type, andoverview.coversandoverview.forfor each universe spec.--kindsalso prints each factor with its question and number of guidance notes. Use--kindsto see the document types and factors in a universe spec.- Targets work as for
--inspect: a.knowledge-bus/folder, one universe spec file, or explicit files. Without a target, the nearest.knowledge-bus/is used. - When the scope holds several universe specs, choose one for
--cardwith--universe <id>or target its file. Without--universe,--kindsprints one group per universe spec. - In a nested folder, the scope includes the universe specs listed under
from_parentin.knowledge-bus/workspace.yaml. See Nested Folders.
--card also checks every other universe spec in scope and its guidance file. Both commands skip marks files (*.explorer.yaml) and run no Explorer drawing checks, so a broken marks file never blocks a card. They write nothing.
Errors
An error is one JSON object on stderr with schemaknowledge-bus/inspection-error/1. The exit code is 1 and stdout is empty.
For an unknown document type,
candidates lists every document type id. For several universe specs with none chosen, candidates lists their ids. In a nested folder with ids under from_parent, the error also has from_parent, the list of those ids.
Card fields
The JSON card has schemaknowledge-bus/card/1. Every field is present in every card.
Readable wording
Conditions are printed in words:{ authority: [approve, statutory] }readsauthority is approve or statutory.- Several keys join with
and:time-separation is none and reversibility is reversible. - A facet reads
<id> <facet> is <values>:outcome form is creation or service. - An empty value list reads
no value.
Depends on: and, for each key, <question> (<id>), joined by semicolons. A frame with no question reads not stated in the universe spec (<id>). The card has no file to judge, so it never says whether a condition holds.
Section status
Guidance lines
- <Label>: <claim>- <Label>, when <condition>: <claim> Depends on: …
<Label> is the guidance entry’s kind, such as heuristic or convention, with its first letter capitalised.
Fallbacks
- A missing
action,actorortimingreadsnot stated in the universe spec. - An empty condition (
{}) on a section, a gate or a guidance entry reads as no condition. - An empty
disabled_whenreads- Not used: in every situation. - Quote
versionin the universe spec. An unquoted0.10is read as the number 0.1 and prints as0.1.
Layout
# <name>- The universe spec line.
- A list: other names,
Helps you,Who uses it,When it is used,Not used when,No document needed. ## How to write it well, only when the document type has guidance.## Sections, with### <name>for each section:Answers, the status line, the gate line, theKept in another documentline, then the section’s guidance.## How to present it, only whenpresentationholds a block: the lineFactors change presentation and focus only. The sections stay the same., then each block.## What the conditions mean, only when a named value has a question.
Presentation blocks
Guidance keyed to a factor is advice on presenting the document. A factor selects nothing, so the sections stay the same with or without a presentation block. The card lists every factor of each universe spec in scope that declares a factor, with the factor’s values and guidance, and never says which value applies. Example: the visit plan card.Document type list
The JSON list has schemaknowledge-bus/kinds/1: universe_spec as on the card plus covers and for; kinds, one entry per document type in declared order with kind, name, alias, action, actor and timing; and factors, one entry per factor in declared order with factor, name, question and guidance. guidance counts the entries under factors.<factor> in the guidance file and is null when the universe spec has no guidance file. covers and for copy universe.overview.covers and universe.overview.for with leading and trailing whitespace removed and each inner run of spaces and line breaks reduced to one space. actor and timing match the card’s enablement.actor and enablement.timing. covers, for, actor and timing are null when the universe spec gives no value.
With several universe specs and no --universe, the JSON list has schema knowledge-bus/kinds-set/1: universe_specs, one knowledge-bus/kinds/1 object per universe spec, and from_parent, the ids listed in workspace.yaml ([] without the file). The folder’s own universe specs come first, sorted by id, then the listed universe specs in from_parent order.
The readable list starts with # Document types, In the <label> universe spec (<id> <version>)., Covers: <covers> and For: <for>, then gives each document type as - <name> (<id>) with indented Also called or Its shape is set by an outside authority, Helps you, Who uses it and When it is used. After the document types, Factors: gives each factor as - <name> (<id>) with indented Asks: <question> and the number of guidance notes, such as 2 guidance notes or No guidance notes. The list leaves out the line for a null covers, for, actor or timing, the count line for a null guidance, and Factors: for a universe spec without factors.
With several universe specs, the readable list starts with # Document types, then gives each universe spec as ## <label> universe spec (<id> <version>) followed by its Covers and For lines and its document types. A heading for a universe spec listed in workspace.yaml ends with , from the parent folder. For a universe spec without document types, the group holds the line No document types. Example: a nested folder’s list.
Left off the card
- The rest of the universe spec: overview, terms, statuses, relations and other document types.
- Whether a condition holds.
- Guidance sources, citations and links.
- Codes on document types, sections, frames and factors.
- The number of answers per section, and whether a section’s answers can ever be complete.
Expected cards
Expected cards are inchecker/tests/cards/. Tests compare the output of kbp --card and kbp --kinds with the expected cards: JSON by value, Markdown byte for byte.
After a change to the card or to one of these universe specs, rewrite the expected cards and review the diff: