Skip to main content

Module document

Module document 

Source
Expand description

Canonical FUR conversation document: serialize / parse.

.fur/ is operational state. This module defines the durable format: a conversation is a Markdown file that a person can read and a machine can parse, and tests/roundtrip.rs proves the trip is lossless.

On-disk layout this format assumes:

chats/
└── schema-proposal-changes-fur/
    ├── convo.md                    <- the spine (this format)
    └── CHAT-20260808-181158.md     <- long-form body, referenced by link=

link= is always relative to the conversation folder that holds the spine. Long-form siblings carry no metadata of their own; the folder is the unit of self-containment.

§Lineage (schema 2)

parents and children record edges to other conversations, by conversation_id. Together they form a directed graph across the archive: a methodology discussion informs a forecast, which informs a revision.

Three properties are deliberate, and each has a reason:

  • Edges are ids, never folder slugs. bridge::slug_for embeds the title, and sync_conversation renames the folder when the title changes. A slug-based edge would break on the first rename, and would not survive registry import at all.
  • Dangling edges are legal. A conversation imported from a registry can reference conversations the importer has never seen. An unresolvable edge is partial knowledge, not corruption — unlike a missing link= file, which is a broken document.
  • Cycles are legal here, and handled by traversal. Two people can independently publish A→B and B→A; the cycle only exists once both are in one archive. Rejecting it at parse time would make that archive unrepresentable. Every walker carries a visited set — which it needs for diamonds regardless.

Self-reference is rejected: it is never meaningful and always a mistake.

Structs§

FurDocument
A whole conversation: front matter plus an ordered list of messages.
FurMessage
One message in a conversation.

Constants§

FUR_DOC_SCHEMA
Version of the document format. Deliberately an integer, and deliberately separate from schema::SCHEMA_VERSION (which versions the .fur/ JSON). Integers also avoid the lexicographic trap of comparing “0.10” to “0.3”.
FUR_DOC_SCHEMA_MIN
Oldest document version this build still reads.

Functions§

parse
Parse a canonical document. Errors are strings so this can sit under the existing eprintln! style without dragging in an error crate.
serialize
Render a document to its canonical text form.