.knowledge-bus/ directory holds the definitions and supporting files for the folder that contains it. That containing folder can be a notes vault, document collection, project, or any other folder. This convention specifies where Knowledge Bus files live, not how to organize the surrounding files.
Directory contents
.knowledge-bus/ directory. Git is not required. Define the structure before creating documents, or derive it from existing material through ingestion. Answers and an ingest log are not prerequisites for authoring a universe.
Directory selection
Explicit targets take precedence. Pass the folder, its.knowledge-bus/ directory, or individual definition files:
.knowledge-bus/. It uses the first one found and does not combine definitions from different directories. Calls from inside .knowledge-bus/ use that directory. An empty or incomplete nearer directory does not fall back to a parent’s .knowledge-bus/. To use universe specs of the parent folder in a nested folder, list their ids in the nested folder’s workspace.yaml; see Nested Folders.
The checker reads the *.kbp.yaml files directly inside the selected .knowledge-bus/ directory together, to check guidance against its universe. The checker also reads workspace.yaml in that directory and, for each id under from_parent, the universe spec file and guidance in the parent folder. Duplicate universe ids fail. Answers, the ingest and evolve logs, presentation marks, and Explorer outputs are not checker inputs. Explicit file targets select exactly those files; include the universe when checking guidance.
Several universes in one scope
Several universes may be direct siblings in one.knowledge-bus/. Prefix filenames for people, but rely on semantic headers for identity and association:
universe.id identifies a universe. guidance.guides and marks.marks_for associate its companion files. When the directory contains several universes, inspection requires an id or universe file. Duplicate ids and ambiguous companion files fail. Generated Explorers stay under their universe ids. A nested .knowledge-bus/ stays separate unless its workspace.yaml lists universe specs of the parent folder.
A generic directory target without its own .knowledge-bus/ still scans for *.kbp.yaml files, for example a reference collection or test corpus. It skips metadata directories and nested folders that contain their own .knowledge-bus/. Directory scans do not follow nested directory symlinks.
Missing definitions are an error when checking. Checking never creates a .knowledge-bus/ directory.
Nested folders
A nested folder with its own.knowledge-bus/ stands alone by default. To apply universe specs of the parent folder inside a nested folder, list their ids under from_parent in the nested folder’s .knowledge-bus/workspace.yaml. The parent folder is the nearest folder above with its own .knowledge-bus/.
Example
A village hall keeps two universe specs inhall/.knowledge-bus/: Hall bookings and Hall upkeep. The management committee keeps Committee minutes in hall/committee/.knowledge-bus/. The committee also signs off hirer checklists, so Hall upkeep applies in hall/committee/ too.
hall/committee/.knowledge-bus/workspace.yaml:
kbp in hall/committee/ checks workspace.yaml, then Committee minutes, then Hall upkeep from the parent folder, one block per file. Output with the protocol block and the per-section lines cut:
kbp --kinds --format markdown in hall/committee/ prints one group per universe spec:
kbp --card hirer-checklist --universe hall-upkeep in hall/committee/ prints the same card as in hall/. --card, --inspect and --explore refuse without --universe and list the candidates:
hall/committee/.
The file
workspace.yamlholds settings for its folder.from_parentis the only key: a list of universe spec ids, each listed once. Other keys are refused.- Without
workspace.yaml, or withfrom_parent: [], no command reads the parent folder. - A listed id must be declared in the parent folder’s own universe spec files. Ids from the parent folder’s own
workspace.yamlare refused, so a nested folder can list only universe specs declared in the direct parent folder. - A universe spec in the nested folder can reuse the id of a universe spec in the parent folder when the id is absent from
from_parent. - In a folder holding only
workspace.yaml, the listed universe specs are the folder’s universe specs. - A factor-only universe spec can be listed like any other universe spec.
--kindsprints its group with “No document types.” and its factors.
Reading
- Every command reads
workspace.yamlwhen the command reads a whole.knowledge-bus/: with no target, a folder target, or a.knowledge-bus/target.--inspect,--explore,--cardand--kindsalso readworkspace.yamlfor a single universe spec file target. - Commands skip
workspace.yamlwhen check or--mintgets explicit definition file targets, when any other command gets several explicit file targets, and when a command scans a generic directory. - For an explicit
.knowledge-bus/workspace.yamltarget, check and--mintapply the same rules as for a folder target. Check prints the same=== workspace.yaml ===block as a folder check, and adds no file from the parent folder. --card,--kinds,--inspectand--exploreskip an explicitworkspace.yamltarget. Withworkspace.yamlor a marks file as the only target, the four commands refuse with “No universe definitions in the selected scope”.- For each listed id, commands read the parent folder’s universe spec file and the parent folder’s guidance for that universe spec.
--inspectand--explorealso read the parent folder’s marks for that universe spec. - The skills follow the same reading rules as
kbp. - Each universe spec keeps its own id, label, document types, guidance and marks. No command merges universe specs. Check prints one block per file and adds
from the parent folderto the heading of each file read from the parent folder. With several universe specs,--inspect,--exploreand--cardrefuse without--universe, list the candidates, and addfrom_parentto the refusal. With several universe specs,--kindsprints one group per universe spec. --cardgives advice on presenting the document under “How to present it”: one block for each universe spec in scope that declares a factor, the card’s own universe spec first. Blocks for universe specs listed inworkspace.yamlhave headings ending with, from the parent folder.- Check in the parent folder never reads nested folders.
Refusals
- Check,
--card,--kinds,--inspectand--explorerefuse guidance in the nested folder for a listed universe spec.--inspectand--explorealso refuse marks in the nested folder for a listed universe spec; the other commands skip marks. - When a listed universe spec does not conform, check in the nested folder fails too, and read commands refuse with category
conformance. - When
from_parentlists an id, commands run in the nested folder refuse on any unreadable*.kbp.yamlfile in the parent folder.--inspectand--explorealso refuse on an unreadable marks file in the parent folder. The refusal message includes the file name and the parent folder. - After a listed id is renamed or removed in the parent folder, check in the nested folder fails with “which the parent folder does not declare”. Before changing or removing a
universe.id,kb-evolvelists every nestedworkspace.yamlthat names the id underfrom_parent.
checker/tests/workspace/ must fail with exactly that refusal. The kb-check skill gives the fix for each refusal.
Writing changes
- Write a change to a universe spec or its guidance in the
.knowledge-bus/holding the universe spec file. Skills name that.knowledge-bus/before writing. - Add the
evolve-log.mdentry beside the changed universe spec. - Keep answers, the ingest log and Explorer outputs in the selected
.knowledge-bus/. - During ingestion,
kb-ingestfiles answers for listed universe specs in the selected.knowledge-bus/, and writes a change to a listed universe spec in the parent folder only after the user confirms the change.
Creating and updating definitions
Create.knowledge-bus/ when the user asks to set up definitions for a folder. There is no separate kbp init command. Keep writes inside the selected metadata directory and leave existing source files untouched. For a universe spec listed in workspace.yaml, write changes in the parent folder; see Nested Folders.
Inspect existing definitions, guidance, answers, and logs before writing. Reuse them or propose deliberate changes; do not reset or blindly overwrite them. Preserve decisions and history. Ask how to proceed if existing content is incompatible or ambiguous.
During ingestion, exclude every .knowledge-bus/ directory from source material. Skip and report nested folders that contain their own .knowledge-bus/; ingest them separately only when explicitly targeted.
Protocol and examples
The installed checker carries its protocol. Knowledge Bus directory discovery does not search for aprotocol/ directory. An explicit protocol file can still override the bundled protocol.
In the implementation checkout, protocol/ remains the protocol source and universe-samples/ remains the bundled example collection. A bare uv run kbp there validates the examples when no .knowledge-bus/ directory is found. Those reference files do not move into .knowledge-bus/.
Previous locations
The sibling<folder>-spec/ convention is no longer supported for discovery or output. There is no fallback or migration. Existing folders are not moved or deleted. An explicitly supplied file remains a valid checker target regardless of its location.