The pen
glossary/the-penChecked by automation only
still a draft
Written 2026-10-20 by ktl-librarian (automation). Last checked 2026-10-29 by ktl-librarian (automation).
The name the docs give knowledge-apply.sh, the script through which ktl-librarian writes every change to the bundle. The librarian describes each change as an operation in .lokf/patch.yaml, and the pen checks every operation and writes the files, or writes nothing.
The full record
- Checks
- 2026-10-29 by
ktl-librarian(automation)
- 2026-10-29 by
- Sources
- About
- Related to
- Pointed to by
- Desk (related to)
- Librarian (related to)
- Registrar (related to)
- The pen, for readers aged 13 to 18 (derived from)
- Graph
- Open this concept in the knowledge graph
- IRI
https://w3id.org/ktl/knowledge/glossary/the-pen- Licence
- CC BY 4.0
- Files
- MarkdownJSON-LDSource on GitHubHistory on GitHub
Overview
Section titled “Overview”The pen is the name the docs give knowledge-apply.sh. ktl-librarian never edits a file under .lokf/knowledge/ by hand. It describes each change as an operation in .lokf/patch.yaml, and the pen checks every operation and writes the files, or refuses the whole file and writes nothing.
The pen:
- stamps
generatedfrom the clock; - keeps a concept’s
descriptionequal to its two index bullets; - files each line in
log.md; - runs
lokf validateon every concept a patch would write, with--dry-runtoo, when.lokf/.venvholds the toolkit (0.55.0); - moves a feedback entry the librarian handled into
.lokf/questions.md, ten to a patch at most.
It refuses a human: actor, a rewrite of text a person wrote, and the deletion of a concept a person confirmed or left a note on. It also refuses a patch after which any concept it writes would hold a person’s record other than the one the file held. That covers a human: event or a person’s note added, changed or removed, however the operations spelt it.
In the scheduled run, the wrapper applies the patch file after the agent has finished, and refuses a run in which the agent changed any other file. In the agent’s step the pen only checks the patch: the wrapper sets KNOWLEDGE_PEN_DRY_RUN_ONLY, so a run without --dry-run exits 2, writes nothing and leaves the patch file for the wrapper. A patch may also carry handoff, up to ten lines for the person reviewing the change, in the librarian’s own words. The pen holds each to one line of printable text and writes none of it to the bundle. The scheduled pull request shows them under From the librarian.
The pen is the librarian’s only way to write the bundle, and the bundle has other writers: a person writes the curator’s verdicts through ktl-curator or the KTL Curator plugin. The architecture page names the pen as the registrar for the librarian.