State the encoding and line-ending contract for index.md
Fills the gap, matching the built engine: strict UTF-8 no-BOM reads (undecodable or BOM'd files fail fast loudly), BOM-less writes, per-line ending preservation (CRLF stays CRLF), final newline preserved, app-created files LF. Agent guide teaches the contract. Claude-Session: https://claude.ai/code/session_01HJ7PhFNmQ19bvy9RMD6GSb
This commit is contained in:
@@ -35,6 +35,7 @@ MyBoard.kanban/ ← board = the document
|
||||
- **Atomic writes**: temp file, rename over `index.md`.
|
||||
- **Unknown frontmatter keys and their order are preserved verbatim** on every rewrite. This is load-bearing for agent overlays (`project:`, `sphere:`, custom tags) — see 08-agent-integration.md.
|
||||
- **The app never reformats a body it didn't change** (byte-identical round-trip; plain string comparison, no re-serialization).
|
||||
- **Encoding and line endings** (settled — the contract underneath "byte-identical"): `index.md` is **UTF-8, no BOM**. Reads are strict — a file that doesn't decode as UTF-8 is the loud malformed-input rejection, offending path named; a BOM'd file fails the frontmatter delimiter and is rejected the same way, deliberately (external writers must produce plain UTF-8, which the agent guide teaches). App writes are BOM-less UTF-8. **Line endings are preserved per line, never normalized**: LF and CRLF both parse; a rewritten frontmatter line keeps the ending it had (a CRLF file stays CRLF); untouched bytes — the body and every unedited line — round-trip byte-identically; and the file's final newline, present or absent, survives rewrites. One card edit can never become a whole-file line-ending diff poisoning the semantic-commit story (06-history-undo.md). Files the app *creates* are LF.
|
||||
|
||||
## Frontmatter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user