Skip to content

Reference

Header Reference

HeaderPurposeExample
@idIdentifier for the record (plain string)@id prompt-001
@reply-toReply to another record by @id (threading)@reply-to c1
@byAttribution of who provided feedback@by alice
@tagSpace-separated tags for categorization@tag training batch-1
@inputReference to input that produced the content@input ./prompts/sunset.txt
@fileReference to external content file (provenance)@file ./images/photo.jpg

Header order in canonical form: @id@reply-to@by@tag@input@file → unknown headers (alphabetical)

File-Level Header Reference

HeaderPurposeExample
%markbackVersion declaration%markback 2
%scopeIssues being checked (space-separated)%scope correctness style
%coversGlob pattern of files under review%covers ./src/*.py

CLI Command Reference

CommandPurposeOptions
mb <file> "<feedback>"Add feedback to a file--by, --tag, --input
mb --lint <paths...>Lint MarkBack files/directories--json, --no-source-check, --no-canonical-check
mb --normalize <input>Normalize to canonical V2 form
mb --list <paths...>List records
mb --stats <paths...>Show statistics
mb --convert <input>Convert storage modes--to (single, multi, compact)
mb --upgrade <files...>Upgrade V1 files to V2--dry-run
mb --init [path]Create a .env template--force

Configuration Keys (.env)

KeyMeaning
FILE_MODEgit (overwrite) or versioned (timestamped outputs)
DEFAULT_BYDefault value for @by header when adding feedback

Lint Error Codes

CodeMeaning
E001Missing feedback (no <<< delimiter found)
E002Multiple <<< delimiters in one record
E004Content after <<< delimiter
E006Malformed header syntax or invalid file encoding
E007Invalid JSON after json: prefix
E008Unclosed quote in structured attribute value
E009Empty feedback (nothing after <<<)
E010Missing blank line before inline content
E011Invalid line/character range (end before start)
E012Unclosed fenced feedback block (missing closing """)

Retired Error Codes (V1 only)

CodeV1 MeaningV2 Status
E003Malformed URI in @uriRetired: @id has no format validation
E005Content present when @source specifiedRetired: @file + inline content now valid

Lint Warning Codes

CodeMeaning
W001Duplicate @id within the same file
W002Unknown header keyword
W003@file referenced file not found
W004Trailing whitespace on line
W005Multiple blank lines
W006Missing @id (record has no identifier)
W007Paired sidecar file not found
W008Non-canonical formatting detected
W009@input referenced file not found
W010V1 format detected (old header mapped to V2 equivalent)
W011@reply-to points at an unknown @id or forms a cycle