@gram 2 doc portal-reference-syntax-guide t .gram syntax d The current source envelope, identifiers, fields, blocks and literal escaping. view document ::rich # .gram syntax ## Current source A current document begins with `@gram 2`, a `doc ` owner, and zero or more typed records. Current writer files end in a Core-owned `@gram-history 6` trailer. The trailer is not authored article content. `@gram 1` remains a readable legacy source version; it is not the current writer format. IDs are stable document-local identifiers using letters, digits, hyphens or underscores. A record begins with a type code and ID, such as `K local-search` or `T review-index`. IDs are not derived from titles. ## Fields and values A field is one line: `key value`. The value is the rest of that line and remains text; the format does not coerce a date, number, status or color. Common keys include `t` (title), `d` (description), `x` (status), `s` (scope), `p` (priority), `owner`, `tag`, `source`, `ref`, `view` and `motion`. `t` is required on the document and known records. Singleton fields cannot repeat; `tag` and `source` may repeat. ## Blocks A literal block starts with `::kind` and ends at a line exactly equal to `::end`. Payload is data, not executable code; block bodies do not nest. Unknown block kinds are retained. When a payload line itself equals `::end`, escape it as `\::end`; the reader removes the escape. ## Minimal valid source ```text @gram 2 doc index-notes t Index notes K lookup t Keep query boundaries explicit ::reason The index is a derived view, not canonical document content. \\\\\\\::end An escaped terminator line remains literal payload. \::end ``` A payload line equal to a terminator must be escaped, and the block still needs its own closing ::end. See Records for type/field conventions and Relations for edge direction. Source grammar and validation are defined by the linked Core format specification. ::end SRC format-language t .gram language specification ref https://github.com/clab-one/thegram-format/blob/main/spec/language.md SRC format-rich t Current rich document specification ref https://github.com/clab-one/thegram-format/blob/main/spec/rich-document.md SRC format-history6 t Current History/6 specification ref https://github.com/clab-one/thegram-format/blob/main/spec/source-history-render.md @gram-history 6 @rev 0 2026-10-12T13:11:21.788Z - 79d67717aae7515e5566b3e22b8e5f99eabf3bb332eac9f7644a246debda54a7 @rev 1 2026-10-12T13:11:21.788Z portal-reference-contracts agent=developer-doc-generator req=portal-reference-syntax-guide-984a5faf8d626bdab306e34f dig=a606c51ed27a84e2 kind=SourceImported 2b5f7493dfc872f178ffc766bb19b08051f22469b8bbace18c1ab5c8b61e2e58 @@ 38 1 0 @@ 40 0 2 t .gram language specification @@ 41 1 0 @@ 43 0 1 t Current History/6 specification @rev 2 2026-10-12T13:38:05.256Z portal-reference-finalize agent=developer-doc-generator req=portal-reference-syntax-guide-0e2c6bcce05e366bf3c89074 dig=e4c097bfad944099 kind=SourceImported b7963aba95585dbbef23c217e0d29d484f9bc33c804f53b7820a6cf94a4b596a @@ 4 2 1 ::body @@ 33 1 0 @@ 36 2 0 @@ 44 3 0 @rev 3 2026-10-12T13:39:13.016Z portal-reference-finalize agent=developer-doc-generator req=portal-reference-syntax-guide-aa34061bb91a48045cce1b24 dig=f4bd39f23635f4f0 kind=SourceImported a85da4b5a812831ad971cc1c06d70a8a22736472fc8f33f53c45d1dc12ea5362 @@ 32 1 1 \::end @rev 4 2026-10-12T23:14:15.898Z portal-reference-finalize agent=developer-doc-generator req=portal-reference-syntax-guide-r3-09906cb8252ed233c4b87ac9 dig=c786d60d519c2686 kind=SourceImported 07070fb6c30da9f78308dc24c90df4702c995a9777707be6332a1918ef6a486a @@ 32 0 1 \\::end @@ 33 2 0 @@ 37 1 1 The escaped line is literal payload; final ::end closes ::reason. @rev 5 2026-10-12T23:17:37.880Z portal-reference-finalize agent=developer-doc-generator req=portal-reference-syntax-guide-r4-0cc6ea1cb1f43248220ef2c2 dig=662fdf91f391f055 kind=SourceImported 2b7b861b214394ee4df95b373e5c4c33a23a889f132f7ed74a0f572385ad4f67 @@ 32 1 1 \::end