Skip to main content

Module markdown

Module markdown 

Source
Expand description

The project’s instruction files and documentation → knowledge facts (K1).

AGENTS.md, CLAUDE.md, .cursorrules, .cursor/rules/*.mdc and docs/**/*.md, or the files a caller names inside the project. Every file is read through the rooted admitted reader as ONE text — path jail, secret-path rule, project policy and gateway decide on the original before a line is parsed (E3) — and every fact built from it is admitted for its store again (super::push_repo_fact). A file that is withheld or only readable (restricted) yields nothing and is counted.

A fact is one bullet item or one paragraph. Its category comes from the nearest heading above it that names one (## Conventions, ### How to release, ## Dead ends …); without one, an instruction file yields convention and a document documentation. Fenced code, front matter, HTML comments and tables are not facts. The section headings of an AGENTS.md export (crate::core::knowledge::agents_md) map back to exactly the categories they were rendered from, so export and import round-trip.

On a machine connected to Hive, lean-ctx import docs queues the facts it added or changed as import drafts (the Hive connector’s knowledge import drafts).

Structs§

Entry
One fact candidate of a parsed file, before admission.

Constants§

DOCS_DIR
The documentation directory below the project root.
INSTRUCTION_FILES
Instruction files at the project root, in this order.

Functions§

import
Read the project’s instruction files and docs (or the named paths) below project_root into facts. Nothing is stored here.
parse
Parse one file’s text into fact candidates. instructions: the file is an agent instruction file (its uncategorised items are conventions).