Concept · documents
Use when
You write a note, a brief or a summary in Markdown, or you change the text of a Markdown File that already has a path.
Looking for something else?
A newer copy of a document that you have as a file on disk (card file, recipe new-edition). A File that a synced folder keeps current (card source). A PDF or an image (card file).
For
A document is a Markdown File that sits at a Workspace path, such as/notes/plan.md. You read its exact text, and you change it by exact text or by
adding a block. You do not upload bytes. Each change is one new version of the
same File. The older versions stay readable, and search reads the newest one.
A Markdown File that someone uploaded is a document too, once it has a path.
penumbra files place <file> <path> gives it one. After that you read and edit
it by exact text, and each edit is a new version of the same File.
Read a document before you change it. An edit applies to the version you read.
If anyone changes the document after your read, Penumbra writes nothing, and you
read again.
Use when
- The person asks you to write a note, a plan or a summary that lives in the project.
- You must change a few sentences of a document, or add a section to it.
- You need a document’s headings, not its body.
Not this
- The person gives you a newer copy as a file on disk: replace the File (card file, recipe new-edition).
- The File is kept current by a synced folder: change it in its folder (card source).
- A PDF, an image or a file that is not Markdown: use card file.
Rules
document.1A document is reached by its Workspace path. Your job: use the path, which starts with/, withpenumbra files readand the other document commands. A File with no path is refused withfile_unplacedand exit code 3. Give it a path withpenumbra files place <file> <path>.document.2A new document takes a new path. Enforced: a path that is in use is refused withpath_conflictand exit code 3, and nothing is overwritten. Create one withpenumbra files new /notes/plan.md --from <file.md>. On MCP, callcreate_markdownwith the name, the folder and the whole text. Penumbra makes missing folders and adds.md.document.3Edit the version you read. Enforced: if the document changed after you read it, nothing is written. The CLI exits withdocument_changedand code 3. The MCP tool answersversion_conflict. Your job: read the document again, and make the edit again. In the CLI,penumbra files edit --fromandpenumbra files insertneed--expect <version>, the version you read.penumbra files read <file>prints it asversion:after the text, and--jsonprints it asversion_id. Without--expectthe command is refused withexpect_requiredand exit code 2.document.4On MCP, an edit replaces exact text. Your job: callread_documentfirst, with the viewcontentorblocks. Then calledit_documentwithold_textcopied from that read, and thenew_text. Give 1 to 50 edits in one call. Enforced: an edit whose text is not found, or that matches more than one place withoutreplace_all, fails the whole call. Nothing is written.document.5An outline is not enough to edit. Your job: do not edit fromread_documentwith the viewoutline, or fromget_document_outline. They omit the body, and they do not allow an edit. Read the content of the part you change.document.6The CLI gives the whole new text, or a block to add, from a file. Your job: runpenumbra files edit <file> --from <file.md> --expect <version>for the whole new text. Runpenumbra files insert <file> --after "<heading>" --from <file.md> --expect <version>to add a block under a heading. Take<version>frompenumbra files read <file>(rule document.3). List the headings withpenumbra files outline <file>. Enforced: a heading that is missing or that two headings share is refused withheading_not_foundorheading_ambiguousand exit code 2. Name a shared heading by its block id, frompenumbra files outline <file> --json.document.7An edit that changes nothing writes nothing. Enforced:penumbra files editwith the text that the document has says “unchanged” and makes no version. Every real edit makes one new version, and one edit call is one version, even with many changes.document.8An edit does not move what the Graph knows. Your job: treat an edit of a document that entities cite like a new edition. Entities keep citing the version they came from (card rule passage.7), and no extraction runs (card rule file.7).document.9A document that a synced folder keeps current cannot be changed here. Enforced: the edit is refused withfile_write_constrained(card rule source.1). Your job: change the document in its folder.document.10Pass the source date when you create a document and its text states a date. Your job: use--source-dateonpenumbra files new. On MCP,create_markdowntakessource_dateonly when the connection holds the permissionset_source_date(card rule file.5).
Failure signs
- An edit is refused as
document_changedorversion_conflict: rule document.3. - A read or edit of a File says it has no Workspace path: rule document.1.
- A create is refused with
path_conflict: rule document.2. - The Graph still shows the old text after an edit: problem entities-cite-replaced-version and problem new-version-not-extracted.
Doors
penumbra files proposals create suggests an edit and does not change the
document.