Conformance suite
Every engine build must pass every fixture here. This is the contract between agents.
Layout
#NNN-name.selfis the input. A fixture is every top-level.selffile whose stem containsno
.;NNN-name.base.selffiles and subdirectories are support files (imports, includes).NNN-name.htmlis the expected HTML body, without the<style>block.NNN-name.diag.txt, if present, lists the expected diagnostics, one per line, in order:SEVERITY [FILE:]LINE:COL MESSAGE. FILE appears only when the diagnostic belongs to an imported or included file, as its canonical key. **No.diag.txtmeans the fixture must produce no diagnostics at all.**NNN-name.css, if present, is the expected CSS (D41).NNN-name.folds.txt, if present, lists the expected folds, one per line:KIND LEVEL FIRSTLINE-LASTLINE(D51).
Normalisation
#Applied to both expected and actual HTML and CSS before comparing:
\r\nbecomes\n.- Every match of
>[ \t]*\n\s*<becomes><(line breaks between tags do not matter). - Trim.
Spaces between tags on the same line are significant. Nothing else is normalised.
.diag.txt and .folds.txt are compared line by line, ignoring blank lines and trailing
whitespace (D67).
Runner options
#- Input: the raw bytes of the
.selffile, through the byte-level entry (parse_bytesinRust,
parse(Uint8Array)in JS), so invalid UTF-8 is handled per D8. path: the fixture's file name (for example008-import-override.self).- Resolver: reads
spec/conformance/KEY, or returns null if it does not exist, or if KEYcontains
://or a..segment (D67). A library keylib:NAMEreadsspec/conformance/library/NAME.self(D72). - Full built-in plugin set.
allow_re,allow_remote,forms,unsafe_htmloff. No host vars.
Rules for fixtures
#- Small. One feature per fixture where possible.
- Expected output is hand-written and reviewed, never generated by the engine under test.
- Class names for styled rules use the rule's
asname when given, elseself-rNwhereN is the rule's 1-based index in the document's compiled table (imports included, D28). A named rule whose name another rule writes as a class uses
self-rNbeside the name (D264). - Add a fixture for every bug fixed. The fixture comes before the fix.
Runners: engine/crates/selfscribe-conformance/tests/conformance.rs (Rust, with selfscribe-plugins),
engine/crates/selfscribe-cli/tests/conformance.rs (CLI), and
packages/selfscribe/test/conformance.test.ts (WASM through the JS package). All read this
directory. They must agree.
Coverage: escapes, nested inlines, overlapping delimiters, unclosed blocks, imports
with overrides and cycles, off, scopes, every modifier, every directive, every built-in
plugin, CRLF input, empty document, rules-only document, tabs versus spaces, and the limits
in 03 §4. INDEX.md maps each fixture to the spec clause it checks.
Fixture index
What each fixture checks, and the clause it checks it against (spec file § or decision D#).
| Fixture | Checks | Clause |
| 001 no-rules-is-markdown | no rules block means use markdown | 01 §1, D40 |
| 002 inline-longest-wins | longest pattern at a position; run alignment | 02 §3, D35 |
| 003 colour-comments | line rules, word rule, style classes, CSS | 02 §4, D41 |
| 004 group-nest | group, nest, digit slot | D24, D29, D30 |
| 005 table-split | split | 02 §4 |
| 006 block-verbatim | verbatim block, optional space in block segment | D33 |
| 007 escape | escape stops a match | 01 §3, D5 |
| 008 import-override | use, replacement, off | 02 §6, 05 §1 |
| 009 scope | scope and @scope | 01 §3 |
| 010 link-attr-slot | attribute slot consumed | 02 §4 |
| 011 fold-and-hidden | fold N, hidden block, fold output | D51 |
| 012 unclosed-block-degrades | unclosed block warning, standalone paragraph | D34, D10 |
| 013 unknown-target | unknown target warning at the rule | D44 |
| 014 set-slot | set slot | 02 §3 |
| 015 set-slot-not-inherited | slot per file | 01 §2 |
| 016 empty-document | empty input | 01 §5 |
| 017 rules-only | rules block, empty body, rules fold | D51 |
| 018 crlf | CRLF line ends, verbatim output uses LF | D1 |
| 019 tabs-vs-spaces | tab = one level, 2 spaces = one level | 01 §4, D30 |
| 020 indent-setting | set indent 4 | 01 §2 |
| 021 bom | BOM before the fence | D2 |
| 022 fence-case-leading-blank | blank lines before fence, several spaces, case | D2 |
| 023 fence-needs-space | ~~~selfscribe is not a fence | D2 |
| 024 unclosed-rules-block | unclosed rules block becomes body | D3 |
| 025 escapes | \` before punctuation only; \; trailing ` | D5 |
| 026 escape-inside-slot | escapes inside content and attribute slots | D5, D35 |
| 027 at-lines | ordinary @ lines; stray @end | D6 |
| 028 rules-comments | full-line and trailing comments, # in CSS and pattern | D12 |
| 029 set-and-var | set variables, title, missing var | D49 |
| 030 blanklines-keep | set blanklines keep | D54 |
| 031 longest-tie-last-wins | equal length: last defined wins | 02 §3 |
| 032 override-in-document | same WHERE + pattern replaces | 02 §6 |
| 033 off-by-name | off NAME | D13 |
| 034 off-with-where | off WHERE PATTERN | D13 |
| 035 off-no-where-and-nomatch | off PATTERN hits all WHEREs; no-match warning | D13 |
| 036 off-then-redefine | later rule with same pattern is active | D13 |
| 037 full-form | full form, anonymous rule, repeated style | 02 §5, D20 |
| 038 numbered-slots | _2 before _1 | D25 |
| 039 content-slot-token | bare slot token as content (bbcode [url]) | D22 |
| 040 quoted-attr-interpolation | "color: _1"; unsafe style attribute | D23, D42 |
| 041 empty-slot-attr-omitted | empty slot attribute omitted; attr-only slot may be empty | D35, D39 |
| 042 classes-order | class order and dedupe, as class | D39, D41 |
| 043 css-unsafe | unsafe declarations dropped | D42 |
| 044 unsafe-url | URL scheme policy | D43 |
| 045 html-escaping | text and attribute escaping | D39 |
| 046 disallowed-target | refused elements, unknown inline target | D43, D44 |
| 047 reserved-text-hidden | text, hidden inline and line | 02 §4 |
| 048 keep | keep on inline and line | D38 |
| 049 word-rules | word boundaries, word inside inline, not in verbatim | D36 |
| 050 bound | bound modifier | D36 |
| 051 digit-slot | _# | D24 |
| 052 pattern-errors | every rule-line error | D19, D25, D26 |
| 053 invalid-settings | invalid set values | D19, D21 |
| 054 pattern-too-long | 256 ok, 257 error | 03 §4, D26 |
| 055 double-space-pattern | \ \ , whitespace collapse | D11 |
| 056 literal-arrow | \-> in patterns | D11 |
| 057 verbatim-inline | verbatim keeps backslashes; escaped closer | D5 |
| 058 group-shared-input | shared group, group classes, input= | D29, D45 |
| 059 group-breaks | blank and scope lines do not break a group | D29, D6 |
| 060 nest-children | paragraph children, skipped levels, blank lines | D30 |
| 061 split-edges | escaped separator, empty cells | 02 §4, D66 |
| 062 fold-levels | fold N sections, trailing blanks, empty sections | D51 |
| 063 fold-bare | bare fold on line and block | D51 |
| 064 block-nonverbatim-nested | nested same-rule blocks, closer wins | D33 |
| 065 block-single-line | one-line blocks | D33 |
| 066 block-in-list-indent | indentation stripped in nested verbatim | D33 |
| 067 block-longest-opener | longer opener wins | D27, D33 |
| 068 paragraph-merge | lines merge, trailing spaces trimmed | D31 |
| 069 line-exact-anchored | line patterns anchored at both ends | D32 |
| 070 nested-inlines | recursion into slots, run alignment nesting | D35 |
| 071 overlapping-delimiters | leftmost start wins | D35 |
| 072 inline-edge-cases | no cross-line, empty content slot fails | D35 |
| 073 limit-inline-32 | inline recursion limit | D55 |
| 074 limit-nesting-64 | nesting limit | D55 |
| 075 import-cycle | cycle cut, diagnostic in the imported file | D16 |
| 076 import-unresolved | unresolved path, unknown template, remote off | D17 |
| 077 import-in-place-order | use expands in place | D14 |
| 078 import-relative-nested | relative keys from nested imports | D17 |
| 079 import-settings | which settings leak from imports | D15 |
| 080 scope-inherits-default | scope = default + own | D37 |
| 081 scope-flat-nesting | scopes do not stack | D7 |
| 082 scope-import-and-off | import into current scope; off per scope | D15, D37 |
| 083 use-form | built-in form template, input=, var | 04 §5 |
| 084 use-comments | built-in comments template, CSS origins | D41 |
| 085 emoji | emoji plugin, unknown name, styled wrapper | D46, D49 |
| 086 mermaid-math | mermaid and math markers | D49 |
| 087 csv-tsv | csv quoting and trimming, tsv, header only | D49 |
| 088 include | include, include cycle, unresolved include; the included file's own rule reads its body | D49, D263 |
| 089 regex-disabled | re rule without allow_re | D63 |
| 090 duplicate-name | duplicate as names | D28 |
| 091 attr-not-allowed | attribute name policy | D43 |
| 092 slot-not-in-pattern | reference to a missing slot | D25 |
| 093 markdown-table-separator | separator row hidden inside the table | D60 |
| 094 markdown-tour | the built-in Markdown template end to end | templates/markdown.self |
| 095 full-form-modifiers | every modifier key in full form; incomplete rule; unknown key | D20, D66.13 |
| 096 settings-rules-project | set rules, set project and their invalid values | 01 §2, D19 |
| 097 import-diamond-root | diamond import, root-relative /, .. above the root | D16, D17 |
| 098 plain-workbook-templates | built-in plain and workbook; diagnostic in a template | D17, D56 |
| 099 scope-in-blocks | @scope in a non-verbatim body (auto-close), in verbatim (text), indented, unclosed | D6 |
| 100 include-inline-and-scope | include under @scope; include from an inline rule | D49, D66.14 |
| 101 block-opener-fallback | longer opener without closer falls back to a shorter one | D33 |
| 102 unclosed-nested-block | unclosed outer block with a closed inner one | D33, D34 |
| 103 lone-cr-mixed-indent | lone \r is text; tabs and spaces mixed on one line | D1, D30 |
| 104 invalid-utf8 | lossy decode with an error | D8 |
| 105 css-overridden-omitted | overridden and disabled styled rules emit no CSS; overridden unknown target is silent | D41, D44 |
| 106 unknown-target-once | one warning per rule, not per use | D44 |
| 107 url-more | cite, upper-case scheme, whitespace inside a scheme, &# is not a scheme | D43 |
| 108 css-triggers-hash-quote | expression(, \`, < triggers; # inside quotes; _0` literal | D12, D25, D42 |
| 109 long-relative-url | a relative URL longer than any scheme stays; a long scheme is still refused | D43 |
| 110 library-rulebook | use NAME resolves a host library rulebook (lib:NAME); unknown names; no relative imports inside a library rulebook | D72 |
| 111 data-csv-table | use data; a typed CSV data block drawn as its own table; every type's cell; the payload | D80, D82 |
| 112 data-bad-cells | bad cells per type, unknown type, extra fields, an inferred column | D80 |
| 113 data-formats | JSON array, JSON Lines, records with a % header and a comment, TSV by sniffing; list views | D80, D82 |
| 114 view-table-options | as hidden; sort desc, columns, page, totals in tfoot; group, filter, search, title | D80, D82 |
| 115 view-cards-board | a board by its first choice column (empty columns kept), grouped cards, a board by a text column with (none), avg and count | D80, D82 |
| 116 view-calendar-form | a calendar by the first date column (offset timestamps on their written day, a note for undated records), a form | D82 |
| 117 view-diagnostics | duplicate and invalid names, unknown kinds, sources, columns, reserved sqlite, repeated options, filter errors, fallbacks | D80, D81 |
| 118 data-files | from PATH with a types body, a view of a file path, file diagnostics, unresolved and unsupported files | D80 |
| 119 view-filter | the filter language: or, not, parentheses, dates and timestamps, choices order, lists, alternatives (A or B values), today without a host date, empty cells | D81 |
| 120 data-escaping | CRLF input, quoted CSV, HTML and payload escaping | D80, D82 |
| 121 details-summary | details with a summary attribute gets a <summary> child; an empty slot has none | D86 |
| 122 footnotes | Markdown footnotes: numbering by first reference, repeated references, unknown, unused, duplicate and invalid notes | D87 |
| 123 citations-bib | author-year citations from a BibTeX file: prefixes, locators, et al., DOI and URL links, macros, TeX flattening, file diagnostics | D88 |
| 124 citations-records | numeric citations from a records data block, all, a refused URL, no authors or year, an unknown source | D88 |
| 125 equations | numbered equations, eq: labels, references, an unlabelled and a plain math block, a duplicate label | D89 |
| 126 glossary | terms marked in headings and text but not in code, links or longer words; hidden abbreviations; a duplicate term | D90 |
| 127 progress | task counts per section, whole document, no tasks | D91 |
| 128 footref-without-notes | a reference-like [^x] in a file without notes is text, without a warning | D87 |
| 129 page-break | ---page--- in Markdown is a page break, hr.self-pagebreak | D94 |
| 133 data-holidays | set holidays SOURCE: the days off (a span with a to column) go to clients in the payload; filters take units (today+10wd, today-1m, today+2w) | D119 |
| 134 data-holidays-unknown | a holidays source that does not exist warns once, at the set line | D119 |
| 135 data-calc | calculated columns: start + 3w, start + 10wd, due - start, hours * client.rate (exact), client.email through a choice(from …) column; CSV fields skip them; a view filters and sorts by them; the payload carries calc | D120 |
| 136 data-calc-warnings | a type that does not fit, an unknown column, a missing ), a lookup through a plain column, a written type that disagrees, a number plus an amount, a division by zero (empty), a JSON key for a calculated column | D120 |
| 137 rule-keys | key SHORTCUT on rules changes nothing in the HTML; a shortcut without Ctrl or Alt (other than F1-F24) warns | D122 |
| 138 linebreaks-keep | set linebreaks keep: a line break inside a paragraph is a <br> (indentation dropped); lists are untouched; another value warns | D123 |
| 139 block-options | size words after a block's opening line (maxwidth:800px, width=50%, align:center) become its inline style (a code block's on its pre) and are not matched by the rule; a bad value warns | D125 |
| 141 palette | palette NAME VALUE [dark VALUE], one line or a block: custom properties on :where(.self-doc, .self-palette) before the rules, the dark value through light-dark(); a later name replaces in place; a bad name, an editor name (ui- and the like), a dark gradient and an empty value warn | D129 |
| 142 class | class NAME { css } styles a class without a rule, after the palette and before the rules; a later class of the same name replaces it in place; self-, cm-, ed- and pg- names, a missing { css } and unsafe declarations warn | D130 |
| 143 view-plain | plain on a data view: the payload says "plain":true (the client draws no bar, and sums as bare figures); the static table is unchanged | D80 |
| 144 word-slots | one-word slots in word rules: @_, #_ with an attribute and keep, #_/_, $_, _%, v_; trailing , . ) stay outside; no match after a letter (email@host) or before -; a longer literal (@ana) wins; escapes; _ alone, _# and three slots are errors | D133 |
| 145 class-selectors | class NAME with pseudos (::after, :last-child::after, :hover, ::marker, :nth-child(2n+1)) and one descendant or child element (card h3, card > p), still under :where(.self-doc, .self-palette); the same name and ending replaces; two elements, a pseudo-element before the element, other pseudos, class and list selectors warn; \` in content` is unsafe | D130 |
| 146 view-chart-bar | as chart by COLUMN sum COLUMN: a bar per choice in order, (none) last, exact sums, an SVG with a titled bar per value and a table of the numbers; the payload's chart and by; no total gives count, and a filter applies first; an unknown chart type warns | D134 |
| 147 view-chart-line | as chart line by month (the first date column), two totals as two series, an empty month in between (sum 0, no average), a negative value, a record without a date noted; area by date week (Mondays); a period on a column that is not a date warns | D134 |
| 148 view-chart-group | hbar … group product: one series per value; pie of one total; donut group region (group alone is the categories) with max of a rating; min of a date is left out with a warning | D134 |
| 149 numbered | numbered counts each kind on its own (figure, table, theorem; name=Satz shares the theorem count); captions under figures, above tables, run into a theorem's first line; ref by prefix, by kind= and bare; [@eq:…] still eqref; unknown, duplicate and invalid labels and an invalid kind warn | D140 |
| 150 typed-slots | _# read by attributes (value=_#, inside quotes); group-start=_# puts start on the ol from the first item, left out when 1, nested lists count on their own; url word slots take query strings, fragments and balanced brackets, leaving trailing punctuation and quotes outside, not inside code; a link's text is not linked again; _# without a digit slot and url off a word rule warn | D141 |
| 151 data-rules | Rules after a column's type: required (an empty cell warns), unique (a repeated value is a bad cell), default, when TEST then VALUE else '' with its test in the payload, hidden (left out of the columns shown), readonly; a default that does not fit, a test on an unknown column, an unknown rule and a when without then warn; a calculated column beside them | D153 |
| 152 data-query-locked | readonly and views said on a data block hold for its views; locked and unlocked; views none; data NAME from OTHER where TEST keeps the other source's records and lines, names itself in source.query, adds a calculated column from its one header line; two queries that take from each other and a missing source warn | D154, D155 |
| 153 data-query-totals | per client sum hours avg hours min due count after where: one record per value with sum_hours, avg_hours, min_due, records; a calculated column from the block's header line; views of it are readonly; a view and a query of the totals (where records > 1); a looked-up column carries link with where each value's record starts; an unknown per column warns and the records are listed | D156, D157 |
| 154 data-totals-join | The column totals are per stays a choice(from clients.name): calculated columns of the totals read through it (rate = client.rate, cost = sum_hours * client.rate, city = client.city), an empty value reads nothing; a view total and a chart over those columns; a query of the totals (where cost > 1000); a lookup of a column the other source does not have warns | D161 |
| 155 data-table-peek | A choice(from DB.sqlite/TABLE.csv COLUMN) column: its link carries peek, the column names and the looked-up records whole (each value's first record, empty values left out), because a table of a database has no text to open; a calculated column reads through it; a lookup of an ordinary file carries no peek (reads 155-shop.sqlite/clients.csv and 118-data-files.csv) | D162 |
| 156 data-pivot | per region across quarter sum amount: a column for each value of quarter and a total column, one record per region; a value named like a column gets _; empty cells where nothing is to total, 0 for a count; max of a date gives date columns; a view total and a chart over a value column; two totals with across, an unknown across column and across without one warn; a query that names itself says so | D165 |
| 157 rewrite | rewrite block turns a short notation into a target's language: LaTeX templates under set slot @ (x_1 passes through) with first and last lines for math; _# digits and a line's own indentation kept for pre; a line no template matches stays as written; data-self-rewrite carries the line map; markdown's code block still works beside them | 02 §8, D255 |
| 158 rewrite-shared | A rewrite from a rulebook (use) applies in the document; rewrite inline, a rewrite into data (which reads its block as written), a slot the pattern lacks (left as written) and an unknown template line are problems on their lines | 02 §8, D255 |
| 159 own-style | A styled rule named box while another rule writes div.box (and a group writes ul.box): its class is self-r1 beside box, its CSS .self-r1, an info note at the rule; a class box line still styles every .box; a name nothing else writes keeps .note | 02 §4, D41, D264 |
| 160 view-buttons | button Watered runs watered, button "Moved it" runs moved: the payload carries buttons as [label, action] pairs in order; the static table draws no button and no extra column | 04 §7, D267 |
| 161 data-totals-file | Totals over a table kept in a file: sum("161-picks.csv".points) and count(…) in a file's own header, over the rows whose choice(from 161-players.csv) column names each player; the picks' own points are worked out first; a view of the file and a block that reads it (from 161-players.csv) are the same table, and the block's header totals a block of the document that reads the other file (sum(picks.points)); an unknown source warns (reads 161-players.csv and 161-picks.csv) | D139, D270 |
| 162 data-calc-rules | Rules after a calculated column's expression: hidden (left out of the block's table, shown where columns names it), help beside the calculation in the payload; required and default do not apply to a calculated column and are taken off with a warning each | D153, D270 |
| 163 data-figures | The static output writes figures as the client does: set currency £ without tips puts £ on the money columns (worked-out ones too) and not on tips, whole pounds where every value is whole; thousands grouped; set dates weekday for due dates; a table's totals row with Total and bare sums, a group's line with its count and sums, a list's totals as words named by their columns (Amount £2,154.90 · Average amount £1,077.45); tiles for as stats; worked-out cells marked self-calc; when … -> red on a row and -> bold in left on a cell | D82, D186, D259 |
| 164 view-chart-money | A static chart has the client's view box (an hbar of two rows is 158 high, bars 340), axis values grouped, compact from 10,000 and with the shared currency, each bar's value written as its column's totals (inside a bar that reaches the edge), series named by their columns as headings (Revenue, Orders), a legend over several series, a donut's total and shares, and the numbers as written in a table for screen readers | D134 |
| 140 rules-regions | # region NAME … # endregion (nested, one left open) and # ---- section comments fold inside the rules block; they stay comments | D124 |
Not covered by fixtures (unit tests instead): depth 64 reached through non-verbatim blocks, includes and imports, because a readable fixture for it would be hundreds of lines.