Decisions
Every ambiguity, gap or contradiction found in the spec, as a numbered question with the answer adopted. The spec files have been updated to match; this file records why. New entries go at the end with the next number. Never renumber.
Status key: adopted (in the spec), deferred (v1.1), rejected.
A. Kernel and document shape
#D1. CRLF normalisation versus spans into the original source
#01 §4 says \r\n is normalised to \n "before anything else", but 03 §2 says every span
is a byte offset into the ORIGINAL source. Rewriting the buffer breaks spans.
Adopted. The engine never rewrites the buffer. \n and \r\n are both line
terminators; the \r of a CRLF pair is never part of a line's content. Spans are UTF-8 byte
offsets into the original input. All output (HTML, verbatim bodies, plain text) uses \n.
A lone \r not followed by \n is an ordinary character.
D2. What exactly is the opening fence?
#Adopted. After skipping an optional UTF-8 BOM and any blank lines, the first line must
be ~~~, one or more spaces or tabs, selfscribe (any case), then optional trailing whitespace.
No leading indentation. ~~~selfscribe (no space) is not a fence. The closing fence is the first
later line that is ~~~ plus optional trailing whitespace. A BOM is skipped for matching
but still counts in spans.
D3. Rules block opened but never closed
#Adopted. It is not a rules block. The whole file is body under the default rules
(D40), and a warning unclosed rules block is reported at 1:1. Rationale: while typing, the
user sees text and a squiggle instead of an empty document.
D4. set rules show|hide: default is show, yet no fixture renders the rules block
#Adopted. Rendered HTML never contains the rules block. rules is an editor
presentation setting: hide means hybrid mode and preview treat the rules block as folded
and hidden by default. The fixtures stand.
D5. Which characters does `` escape?
#01 §3 says \x makes any next character literal. That turns C:\Users into C:Users.
Adopted. \` escapes only ASCII punctuation (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~`).
An escaped character is emitted without the backslash and can never be matched by a
pattern literal (so it never starts or ends a match, and never forms part of one), though
it may sit inside slot content. A backslash before anything else, or at end of line, is
an ordinary character. Escapes are not processed in verbatim content (the backslash is
kept, as in CommonMark code spans), but escaped characters still cannot close a verbatim
match.
D6. @scope / @end details
#Adopted. Recognised on a line whose content after indentation and trailing-whitespace
trim is exactly @scope NAME (NAME = [A-Za-z0-9_-]+, single space or more between) or
exactly @end. They produce no node. They end a paragraph but are transparent to
group (D29). @end with no open @scope produces warning @end without @scope and is
dropped. An @scope still open at the end of its region closes silently. @scope NAME
where no rule was ever declared in scope NAME produces warning unknown scope 'NAME' and
still opens (it behaves like the default scope), so @end pairs correctly. Inside a
non-verbatim block body they work and auto-close at the end of that body. Inside verbatim
bodies they are text.
D7. Scope stacking
#Adopted. Scopes are flat. The active table inside @scope b is always
default scope + scope b (D37), whatever scope encloses it. @end returns to the
enclosing scope. Rationale: one table per named scope, precompiled.
D8. Invalid UTF-8
#The Rust API takes &str; JS strings are already text. Adopted. Byte-level entry points
(self CLI, parse_bytes) decode lossily, replacing invalid sequences with U+FFFD, and add
error 1:1 input is not valid UTF-8. Spans then index the decoded text.
D9. Column numbers in diagnostics
#Adopted. LINE:COL are 1-based; COL counts Unicode scalar values from the start of the
line (including indentation). The AST still carries byte spans; line/col is derived.
D10. Fixture 012 says 3:1 but the unclosed opener is on line 4
#Adopted. Fixture bug, fixed to 4:1. Line numbers are 1-based lines of the file the
diagnostic belongs to, counting the rules block.
B. Rule-block syntax
#D11. How is a short-form line tokenised?
#Adopted.
- The first token is the WHERE keyword (or directive).
- The pattern is the text after it up to the separator: the first whitespace-delimited
->token not preceded by ``. Leading/trailing whitespace is trimmed; every run of unescaped whitespace inside the pattern collapses to one space.\is a literal space that is never collapsed (so two literal spaces are\ \). A literal->in a pattern is written\->. - After
->: the TARGET token, then any mix ofname=valueattributes, bare slottokens (D22), modifiers, one
{ css }block andas NAME, in any order. The{ ... }block may appear anywhere after the target (the shippedcomments.selfputsasafter it). Quoted values use", with\"and\\as the only escapes.
D12. Trailing comments on rule lines
#05 §5 writes off // ! _ # disable one imported rule, yet # is a common pattern
literal (line # _ -> h1) and appears in CSS (#fee).
Adopted. A line whose first non-blank character is # is a comment. Otherwise a
trailing comment starts at a # that is (a) preceded by two or more whitespace characters,
(b) followed by whitespace or end of line, (c) outside quotes and outside { }, and
(d) not the first token after the directive keyword. Patterns never legitimately contain
two raw spaces (D11), so this is unambiguous.
D13. off PATTERN does not say WHERE
#Adopted. off [WHERE] PATTERN or off NAME. A single token equal to an as name of an
active rule in the current scope means that rule. Otherwise the argument is a pattern,
compiled with the current slot character; with WHERE it disables that rule, without
WHERE it disables every active rule in the current scope with that compiled pattern.
Only rules defined before the off line are affected; a later rule with the same pattern
is active again. No match: warning off: no rule matches 'ARG'.
D14. Where do use lines apply?
#05 §1 says "imports are applied in order, then the document's own rules", while 01 lets
use appear anywhere in the block.
Adopted. Textual order. A use line is expanded in place, depth first, exactly where it
appears. Later wins. A rule written above a use can therefore be replaced by the import.
Templates and docs put use first.
D15. What does an import contribute besides rules?
#Adopted.
slotnever leaks (01 already says so).titlenever leaks (every template sets its own title; it must not retitle documents).blanklines,indent,rules,projectand variables do apply to the importer; theimporter's own later
setwins (textual order, D14).scopestate does not leak: after theuseline the importer's current scope isrestored. Rules the import declared in its default scope go into the importer's current scope at the
useline; rules it declared underscope NAMEgo into NAME.
D16. Import cycles, diamonds and depth
#Adopted. The engine keeps the stack of canonical keys being imported. A use whose key is
already on the stack is skipped with warning import cycle: A -> B -> A (keys as
canonicalised, D17), reported in the file containing the offending use. Diamonds (the same
file reached twice by different paths) are not cycles; the file is applied again.
Import nesting counts toward the depth limit 64 (D55).
D17. How are import paths resolved when the engine never does I/O?
#resolver(path) -> string | null cannot resolve ./b.self inside sub/a.self without a base.
Adopted.
- Bare names without
/and not ending in.self(markdown,bbcode,comments,form,plain,workbook, anddatasince D80) are built-in templates, resolved inside the engine without calling the resolver. Unknown: errorunknown template 'NAME'. scheme://...is remote. Unlessallow_remoteis set: errorremote imports are disabled: 'URL'. If allowed, it goes to the resolver unchanged.- Everything else is a path. The engine joins it with the directory of the importing file's
key and normalises
.and..segments using/separators, producing a canonical key. The main document's key isoptions.path(defaultdocument.self). A leading/makes a path root-relative (the leading/is dropped from the key). The resolver receives the key.nullgives errorcannot resolve import 'PATH'(PATH as written). - The resolver is synchronous. Asynchronous hosts (workers, browsers) parse once, read
document.importsfor unresolved keys, fetch them, and parse again.
D18. Project and workbook defaults: mechanism, and set project off
#Adopted. The host passes options.defaults = [{key, level}] (level project or
workbook). Effective rule sources for a document, in order:
- if
defaultsis non-empty and the document's own block does not containset project off: each default, as if byuse; - otherwise, if the document has no rules block: the built-in
markdown; - the document's own rules block.
So a project default replaces the built-in default (the project file normally starts with
use markdown). project joins the kernel settings table.
D19. Unknown directives, malformed lines
#Adopted. Each is skipped with an error diagnostic at the line (col 1 for whole-line
problems): unknown directive 'X', missing '->' in rule, missing target,
empty pattern. Unknown modifier words are a warning unknown modifier 'X' and the
rule is kept without them. Invalid setting values are warnings
(invalid value for 'indent': 'X', allowed 1..16; blanklines keep|collapse;
rules show|hide; project on|off; slot D21) and are ignored.
D20. Full-form details
#Adopted.
rulewith an optional NAME. NAME is the rule'sasname. Anonymous full-form rules makeshort to full conversion lossless.
- Key lines are the following lines that are indented (any amount) and non-blank. A blank
or non-indented line ends the rule.
- Keys:
where,matchorre(exactly one),out(TARGET plus attributes and bare slottokens, no modifiers),
style(CSS declarations, no braces; repeated lines are joined with;),editor,doc(repeated lines joined with a space), and the modifiersverbatim,keep,bound,nest,group X,split "S" T,fold [N],input KIND [checked]. - Missing
where,match/reorout: errorincomplete rule, rule skipped.Unknown key: warning
unknown key 'K' in rule. editorvalue: comma-separated hintscolour C,icon "X",bold,italic,hide.Stored in the rule table only; no effect on HTML.
D21. set slot validity
#Adopted. Any single non-whitespace character except \`, . and #` (which would collide
with escapes, ... and the digit slot D24). Otherwise warning, ignored.
D22. Using one slot both as an attribute and as content
#[url]_[/url] -> a href=_1 in bbcode.self produced an empty link, because "a slot named in
an attribute is consumed". There was no way to say "and also show it".
Adopted. A bare slot token after the target (_1, $2) lists content explicitly.
If any bare slot tokens are present, the content is exactly those slots in that order.
Otherwise content is every slot not referenced by an attribute, in slot-number order.
bbcode.self now says [url]_[/url] -> a href=_1 _1.
D23. Slot references inside quoted attribute values
#bbcode.self had [color=_]_[/color] -> span style=_1, which yields style="red" (invalid CSS).
Adopted. Inside a quoted attribute value, a slot character followed by a digit 1..9 is
replaced by that slot's text; everything else is literal. Referencing a slot this way also
consumes it (D22). bbcode.self now says span style="color: _1".
D24. Ordered lists: 1. _ cannot match 2. y (fixture 004)
#Everything in a pattern is literal, so fixture 004's expected output was unreachable.
Adopted. New pattern token: the slot character followed by # is a digit slot that
matches one or more ASCII digits (greedy). It is not a capture: it has no number and never
becomes content or an attribute. It counts as one literal character for "longest wins".
Fixture 004, the 02 example and markdown.self now write _#. _ ($#. $).
D25. Slot numbering corner cases
#Adopted. _1.._9 are numbered slots; bare _ takes (highest number so far) + 1.
At most 9 slots. A duplicate number is error duplicate slot N. Two slots with no literal
between them is error adjacent slots in pattern (so __x__ needs set slot). An attribute
or bare slot token naming a slot that is not in the pattern gets warning
slot N not in pattern and is dropped (if that leaves no bare slot tokens, content falls back
to the unconsumed slots). _0 is a literal underscore followed by 0.
D26. Pattern shape constraints per WHERE
#Adopted.
inline: must start and end with a literal (errorinline pattern must start and end with a literal). May have zero slots.word: no slots or digit slots (errorword pattern cannot contain slots). Replaced by D133:one or two one-word slots and at least one literal; still no digit slot.
line: any shape, including a lone slot (which matches every line).block: must contain the separator...(a whitespace-delimited...), and both theopening and closing segments must contain a literal (error
block pattern needs '...',block pattern needs an opening and a closing literal). In other WHEREs...is literal.- Pattern length (D27) over 256: error
pattern longer than 256 characters.
D27. "Longest pattern" measure
#Adopted. The number of literal characters (Unicode scalar values) in the compiled pattern;
a digit slot counts 1; a numbered or bare slot counts 0. For block, opening plus
closing segment. Ties go to the rule defined last.
D28. Rule identity, numbering and naming
#Adopted. The compiled table is one list for the whole document, in definition order
after in-place import expansion (D14), across all scopes. A rule's id is its 1-based position.
Overridden and disabled rules keep their id and stay in the table (for the inspector).
as names match [A-Za-z][A-Za-z0-9_-]*; a later duplicate takes the name and the earlier
loses it, with warning duplicate rule name 'X'.
C. Matching
#D29. group semantics
#Adopted. After nesting, each sibling list is scanned; a maximal run of consecutive siblings
whose rules carry the same group X (compared as the exact string, so ul and ol differ) is
wrapped in one X element. Blank lines and @scope/@end lines do not break a run; hidden
nodes inside a run are included (they render nothing); any other node, including a paragraph,
breaks it. X may carry classes (group ul.tasks). The wrapper has no rule and spans from the
first member's start to the last member's end.
D30. nest semantics
#Adopted. Each body line has an indent level: (number of tabs) + floor(number of spaces /
indent), counted over its whole leading whitespace. A node from a nest rule claims every
following line whose level is greater than its own, until the first non-blank line whose level
is less than or equal. Claimed lines are parsed recursively (all line kinds, including blocks
and paragraphs) and become the node's children after its inline content. Blank lines inside the
claimed region do not end it. A more-indented line after a non-nest node is simply the next
sibling; indentation is not otherwise significant.
D31. Paragraphs: one per line or merged?
#Fixture 012 renders two consecutive plain lines as two <p>, which looks like one paragraph
per line; Markdown users expect soft-wrapped lines to merge.
Adopted. Consecutive plain lines (same parent, no rule matched) merge into one p,
joined by \n; a blank line, a rule-produced line, a block, or a scope directive ends it.
Inline rules never cross the join. Fixture 012 stands because an unclosed block opener
degrades to a standalone paragraph of its own line (D34), so the next line starts a new one.
D32. Line-rule matching
#Adopted. The subject is the line after indentation, with trailing spaces/tabs removed. A line pattern is anchored at both ends: its leading literal must match at the start and, if it ends with a literal, that literal must match at the very end. Middle slots are non-greedy up to the next literal; the last slot takes everything up to the trailing literal or line end. Line slots may be empty. Captured slot text of line and block rules is trimmed of surrounding spaces/tabs. Pattern spaces match exactly one space. Escaped characters cannot match literals.
D33. Block-rule matching
#Adopted.
- Opening and closing segments each match a whole line like a line pattern (D32), except
that each space in a block segment matches zero or more spaces/tabs. This is what lets the pattern of three backticks, space,
_match a fence written with no space before the language (fixture 006), and lets the trailing slot be empty. - Block rules are tried before line rules, longest first (D27). An opener only wins if its
closer is found; otherwise the next candidate is tried.
- Verbatim bodies end at the first closing line. Non-verbatim bodies count nested
openers of the same rule, so
::: a/::: b/:::/:::nests correctly. A line that matches the closing segment is always a closer, even if it also matches the opener (:::against::: _). - The body is every line strictly between opener and closer. Verbatim body text is each line
followed by
\n(so a non-empty body ends in\n), with the opener's exact leading whitespace string removed from each body line where present. Non-verbatim bodies are parsed recursively as a body. - Single-line form: if the opening segment is all literal (no slot) and a line starts
with the opening literal and ends with the closing literal, with at least one character between, it is a one-line block whose body is the text between (trimmed). So
<!-- note -->and$$ x^2 $$work. - Slots in the opening or closing line are only available to attributes; unconsumed ones are
discarded (the body is the content).
D34. Unclosed block
#Adopted. Warning unclosed block: expected closing CLOSE for rule N at the opener
(CLOSE is the closing segment as written). The opener line becomes a standalone paragraph of
its own text (inline rules apply); parsing continues with the next line.
D35. Inline matching
#Adopted. One left-to-right pass per line of text:
- At each position, candidates are the inline and word rules whose first literal matches
there, ordered by length (D27) descending, then definition order descending.
- The first candidate that matches wins; the pass continues after it. If none, one
character becomes text. Leftmost start wins; at the same start, longest pattern wins.
- A slot is non-greedy: the next literal is searched from the slot start, skipping escaped
characters, never past the end of the line; the first occurrence (after run alignment) is the only one tried. If that leaves a content slot empty, the rule fails at this position (so
[](x) [a](b)does not run on to the second link). A slot used only by attributes may be empty (is an image with no alt). - Run alignment: if that next literal is two or more copies of one character (
**,~~,>>) and the same character continues right after the found occurrence, the occurrence slides right to the end of that run. This is what makes***c***give<strong><em>c</em></strong>(fixture 002) and lets<<<<a>>>>nest. Single-character literals never slide (so(see [a](b))keeps its last)).boundand word-boundary checks apply to the match found this way; failing them fails the rule at this position (no retry with a later closer). - Unless verbatim, content slots are scanned recursively with the same table; attribute
slot values are escape-processed text and are not scanned.
- Known, documented simplifications versus CommonMark: no flanking rules (use
bound,D36), code spans do not take precedence over an earlier opener, a closer found inside what would be a nested construct still closes.
D36. Intraword underscores (snake_case_name becoming emphasis)
#Adopted. New modifier bound: the match may not start right after, or end right
before, a letter, digit or _. markdown.self uses it on the _ rules. word rules always
behave this way on any side where the token's own edge character is a letter, digit or _
(so TODO: does not match inside xTODO:, and its trailing : needs no boundary).
D37. What does a named scope contain?
#Adopted. Scope NAME's table is the final default-scope table with scope NAME's declarations
applied on top, in order: a rule with the same WHERE and pattern replaces the default one
within NAME only; off inside scope NAME disables within NAME only.
D38. Word rule and no-slot inline rule content
#Adopted. A word node's content is the matched token. A no-slot inline rule has empty
content unless keep. keep on any rule makes the content the full matched source text
(delimiters as plain text, slot parts scanned as usual). A slotted word rule (D133) follows
the inline rule here, except that its word is never scanned.
D. Output
#D39. HTML serialisation, byte for byte
#Adopted.
- Each top-level node that renders something is followed by
\n(a top-levelhiddennode emits nothing at all). Nothing else is added between tags.
- Text escaping:
&<>. Attribute values:&<>", always double-quoted. - Attribute order:
classfirst (if any), then the rule's attributes in written order, thenengine-added attributes (
type,checked,disabledon inputs;data-target;data-self-plugin). - Class order: engine class (
self-unknown, plugin class such asmermaid), then targetclasses, then
class=attribute words, then the rule's style class; duplicates removed, first occurrence kept. - Void elements (
area br col hr img input wbr) are written<x>and render no content. - An attribute whose value came from a slot and is empty is omitted. A quoted empty value
(
alt="") is kept. - A
codenode produced by ablockrule is written<pre><code ...>BODY</code></pre>. - Paragraph lines are joined with
\ninside the<p>.
D40. The default rules for a file without a rules block
#Adopted. Exactly use markdown, unless host defaults apply (D18).
D41. Style class and CSS output format
#Adopted. A rule with a { ... } block gets a style class (even if every declaration is
later dropped as unsafe): its as name, else self-rN (N = rule id). Since D264: when
another rule writes that name as a class of its own elements, the style class is self-rN,
and the rule's elements carry the name and self-rN. render_html returns css as, for each styled rule that is active (not
overridden, not disabled) in id order:
/* FILE:LINE */
.CLASS { DECL; DECL }
FILE is the rule's file key (template name for built-ins). Declarations are split on ;
outside quotes and parentheses, trimmed, empties dropped, joined with ; . Rules whose every
declaration was dropped emit nothing.
D42. CSS safety
#Adopted. A declaration is dropped with warning unsafe css dropped: 'DECL' if it
contains (case-insensitive) url(, image(, image-set(, expression(, javascript:,
@, \`, <, >, { or }`. No document can make the browser fetch through CSS. The same
check applies to a style attribute value (the whole attribute is dropped with warning
unsafe style attribute dropped).
D43. Element and attribute policy
#ARCHITECTURE says "element and attribute names are allowlisted" but the spec itself uses
non-standard attributes (summary=_1, lang= on code).
Adopted.
- Elements: allowlist `a abbr address article aside b bdi bdo blockquote br caption cite
code col colgroup data dd del details dfn div dl dt em figcaption figure footer h1 h2 h3 h4 h5 h6 header hgroup hr i img input ins kbd label li main mark nav ol p pre q rp rt ruby s samp section small span strong sub summary sup table tbody td tfoot th thead time tr u ul wbr
. Anything else is not an element. The listed dangerous names (script iframe object embed style link meta base form) give warningtarget 'X' is not allowed` unless the host setsunsafe_html, which admits them as elements. - Attributes: names must match
[a-z][a-z0-9-]*, must not start withon, and must notbe
srcdoc,formaction,action,http-equivorxmlns. Otherwise warningattribute 'X' is not allowedat the rule, and it is dropped. - URLs (
href src cite poster background longdesc): after stripping ASCIIwhitespace and control characters, a scheme (text before the first
:that precedes any/ ? #) must be one ofhttp https mailto tel ftp, ordata:image/(png|gif|jpeg|webp|avif|svg+xml)onimg srconly. Otherwise the attribute is dropped with warningunsafe url dropped. No scheme means relative and is fine.
D44. Target resolution and unknown targets
#Adopted. Order: reserved hidden and text; a registered plugin (built-in Rust plugins,
plus names the host registers from JS, D48); an allowlisted element; otherwise unknown.
The unknown-target warning is reported once per active rule at the rule's line (fixture
013: 2:1), not per use. An unknown node renders `<div class="self-unknown ..."
data-target="NAME">` with its content rendered normally (inline rules apply); the rule's
attributes are dropped. When produced by an inline rule it is a <span> instead of a <div>.
D45. input=KIND modifier
#Adopted. Rendered by the core HTML renderer (not a plugin): <input type="KIND"> prepended
as the first child, with checked when given, and disabled unless the host enables
forms. KIND ∈ checkbox radio text. No name attribute; collect() keys values by the
label's text. A rule targeting input directly is just the HTML void element.
D46. Output of plugin targets that produce plain text (var, emoji)
#Adopted. The text is emitted bare; if the rule has target classes or a style class, it is
wrapped in <span class="...">.
D47. When do plugins run?
#Render functions only receive doc, yet plugins need the registry, resolver and settings.
Adopted. Plugins run at the end of parse, as an AST transform: each node whose target
resolves to a plugin is replaced by the plugin's output, either new nodes (which keep the
original span and rule) or a Raw node holding trusted HTML. Renderers stay pure functions of
the AST. The AST JSON therefore shows plugin output.
D48. Plugins registered from JavaScript
#The engine half of a plugin is Rust (04 §2), yet the npm package has a "plugin registry".
Adopted. JS registers client halves (hydrate). Their names are passed to parse as
options.plugins so they are not unknown targets. For such a name the engine emits a generic
marker: <div data-self-plugin="NAME"> (block or line rule) or <span data-self-plugin="NAME">
(inline), with classes and safe attributes, containing the escaped content (verbatim text if
verbatim). The client half enhances it after render.
D49. Built-in plugins, exact output
#Adopted.
emoji: content is a short name (trimmed); the emoji character from the bundled table,else the matched source text unchanged. The table lives in
selfscribe-pluginsand is kept small (about 150 common GitHub names) for the WASM budget. It must contain at leastsmile😄,heart❤️ (U+2764 U+FE0F),+1👍,rocket🚀,tada🎉,warning⚠️ (U+26A0 U+FE0F).mermaid:<pre class="mermaid" data-self-plugin="mermaid">BODY</pre>(escaped).math: from an inline rule<span class="self-math" data-self-plugin="math">TEXT</span>;from a block rule
<div class="self-math self-math-display" data-self-plugin="math">BODY</div>(body trimmed).csv,tsv: body split into non-empty lines, fields split on,or tab;"quoting perRFC 4180 within a line (
""is a quote). Unquoted fields trimmed. Output<table><thead><tr><th>..</th></tr></thead><tbody><tr><td>..</td></tr>..</tbody></table>;<tbody>is omitted when there is only a header. Cells are escaped text, never parsed.var: content is the variable name (trimmed). Value lookup: hostvars, then documentsettings and variables (including
title). Missing: empty, no diagnostic.include: content is a path, resolved likeuse(D17). Its body is parsed under thecurrent scope's table and replaces the node; the included file's own rules block, if it has one, is laid over that table for its body only, and its relative links and pictures are read from its own folder (changed by D263: until then its rules block and settings were ignored). Every resulting node carries the include line's span (so editor mapping stays in one file). Cycles: warning
include cycle: A -> B -> A(chain from the first occurrence of the repeated key); unresolved: errorcannot resolve include 'PATH'. A cut or unresolved include renders nothing. Inside an inline rule: warninginclude needs a line or block rule, rendered as text.hidden: renders nothing, stays in the AST.
D50. Decorations shape
#Adopted. decorations(doc[, from, to]) returns [{span, class, rule, kind}], sorted by
start ascending, then end descending:
kind: "node", classself-t-TARGET: every element node produced by a rule.kind: "mark", classself-mark: every dropped delimiter range (literal parts of a match notkept); class
self-escapefor an escaping backslash; classself-directivefor@scope/@endlines.kind: "rules": rules-block tokens with classes `self-rb-fence self-rb-comment self-rb-keywordself-rb-pattern self-rb-slot self-rb-arrow self-rb-target self-rb-attr self-rb-modifier self-rb-style`.
The optional range limits output to decorations intersecting it (06 §7).
D51. Folds shape
#Adopted. [{kind, level, span}] where kind is section (from fold N), children
(bare fold on a line rule: the following more-indented lines), block (bare fold on a
block rule: its body and closer), or rules (the rules block, always present when there is
one). A section runs to the line before the next node with fold level ≤ N, or the end, with
trailing blank lines excluded. Span start is the end of the header line; span end is the end
of the last included line. Empty ranges are not emitted. Fixture .folds.txt files list
KIND LEVEL FIRSTLINE-LASTLINE (header line to last line, 1-based; LEVEL 0 for non-section).
D52. AST JSON
#Adopted. render_ast(doc) returns
{"nodes":[...],"folds":[...],"diagnostics":[...],"settings":{...},"rules":[...],"imports":[...]}
element: {"kind":"element","target":"p","classes":[],"attrs":[["href","x"]],"children":[],"span":[0,5],"rule":3,"scope":null}
text: {"kind":"text","text":"hi","span":[0,2]}
raw: {"kind":"raw","html":"<pre>..</pre>","span":[0,9],"rule":4}
Keys in exactly that order; attrs are ordered pairs. rules entries carry `id where pattern
target classes attrs content modifiers style name scope origin{file,line,col,level}
overridden_by disabled_at editor doc. Level is builtin|project|workbook|import|document`.
D53. JS spans
#Adopted. The engine's spans are UTF-8 byte offsets everywhere, including AST JSON. The JS
package converts decorations, folds and diagnostics to UTF-16 code-unit offsets for
CodeMirror (toUtf16 helper, also exported).
D54. blanklines keep
#Adopted. Each blank line lying between two top-level nodes emits a top-level <br>.
Leading and trailing blank lines of the body, and blank lines inside nested content, emit
nothing. Paragraph merging is unchanged.
D55. Hard limits: what "degrades to text" means
#Adopted.
- Depth of a node = 1 + number of
nest, block and include ancestors (group wrappers do notcount); top-level nodes have depth 1.
- Depth 64 (nest, non-verbatim blocks, includes and imports combined): a line that would
create a node at depth 65 or more is parsed as a paragraph line of the deepest allowed parent; one warning per document
nesting deeper than 64 levelsat the first such line. An import or include past the limit is skipped with the same warning. - Inline recursion 32: a line's text is scanned at inline depth 0 and a match's content
at depth + 1. Content that would be scanned at depth 32 is emitted as plain text instead; one warning per document
inline nesting deeper than 32 levels, at that content's start. - Pattern length 256: D26.
D56. Diagnostic format in fixtures
#Adopted. One per line: SEVERITY [FILE:]LINE:COL MESSAGE; FILE is present only when
the diagnostic belongs to another file (import key). Severities: error, warning,
info. Order: rules-phase diagnostics in processing order (imports depth-first), then the
unknown-target and refused-target warnings for active rules in id order, then body
diagnostics in the order the parser meets them (plugin diagnostics last, in document order).
Positions: a rules-block diagnostic points at the first token of its line (for a full-form
rule, the rule line); an unknown-target or attribute diagnostic points at the rule; a body
diagnostic points at the start of the construct (block opener, directive line content,
inline match start, the include line), after indentation. Unsafe URL and style diagnostics
point at the start of the match that produced the node. **If a fixture has no .diag.txt, it must produce zero
diagnostics.** CLI exit code: 1 if any error, 0 otherwise (--strict: warnings too).
D57. Fixture normalisation and discovery
#The README said "collapse runs of whitespace between tags" without saying to what.
Adopted. normalise(s): convert \r\n to \n; replace every match of
>[ \t]*\n\s*< with ><; trim. Applied to both sides. Spaces between inline tags on one line
stay significant. A fixture is every top-level NNN-name.self whose stem contains no .;
x.base.self files and subdirectories are support files. The fixture's path option is its
file name; the runner's resolver reads keys relative to spec/conformance/. Optional
companions: .diag.txt, .css (compared normalised the same way), .folds.txt.
Runners use the full built-in plugin set, allow_re off, allow_remote off, forms off,
unsafe_html off, no host vars.
D58. Where are diagnostics produced, parse or render?
#Adopted. All at parse (URL, attribute and CSS checks included). Renderers never add diagnostics.
E. Templates and examples
#D59. Blockquote grouping produced nested quotes
#line > _ -> blockquote group blockquote renders <blockquote><blockquote>...
Adopted. It is line > _ -> p group blockquote in 02 and markdown.self.
D60. Markdown table separator rows
#|---|---| rendered as a data row. Adopted. markdown.self adds hidden line rules
(|--$|, | --$|, |:--$|, | :--$|) after the row rule. They are longer than | $ |, so
they win on separator rows, and hidden nodes are transparent to grouping (D29), so the table
stays one table. Header cells remain td in v1.
D61. Markdown autolinks <url>
#<$> -> a href=$1 also matches a < b > c in prose and cannot show the URL as text unless
D22 is used. Adopted. Removed from markdown.self. v1.1 may add a URL-shaped slot.
D62. set title in templates
#Adopted. Kept (the "New" menu shows it); not inherited (D15).
D63. Regex rules (re)
#Adopted. Allowed for inline and line only. line regexes must match the whole
subject; inline regexes are tried at each position with length = match length for
priority. Numbered groups 1..9 are slots. Without the re cargo feature or with allow_re
off: warning regex rules are disabled, rule skipped. Bad regex: error invalid regex: MSG.
D64. Plain-text renderer
#Adopted. Rust and CLI only (render_text), not part of the four-function API: text content
of each top-level node, separated by blank lines; list items prefixed - ; hidden omitted.
Not conformance-tested.
D65. render_html return shape for hybrid mode
#Hybrid mode needs each block's HTML separately. Adopted. render_html(doc) returns
{html, css, blocks: [{span, html}]}, where blocks are the top-level nodes (html is
blocks joined, each followed by \n). Still four functions.
F. Clarifications from the Phase 0 fixture review
#D66. Review round 1
#The reviewer found three fixture defects (011 folds, 044 lines, 061 empty row), fixed, and these under-specified points. Adopted:
splitnever splits on an escaped separator (D5); pieces are escape-processed aftersplitting and trimmed. No piece is ever dropped: empty content gives one empty cell.
- CSV quoting: a field whose text, after trimming leading spaces, starts with
"isquoted; whitespace outside the quotes is ignored.
- Refused targets render exactly like unknown ones (
self-unknown) and report onlytarget 'X' is not allowed. The unknown-target message isunknown target 'X'. - Import and include cycle chains start at the first occurrence of the repeated key.
- Diagnostics raised while parsing an included body carry the included file's key and
its own line and column (the nodes still carry the include line's span).
blanklines keepcounts top-level nodes after grouping: blank lines inside a groupwrapper emit nothing.
- Paragraph lines are their text after indentation with trailing spaces and tabs removed.
- Folds are listed by span start ascending (the rules fold comes first).
- CSS origin LINE is the rule's origin line (the
ruleline for full form). - Depth limit wording (D55): a line that would create a node deeper than 64 becomes
paragraph text inside the depth-64 node.
- D60 wording:
|--$|and| $ |are both length 4 but can never match the same line. - D34: a block opener that fails for lack of a closer does not get a second chance
as a line rule; it becomes a standalone paragraph.
- Full-form key diagnostics (
unknown key, a badinputvalue, and so on) point at thekey line's first token;
incomplete rulepoints at theruleline. includefrom an inline rule renders the matched source text unchanged (escaped),with the warning at the match start.
D67. Review round 2
#Adopted:
- URL schemes are compared ASCII case-insensitively (
HTTPS:is allowed); the attributevalue is emitted as written.
- Conformance runners pass raw fixture bytes to the byte-level entry point (D8). The JS
package's
parseaccepts aUint8Arrayas well as a string, with the same lossy decode anderror 1:1 input is not valid UTF-8. - A built-in template's file key is its bare name (
workbook), in diagnostics (D56),origins and CSS comments (D41).
..above the root is kept in the key (../../outside.self). Hosts must refuse keyscontaining a
..segment (return null), so a document can never read outside its project. The conformance resolver does exactly that..diag.txtand.folds.txtcomparison ignores blank lines and trailing whitespace.
G. Phase 1 (engine) decisions
#D68. Performance budget: how it is measured, and the native allocator
#The 03 §4 budget (10 000 lines under 5 ms native) was first missed at about 14 ms. The profile was flat: allocations (91 k per parse) and moving 176-byte nodes dominated. Adopted:
Node.targetandNode.textareStr(small-string optimised, 24 bytes, up to 22 bytesinline, longer text shared);
classesandattrsareFew<_>(one pointer, no allocation when empty); attributes are(Str, Str).Node.marksmoved to `Document.marks: Vec<(Span, RuleId)>`. Grouping happens as nodes are emitted. Allocations per parse of the bench document fell from 91 k to 34 k.selfscribe-corestays allocator-agnostic and dependency-free. **Native binaries (theselfCLI,the Tauri desktop shell, and the benchmark) use mimalloc as the global allocator.** The budget is measured as shipped.
- The benchmark is
selfscribe-conformance/tests/bench.rs(a dense 10 000-line Markdown document:inline markup on most lines, lists, tables, code blocks), best of 60 parses, pinned to one performance core with
engine/scripts/bench-pinned.ps1(hybrid CPUs otherwise land on efficiency cores and double the time). - Result at the Phase 1 gate (i5-12450H, machine under 70-90 % load from other programs):
4.49-4.63 ms pinned with mimalloc; 5.6-6.2 ms pinned with the Windows system allocator; about 9 ms on an efficiency core.
D69. Details the tracks fixed that the spec left open
#Adopted (all implemented and tested):
- JSON (D52):
settingsis{"rules","blanklines","indent","title","project","values":[[k,v]]};rule
attrsvalues are written as in rule syntax (_2,"t _1",noopener);modifiersis an object and a barefoldis0;styleisnullor{"class","decls"}. - Decorations (D50):
Rawplugin output that carries a rule getsself-t-TARGETfromits rule, so Mermaid and math blocks are highlighted in source mode.
- Messages not fixed elsewhere (exact text):
missing import path,missing setting name(errors);invalid scope name 'X',invalid rule name 'X',unknown editor hint 'X'(warnings);more than 9 slots in pattern,regex rules need inline or line(errors);invalid value for 'group'|'split'|'input'|'where': 'X'(warnings); a straychecked, or modifiers written in a full-formoutline, giveunknown modifier 'X'. - Rules phase: block rules have empty
contentunless bare slot tokens are given;\in a block segment is a literal space;
OptWscounts 1 toward priority length; a digit slot counts as a slot for "adjacent slots"; import records de-duplicate by key, include built-in targets as resolved, and exclude the implicitmarkdown; templates are levelbuiltineven when reached through a project default;matchandretogether are anincomplete rule; an unclosed rules fence is reported at the fence line (D3's "1:1" holds when the fence is the first line);fmtleaves any rule that has its own diagnostics exactly as written. - Body: the depth warning fires at the first content line beyond depth 64;
@scopeinside
nest-claimed lines is local to that region like block bodies; the single-line block form needs both segments slot-free;keepwithsplitkeeps the split; the input control node has an empty span at the match start and no rule; the unclosed-block warning names the highest-priority opener that failed; plugins run children first; plugin output spans outside the plugin node are replaced with its span; an include of a remote URL withoutallow_remote, or of an unknown template, iscannot resolve include 'PATH'; include keys joinDocument.imports; group and split targets that are not allowlisted elements render as unknown without a diagnostic; anrecontent slot that spans the whole match is plain text (no self-recursion). - Renderer: a
*/inside a CSS origin file key is written* /; render depth is cappedat 256 (deeper subtrees render their text only); an empty csv body is
<table></table>; math from a line rule renders like block math.
H. Phases 2 to 4 (surfaces, editor, desktop, site)
#D70. Choices made while building the surfaces
#Adopted:
- Client plugins (
selfscribe/client): Mermaid runs withsecurityLevel: 'strict', host-onlytheme keys, and its SVG is stripped of anything that could fetch before insertion, so a document can never cause a network request (04 §4). KaTeX renders MathML by default (no stylesheet needed); hosts can switch to HTML output.
- CLI:
self fmtdefaults to--short;--css separateneeds-o. Short to full to shortis semantically lossless (same compiled rules and output) but not byte-identical: column alignment and trailing comments move (comments become their own
#lines). - WASM is built with the
refeature (about 22 KB gzipped); the budget is met with it.fmt(source, { full })is part of the JS package for the rule wizard. - Editor keys: browsers reserve Ctrl-N/W/Tab, so the editor also binds Alt-N, Alt-W and
Alt-. / Alt-, .
insertIntoRulesBlockon a document with no rules block and no project defaults writesuse markdownfirst, so creating a block never silently drops the implicit Markdown rules (D40). - Desktop: the Rust side reads and writes only paths the user picked in a native dialog
(grants remembered for recents); writes are atomic; the open folder is watched and changed files reload clean tabs, warn on dirty ones and reparse importers. The native engine returns the same data as the WASM binding and the editor code is unchanged.
- Site: the spec is rendered by Selfscribe itself with the built-in
markdownrules.
D71. Known limitations carried into v1.1
#- A code span cannot end right after a backslash (`
` ``): the escape rule (D5) stops theclosing backtick. The spec text uses such spans in a few places; the site renders them imperfectly. Options for v1.1: allow a verbatim rule's closer to match an escaped character, or a double-backtick code span rule in
markdown.self. - Inline rules never cross a line break (02 §2), so
**bold**split across soft-wrappedlines stays literal.
- The editor drops a parse result whenever the text changed during the parse; typing
continuously faster than debounce plus parse time delays highlighting until a pause.
- On the desktop, each native parse moves the source and the result as JSON on the main
thread (the web path does this in a worker). Fine for normal documents; heavier on very large ones.
editor iconhints (D20) are stored but not shown.
I. Rulebook library
#D72. Saved rulebooks: use NAME beyond the built-ins
#Users want to keep their own rulebooks ("my-notes", "house-style") and use them by name, like
use markdown. D17 made every non-built-in bare name an error.
Adopted.
- A bare name (no
/, not ending in.self) that is not a built-in template and matches[A-Za-z0-9][A-Za-z0-9_-]*is a library rulebook. The engine asks the resolver for the keylib:NAME. Built-ins always win; a library cannot shadow them. - If the resolver has no such rulebook: error
unknown template 'NAME'(unchanged text, soa typo reads the same as before). Other bare names keep that error without a resolver call.
- The file key of a library rulebook is
lib:NAME(diagnostics, origins, CSS comments). Itsrules have level
library(new value in D52's level list). - A library rulebook may
usebuilt-ins and other library rulebooks by name. A relative orroot path inside it is error
cannot resolve import 'PATH'without a resolver call (a library has no directory).includefollows the same rules. - A library rulebook is an ordinary
.selffile (text behind every GUI). Hosts store them wherethey like: the web editor in the browser's storage, the desktop app and the CLI in a folder (
self --library DIR, default~/.selfscribe/rulebooks, fileNAME.self). - Conformance runners map
lib:NAMEtospec/conformance/library/NAME.self.
J. Plugins, embeds and the editor (v1.2)
#D73. The host plugin catalog
#Users want diagrams (flowcharts, UML), charts, LaTeX, music notation and embedded pages, and a manager to switch them on and off. 04 §2 already allows plugins registered from JavaScript (D48); nothing here changes the engine, the kernel or the conformance suite.
Adopted.
- New plugins are client halves only (D48), shipped in the
selfscribe-pluginspackage:a catalog of
PluginInfo(name, title, category, the rule lines a document adds to use it, examples, settings, requirements) plus acreate()for the client half. The engine emits the generic marker for them; the document stays a static, readable file without them (a chart is still its data, a UML diagram still its text). - The initial catalog:
mermaidandmath(the existing built-ins, with diagram-kindexamples: flowchart, sequence, class/UML, state, ER, Gantt, pie, mind map, timeline),
chart(bar, line, area, pie from CSV-like text, rendered to SVG with no library),graphviz(DOT),uml(nomnoml),music(ABC notation),qr,embed,html,latex. - Enabling is host state, never document state. The editor keeps it in
preferences.self(text behind every GUI):
set plugin-NAME on|off, and a plugin's settings asset plugin-NAME-KEY VALUE. Only enabled names are passed toparse(options.plugins), so a disabled plugin's target is an unknown target with the usual warning (D44); the editor offers "enable the plugin" as the fix. - Third-party renderer output (SVG from Mermaid, Graphviz, nomnoml, abcjs) goes through the
inert sanitizer (no resource-loading elements, no
on*, no external URLs) before it reaches the page, as Mermaid's does today. - 04 §4 still holds: no document triggers a network fetch by itself. A plugin may load
its own library lazily from the host's bundle; it may reach the network only for
embed, and only as D74 says.
D74. embed, html and latex: the three plugins that need a policy
#Adopted.
embed(content: a URL). Onlyhttps:URLs; anything else renders the URL as text.The client first shows a placeholder card (site, URL, a "Load" button): nothing is fetched until the user clicks, unless the site is listed in
set plugin-embed-allow HOST ...(exact host names, default empty). Known sites are rewritten to their embed form (YouTube viayoutube-nocookie.com, Vimeo, OpenStreetMap, CodePen, Figma, Loom). The frame is `<iframe sandbox="allow-scripts allow-same-origin allow-popups allow-presentation" referrerpolicy="no-referrer" loading="lazy">`: the page runs with its own origin, never ours, and cannot navigate the editor.iframeas a plain target stays refused (D43);embedis the supported way.html(content: an HTML fragment, verbatim). Rendered in<iframe sandbox="allow-scripts">(a unique opaque origin) whose
srcdocstarts with a CSP `default-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:; script-src 'nonce-N'`, where N is random per render and belongs only to the host's measuring script (it reports the height to the parent). Document scripts andon*handlers do not run and nothing can be fetched.set plugin-html-scripts onalso allows inline document scripts (still opaque origin, still no network).latex(content: a LaTeX body, or a whole document with\documentclass). Rendered bythe host: the desktop app runs the local TeX installation (
lualatexby default;set plugin-latex-engine pdflatex|xelatex|lualatex) in a fresh temporary folder with--no-shell-escape,--saferfor LuaTeX,openin_any=p/openout_any=p, the MiKTeX package installer disabled, and a 30 s timeout; the PDF becomes SVG and is shown as an<img>(nothing in it can run or load). Results are cached by the hash of engine, preamble and body. Where no TeX is available (the web, or no installation) a math-only body falls back to KaTeX and anything else shows the source with a note. Known limit: TeX can still read files the user can read (\input{/abs/path}) into the picture it draws; it cannot write outside its folder, run programs, or reach the network.
D75. Editor: syntax in hybrid mode, sidebar side, hydrated hybrid widgets
#Adopted.
- Hybrid mode gets a Show syntax toggle (
set hybrid-syntax hidden|shown, a toolbarbutton, a command, Ctrl-Shift-M). Shown: no block is replaced by a widget; every line is source, styled like the rendered document (the rule's element styles and its
{css}class on the node's range, headings sized, delimiters visible but muted), and blocks whose output is not text (plugin targets, images, tables) also get their rendered widget under the source. Hidden: hybrid as before (06 §1). - Hybrid widgets are hydrated like the preview (plugins run inside them); a widget whose
HTML is unchanged keeps its hydrated DOM.
- The activity rail and the side panel are on the same side:
set sidebar left|right,default
left(rail at the window edge, panel between the rail and the document). - As built (track Y).
- Ctrl-Shift-M was "Next mode" since v1; it now shows or hides syntax, and Next mode
moves to Alt-M. From a mode other than hybrid, the syntax command switches to hybrid with syntax shown.
- The rule's
{css}reaches the source as inline styles computed from its declarations(D52
style.decls), not as its class: text declarations on the node's range; for block and line rules, background and borders on the node's lines, as one box. Layout declarations (display,position, margins, sizes, vertical padding) are dropped, so a line stays a line. - Element looks come from the rule table:
verbatimblock rules are code cards, `groupblockquote
a quote bar,group tableortrmonospaced rows,hidden` muted lines. - Non-text output means plugin markers,
img,table,hr,svg,iframe,video,audio,canvas,pictureandobject. A block that also has text shows only those parts under its source. The widget under the source keeps its last rendering while the block is edited, until the next result. - Toggling keeps the caret line (or, when it is off screen, the first visible line) at
the same height on screen.
- Ctrl-Shift-M was "Next mode" since v1; it now shows or hides syntax, and Next mode
D76. Large documents: a virtualised preview and a packed worker result
#A 2 MB Markdown file (a converted manual: a table of contents of 1 200 links, headings, code,
tables) froze the preview for seconds and kept it slow. Measured causes: every result was
re-parsed as one <template> of the whole document and every block mounted (66 000
elements; 2.5 s to first paint, 5.5 s to enter split mode); structured-cloning the worker
result object by object cost the main thread about 200 ms per parse (150 000 decorations);
the document was parsed twice on open; the word count, the outline and the inspector did
O(document) work on every change or caret move.
Adopted.
- The preview is virtualised (
VirtualPreviewinselfscribe-cm6, 06 §7): only blocks inand near the viewport are in the DOM, between spacers sized from a height per block (measured once mounted, cached by the block's HTML; estimated by element kind and length before). The block at the top of the viewport is the scroll anchor: estimate errors go into the top spacer, never into a visible jump. A top-level list longer than 40 000 characters and 200 items windows its items the same way (spacer items are
aria-hiddenand have no marker; anolkeeps its numbering throughvalue). The rendered content of every mounted block is the engine's HTML, unchanged. - Split-mode scroll sync reads block positions from the virtualiser (binary search over
measured or estimated offsets); entering split from the preview scrolls the editor to the block being read.
- Printing mounts every block for the print and virtualises again afterwards; **Select
all + Copy in the preview copies the whole document (HTML and plain text); Find** in the preview opens the editor's search in split mode (the preview follows the match). The browser's own find only sees mounted blocks.
selfscribe/workertransfer (06 §2): the worker posts decorations and block spans astyped arrays (transferred) and omits
htmlwhen it is the blocks joined (D65, checked by length);connectWorkerrebuilds the sameWorkerResult, withhtmljoined on first read. The API and its types are unchanged; the oldresultmessage is still accepted. An idle worker parses a small sample once, so the first large parse does not run cold code.- Editor chrome: one parse per text (the store and the parse driver share it), the word
count runs in slices that yield to the event loop, the outline is computed per result and redraws only rows that changed, and the inspector indexes a result's nodes once.
- Gates (
apps/editor/e2e/large.spec.ts, a generated 2 MB document): first contentpaint under 1.5 s with no long task over 200 ms after it; preview scroll frame p95 under 16 ms; each mode switch under 500 ms; typing in split mode, main-thread p95 under 16 ms.
D77. Link targets in the Markdown template, and following # links
#Documents converted from HTML (for example a documentation set flattened into one file) mark
link targets with empty anchors, <a id="NAME"></a> or <a name="NAME"></a>, and link to
them with [text](#NAME). The Markdown template showed those anchors as literal text, and
the editor did not follow # links.
Adopted.
- The built-in
markdowntemplate gains two inline rules:<a id="$"></a>and<a name="$"></a>, both-> span id=$1(an empty, invisible target). No other raw HTML is interpreted; this is the one idiom such conversions need. - Hosts follow
#NAMElinks inside the document: to the element with thatid, else to theheading whose text slugifies to NAME (lower case, spaces to
-, punctuation dropped, as GitHub does). The editor scrolls the preview to it, and in source and hybrid modes moves the caret there (Ctrl/Cmd-click in hybrid).
K. Search (v1.3)
#D78. Find, find in the preview, search across files, and structure filters
#CodeMirror's search panel scanned a 2 MB document synchronously, could not count, stay in a selection or look at structure, and the preview's Ctrl-F only opened it in split mode (D76). Adopted (editor only; no engine, kernel or template change, 06 §8):
- Find bar (Ctrl-F, Ctrl-H): one bar over the document in every mode. Match case, whole
word (an edge that is a letter, digit or
_must not touch another), regular expression (JavaScript syntax,gmflags,iunless case sensitive; replacements expand$&,$1,$<name>,$$,\n,\t); "n of m"; replace, and replace all as one transaction (one undo step); in selection (the ranges selected when it is switched on, mapped through edits). Empty matches are never matches. - Speed. Matches are found in slices of about 8 ms that yield to the event loop and kept
as typed arrays for the text they were found in; between searches, what is drawn is mapped through the edits since, for the visible ranges only, and a match an edit touched is dropped until the next search (once typing pauses: 40, 150 or 350 ms by document size). At most 250 000 matches are kept ("250 000+").
- Find in the preview searches the rendered text of every block from the engine's block
HTML, not the DOM, so blocks the virtual preview has not mounted count too. Rendered text is the text content of the HTML without plugin output (
data-self-plugin),<style>and<script>, with a no-break space read as a space. Match k of a block is the k-th match of that text; mounted blocks find it again in their DOM (the same text), highlight it with the CSS Custom Highlight API (no DOM change, so measured heights and hydrated plugins are untouched), and next / previous scroll the virtualiser to it, including items of windowed long lists (VirtualPreview.listItems,scrollToListItem). In split mode the bar searches the pane that has the focus, with a Source / Preview switch. - Hybrid: going to a match selects it, so its block shows its source (06 §2); matches in
the rendered text of other widgets are highlighted like the preview's.
- Structure filters limit where matches count, from the engine result of the current
text (D50 node decorations and their rules, D52 rule table, the outline), never from regexes over the source. A filter line is terms separated by spaces:
in:heading|code|link|quote|list|table|rules,target:NAME(nodes whose target is NAME),rule:NAME(nodes of the rule named NAME withas, else of rules with that class, else rule id NAME),section:TITLE(quoted if it has spaces: from each heading whose text is TITLE, else contains it, to the next heading of the same or a higher level). A leading-excludes.in,targetandruleterms are one union,sectionterms another; the two intersect each other and "in selection"; excluded terms are subtracted last. A node's range counts without its own rule's dropped delimiters (self-mark), soin:headingdoes not find##.in:codeiscode pre kbd samptargets andverbatimrules. In the preview a term becomes the elements whose text counts (h1-h6,target:h2ash2,rule:NAMEas the rule's element and classes);section:and terms that are not elements act on whole blocks;in:rulesrenders nothing. A search with a filter waits for the result of the current text rather than use stale ranges. - Search across files (the Search side panel, Ctrl-Shift-F): the open folder or workbook
and every open tab (their current text, unsaved changes included; tabs outside the project too), with the same toggles and filter, and comma-separated include / exclude globs (
*,**,?,{a,b}; a pattern without/matches at any depth,dir/everything under it). Binary files are skipped. Replace all plans every edit first and shows each file's count and changed lines to confirm. An open tab is edited through the editor (one undo step, unsaved); a file that is not open is written once, only if it is unchanged since the search, and can be put back (Undo) while it is unchanged since the write. Read-only tabs are left. - State: the toggles and the query history (30 per field, arrow keys) are remembered per
browser, like the palette's recent commands; they are not document or
preferences.selfoptions.
L. Document options (v1.3)
#D79. Document styles (set style WORD ...) and the editor's view options
#Writers asked for looks they can switch on with one line: "use markdown [dark wide]",
"document theme dark wide", show empty lines. Rules style only what they produce (a rule's
{css} is scoped to its class, D41); nothing could style the page as a whole.
Adopted (no kernel, engine or conformance change):
- Syntax.
set style WORD WORD ...in the rules block, for example `set style dark widenumbered
.style` is an ordinary variable (01 §2, "any other key"), so every host already receives it insettings.values(D69), thevartarget can show it, and imports pass it on (D15). Rejected: options onuse(use markdown [dark wide]) change the kernel'suseline and tie a look to one rulebook; style rulebooks (use style-dark) cannot style the page (D41) and would need new built-in names.set styleis one readable line that composes with imports for free. - Words (case-insensitive, separated by spaces or commas):
- page:
dark,light,paper(a printed sheet on a desk: serif type, page margins); - width and spacing:
wide(a column 1.6 times the reading measure),compact; - type:
serif,sans,mono,justified(with hyphenation); - structure:
numbered(headings),dropcap(the first paragraph),columns(two); - looks, which bundle the above with a few touches of their own:
newspaper(serif,justified, two columns, drop cap, compact, a masthead
h1),academic(serif, justified, numbered, a centred title, a narrower column, indented paragraphs), andpaper; nonedrops every word before it (to switch off a style that came from an import).
- page:
- Composition. Words add up. A single word written with a look overrides that part of it
(
newspaper sans). In each exclusive group,dark light paperandserif sans mono, the last word written wins. Unknown words are ignored by renderers and flagged by the editor. - Imports. A project default (
selfscribe.self), a workbook default or a library rulebook canset a house style; the document's own later
set stylereplaces the whole value (D14, D15), andset style noneremoves it. - Rendering contract. A style is presentation, not output:
render_htmlis unchanged.One host stylesheet,
templates/styles.css(JS:selfscribe/styles; compiled into theselfCLI), serves every host. A host wraps a rendered document as<X class="self-page self-s-WORD ..."><Y class="self-doc">BLOCKS</Y></X>(oneself-s-class per word in effect; blocks are children of.self-doc, or each wrapped in adiv.self-block, as in the editor's preview). The stylesheet- sets document tokens on
.self-page: the palette (--doc-bg,--doc-fg, ... fromdocs/design/tokens.md) and the metrics
--doc-font,--doc-font-heading,--doc-leading,--doc-gap,--doc-heading-gap,--doc-align,--doc-hyphensand--doc-measure. A host's own document typography reads these tokens, with its defaults as fallbacks; the stylesheet also has a zero-specificity base for hosts that have none (the CLI); - adds element rules only where a token cannot do it: numbered headings, the drop cap,
columns, the newspaper masthead, the academic title and paragraph indents, the paper sheet, and print rules.
- sets document tokens on
- Precedence with the document's
{css}. Colours reach elements only through tokens, andalignment, hyphenation and fonts are inherited from
.self-doc, so a rule's own declarations ({ color: crimson; text-align: center }) always show. The element rules of looks set only sizes, margins, indents and alignment of headings and paragraphs, never colours; where a rule sets the same property on the same element, the look wins. - Numbering and the drop cap.
h2is 1,h31.1,h41.1.1; anh1is a title andrestarts the numbers; only top-level headings count (as CSS counters on
.self-doc's children would). Static pages use CSS counters. The editor's virtualised preview and hybrid widgets cannot count blocks that are not mounted, so they compute the same numbers from the blocks and write them asdata-self-num. The drop cap goes on the first top-level paragraph (data-self-leadin the editor). - What renders where.
- Preview (web and desktop): everything. The palette of
dark,lightandpaperisthe user's matching editor theme (the current theme if it already matches, else
theme-darkortheme-lightfrom preferences.self), applied to the document area only (the editor and preview panes), so every theme keeps its tested contrast; static hosts use the stylesheet's own palettes.columns(and the newspaper's) needs every block mounted: documents of up to 2 000 blocks mount them all, larger ones stay one column. - Hybrid: the palette, fonts,
wide, and the numbers on heading widgets. Alignment,columns, the drop cap and the sheet stay out of the text being edited. Source: the palette only.
- Site (examples page, playground) and the CLI (
self render --standalone, whichinlines the stylesheet when the document has a style): everything, from the static rules. Fragment output (
self renderwithout--standalone) is unchanged: the page it goes into decides. - Print: styles print;
darkprints as a light page and sheet shadows are dropped.
- Preview (web and desktop): everything. The palette of
- Style picker (text behind every GUI): a status bar item (Style: …) with a popover,
and a Manager section, both with live thumbnails (the current document's first blocks in each style), edit the document's own
set styleline, adding it to the rules block, or creating the block withuse markdownfirst when the document relies on the built-in default (D70). One undo step. When the style came only from an import, the new line starts from the imported words. - View options (editor state, never document state;
preferences.self):set show-blank-lines on|off(a faint rule on empty lines),set show-whitespace on|off(spaces as dots, tabs as arrows, trailing whitespace marked),set show-line-endings on|off(a mark at each line end) andset indent-guides on|off(a guide per indentation level: a tab, orset indentspaces). They are drawn for the visible lines only, so typing costs the same on a 2 MB document. One "View options" popover beside word wrap and full width, rows in Settings, and palette commands.
M. Data and views (v1.3)
#D80. Data blocks, typed columns and one-line views
#Writers asked for tables "like CSV" that can also be shown as cards, a board, a form or an
editable table with search and filters, "a bit like Notion or Obsidian", but kept in
human-readable, forever formats. The csv and tsv plugins (D49) only draw a static table.
Adopted (no kernel change; two new built-in plugin targets and one built-in template):
- Targets.
data(a source of records) andview(a way to show a source) are built-inengine plugins (
selfscribe-plugins, featuredata). The document reaches them through rules like any other target.csvandtsvkeep their D49 output exactly. - The
datatemplate (templates/data.self, a new built-in name, souse dataresolveswithout the resolver; a library rulebook cannot be called
data, D72):use markdown block ```data\ _ ... ``` -> data info=_1 verbatim line view: _ -> view verbatimThe escaped space makes
`dataneed a space and a name, so`databasestays a code block. Both rules can be copied into any rulebook; the targets are the contract, the spelling is the template's. - A data block is
`data INFO…`.INFOis `NAME [FORMAT] [from PATH][VIEW OPTIONS]`:
NAMEmatches[A-Za-z][A-Za-z0-9_-]*and is how views refer to the block. Otherwisewarning
invalid data name 'X'(the block still shows, unnamed). Two blocks with one name: warningduplicate data name 'X'on the later one; views use the first.FORMATiscsv,tsv,json,jsonlorrecords. Without it the body decides: afirst non-blank character
[isjson,{isjsonl, a tab in the first non-blank line istsv, anything elsecsv.from PATHreads a project file instead of the body, resolved likeinclude(D17,D49: relative to the document,
..above the root refused by hosts, remote only withallow_remote, never a template or library name), recorded inimportsso asynchronous hosts fetch it and parse again. The extension gives the format (`.csv .tsv .json .jsonl .rec,.recbeingrecords); another extension is warningunsupported data file 'PATH'; a missing file is errorcannot resolve data file 'PATH'`. The block's body, if not blank, is one header line (below) whose types apply to the file's columns by name. Diagnostics inside the file carry its key (D66.5).- The rest is a view of the block itself (below); the default is
as table, andas hiddenshows nothing (the block stays in the AST, and views still read it).
- Formats (all plain text, each record keeps its byte span in the text it came from):
csv/tsv: non-blank lines; the first is the header; fields as in D49 and D66.2 (oneline per record,
""inside quotes). A record with more fields than the header: warningrecord has N fields, header has Mat its first field; extra fields are ignored. Fewer fields are empty cells.json: one array of objects. Columns are the object keys in order of first appearance.A string is its text; a number its text as written;
true/falseas written;nullempty; an array its items' texts joined with,(a list: a column whose values are all arrays is inferred aslist); an object its source text. Errors:invalid JSON: MESSAGE(error, at the offending character; no records),JSON data must be an array of objects, and warningrecord is not an object(skipped).jsonl: one object per non-blank line; a bad line isinvalid JSON: MESSAGEand skipped.records(in the style of GNU recutils):field: valuelines, records separated byblank lines,
#lines are comments. Other lines: warningexpected 'field: value'; a field repeated in one record: warningduplicate field 'F' in record(the first is kept). Field names match[A-Za-z_][A-Za-z0-9_-]*.- In
json,jsonlandrecordsbodies an optional first line starting with%is theheader line (it sets types and the column order).
- Typed columns. A header is comma-separated (tab-separated for
tsv)NAME[:TYPE]. Thefield is typed when the text after its last
:is a type; when that text is a lowercase word (with optional parentheses) that is not a type, warningunknown type 'X'and the column is text named by what precedes the:; otherwise the whole field is the name. A repeated name: warningduplicate column 'X'(views find the first). Types:Type Valid cells (after trimming; empty is always allowed) Bad cell warning textanything none number`[+-]?(D+[.D*] .D+)([eE][+-]?D+)?`, exact decimals with at most 15 digits before and 15 after the point once the exponent is applied 'V' is not a number (column 'C')dateISO 8601 YYYY-MM-DD, or a timestamp `YYYY-MM-DD(T)HH:MM[:SS[.F+]][Z ±HH:MM]`, with real months, days (leap years) and times 'V' is not a date (column 'C')boolyes no true false y n x 1 0, any case (xand1are yes)'V' is not yes or no (column 'C')`choice(A B …)` exactly one of the values (at least one; else unknown type)'V' is not one of A, B (column 'C')listitems separated by ,(quote the cell in CSV), trimmed, empties droppednone urla URL that passes D43 ( http https mailto tel ftp, or relative)unsafe url 'V' (column 'C')Bad-cell warnings point at the cell (for CSV the first character of the field, a quote included; for JSON the value). Columns with no type are inferred, with no warnings:
numberif every non-empty cell is a number, elsedateif every one is a date, elseboolif every one isyes no true false, elsetext. - Typed values order and compare records: numbers as exact decimals; dates by instant
(a date is its day at 00:00 UTC; an offset is applied; fractions to the millisecond);
boolno before yes;choiceby position in the list (bad values after, by text);text,urlandlistby their lower-cased text, then by the text. Cells that do not fit the column's type sort after the others, by text, and empty cells last, in both directions (the direction reverses only the typed order). Sorting is stable. - A view is
view: SOURCE [OPTIONS](one line), or the options of a data block. SOURCE isa data block's NAME, or a PATH (it contains
/or ends in.csv .tsv .json .jsonl .rec) read likefrom PATH. Options, in any order, each at most once (a repeat: warningrepeated option 'X', the later wins); a comma before an option word is ignored:as KIND:table(default),cards(orgallery),board,list,calendar,form,hidden. Unknown: warningunknown view kind 'X', a table.by COLUMN: the column a board is grouped by (default: the firstchoicecolumn),the date a calendar is laid out by (default: the first
datecolumn); for the other kinds it meansgroup COLUMN. A board or calendar without one: warning `'board' needs 'by COLUMN'(or'calendar' …`) and a table; a calendar by a column that is not a date: warning'C' is not a date columnand a table.group COLUMN,sort COLUMN [asc|desc] [, COLUMN [asc|desc]]…,columns COLUMN, …(which columns show, in that order),
page N(records per page, N ≥ 1),search TEXT(case-insensitive, in the shown columns),filter EXPRESSION(D81),title TEXT, and totals:count,sum COLUMN, …,avg COLUMN, …(number columns),min COLUMN, …,max COLUMN, …(number or date columns).- COLUMN is a name (exact, else the one name equal ignoring case) or a
"quoted name";where a COLUMN can stand (after
by,sort, a comma in a list, …) an option word that is also a column's name is that column (columns title, owner); TEXT is a word or a"quoted text"(\"and\\escape). Messages: `unknown column 'X','OPTION' needs a column,'page' needs a number,'OPTION' needs text,'as' needs a view kind,'C' is not a number column,'C' is not a number or date column`,unexpected 'X',view needs a source,unknown source 'NAME'. Aviewordatatarget from an inline or word rule: warningview needs a line or block rule(or `data …`) and the matched text as text (like D66.14). - Views of a source see its records; bad cells show as written.
- A view whose source is unknown, reserved or unreadable (and a data block whose file
cannot be read) renders its own text:
<p class="self-view-missing">LINE</p>, LINE being the view line or the data block's opening line as written.
- Reserved: SQLite.
view: sqlite PATH "QUERY" …(and``data NAME from sqlite PATH"QUERY" `) is reserved for a future read-only desktop connector whose way back to plain text is "export to CSV". Until then it is warning `unknown source 'sqlite' (reserved for a future read-only connector)`. Nothing opens the file.
- Order of diagnostics (D56): a data block's (info, header, then cells in text order) when
the plugin phase meets it; a view reports the cells of a file it reads directly only if no earlier data block or view of the same parse read that file.
- Rejected: a sigil for views (
@view,{{view}}):view:reads as plain text and cannotcollide with Markdown; a fence for each view (Obsidian's style): two or more lines where one says it all; types in a separate schema block: the header is where people look.
D81. The filter language
#A view's filter needs comparisons (status != done and due < 2026-10-01). 02 §7 keeps
expressions out of documents; a filter is not code: it is a predicate over one record, with no
arithmetic, no functions, no variables and no loops, parsed into a tree by the plugin (host code)
and evaluated without eval.
Adopted.
- Grammar (words are case-sensitive and lower case):
filter := or or := and ("or" and)* and := unary ("and" unary)* unary := "not" unary | "(" or ")" | test test := COLUMN [OP VALUE ("|" VALUE)*] OP := = | != | < | <= | > | >= | contains VALUE := WORD | "QUOTED"Operators need no spaces around them (
due<2026-10-01). The filter runs to the next option word (D80) outside quotes and parentheses. An option word that is also a column's name (a column calledtitle) is read as the column, so such options go beforefilter. A column calledand,or,notorcontainsmust be quoted. - Meaning, by the column's type (D80):
- A bare COLUMN is true when the cell is not empty; for
bool, when it is yes. Sonot doneand
not dueread naturally. - An empty cell makes every test false except
!=, which is true. numberanddatecompare typed values. A date-only VALUE compares with the cell'swritten date (so
due = 2026-09-20matches2026-09-20T10:00); a timestamp VALUE compares instants.today,today+Nandtoday-N(days) are dates taken from the host variabletoday(ParseOptions.vars, ISO date); without it, a test that uses them is true in engine output (empty cells included) and evaluated by the client against the reader's date.choice: VALUE must be one of the values;<and>follow the list's order.bool: VALUE is a yes or no word; no is less than yes.textandurl: compared ignoring case;containsis a case-insensitive substring.list:=is true when an item equals VALUE (ignoring case),!=when none does,containswhen an item contains it;<and>compare the whole text.A | Bafter=is "equals any", after!="equals none", aftercontains"containsany"; with other operators it is an error.
- A bare COLUMN is true when the cell is not empty; for
- Errors are warnings starting
filter:at the offending token: `expected a column,found 'X'
,expected a value after 'OP',expected ')',unexpected 'X',unknown column 'X','|' needs =, != or contains, and the value checks of D80 ('V' is not a number (column 'C')`, and so on). A filter with an error is not applied (every record shows). - Top-level
andterms are the view's filter chips on the client (D82): each keeps itssource text so a chip reads as written.
D82. What views render: static HTML and the client payload
#Every renderer (CLI, site, editor, plain export) must show a real table or cards, and the client must turn the same output into an interactive view without re-reading the text.
Adopted. A view (and a data block's own view) is one Raw node (D47) with the view node's
span and rule:
<div class="self-view self-view-KIND[ CLASSES]"[ ATTRS] data-self-plugin="view">
[<p class="self-view-title">TITLE</p>]
CONTENT
[<p class="self-view-note">NOTE</p>]…
[<p class="self-view-totals">TOTALS</p>]
<script type="application/json" class="self-view-data">PAYLOAD</script>
</div>
No whitespace or newlines are emitted between tags (fixtures may break lines, D57). KIND is the
kind actually drawn; CLASSES and ATTRS are the rule's (a data block's info attribute is input,
never output). What is drawn: the records after filter and search, in sort order, the
first page of them, or at most 1 000 (the static limit, so a 10 000-record view does not
put 50 000 cells into every page it is on).
- Cells: empty is nothing; text and numbers are escaped text; a date `<time
datetime="V">V</time>
; a bool<input type="checkbox" disabled>(withchecked` beforedisabledfor yes); a choice<span class="self-chip">V</span>; a list its items as chips separated by one space; a URL a link (awhosehrefand text are the cell); a bad cell<span class="self-bad">V</span>. - table:
<table class="self-table"><thead><tr>a<th>per shown column</tr></thead>,then
<tbody>rows of<td>s; number columns'thandtdhaveclass="self-num". Grouped: one<tbody>per group starting with `<tr class="self-group"><th colspan="N">LABEL <span class="self-count">K</span></th></tr>. No records: no<tbody>. Totals:<tfoot><tr>` with atdper shown column holding that column's totals (sum V,avg V,min V,max V, joined by·),countfirst in the first column (N records). - cards:
<div class="self-cards">of<article class="self-card"><p class="self-card-title">the first shown column
</p>then, if any other shown cell is not empty,<dl>with<dt>COLUMN</dt><dd>CELL</dd>for each</dl></article>. - list:
<ul class="self-list">of<li><span class="self-card-title">FIRST</span>then, ifany, a space and
<span class="self-meta">the other non-empty cells joined by·</span></li>. - Grouped cards and lists: per group `<div class="self-group"><p class="self-group-title">LABEL
<span class="self-count">K</span></p>
+ the container</div>`. - board:
<div class="self-board">of `<section class="self-board-col" data-value="V"><pclass="self-group-title">LABEL <span class="self-count">K</span></p>
+ cards</section>`; cards leave out the board's column. Columns: every choice in order (empty ones too), then other values in order of appearance, then empty cells as(none). - calendar:
<div class="self-calendar">of one `<table class="self-cal"><caption>MonthYYYY</caption>
per month holding records (English month names), atheadofMon…Sun`, and weeks of seventds:<td></td>outside the month, else `<td><span class="self-day">D</span>+<span class="self-event">TITLE</span>` per record that day (TITLE is the first shown column other than the date, as text)</td>. A record's day is the date written in the cell. - form:
<div class="self-form">of<label class="self-field"><span>COLUMN</span>CONTROL</label>,CONTROL an
<input type="text|number|date|url|checkbox" disabled>or, for a choice, `<select disabled><option></option><option>A</option>…</select>`. Filters, sorting and totals do not apply. - Group labels are the cell's text,
(none)when empty; groups follow the choice order,then first appearance;
(none)last. - Notes (each its own
<p class="self-view-note">):No records;Showing N of M records;for a calendar
N records without a date. Totals outside tables:<p class="self-view-totals">ofN records,sum COLUMN V, … in the order written, joined by·.1 record,N records. Totals count every record after filter and search; a total with no values (anavgof empty cells) is left out; in a table, totals of columns that are not shown go into such a paragraph after it. - Numbers in totals are exact:
sumkeeps the most decimals of its cells (10.50 + 2is12.50);avgis rounded half away from zero to two more decimals, then trailing zeros are dropped down to that many;minandmaxare the cell as written (numbers or dates). - PAYLOAD is JSON (no whitespace outside strings; strings escape
"`` and controlcharacters as
\"\\\n\r\t\u00XX, and<>&as\u003c\u003e\u0026, so the script element cannot be closed early; other characters are written as is):{"source":{"name":N,"file":F,"format":"csv","body":[S,E],"view":[S,E]}, "columns":[{"name":"status","type":"choice","choices":["todo","done"]},...], "records":[[S,E,"cell","cell",...],...], "view":{"kind":K,"by":C,"group":C,"sort":[["due","asc"]],"filter":[{"text":T,"test":X}], "columns":[...],"page":P,"search":S,"totals":[["sum","amount"],["count",null]],"title":T}}nameis the block's name ornull;filethe key of a file source ornull(the document);bodythe byte span of the text holding the records (the block's body lines, or the whole file);viewthe byte span of the line that holds the view (theview:line, or the data block's opening line).recordsare every record of the source in text order, each with its byte span and its cells as text (D80).columnshas"choices"only for choices. Inview, absent options arenull(sort,filter,totals[]);columnsis the shown columns; a testXis{"col":C},{"col":C,"op":O,"values":[V,…]},{"and":[X,…]},{"or":[X,…]}or{"not":X}, with VALUEs as written. A filter with errors is[]. Spans are UTF-8 byte offsets (D53). - Static styles.
templates/styles.csshas a zero-specificity base for this output (tables,cards, board columns, calendar grids, chips), in document tokens. The CLI's standalone page inlines the stylesheet when the page has a view (as it does for a style, D79), and the site links it for such examples.
- The client half (
view, in theselfscribe-pluginscatalog, D73) reads only the payload,and implements the same typing, ordering and filter semantics (shared test vectors in
spec/conformance/data/vectors.json, run by the Rust and the JS tests).
Amended (26 Nov 2026): how the client writes figures. A review of the examples found tiles
reading 3241.5 where a reader expects 3,241.50 or £3,241.50. The client now writes a
number column's figures (cells, totals, group lines, tiles, a chart's values) with thousands
grouped, and a total to as many places as the column's values are written with. A column whose
name carries a currency sign or a bracketed code (amount £, € refunded, fee (CHF)) is
money: its figures carry the sign, with no pence when every value is whole and two places when
any has pence, and totals and tiles leave the sign out of the column's words. A column of years
is not grouped: its name says so (year, born, since…), or it has two values or more and
each is a whole year from 1800 to 2100. The text, sorting, filters and editing keep the values
as written. Why the name, not a type: a type such as number(£) is read by the engine,
and the name already says it in the examples (€ refunded). The engine's static output still
writes figures as typed; it can follow later.
And a document's currency, set currency £ (26 Nov 2026). Renaming columns to carry a
sign was clumsy where formulas use the names, so a document can name its currency once:
set currency £ (a sign, or a three-letter code such as CHF). The engine keeps any set
value without reading it, so the host passes this one to the page as the custom property
--self-currency (a CSS string, currencyVars in the plugin package), and a view reads it
from the element it draws in. It applies to the number columns that are clearly money: a name
such as amount, price, cost, budget, planned, billed, spent, left, revenue,
margin, fee, paid, balance, or a worked-out column whose sum names one (`left = planned
- sum(bills.amount)`). A name that says a count, a quantity, hours, a rate, a share or a year
keeps the plain number. total says neither, since a query's total column adds counts as
often as money. with A, B and without C after the sign name the columns the guess gets
wrong; a column's own sign wins. Why not a view or column word: both are read by the engine,
which refuses words it does not know.
And dates (26 Nov 2026). The client writes a date cell in the reader's short form with
the year (14 Jul 2026, Jul 14, 2026), in tables, cards, lists, boards, group headings,
tiles, day squares and a chart's days; the element stays <time datetime="2026-07-14">, and
editing, sorting and filters keep ISO. set dates weekday adds the day of the week, `set dates
iso keeps the dates as written, and for A, B` limits either to those columns. It reaches the
page as --self-dates, as the currency does.
And the engine's own output follows (27 Nov 2026). Without JavaScript (the CLI's `self
render`, a mail, a page opened from disk, a print) the engine's HTML was what people saw, and it
read unfinished: 1627.88 with no sign, sum 1627.88 in a total cell, a plain "sum …" line
under the table, a chart of bare bars. The engine now writes figures and dates by the client's
rules (selfscribe-plugins/src/data/figures.rs, ported from numbers.ts and dateshow.ts,
with shared vectors in spec/conformance/data/vectors.json): it reads set currency, `set
dates and set lang` for that, which the paragraph above said it did not. A table's totals row
has Total in its first column and the bare sums; a group line names its count and totals
(Home 6 · Amount £1,455.25); the totals line is tidy and is left out under a plain chart or
tiles. as stats draws tiles, as the client does (D186's static table is replaced). Highlights
(when … -> red, D259) are applied. A chart is drawn with the client's geometry
(chartdraw.rs: axis, ticks, currency on the axis, legend, values on the marks); its numbers
table stays for screen readers, hidden from view. On both sides a total is named as a heading of
its column: Planned, Average joints, Lowest …, Highest …, a count Records, never `sum
planned`. A plain view keeps its height when the client draws over it. Fixtures 163 and 164.
D83. Plugins that edit the source: the write-back API
#A cell edit, a card dragged to another column or a submitted form must end as text in the data block or the data file (text behind every GUI), as one undo step. Client plugins could only read their element; nothing let them change the document.
Adopted.
selfscribe/client:hydrate(root, { edits })passes anEditHostto plugins asctx.edits(absent: the view is read-only). A plugin callsctx.edits.propose(element, { file, within, changes, label }), wherefileisnullfor the document or a file key,withinthe byte span it may touch, and each change is `{from, to, insert, expect}in UTF-8 byte offsets of that text (expect`: the text there now). It resolves totruewhen applied. Plugins compute minimal changes: one cell's text (quoted for CSV when it needs to be, JSON strings escaped), a new record appended at the end of the body, a record's lines removed.- The host (the editor) accepts a proposal only when:
- the element is in the live preview or hybrid view of the document it edits (not a gallery
sample or a thumbnail), and that document is not read-only;
- every change lies inside
within, andwithinlies inside the text; - for a file,
fileis one of the keys the document's last parse read (imports, resolved)with a data extension (
.csv .tsv .json .jsonl .rec); - every
expectequals the current text at its range (otherwise the text changed since theview was drawn: refused, and the view says so).
The changes are then applied through the store as one transaction (one undo step, user event
input.view): to the document, or to the file's tab when it is open, or else written to the file once, with an Undo that puts it back while it is unchanged (as D78). The next parse redraws every view of that source. A plugin never writes outside the span its view names, and the host checks it. - the element is in the live preview or hybrid view of the document it edits (not a gallery
- The same API serves any plugin (a chart that nudges a value, a task list), but only views use
it in v1.3.
- As built (track E).
EditHostalso hasread(element, file)(the current text, so a plugin computes itschanges and their
expectfrom what is there now) and an optional `reveal(element, file, offset)` (the view's Source button; from the preview it switches to split mode).- A plugin element marked
data-self-interactivekeeps its events in hybrid widgets (a clickdoes not move the caret into it) and in the preview (a click does not set the caret). A change made through a widget carries
keepWidgets(selfscribe-cm6): the edited block keeps its widget until the next result instead of flashing its source. The view shows the new value at once and is redrawn from the new text by the next parse (about 40 ms for the text and 0.4 s for the redrawn 10 000-record view in the e2e gate). - The client keeps a view's search, sort, chips, page and scroll across redraws (keyed by
source and view options), and gives the focus back to the edited cell or card.
- Sort keys are computed once per record (engine and client); a table of more than 150 rows
draws only the rows near its viewport; cards, lists and boards page by 60 without
page. - Save view writes
as,sort,searchandfilter(last, so it cannot swallow a lateroption) into the view's line, keeping its other options; chips that contain
orare parenthesised when joined withand. - Galleries, thumbnails, the Manager and the site hydrate views without
edits: read-only.
N. Code, plugins and images (v1.3 track C)
#D84. Highlighted code blocks: a client plugin that claims pre > code
#Code blocks were plain monospaced text. Writers asked for colours in many languages (AutoHotkey first, then the usual ones), a copy button and line numbers, without slowing down a 2 MB manual with thousands of code blocks.
Adopted (no engine, kernel or template change; the engine output stays
<pre><code lang="LANG">BODY</code></pre>, D39, fixture 006):
- Client plugins may claim elements by selector.
ClientPlugingains two optional, additivefields:
selector(a CSS selector;hydrate()also hands every matching element that is not hydrated yet to the plugin, once, marked withdata-self-hydratedlike a marker) andhint(a substring every claimed element's HTML contains, so a host can skip blocks without it).selfscribe/clientexportsneedsHydration(html): true when the HTML holds adata-self-pluginmarker or a registered plugin'shint. The virtual preview asks it per block (only mounted blocks are hydrated, D76), and hybrid widgets hydrate as before (D75). - The
highlightplugin (catalog, categorycode) claimspre > code(hint<pre><code).The name is
highlight, notcode: a registered plugin wins over an element of the same name (D44), andcodemust stay an element. A rule may also targethighlightdirectly (block ~~~ _ ... ~~~ -> highlight lang=_1 verbatim): the marker is drawn the same way. - The info string.
langis read as words: the first is the language (case-insensitive,with aliases:
ahk ahk2 autohotkey,js javascript mjs cjs jsx,ts typescript tsx,py python,rs rust,c h,cpp c++ cc cxx hpp,cs csharp c#,go golang,java,kotlin kt,sh bash shell zsh console,ps1 powershell pwsh,bat cmd batch,sql,json jsonc json5,yaml yml,toml,ini cfg conf,html htm xml svg,css scss less,md markdown,diff patch,self selfscribe,php,ruby rb,lua,swift,regex,text plain txt(plain on purpose)). The other words are options:lines/nolines(line numbers for this block),{2,4-6}(lines to mark),title=NAME(a file name shown in the block's bar). An unknown language stays plain text, with the copy button. - What the client draws. The code element's text is split into
<span class="selfhl-X">tokens (X one of
kkeyword,bbuilt-in,ttype,ffunction,vvariable,sstring,eescape,nnumber,lliteral,ccomment,mmeta/directive,ooperator,ppunctuation,rregex,gtag,aattribute,xproperty,hheading,ulink,iinserted,ddeleted,em,st), the text itself unchanged, so find in the preview (D78) and copying still see exactly the engine's text. With line numbers or marked lines every line is aspan.selfhl-line; numbers are CSS counters, not text. The bar above the code (language or title, and a Copy button) isaria-hiddenapart from the button, and holds no text nodes (labels come from CSSattr()), so the block's text content is still the code. The bar isdata-self-interactive(D83): clicking Copy in a hybrid widget does not move the caret. - Colours are theme tokens. Token classes map to the syntax tokens every theme defines and
tests for contrast (docs/design/tokens.md): keyword
--syn-keyword, string--syn-target, number--syn-slot, comment--syn-comment, function--syn-directive, type--syn-style, variable and attribute--syn-attr, meta--syn-modifier, tag--syn-pattern, escape and regex--syn-escape, operator and punctuation--syn-mark, heading--syn-heading, link--syn-link, deleted--syn-error; each with a fallback for pages without tokens that follows the page's colour scheme. The site's static pages get the same classes at build time. - Settings (preferences.self):
set plugin-highlight-numbers off|on|long(long: blocks of12 lines or more; default
off),set plugin-highlight-copy on|off(default on). - Speed and size. Selfscribe's own tokenizer: one sticky regular expression per language
state, no dependencies, loaded lazily on the first code block; a block is highlighted once when it is mounted (hydrated blocks are reused, D76); blocks over 200 000 characters stay plain. Rejected: Shiki (a WASM regex engine and TextMate grammars, megabytes), highlight.js and Prism (a library to keep up to date for grammars we would rewrite anyway for AutoHotkey v2 and Selfscribe, and global state).
- The CLI is Rust and has no JavaScript:
self render --standalonekeeps plain code blocks.
D85. Images, audio and video in projects and workbooks
#A relative  in a folder project or a workbook asked the browser for img/a.png
next to the editor's own page (a request to the app's server, never the file).
Adopted (host behaviour; no engine change):
- Which URLs are local. In the rendered output of a document that belongs to a project or
workbook,
srcofimg,video,audioandsource,posterofvideo, and amediaplugin's path (D92) are local when they have no scheme (D43), do not start with//or#, and end in a known extension: imagespng jpg jpeg gif webp avif svg bmp ico, audiomp3 wav ogg oga m4a aac flac opus, videomp4 m4v webm ogv mov. The path is percent-decoded;?queryis dropped and#fragmentkept (media fragments like#t=10). - Resolution follows D17: relative to the document's directory in the project, a leading
/from the project root,
.and..normalised;..above the root is refused. Other URLs are left to the browser as before (web images keep working);data:staysimg-only (D43, enforced by the engine). - Loading. The host reads the file's bytes through the project's file store and shows a
blob:object URL of them (type from the extension). The relativesrcis removed before the browser can request it, so nothing is fetched beyond the files the document names and nothing leaves the machine. One object URL per file is shared by every element that shows it; URLs no connected element uses are revoked when the next result is drawn, on close of the project, and when the file changes (it is read again). A missing or refused file shows the image'salt(or the path) as a small broken-image placeholder with the reason in itstitle. Documents outside a project resolve nothing (placeholder). - Where. The preview, hybrid widgets and every read-only rendering of project documents
(thumbnails are not project documents and show placeholders).
- Paste and drop. Pasting or dropping image files (or audio and video) into a project
document in source or hybrid mode saves each next to the document, in an
images/folder beside it (media/for audio and video), named after the file (lower case, spaces to-, unsafe characters dropped;pasted-YYYYMMDD-HHMMSS.pngfor clipboard images without a name), with-2,-3, ... when the name is taken; then inserts(amedia:line for audio and video when the document has the rule, else the image form) at the caret or drop point, as one undo step. Zip and gzip workbooks keep the file in the workbook (saved with it). Outside a project the editor says why and inserts nothing: nodata:URLs are written into documents.
D86. details with a summary attribute
#The spec's own example block ::: spoiler _ ... ::: -> details summary=_1 rendered
<details summary="Title">, which browsers show as "Details".
Adopted (renderer): an element target details with a summary attribute renders the
attribute as a first child <summary>VALUE</summary> (escaped text) and not as an attribute:
<details class="x"><summary>Title</summary><p>body</p></details>. An empty slot omits the
attribute (fixture 041), so there is no summary. Other attributes are unchanged. Fixture 121.
D87. Footnotes
#Adopted (two built-in plugin targets, feature notes; two rules in markdown.self):
markdown.selfgainsinline [^$] -> footrefandline [^$]: $ -> footnote key=$1. Anyrulebook may copy them.
[^1](x)is still a link (longest pattern, D35). A host that parses without the built-in plugins (onlyselfscribe-core) gets the usual unknown-target warning for these two rules (D44); every Selfscribe host has them.footref(content: the key, trimmed). References are numbered 1, 2, ... in the order inwhich keys that have a definition are first referenced, in document order within the file. Output:
<sup class="self-fnref[ CLASSES]" id="fnref-KEY" data-self-plugin="footnote"[ ATTRS]><a href="#fn-KEY" title="TEXT">N</a></sup>, TEXT being the definition's text content with runs of whitespace collapsed and trimmed; the k-th reference (k ≥ 2) to the same key has idfnref-KEY-k. A key with no definition: warningunknown footnote 'KEY'at the reference, output the matched text as text. In a file with nofootnoteat all the matched text is output without a warning: such a file is not using footnotes, and[^abc]there is usually a regular expression's character class (converted manuals have many).footnote(a line or block rule; the key is thekeyattribute, input only, neveroutput; the content is the note). A referenced note:
<div class="self-footnote[ CLASSES]" id="fn-KEY"[ ATTRS]><a class="self-fn-num" href="#fnref-KEY">N</a><div class="self-fn-body">CONTENT</div></div>(CONTENT rendered normally: inline rules, nested lines). A note never referenced: warningfootnote 'KEY' is never referenced, classself-footnote self-fn-unused,<span class="self-fn-num">KEY</span>instead of the link. A second note with the same key: warningduplicate footnote 'KEY', drawn like an unused one without anid. A key that is empty or contains whitespace: warninginvalid footnote name 'KEY', drawn unused without anid. Nokeyattribute: warningfootnote needs key=. From an inline or word rule: warningfootnote needs a line or block rule, the matched text.- Notes are drawn where they are written (spans stay in place); a "Footnotes" section is the
writer's heading. Keys are compared exactly.
Peer(D80) gainstext, the node's text content, so a plugin can read another node's words.
D88. Citations and a bibliography
#Adopted (two built-in plugin targets, feature cite; rules in the catalog, not in
markdown.self):
inline [@_] -> citation
line bibliography: _ -> bibliography
- Sources.
bibliography: SOURCE [all]names a BibTeX file (refs.bib: a path, read likedata from PATH, D80) or a data block (NAME, D80) whose records are references. Everybibliographyline of the file is a source for every citation, in document order (the first source that has a key wins). Unreadable: errorcannot resolve bibliography 'PATH'; an unknown data block name: warningunknown source 'NAME'; either renders<p class="self-bibliography-missing">SOURCE</p>. - BibTeX (
@TYPE{KEY, field = {..} | ".." | number | macro # ...}): nested braces,@stringmacros and the month macros,#concatenation;@comment,@preambleand text between entries are ignored. TeX is flattened: braces dropped;\&\%\$\_\#their character;--en dash;---em dash;~a space; the accent commands (acute, grave, umlaut, circumflex, tilde, cedilla, caron, macron) on a letter, with or without braces, the composed letter;\ss \o \O \aa \AA \ae \AE \l \Ltheir letters; any other\command{x}isx. A malformed entry: warninginvalid BibTeX entryin the file (D66.5) at its@, reported once per parse when the file is first read; a repeated key: warningduplicate reference 'KEY'at its@(the first wins). - Records (a data block): the key is the column
key, elseid, else the first column.Fields are found by column name ignoring case. Authors in one cell are separated by
;orand. - Fields used:
author(elseeditor),title,year(else the first four digits ofdate),journal/booktitle/container,volume,number/issue,pages,publisher/school/institution/organization,doi,url. A name is "Family, Given" or "Given ... Family" (the last word); a braced name ({World Health Organization}) is one family name. - Style is the variable
cite-style(set cite-style numeric; defaultauthor-year). citation(content: items separated by;; an item's key is the word after its@, orits first word when it has no
@, as in the first item of[@key]; text before the@is a prefix, text after the key and a comma a locator). Author-year:(ITEM; ITEM), ITEM[PREFIX ]<a href="#ref-KEY" title="ENTRY">AUTHORS YEAR[, LOCATOR]</a>, AUTHORS the family names (A,A and B,A et al.for three or more; the title without names), YEARn.d.when missing. Numeric:[ITEM; ITEM]withN[, LOCATOR], N the order in which references are first cited in the file. Wrapped in<span class="self-cite[ CLASSES]" data-self-plugin="citation"[ ATTRS]>. An unknown key: warningunknown citation 'KEY', the item<span class="self-bad">KEY</span>. ENTRY is the reference's plain text.bibliography:<ul class="self-bibliography[ CLASSES]"[ ATTRS]>of<li id="ref-KEY">ENTRY</li>for the references of its own source that are cited in the file (every reference withall); author-year ordered by the entry's NAMES text (its title when it has none), then year, then title, ignoring case; numeric by number with<span class="self-bib-num">[N]</span>first (uncited ones last, in source order, with no number). Nothing to list:<p class="self-bibliography-empty">No references cited</p>.- ENTRY (APA-like, all text escaped):
NAMES (YEAR). TITLE. CONTAINER, VOLUME(ISSUE), PAGES. PUBLISHER. LINK, parts left out when empty. NAMES areFamily, I. I.joined with,and, &before the last; without names the title comes first (TITLE. (YEAR).). The title is<em>when there is no container, else the container is. LINK ishttps://doi.org/DOI(a DOI already written as a URL as it is) or theurl, as a link whose text is the URL, when it passes D43, else left out. A title that ends in. ? !gets no extra full stop. Intitleattributes the entry is plain text. - From an inline or word rule
bibliographywarnsbibliography needs a line or block rule.
D89. Numbered equations
#Adopted (two built-in plugin targets, feature equation; rules in the catalog):
block $$ {#_} ... $$ -> equation label=_1 verbatim
inline [@eq:_] -> eqref
equation(verbatim body, thelabelattribute is input): numbered 1, 2, ... in documentorder within the file. A label's leading
eq:is not part of it ({#eq:euler}and{#euler}are botheuler). Output:<div class="self-equation[ CLASSES]" id="eq-LABEL"[ ATTRS]><div class="self-math self-math-display" data-self-plugin="math">BODY</div><span class="self-eqno">(N)</span></div>(body trimmed and escaped; themathclient typesets it, D49). No label: noid. A repeated label: warningduplicate equation label 'L', noid. A label with whitespace: warninginvalid equation label 'L', noid.eqref(content: a label,eq:stripped):<a class="self-eqref[ CLASSES]" href="#eq-L" title="BODY" data-self-plugin="equation"[ ATTRS]>(N)</a>. Unknown: warningunknown equation 'L', the matched text.
D90. Glossary and abbreviations
#Adopted (two built-in plugin targets, feature glossary; rules in the catalog):
line *[_]: _ -> glossary key=_1 group dl
(-> abbreviation key=_1 instead defines the term without showing it, as Markdown Extra does.)
glossary(line or block rule;keyis the term, input only):<div class="self-term-def[ CLASSES]" id="term-SLUG"[ ATTRS]><dt>TERM</dt><dd>CONTENT</dd></div>, SLUG the term in lower case with runs of characters other than letters and digits turned into-(trimmed).abbreviation: nothing (the node stays in the AST).- Terms in the text. After the plugins of the main document ran (includes expanded), every
text node is searched for the defined terms: an exact, case-sensitive match that is not preceded or followed by a letter, a digit or
_; the longest term wins at a position. A match becomes<abbr class="self-term" title="DEFINITION">TERM</abbr>(DEFINITION: the definition's text content, whitespace collapsed). Not searched: text insidea abbr code pre kbd samp dt script styleelements, content of verbatim rules, and plugin HTML. The new node's span is the match when the text node's text is its source unchanged, else the text node's span. - A term defined twice: warning
duplicate term 'T'at the later one (the first wins); an emptykey: warning
glossary needs key=. From an inline or word rule: warningglossary needs a line or block rule(orabbreviation ...), the matched text. PluginHostgainsdefine_term(term, title); the engine applies the terms once.
D91. Task progress
#Adopted (a built-in plugin target, feature progress; rule in the catalog):
line progress: _ -> progress.
- What it counts. Task controls: nodes made by
input=checkbox(D45), done whenchecked,whose span starts in the progress line's section: from the nearest
fold Nsection header before it (D51; the file start when there is none) to the next section header of level ≤ that N (the file end when there is none; with no header before it, the whole file). Tasks from an included file count at the include line. - Output:
<div class="self-progress[ CLASSES]" role="progressbar" aria-valuemin="0" aria-valuemax="T" aria-valuenow="D" aria-label="LABEL"[ ATTRS]><span class="self-progress-label">LABEL</span><span class="self-progress-track"><span class="self-progress-fill" style="width:P%"></span></span><span class="self-progress-count">D of T</span></div>, LABEL the content's text, P = ⌊100·D/T⌋ (0 when T is 0, and the count readsno tasks). The HTML changes whenever a count changes, so every host redraws it. - From an inline or word rule: warning
progress needs a line or block rule. PluginHostgainstasks(at) -> (done, total).
D92. More catalog plugins, the catalog's new fields, and the emoji picker
#Adopted (client halves in selfscribe-plugins, D73; no engine change beyond D86-D91):
PluginInfogains optional fields:builtin(the engine draws the target itself, 04 §3;the switch turns only the client half on or off, and the Manager says so; the text says what the client half adds),
claimsandhint(what a selector plugin enhances, shown instead of a target, and the HTML that shows a document uses it), and the categorieswritingandcode.- New entries (each with examples, settings where useful, dictionary words and a Manager
card):
highlight(D84);callout:::: KIND Titleblocks and GitHub> [!NOTE]lines; kinds note, tip, info,success, question, warning, caution, important, danger, bug, example and quote; an icon and a tinted card from theme tokens;
::: KIND- Titlestarts folded;tab: consecutive::: tab Labelblocks, grouped bygroup div, become one tab set; arrowkeys move between tabs; choosing a label chooses it in every tab set of the page;
spoiler(Details and spoilers): thedetailselement with D86's summary, and||hidden text||revealed on click or Enter;footnote,citationandequation(D87-D89): previews on hover and focus;glossary(D90) andprogress(D91): engine only,builtin;timeline: atimelinecode block of lines like[x] 2026-09 | Title | details, with[x]done,
[>]current and[ ]planned;events: aneventscode block of lines like2026-09-14 10:00 Title @ Place, an agendagrouped by month, or month grids with
view: month; past events dimmed from the reader's date;chess: achesscode block holding a FEN position, or PGN movetext with headers, drawn asan SVG board with a move list and step buttons; an illegal move stops the replay with a note;
media:media: PATH | caption(oraudio:andvideo:lines), a player for a projectfile (D85), or for an
https:URL withpreload="none", so nothing loads before the reader presses play;emoji: the engine's target (inline :_: -> emoji),builtin.
- The emoji picker (editor): a dialog from the Insert menu, the palette (Insert emoji…),
/emojiin the slash menu and Alt-;: search by name and keyword, categories, keyboard navigation, recent emoji (per browser, like the palette's recent commands, D78). It inserts the character, or:name:when the document has anemojirule and the engine's table knows the name (D49).
D93. Document fonts: set font and set heading-font
#The user wants documents to be easy to set in a custom font, like the editor's own font
choices (v1.4 P: a font gallery, and font roles in preferences.self).
Adopted.
set font NAMEandset heading-font NAMEare variables (01 §2), likestyle(D79): theengine stores them and does not change its output. NAME is the rest of the line (a font id such as
literata, or a family name such asAtkinson Hyperlegible Nextor `Avenir Next). They import and override likestyle` (a document's own line wins).- Hosts map NAME to a font they have. The editor matches its gallery by id or name
(case-insensitive) and loads that font; any other NAME is used as an installed font by name, with the page's current font as the fallback. The page variables are
--doc-font(text) and--doc-font-heading(headings), so styles (D79) and rule CSS keep working; a font written with a style word (serif,sans,mono) replaces that word's face. - Hosts without the font (the CLI's standalone page, the site) fall back to the style's font;
nothing is fetched to find a font (04 §4).
- Editor preferences
font-ui,font-editor,font-prose,font-codechoose the editor'sown faces (
default, a gallery id, orcustom:NAME); a document'sset fontwins overfont-proseinside that document.
D94. Page breaks and export
#The user asked for page splits, pages, and export to HTML and PDF with the document's theme.
Adopted.
- The class
self-pagebreakmarks a page break: any rule may produce it (-> hr.self-pagebreak,-> div.self-pagebreak). Printing and PDF export start a new page after it; on screen it is a dashed rule. The built-inmarkdowntemplate gains one line rule at its end,line ---page--- -> hr.self-pagebreak(at the end so the line numbers of its other rules do not move). Nothing else in the engine changes. - Export is host behaviour. The editor's export writes one standalone HTML file: the shared
stylesheet (D79) with the document's style classes, a chosen theme's document tokens (light, dark or the current one), the document's fonts (D93) embedded from the editor's own files as data URLs, plugin output already drawn (diagrams, charts, highlighted code), and print rules (page size, margins, page numbers and a running title as CSS page margin boxes). PDF is that page printed by the browser or the desktop web view. Markdown export is the text without its rules block; plain text is the rendered words. Export never reaches the network.
D95. Write mode and rule-driven block tools
#- A fifth editor mode, Write (06 §1), sits between hybrid and preview: the rendered page,
edited in place. The source stays the only truth: every edit is a change to the source text made through the editor (one undo history with the other modes), and the page is drawn again from the engine's result. Nothing is ever read back from the page's HTML.
- Typing a character or deleting one inside a text run is shown by the page at once and made
to the source at the mapped position (D96). Enter, Backspace and Delete at a block's edge, Tab, selections, paste, cut, undo and formatting keys are run by the editor at the mapped selection, so lists, quotes and inline formatting follow the document's own rules exactly as in source and hybrid mode (smart lists, rule-driven formatting). Enter outside a list starts a new block with the separator the document uses there (a blank line unless its blocks sit on consecutive lines).
- Blocks without a sensible inline mapping (code, tables, figures, plugin output, custom HTML)
are not edited in place: a click opens their source in a small editor over the page. Links, pictures and abbreviations get a popover for their parts (link target, picture source, description, title), each written back where it appears in the block's source; a part not found as written is shown but not editable.
- Block tools in Write, hybrid and source: a handle beside the block under the pointer (and
Alt-/ at the caret) opens a menu to move the block up or down, duplicate or delete it, and turn it into any line or block rule of the document. The choices are the slash menu's items (the document's own rules, grouped by kind, with a rendered sample). Turning reads each line's content through the line rule that matches it, unwraps a block rule's opener and closer when the lines are exactly one such block, and writes the content through the chosen rule's skeleton (digit slots count up). Everything is a plain text change.
D96. Span mapping in Write mode
#- A block's rendered text is mapped to its source by aligning the two strings: the alignment
that matches the most characters, taking each rendered character from the earliest source character that still allows the most matches (so a link's text maps to its text, not to an identical URL). Delimiters are the source characters left unmatched; rendered characters with no source (a list number drawn by a rule, an emoji from a shortcode) are never edited directly. Blocks too large for the table (over 4 million cells) use an earliest-match scan.
- A caret between two rendered characters is placed in the source right after the first one's
source character (typing at the end of a bold word stays bold), else before the next mapped one. Deleting a character removes its whole source span: an escape (
\*) or an entity (&) goes with it. - A caret the page cannot show (a new empty list item, an empty line between blocks) is held by
that empty element, or by a temporary empty paragraph, at a known source position until the next render.
D97. Comments: comments.self and text-quote anchors
#- Where. A document's comments live in
comments.selfin the same folder (one file for allthe documents of that folder, each record naming its document). Documents outside a folder keep theirs in app storage as
comments/NAME.comments.self, the same format. - The format is an ordinary Selfscribe document using the
datatemplate (D80): a heading,a line of explanation,
view: comments as board by status filter not re, and onerecordsdata block namedcommentswith the header% id, re, doc, status:choice(todo|done|note), author, date:date, line:number, quote, before, after, body. One record per comment; a reply is a record whoserenames the comment it answers (it has no anchor or status). Values are one line: a line break is written\n, a backslash\\. Opened in the editor, the file is a board of to-do, done and note cards (and its data view's write-back, D83, moves a card between columns). The engine needs nothing new. - Anchors are text quotes in the document's source: the exact text (
quote), up to 32characters before and after it, and the line it started on. They are found again after every pause in typing: the occurrence of the quote whose surroundings match best (the nearest line on a tie); else the same words with different spacing; else the text now between the old surroundings when it is at most three times the old length plus 40 characters. An anchor found nowhere is orphaned: listed first in the Comments panel, flagged, and kept until it is attached to a new selection or deleted. Anchors found again are written back with the next change to the comments file.
- The editor marks anchors in the text and puts a badge in a margin gutter (source and
hybrid), highlights them on the page with the CSS Custom Highlight API and a badge in the block's margin (preview, Write, split), and lists them in the Comments panel (filters open, done, notes, all; comment on the selection with Alt-Shift-C; reply, resolve, reopen, edit, delete). Comments are signed with
set author NAMEfrom preferences.self. - Comment events (added, replied, changed, resolved, removed) are published to the host for
triggers (v1.4 A).
D98. Connectors, actions and automations as files
#Writers asked for documents that do things (a home dashboard, "comments marked to-do become rows in TODO.self") without code. 02 §7 keeps code out of documents; D74 keeps hosts in charge of anything that reaches out. So a document only names an action; what an action, a request or a trigger does is written in plain files beside it, and the host runs them.
Adopted (no engine or kernel change):
- Files. In a folder project:
connectors/NAME.self,actions/NAME.selfandautomations/NAME.self. Each is an ordinary Selfscribe document whose rules block holdsset KEY VALUElines (the preferences form, D73) and whose body says in words what it is for. NAME matches[a-z0-9][a-z0-9-]*. Unknown keys are reported by the Automations section and ignored; a definition with an error does not run. - A connector is one HTTP request:
set method GET|POST|PUT|PATCH|DELETE(default GET),set url URL(https:, orhttp:tolocalhost/127.0.0.1),set header NAME: VALUE(repeatable),set body TEXTandset type json|form|text,set field NAME DEFAULT(repeatable: its inputs),set pick PATH(a dotted path into the JSON reply,a.b.0.c),set map COLUMN PATH(repeatable: record fields from paths inside each picked item) andset output FILE(a project.json,.csvor.tsvfile the records are written to). Documents read the result like any data file (D80):view: data/weather.json as cards. Nothing is fetched while rendering; the file is what was last fetched. - An action is a list of
set step KIND ARGSlines run in order:append FILE TEXT(a lineat the end of a project file, created if missing),
add-row FILE V1 | V2 | …(a row at the end of a CSV or TSV file, quoted as needed),call CONNECTOR,copy TEXT(to the clipboard),notify TEXT(the status bar) andopen FILE. A step that fails stops the action and is logged. - An automation is
set when EVENTandset do ACTION. Events:comment added [todo|note],comment resolved,comment replied(D97),file changed FILE,every N minutes(N ≥ 1, while the app and the project are open) andopen(the project was opened). - Templates.
{NAME}in a value is replaced from the run's context: a connector's fields,a trigger's details (
{doc} {quote} {body} {author} {status} {id}for comments,{file}for files), a button's text and arguments, and{now}/{today}.{secret:NAME}is replaced by a secret from host storage, in connector URLs, headers and bodies only. An unknown name is left as written and reported by a dry run. - In documents an action is a button: any element a rule gives the attribute
data-self-action="NAME"(for exampleinline [[_]] -> span.self-button data-self-action=_1 _1), with arguments asdata-self-arg-KEYattributes. The host makes it a button in preview and Write; hybrid and source stay editing surfaces. - Rejected: actions written in documents (a pasted document could then act), and `from
connector NAME` as a data source (rendering would reach the network; the output file keeps the text-first rule and works offline).
D99. Running automations: consent, secrets and the log
#Adopted.
- Nothing runs by itself. A button runs its action on a click; the first time an action
runs in a project the host shows exactly what it will do (its steps, and each request with secrets hidden) and asks, with "always allow in this project". Automations are off until the user enables each one in the Manager's Automations section, which shows what it does. Consent and enabled automations are kept per project in host storage, never in the project, so a project cannot enable itself.
- Secrets are named values in host storage, set in the Automations section. On the web
they are encrypted with AES-GCM under a key that cannot be exported, kept in the browser's own storage (this protects them at rest; any script of the editor's own origin can use them). The desktop host may keep them in the system keychain instead. Secrets never appear in project files, the log or a dry run.
- Requests go through the host:
fetchon the web, where a server must allow cross-origincalls (CORS) or the request fails with that reason; a desktop host may make them natively. Timeouts are 20 seconds; replies over 5 MB are refused.
- Dry run shows each step and request as it would run, with templates filled in, and
changes nothing. The run log keeps the last 200 runs (time, what ran, the trigger, each step's result or error) for the session.
D100. Polish before v1.4
#- A
urlcell's link text is its value without amailto:ortel:scheme (the link keepsit), in the engine's static views and the interactive ones:
mailto:ana@example.comreadsana@example.com. Other URLs read as written. (Amends D80, D82.) - A board wider than its page fades at the side that has more columns.
- Keys a focused control uses itself (a board card's Alt-Left / Alt-Right) are listed on it as
data-local-keysand reach it instead of the editor's shortcuts (back / forward).
D101. Source spans in rendered HTML, for editors
#The Write view (D95) mapped a rendered block to its source per top-level block. Documents whose body sits in one container (a card, columns, a section) were one block, too large to align, and typing inside them landed at the container's start.
- A parse option
sourceSpans(Rustrender_html_spans, WASMDoc.render_html_spans, thedesktop's
spansrequest field) renders block-level elements (made by a paragraph, aline, ablock, agroupor asplitcell) withdata-self-s="A B": the element's span in UTF-8 bytes, relative to the start of its top-level node. Inline elements get none. - Relative, so an edit in one block leaves every other block's HTML unchanged (the preview
keeps their DOM). Spans outside the top-level node (included files) are left out.
- Off by default:
render_html, the conformance fixtures, the CLI and exports are unchanged.The editor turns it on and strips the attribute from everything it exports.
- The Write view edits the innermost element with a span (a list item deep in a card's
column), aligning its own text with its own source. A caret on something that is not text (a card's padding) types nothing, rather than typing at the container's start.
- The desktop reply sends
htmlasnullwhen it is the blocks joined (D65), as the workerdoes, halving the reply for a large document.
D102. Page layouts: scroll, pages, slides
#The user asked for a paged book view and for splitting a document into slides.
- Host behaviour; the engine is unchanged. A document may say
set layout pagesorset layout slides(asetvalue the engine already passes through, likestyle); other values are ignored. The user's switch per tab (the status bar, the palette) wins over it, andset page-layoutin preferences.self is the default for documents that say nothing. - Pages lays the preview out in page-sized columns, two side by side when the pane is wide
enough. Page turns (arrows, Space, Page Up/Down, the outer fifth of the pane, a swipe, the wheel) move one page or one spread; nothing scrolls.
self-pagebreak(D94) starts a new page. Documents over 4000 blocks show their first 4000 and say so. - Slides cut the document at page breaks; without them at top-level rules (
<hr>);without those at first- and second-level headings (a heading does not cut a slide that has no heading yet, so a kicker stays with its title). The break blocks are not shown. A slide is 16:9, scaled to the pane; content taller than a slide is shrunk (not below 45%).
Oshows every slide,For F5 (Present) goes full screen. - Both draw the same engine HTML as the preview, hydrated the same way, and a click on a block
moves the editor's caret there.
D103. Automations that go further
#The user asked for automations that are "useful and powerful", with demos. Everything stays text (D98) and consent works as before (D99); the additions:
- Connectors read replies as
format json|csv|xml|text(XML: RSS items and Atom entries, readby a small scanner so no DOM is needed); shape rows with
where,sortandlimit; keep an output's rows withwrite appendorwrite merge KEY; and write.selfor.mddocuments withrowandheadingtemplates. A CSV or TSV output keeps its typed header. - Action steps
prepend,write(replace) andcreate(only when missing). File names mayuse the context (
journal/{today}.self) and must stay inside the project.\nand\tin a step, row or heading are a line break and a tab. The context has{date},{time},{weekday},{month-name},{year},{month}and{day}. - Triggers
daily at HH:MM(once a day, at the time or on opening after it; the day of thelast run is kept in the browser) and
document saved({doc},{title},{words}). - The desktop app makes connector requests itself (
http_fetch: the same limits, so any webservice works without CORS) and keeps secrets in the system keychain (names listed in the app data folder, values never in a file). Phones keep the web's encrypted store.
- Ready-made examples: front page news, exchange rates with a history, a daily journal, a
writing log, a GitHub issues board, a feed reader.
D104. Date ranges and timelines in views
#The user asked for Gantt charts and calendars with date ranges. Both come from the same records, so they are view options, not new plugins:
to COLUMNnames the end of a range. It must be a date column; another type gets a warningand is dropped. A start with no end, or an end before the start, is a one-day record. Ranges longer than about ten years are cut there.
as calendar ... to END: a range is one bar across its days. Each record keeps a lane (aline in the day cell) for its whole range, so bars line up; empty lanes are drawn empty. The title shows on the first day, on Mondays and on the first of a month.
as gantt(alsoas timeline): one row per record, a bar frombytotoon a shared axisfrom the earliest start to the latest end, with month marks;
groupmakes swimlanes. Withoutto, a second date column is used when there is one. A record with only a start is a milestone (a diamond). With the host'stoday, a line marks it.- Static HTML places bars in percent of the range (
style="left:…;width:…"), so every rendererdraws them without script. The payload's
viewgains"to"only when the view has one, so earlier payloads are unchanged. - The client half drags a bar to move both dates, an end to change one, and arrow keys move a
focused bar a day (Shift moves its end); the change goes back to the text as one step (D83). Double-clicking an empty line adds a record there.
D105. Playing cards
#Adopted (v1.5 X16). A client plugin cards (fences cards and poker, verbatim). Cards
are a rank and a suit (As, 10h, Q♣), ?? face down. Lines title:, pot:, board:
(streets split by |), dealer:, hand NAME: CARDS | note, game: poker|blackjack|none;
other lines are notes. Scoring is the plugin's own (best five of seven, ties by kickers);
nothing reaches the engine, so the static page shows the source.
D106. Layouts: documents in a grid
#Adopted (v1.5 X24). A client plugin layout (fences layout and split, verbatim) shows
other documents of the project. The body is a picture of the grid: each line with | (or a
lone document name) is a row; cells are document paths, path#Heading (only that section)
or . (empty). A name in neighbouring cells is one area when it makes a rectangle, else each
place is its own cell with a note. Option lines: columns (sizes, bare numbers are fr, one
number N is N equal columns), rows, gap (length, narrow, wide, none), height
(length or screen), look cards|plain|split, title. // comments. The host renders each
cell's document with its own rules (PluginHost.loadDocument), its CSS scoped to the cell;
paths resolve from the cell's own document, a document already on the page is not shown again,
and nesting stops at three levels. Without a host the cells name the files.
D108. Custom styles: a document's CSS and a project's
#Adopted (v1.5 X25). A client plugin style (fence style, verbatim) holds CSS for the
document it is in. Hosts keep it to that document: every selector goes inside the document's
root, and :root, html, body, .self-page and .self-doc become that root, so
.self-doc { --doc-link: teal } sets a page token (templates/styles.css draws with them). As
for { css } (D42), declarations with url(, image(, image-set(, expression(,
javascript: or a backslash, and @import, @font-face and other at-rules but @media,
@supports and @keyframes, are left out. A folder or workbook's selfscribe.css at its root
is the same CSS for every document of it, applied before the document's own. The engine is
unchanged: it draws the block as <pre data-self-plugin="style">; exports turn it into page CSS
and remove it; other renderers show the source.
D109. Ratings, switches and suggestions
#Adopted (v1.5). Three column types join D80. rating (also stars) and rating(N) for N
from 1 to 10 (default 5): a whole number from 0 to N, or stars written out (★★★, ***); it
sorts and filters as a number; a static renderer draws N self-star spans (self-on for lit
ones) in <span class="self-rating" role="img" aria-label="K of N">; a bad cell warns
'V' is not a rating from 0 to N (column 'C'). toggle is bool drawn as
<input type="checkbox" class="self-switch" role="switch">. suggest and suggest(a|b) accept
any text; the payload lists the values under choices and a client suggests them with the
column's own values. The payload of a rating column carries max. Ratings take sum, avg,
min and max totals (stars count), and a bare filter stars keeps rated records. Fixture 131.
D110. Plugins people install
#Adopted (v1.5). The editor installs a plugin from a JavaScript module (or a .zip holding
an index.js) whose default export gives name, rules (one making the target name) and
hydrate(element, ctx) or create({settings, host}), with optional title, summary,
examples, settings and css (docs/PLUGINS.md). A built-in's name is refused. The app
shows the plugin's name, file and rules and warns that it runs with the app's rights before
installing; installed plugins are kept in the app's storage, loaded at start-up as blob
modules (the desktop CSP allows blob: scripts for this), listed under Yours, and removable.
Documents carry no code, as before (D73): they name the target in their rules, and renderers
without the plugin show the engine's output.
Amended (v1.5): the plugins folder. The desktop app also loads plugins/NAME.js and
plugins/NAME/index.js (or plugin.js, main.js) from its app data folder at start-up and on
Reload, checked like an install but without the question (putting a file there is the user's own
act). An installed plugin wins a name clash; a file taken away unloads its plugin at the next
look; the Manager opens the folder (open_plugins_folder, which can open only that folder) and
never deletes a file in it.
D112. Timers
#Adopted (v1.5). A client plugin timer (fences timer and pomodoro, verbatim). Each line is
a phase: a name and a duration in either order (25m, 90s, 1h30m, 2.5 min, 1:30,
1:02:03). repeat N (1-99) repeats the phases above it; lines after it, or starting with
then, come once at the end, and when there are some the last round's final phase gives way to
them (the pomodoro's long break). # TITLE names it, sound off silences the chime, // lines
are comments; a line without a duration is noted. An empty block is the pomodoro (Focus 25m,
Break 5m, repeat 4, then Long break 15m). Time is kept by the clock, not by counting ticks.
Nothing is written back; other renderers show the text.
D113. Editing inside a layout
#Adopted (v1.5), amends D106. A cell's views and plugins edit the cell's own document: the
edit host (D83) takes the document from the nearest [data-self-layout-key] and checks and applies
changes against that text (its tab when open, one undo step; else the file, with Undo on the
note), and data files against what the cell's last parse read. Each cell also has Edit: the
cell becomes a plain text editor of the whole document (with the caret at the cell's heading),
Save (Ctrl+Enter) writes it the same way, Esc cancels. Hosts announce changed documents
(PluginHost.onDocumentChange) and layouts draw those cells again. PluginHost gains
readDocument, writeDocument and onDocumentChange.
D111. Choices and suggestions from another table
#Adopted (v1.5). A header type choice(from SOURCE) or suggest(from SOURCE) takes its values
from another source instead of listing them: from NAME.COLUMN (a data block of the file and one
of its columns), from NAME (its first column), from PATH or from PATH COLUMN (a data file,
read like from PATH of D80). The values are the column's distinct non-empty cells, trimmed, in
order; a choice then validates and sorts by them as in D80. Lookups do not chain: in the source
read, its own lookups are plain suggest. An unknown source warns unknown source 'X', an
unknown column unknown column 'C' (at the header field), and the column becomes suggest with
no values; so does one whose source has no values. The payload lists the values under choices
as before, so clients need nothing new. Fixture 132.
D114. The element tree
#Adopted (v1.5). Some hosts may not put an HTML string into their page: a strict CSP, an
Obsidian plugin (its review refuses innerHTML), native views. render_tree(doc) gives the
rendering as data: `{"format":"selfscribe-tree","version":1,"css":CSS,"blocks":[{"span":[A,B],
"nodes":[…]}]}, a node being a JSON string (text, entities decoded) or JsonML ["tag",
{attrs in order}, …children] (attributes always present, bare attributes as ""`,
<script> and <style> bodies as one raw text child). It is **read back from the HTML
renderer's output** (selfscribe-core/src/render/tree.rs) rather than rendered a second time, so
whatever rules and plugins draw is in both and the two cannot drift; the reader understands
what the engine writes and degrades on anything else (an unmatched end tag is dropped, an
unclosed element ends at the end, comments are left out, a stray < is text). With
sourceSpans the elements keep data-self-s (D101). The CLI prints it with `self render
--tree; the JS API has render_tree(doc) (spans as UTF-16 like Block`) and
selfscribe/client has buildDom(nodes, doc?, {styles?, filter?}), which builds with
createElement/createElementNS (SVG, MathML, foreignObject back to HTML), drops on…
attributes, script and data: URLs (pictures keep data:image/…) and any <script> that is
not JSON data. Tests: every conformance page reads back to the same tree from its own
re-serialisation (Rust), and the tree built into DOM equals the DOM of the HTML for every
fixture (JS). Not one of the four functions of 03 §5; an addition beside them.
D115. A style check (lint)
#Adopted (v1.5). A client plugin lint (fence lint, verbatim) lists checks, one per line:
words W… (whole words, any case), exact W… (as written), ending S…, starting P…,
adverbs (-ly), long N (sentences over N words), passive (a be-verb and a past participle,
a guess) and repeats (a word twice); as LABEL names a check and a last word underline,
highlight or colour its look; # TITLE; // comments; an empty block is a default set.
It marks hits in the rendered page around it (never the text, never code, form fields or
other plugins' widgets) and shows a card with a count per check (a click goes through the hits)
and a switch to hide a check; it marks again when the page changes. Suffix and prefix words are
deliberately not a rule-language feature: word rules stay literal (02 §2), and affixes would
break the first-literal index of inline matching for little gain in documents themselves.
D116. Importing Word and PDF
#Adopted (v1.5). The editor imports a .docx or a .pdf into a new document (`use
markdown`, the title from the file). Word: styles give headings (or their outline level), the
title, quotes and code; numbering gives bulleted and ordered lists (nested); runs give bold,
italic, strike-through and code (a monospace font); links, tables (first row the header),
pictures (as data: images) and footnotes (a Notes list); equations keep their text. PDF (pdf.js,
loaded only then): lines by baseline, headings by size (15% over the body size, the largest
#), paragraphs by the gap, lists by a leading bullet or number, hyphenated line ends joined,
running heads, feet and page numbers dropped. Scans have no text and are refused with a note.
Both are guesses to read over; nothing about them reaches the format.
D117. Page setup: set page, set width, set lang
#Adopted (v1.6). A review found that paper size and margins existed only inside the PDF
export (and were forgotten when it closed), Word export was always A4, the pages view had no
paper at all, and a document could not say how wide its column is or what language it is in.
Three more set values, host behaviour like set style (D79) and set layout (D102); the
engine only passes them through:
set page SIZE [portrait|landscape] [margins narrow|normal|wide]:A4,A5,A3,LetterorLegal, in any order and case; unknown words are ignored. Hosts use it for the pages view (the paper's shape and margins), printing, PDF and Word; without it they use A4, portrait, normal margins (12, 20 or 28 mm).set width LENGTH | full: the reading column in the preview, hybrid mode and HTML exports(
38em,70ch,720px,16cm, clamped to sensible bounds), or the whole window. It wins over the width style words and the user's own measure for that document.set lang TAG: the document's language, a BCP 47 tag (en-GB,fr,pt-BR). The editor'sspellchecker uses it, and exports write it as
lang(HTML, EPUB, Word), which screen readers and hyphenation (thejustifiedstyle) need. Without it, hosts use their own.
The editor's File > Page setup… dialog writes these lines (and set layout) as one undo step.
Export dialogs start from the document's page and remember the other options.
D118. Scoped CSS for embedders (renderToHtml scope)
#Context. The rule CSS (D41) uses class names numbered per document (.self-r1), written at
the top level. Two documents on one page (forum posts, comments) share those names and restyle
each other; a rule's position: fixed can cover the host page. The engine's output is right
for one document per page and stays as it is.
Decision. The JavaScript package's renderToHtml(source, { scope }) takes a CSS selector for
the element the host puts the HTML in. Each .CLASS { … } line of the rule CSS is written as
SCOPE .CLASS { … }, and position: fixed declarations are left out (a rule left with no
declaration is dropped). scopeRuleCss(css, scope) does the same for hosts that call
render_html themselves. This is host behaviour on top of D41's format; the engine, its CSS
format and the conformance suite do not change. parse also accepts allowRe, allowRemote
and unsafeHtml beside the spec's snake_case names.
Consequences. INTEGRATE recommends scope for text other people write. A style block
stays refused without unsafe_html (D43), so nothing else reaches the page.
D119. Dates you can type, and units in filters
#Context. The owner asked for quick date entry ("+2d", "2w") and working days. Cells hold ISO
dates (D80), and a filter counts from today in days only (D81).
Adopted (v1.6).
- Typing a date (the editor; no format change). A date cell's editor, a form's date field and
the gantt and calendar editors take a short form and write the ISO date it stands for; the file only ever holds real dates. The forms, in any case:
today,tomorrow,yesterday;- an amount with a unit:
ddays (the default),wweeks,mmonths,yyears,wdworkingdays (Monday to Friday). A signed amount (
+2d,-1w,+10wd) moves the cell's own date when it has one, else counts from today; an unsigned one (2w,10wd) counts from today; - a weekday,
mon…sunor the full name (next fritoo): the next one after today, sofrion a Friday is a week away (today istoday).
Months and years keep the day and fall back to the month's last day (31 Jan + 1m = 28 or 29 Feb).
N wdsteps N working days, skipping Saturdays, Sundays and the document's holidays (below);0wdis the day itself, or the next working day after a day off. A cell with a time keeps its time. Anything else is written as typed and gets D80's bad-date warning as before. "Today" is the reader's local date. - Holidays.
set holidays SOURCEnames the days off thatwdskips. SOURCE is read like aview's (D80): a data block of the document, or a data file (
set holidays holidays/uk.csv); its first date column gives the days, one row a day, and a date column calledtomakes a row a span (a week off:2026-12-24, 2027-01-01). An unknown or unreadable source is warningunknown source 'X'at thesetline, andwdthen skips weekends only. The holidays go to clients in the payload (holidays, ISO dates), so editors and filters use the same days. - Units in filters (D81).
today+Nandtoday-Ntake the same units:today+2w,today-1m,today+10wd; no unit is days, as before. Engine and client compute them alike from the host'stoday(the shared vectors inspec/conformance/data/vectors.jsongain cases).
Consequences. One helper in the plugins package (shiftDate, readDateInput) serves the
editors and the client filter; the engine gets the same arithmetic for filters and D120. A
fixture covers filter units.
D120. Calculated columns and lookups
#Context. The owner asked for "a mini calc": show a date and also that date plus three weeks or ten working days, and pull a field across from another table. 02 §7 keeps expressions out of the kernel ("a host plugin may do them"); the data plugin is a host plugin (D80), as D81's filter is.
Adopted (v1.6). A header field may end in = EXPRESSION: NAME[:TYPE] = EXPRESSION. The plugin
computes it for every record; the kernel has no expressions and the records hold no such cell.
- The language, closed like D81's (no functions, no variables but the record's columns, no
loops, parsed into a tree and evaluated without
eval):expr := term (("+" | "-") term)* term := factor (("*" | "/") factor)* factor := "-" factor | "(" expr ")" | NUMBER | AMOUNT | "today" | DATE | REF AMOUNT := NUMBER UNIT (UNIT: d w m y wd, as D119: 3w, 10wd) REF := COLUMN | COLUMN "." COLUMN | "QUOTED NAME" - Types. number with number (
+ - * /) is a number, exact decimals as D80 (a division keeps15 digits after the point, rounding half to even); date ± amount is a date (D119's arithmetic; a number counts days); date − date is a number of days; anything else is a warning
cannot C 'A' and 'B' (column 'X')at the header and an empty column. The type is inferred; a written:TYPEthat disagrees is warningcolumn 'X' is a Tand the inferred type wins. - Columns are the block's earlier columns, calculated ones included (left to right, so there
are no cycles).
C.Flooks up through achoice(from NAME.COL)orsuggest(from …)column C (D111): the first record of NAME whose COL equals C's cell (ignoring case) gives its field F. Lookups do not chain. Unknown names are warningunknown column 'X' (column 'C'), a lookup through another kind of column'X' is not a choice(from …) column (column 'C'), and a missing pieceexpected a value,expected ')'orunexpected 'X'(with the column); each at the header, and the column is empty. - Cells. An empty or bad operand makes the cell empty; so does a division by zero.
todayneeds the host's
today; without it the engine leaves such cells empty and the client computes them with the reader's date (as D81 does for filters). - Records. A calculated column takes no field: in CSV and TSV the record's fields fill the
other columns in order, and D80's field count ignores calculated columns; in JSON, JSONL and records a key of that name is ignored with warning
column 'X' is calculated: 'X' is ignored. - Views. A calculated column is like any typed column:
columns,sort,group,filter,totals, a calendar's
byand a gantt'sto. It is read-only: editors show it, never write it, and a board grouped by it does not move cards. The payload's column gains"calc": "EXPR", and its cells carry the computed values, so earlier clients still draw them; the client computes them again when a record changes.
Rejected. Functions (IF, SUM, ROUND) and cell formulas (=A1+B2): a spreadsheet is
another product, and the cells of a data file stay data. Cross-table lookups without a from
column: the relation should be visible in the header.
Consequences. Engine and client evaluators share vectors; fixtures cover arithmetic, working days, lookups and the warnings; the dictionary, Help and PROMPT.md gain the syntax.
D121. The name: Selfscribe, and Selfscriber for the app
#Context. "Markform" clashes with another project (docs/OBSIDIAN.md) and its npm name is taken. The owner chose a new name: a document that describes, and so designs, itself.
Adopted (v1.6). A clean break, before the first release:
- The format, engine, spec and packages are Selfscribe (selfscribe.dev); the app is
Selfscriber (selfscriber.app); selfscribe.new opens the app at
?new. *The app's name is Selfscribe since D265.* - Files are
.self(was.mf); a project's settings file isselfscribe.self(wasmarkform.mf), and the app's own files follow (preferences.self,comments.self,workbook.self). - The rules block opens with
~~~ selfscribe(any case, D2), no longer~~~ mf. - Rendered HTML uses the prefix
self-anddata-self-(wasmf-,data-mf-); client pluginclasses use
selfp-(wasmfp-). - The command line tool is
self(self render,self check), withselfscribeas a secondname for it. Environment variables start
SELFSCRIBE_(wasMF_). - npm packages are
selfscribe,selfscribe-plugins,selfscribe-cm6andselfscribe-fs;the Rust crates
selfscribe-core,selfscribe-plugins,selfscribe-wasm,selfscribe-cliandselfscribe-conformance.
Nothing reads the old names: .mf files and ~~~ mf blocks are plain text to Selfscribe. Every
earlier decision's mf, .mf and mf- read as the new names.
D122. Keyboard shortcuts for rules
#Context. The owner asked for shortcuts that belong to the document: Ctrl+B for bold where
the rulebook says what bold is, a key for a heading or a highlight. The editor already guesses
Ctrl+B, Ctrl+I and Ctrl+E from targets (strong, em, code); nothing lets a rule say it.
Adopted (v1.6).
key SHORTCUTis a modifier (D20's list, both forms):inline **_** -> strong key Ctrl+B,line # _ -> h1 key Ctrl+1; in the full form akey Ctrl+Bline, oreditor key Ctrl+B. It is an editor hint: stored in the rule table (editor.key), no effect on HTML, and a rule that has only this hint keeps its short form (self fmt).- SHORTCUT is modifier words and one key joined by
+, any case:Ctrl,Cmd,Mod(all three mean Ctrl, or ⌘ on a Mac),
Alt(Option),Shift; the key is a letter, a digit, one punctuation character other than+, orF1…F24,Enter,Space,Up,Down,Left,Right,Home,End,PageUp,PageDown,Backspace,Delete,Insert. It needs Ctrl or Alt unless the key is F1…F24. The rule table holds it writtenMod+Alt+Shift+KEY(in that order, letters upper case). Anything else is warninginvalid value for 'key': 'X'and the rule has no shortcut. - In the editor, the shortcut applies its rule where the caret is: an inline rule wraps the
selection in the rule's delimiters, or unwraps it when it already has that rule (as the format bar does, D95); a line or block rule turns the selected lines into it, or back to plain text when they already are. When two rules give one shortcut, the later wins. A rule's shortcut wins over the app's own inside the document, except these, which stay the app's: Ctrl+S, Ctrl+Z, Ctrl+Y, Ctrl+Shift+Z, Ctrl+C, Ctrl+X, Ctrl+V, Ctrl+A, Ctrl+F, Ctrl+H, Ctrl+K, Ctrl+P, Ctrl+W, Ctrl+N, Ctrl+O and Ctrl+Tab. The guesses (Ctrl+B, Ctrl+I, Ctrl+E) apply only to shortcuts no rule gives.
Rejected. A separate keys block binding shortcuts to rule names: the shortcut belongs next
to what it does. App commands (the emoji panel, view toggles) in documents: they are the reader's
choice, not the document's, so they belong in preferences.self.
D123. set linebreaks keep
#Context. The plain rulebook has no rules, so lines merge into paragraphs as in Markdown
(D31): a shopping list written line by line reads as one line. Poems and addresses want the same.
Adopted (v1.6). A kernel setting (01 §2), like blanklines: set linebreaks keep makes each
line break inside a paragraph a br element (MadeBy::Break) whose span covers the join (the
trailing spaces, the break and the next line's indentation); collapse (the default) keeps the
newline text node. Lines matched by rules are not paragraphs and are untouched. Like
blanklines, it applies from imported rulebooks. Any other value is `invalid value for
'linebreaks': 'X'. The built-in plain rulebook sets keep`. Fixture 138.
D124. Folding the rules block: regions and sections
#Adopted (v1.6). Comment lines of the rules block (D12) that fold, in the engine's fold list
as kind region (so every editor gets them): # region NAME (or #region) to # endregion,
nested, and one left open runs to the end of the block; and a section comment, a comment
starting with --- (# ---- Headings ----, as the built-in rulebooks and examples already
write them), to the last non-blank line before the next such comment, region line or the end.
Level is the depth (1 at the top). They stay comments: no rule, setting or diagnostic changes.
Fixture 140.
Rejected. A region keyword in the rules language: a comment keeps old engines reading the
block unchanged, and matches what other editors do (#region in C#, VS Code).
D125. Size words after a block's opening line
#Context. A diagram or a code block often wants less than the whole column
(``` ` mermaid maxwidth:800px ```). Writing a rule per size is too much for that.
Adopted (v1.6). On the opening line of a block rule (D33), words at the end of the form
NAME:VALUE or NAME=VALUE, where NAME is width, maxwidth (max-width), height,
maxheight (max-height) or align, are size words. They are taken off before the block rules
match the line, so ``` ` mermaid maxwidth:800px `` is the mermaid block and `` `` js
width:50% ``` captures js in its slot. A length is a number with px, em, rem, ch, %`,
vw, vh, cm, mm, in or pt (a bare number is pixels), or full (100%); align is
left, center (centre) or right (margins). The block's element gets them as an inline
style (after a rule's own style=), in order; a code block's goes on its pre. A word with
a NAME but a value it does not take is taken off too, with invalid size word 'NAME:X', and
adds nothing. Only the end of the line counts; a line that is nothing but size words is not an
opening. Line and inline rules are not affected: in prose, width: is text. Fixture 139.
Rejected. A kernel attribute syntax ({width=800}): the kernel stays fixed (01), and the
words read naturally after a fence's language, where editors already expect options.
D126. How wide a document shows, per mode
#Context. One global switch (centered) made Source a narrow column like the preview, while
code wants the whole window and a dashboard wants it even in the preview; the owner asked for
widths that follow the mode and the document, remembered per document.
Adopted (v1.6). The editor decides the width of the text in each mode (split shows the page
as Preview does) in this order: (1) what the reader chose for this document in this mode with the
Full width switch, remembered on this computer (new documents for the session); (2) what the
document or its rulebook says: set source-width full|reading|LENGTH for Source, set width
(D117) for the others; (3) wide content, for the reading modes only: a layout with more than one
column, a board, calendar or timeline view, or a table view of seven columns or more; (4) the
reader's defaults: Source full width (source-full-width on in preferences.self), the others as
centered says. Line numbers in Source work the same way: the reader's choice for the document,
then set line-numbers on|off, then the line-numbers preference. The switch's tooltip says
which of these decided. source-width and line-numbers are variables the engine only stores
(04 §6); the plain rulebook sets source-width reading and line-numbers off.
D127. A longer fence in the Markdown rulebook
#Context. Guides show documents that contain code blocks of their own; they wrap them in a
fence of four backticks, as CommonMark allows. The built-in markdown rulebook knew only three,
so such an example broke at its first inner fence (seen when the guide joined the site).
Adopted (v1.6). templates/markdown.self ends with block `` $ ... ``` -> code lang=$1
verbatim`: a four-backtick fence is a code block whose three-backtick lines are text. It is
added last, so the rulebook's other rules keep their numbers (37 rules now). Longer fences (five
or more) are not recognised; nesting one level deep covers what the guides need.
D128. Pages and slides never hide what does not fit
#Context. The user's review (24 Sept): slides and pages "being weird, with no obvious way to fix it". A table or code block taller than a page was kept whole and cut off at the page's edge; a wide table broke its words a letter at a time; a slide whose content did not fit at 45% text was cut at both ends, with nothing on screen saying so.
Adopted (v1.7, host behaviour; amends D102).
- Pages: tables, code and quotes run on to the next page; small things (pictures, figures,
rows, list items) stay whole; a heading stays with what follows. A drawn block (a chart, a diagram, a data view) stays whole and, taller than a page, scrolls inside it. A table wider than the page gets smaller type (to 80%), then zooms out (to 55%), then scrolls sideways. A look that draws its own sheet (
paper) or columns (newspaper,columns) does not do so inside pages or slides: they are the paper. - Slides fit in steps: pictures and charts get shorter (to 240px of the 720px slide), the text
shrinks (to 45%), the whole content zooms out (to 60%). A slide that still does not fit scrolls and is too full: marked in the overview and counted in the deck's bar ("2 slides too full"), with Split this slide, which inserts the deck's own cut before the first block that runs over (a copy of an existing page break or rule; in a deck cut at headings, the slide's heading again with "(continued)", so the way the deck is cut does not change).
- A deck edited as one page (Split, Write) shows a labelled line where each slide starts.
- A layout switched in the status bar can be kept with the pin beside the switch, which writes
set layout …(as File › Page setup does).
D129. Palettes: named colours with a dark value
#Context. Examples wrote the same hex values again and again (128 color-mix(…) calls in the
examples), with color-mix(in srgb, #hex 85%, currentColor) standing in for "a bit lighter on a
dark page", and no way to say what a colour should be on a dark page. The user: "a nicer syntax
for light/dark, for gradients… maybe like a palette command, so if using hex it is cleaner".
Adopted (v1.7; spec 01 §2, 02 §4). A new rules-block line, in two forms:
palette accent #7c5cff dark #b197fc
palette
ink #1d2433 dark #e6e9ef
soft color-mix(in srgb, var(--accent) 12%, transparent)
sunrise linear-gradient(90deg, var(--soft), transparent)
- Each entry is
NAME VALUE [dark VALUE]; the block form takes indented entry lines, as afull-form
ruletakes keys.darkis a word, not a symbol (/already means something inrgb(0 0 0 / 50%)). - Rules use a colour as plain CSS,
var(--accent), so there is no new token syntax (lesson 3,02 §4 "no shorthand tokens"). Entries may use earlier ones the same way.
- NAME is a lower-case letter, then lower-case letters, digits and
-. VALUE is checked like adeclaration (D42); a
;,{or}is refused. A bad entry is a warning and is skipped. - A later entry with the same name replaces the earlier one, as rules do; entries come in with
uselike rules, so a document can recolour a rulebook with one line. - The CSS output starts with one block for the palette, before the rules:
:where(.self-doc, .self-palette) { --accent: #7c5cff; --accent: light-dark(#7c5cff, #b197fc); … }. The plain value comes first as the fallback for browsers withoutlight-dark(); a value derived fromvar(--accent)follows its dark value by itself.light-dark()follows the page'scolor-scheme, which the hosts set (the editor from its theme, exports from theirs);@media (prefers-color-scheme)would follow the computer instead. darktakes a colour only: a dark value withgradient(in either half is a warning and isdropped (build the gradient from palette colours instead, as
sunrisedoes).- (v1.7, later) Each hex or
rgb()entry also gives--on-NAME:#16181dor#ffffff,whichever has the higher contrast on it, through
light-dark()when the two shades need different ones. An entry namedon-NAMEwins. Badges and bubbles writecolor: var(--on-todo)instead ofwhite, which failed on a light dark-page shade. - (v1.7, later) A replacement is not silent: an entry without
darkreplacing one with it isan info; a rulebook's entry replacing the document's own (the document's line above the
use) is a warning at the document's line. Aclassthat a rule from another file already puts on its elements (markdown'sli.task) is an info at the class line. - The result carries the palette (name, value, dark value, origin) for editors: swatches,
completion after
var(--, the contrast check and the inspector read it. Hosts that show rules outside.self-doc(the editor's hybrid text) put the classself-palettethere.
Review, 24 Sept (D129). Palette names starting ui-, syn-, font-, ed-, cm-, pg-,
self- or selfp- are refused: in hybrid mode the palette is set on the text the editor draws,
where those names are the editor's own tokens.
D130. Styling a class without a rule
#Context. Ten examples wrote fake rules only to carry CSS (`line ::chip:: -> hidden { … } as
chip) for classes made by split, group` or a shared look, and PROMPT.md taught the trick of
naming the first rule after a class so others could borrow it.
Adopted (v1.7; spec 01 §2, 02 §4). class NAME { css } styles every element with class
NAME: a group wrapper, a split piece, or a class several rules share (-> span.pill).
- NAME is a letter, then letters, digits,
-and_; names startingself-belong toSelfscribe and are refused. The CSS is checked like a rule's (D42).
- It is emitted after the palette and before the rules, as
/* FILE:LINE */ :where(.self-doc, .self-palette) .NAME { … }, so a rule's own{ css }wins over the shared class. The prefix keeps it inside the document: hosts put document CSS on their whole page, and a bare.notewould style the host too (review, 24 Sept). - Names starting
cm-,ed-andpg-are refused as well: the editor's own elements sitinside the document's area in hybrid mode and in pages.
- A later
classwith the same name replaces the earlier one (imports included). - The fake-rule trick still works; nothing that worked before changes. *Withdrawn by D264
(25 Nov 2026):* a rule's style is now for its own elements only, so a rule named after a class another rule writes no longer styles that rule's elements; write
class NAME { … }.
Addendum (v1.7, 27 Sept): pseudos and one element inside. A class only styled .NAME, so a
breadcrumb separator or a card's heading still needed a rule. The name may now be followed by
- pseudo-classes from
:hover,:first-child,:last-child,:nth-child(ARG)(ARG isodd,even, or digits,n,+,-with no spaces), then at most one pseudo-element from::before,::after,::marker, which ends the selector:class crumb::after,class crumb:last-child::after; - one element inside it, as a separate word: a descendant
class card h3or a childclass card > p. The element is a type selector (a lower-case letter, then lower-case letters and digits) and may carry the same pseudos:class steps li::marker,class card > p:first-child.
Nothing else is accepted: no second element, no class, id, attribute or list selector, no
pseudo-element before the element. Anything else is warning `class 'NAME': after the name
only …` and the line is skipped. Every selector still starts with
:where(.self-doc, .self-palette) .NAME, so it can only reach elements inside the class, which
are inside the document. The CSS is checked as before (D42): content: "›" is fine; a
backslash escape ("\203A"), url(, < and > are dropped, so write the character itself.
A later class replaces an earlier one only when both the name and the ending match. The class
list the result carries for editors gives the ending as selector (absent for a plain class),
and the contrast check reads plain classes only.
D131. Font tokens for rules
#Context. Examples wrote var(--font-ui, system-ui, sans-serif) 115 times, but --font-ui is
the editor's own name, not a page token, so the CLI, the site and exports fell back.
Adopted (v1.7; 04 §6). templates/styles.css publishes --doc-font-ui (a sans-serif for
labels and badges) and --doc-font-mono (code) on .self-page with full fallbacks, next to
--doc-font and --doc-font-heading. Rules write var(--doc-font-ui).
D132. A document's theme for the app
#Context. A document could set its page's look (set style) but not the colours of the app
around it, so a neon slide deck or a sepia manuscript was always shown in the person's theme.
Adopted (v1.7; host only, no engine change). set theme NAME in a document, with the id of a
built-in theme (cyber-dark, sepia, nord…), colours the whole app while that document is the
active tab. Leaving it (another tab, Home) brings back the person's own theme. An e-ink device
keeps its theme. The preference document-themes (Settings, on by default) turns it off, and the
status bar's theme picker says when a document is choosing. The engine keeps set theme as it
keeps any unknown setting. Export offers the document's theme ("Its own") and chooses it by
default when the document sets one (v1.7).
D133. One-word slots in word rules
#Context. Word rules took no slots, and inline rules must end with a literal, so a mark
followed by one word could not be matched: @ana, @9:30, #groceries, $12, v1.2, #123,
50%. People wanted mentions, tags, times and prices without writing a closing mark.
Adopted (v1.7; spec 02 §2-3). In a word rule the slot character matches one word.
- A word is a run of letters, digits and
_(Unicode letters and digits count, as in D36),with
-,.,:and/allowed between them. It starts and ends with a letter, digit or_. So a trailing.,,,;,:,!,?or)stays outside:@9:30,gives9:30,#tag.givestag,(v1.2)gives1.2. An escaped character ends the word. - A slot followed by a literal stops at the first place in the word where the literal
matches right after a letter, digit or
_(non-greedy, as in D35):#_/_on#a/b/cgivesaandb/c;_%on50%gives50. A slot at the end takes the whole word. - Shape (D26). One or two slots, at least one literal (
word _is an error,word pattern needs a literal: it would style every word), no digit slot (`word pattern cannot contain the digit slot), more than two slots isword pattern has at most two slots. Two slots still need a literal between them. A slot may come first (_%`). - Boundaries (D36). A slotted word rule never starts right after a letter, digit or
_,whatever its first character, so
email@hostdoes not match@_andx#tagdoes not match#_. The end keeps the word-rule check: a literal ending in a letter or digit may not be followed by one. All-literal word rules are unchanged. - Precedence (D27). Unchanged: at one start the longer pattern wins, a slot counts 0, then
the rule defined last. So
word @ana(4) beatsword @_(1) on@ana,word TODO(4) beatsword _O(1) onTODO, and#_/_(2) beats#_(1) when there is a/. A literal rule wins even when the slotted one would take a longer word:@ana.bis@anathen.b. - Content (D22, D38). As in inline rules: the literals are dropped, the unconsumed slots are the
content,
keepkeeps the literals, a slot used by an attribute is not content (word #_ -> a.tag href="#_1" keepshows#groceriesand links to#groceries). The word is not scanned for further rules: it is one word, and scanning it again letv_match inside@veg. The dropped literals are marks for the editor like other inline rules' (D50). - Word rules whose pattern starts with a slot are tried at every position that can start a
word; the others keep their first-byte buckets, so documents without them scan as fast.
Why not greedy to the next space. Tags and mentions sit before punctuation far more often
than they contain it; a word that swallowed , and . would need every author to write
escapes.
D134. Chart views
#Context. The chart plugin draws from numbers typed into its block, so a chart of a
budget meant copying the budget's totals by hand and keeping them in step. A view already
filters, sorts and totals records; it could draw the totals.
Adopted (v1.7; spec 04 §7). as chart is a view kind (D80): a total per category, drawn
as a chart that follows the records as they are edited.
- Type.
as chart TYPE, the next bare word:bar(the default),hbar,line,area,pieordonut. Another word warnsunknown chart type 'x'and bars are drawn. Why notas chart type line: the type is the only thing that can followas chart, and one word reads likeas board. - Categories.
by COLUMN. A column's values are categories as groups are (D82): choicesin their order, then other values in order of appearance (so
sortorders them), then(none). A date column groups by a period written after it,by due month:day(the default),week(labelled with its Monday),month(Sep 2026),quarter(2026 Q3) oryear.by monthalone, where no column is calledmonth, is the first date column by month; without a date column it warns'by month' needs a date column. Periods run oldest first and the empty ones in between are drawn (up to 400 of them), so a line does not skip a quiet month. A record without a date is left out and noted (1 record without a date). A period after a column that is not a date warns and does nothing. Withoutby,groupalone gives the categories; without either, the first choice column, else the first date column, else the first column. - Values. The totals words (D80) give the values: each
sum,avg,minandmaxof anumber or rating column, and
count, is a series, in the order written.minormaxof a date column is left out with a warning. No total meanscount. Values are exact decimals as totals are; an empty category counts and sums to 0 and has no average, minimum or maximum (a gap in a line). - Series.
group COLUMNbesidebymakes one series per value of that column, of thefirst total.
pieanddonutdraw the first series. - Which records. Filter, search and sort apply first, as in every view.
pagedoes not:a chart counts every record the view keeps.
- Totals. The totals line still shows under the chart, over every record kept.
plainkeeps its meaning (D80: no bar of views, search or buttons).
- Static output. The engine draws an SVG (
role="img", labelled with the chart's kind,series and category column; every bar, point and slice has a
<title>with its value), a legend when there are several series or slices, and the numbers as a table in adetailselement. Colours are classes (self-chart-s1…s8) that the document stylesheet fills, so the chart follows the document's accent. The payload's view gains"chart"(on a chart) and"period"(when written);byis sent for a chart as for a board. - Client. The client works out the same numbers from the payload (so an edit shows at
once) and draws them with the
chartplugin's renderer: theme colours, the value on hover and focus, legend buttons. A redraw with the same numbers keeps the drawn chart. "Show as" offers Chart when the view has a number or rating column, or counts; Save view writesas chart TYPE,by COLUMN PERIODandgroup.
Why the totals words rather than new ones. sum amount already means "add up amount" in
every view, and a table switched to a chart should show the numbers it just showed in its
footer. Why no stacked bars or scatter plots yet. Stacking needs a word for it and a
scatter plot has no categories; both stay in the chart block for now.
Amended (26 Nov 2026). A plain chart has no totals line: it has no bar to switch from a
table, so its totals words are only its series, and the line read as a stray caption in a
report's figure ("max rate 111"). A chart with its bar keeps the line. Where the categories are
a number column, both axes are numbers and the client names them: the category column under
the chart, and the measured column beside it when there is one. The engine's static chart is
unchanged for now.
D135. Mail merge: set merge
#Context. Letters, certificates, invoices and name badges are one page with a few changing words, made once per row of a list. People kept one document per person by hand, or a word processor's mail merge outside their text.
Adopted (v1.7; a host feature, no engine change). A template document names its rows
with set merge SOURCE in its rules block, and its fields are {{column}} through the
existing var target (inline {{_}} -> var, D49).
- Sources. Read like
view:(D80), plus one form for another document:set merge guests: the data block namedguestsin this document;set merge guests.csv(.tsv,.json,.jsonl; any value with a/): a data file,relative to the document;
set merge people.self#guests: the data blockguestsof another document of thefolder or workbook, resolved like a link (
people#guestsfindspeople.self);set merge people.selftakes that document's only data block.
Why
#: it is how a link names a place inside another document (notes.self#setup), and it keeps the value one word, assetvalues of other hosts' settings are. - Fields. The host parses the template once per row with the row as host data
(
ParseOptions.vars), which D49 already puts before the document's settings. A field is therefore plain text, never markup. Each column is given under its name, and under its name in lower case when no column has that name. Outside a merge (another host, the command line) a field shows the document's ownset NAME value, so those lines are the placeholders. - Its own block. A same-document source block is left out of every merged page;
view:lines of it stay. The editor's preview still shows it.
- Output (the editor). A row stepper over the preview ("Row 3 of 42 · guests in
people.self") sets the row the preview shows. File › Export › Mail merge… makes one PDF with a new page per row (through the print dialog), or a .zip of web pages, Word files or Selfscribe documents, one per row. File names come from a pattern (
{{name}},{{_row}}for the row number), made safe for every system and unique without regard to case. A filter in the view filter language (D81) picks the rows. - A row as a document. The Selfscribe output is the template with
set mergeremoved,its own data block removed, and the row as
setlines at the end of the rules block. A column whose name is not one word gets a slug key (First town→first-town) and its fields are renamed to match, so the file renders the same on its own. - Problems. A source that cannot be read is named where the stepper would be:
No file guests.csv in this folder.,people.self has no data block named staff.,people.self has 2 data blocks: name one, as in set merge people.self#guests.
Why not a new target or block. The var target and host vars already did the work; a new setting that only hosts read keeps the format unchanged. Why no PDF per row yet. PDF is made by the print dialog on every platform; a file per row needs a PDF writer the app does not have.
D136. Encrypted blocks: ```secret
#Context. People keep door codes, account notes and diary entries in the same files as everything else, and wanted one part of a plain text file to be private without moving it to another app or encrypting the whole file.
Adopted (v1.7; a client plugin, spec 04 §8, no engine change). A fenced block whose body is ciphertext, self-describing so any tool can open it years later:
```secret
selfscribe-secret v1 aes-256-gcm pbkdf2-sha256 600000
salt: DRG2cFh4e3gugyBRzJ3gEg==
iv: VTh2Hs78Iz5vDxzv
Gy7NmVqY0976bd0uMOcRNgAxs04jBygnRGrcvEIj6wD4LR99Uhfojh6CkvIXc5KIj10WLJakKT9d
…
```
- Header. One line: the magic word, the format version, the cipher, the key derivation
and its iterations. Then
salt:andiv:in base64. Othername: valuelines before the data are read past (room for a hint in a later v1). The rest is base64 of AES-GCM's output (ciphertext, then the 16-byte tag), wrapped at 76. Blank lines and CR LF do not matter. - Crypto (WebCrypto only). The key is PBKDF2-HMAC-SHA-256 of the passphrase (Unicode NFC,
UTF-8) with a random 16-byte salt, 600000 iterations for new blocks, 32 bytes. The cipher is AES-256-GCM with a random 96-bit IV and no additional data. The plaintext is the block's inner text in UTF-8. A reader accepts 1 to 10 000 000 iterations (more could hang a page).
- Saving again keeps the salt and iterations (so the key is not derived again) and takes a
new IV every time. A new block (Encrypt selection) takes a new salt.
- One message for failure. A wrong passphrase and changed data both fail GCM's check, and
both say "That passphrase doesn't open it." A block that cannot be read says why.
- The key. A non-extractable
CryptoKeyin memory, found by salt and iterations, so theblock stays open while the preview draws it again. It is never stored. Lock forgets it, and so does the idle time (
set plugin-secret-idle MINUTES, 5 by default: no key, pointer or wheel activity on the page). Only the live document reopens a block by itself; an export or a gallery never does. - Where the plaintext may be. Only in the block's shadow root, the small editor's
textarea (also in the shadow root) and memory. Write-back replaces the whole body through the edit host (D83), so the document text, the undo step, drafts, versions, search, the note index and the Inspector only ever see ciphertext. A shadow root is outside
textContent,innerHTMLandcloneNode, so find in the preview, the Write view, exports and block pictures cannot read it either. Exports replace the block with "Locked (encrypted)." The content is drawn with the document's own rules throughPluginHost.renderText(the host parses the rules block plus the plaintext and keeps nothing), or as a small safe Markdown when the host has none. Plugins inside run read-only. - Commands. Edit › Encrypt selection… asks for the passphrase twice (8 characters at
least) and adds the plugin's rule line when the rules block lacks it, as one undo step. Edit › Decrypt block asks first, and for the passphrase unless the block is open.
Why a fenced block with a text header, not a binary blob or a JSON object. It stays one readable, diffable piece of a plain text file, and each field can be read by eye. *Why no additional data over the header.* Every field that matters already changes the key or the IV, so a change to one fails the tag; leaving it out keeps other tools' code to a few lines. Why PBKDF2 and not Argon2. WebCrypto has PBKDF2 and not Argon2, and the rule is no crypto of our own. The version word leaves room for another KDF later. Known limit. Encrypt selection is one undo step, so until the document is closed, Undo can bring back the plain text it replaced (it was in the text before); an earlier saved version of the file may hold it too.
D137. Publishing: what a document says about itself, contents blocks, conditional merge text
#Context (M2). Exports carried a title and the author from Settings, and nothing else. An e-book had no cover and one contents entry per document; a website had no description, no link previews and no search; a mail-merge letter could not say one thing to some rows and another to the rest.
Adopted (v1.7; host only, no engine change).
- Settings for exports.
set author NAME,set description TEXT,set cover PATH(apicture relative to the document) and
set date YYYY-MM-DD(todayis the export's day). The engine keeps them as it keeps any setting (so{{author}}shows them). EPUB writes them asdc:creator,dc:description,dc:dateand its cover; Word as its core properties; web pages asmetatags; websites also as Open Graph and Twitter tags. Several documents: the first that sets each one wins; the author falls back to Settings › Your name. - The contents block. A client plugin
toc(`tocwith optionallevels: 2-3,numbered: yes,title: …) lists the document's headings as links, live in Preview and Write, as a static list in HTML, PDF and EPUB, and as a realTOC \o "a-b" \hfield in Word (its current entries inside, so it reads correctly before Word updates it). Headings are matched by the same slug as#headinglinks. - Conditional text in a merge.
{{#if column}} … {{else}} … {{/if}}and{{#unless column}} … {{/unless}}choose text by a row's value before the row is parsed. A value is true unless it is empty,0,no,false,offorn;{{#if column = value}}and!=compare, ignoring case. The host chooses on the text (not the AST) because the branches may hold whole blocks; in the preview the text keeps its length (left-out parts become spaces at the end of their line), so source spans still find their lines. Addendum (25 Nov 2026). The engine makes the same choice itself, so the command line and the embeddable renderer no longer show every branch with the markers between them: a document with a rule whose target isvar(its own or a rulebook's; that is how it says{{name}}is a field) has its body's{{#if}}and{{#unless}}text chosen before the lines are read, from hostvars, then its settings, asvarreads them. The text keeps its length as in the preview, so spans and problems point at what was written. A document without avarrule keeps the markers as written (a code block that shows them, say). An included body is chosen with the including document's values. A host that chose already hands the engine no markers, so nothing is chosen twice.
Why a plugin for the contents and not a kernel directive. It needs every heading of the
document after rendering, which is the host's view, and a plugin keeps the kernel fixed.
Why the choice on the text. {{_}} -> var is an inline rule of the document; a branch that
holds a heading or a list has to be chosen before the lines are read.
D138. Query blocks: ```query
#Context. A folder of notes holds tasks in many files and notes on many subjects. People asked for one page that lists the open tasks of a project, the notes tagged #trip, or what changed this week, and keeps itself up to date, as Obsidian's Dataview and Tasks do.
Adopted (v1.7; the app, like [[links]]: no engine or spec change). A fenced block whose
info word is query. Its words (the rest of the opening line, then its lines; # lines are
comments) say what to list, which, and how:
```query tasks open in:garden/ tag:#pears due:7d sort due as board
```
- What.
tasks(task lines[] …,[x] …,- [ ] …, outside code and the rules block;openunlessdoneorallis written) ornotes(documents, the default;filestoo). - Filters.
in:FOLDER/(in:.the query's own folder,in:thisits own document),path:GLOB(the Search panel's globs),#tagortag:(nested tags count),@nameormention:,links:NAME(documents linking to NAME),title:WORD,due:andchanged:(today,overdue,none,any,7d,2w,2026-10,2026-10-28,<DATE,>=today+7d;changed:7dis the last seven days,due:7dthe next seven and anything overdue), and words or "quoted words" (in a task's text, or a note's name, title and headings).-before a filter excludes. Filters of one key widen, different keys narrow. A task's tags are those of its line and of its note's lines that are not tasks. - Due dates on a task:
📅 2026-11-02(Obsidian Tasks) ordue:2026-11-02, taken out ofthe task's text.
- Showing.
sort FIELD [desc](empty values last),limit N, `as list|table|cards|board|calendar
,by FIELD. A board goes bystatus(open, done), a calendar bydue` (tasks) orchanged(notes), unlessbysays otherwise. - Rendering. The app turns the rows into a
datablock (D80) and has the engine render it,so every view, its search, sort and filter, and every export work as they do for data; the block's place on the page shows it, in a frame marked
data-self-queryanddata-self-fixed. A problem in the query is a line above the results, and the rest of the query still runs. - Fixed records. A data view inside
data-self-fixedadds, deletes and saves nothing, andopening a record asks the host to reveal its source (
EditHost.revealwith the record's offset). Its yes/no and choice cells still propose edits: for a query, the app turns a ticked box or a card moved betweenopenanddoneinto a tick in the task's own note (its open tab when there is one, as one undo step; a tab with no other changes is saved too), after checking that the line still holds that task. Every other edit is refused with a message. - Live. When the notes index changes what a query would show, the documents holding
queries are drawn again.
Rejected. A query language with expressions and fields of its own (Dataview's DQL): the words above cover the requests, and the data views already sort, filter and total. Writing the results into the file: they are drawn, so the text stays the query.
Consequences. Notes scan task lines and headings; the index keeps each document's time of
change. docs/guide/folders.md gains "List tasks and notes from across the folder".
D139. Functions in calculated columns, and totals over related rows
#Context. D120 kept calculated columns to arithmetic and rejected functions. In use, people
asked for the few things a sheet of records always needs: a word when a date has passed, a
price rounded to cents, the larger of two dates, a name and a town joined, and on a clients
table the total of that client's jobs. Calculator notes (the calc plugin) had no functions
either, so the two maths languages drifted.
Adopted (v1.7, amends D120). The expression language grows, still closed and parsed into a tree (no eval, no variables, no user functions):
expr := and ("or" and)*
and := compare ("and" compare)*
compare := sum (("=" | "!=" | "<" | "<=" | ">" | ">=") sum)?
sum := term (("+" | "-") term)*
term := factor (("*" | "/") factor)*
factor := "-" factor | "not" compare | "(" expr ")" | NUMBER | AMOUNT | DATE | TEXT
| "today" | CALL | TOTAL | REF
TEXT := "'" … "'" ('' is a quote inside)
CALL := FN "(" [expr ((";" | ",") expr)*] ")"
TOTAL := ("sum" | "avg") "(" TABLE "." COLUMN ")" | "count" "(" TABLE ")"
- Functions.
if(test; then[; else]),round(x[; places])(halves away from zero, exactlyplacesdecimals, 0 to 15),min(…)andmax(…)(numbers or dates; empty values left out),abs(x),concat(…)(text of each value, empty as nothing),join(sep; …)(the non-empty values withsepbetween),days(from; to)(to - fromin days) andtoday(). Names are case-insensitive. A wrong count is warning'round' takes 1 or 2 values; an unknown nameunknown function 'x'. - Separators. A header is a CSV line, so values are separated by
;. A,works too whenthe whole field is in double quotes (
"x = if(a > b, a, b)"), or in TSV. - Text and yes/no. Text is written in single quotes (double quotes stay column names, as in
D120). A comparison gives yes/no; so do
and,orandnot. Numbers and dates compare in order; text (ignoring case) and yes/no only with=and!=; anything else is warningcannot compare 'A' and 'B' (column 'X'). A comparison with an empty side is empty. A test is yes when it is yes, a number other than 0, text other than empty, or a date; an empty value is no.boolandtogglecolumns are yes/no values. A yes/no result is writtenyesornoand the column is abool. - Types.
if's two results must be of one type ('if' gives a number or a text);roundand
absneed numbers,daystwo dates,minandmaxnumbers or dates. - Totals over related rows.
sum(jobs.total),avg(jobs.hours)andcount(jobs)read thedata block named
jobsin the same document: the rows whosechoice(from THIS.KEY)column (the first that points at this table, by its name) holds this record'sKEYvalue, ignoring case. The column summed must be a number column ('jobs.what' is not a number column). A sum of no rows is 0, a count 0, an average empty. Problems are warnings at the header: `unknown source 'jobs',no column of 'jobs' is a choice(from clients.…),this table needs a name for 'jobs' to point at it. The other table is read with its lookups (so itstotal = hours * client.rate` counts) but without totals of its own, so two tables that total each other never loop. - The client computes everything again but lookups and totals, which keep the engine's
value, as D120's lookups do.
- Calculator notes gain
round,min,maxandabswith the same meaning (;or,between values, currencies kept, two currencies never compared).
Rejected. Cell references (A1), user functions and loops, as before. Text ordering (<
on words): it depends on the reader's language. Totals over files and through chains of
tables: the relation must be one from column away and visible in the header.
Consequences. spec/conformance/data/vectors.json gains a done:bool column and cases for
every function and operator, read by both engines; the guide (Data and views), the dictionary
and PROMPT.md describe the functions.
Amended (27 Nov 2026, D270). Totals over a file are adopted: sum("data/picks.csv".points)
names the file in double quotes, and its choice(from data/players.csv) column points at this
table when this table is read from that file. The relation is still one from column away and
written in the header; chains of tables stay rejected.
D140. Numbered blocks and references
#Context. D89 numbered equations and nothing else. Papers, reports and manuals also number figures, tables and theorems and refer to them by number, and the numbers must stay right when things move. One mechanism should do all of it, for kinds nobody listed in advance.
**Adopted (v1.7, extends D89; two built-in plugin targets in the equation feature; rules in
the catalog):**
block ::: figure {#_} _ ... ::: -> numbered kind=figure label=_1 caption=_2
block ::: table {#_} _ ... ::: -> numbered kind=table label=_1 caption=_2
block ::: theorem {#_} _ ... ::: -> numbered kind=theorem label=_1 caption=_2
inline [@fig:_] -> ref kind=figure
numbered(line or block rule;kind,label,captionandnameare input).kindis one word of letters, digits and
-, in lower case,figurewhen missing. Each kind counts on its own, 1, 2, … in document order within the file.nameis what the number is called (name=Satz), else the kind with a capital letter. A label may repeat its own kind's prefix ({#fig:map}in a figure ismap); its id isKIND-LABEL.- Figure-like kinds (
figure table listing chart diagram photo map plate):`<figure class="self-numbered self-kind-KIND[ CLASSES]" id="KIND-LABEL" data-kind="KIND" data-num="N"[ ATTRS]>CONTENT<figcaption class="self-num-caption"><span class="self-num">NAME N</span>. CAPTION</figcaption></figure>
; no caption: no. CAPTION.table` andlistingput the caption first. - Other kinds (a theorem): a
divwith the same classes and attributes, whose firstparagraph opens with `<span class="self-num-head"><span class="self-num">NAME N</span><span class="self-num-title"> (CAPTION)</span>.</span> ` (a paragraph of its own when the content does not open with one), as theorems are set in print.
- No label: no
id. A label used before in the same kind: warningduplicate KIND label 'L',no
id. A label with whitespace: warninginvalid KIND label 'L'. A kind that is not one word: warninginvalid numbered kind 'K', the content in a plaindiv.
- Figure-like kinds (
ref(content: a label). The kind iskind=on the rule, else the label's prefix(
fig tbl tab thm lem def cor prop ex lst eq, as pandoc-crossref writes them), else any kind (the first numbered block with that label, else an equation).eqrefers to D89's equations. Output:<a class="self-ref[ CLASSES]" href="#ID" title="TITLE" data-kind="KIND"[ ATTRS]>NAME N</a>, TITLE the caption, else the block's text (whitespace collapsed, at most 120 characters, cut at a word); an equation shows(N). Unknown: warningunknown KIND 'L'(unknown label 'L'without a kind), the matched text.
Rejected. Numbers within chapters (Figure 2.3): a document is one file, and a book's
files are exported together, so chapter-relative numbering waits until a book needs it.
Automatic captions from an image's alt text: the caption is what the author writes.
Consequences. Fixture 149; the catalog entry "Figures, tables and theorems"; the document
styles set captions, run-in heads and :target; the LaTeX export writes \label and \ref.
D141. Typed slots: numbers and URLs
#Context. Two things every Markdown reader expects could not be written as rules: a numbered
list that starts at 5. (the digit slot threw its digits away), and a bare address such as
https://example.com/a?b=1#c turned into a link (a one-word slot stops at ?, = and #).
Adopted (v1.7, amends D24, D29, D133; spec 02 §3-4).
- The digit slot's digits. The first
_#of a pattern is slot 0 for attributes:value=_#,"no. _#". It is never content._#in a rule whose pattern has no digit slot: warningno digit slot in pattern, the attribute dropped. group-NAME=attributes go on the group's wrapper, taken from its first member, and nomember keeps them:
line _#. _ -> li group ol nest group-start=_#makes a list that opens with5.<ol start="5">.start1 on anolis its default and is left out, so lists that start at 1 are unchanged. URL attributes andstyleare checked for the wrapper as for any element; an unknown wrapper gets none.urlon awordrule with a slot: the slot takes a whole URL. It starts with a letter,digit or
_and runs to a space,<,>,", a backtick or an escaped character, less trailing.,,,;,:,!,?,',*,_,~and a closing)or]with no opening one inside it (…/Tide_(sea)keeps its bracket,(see https://x.y)does not). Followed by a literal, it stops where the literal first matches. Elsewhere: warning `url needs a word rule with a slot, the modifier dropped. The rule table gains"url"` in a rule's modifiers.- No link inside a link. While the content of a match whose target is
ais scanned, ruleswhose target is
ado not match:[https://a.example](https://a.example)is one link. - The Markdown template writes
group-start=$#on numbered lists and links barehttps://,http://andwww.addresses, as GitHub's Markdown does.
Rejected. A typed slot syntax (_:url, _num): every suffix already means a slot followed
by literal text, so it would change existing rules. Numbering every item (value= on each
li): Markdown numbers a list from its first item, so 1. 1. 1. reads 1, 2, 3.
Consequences. Fixture 150; the Markdown template has three more rules; the help describes
url and group- attributes.
D142. The same engine everywhere: regex rules, plain text, async imports
#Context. The CLI was built without the re feature, so a document with regex rules rendered
differently there than in the web app; the WASM engine had no plain-text output, which the CLI
had; and hosts whose files load asynchronously (fetch, IndexedDB) had to pre-load imports
themselves before parse.
Adopted (v1.7; 03 §5).
- The CLI is built with
re.self renderandself checktake--allow-re(asservetakes
allow_re); without it regex rules stay off with D63's warning, as in every host. - The WASM document has
render_text; the JS package exportsrender_text(renderText),the same text as
self render --text. parseAsync(source, options)takes a resolver that may return a promise. It parses,loads every key the engine asked for and did not have, and parses again until nothing new is asked for (at most
maxRounds, 32). Each key is loaded once; a rejection or a non-string means "not found". The result is the sameDocumentasparsewith those files.
Rejected. An async engine: parsing stays synchronous and fast, and the rounds touch only documents with imports or includes, usually one or two rounds.
D143. Activating Pro from the receipt
#Context. Buyers had to copy a key from an email and paste it into a dialog. A link in the receipt that opens the app and activates the key removes that step.
Adopted (v1.7, desktop).
selfscriber://activate/KEY. At launch, or from a second launch the single-instanceplugin hands to the running app, an argument of that form gives a key: letters, digits and dashes, 8 to 80 characters, percent-escapes decoded, the scheme in any case. Anything else is ignored. The page asks for a launch key once (
licence_link_key); a later one arrives as the eventselfscribe://licence-key.- The Pro dialog opens with the key filled in and activates it at once (an active licence is
left alone), so the welcome or the reason it failed is the first thing shown.
- Windows: the app registers the scheme for the current user (
HKCU\Software\Classes,no administrator) when it starts, if the registration does not already point at this exe, so the installed and the portable app both answer.
Rejected for now. macOS and Linux need Tauri's deep-link plugin (Apple events, desktop files), not in the dependencies yet; there the email's key is pasted as before.
Replaced (27 Nov 2026) by D273: the activate links are gone. The scheme and its Windows
registration stay for pairing links (D217, D271).
D144. The worker parses only what changed, and checks itself
#Context. The engine parses a whole document: under 1 ms for an ordinary one, 100 ms for 2 MB, where the preview trailed the typing by about 170 ms. Making the engine itself incremental was measured and set aside (ROADMAP, 15 Nov): its positions are absolute, and copying the unchanged tree costs half of parsing it. But the last result already says where every top-level block is, and the positions inside a block's HTML (D101) are counted from the block's own start, so a block's HTML does not change when text above it does.
Adopted (0.9, packages/selfscribe/src/patch.ts). No change to the format or to any
output: this is how the worker makes the same result.
- The island. For a document of 150 000 characters or more, the worker finds the one
stretch where the new text differs from the last, and grows it to whole lines with a blank line on each side, holding every old block it touches whole. It parses the rules block plus that island alone, and puts the answer in the place of the island's old blocks, decorations, folds and problems; what follows only moves.
- When it is refused, and the whole text is parsed as before. A piece does not always
mean alone what it means in the document. Read from
body/region.rsandbody/build.rs: the island and the next written line start at the margin (nestclaims across blank lines); no block opener is without its closer, in the island or in the last whole parse; no@scopeor@end; the blocks beside the cut are not of one kind the engine may have joined (group); no rule in use counts or refers across blocks (footnotes, citations, numbered blocks and references, equations, the glossary, progress, data and views, includes);set blanklines keepis off; the island holds no section heading; and the rules compile to the same table, settings and CSS. Section folds of the headings above the island are moved to where the writing under them now ends. - The check. These conditions are careful, not proven. When typing pauses (400 ms) the
worker parses the whole text and compares. A difference is reported (
stale, the editor parses again), and patching is off for the rest of that worker's life. - Tested by editing documents at random (fences, scope lines, footnotes, indents, joined
and split lines) and comparing every accepted patch with the whole parse, each patch starting from the patched result before it.
Measured on 2 MB in split view: the worker's part of a key 100 ms to 15 ms, key to preview 168 ms to 81 ms. What is left is the 30 ms wait before parsing and about 30 ms of applying the result on the main thread.
Rejected. Showing the patch at once and correcting it later without the conditions: a wrong block would flash on most edits near a list or a fence. Sending the main thread only the changed blocks: the next step, not needed for this gain.
D145. Settings and the Manager are one window to the eye
#Context. The app had two windows for changing things: Settings (Ctrl+,: theme, fonts,
editing, layout) and the Manager (Ctrl+Shift+X: plugins, rulebooks, snippets, examples,
themes, looks). Which one held a thing had to be learnt; themes were in both. The owner's
note of 15 Nov: "the diff between certain menus is a bit confusing ... manager vs settings".
Adopted (0.9).
- One list. Both windows show the same list on the left (
features/manager/ConfigNav):"The app, how it looks and behaves" with the sections of Settings, then "The Manager, what you add and use" with the Manager's. The window is called Settings; the Manager is the named part of it that holds what you add. A click on a name in the other half opens it.
- One frame. Both use the Manager's frame at one size (up to 1560 by 1000, 40 px inside
the window) in the same place, and the swap has no entrance, so the window does not seem to change. They stay two dialogs in the code (
settings,manager): their commands, shortcuts, test ids and lazy loading are unchanged, and the Manager's sections are still registered by their features. - Settings reads by groups. Each group of settings is a card; the open section's groups
are listed in a row at the top; a name, its one line of explanation and its control are a row no wider than 940 px. Editing's fifteen switches under "Writing" are three groups (Help as you type, The editor, Saving and new documents). Updates, the licence and developer tools moved from Layout and devices to a section of their own, App and updates.
- Themes. Appearance keeps the small cards. The Manager's section is named Theme
gallery, which is what it is: the same choice with every theme shown large.
Rejected. One dialog component holding both: the Manager's sections load on demand and own their headers, search and focus, and every test and command addresses the two by id. Renaming the Manager: Help, the dictionary and the palette all use the word; it now has a place instead. Settings as a tab beside documents: a tab has no scrim to click away, and the window at this size already uses most of the screen.
D146. The app's own right-click menu, and scrollbars that follow the theme
#Context. A right click gave the browser's menu (Back, Reload, Inspect, Save as) nearly everywhere, in the system's look; only a tab and a file in the tree had a menu of the app's. Scrollbars were the system's too: grey with arrows on every theme. The owner's note of 15 Nov: "themes affecting the scrollbars too, and absolutely rich context menu throughout replacing the default one".
Adopted (0.9).
- One menu everywhere (
ui/ContextMenu.tsx, onecontextmenulistener on the page). Itstarts by saying what it is about (an icon, a kind, the thing itself: "Selection · 10 characters", "Line 4", "Link", "Picture", "The page"), then holds what fits:
- the text being written: Cut, Copy, Paste, paste as a quote, copy as rich text, Format
(the document's own marks), the block commands, Table when in one, Insert, footnote, comment, encrypt, Find, Replace, Select all, Show as, help for the word;
- a field: Cut, Copy, Paste, Select all, Clear;
- the rendered page: the link or picture clicked (open, copy its address), Copy, copy as
rich text, select the page, Show as, the look, page setup, Export, Print, Present;
- anywhere else: the palette, New, Open, the panel, focus, full screen, Theme, Text size,
Customise the toolbar (on a bar), Settings, the Manager, shortcuts, Help.
Items are the registered commands (their titles, icons, keys and
when), as in the menu bar, so they cannot disagree with it. - the text being written: Cut, Copy, Paste, paste as a quote, copy as rich text, Format
- Menus of their own stay. A tab and a file handle the event first; the shared menu
only opens when nothing did.
- Shift + right-click is the system's menu. The spelling suggestions live there and a
page cannot read them, so the editor's and a field's menu say so in a line at the bottom.
data-native-menuon an element keeps the system's menu for it. - The toolbar. A right click on it opened Customise at once; it now opens the menu,
which has Customise in it, like every other place.
- Scrollbars. One rule for every scrolling area: a slim rounded thumb mixed from the
theme's ink and accent, no track, no arrows; darker under the pointer, the accent while dragged. WebKit's scrollbar parts where they exist (Edge, the desktop app, Safari), the two standard properties in Firefox. Areas that hide their scrollbar still do.
- Floating surfaces (menus, popovers) take a little of the accent in their top edge,
border and the glow under them.
Rejected. Reading the clipboard with execCommand('paste'): browsers refuse it; Paste
asks the clipboard API and says to press Ctrl+V if the browser says no. Suggesting spellings
in the app's menu: there is no API for the browser's dictionary, and shipping one is a
download of megabytes per language. A blur behind menus: backdrop-filter makes a menu the
containing block of its submenus, which are placed in the window.
D147. Trying a theme in Settings changes a sample, not the app
#Context. Resting the pointer on a theme card in Settings dressed the whole app in that theme (after a rest of 140 ms, never while scrolling). Since D145 the window covers most of the app, so what changed was mostly the window itself, under the pointer, with a crossfade of every element. The owner's note: "the theme preview change is clunky and slow".
Adopted (0.9). Appearance shows a sample beside the cards (above them in a small
window, and in sight while they scroll): a small picture of the app with a title bar, the
rail, an editor with rules and text, the rendered page and the status bar
(ui/ThemeSample.tsx). It is drawn with the theme's own tokens set on its root element, so
it is the theme and not a copy of it. The theme under the pointer or the focus shows there at
once and says "Trying: click to keep"; the app changes only on a click. The status bar's
theme button and the palette still dress the app: they are small, and the app is in sight
behind them.
Rejected. A second copy of every theme's CSS under a class, to scope a theme to part of the page: the tokens as inline custom properties do the same with no stylesheet.
D148. Spelling suggestions and synonyms come from lexcore
#Context. D146 left spelling to the system's menu (Shift + right-click): a page cannot ask the browser for suggestions, and a word list seemed a download. The owner has one already: lexcore, the engine of his LexLab project, built to WebAssembly, with packs for British and American English. His note: "lexcore, and maybe have option for us vs gb, auto detect?".
Adopted (0.9).
- What ships (
apps/editor/src/features/spell/): LexLab'spkg-fullengine unchanged(311 KB of wasm) and its
en-GB-fullanden-US-fullpacks as built, gzipped (2.3 MB and 1.8 MB; 261 318 words each, with frequencies, inflections, variants, the synonym graph and the learned ranker).packs/LICENSES-en-GB.mdlists the packs' sources and their terms (SCOWL, the Hunspell English dictionaries, Open English WordNet, VarCon, wordfreq). - When it loads. Never at start. The first right click on a word fetches the engine and
one pack from the app's own files (about 0.2 s; the menu says "Checking the spelling…" meanwhile); after that the answer is ready before the menu opens. Hashed assets, so the offline cache keeps them.
- In the menu. A word that is not in the list: "Spelling · British English", then up to
six corrections, the most likely first; a click replaces the word and keeps its capitals. A word that is right: "Synonyms of …", a submenu whose words replace it. In the text being written, in Write mode and in fields that are spellchecked. Not for acronyms, words with digits, or with Spellcheck off.
- Which English (
set spell-language, Settings › Editing › Spelling suggestions in):British, American, or Automatic, the default. Automatic takes the document's
set langif it names a region; else what its own spellings say (colour or color, organise or organize, centre or center, travelled or traveled, a few whole words; at least two tells and more of one kind than the other); else the system's language; else British. A document that says it is in another language gets no suggestions: there is no list for it. - The underline is still the browser's. It marks words by its own dictionary, so now
and then the two disagree: an underlined word with no suggestion here, or the reverse.
Rejected. The nano pack (300 KB): 47 563 dictionary stems without inflected forms, so
"walked" would be unknown, and no frequencies to rank by. Building a smaller pack for
spelling only: the ranker is bound to the pack it was trained on by hash, and it is what
puts the right word first 92 % of the time (77 % without). Underlining with lexcore too, so
both agree: a decoration pass over every visible word on every key; worth doing, not in
this pass. Asking Windows for suggestions in the desktop app: its API is COM, the desktop
crate forbids unsafe, and the browser build would still have none.
D149. The right-click menu is short, grouped, shaped by the UI style, and set up in Settings
#Context. D146's menu listed everything: twenty lines in the text. The owner's note: "less cluttered and messy, more rich, theme aware (studio, minimal…), more contextually aware, cleaner categories, sub menus, configurable in the settings?".
Adopted (0.9). This replaces the item lists of D146; the rest of D146 stands.
- Order. What is under the pointer first: a misspelt word's corrections or a right
word's synonyms (D148); then the clipboard; then a link at the caret (open it, copy its address) or the table commands when in a table; then the groups. The header names the same thing: "Selection · 2 words · 10 characters", "Link · line 7", "Table · line 11", "Line 4".
- The clipboard is one row of four small buttons, an icon over its name: Cut, Copy,
Paste, Select all. Left and Right move along it, Down and Up leave it.
- Groups are submenus, so the text's menu is about eight lines: Format (Format the
selection, when there is one), Block (turn into, duplicate, delete), Insert, Paste and copy as, Find, View. With a selection, Comment and Encrypt are lines of their own; without one they are not offered. The page: the link or picture, Copy, then View and Export and print. The frame: the palette, New and open, View, Theme, Settings, Help.
- The UI style shapes it (
theme/uistyles.css), like the rest of the chrome. Default:the accent in the surface and a filled mark. Minimal: a flat sheet, hairlines, no boxes round the buttons. Soft: roomier, rounder, a round mark. Classic: a filled title bar and the accent as the highlight. Compact: 26 px rows, a one-line header, icons only in the button row. Mono: the code font, square, dashed rules, inverted on hover. Every menu and popover takes the same shape, not only this one.
- Settings › Editing › Right-click menu: the app's menu or the system's
(
set context-menu); grouped or full, where each group is a heading over its lines (set context-menu-layout); whether it names what was clicked (set context-menu-header); the clipboard as buttons or as four lines (set context-menu-quick).
Rejected. Choosing which groups show, one switch each: six more settings for a menu that is eight lines; the full layout and the system's menu cover the two real wishes (see everything, or none of this). Icons only in the button row everywhere: "Select all" has no icon people know.
D150. A Data section in the Manager: what a document has, and a guided way to make more
#Context. Data blocks and their views (D80 to D83, D119, D120, D134) are two-way: a few lines of CSV in the document show as a table, a board, a calendar or a chart, and every edit there is written back into the text. But you had to know how to type one; the ways in were pasting spreadsheet cells and one command for a table. The owner's note of 15 Nov: "can it work with a sqlite kind of db, or a plugin … 2 way data app / text interfaces … a rich way to upgrade from a text data source, or create from scratch … a data source manager".
Adopted (0.9). The Manager has a section, Data (features/data), between Rulebooks and
Snippets; Tools › Data sources… and New data source… open it.
- What the document has. Each data block is a card: its name, records, columns (each
with its type; calculated ones marked), how it shows, its line, and the
view:lines that show it again. Go to it; add another view of it (aview:line under it); copy it as CSV or as SQL. Under them, the Markdown tables of the document, each with "Turn into data…". - A new source, in three steps on one screen. Start from nothing (six starting tables:
blank, tasks, contacts, expenses, a reading list, an inventory), text you paste, a file, or a table of the document. Columns: each with the type its values suggest (number, date, switch, link, a choice of the few values that repeat), over the first six rows; the name and the type change in place, columns are added and removed. *Name it and choose how it shows*: the eight views, the ones the columns cannot feed greyed out with the reason ("needs a Date column"). Under them, the lines that will be written. Then: add it at the caret, replace the table it came from, or open it as a new document.
use datais added to the rules block when it is missing. - Text it reads (
model.ts,parseGrid): CSV with quoted fields, tab-separated cells,semicolons, bars, a Markdown table, JSON (records, rows, a wrapped list, one record per line), and plain lines as one column.
- SQLite, read only, with no SQLite (
sqlite.ts). The file format is documented andstable; reading it is the header, the schema table, B-tree pages, overflow pages and records: about 250 lines. A database's tables are offered by name with their row counts, up to 5 000 rows each. Not read: WITHOUT ROWID tables, virtual tables, UTF-16 databases, and changes still in a write-ahead log. The file is read in the app and never changed.
- SQL out. A source copies as
CREATE TABLEandINSERTlines thatsqlite3and mostdatabases read: numbers as numbers, a switch as 1 or 0, an empty cell as NULL.
- Everything it writes is the text you could have typed. The section parses nothing the
engine does not; it writes a data block and the views take over.
Rejected. sql.js for reading: a megabyte of wasm for what 250 lines do. A plugin for SQLite: plugins draw blocks; this is a way in and out, which is the app's job. Typing records in the wizard: the table view in the document already edits them, with undo. (A live link to a database was rejected here at first; the owner asked for it and D151 adopts it.)
D151. A table of a SQLite database is a data source, edited in place (desktop app)
#Context. D150 copies a table into the document. The owner wanted the other thing too: the document as a window on the database, two ways, "an advanced feature, not lazily implemented", with nothing for people to install.
Adopted (0.9, desktop app).
- The key.
shop.sqlite/clients.csvnames the tableclientsof the databaseshop.sqlitein the project folder. A view line names it like any data file:view: shop.sqlite/clients.csv as board by status. The engine is not changed: it asks its resolver for that key and reads CSV. The native resolver (resolver.rs) answers it from the database (db.rs,table_csv) when no real file has that name. So every view, filter, total, chart and lookup works on a table, andchoice(from shop.sqlite/clients.csv)too. - SQLite is inside the app.
rusqlitewithbundled: SQLite's source is compiled intothe binary on every system the app is built for. Nothing to install, no system library.
- Columns come typed from the schema and the values: number (a numeric affinity whose
values are all numbers), switch (declared
BOOLEAN, values 0 and 1, shown as yes and no), date (declaredDATE/DATETIME, ISO values), choice (aCHECK (col IN ('a', 'b'))), else text. Generated columns show and cannot be typed into; a blob shows as[n bytes]. Rows come in the order of the rowid, or of the primary key for a table WITHOUT ROWID. - Edits are not text.
EditHost.records(selfscribe/client): a view sends what itmeans (set these cells of the row it drew at this place, add a record, delete one) with the cells that row showed.
db::applyopens the file for writing (never creating it), takes an immediate transaction, reads the table again, and refuses when that row no longer shows those cells ("the database changed since this view was drawn"), so nothing is written from a stale picture. Then oneUPDATE,INSERTorDELETEby rowid or primary key, which must touch exactly one row. Foreign keys are on, so the database's own rules decide. - Refusals are in plain words: "another record already has this name", "n cannot be
empty", "it points at a record that does not exist", "rate: 'lots' is not a number", "another program is using this database; try again when it has finished" (after 2.5 s, never a hang).
- Its own undo. The database is outside the document's history. Each change is kept with
what undoes it (
Histories, 200 per database, for the session): the note after an edit has Undo, then Redo; the Data section has both. Before undoing, the record is checked to be where that change left it; if another program changed it since, it is left alone and said. - It follows the file. The folder watcher reports the database (or its journal or
write-ahead log) changing; every open document showing one of its tables reads it again (
store.databaseChanged). After an edit made here, at once. - Read only where rows cannot be told apart: a view of the database, a table with no key.
The Data section says which tables can be edited and why not.
- The Data section has a fifth way to start, "A database, live": the databases of the open
folder, their tables with row counts, typed columns and "can be edited" or "read only", how it shows, and Link it, which writes one view line. Linked tables are cards marked live.
- Scope. A database must be inside a folder the user opened; the shell checks the folder
against its grants and the key against the resolver's rules (no
.., no device names). Only a file that already is a SQLite database is opened.
Limits, said. The first 50 000 rows of a table are shown. A cell with line breaks shows on one line, and editing it writes it as one line. Calculated columns belong to data blocks, not to tables. In the browser a linked view cannot read the database (the view says the file cannot be resolved); A file still copies a table in (D150).
D152. A document opened on its own reads the folder it is in (desktop app)
#Context. The owner opened clients.self from D151's example by itself and both views
said "cannot resolve data file". D151 read a database only for a document of an opened
folder. A document opened as a file had no folder, the editor answered "missing", and that
answer was then kept, so the views stayed broken even after the folder was opened. Found by
driving the built app (WebView2 with a debugging port), which D151 had not done.
Adopted.
- The folder of a file you opened is read for it. For a tab that is a file on disk, the
parse names that file's folder as its root, so what the document names beside it resolves: a table of a database, a
.csv, an import. The shell allows it (Scope::check_reading): the root must be a granted folder, or exactly the folder a granted file is in. - Only reading widens. The file commands (list, write, remove) still need the folder
itself. The database commands take the same root, since editing a table is what a linked view is for; they open only files that already are SQLite databases.
- Looking for databases beside a lone document goes one folder down, not four: the
folder may be Downloads.
- "Missing" is kept per folder. The engine adapter's cache of what the editor answered
is one per root, so an answer given for no folder never hides a file of a folder.
- Two tabs of one path (the file alone, and the same name in the open folder): the
active tab decides which folder a parse reads, then the folder's document.
Limits, said. A database beside a lone document is not watched: a change made by another
program shows when the document is next read. A .csv beside a lone document is shown, and
an edit to it in a view is refused (it is written through the open folder). Rejected:
asking the user to open the folder (they opened the document; that is the ask), and a
command that grants any path the page names (a page could then name any).
D153. Column rules: required, unique, read only, hidden, a default, and "when … then …"
#Context. The owner: "more data control … rules … automations and triggers … default getting changed". Columns had a type and nothing else (D80), so nothing could be said about what a record must hold, and nothing happened by itself when one changed.
Adopted. Rules are words after a column's type, in the header:
task:text required unique, status:choice(todo|done) default todo,
finished:date when status = done then today else '', id:number readonly hidden
- A type carries them. Words after a valid type are rules; a column that wants rules and
no other type says
:text. So a name with spaces, a name with a colon (Time: Start) and every header written before read as they did. A field with rules is not a calculation: the=ofwhen status = donebelongs to the test. An unknown word is a warning. required: an empty cell is a warning in the text, and a view does not save one.unique: a value another record has (ignoring case) is marked like a cell that does not fit its type, and a view does not save one.readonly: views show the column and do not type in it.hidden: left out of aview unless its
columnsnames it.default VALUE: what a new record starts with, as it would be typed, so a date takestodayor2w(D119). The form shows it and it can be changed before adding.when TEST then VALUE [else VALUE]: TEST is a filter's (D81). When a change makes thetest true the cell is set, in the same undo step; with
else, when it stops being true (else ''empties it). A new record that already meets the test gets the value.- One pass. What a rule sets does not set off another rule, so rules cannot loop. A cell
typed in the same change is left as typed: the hand wins over the rule.
- Only what a change touches is judged. A record that already breaks a rule elsewhere
can still be edited; the text says what is wrong with it.
- Where they run. The engine reads and checks the rules and sends them in the payload
(
required,unique,readonly,hidden,default,when{text,test,then,else}, only when written). The view enforces them and works outtoday, since only it knows the reader's date. Text typed by hand is not stopped: it is warned about. - Files and database tables take rules from the one header line of a
fromblock(
data clients from shop.sqlite/clients.csv, thenname:text required).
Rejected. Rules in brackets or after ! (more to learn than words); rules as lines of
their own in the block (the body is records); expressions as values (then =hours*2: a
calculated column already does that, D120); chains of triggers (loops, and nobody can say
what a click will do). Not done: a trigger with an effect outside the record (send,
notify). The Automations feature (D98) has no "record changed" trigger yet.
Amended (27 Nov 2026, D270). A calculated column takes rules too, after its sum:
points = a + b hidden. It keeps hidden, readonly, help and if; a rule about what is
typed (required, default, when and the rest) is taken off with a warning.
D154. Who may change what: readonly, locked, unlocked, views; a menu on each column
#Context. The owner: "LOCKED and READONLY tags; locked is where the markdown doesn't get edited, like default getting changed … or unlocked maybe"; "show as default, hide boards or cards"; "auto filter". A view could always be edited and re-saved, and always offered every kind it could draw.
Adopted. Four option words, on a view's line or on a data block's opening line, where they hold for every view of that source:
readonly: the view shows the records and changes none (no editing, adding, deleting,dragging). The bar says "Read only".
locked: the view's own line is never rewritten from the view. There is no Saveview; sorting and filtering still work, for looking. Records are still edited: locked is about the set-up,
readonlyabout the data. The bar says "Locked".unlocked: the opposite. A sort, filter, search or kind changed in the view is writteninto its line by itself, 0.7 s after the last change. Without either word it is as before: Save view writes it when pressed.
views table, cards: the kinds the view offers, in that order. Withoutas, the firstis the one drawn.
views none, or one kind, shows no choice.- Save view keeps these words (and
plain) as written; it used to drop what it did not know.
A menu on each column of a table (the spreadsheet's "auto filter"): sort either way, and tick the values to show, with how many records hold each, a search when there are many, and "(empty)" for empty cells. What is ticked is an ordinary filter (`client = "Harbour Co" | "Tide Ltd"`), so it shows as a chip and Save view writes it; a filter written that way ticks the same boxes. A text cell completes from the values its column already repeats.
Rejected. locked also meaning read only (two different wishes: a fixed dashboard whose
data is still edited, and a report); hiding the view bar under locked (plain does that).
D155. A query: data NAME from OTHER where TEST
#Context. "Are there queries? … create a read only or form based on queried data". A view line already filters, sorts, picks columns and totals (D80, D81), but the set it shows had no name: it could not be shown twice, charted, or given columns of its own.
Adopted.
data late from jobs where due < today and not done as listis a source calledlate: therecords of
jobsthat pass the test.view: late as chart by clientworks like on any source. Withoutwhereit is all of them (a second name, with its own rules).- They stay the other source's records. The payload names that source and its lines, so
an edit made in a view of the query goes there; a record that stops passing leaves the query on the next read.
source.queryin the payload carries the query's own name. - Columns of its own. The block's one body line is a header, as a
from FILEblock's:types, rules (D153) and calculated columns that exist only in the query.
- What the source says (
readonly,locked,views) is said per source, so a querycan be a read-only report of an editable table.
- A query of a query works. Two that take from each other are told so, once each.
from NAMEused to be an error ("unsupported data file"), so nothing written beforechanges meaning. A name with a data extension or a
/is still a file.
Not done. Queries that total (one row per client with a sum): a table grouped with totals
and a chart show those, but not as records to query again. Joins beyond choice(from …)
lookups (D111) and totals over related rows (D139).
The Data section (D150) sets all of D153–D155 without typing: on a source's card, Rules (ticks and fields per column, read only, how view lines are kept, the views offered) and Add a query (a name, a test with the columns to click in, how it shows, read only or not). Each writes the same text, as one undo step.
D156. A query that totals: per COLUMN sum A avg B count
#Context. D155 left out "queries that total": a grouped table and a chart show totals, but not as records another view or query can use.
Adopted. After a query's where: `data load from jobs where not done per client sum
hours avg hours count. The source then holds one record for each value of client`, in the
order a grouped view gives, with a column per total: sum_hours, avg_hours, min_due,
max_due, and records for count.
- Names a view can write.
sum_hours, notsum hours;records, notcount, becausecountis a view's own word andwhere count > 1could not be read. - Worked out, so read only. The records are no line of any text. Every view of the
source is
readonly, and so is a query of it; no value in it offers to go to a record. - The block's one header line speaks of the totals:
% client, days = sum_hours / 8. sumandavgtake number and rating columns;minandmaxalso dates. A column thatis none of the table's warns, and the query then lists the records.
- Add a query in the Data section has "The records | Totals", the column to total per,
and what to total.
D157. Go to the record a value names
#A choice(from clients.name) cell names a record of another source. The payload now says
where: link{source, file, at[[value, offset]]} on the column (at most 2000 values), and
the view draws a small arrow beside the value that shows that record's line through the
host's reveal. Not for a table of a database (there is no text to go to) and not for
totals (D156). Fixtures 132 and 135 gained the field.
D158. A lone document's folder is watched while it reads something there
#D152 left a database beside a document opened on its own unwatched. The desktop app now watches that document's folder while its last parse resolved something from it (a table, a data file, an import), and stops when it reads nothing there or another tab is active, so opening a note in Downloads watches nothing. A change makes the documents that read the file read it again. The shell allows the watch where it allows the read (D152).
D159. Completion on data lines
#As you type a view: line or the first two lines of a data block, the editor offers what
fits there: the document's sources (queries and linked tables included), the option words
not yet on the line, the kinds after as and views, the source's columns after by,
sort, columns, sum and inside filter or where (date columns first where a date is
wanted, number columns for sum), a choice column's values after =, the types after a
header's :, and the rule words of D153 after a type. A name that is not one word goes in
quotes. Nothing is offered on any other line. One source added to the editor's existing
completion (features/data/complete.ts); the logic is a pure function of the text and the
caret. Not done: columns for a view of a file, values of a choice(from …) column,
operators typed without spaces.
D160. Automations: a record changed
#Context. D153's when … then … only sets a cell of the same record. "Automations and
triggers" also means doing something else: log it, notify, call a connector.
Adopted. Three triggers beside D98's: record added [SOURCE], record deleted [SOURCE]
and record changed [SOURCE [COLUMN [to VALUE]]], as in `set when record changed tasks
status to done`. SOURCE is a data block's name or a data file's key (a table of a database
too); names and values compare ignoring case.
- They fire for changes made through a data view, after the write went through, never
for text typed by hand, a refused change or a saved view. Consent and Pro are as for every automation (D98).
- The action gets
{source},{file},{kind},{doc},{record}(its cells ascolumn: valuelines),{changed},{column},{value}, and each cell by its column name ({status}). - A trigger narrowed to a column stays silent when the changed cells cannot be known,
rather than guess. Since D162 a view inside a layout cell is known too: the layout host keeps what it drew in each cell.
- The view host listens only while an enabled automation has a record trigger, so documents
without one pay nothing. A starter, "Log of finished tasks", shows the form.
D161. Totals read through the column they are per
#Context. D156's totals had plain columns: per client gave a client column that had
forgotten it was a choice(from clients.name). So "hours per client times that client's
rate" could not be written.
Adopted. The column totals are per stays what it was in the source: its type, its
lookup and its link. A calculated column in the totals' one header line reads through it
as in any table (D120): % client, cost = sum_hours * client.rate, city = client.city.
Views, charts and queries of the totals name those columns. Nothing new to learn: it is the
lookup of D111 on a record that happens to be worked out.
- A view total written on the opening line goes after
as KIND(`per client sum hours astable sum cost
): before it,sumstill belongs toper`.
D162. What the text does not say: file columns, looked-up values, database records
#Context. Four gaps that all came from one cause: something knew only the document's text, and the answer was in a file or in the last rendering.
Adopted.
- Completion reads the last rendering. A view of a data file (
view: expenses.csv) orof a database table offers that file's columns and values, taken from the view's payload. A
choice(from …)column offers the other source's values: read from the text when that source is a block of the document, from the payload when it is a file. Afterview:the folder's data files are offered by the path the document names them. Nothing is offered for a file that has not been rendered yet: no guesses. - A line inside another code block is that block's text.
view:and data lines insidean example fence or the rules block complete nothing.
- A value from a database table opens a card. There is no line of text to go to, so
the payload's
linkcarriespeek(the column names and the first 200 looked-up records, only for a table of a database) and the arrow shows that record under the cell. Records in text keep D157's jump. - The Data section lists the folder's data files (
.csv .tsv .json .jsonl .rec, notpackage.jsonand the like, not dot folders): what each holds, where the document shows it, and "Show it here", which writesview: PATH. - Record triggers know the views of a layout cell, so `record changed tasks status to
done` fires there too.
Rejected. Reading the file from the completion source: it is asked on every keystroke and must answer at once. Carrying whole records for every lookup: a document's own lines are already one click away, and payloads would double.
D163. Mail merge from a query, from totals and from a database table
#Context. D135's merge found its rows by looking for "the data block named X whose
records follow its opening line". The sources of D151, D155 and D156 are none of that: a
query's payload carries the name of the source it reads, totals have no lines, a table is
not a file of the folder. set merge on any of them said there was no such block or file.
A statement per client (totals) and a letter per open job (a query) are what merge is for.
Adopted (a host change, no engine change).
- A source goes by its own name.
set merge latefinds the querylate(its payload'squery), not the source it reads;set merge jobsstill gets all ofjobs. Any view of a source holds the same records, so the first payload of that name gives the rows. Totals' calculated columns are fields like any other ({{cost}}), and the dialog's filter reads them as numbers. - Which payload is the block (left out of every copy, while
view:lines of it stay)is read from the template's text: the payload's
viewspan starts with a fence. That holds for a query, totals and a block that reads a file, where D135's test did not. set merge shop.sqlite/clients.csvis read by the engine like a view of the table.The database, not the table, is what must be in the folder; a document opened on its own reads what is beside it (D152). Without the desktop app the message says so and points at copying the table in. The row stepper reads the rows again when the database changes.
- A source shown
as hiddenstill gives its rows. It draws nothing, so the renderinghas no payload for it; the host parses the document once more with
view: NAMEat the end, only when the name was not found. A letter's rows are usually hidden. - A copy as a Selfscribe document leaves the source block out whatever its fence
(backticks or tildes, any length).
Rejected. A flag on the payload saying "this is the block": every data fixture would change for something the text already says.
D164. A merge is set up by clicking
#Context. Using a merge meant knowing three things by heart: the set merge line, the
inline {{_}} -> var rule and the names of the columns. The dialog's answer to a document
without them was a paragraph telling you to type them. Its right half was a list of rows.
Adopted (the editor; the text it writes is D135's, unchanged).
- "Where are the rows?" is the dialog's first screen when the document has no rows (or
names ones that are not there), and behind Change… after. It lists, in words, what the document can merge from: its data blocks, queries ("the records of jobs where not done") and totals ("one copy for each client of jobs"), the folder's data files, the database tables it shows. One click writes
set merge X, and the field rule when no rule makes{{_}}a field yet. Start a new list adds a small table of people, and a first line with two fields when the page is empty. - Fields without typing their names. The row bar has a Field menu (each column with
the shown row's value);
{{completes the columns and writes over the braces the editor closed, so the caret ends after them;/fieldlists them in the slash menu./mailopens the dialog. - The page of each row. The dialog shows the rows on the left and, on the right, the
chosen row's copy drawn as it will be made (the same code as the export). No guessing what "3 copies" will look like.
- Conditions compare numbers:
{{#if cost > 2000}}(<,<=,>,>=; numbers asnumbers, other values in text order, which suits dates written year first; an empty value is neither more nor less). A statement needs it.
- An example, Statements (
examples/statements.self): totals per client priced at theclient's rate, one page each.
Rejected. A wizard of several steps: one list of choices is the whole decision. Writing
the fields as chips in the text: a field is {{name}}, plain text, and stays readable in any
editor.
D165. A pivot: per COLUMN across COLUMN
#Context. "Sales by region and quarter" is the first thing people do with a table in a spreadsheet, and there it is a dialog of drag targets. D156 gave one line per value; a pivot is the same with one more word.
Adopted. data NAME from OTHER [where TEST] per A across B [sum C] holds one record
per value of A, with a column for each value of B (named by the value, in the order
B's values are grouped: a choice's order, then first appearance, (none) last) and a last
column total for the whole line.
- One total fills the grid: the first written (
sum,avg,min,max), else thecount. A second one warns and is not used.
- A cell with nothing to total is empty (a view's own sums skip it); a count says
0. - Names: a value that is also a column's name here (
total, orA's own name) gets_after it, so both can be named in a view.
- It is a worked-out source like D156's totals: read only, and every view, chart, query
and merge takes it.
- The Data section's Add a query has "A pivot": line, column, what each cell holds, and
the grid itself shown before it is added. Completion offers
per,acrossand the columns.
Rejected (D165). A pivot view kind: it would be a second way to total, with its own static
output, payload and client, and it could not be charted or merged. A period after across
(across due month): useful, but it needs D119's calendar rules in the engine's grouping;
a calculated column (month = …) does it today.
D166. Flow diagrams that move, show themselves in steps, and draw circuits
#Context. A diagram that moves, or builds up while you talk, was a job for a slide tool or an animation library. A circuit was a job for a drawing program or TikZ.
Adopted (the flow client plugin; the engine is unchanged).
- A chain:
a -> b -> cmakes a link per step; options after the last name apply toeach.
- Moving links:
movingon a link (moving=slow|fast|off), orset moving=onfor all.Dots travel the way the link is written. It is CSS on a second path, with no timers, and only inside
prefers-reduced-motion: no-preferenceon screen: print, export and reduced motion show the complete, still line. - Steps:
step "Caption": a blines name nodes, groups or link ids. A link appearswhen both its ends are shown. The bar under the diagram has Previous, Play or Pause and Next, "Step N of M", the caption, and a dot per step; arrow keys, Home and End work on it. Nothing plays by itself. Without a script, in print, in an export and with reduced motion everything is shown.
- Circuit parts as shapes: `:battery :resistor :lamp :switch :switch-closed :led :diode
:capacitor :motor :ground :junction
(with everyday other names::bulb,:cell`,:earth). A link between two parts is a wire: square, no arrow heads. One closed loop is placed round a rectangle. Only wires on a closed loop through a battery carry dots, so an open switch stops the current and its lamp stays dark. - A mistake no longer hides the diagram: what can be drawn is drawn, with the message
and its line number under it.
- Switches can be flipped by the reader: click, Enter or Space on a
:switch, and thecurrent and the lamps follow at once.
:buttonis closed only while held. This is the view's state: the text is never rewritten, and an export or a print shows the diagram as written. The symbol has an unseen box over it to take the pointer (its lines are thin). - A state machine to run:
set start=STATEmakes nodes states and each link's textits event. Under the diagram: "Now", a real button for each event that can happen from the current state, Reset, and the trail of states visited. Only the link leaving the current state fires for an event several links share. A state with no way on says so. Without
set start=a diagram has no buttons.
Rejected. A second diagram language for circuits, or running TeX in WebAssembly: tens of megabytes for something four lines of the language people already have can say. A timeline of keyframes: steps are how a person explains a diagram.
Known. A loop that contains a ground falls back to the ordinary layout. There is no two-way (changeover) switch: every part has two ends, and a staircase light needs three.
D168. A diagram editor: in place, full size, and .flow files
#Context. The owner's own diagram studio (Flowcraft) is a separate program with its own
windows. The flow language here already follows its text format. What was wanted: a
proper editor built into the app, the same language inline in a document or as a file of
its own, one diagram shown in several places, and parts defined once and placed many times.
Adopted.
- One editor, two sizes, inside the
flowplugin. A drawn diagram has Edit: it becomesa canvas where it sits (drag to move, drag from a side handle to connect, a shape strip, rename in place, a row under the toolbar for the selection, steps, undo and redo, Tidy, copy and paste, align and spread, resize, group, a menu on right-click). "Full editor" grows the same editor over the page area, with a Library (shapes, circuit parts, blocks) on the left and Outline, Views and Steps on the right; "Back to the page" returns.
- The text is the truth. Every action is a small change to the diagram's lines through
the edit host (a move writes
at X,Y), made by pure text operations that leave every other line, comment and line ending as it was. The editor carries over the redraw. - A
.flowfile is a diagram on its own. Its whole text is what aflowblock holds.The app parses a
.flowtab as a document of one flow block round the file's text and keeps only that block; the tab's text stays the file's text, and its page is the full editor, edge to edge. New diagram (.flow) makes one; an empty one offers four starters. - Views.
view NAME "Title" at X,Y size WxH [step=N] [start=STATE]names a window ontoa diagram. A block whose body is
from orders.flow view checkout(orfrom NAME view Vfor a diagram named withdiagram NAMEin the same document) shows that window, with the reader's features working in it, and "Open" goes to the source.set hidden=onmakes a diagram a source only. The host gives the pluginreadFile(element, path). - Blocks.
block NAME [key=default …] { … }defines a part; `use NAME as ID [at X,Y][key=value …]
places one;{key}in a text is filled per placement; links go toID` orID.inner;import parts.flowbrings in another file's blocks. "Make a block" from a selection; double-click a placement to edit its block. - It takes the app's themes and UI styles from the same variables as the rest of the page.
Rejected. Porting the studio as a window of its own: two programs in one, and its
layers, style kits and timeline have no short line in the text. A binary or JSON file
format: a .flow file is the same lines a block holds, so one can be pasted into the other.
Not in. Imports are followed one level. The system clipboard is not used (copy works between diagrams of one page).
D169. Diagrams with states, rules that keep them tidy, and state kept in the document
#Context. After D168 a diagram could be edited, shown through views and built from blocks, but it had one arrangement, nothing held it in shape while it was edited, and what a reader clicked was forgotten when the page was drawn again.
Adopted (the flow plugin).
- States. `state night "At night" { door at 40,140 · guard hidden · sign "Closed" · lamp
color=yellow · sw closed }`: a named set of differences from the diagram as written. Shown by
set state=,view … state=,step "…": state=night, or by itself while a state machine is in a state of the same name. Positions glide in the reader; print, export and reduced motion show the result at once. In the editor, choosing a state means every change is written into that state's lines, and a value equal to the base is removed. - Keep rules.
keep a b c in-a-row [gap=40],in-a-column,a left-of b,a above b,a b same-size | same-width | same-height,a centred-on b. The first-named thing stays and the others follow, solved as a pure pass after layout and before routing, in a state too. Two rules that set the same thing are refused on the later line, naming the earlier. While dragging, what is tied moves along; Align and Spread can write the rule. - State kept in the document.
set keep=panelnames a data block of the document withthe columns
name, value. Each switch (ID, open|closed), the machine's state (`state, NAME) and the step (step, N`) are rows of it, prefixed with the diagram's name when it has one, so several diagrams share a block. The diagram starts from those rows; a click writes one cell ("Edit cell") or one new row ("Add record") through the edit host. So the state survives a reload, a table of the block shows it, and record triggers (D160) see it. A missing block is said, with "Create it". In a.flowfile there is no document to keep it in, and the diagram says so.
Rejected. A store of its own for a diagram's state (local storage, a side file): the document would no longer say what it shows, and nothing else could read it. Keeping push buttons: they spring back.
Known. A value changed in the table reaches the diagram when the reader next points at it or it is drawn again, not at once. Colours and sizes change at once in a state; only positions glide. A table of a database as the place to keep state is not in: the block is the document's own.
D167. A person's own rules come before the editor's helpers
#Context. A break test for 0.9.1 (122 cases in the built app, driven on a hidden desktop) wrote awkward but legal documents against the typing helpers. Nothing crashed. Two cases lost text and several took a key the person meant for the text. The pattern was the same each time: a helper acted on what a character usually means, not on what this document's rules say it means.
Adopted.
- A document whose own line or block rules start with
/keeps its lines. The slashmenu does not open by itself there (
/table+ Enter used to become a table row); Ctrl+Space still opens it. Documents without such a rule are unchanged. - Write mode: a line that so far is only its rule's mark (
/underline /_ -> p.cmd)draws a block with no text. The caret now goes into that block and what is typed goes to the editor's caret. Before, it stayed in the paragraph above and the letters landed there.
- Enter after a word typed in full starts a new line on data lines too (`view: t as
table`), as it already did in the rules block. Tab takes the open completion, as the guide said; otherwise it indents.
- Enter before brackets the editor closed by itself (
[[ startwith]]after thecaret) starts the new line after them, outside code and the rules block.
- Ctrl+Shift+Z redoes on every system, as Help says (it was bound on the Mac only).
- The command bar keeps the focus while it is open, and Escape closes it wherever the
focus is (a data view took the focus back for the cell it was editing).
{{offers a merge's fields in Source and Hybrid too: the rows are read whenever thedocument is a merge, and the row bar is drawn only with the page.
- Changes waiting to be mapped are dropped when the tab changes (they threw "Mismatched
change set lengths" on every keystroke in the next tab).
- A query that names itself says so, instead of "unknown source".
Left as they are, and known. A rule's key that the app already uses (Ctrl+K, Ctrl+N,
Ctrl+Z) is ignored without a message. Enter on a task line takes the offered date ("next
fri"). An unclosed {{#if}} gives no message. A merge field inside a link's address is not
filled. inline #_# reports the wrong reason (_# is the digits slot; write #_\#).
Rejected. SQLite as WebAssembly, to have it in the browser too: no file locking, so
another program writing the same database could be overwritten; the whole file in memory and
written back whole. Windows' own winsqlite3.dll: it needs unsafe calls, which the desktop
crate forbids, and it is one system only. Sending edits as changes to the CSV text and working
out the SQL from the difference: indirect, and wrong the day the text and the table disagree.
A new view syntax (view: shop.sqlite#clients): an engine and conformance change for what a
key already says.
D170. A form's layout, and help and placeholders for its fields
#Context. A form view drew one field per column in a grid, labelled name (type). The
user's Clayform prototype (read 17 Nov) puts fields in named groups and several on a line
("grouped lines"); that is what makes a form read as designed. First job of milestone T1.
Adopted.
layouton a view's line names a form's lines: `view: quotes as form layout Client:name | email, Terms: status | due, notes
. A comma starts a new line;|` puts fields side by side on one; a word with a colon (Client:, or"Billing address":in quotes) is a group's heading and holds until the next one ("":ends a group).- The layout's fields are the view's columns where
columnsis not written, so a columnit leaves out is not in the form. A record opened from another view of the same line shows the layout first and the other columns after it.
help 'TEXT'andplaceholder 'TEXT'are rules of a column, written with the othersafter its type. They belong to the column, not the view: every form of the table shows them.
- A rule's value in single quotes is taken whole: a rule word inside it is text (`help
'required for invoices'
). This holds fordefault,thenandelse` too. - A field named twice in a layout and a name that is no column are warnings. Save view
keeps the layout. The static page draws the groups as
fieldset.self-groupand the lines as.self-row. A laid-out form labels a field with the column's name alone.
Rejected. Quoted text as the heading ("Client" name | email): quoted text is already a
column's name. Extending columns to carry the lines: every other view kind reads columns
as a flat list. A block of its own for the form's design: one more place to keep in step with
the columns, for what one line says. + between fields: a+b is one word to the tokenizer.
D171. A form's fields: controls by type, live totals, the linked record
#Context. The user on the first laid-out form (17 Nov): "clunky". Boxes round the groups, labels in lower case with the type in brackets, every field a plain input. Clayform's forms had calculated fields that followed the typing and showed what a picked record brings.
Adopted.
- The look. One card with a heading and the record picker on its first line; groups are a
small heading over a hairline, not a box; labels are the column's name with a capital (
_reads as a space), with a red star when required; every control is 34px high with one corner size from the app's scale and an accent ring when it has the focus. - A control per type. A choice of two to five short values: buttons side by side
(clicked again, it is taken back, unless required). A rating: stars. A switch: before its name, on one line. A date: the typed field (D119) with a button that opens the system's calendar. A calculated or read-only field: dashed, marked "calculated". The input that holds the value stays in the form (hidden for buttons and stars), so the form's reading, rules and writing are unchanged.
- Calculated fields follow the typing, in a new record too. A lookup (
client.rate) isworked out in the form as well: a view drawn
as formcarries the first 200 records of each source its columns pick from (link.peek, as a database's table already did, D162). Other view kinds carry none, so no other payload grows. Totals over other tables' rows (sum(jobs.total)) keep the engine's value until the record is saved. - The picked record shows under its field: up to three of its other fields ("Rate 95").
Rejected. Carrying linked records in every view: every payload with a linked column would grow, and four conformance fixtures with them, for what only a form uses. A combobox of our own for long choices: the system's list with typing to filter is kept (D154). (D173 replaces that last point for columns that pick from another table.)
D172. Lines: another table's records inside a form
#Context. The user (17 Nov): Clayform's strength is its lines. A quote holds a second
collection, each line a product, a quantity and prices worked out, the lines gathered into
groups. Selfscribe had the two tables and the sums (sum(lines.total), D139) but no way to
work on both in one place.
Adopted.
- A table's name alone on a line of a
layoutshows that table's records as lines ofthe record:
view: quotes as form layout title | client, Lines: lines. The table is one with achoice(from quotes.…)column, the same link the sums read. Nothing new is written in the data: the lines are records of their own table, each naming its quote. - Each line is a row of fields for the table's columns (not the linking one, not hidden
ones). A field is written when it is left, or on Enter; calculated cells follow the typing. An empty row is always there: once it holds what the table requires, it is a new line. A cross at the row's end deletes it. Under the lines: how many, and each column of numbers added up (a value looked up as it is, such as
price = item.price, is not). - A column called
groupgathers the lines under its values, each group with its ownempty row; "New group…" starts one.
- The form is drawn again after each write (the text changed), on the same record, with
what was typed in its other fields, and the focus where it was going.
- The engine sends each such table as a payload of its own (
related), so the lines areedited by the same code as a view of that table: its rules, defaults and refusals hold.
- A record not yet added has no lines: the form says to add it first. A static page shows
no lines (a
view:of the table, filtered, does).
Rejected. Lines kept inside the parent's record (a list cell): they could not be
queried, totalled or merged as records. A lines NAME word: the name alone says it, and a
name that is neither a column nor such a table is a warning as before.
D173. The picker of a column that picks from another table
#Context. The user (17 Nov): picking a product where the company holds several batches (a colour, how many in stock, a price) and can also order in. A plain list of names does not show what differs.
Adopted. In a form and in its lines, a choice(from OTHER.column) column is a field
that opens a list of the other table's records: one row each, the value in bold and up to
four of its other fields in columns (numbers to the right), a search box that finds by any
field, arrow keys and Enter, and "None" to take the choice back. Where the other table has a
group column the records stand under its values ("In stock", "To order"). The picked
record's first other fields show beside the value in a line. The data is the table itself:
a batch is a record, so stock and price are columns anyone can read, total and chart.
Typing on the closed field opens the list with what was typed.
Rejected. A show a, b word on the column: the other table's columns in their order say
it, and hidden (D153) leaves one out. Options kept in the choice's brackets with their
details: a second copy of the stock table.
D174. A form in sections or in steps, and fields shown on a test
#Context. The user (17 Nov): a long form should be gone through, top down in sections that fold, or step by step with later steps shut until this one is right, or both; and a field should be asked only when it applies.
Adopted.
as form sections: each group of the layout folds. The one worked in is open; theothers are one line each with what they hold and a tick, or how many fields are still to fill. Tab from a section's last field opens the next (Shift+Tab, the one before).
as form steps: a numbered bar of the groups, one shown at a time, with Back and Next.A step opens once every step before it holds what it must; Next says what is missing and stays. A new record is added on the last step (Enter on an earlier one goes on); a saved record can be saved from any step.
- Both: in steps, a group named
"Step > Section":is a section of that step, folded asabove. Groups with the same step stand together.
- Sending a form in either way opens the first group that lacks something and says what.
The step and section are kept while the form is drawn again (a line written, D172).
if TESTon a column (a filter's test, aswhen's): a form shows the field only whilethe test holds for what is typed. A field not shown is not required and is saved empty. The engine's own check of
requiredskips a record whose test does not hold.- Rules that were there already do the rest:
required,unique, types,default,when … then …(D153),readonlyandhidden(an id a form never shows).
Rejected. A separate word for each (accordion, wizard): two words after form say it.
A third level of grouping: a step of sections is as deep as a form reads well. hidden when:
hidden then when already reads as two rules.
D175. A column that follows a value until one is typed
#Context. The user (17 Nov): a line's price comes from the product, but a person must be able to type another, see that they did and where the price came from, and go back.
Adopted.
follows SUMafter a column's type:price:number follows item.price. A cell writtenempty holds what the sum gives, and every reader sees that value: other calculated columns (
total = qty * price), totals, filters, sorts, charts, merges. A value typed in the cell takes its place. Emptied again, the cell follows once more. Nothing is copied: the empty cell is the link, so a price changed in the stock table changes every line that follows it and no line that was typed over.- It shows which is which. In a form and in its lines an empty field shows the followed
value in its place; a typed one is marked, says what the sum gives now, and has Reset. In a table a followed cell is muted and a typed one has a mark at its edge; both say so on hover.
- The payload marks the cells that follow (
followed, pairs of record and column) and thecolumn's sum (
follows).requiredis met by a cell that follows. - A record not added yet has lines (D172 amended): the first line typed adds the record
(it must hold what it requires), then the line, and the form stays on the record.
- An empty CSV field written right after its comma takes the space the others have.
Rejected. Copying the price in when the product is picked (Clayform's autofill): the
line no longer knows whether its price was chosen or copied, and a corrected stock price
reaches no open quote. default item.price: a default is written once, into a new record.
A separate "overridden" column: two cells to keep in step.
D176. A change that starts a record in another table
#Context. when … then … (D153) sets a cell of the same record. The user (17 Nov): a
trigger should start the next piece of work, linked to what set it off: a quote is won, so a
task to invoice it appears.
Adopted.
on TEST add TABLEafter a column's type: `status:choice(draft|sent|won) on status =won add tasks`. When a change made through a view makes the test true (or a new record already meets it), one record is added to TABLE.
- The new record names the one that started it: TABLE is a table with a
choice(from THIS.…)column, the link lines and sums already use, and that column gets this record's value. Everything else is the table's own: its columns'defaults say what a started record holds (task:text default 'Send the invoice',due:date default 2w). So the task table says what a task is, and the trigger only says when. - It is a second write, after the text was read again, with its own undo step. A test that
was already true starts nothing; nor does text typed by hand (as for
when). - It chains with what is there. The record added is a view's write like any other, so an
automation (D160:
record added tasks) can notify, call a connector or write a log, and the started table's ownonrules can start further records. - The payload carries each such table without its records (
starts), and the column itsrule (
on: { text, test, add }).
Rejected. Values written in the rule (add tasks(task = '…', due = 2w)): a template
language in a header cell, for what the target's defaults already say in their own place.
A trigger that runs an action directly: actions belong to the folder's automations, with
their consent (D98); a record is the hand-over between the two.
D177. A log of changes: who, what it was, what it is
#Context. The user (17 Nov): where a price came from, and who changed it, should be on record. Automations already hear every record a view adds, changes or deletes (D160).
Adopted. A record event's action gets three more values: {was} (what the changed cell
held before), {key} (the record's first cell: what it is called) and {who} (Settings ›
Editing › Your name, the name comments are signed with). A ready-made automation, **Log of
every change**, writes when, who, kind, source, record, column, was, now to
data/changes.csv for every source, with a document that shows the log newest first and
charts it by person. The log is an ordinary table: filter it by record for one quote's
history, total it by person, merge it into a report. The tables a form shows as lines
(D172) and those a change starts a record in (D176) are known sources too, so their records'
cells and changes are told in full.
Rejected. A log inside each document, written by the view: every change would be two writes and two undo steps, and a document's own log is one more thing in it to keep clean. The engine stamping records: it does not write.
D178. Who changes records: editors
#Context. The user (17 Nov): user permissions. There is no account and no server, so nothing can be forced: a file can always be opened as text. What can be said and kept to in the app is who a table, a view or a column is for.
Adopted.
editors NAMESon a data block's first line (for all its views) or on a view's line:data prices editors ana, tom. A person whose name (Settings › Editing › Your name, capitals aside) is not among them sees the records and changes none; the view says "Only Ana and Tom" where it would say "Read only". With no name set, it says where to set one.editors a|bafter a column's type narrows one column:price:number editors ana.Others see the cell and cannot type in it, in tables, forms and lines alike.
- A host that does not say who is at the keyboard (a published page, another app) has no
editors among its readers: such records are shown, not changed.
- This is a rule for people who mean well, not a lock. The file is text, and a name is
typed, not proven. A host that syncs the folder (milestone T3) can refuse a change: each change already names the range it stays within. Until then the guide says so plainly.
- With D177's log on, a change is written down with the name that made it.
Rejected. Passwords in the document (Clayform's hashed users): unsalted, and the data was readable beside them. Roles: a second list to keep, for what a few names say; a table of people with roles can come with the host. Hiding a column from non-editors: hidden text in a text file is not hidden.
D179. A cell's least, most and shape
#Adopted. Three more rules after a column's type: min VALUE, max VALUE and
pattern MASK. min and max compare as the column does: numbers and ratings as numbers,
dates as dates, and for text the count of characters. A mask has A for a letter, 9 for a
digit, * for any one character and anything else for itself (AA-9999); the text must be
as long as the mask. The engine marks a cell that breaks one and says which ("'0' is less
than 1"). A view does not write such a value: a form says it under the field as it is
typed, and a table or a line refuses it with the reason. Sorting, totals and charts go by
the type alone, so a value outside its limits still counts as what it is.
Rejected. Regular expressions: two engines (Rust, JavaScript) that differ at the edges,
for what a mask says in a way anyone can read. A length rule: min and max on text.
D180. Lines: moved, regrouped, renamed, copied; forms that leave out what does not apply
#Adopted.
- A line is moved by its grip (drag) or with Alt and an arrow from any of its fields. It
goes before or after the line it is dropped on or passed, and into that line's group; on a group's empty line, to that group's end. One write: the record's line of text is taken out and put in, with its group cell set. Records that are not lines of text (JSON,
field: valueparagraphs) only change group. - A group is renamed from its heading: every line of it in this record, as one step.
- A line is duplicated by the button beside its delete: a new line with the same cells.
- A group, section or step none of whose fields apply is gone (D174's
if): its headingand its step in the bar with it, and Next passes over it.
- The Rules dialog has every rule: under "More", a field each for the help line, the
placeholder, shown-if, follows, at least, at most, the pattern, what it starts and its editors.
- On a page (print, export) a form's lines are an empty table with that table's columns:
a form to fill in by hand. The records themselves are printed with a
view:of their table or a mail merge (D163).
Rejected. A menu on each line: three things (move, copy, delete) fit beside the line
and are found without opening anything. An if on a group's heading: its fields' own tests
say when it applies, in one place.
D181. Sync: one engine, a place per kind of storage
#Context. The sync guide (M6) sent people to Dropbox or git. The user (17 Nov): every way of syncing, behind one adapter that does not break: Drive, a server of one's own over SFTP or FTP, WebDAV, storage, a home server through a tunnel, and encryption.
Adopted.
- A crate of its own,
selfscribe-sync, with no part of the app in it. One trait,Place, with four verbs: list, read, write, remove. Each kind of storage is one small file that implements it; the engine knows nothing else about any of them. - The engine compares what the folder and the place hold now with what they held when
they last agreed (a manifest in the folder's
.selfscribe/sync/PLACE/): a hash per file and each side's own tag for it.- Changed on one side: copied to the other. Removed on one side: removed on the other,
into the folder's
.trashon this side. Changed on one and removed on the other: kept. - Changed on both: merged, line by line, over the version both had (kept beside the
manifest for text files). Records of a data block are lines, so two people's changes to different records both stay.
- Not mergeable: both kept, on both sides. The folder's own stays under its name; the
other is saved as
name (from PLACE DATE).ext. - A run that would remove more than ten files and more than half of what is known stops
before removing any, and says so.
- A request the place could not take is tried again (three waits). One file failing does
not stop the others. The manifest is saved as the run goes, so a run cut short is finished by the next. A path a place hands out that leads out of the folder is not followed; the engine's own state, the trash and
.gitare never synced.
- Changed on one side: copied to the other. Removed on one side: removed on the other,
- Places. Another folder (a disk, a share). WebDAV. S3-compatible storage, signed with
Signature Version 4. SFTP through the system's
sftpwith a key, FTP and FTPS through the system'scurlwith the password given on its standard input, never on a command line: both programs come with Windows, macOS and Linux, so nothing is bundled. A folder of Google Drive through its API. - A sealed place wraps any other: contents under AES-256 in counter mode with a random
nonce, then HMAC-SHA-256 (checked before anything is decrypted); names under the same cipher with the name's own MAC as its nonce, so a listing reads back; keys from the passphrase by PBKDF2-HMAC-SHA-256, 600 000 rounds, with a salt kept in the place. A wrong passphrase opens nothing; a changed file is not read; a place that already holds files in the open is not sealed over.
- In the app (desktop): Settings › Sync lists a folder's places (
places.json, with nosecret in it), adds one from a form per kind, and runs one: "Look first" (what would be done) and "Sync" (done, file by file). Secrets are in the system keychain.
- A tunnel (Tailscale, Cloudflare) is a way to reach a place, not a place: the guide says how.
Tried, and how. The engine against a second folder and against a place that drops out; WebDAV and S3 against servers of each kind run inside the tests; the cipher against NIST's vectors and the key derivation against the RFC's. Not yet tried against a live server: SFTP, FTP and Google Drive (their commands and requests are tested, the round trip is not).
Rejected. A sync service of our own first: every place above works with no account. Bundling an SSH or FTP library: the system's own programs are kept up to date by the system. AES-GCM: its crate is not at hand offline, and counter mode with a MAC is the same promise from parts that are. Syncing in the browser: it cannot reach a share, a keychain or SSH. A CRDT for merging: the file is plain text and stays so; live editing is its own job (T3).
D182. Records in and out: the reply is there for the next step
#Context. Sync (D181) moves files. The user (17 Nov): the same must hold for records of another system: "syncing download of customers, then sync update, get id". Connectors (D98) could fetch and could send, but what the server answered to a send was thrown away, and no step could change a record that was already there.
Adopted.
- After
call, the answer is in the context:{reply}(its text, the first 2000characters) and, for a JSON answer, each value under its path:
{reply.id},{reply.data.id},{reply.items.0.sku}(five levels, twenty items of a list). - A step
set-cell:set-cell FILE.csv name = {name} | id = {reply.id}. The first partnames the record (the first whose column holds that value), the rest what to set. It also takes a data block of a document:
notes.self#clients. Only that record's line is rewritten; the header, its types, calculated columns, comment lines, line ends and the file's spacing stay. A column or a record that is not there, or a value the reply did not hold, stops the run with those words and writes nothing. write merge KEYkeeps what is yours. A record that is here already takes theserver's values and keeps the columns the server does not send. A record whose key is empty (not sent yet) is never matched. Before, the server's row replaced the whole record.
appendandmergealso keep every column of the file's first line, calculated ones included: before, a file that held only its header lost the columns the server did not send (found by the end-to-end test of the example).- A cell goes into a body as the body needs: escaped inside a
jsonbody, encoded in aformbody. Before, a quote in a name broke the request. - A dry run does not call a coming reply missing: a step that uses
{reply.…}after acallreads "would run, with what the server answers". A dry run with a step it cannot do is not ok as a whole. - A ready-made example, "Customers in and out", and the guide's first page on automations.
Not adopted, and why. A second sync engine for records: connectors, steps and triggers already are the adapter, and a person can read each one. Matching the record by its line number: lines move; a column's value is what both sides know.
Not yet. Lists that come in pages; records deleted on the server; sending again later what could not be sent.
D183. Sync by itself, and a run that says where it is
#Context. D181 synced when a person pressed Sync. The user asked for sync that is simply there. A run of a large folder said nothing until it ended.
Adopted.
- A place has
auto: minutes between the syncs the app does by itself, written inplaces.jsononly when it is set. The form offers never, 5, 15 and 60 minutes. - When. At the folder's opening, when the interval has passed since the place's last
finished run, and twenty seconds after the last save (typing goes on for a while). The app looks every fifteen seconds; nothing runs in the background when the folder is closed.
- Never past the stop. A run the app starts never allows a mass removal. It stops, says
so once, and waits for a person in Settings › Sync.
- Quiet. A run that went well says nothing. A place that cannot be reached says
nothing and is tried again after its interval (five minutes at least), not at every look. A message is shown only for what needs a person: both versions kept, files not done, sign-in refused, the stop. The same message is not shown twice in a row.
- One run per place. The runs are one state in the editor, shared by the section and
the timer, and the shell refuses a second run of a place while one goes (
busy): two would each write the manifest. - Progress. The shell emits
selfscribe://sync-progressfor each file the engine hasdone, with the count so far; the place's line shows it.
Tried. The timer with a stand-in host and a clock moved by the tests: opening, the interval, a save, the stop, a place out of reach. In the app's screen with a stand-in host, light, dark and narrow. Not tried: against the shell itself with a real place, since the Windows build has not been opened in this work.
Rejected. A service that syncs with the app closed: a second program to install and trust, for a folder nobody is changing. Syncing on every save at once: a save every few seconds would be a run every few seconds.
D184. A question with buttons, and two steps for records
#Context. The user (17 Nov) pointed at an app of theirs whose reminders carry "Took
all", "Snooze 15 min", a typed reply and a 1 to 5 rating, and asked that Selfscribe make
such notices easily. notify was a message that leaves by itself, with no button.
Adopted.
- A step
ask:ask TEXT | LABEL = ACTION | LABEL = snooze N | LABEL | reply = ACTION.A button runs an action of the folder, asks again in N minutes, or closes;
replyis a line to type into. The action a button runs gets{asked}(the title),{answer}(the button's words or what was typed) and what the run knew when it asked. - It stays until answered: a card at the top right (at the bottom on a narrow screen),
not a toast. The same question from the same action replaces the one waiting; at most eight wait. The steps after
askgo on at once. - When the app is not in front, a system notification says the question. Its buttons
are on the card: the notification plugin gives no buttons on a desktop.
- Consent as before (D99): the action a button runs asks the first time, like any other.
set-cells:set-cellfor every record that matches, and both take several testsjoined with
&.add-rows TO from FROM once KEYS | cells: a record for every record of another table, not added twice. Both came from the remake's needs: today's list from the plan, and "Took all" for one part of the day.
Not adopted. Waiting for the answer inside the run: a run would hold for hours, and a closed app would lose it. Keeping questions across a restart: not yet (see below).
Not yet. Buttons in the notification itself on a phone. A time of day noticed with the app closed. (A question that outlives the app: done in D188.)
D185. A folder as an app
#Context. The user: tie screens together, show them without the editor, "especially for phone", with screens edited "as easy as editing any other document".
Adopted.
app.selfat the folder's top:set app NAME, up to five `set screen LABEL =DOCUMENT | ICON
,set accent #RRGGBB. It is read with theset` lines every definition file uses, and a mistake is said with its line.- The app view is the editor's own Preview with the editor's bars away and the app's
in: a header (the app's name, the screen's, a pencil back to the editor) and a bar of tabs at the bottom. A tab opens its document. Nothing is drawn a second way, so every view, form, button and link works as it does in a document.
- A folder used as an app opens as one next time (kept per folder name in this
browser);
?appin the address asks for it. Leaving with the pencil turns it off. - A ready-made example, "A daily plan, as an app": four screens, a list made from a plan
each day, reminders that ask, a journal, progress.
Tried. In a browser at 390 by 844: every screen, a tick, a reminder answered, a typed answer, back to the editor (an end-to-end test and screenshots). Not tried on a phone or in the Android app.
Not yet. An app as a package of its own (one file or address that installs it with its own name and icon). More than one bar of screens. A screen that is a form filling the whole screen.
D186. A list to tick, tiles, and a square per day
#Context. The remake showed what views could not draw: a line to tick with a thumb, a large figure, a streak, a month of days at a glance.
Adopted.
- A list that shows a yes/no column ticks it: the line is the button, a small arrow
opens the record, a group's heading counts its done lines. No new word.
as stats(alsotiles): each total a tile; each yes/no column shown a tile withits share and a bar; with a date column too, the days in a row on which every record was yes, today not breaking the run until it is over.
as heat by DATE(alsoheatmap): a square per day for five to twelve weeks up totoday, by the share of yes, else the view's first total, else the number of records.
plainhides the filter chips as well as the bar: a plain view's filter is part ofwhat it is.
- In a static page both kinds print as their table with the totals under it.
Not yet. A ring; bars of a streak over time; a tile's figure compared with the week before.
Amended (26 Nov 2026). The days end today, unless no record falls in the days shown (the
tiles' two weeks, the squares' twelve weeks at most). Then they end on the latest record, and
the view says so ("days in a row to 25 Nov 2026"; "Up to 25 Nov 2026, the last day with
records"). An example's sample month, or a log kept last year, no longer shows as an empty
grid; live records keep counting from today. The habit block's rows follow the same rule.
D188. A question outlives the app
#Adopted. What waits for an answer, and what is snoozed with the time it is due, is kept per folder (by name) in this computer's storage. Opening the folder brings them back: the waiting ones at once, a snoozed one when it is due, or at once when that time passed while the app was closed. An answered or closed question is not kept. What is read back is checked, and anything that is not a question is left out. This takes "a question that outlives the app" off D184's list. The plugin package now has its own tests of the list to tick, the tiles and the day squares, off D186's list.
Not yet. A time of day noticed with the app closed: the question is asked when the folder is next opened after it, not at the time.
D274. One domain, a hosted service later, and a Mac build kept private
#Context. The owner (27 Nov 2026): "i only want selfscribe.dev, i don't wanna use selfscriber.app"; licensing should say that "there will be a paid service available for features involving online hosting + cloud storage & sync", and that donations pay for code signing and reaching every system; the command line, usable anywhere, was missing from it; and a macOS build should be made on GitHub Actions but "not publicly release mac, yet".
Adopted.
- The web app is app.selfscribe.dev (Pages project
selfscribe-app), the websiteselfscribe.dev; selfscriber.app is not used (D121's app name stays the app's name). A subdomain, not
selfscribe.dev/app/, because the web build's assets are addressed from the top (/assets/…) as the desktop and Android builds load them. - LICENSING.md says the app stays free, every feature of it; a paid service for online
hosting, cloud storage and sync through our servers will come, and is a service, not part of the app (your own devices and your own relay stay free); donations pay for code signing and for building and testing on every system. It names the command line (
self, MIT) as usable anywhere and shippable in other products. The donate page says the same. - macOS is built by hand, never released:
.github/workflows/mac.yml(Run workflow) makesa universal unsigned .dmg and the command line as artifacts kept 14 days.
build.ymlno longer builds macOS for a tag's release, and its iOS job runs only by hand (a macOS runner costs ten times the minutes of a private repository).
D273. No Pro and no supporter key: everything is free, donations only
#Context. D216 made Pro free to use and asked for donations; D266 moved the donations to Stripe and made the supporter key a signed key checked offline. What was left still spoke of Pro: a dialog, a status bar label, a note every fifth start, a key to enter, the site's pricing, costs, refunds and thank-you pages, and a key service. The owner (27 Nov 2026): there is no Pro and no supporter key. Selfscribe is free, every feature unlocked, with no account, no key and no purchase. People may donate.
Adopted.
- Nothing in the app is Pro. The gates, the "Pro" tags in menus and the palette, the
support dialog, the status bar's Support, the occasional note and the supporter key are gone, with
features/pro/. Help › Donate… opens the site's donate page; that is the only mention. - The desktop shell keeps no key.
licence.rs, its commands and theselfscriber://activate/KEYlinks are gone.selfscriber://stays for pairing links (D217, D271). Alicence.jsonleft in an app data folder is never read. - The key service is gone (
tools/supporter-keys), and nothing goes online about a key. - The site has one page about money,
donate.html: the app is free with everything init, and a donation helps pay for code signing and the domain. Its Donate button is
DONATE_URLinapps/site/src/build/donate.ts, a Stripe Payment Link; while that is empty, the page says donations open soon and shows no button.pricing.html,costs.html,refunds.htmlandthanks.htmlredirect to it (_redirects). Terms and privacy say that a donation through Stripe is the only payment, with no keys and no accounts.
This replaces D216 and D266. Nothing had been sold: the payment link was never set.
D272. Folders on a phone live in the app
#Context. The owner (27 Nov) wants folders on the phone, "batteries included", and device sync (D271) needs a folder there to keep in step. The Android app had none. Android gives a web view content links, not paths, so the editor kept the web's file handling (v1.5 X7), the shell's folder picker answered nothing on phones, and the Rust side (the resolver, the watcher) reads only paths. A folder of the phone's own storage would have to be read file by file through Android's document provider, which the engine's resolver cannot do.
Adopted.
- The folders live in the app's own storage,
folders/in the app data folder(
/data/user/0/app.selfscriber/folders). The shell grants that folder already (the rulebook library and preferences are there), so the scoped file commands, the native resolver (imports, data files, pictures) and the watcher work on them as on a computer's folders. No permission is asked for. - Open folder lists them ("Folders on this phone"). A tap opens one; its menu renames it,
shares it as a
.zip, saves a copy as a.zip, or deletes it. New folder and Unpack make their folder there. Home has "Your folders on this phone", with New folder; on a phone the recent work leaves folders to that list. - Delete moves a folder to the app's trash (
folders-deleted/TIME-NAME), with Undo. Itcomes back from Recently deleted, under a free name if its own was taken meanwhile, and is gone for good 30 days later. A rename and a deletion are one rename each: the new
fs_movecommand (both ends and the source's folder in the scope, the target not taken, a folder never into itself). - The folder examples become folders on the phone the first time they open, named by their
title. After that the same folder opens, with what was added to it.
- Nothing is shut in. Files come in through Android's picker: Add files from the phone… (the
Files panel), Open a .zip as a folder…, and Open as before. They go out through the share sheet (a folder as a
.zip, or one file) or Android's "Save to" picker (a copy). Both are calls of the activity's bridge (SelfscriberAndroid.shareFile,saveFile) on a file the page first writes tocache/exports/, handed over through the app's FileProvider. The web view ignores download links, so every download of the app (an export, Save as of a lone document) goes to the "Save to" picker (setDownloaderinselfscribe-fs). - The app says where they live: inside the app, on this phone only, deleted with the app,
and that syncing with another device or sharing a
.zipkeeps a copy. The note is under the list, on Home and in New folder. - Writes go as JSON on a phone. Android's web view carries only JSON to the shell, so a
command's raw body arrives as JSON there and
fs_writerefused every write. It now also takes{ path, data }with the bytes in base64, which the page switches to after the first refusal. - Rejected for now: a folder of the phone's own storage, through Android's folder picker.
Every read and write would go through the activity, the resolver and the watcher would need a second kind of file system, and the app's Tauri plugins do not offer one. A
.zipbrings such a folder in.
Tried on the Android emulator (Android 15, the x86_64 debug APK, 27 Nov), the page driven over
its DevTools socket and by taps: New folder from Home, a note taking ../house-style.self, plant
care and the field guide made into folders (their data views, pictures and links working), a plant
added and still there when the example opened again, rename, delete, Recently deleted, Put back
and Delete for good, the share sheet (a folder's .zip, one file by holding it in the list),
"Save to" Downloads, Add files from the phone, Open a .zip as a folder, a file changed outside the
app showing in its open tab, and the folders still there after the app started again. Tried in a
browser at a phone's size with the browser's own storage too.
Not yet. A folder of the phone's own storage; a folder's size in the list. iOS would keep its folders the same way, but has no share bridge. On a real phone.
D271. A folder kept in step with your other devices
#Context. The owner (27 Nov), "batteries included": a folder kept in step between your own
devices, directly on the same network and through your relay when apart, linked with a QR
code. No account, nothing stored on our servers, a relay that keeps nothing and reads nothing.
D268 put the plan in relay/PROTOCOL.md: the four verbs of a sync location, asked of the other
device.
Adopted.
- A link is a pair of devices. Settings › Sync › Sync with your other devices, above the
sync locations. Link a device… shows a QR code and a short code (D217's sealing, a new kind of link:
selfscriber://device/…). The QR holds the link's secret (32 random bytes), this device's id and name, its addresses and port, its relay, and the folder's name. The other device scans it (a phone's camera opens the app: an intent filter for the scheme, and the link kept for the page as a pairing link is) or pastes it, types the code, and picks the folder: the open one, a new one, or another. An empty folder fills; one with files is joined by the engine's first sync, which keeps both copies of a file that differs. It then tells the first device who it is (ajoinsealed with the link's keys), and both keep the link: its secret in the keychain on a computer, in the app's own storage on a phone. Unlink on each. Three devices are three links; the guide says to make a star around the computer that is on most. - One of the two syncs the link: the one that joined. It runs the sync engine with the
other device as its place (
selfscribe_sync::bridge: the verbs become questions the window carries, with a patience of 90 seconds from the last word of the window). The other answers from its folder (selfscribe_sync::serve) and, to sync, asks the first to (sync, then the run'sendwith its result, read the other way round). So a link has one record of what both had when they last agreed, in that device's folder (.selfscribe/sync/dev-ID), and two syncs of one link never cross: the device that syncs refuses a second run (assync_rundoes), and the one that answers holds the link for the run that began it until itsendor two minutes of silence. Rejected: each device syncing with its own record. The second record would be stale after every run of the other, so a file edited again on the first device in the same lines after a sync came back as a conflict. - Answering is bounded. Only paths inside the linked folder (
safe_path), never its trash,.selfscribeor what is not synced; files up to 256 MiB, in pieces of 512 KiB (one message on a relay on Cloudflare, 1 MiB) whose whole is checked against its SHA-256, written beside the file and moved over it; a removal into the folder's trash. Only a device that holds the link's secret gets an answer. - Encrypted end to end, on the network too. Every key comes from the secret by HKDF; each
conversation opens with a hello and a welcome carrying fresh nonces, and the session's two keys come from both, so a recorded message opens in no other session. A question's number is its IV and is answered once. The shell's listener (
devices_net.rs, beside the live one, on a port kept indevices/me.jsonand told to the other device) and the relay carry bytes they cannot read. - The network first, then the relay. A device tries the addresses the other gave last
(1.2 seconds to connect each), then its room on the relay: each device hosts a room of its own while the app is open (a token from the secret and its id) and keeps a guest line to the other's, which says when it comes online. Whenever they talk, each says its addresses, port and relay. The window's policy lets it ask only this computer over plain HTTP, so the shell carries the network's messages; the page opens the relay's WebSocket itself, as for a live document. With no relay set, the link works on one network, and its line says so.
- When it syncs: as a sync location (D183), when the app opens, every 5, 15 or 60 minutes
(15 to start), twenty seconds after a save in the folder, on Sync now, and when the other device comes online. Quiet unless it needs a person. Its line says where the other device was last reached (this network, the relay), when, and that it syncs when both are open.
- A phone is a device like a computer. The Rust and the page are the same on Android; the
secret is kept in the app's storage, and the folder is one of the phone's (D272).
Tried. The engine through the bridge and a folder answering it, in Rust: files both ways, a file in many pieces, a merge, a removal into each side's trash, a carrier that goes quiet. The answering side's path checks, pieces and trash; the listener; the lock. In the page: the keys and messages, replay, pairing, two devices linked by the code on a network and through the real Node relay alone, a sync asked by the device that answers, the network cut so that it goes through the relay (a piece split to its smaller messages), and back. Two builds of the desktop app on one computer, driven through their web views: linked by the code, the first sync (a file of two pieces, a file on both sides kept twice), a document edited on both merged, a file removed on one in the other's trash, a changed port reached through the relay and then direct again, and a sync by itself when the app opened. A laptop and that computer: linked and synced through the relay, Windows' firewall keeping them off the direct way. That found a slip: the offer's room was closed as the link was kept, before its answer had left, so a device joining through the relay alone was told the other could not be reached. Not tried: a phone.
Not yet. Naming the computer or phone in the QR's words ("Ana's laptop") by its kind; a beacon on the local network, so a computer that comes online there is seen at once rather than at the next sync; a link of a folder's part.
D270. Totals over a table kept in a file, rules after a calculation, and the form of a file
#Context. Building the World Cup pool (examples/projects/world-cup-pool, 26 Nov) needed three
workarounds. The picks are kept in data/picks.csv, and a lookup through `choice(from
data/matches.csv) reads across files, but sum(…) and count(…)` read only data blocks of the
same document (D139 rejected totals over files), so the table of players was a per player
query with a columns list. Calculated helper columns (guess, exact) could not take hidden,
because a field with = took no rules (D153). And the four form commands (D212, D215, D254,
D260) worked only on a data block of the open document, so picks from people without the app
went into an inbox block, to be cut and pasted into the file.
Adopted.
- A total names a file in double quotes:
sum("data/picks.csv".points),avg(…),count("data/picks.csv"). The grammar is D139's (TABLEis a name or a quoted name); a quoted name that is a data path (a/or a data file's extension) is read through the resolver, as a lookup's file is. The file is read with its lookups and calculated columns (Follow::Lookups), so a pick's own points count, and without totals of its own, so nothing loops. Its own problems are said where it is shown; a file that cannot be read is `cannot resolve data file 'X' (column 'C')` at the header. - Who a table is. The other table's first
choice(from …)column that points here links therows:
choice(from NAME.…)names a block (as before),choice(from PATH)names a file, and both mean this table when this table is that block or is read from that file (aview:of it, or adata NAME from PATHblock). Paths are compared by the key the resolver gives them, sodata/x.csvand./data/x.csvare one file. A plain query (D155) of a file is that file too; a query's totals (per) are no one's. The message for a missing link names what is looked for:no column of 'data/picks.csv' is a choice(from data/players.csv). - Rules after a calculation:
points = a + b hidden,guess = if(…) hidden help 'Who wins'.The rules start at the first rule word (D153's words) that stands outside brackets and quotes right after a value; an expression never has two values side by side, so a column of that name cannot be meant there (
a + hidden,client.hiddenandhiddenalone stay columns). The engine (calc::rules_at) and the editor (calcRulesAt) agree onvectors.json'scalcRules. A calculated column keepshidden,readonly,helpandif, which say how it shows. The others are about what is typed (required,unique,default,when,placeholder,follows,on,editors,min,max,pattern,warn): each is taken off with `'X' does not apply to a calculated column, which nothing is typed in (column 'C')`. The payload carries the kept rules besidecalc, so views hide the column as they hide any other. Column rules in Settings › Data offers Hidden on a calculated column and writes it after the sum. - The form of a file. The form commands take the table the caret is in; else the
.csvfilewhose
view:line the caret is on (or thedata NAME from FILEblock it is in); else the document's first table; else the first.csvfile it shows. The file's first line is read as a block's header (types and rules). An answer is a line at the end of the file, as its lines are written (commas without spaces, the file's own line ends), put in the file's tab when it is open and written otherwise. A form online (D254) remembers the file's key and adds what it pulls to the file. A file of another format says that a form adds lines to a.csvfile and offers to copy the table in (D212's offer); a document with neither says what to do. - Choices from another table on a page. A
choice(from …)field of a form page, a shared formor a form online is a list of that table's values (a block of the document, or a
.csvfile), read when the page is made, at most 500; the form online checks an answer against them.
Not yet. Totals through two links, or over a table of a database's rows; a suggest(from …)
list on a page; a form of a .tsv, .json or .jsonl file.
D269. A league table, one time in many places, and sources cited by number
#Context. The owner (26 Nov) asked for the plugins the catalog was missing. Three were: a
table worked out from results (a family's World Cup pool, five-a-side, darts), one moment read in
several places (a meeting, an on-call handover), and citations against a list written in the
document itself, numbered as they are made. All three are client plugins: the engine marks the
blocks (External, D48) and needs no change.
Adopted.
league, a concept block (category ideas), in the line syntax ofbracket: `Team 2 - 1Team
once played,Team - TeamorTeam v Teambefore, a note after| ` (shown for a match to play). A line that is not a match may be a setting:points W D L(default3 1 0),top Nandbottom N(places marked, with a dashed rule),tie-break …(words: points, goal difference, goals for, head-to-head, name; points first and name last when left out). The default order is points, goal difference, goals for, head-to-head, name. Head-to-head is a small table of the matches between the teams still level: its points, then its difference, then its goals. A match is read before a setting, so a team called Top Rank is a team.#starts a group (with##groups,#is the block's title). A team is matched with its emoji and flags folded away, so🇲🇽 MexicoandMexicoare one team, shown with the flag. A real<table>per group (th scope=rowfor the team,abbrfor the column letters), the last five results as W/D/L squares with their words for screen readers, and the matches still to play under it.timezones, a concept block (category ideas). The line with a time is the moment: anoptional date (
Tuesday 3 March 2026,3 Mar,2026-03-03, a weekday for the next one,today,tomorrow), a time (15:00,3pm,15h00,noon) and a place. Other lines are places separated by commas. A place is a name of a built-in table (cities, countries with one clock, short names such asET, each standing for a city's clock so summer time follows), an IANA zone, or the last part of one fromIntl.supportedValuesOf. Times come fromIntl.DateTimeFormatwith the zone: offline, summer time right for the date. The instant is found in two passes over the zone's offset; a time the clocks skip is shown as the time after, with a note. Rows: the moment's place first (unless listed), the places, then the reader's own zone. Each has its local time, the day when it differs (+1), and a band: working hours (hours 8-18, default 9 to 17), early morning (7 to the start of work), evening (to 22), night. A strip, hidden from screen readers, shades the 24 hours around the moment and marks local midnight. One moment a block; at most 60 places. A wrong weekday for a date is a problem.sources(category writing), one target for both halves: `inline [@_] -> sourcesverbatim
is a citation (a span),block ``sources ...`-> sources verbatima list (a div). Notcite: that is an HTML element rulebooks make (academic.self,textile.self), and a plugin wins over an element of its name (D44). A source is[key] the reference; an indented line carries it on;style numbered|superscript|author-year,alland# Title. A citation's items follow D88 (;between them, words before the@kept, a locator after a comma). Numbered by first citation of a known key; author-year names come from the reference as written (the part before(YEAR): family names, not initials; three or more iset al.). The list shows only what is cited (all: the rest after, marked), by number or by name, with back-links to each use (cite-KEYandcite-KEY-N). An unknown key is marked in the text and named under the first list.*words*are italics;https:addresses anddoi:are links.- How an inline plugin sees the whole document. No new hook. Where the host offers
ctx.edits, the plugin reads the text withctx.edits.read(element, null)and finds the citations and lists the way the document's own rules do (its rules that makesources, else[@_]and a ```sources block), skipping the rules block, code and code blocks, and the longer patterns of other rules ([@tbl:_]). The editor's preview mounts only the blocks near the screen (D76), so its page is not the whole document. Elsewhere (exports, static pages, galleries) the page is: the plugin reads the citation and list elements in the.self-docaround it. Every element of one page is drawn from one reckoning, and a watcher on the page (astochas, D137) works it out again when blocks come and go; a redraw that changes nothing writes nothing. - The engine's
citationandbibliography(D88) stay for BibTeX files and records.
Not yet. A narrative citation, Smith (2021); a league's point deductions; several moments in
one timezones block, a column each.
D268. A relay of your own, for live documents from anywhere
#Context. The owner (26 Nov): a small repository for "a sync relay for p2p", with setup instructions, "somewhere in the app's sync settings to put a custom node", on Cloudflare or a VPS. Live together (D190, D191) reached one network, or one Tailscale, and a guest in the web app could not reach another computer at all. The sync guide promised a free relay "that we run".
Adopted.
relay/, a project of its own (MIT, no dependencies), the source of its own publicrepository,
github.com/SelfScribeDev/relay. One room logic (core.js) under two servers: a Cloudflare Worker with a Durable Object per room, whose WebSockets hibernate (the free plan), and a server for Node 20 or newer with a WebSocket of its own (RFC 6455), with systemd, Docker and Caddy files. The protocol is generic: a room has one host and any number of guests; a guest's message goes to the host tagged with the guest; the host's go to one guest or to all.relay/PROTOCOL.md.- A room is the hash of its host's token (16 bytes of SHA-256). Only the app that holds
the token can host it, on any relay, after any restart. The relay keeps nothing to check it, and nothing at all once the connections close.
- Encrypted end to end. The app seals every question and answer with AES-256-GCM, under
a key of 32 random bytes made for each share. The key travels in the join link after
#(https://RELAY/live/ROOM#KEY), which no browser sends; the room and the direction are in the additional data. The relay sees addresses, times and sizes. A message bigger than the relay takes goes in parts. - The session is unchanged. The relay's two ends are a
HostTransportand aGuestTransport. A line that drops is made again, and the questions still waiting are asked again under new numbers; the host answers each number once. The page opens the WebSocket itself, so the web app and the desktop app work alike and the shell's Rust is untouched. The desktop window's policy now lets it connect tohttps:andwss:, and to plainhttpandwson this computer only. - Settings › Sync › Relay: the address (
set relay …in preferences.self), Test (therelay's
/v1/health), what the relay can and cannot see, the setup guide, and "Selfscribe's own relay: coming later". With a relay set, Share live opens a room there too: the bar shows Link for anywhere once the relay has given the room, or says that it did not answer. The share stands on the network either way. Join a live document takes the link as it takes a code.
Tried. The relay's tests: rooms, frames, the Node server over sockets, the Worker with Cloudflare stood in for (made afresh between messages, as hibernation does), and the app's own line against the running Node server, a restart of the server under a session included. In a browser: the web app in two separate profiles, a share through a relay on this computer, the link joined, both typing, the stop told. Not tried: a deploy to Cloudflare (wrangler is not on this machine); two computers on different networks; the desktop app, whose new policy needs a build.
Not yet. A folder kept in step through the relay (PROTOCOL.md has the plan: the four operations of a sync location, asked of the device that holds the folder). Selfscribe's own relay. A phone.
D267. A button in each record of a view, that runs an action for it
#Context. The plant-care example (26 Nov) needed a Watered button per plant. A view could
not hold one, so the buttons sat in a list under the table, one [[Plant|watered]] per plant,
typed again for each new plant. The owner asked for a button in each row.
Adopted.
- The option:
button LABEL runs ACTION, a view option likewhenand the only other onethat may be written more than once (a comma between them reads better and is optional):
view: data/plants.csv as table button Watered runs watered, button Moved runs move. The label is the words beforeruns, so it reads as a sentence; a label holding a word of the view (as,sort) is quoted. ACTION is a name ofactions/orflow:NAME, as for any action button.runswas chosen over=or->, which already mean a test and a look in a view's line. The engine checks the shape (a label,runs, an action), says what is missing otherwise, and passesbuttons: [[label, action], …]in the payload. It does not look for the action: the engine has no folder, and the app says an unknown action when it is pressed. - Where it shows: a column at the end of a table, the foot of each card (cards and a
board), the end of each line of a list. Not on a calendar or a timeline, whose items open the record's panel and have no popover to hold it, nor on a chart, form, map, flow, tiles or days, which draw no record of their own to put it on. The static output and an export draw none: nothing could run them, and the records still read.
- What the action gets: the button carries
data-self-action(so the host runs it exactlyas any action button, consent on the first run included) and
data-self-record, the record's cells as[column, value]pairs, calculated cells included. The app gives each cell under its column's name, spaces written-, and{record}ascolumn: valuelines: the names a record trigger (D177) and a schedule (D194) already give, so one action serves a button and an automation alike.data-self-arg-*still wins over a cell of the same name, and a cell over{text}and{doc}. - After it runs nothing is special: the view follows its file or block, and shows the
changed record when the action writes it.
- Save view writes the buttons back into the line, after the rules.
Not yet. A button that shows only on some records (`button Paid runs pay if status is sent`); buttons in a record's panel.
D266. Donations through Stripe, and supporter keys checked offline
#Context. The donations and supporter keys (D216) were to go through Lemon Squeezy, which made the keys, activated them per computer and checked them weekly. Lemon Squeezy stopped taking new sellers on 16 Nov 2026 and stops taking payments on 31 Mar 2027. Stripe, which owns it, points sellers to Stripe Managed Payments. No store had been opened and no key had been sold. Stripe acts as the merchant of record there and handles sales tax and VAT, for 3.5% on top of its usual fees. It has no licence keys of its own.
Adopted.
- Checkout: a Stripe Payment Link with Managed Payments, the customer choosing the amount
with $29 suggested, or a fixed $29 if Stripe does not allow both. Its address is in one place,
CHECKOUT_URLinapps/site/src/build/store.ts; the app's Donate button opens the pricing page, which holds it. After paying, Stripe sends the donor toselfscribe.dev/thanks.html?session={CHECKOUT_SESSION_ID}. - Keys: a Cloudflare Worker (
tools/supporter-keys) answersGET /key?session=…. It asksStripe for the session and, when it is paid, signs a key with Ed25519:
SELF-and base32 of a version, the start of the SHA-256 of the session's id, the day of the payment and the donor's first name, then the signature. The same session always gives the same key, so the Worker keeps nothing, and the thank-you page's address shows the key again. - The app checks a key offline with the public key built into it (Web Crypto). The format is
one module (
tools/supporter-keys/src/format.ts) that the app and the Worker both import, with a shared test vector. The desktop shell only keeps the key inlicence.json, where it was kept before. A key the old store made does not check out, and the app asks for a new one. - A key works on all of a person's computers. It says thank you and stops the support note,
as before (D216). A
selfscriber://activate/KEYlink still adds it (D143); the thank-you page offers one.
Dropped. The weekly online check and the 30 days of offline grace; counting computers ("seats") and Free this computer; the order page link; switching a key off after a refund; the trial file and the build-time store and product ids. The app no longer goes online about a key. A shared key cannot be stopped, which is acceptable for a key that only says thank you.
For the owner (docs/RELEASING.md): turn on Managed Payments, make the product and the Payment
Link with its redirect, run node scripts/keypair.ts, put the public key in
apps/editor/src/features/pro/key.ts and the link in apps/site/src/build/store.ts, make a
restricted Stripe key that reads Checkout Sessions, and deploy the Worker with wrangler and its
two secrets.
Replaced (27 Nov 2026) by D273: the keys, the Worker and the thank-you page are gone. A donation is a Stripe Payment Link on the donate page.
D265. The app is called Selfscribe too
#Context. D121 named the format Selfscribe and the app Selfscriber. The owner (26 Nov 2026): "call it selfscribe not selfscriber". One name is easier to say and to find, and the app is the format's home.
Adopted. Everything a person reads calls the app Selfscribe: the title bar, menus,
Help, the guide, the website, notices, the installers and the files a build makes
(Selfscribe-VERSION-setup.exe, selfscribe-web-VERSION.zip), and the name Windows lists under
Default apps (an older "Selfscriber" entry there is removed when a file type is offered). Where
a sentence needs to tell them apart it says "the app" or "the format".
**Kept, because they are not read and changing them would cut an installed copy off its
data:** the install identifier app.selfscriber, the selfscriber:// link scheme (pairing,
licence activation), the Cargo package and binary selfscriber, the Android bridge
SelfscriberAndroid, the SELFSCRIBER_* build settings, and the addresses the owner holds
(selfscriber.app, the SelfScriber GitHub organisation). Replaces D121's app name.
D264. A rule's style is for its own elements
#Context. A rule's style class is its as name (D41), and its CSS is .NAME { … }. So when
another rule wrote that name as a class of its own elements, the style reached those too. A
real folder's house style (24 Nov 2026, the printed records) had a rule
block ::: box … ::: -> div.panel { border … } as box whose border landed on another rule's
div.box, which nobody had asked for. D130 had kept the old fake-rule trick (a rule named after
a class only to carry its CSS) working on purpose, but class NAME { … } has replaced it
since, and the Help and PROMPT.md teach class.
Adopted (spec 02 §4, D41).
- When a styled rule's
asNAME is also a class another active rule writes (its target'sclasses, its
grouporsplitelement, a literalclass=word), the styled rule's class isself-rN: its elements carry NAME andself-rN, its CSS is.self-rN { … }, and the other rule's elements are not styled by it. Rules of imported rulebooks and of included files (D263) count as other rules. Aclass=filled from a slot does not. - Nothing changes for a rule whose name nothing else writes, for two rules of one name (D28),
or for
class NAME { … }(D130), which still styles every element with the class, the styled rule's included. - The note. One
infoproblem per colliding rule, so the change is never silent, raisedonly where it can be fixed: when at least one of the two rules is the document's own (written in its own rules block).
- The styled rule is the document's: the note is at its line, `the style of rule 'box' is
for its own elements only; 'div.box' from the rule at line 12 no longer takes it. To style every .box, write: class box { border: 1px solid }` (the other rule's file is named when it is not the document; the CSS is the rule's own).
- The styled rule is a rulebook's and the document's own rule writes the class: the note is
at the document's rule, the line the writer can change: `the style of rule 'done' (line 8 of comments) is for its own elements only; 'p.done' here no longer takes it. To style every .done, write: class done { … }`.
- Both are from imported files (built-in rulebooks, a folder's rulebooks, included files):
no note, though the styles are still kept apart.
use markdownwithuse comments(itsas doneagainst Markdown'sli.task.done) is quiet. The collision is said when the rulebook itself is the open document, whose rules are then its own.
- The styled rule is the document's: the note is at its line, `the style of rule 'box' is
- No shipped example, rulebook or template relied on the collision (a test parses each one and
asserts none raises the note). Conformance fixture 159 shows the new output.
What a document that used the trick must do. Move the CSS of the rule named after the class
into one line, class NAME { … }, and drop the fake rule (or keep it unstyled). Its look is
then the same as before.
Withdraws D130's "the fake-rule trick still works".
D263. An included file reads with its own rules and from its own folder
#Context. Remaking a real suite of printed records (24 Nov 2026: an agenda, a verification
record, log books by model, forms) included printouts that were written as documents of their
own, each with its own rules. include ignored the included file's rules block (D49), so a
printout could not be read inside another document unless every document that included it
copied its rules into its own block, and kept them in step. Its relative links and pictures
were read from the including document's folder, so  in
parts/header.self looked for img/logo.png beside the includer.
Adopted (spec 04 §3, D49).
- Its own rules read its own body. An included file with a rules block has it compiled
(its
use,paletteandclasslines too) and laid over the table of the scope the include is in, for the included body only. The including file's other rules still apply inside it; the included file's rules never apply outside it. - A rule both define (same WHERE, same pattern shape, 02 §6) is the included file's inside
it and the including file's everywhere else. Neither is marked overridden in the document's table: each is in use somewhere.
- A clashing
asname. A name the including file (or a file included before) already usesstays theirs: the included rule loses it with warning
duplicate rule name 'X'at its line in its own file, as for a duplicate in one file (D28), and its style class becomesself-rN. So it styles only its own elements, and the including file's elements keep their class. - Styles reach the document's CSS. The included file's rules come after the document's in
the table (ids after the document's, in the order files are met), so their
{ css }is emitted with an origin comment naming the included file. Its palette entries and classes are added unless the document (or an earlier included file) already has that name: the including file's look wins. - A rulebook both use is one rulebook. A rule the included file brings that was written at
the same place (file, line and column) as one the document already has (a `use ../house-style.self` in both, or the same file included twice or by nested files) is that rule: it is not added again, warns of no duplicate name, keeps its name and style class, and the including file's view of it holds inside the part (an includer's own later rule that replaced it still wins there). A part whose only rules are a rulebook its includer uses reads exactly as if it had no rules block. The rulebook's problems are reported once.
- Values for
{{name}}and{{#if}}in the included body: hostvars, then the includingfile's settings, then the included file's own. A merge row still fills a printout.
- Nested includes layer again: a file included by an included file reads with its own
rules over its includer's.
- Links and pictures (
href,src,cite,poster,background,longdesc) writtenrelative in the included file are rewritten to find the same file from the including file's folder (
img/logo.pnginparts/header.selfbecomesparts/img/logo.png). Addresses with a scheme or starting/,#or?, files in the same folder, and rulebooks with no folder are left as written. HTML a plugin returns as raw output is not rewritten. - An included file without a rules block reads exactly as before.
- Problems in its rules block carry its key and its own line (D66.5). Files its rules block
uses are recorded in the document's imports.
What a document that relied on the old behaviour must do. A document whose included files
have rules blocks that should not apply (a part written as a full document, read inside
another only for its text) either removes the rules the includer must win with from the
part's block, or moves the shared text into a file without a rules block. Where a part's rule
and the includer's rule have the same pattern, the part's now wins inside the part: change
the part's rule, or delete it so the includer's applies. A part whose links were written from
the includer's folder writes them from its own. Fixture 088 shows the new reading: its part's
own inline *_* -> strong now reads the part.
Why layered, not separate. A printout is usually written in its includer's language (the same rulebook) with a few rules of its own; reading it with only its own rules would make every part repeat the rulebook. Why the includer keeps a clashing name. Its elements are already on the page with that class; a part must not restyle them.
Not yet. A part's off reaches only its own rules and rulebooks, not the includer's. A
part's set indent and set blanklines do not change how its body is read.
D262. Opening a table file, and the folder a file is in
#Context. The owner asked for "more intelligent file opening": a .csv, a JSON list or a
SQLite file should open as data, a file in a project should bring its project, and the next
step (a document, a flow diagram) should be easy. Until now File › Open took only documents,
flows and workbooks; a dropped table was ignored; the desktop's Open with and the recent list
opened any file as text, so a .sqlite showed as noise. There was no notion of a project apart
from "an opened folder": workbook.self marks a workbook, selfscribe.self holds default
rules. A file opened alone in the browser has no folder the app can see; on the desktop the
shell lets the app read only that file.
Adopted.
- A table file is one Settings › Data reads: .csv .tsv .json .jsonl .rec, and the SQLite
files .sqlite .sqlite3 .db .db3. Open, a drop, Open with and the recent list all open it the same way, and Open's file filter offers them.
- A Selfscribe folder is a folder that holds a
.selffile (a document,workbook.self,selfscribe.self) and is small and ordinary: at most 200 entries, and never a drive's root, the home folder or one above it, or the home folder's Desktop, Downloads, Documents, OneDrive, Pictures, Music or Videos, whatever stray.selfis in it. The one test, made by the desktop shell from names only (is_selfscribe_folder), in the file's own folder and up to three above it. - A table file in a Selfscribe folder (desktop): the folder is offered once ("data/jobs.csv is
in the folder Harbour. Open the folder…?"). Chosen, the shell grants that folder (only a folder holding a file the person opened, at most three levels up) and it opens on the table, two-way: a view writes the file, as for any file of an open folder. Let go, the answer is "just this file" for that folder, and it is not offered again.
- A table file on its own: a folder not saved to disk holding a copy, named after the
file. The page says so: "A copy, not saved to disk: jobs.csv itself is not changed from here." A SQLite file is read only: its tables are listed, and one is used by copying its rows into a document. On the desktop, Change jobs.csv itself makes it two-way without opening what is around it: the folder is granted, but the open folder lists only that file and the documents made beside it, so search, automations and sync never range over someone's Downloads. The card says which of the two happened.
- Either way Settings › Data opens on a card for the file: how far it is changed from here, the
documents of the folder that show it, Use this table in a new document (a document with
view: PATH), Add it to the open document, and the views that fit its columns: a board for a choice or status column, a calendar and a timeline for a date, a map for a place, a diagram forafterormanager. - A
.selfor.mdopened alone in a Selfscribe folder offers the folder the same way. - The answers are visible and changeable in Settings › File types: "When a file is in a
Selfscribe folder: Ask / Open the folder / Just the file" for every folder, and each folder answered for, with Forget.
- File › Open takes any of these; Import… stays the way to turn a Word or PDF file
into a document.
- Settings › File types offers .csv .tsv .json .sqlite .db, off unless switched on: "Open
documents here" leaves them off and the installer does not register them, so a spreadsheet app keeps its files.
Not yet. In the browser a file opened alone never brings its folder: the File System Access API gives a file no parent (open the folder instead). On Linux .sqlite and .db share one type, so switching one on switches both. An Excel workbook (.xlsx) is not read. The recent list reopens a table file as a fresh copy, not the copy that was changed.
D261. One name for each thing, and what a thing belongs to
#Context. A review of every pictured screen (23 Nov 2026, design/review-2026-11-23/)
found the same fault under most of its findings: one thing had several names, one name meant
several things, and little said whether a setting belonged to the app, a document or a folder.
The owner met it as "Appearance", "Theme gallery" and "Looks" side by side, and said to make it
all logical. Nothing in the text format changes: set style, use, when … -> red,
view: x as flow and the names of settings are as they were.
Adopted. The words a person reads:
- Settings is the one window for everything that can be changed. The word "Manager" is no
longer shown. Its list is in three parts: the app; your documents (plugins, rulebooks, document looks, snippets, examples); the open folder (data, automations, sync).
- App theme colours the whole app, and is chosen in one place (Settings › Appearance; also
View › App theme). Document look styles one document (
set style …). "Theme gallery" is gone. The look that was titled "Paper" is "Printed page" (the word is stillpaper), since Paper is a theme; the Inspector's "Paper" row is "Page size". - Rules are a document's syntax and nothing else. A view's colouring is a highlight
("Highlight · 2"); a column's
required,defaultand tests are column rules. - Table is what "data source", "data block" and "Data" were ("New table…", "Tables…"); the
Settings section is still called Data.
- A view drawn
as flowis labelled Diagram (it draws dependencies, org charts and routes). - Collect answers… is the one way to a table's form for people without the app, and asks
how: send a file, a link while this computer is on, or always on with a Cloudflare account. Live means writing together and nothing else; a published site is "Public site" or "Test copy".
- Sync: a sync location (was "place"), Encrypt before upload (was "seal"), upload
and download (were "send" and "bring in"), conflict: both copies kept. Look first is the one name for saying what would be done without doing it, in Sync and in Automations.
- A folder that has not been written anywhere is not saved to disk (was "in memory").
- A view's button to its text is Show its text (Source is a mode).
Kept as they were, on purpose. The five modes' names (Source, Hybrid, Write, Preview, Split): each now says what it is in View, and renaming them would touch every guide page for little gain. "Rulebook" (a saved syntax). What Pro is and how it is worded: that is the owner's to choose, not a matter of naming.
D260. A shared form reached from anywhere through a Cloudflare Tunnel
#Context. D215 serves a table's form from the desktop app to the local network only. D254 puts a form online on the person's Cloudflare account, where answers wait until they are pulled. The owner also wants the form the app is already sharing to be reachable from anywhere, with no copy kept on any server, using Cloudflare's own tunnel program.
Adopted. While a form is shared, Also reach it from anywhere… (and the command **Reach
the shared form from anywhere…**) runs the person's own cloudflared in one of two ways. A
quick tunnel needs no account and gives an address on trycloudflare.com, new each time; the
app reads it from what cloudflared prints. A named tunnel is on the person's account and
domain, with the account ID and an API token (Cloudflare Tunnel › Edit, DNS › Edit) kept as
D253 keeps them. The app makes or reuses the tunnel and its CNAME record through the API, as
Blockhouse does. Its routing sends only the form's paths to this computer. cloudflared runs
with the tunnel's token in its environment. The form's address is …/f/CODE. The dialog
shows the address and counts the answers that come through it. It says that answers arrive
only while the app is open, and points to D254 for a form that must stay up.
What faces the internet. Never the relay. The tunnel reaches a listener of its own on
127.0.0.1, which answers only GET /f/CODE and POST /f/CODE/ask for the one form shared.
Everything else gets a 404: a live session's routes, another code, any other path. An answer must be
exactly {t:"answer", cells, hp, opened, sent}, with the hidden field empty (a robot is told
it worked and nothing reaches the document) and at least three seconds between opening and
sending, by the page's own clock. Cells are text, at most 200 of 2000 characters. A request
is at most 64 KB. Each address may make 60 requests for pages in ten minutes, other paths it
probes (the 404s) included, and send 5 answers; the form takes 500 answers a day. All of this
is checked before the window hears of it. The listener handles at most 32 connections at once:
the next is answered 429 at once, with no thread of its own, and each connection's pass is
counted out when its thread ends, whichever way. A request must arrive whole within 15
seconds of being accepted, however slowly it trickles in. The relay on the local network
reads requests the same way and has a cap of its own (128, room for a room of guests holding
their pulls).
The page served through the tunnel carries a hidden field and its times, and the
network's page is unchanged.
cloudflared and its process. It is the person's own install, found on PATH and where it
is usually put. When it is not there, the dialog says so with Cloudflare's download page; the
app never downloads it. It is stopped by Stop the tunnel and Stop sharing, and when the
document closes (the relay closing the session stops it). It is also stopped when the app
quits (RunEvent::Exit). Its process id is kept in the app's data folder, and one a crash left
running is stopped at the next start, but only when that id still runs the same program.
Not now. Running the tunnel without the app (a service). A tunnel for live documents.
Taking the named tunnel and its DNS record off the account (the dashboard does that).
Downloading or updating cloudflared.
D259. One colour for a value everywhere, rules that colour records, and a fuller calendar
#Context. The same records looked different in each view: the timeline and the flow coloured
by status (D222), a board only with tone, the map in its own order, the calendar not at all.
Nothing could say "late work is red". The calendar showed a month only, drew a range as a
piece in each day, could not be dragged, ignored times, and was hard to use on a phone.
Adopted.
- One column colours the records in every view: the view's
tone, else itsbyon a map or aflow, else the status column. A value's colour comes from what it says (done green, blocked red), else from its place among the choices. Each view shows the same legend, and pressing a value shows only those records.
when TEST -> LOOKin a view's line: the filter language withis,is not,is empty;then a colour,
bold,faded,strikeormark, andin COLUMNfor one cell of a table. A linked table's column is read through its link (after.end). The rules of every view of the same records on the page apply in each. A rule that cannot be read is said under the view; the others apply. Rules in the view's buttons adds and removes them, written into the line.- The calendar shows a month, a week, a day or an agenda, opens as an agenda on a narrow
screen, starts the week on the reader's first day, and jumps to a date. A record over several days is one bar a week; a record with a time sits in the hours. Dragging moves it, dragging its end changes its length, a click on an empty day or hour adds a record there; each is one undo step, and dates written as links stay links.
Not now. Recurring records; a setting for the first day of the week; times across midnight
and time zones beyond keeping what is written; rules in the engine's static pages; dragging on
a static page; the events and timeline plugins reading records.
D258. A signature as an answer of a form
#Context. The sketch block signs a document (D248, set mode=signature). Forms (D212,
D215, D254) could not ask for a signature, and the owner wants one "basically a sketch block"
in a form, kept with the record.
Adopted. A column of type signature is, in every form of its table, a pad to sign on
with a finger, a pen or the mouse, with Clear; required is kept. The cell is the
sketch's own pen lines joined with ; and ending in the date it was signed
(pen 3: 12,96 40,60; signed 2026-11-21 14:05): one line that reads as a signature and fits
a CSV cell. Strokes are simplified, more if needed, to at most 2000 characters; past that the
pad says to sign again more simply. Places are whole numbers in the sketch's 420 by 150
signature box. Form pages carry a small pad script of their own that writes the same text as
the app, which a test holds them to. An answer whose signature is not that shape and size is
refused: by the app for D215 answers and pulled D254 answers, and by the hosted handler,
which never cuts one to fit. A table or card draws the signature small with its date, and so
does every export.
In the engine and the app. signature is a column type of the engine (ColType::Signature,
data/sign.rs), so its rules are read and a cell not in the shape is a problem on its line.
The engine draws a good cell as a small SVG with the day under it, and a printed form as the
sketch's line to sign on. The app's own form of a table signs on the same pad as the sketch's
signature line, and a table cell is signed in place: Done keeps it as one change, Escape
leaves it. The text, its check and the pad live once, in the plugins package
(client/signature.ts), for the views and the app; only the form pages carry their own copy.
Not now. Signing with the keyboard. Proof of who signed: a signature here is a drawing and a date, not a certificate. A pressure or speed record of the strokes.
D257. Country and region outlines come in a data pack the reader gets once
#Context. Maps (D219) could show places, routes and hand-drawn areas, but not a country or a state, and nothing could be coloured by a number. Border data is too big to ship with the app, and the app fetches nothing on its own.
Adopted.
- A map line draws an outline by name:
country Portugal,region Catalonia,state Texas,province Ontario, with the usual colour and note.shade TITLE: Name n, Name ncolours several by a number. A table with acountry(orstate,province,region) column showsas mapas shaded countries. Names match as place names do; a name that matches nothing is a problem on its line with the nearest names. - The outlines are data packs: Natural Earth's countries (1:110m) and states and provinces
(1:50m), public domain. A pack has a size shown before anything is fetched, mirrors tried in order (jsDelivr, then GitHub, pinned to a release tag), a SHA-256 checked before use, and is kept by the app (IndexedDB; on the desktop, in the app's data folder through the shell's fetch). Nothing is fetched until the reader presses Get, under a map or in Settings › App › Data packs, which also removes it. A pack with no checksum yet says where it comes from and asks first.
- Without the pack a map draws everything else and says what needs it. A read-only or exported
page says the outline is not included. An export (HTML, PDF, a picture of a block, GeoJSON) carries the outlines drawn, simplified for the zoom, so a published page needs no pack.
- Plugins never fetch: they ask the host (
selfscribe:pack) and draw what it hands them.
Not now. Checksums (to fill from a real download before release: both mirrors answer for both files at tag v5.1.2, 838,726 and 2,325,694 bytes, checked 21 Nov by their headers only); finer outlines (1:10m) and states of every country; outlines drawn from a pack on a published site that draws its maps again; packs other than shapes; picking a shaded country in a data view from another view.
D256. Draw one, place many: repeat, and rules that keep things in order
#Context. A block (D168) is drawn once and placed with one use line per place, and keep
rules line things up. A row of pumps, a grid of cells or a ladder was still a line per copy,
and there was no rule for "this beside that" or "this inside that group".
Adopted. `repeat BLOCK as PREFIX (5 | 5 across | 5 down | 4x3) [at X,Y] [gap 20 | gap 20,30]
[name=value …] [joined] [join="{this}.out -> {next}.in"]` places a block as a row, a column or
a grid. Copies are c1…, counted across then down, and links name them (tank -> c7,
c3.motor). Values may use {i}, {row}, {col}, the block's own values and sums with
- - * / and brackets; anything else is a plain problem on the line. At most 500 copies a line.
joined links each copy to the next in its row (in a column, to the one below); joined all
goes on from the end of each row to the start of the next, so a grid is one chain.
The line stays one line: copies are never written out, dragging one moves them all, and the
line brings its own spacing rules so copies are spaced by their drawn size. New keep words:
right-of, below, beside, inside (which makes a thing a member of a group). In the
editor a placement has Repeat (across, down, gaps), a handle at the row's end adds and
removes copies, and several picked things have same width, height and size, and beside and
below, each with "…and keep it".
Not now. Sizes of groups and placements; moving one copy out of its row; sums inside a
block's own lines; inside from the editor; copies along a path or round a circle.
D255. Rewrite rules: a notation of your own for a block
#Context. A rule maps text to a node, never text to text. Someone with a small subject of their own had to write in the harder language of the block that draws it (flow, TikZ, LaTeX). The spec had put templates off (02 §7).
Adopted. rewrite block PATTERN -> TARGET is an ordinary block rule that is always
verbatim, with indented template lines under it: line PATTERN -> TEMPLATE, and first and
last for a line added once before or after. Each body line is matched like a line rule,
longest pattern first, and becomes its template with the slots filled; a line no template
matches is passed through as written, so the target's own language still works and its
problems are reported on the line the person wrote. Templates are copied exactly; only slots
the pattern has are filled (set slot @ for languages that use _). One line in gives one
line out, the output is never read by rules again, a rewrite has at most 256 templates and an
output over 1 MiB falls back to the text as written. Being a block rule it is shared with
use, scoped, turned off and replaced like any other. The node carries data-self-rewrite,
mapping output lines to written lines. A rewritten block is read-only to plugin editors: their
writes are refused, since the editor would be writing the expanded text. A target that reads
its block from the source (data) cannot be named. Spec 02 §8, fixtures 157 and 158.
Not now. Rewriting inside a line; one line becoming several; mapping a plugin's edits back through the templates; hiding Edit on a rewritten block and pointing a plugin's error at the written line.
D254. A table's form online, on your own Cloudflare account
#Context. D215 serves a form from the desktop app to the local network only. People want a form anyone can fill in from anywhere, without a service of ours, with the answers coming back as records. Blockhouse already hosts forms on Cloudflare Pages with a D1 database.
Adopted. Put a table's form online… deploys the D215 page to a Pages project on the
person's account, with a small handler (_worker.js, limited by _routes.json to
/x/forms/*) and a D1 database made and connected through the API, with a random pull key
as a secret. The form's definition comes from the table's columns: the stored ones a person
types in, keyed by name, with their type, choices, required and limits; the handler checks
all of these. It keeps Blockhouse's defences: a hidden honeypot field, a minimum fill time
(timed by the page's own clock), five answers per connection in ten minutes, five hundred a
day, and nothing written for a refused request. The app pulls new answers with the key every
ten minutes while the document is open, or on Check now, and adds each one through the
same path as a D215 answer, once: the last number and recent ids are kept after every
answer. The dialog says what is kept where, deletes taken-in answers from Cloudflare on
request, and Take the form down… deletes the project, the database and every answer left
in it.
Not now. Emails on a new answer (Selfscriber has no mail service). Pulling from the web
app (CORS). A Cloudflare Tunnel to the desktop's own form server: it would need only the form
routes exposed, the relay's own rate limits, and cloudflared installed by the person.
D253. Publishing a website to your own account
#Context. D107 makes a website as a .zip and stops there. People want it online without a service of ours: on Cloudflare, on GitHub, or on a server of their own. Blockhouse, by the same author, already uploads to Cloudflare Pages over its API.
Adopted. Export's Website has Publish…, and Publish the website… opens it. The
folder remembers where it publishes, on this computer, not in the folder. **Cloudflare
Pages** is published from the app with the person's own account ID and an API token (Pages ›
Edit): Blockhouse's direct-upload client, ported to the export in memory. Each file is named
by BLAKE3 of its base64 and extension; Cloudflare is asked which it lacks, and only those are
uploaded, so the second press sends only what changed. Staging publishes to the staging
branch preview, Live site to the production branch. The dialog has Test, the live address
and the last publishes. All requests go through an injected fetch: the desktop shell's, which
needs no CORS and writes the token in from the keychain (D233), so the page never holds it.
Bodies are text, a multipart form included, because the shell carries text. GitHub Pages
is not called: Save for GitHub Pages… adds a workflow (actions/deploy-pages),
.nojekyll and a how-to to the website, and the person pushes it.
Not now. Publishing from the web app: Cloudflare's API sends no CORS headers, and the dialog says so. Uploading to the person's own server over SFTP: the sync shell (D181) syncs a folder both ways and has no one-way upload of other files; it needs an upload hook first. Calling GitHub's API. Custom domains (set in the Cloudflare or GitHub dashboard).
D252. Git as a sync place
#Context. Sync places (D181) were a folder, WebDAV, S3, SFTP, FTP(S) and Google Drive; git was only "keep your folder in git yourself". A git remote gives what none of them has: real history, on hosting most people already have, signed in with the credentials git already holds. The engine was made for storage written file by file; git wants one commit and one push per run, and a push can be refused because someone else pushed first.
Adopted. A place of kind git (url, and an optional branch: empty is the remote's own
default, main for an empty repository) that runs the system's git, as SFTP runs sftp: no
library, nothing downloaded, and no credential kept by the app (git's credential helper or an
SSH key signs in; ssh never asks for a passphrase). The place keeps a bare repository of its own
in the app's data, never in the person's folder. It reads files as objects of the fetched commit
and writes new objects, so no line-ending or filter setting of git's changes what a file holds;
a file's tag is its blob id. The engine gains Place::finish (git: one commit of the run on top
of the fetched tip, Sync from <computer>, <date> <time> UTC: 2 files changed, 1 file added,
pushed, never forced) and Place::gathers (the record of the sync is kept only once finish
went through). A push refused because the branch moved on puts the record back to before the
run and goes once more from the newer commit; refused again, the run stops with a plain message
and nothing is lost. A folder that is itself a git repository is left alone: its .git, its
history and its uncommitted work; what a sync brings in arrives as ordinary changes. Git not
installed, not signed in, a repository not found, out of reach and a protected branch are said
in plain words. A git place cannot be sealed. Look first is its test: it fetches.
Not now. Android and the browser, which cannot run git: they would need each provider's
own API (GitHub's Git Data API: blobs, trees, a commit and a ref update that refuses a
non-fast-forward; GitLab's Commits API with an actions list) and an OAuth sign-in or a token
in the keychain, in the same Place and finish shape. Git LFS (a file in LFS is synced as its
pointer). A sealed git place. Committing in the person's own repository. One git run per file
written, for a very large first sync.
D251. A drawn flow's steps made and placed from records
#Context. A flow block tied to records (set data=, D224) showed their state, but every
step had to be drawn by hand. Nothing could arrange the steps by what the records say, and
renaming a record quietly broke its step's tie.
Adopted. With nothing picked, the records strip under an editable diagram says how many
records are drawn and has Add records not drawn: a step (node ID "Title" record="Title")
for each record that has none, with links from the records' after column, as one undo step
through the diagram's editor. No place is written: the layout puts the new steps beside what
is there, never on top of it. set data=tasks lane=COLUMN puts tied steps in lanes by that
column's value, in the column's choice order; the lanes are drawn from the records each time
and never written, so a step changes lane as soon as its record does. A renamed record takes
its step with it: the tie (and the step's words, when they were the old title) is rewritten,
with a note in the strip. lane= without data=, an empty lane= and a column the records
do not have are said in plain words.
Not now. One undo step for a record's rename together with its step's rewrite (the rewrite is its own step, about half a second later). Lanes while the editor is open, and dragging a step into another lane to change its record. Lanes for steps written inside groups.
D250. Diagrams from records: a link column, a table of links, a tree
#Context. Records as a flow (D222) drew arrows only from an after column, always left to
right, silently dropped names it could not find, and did not colour steps as D222 said.
Adopted. as flow down and as flow across set the direction. link manager names the
column the arrows come from; link legs names a data block of records with from, to and
an optional label, which the engine sends with the view. Steps are coloured by the first
choice column that is neither the lanes nor the link column. A name held by another table is a
grey step of its own; a name found nowhere is listed under the diagram. When a diagram runs
down and its links form a tree, each parent is centred over its children (an org chart from a
manager column), for hand-drawn flows of that shape too. A flow view's columns shows up to
two fields under each title. Click picks, double-click opens, and Join writes the link column
or adds and removes a record of the links table.
Not now. Picking a grey step's record in the other table's views.
D249. The board: finger dragging, order, flow-aware drops, lanes and limits
#Context. as board dragged with HTML5 drag and drop only (no finger), kept no order
within a column, and let a card be dropped on a status its flow refuses, after which it jumped
back.
Adopted. Cards are dragged with the pointer (a mouse after a few pixels, a finger after a
short press so a swipe still scrolls), with a line where the card will land and the board
scrolling near its edges; Alt and the four arrows move a card. A drop between two cards keeps
that order: a number between theirs in a number column called order, rank or position,
else the record's line moves in the text (CSV, TSV, JSON Lines), one undo step either way.
Before a drop the board asks which moves are allowed (a selfscribe:moves event the app
answers from the flow the status follows): refused columns are dimmed, and a drop there says
why and writes nothing. group owner puts cards in lanes; limit 3 or `limit doing 2,
"in review" 1` shows count over limit and marks a column that is over (it warns, it does not
refuse); a column folds from its head; tone risk colours cards by a choice column.
Not now. Limits that refuse a drop; moving between lanes by keyboard; folds kept in the
text; order for JSON arrays, records blocks and database tables; lanes on the static page.
D248. A sketch is lines of text: the sketch plugin
#Context. There was nothing to draw on by hand: a quick plan, an arrow on a picture of an idea, a sticky note, a signature. A canvas saved as an image or a JSON blob would not be a document any more: it could not be read, diffed, merged or undone as text.
Adopted. A sketch block holds one thing per line: pen [colour] [width]: x,y x,y …,
line, arrow, box, oval, note, text, with size WxH for the sheet. Places are whole
numbers from the top left; a drawn line is thinned to the points it needs before it is written
(within about a unit of what was drawn). Colours are eight names that follow the theme, not hex
values. Draw opens the tools in place (over the whole screen on a phone); every finished stroke
is one undo step through the host, and the editor that wrote a text keeps its tools when the
page draws that text again. Lines the sketch cannot read, and comments, are kept as written.
set mode=signature makes the block a line to sign on directly, with name "…" under it and
signed DATE TIME written with the first stroke. A read-only page, an export and print show
the picture.
Not now. Zooming and panning the sheet, picking several things at once, pictures on the sheet, pressure, and a signature as a field of a form. A signature here records strokes and a date; it is not a cryptographic signature.
D247. A diagram says where it opens: set open=
#Context. A wide diagram on a narrow page (a phone) is either a thumbnail of the whole or
a cut-off part of it, and nothing in the text said which part matters. Views (D168) already
name windows onto a diagram, but only another block (from booking view front) could use one.
Adopted. set open=NAME names one of the diagram's own views. The page draws that view's
window instead of the whole drawing, and the editor opens on it. Fit in the editor still shows
all of it, and a from block with its own view still shows that view. A name that is no
view is a problem on that line, and the whole drawing is shown. Without the line nothing
changes: a diagram opens showing all of it, on a phone too. In the editor, a selected view has
"Open here", which writes or removes the line. On the page the reader has "Show all of it"
under such a drawing, and a way back to the view; a print or an export draws the view.
Also adopted for the editor, with no change to the format: on a phone, Edit opens the editor over the whole screen; the full editor has its zoom in the canvas's corner (out, the percentage, in, all of it) and a map of the whole drawing in the other corner while part of it is out of view; two fingers pinch to zoom.
D246. No editor hint that repeats the style
#Context. A rule's editor line (D20) colours, emboldens or slants its source in Source
mode. Source mode already takes those from the rule's style when there is no hint, so a hint
beside the same CSS (editor colour red with color: red) only says it twice, and the two
drift apart when one is changed. A v1.7 leftover.
Adopted. The rule wizard writes a hint only for what the style does not give: no colour
when the style's color is that colour, no bold when its font-weight is bold (600 or
more), no italic when its font-style is italic (any case, with or without !important).
An icon, hide and a key are always written. The tour's aside keeps its colour hint (its
style has none) and drops italic, which its style gives.
D245. The grid plugin is written grid
#Context. The plugin that lays other documents out in a grid (D106) was written ``` `layout ```
with -> layout, a name that reads as set layout (the page's layout, D102) and the timeline's
layout:. A v1.7 leftover asked for grid.
Adopted.
- A plugin may have
aliases: more target names it draws, beside the one it is known by. Itsswitch and settings stay under its own name (people's choices are kept); parsing accepts the aliases wherever it accepts the name (
enabledin the editor,PLUGIN_TARGETSin the packages, the site build), and the editor registers the same client under each. - The layout plugin's alias is
grid. Its rules, examples, the Desk example, the workbookstarter and the side-by-side writing set are written ```
`grid``and-> grid`; it is called Grids. Documents that saylayoutdraw the same, so nothing written before breaks.
D244. set width takes the width words
#Context. D117's set width took a length or full; the style words already sized the
column (set style wide is 1.6 times the reading measure), so set width wide read as it
should and did nothing. A v1.7 leftover.
Adopted. set width narrow (or compact) is 0.8 times the reader's own measure,
normal (or reading) the measure itself, wide 1.6 times it, as set style wide makes it:
the column follows each reader's Settings, where a length is the same for everyone. Page setup's
Narrow, Medium and Wide write the words (they wrote 32em, 40em and 52em). Lengths and full
are as before.
D243. Signing in to a service on phones
#Context. D235's sign-in ran in the desktop shell only: phones had no way to open the browser from the shell, and no keychain.
Adopted.
- The browser is opened by the Tauri opener plugin, on phones only (
tauri-plugin-opener,a mobile-only dependency; desktops keep their own way). The answer is heard on
127.0.0.1as on desktops; the app may be in the background meanwhile. - Kept in
signins.jsonin the app's own storage, which no other app can read, as nameto tokens; the client secret's value is kept with the sign-in there to renew it (a phone has no keychain to read it from), given by the page from its own encrypted store when signing in.
- In the page, a phone's secret store is the web's encrypted one with the shell's sign-ins
beside it: they are listed with the secrets, a request keeps their
{secret:NAME}for the shell to fill (other secrets the page fills itself, as before), and removing the secret of their name signs out (signin_forget). The shell renews tokens as on desktops. - The web's note now says signing in needs the app, on a computer or a phone.
- Tried on an Android emulator (20 Nov, the x86_64 debug APK, against a stand-in service):
the card's Sign in asked natively, opened the browser on the sign-in page with the PKCE challenge and state, the app heard the answer on the phone and traded the code with its verifier, the card read "Signed in · renewed by itself", and Fetch now asked once for the server and sent
Bearerwith the token filled in by the shell; the records came back.
Not yet. A real service's sign-in on a phone (the run used a stand-in), and a real device.
D242. Fields changed on both sides, settled by hand
#Context. D239 named a field changed here and in the service in the run log and took one side; the other value was then only in the log.
Adopted.
- Each such field is kept in a list, per folder on this computer, shown in **Manager ›
Automations › Log**: the record and column, both values, and which one the file holds. Keep mine writes mine into the file and tells the folder's record automations of it as a change of that record (D160), so the automation that sends changed records to the service sends it; Keep theirs writes theirs (when the file held mine). Either takes it off the list. A newer clash of the same field replaces an older one; at most 200 are kept.
D241. A record added into a flow comes in at its start
#Context. A column that follows a flow (set track=, D234) checked each change of a record,
but a record added in a view with the column already set (to "shipped", say) came in anywhere.
Adopted.
- A record added with the column empty is not in the flow yet. One added at the flow's start
(or at any step, when the flow has no start) runs that step's
do=with the record, as a move there does. One added further along, or with a value that is no step, is set to the start in its file or block, the reader is told why ("A kayak starts at new: a record starts at “New”."), and the start's action runs. The start is written as the record wrote its value: by the step's words when it named one by them, else by its id.
D240. A run of a .flow file, shown where it is drawn
#Context. A flow kept as a file, flows/NAME.flow, could run (D234) but showed nothing: a
file has no data block to keep the step it is on in, so its diagram could not light.
Adopted.
- A run of
flows/NAME.flowis shown on every page of the folder that draws it with a flowblock saying
from NAME.flow(with its folder or not) and keeping state (set keep=in the block, or in the file). The step it is on goes into that page's data block under the key the drawn diagram reads (the file'sdiagram NAME, or the block's own), so the diagram lights each step and keeps the trail, as a block written in the page does. The file is not changed.
D239. Two-way records merged field by field
#Context. D236 kept a folder's records and a service's in step, but a fetch merged a whole record over the one here: a field changed here and not sent yet (offline, or the send waiting in the outbox) was lost to the service's older value.
Adopted.
set write sync KEYmerges by the key, field by field, against the copy the servicesent last time (kept per folder and connector on this computer). A field changed only here keeps its value; one changed only there takes the service's; one changed on both sides takes the service's and is named in the run log (
c2: email), as the number of records that kept changes made here is. A record new on either side is kept; one the app has no copy of yet is merged as before. Columns the service does not send stay as they are.- The Xero contacts pack (D236) uses it.
set write sync KEY prefer herekeeps the value changed here instead (it goes to the servicewith the next send);
prefer there, the default, takes the service's. Either way the field is named in the log.
Not yet. (Settling by hand came with D242.) Merging two texts in one field by hand.
D238. A Google Drive place signs in from the app
#Context. Syncing with Google Drive (D181) needed a refresh token got by hand (the OAuth playground, a guide of steps) and pasted into the place. D235 gave the shell a sign-in in the browser with PKCE; the same serves Drive.
Adopted.
- A Drive place in the list has Sign in with Google (desktop app). The shell reads the
place's client id and secret from its setup, asks in a native window, opens Google's page (scope: the whole Drive, since the folder is one the person made, not the app's own;
access_type=offline,prompt=consent, so a refresh token is given), hears the answer on127.0.0.1, trades the code, and keeps the refresh token as the place's own secret in the keychain, where sync has always read it. Nothing is returned to the page; the place then reads as signed in and can sync. Sign in again replaces it. - Pasting a refresh token still works, for anyone who has one.
Not yet. Phones (as D235).
D237. Flow steps that wait for a person or a time
#Context. A flow that runs (D234) went from start to end at once. Real processes stop: an approval waits for someone, a reminder waits for a day. D234 listed both as not yet.
Adopted.
wait=answeron a step: the run does the step'sdo=, then stops there and asks. Thequestion is the step's words, under them the flow's name and the record, and one button per way out of the step (the link's words, else the step it goes to). It is a question of the ask tray (D184): it stays, is kept per folder over a restart, and can be snoozed. A button takes the run on from the step it picks, with
{answer}and{asked}added to what it carries.wait=30m|4h|3d|2w, a day (2026-12-01, at nine in the morning, local), a day and time(
2026-12-01T14:30), or a column of the record (wait=start, a day): the run stops until then. Waiting runs are kept per folder on this computer and taken up every half minute while the folder is open; one whose time passed while the app was closed goes on when the folder is next opened. Taken up, the run goes on past the step: what it does is not done again.- The diagram's kept state (D169) stays on the step that waits, so the drawing shows where each
run is held. A wait that cannot be known (the record has no such day) stops the run and says why.
- Manager › Automations › Log lists the runs waiting for a time: the flow and step, until
when, and the record; each can go on now or be let go.
Not yet. Waits on phones while the app is closed (a system notification is posted, but the run goes on only when it opens).
D236. Two-way sync with a service: only what changed, and steps that choose
#Context. Keeping a folder's records and a service's in step (Xero contacts was the asked-for case) had most of its parts: a merge by id (D182), record triggers from views (D160), the id written back, the outbox for when the service is away (D196). Two were missing: asking only for what changed (a pull every few minutes must not fetch the whole list), and one action that makes a record there when it has no id yet and updates it when it has.
Adopted.
{since}in a connector's address, headers or body is when it last fetched all it askedfor (ISO, UTC, a minute early so nothing falls between);
{since_date}its day. It is empty the first time and while the output file has no records, so the first fetch is whole. It is kept per folder and connector on this computer, and only once the list ended within its pages. A header that comes out empty is not sent (If-Modified-Since: {since}the first time). A304 Not Modifiedis an empty list. Awrite mirrortakes nothing out while only changes were asked for.set step if TEST then STEP: the step runs only when the test holds for the run's values:NAME is set,NAME is empty, or a test in the calculated-column language (D139), as flow links read them (D234). A step passed by says so in the log; a test that cannot be read stops the run.- No echo. Records a fetch writes raise no record events (only a view's edits do), so what
comes from the service is not sent back to it.
- Ready-made: Xero contacts, both ways: changes in Xero every five minutes by
If-Modified-Since, a contact added here made there with its id written back, one changed updated there, one removed archived there (Xero keeps contacts that invoices used). The records are a plain file, there without a network; sends wait in the outbox. When both sides changed, the last one sent wins.
Not yet. A change in the service arriving at once (webhooks need a server); merging two changes to one record field by field.
D235. Signing in to a service, not copying keys
#Context. Accounting and office services (Xero, Google, Microsoft, HubSpot, QuickBooks) give no key to paste: an app signs in with OAuth 2 and gets tokens that run out within the hour. Connectors (D98, D99) only knew secrets pasted once. D233 had made the shell the only place a secret is written into a request; sign-ins had to keep that.
Adopted.
- In the connector.
set sign-in NAMEnames the sign-in; requests use its access token as{secret:NAME}, like any secret. A known service (xero,google,microsoft,hubspot,quickbooks,github, byset serviceor by the name itself) brings its addresses, its return port and its needs; any other givesset authorize URLandset token-url URL. Thenset client-id ID(the app the person registered with the service: Selfscriber has no client of its own to lose),set client-secret NAMEfor services that want one (named secret),set scope …,set redirect http://localhost:PORT/callbackandset sign-in-param KEY VALUE. A connector whose requests never send{secret:NAME}is told so. - The desktop shell signs in (
signin_start): a native question names the service and thesecret, the browser opens the service's own page with PKCE (S256) and a random state, the answer is heard on this computer only (
127.0.0.1, and::1for alocalhostaddress), for five minutes, and the code is traded for tokens at the token address, with no redirects followed. The token address is allowed by that yes (D233). - Kept and renewed by the shell. The sign-in (token address, client id, refresh token, the
access token when the keychain takes it, its end) is kept in the keychain under its own service, and its name is listed with the secrets. A request that uses
{secret:NAME}gets the current access token; one running out within a minute is renewed first, one renewal at a time. A refresh reply without a new refresh token keeps the old one. Removing the secret signs out. No token reaches a page. - In the editor. The connector's card says how the sign-in stands and has the Sign in
button, with the return address to register. A run whose sign-in is missing sends nothing and says to sign in; so does a dry run. Any request missing a secret is no longer sent with its placeholder.
- The web cannot hear the browser come back: there the card says to save an access token as
the secret NAME.
- With it,
set map COLUMN PATH|datewrites a day from the ways services send one (date-times,/Date(ms)/, seconds or milliseconds), andset first-row namesreads rows of cells whose first row names the columns (Google Sheets). Ready-made: Xero invoices (with the organisations connector for the tenant id) and Google Sheets rows.
Not yet. Signing in on the web (phones came with D243); a sign-in shared between folders asked only once per folder (it is per computer now); revoking at the service on sign-out.
D234. Flows that run
#Context. Flow diagrams (D166-D169, D222, D224) were drawn and played by hand; automations (D98, D99, D160) ran actions nobody could see as a process. The review of 19 Nov found joining them the largest gain: the diagram becomes the automation, readable and edited as text.
Adopted.
- A flow node may say
do=ACTION(an action ofactions/), and a linkif="TEST". A test iswritten in the calculated-column language (D139:
total > 500,status = 'paid',due < today and not paid) over the record the run carries, its values typed by how they look (a number, an ISO date, yes or no, else text). - A run starts at the
:startnode (else the one nothing leads into), runs each step'saction through its consent (D99, D233), and goes on by the first link whose test holds, else by the link without a test. It stops at an
:end, at a step with no way on, at an action that fails or is refused, at a decision none of whose tests hold, or after 200 steps; the notice says which. A run of a flow waits for the one before it. - What starts one. A button whose action is
flow:NAME(itsdata-self-arg-*are therecord), and an automation with
set do flow:NAME(the record it heard about, D160). A flow is named bydiagram NAMEin a flow block of a document of the folder, or isflows/NAME.flow. An automation's fingerprint (D233) coversflows/NAME.flow; each step's action keeps its own consent. - The step it is on is written where the diagram keeps its state (
set keep=panel, D169,the row
NAME.state), so the diagram shows the run moving, with a moment on each step, and the text says where it got to. Aselfscribe:keptevent tells a drawn diagram to read its block again. - Records that follow a flow.
set track=SOURCE column=COLUMN(a data block's name, or adata file, with or without its folder and extension) makes the flow the law of that column: its steps (by id or words, any case) are the values a record may hold, its links the moves. When a view changes the column (D160), a move the flow has runs the
do=of the step it enters, with the record, through its consent; any other move is put back in the file or the block ("A boat stays placed: from “Placed” it can go to “Shipped”."). A record from no step may only go to the:start. The triggers listen for record events only while a flow of the folder tracks some.
Not yet. The moves as buttons on a record's card. (Steps that wait came with D237; runs of
.flow files shown with D240; records added further along than the start with D241.)
D233. Nothing connects that nobody looked at
#Context. A review of every way the app reaches the network (19 Nov) found the gates mostly sound (D74, D99, D110, D181), and four places where a connection could happen without a person having seen it.
Adopted.
- A consent covers what was read. "Always allow" on an action, and turning an automation
on, keep with the name a fingerprint (SHA-256, 16 hex digits) of every file that would run: the automation, its action, and each connector the action calls. Line endings do not count; a file nothing calls does not. When any of them changes (by hand, by sync, from someone sharing the folder), the action asks again with "It has changed since you allowed it", and "Run once" drops the old "always". A changed automation does not run: it is switched off, with a notice that opens Manager › Automations. Consents written before this have no fingerprint and ask once. The consent file (app storage, never the folder) gains it as a third word:
set allow NAME on 0123456789abcdef. - Pictures, sound and video from the web wait for a click, as mail apps do, because
loading one tells its server who opened the document and when. Each waiting picture is a placeholder naming the server (a
data:SVG). A click, or Load pictures from the web in the palette, loads those of the document for the session, and the notice offers Always in this folder (kept on this computer, undone by Stop loading web pictures in this folder). Thumbnails and other surfaces that set HTML never fetch them. Exports are unchanged. - The desktop shell keeps the last word, because any script in the window can reach its
commands, an installed plugin's included. Requests leave the page with
{secret:NAME}as written; the shell writes the value in from the keychain, so no secret reaches a page, andsecret_getrefuses. The first time a request goes to a server, or a secret to a server, the shell asks in a native dialog no page can draw or answer ("Selfscriber is about to connect to api.example.com for the first time, and send it the secret “token”"). A yes is kept innet-approvals.jsonin the app data folder (servers, andNAME@server); a no refuses the request. A request carrying a secret follows no redirects.
Not yet.
- An installed plugin's
networkhosts are shown but not enforced. On the web that needs eachinstalled plugin in a frame of its own.
- Live sharing on the local network is plain HTTP behind its code.
D231. Page blocks: a named block defined once, used anywhere
#Context. People want the same block on many pages, a properties card at the top of every
note being the common case (Obsidian's front matter). They want it defined in one place,
added from a menu or by itself to new pages, and free in look and layout. Rules, use, saved
rulebooks (D72), details (D86) and folder templates already did most of it; what was
missing was a name to insert by, a place for the block's text, and the wiring.
Adopted.
- A block template is a
.selffile. Its rules block says how the block looks, its bodyis the text a page starts the block with (
{{isodate}},{{title}},{{cursor}}filled in, as note templates do), and three settings say where and when:set place top|end|caret(defaulttop: right under the rules block),set auto new|empty(new: every new document gets it;empty: empty ones too, when opened) andset for PATH(a folder or glob; the documentsautoapplies to). - Where they live. The open folder's
blocks/NAME.self, then saved rulebooks that setplaceorauto. A document uses one by name,use NAME: the host answerslib:NAME(D72) from the folder'sblocks/first, then the library. So the look stays in one file and every page keeps its own values; changing the file changes every page that uses it. - Inserting (Insert › Page blocks, the palette's Insert a page block…) adds
use NAMEto the rules block (making one with
use markdownwhen the page relied on the built-in default) and the filled-in body where the template says, as one undo step. A built-in template (Properties, Summary) used for the first time is copied intoblocks/(or the rulebooks when no folder is open), where it is the folder's own. - By itself. Every new document the app makes (New file, a note from a template, the
daily note, File › New) passes through the folder's templates set
auto; a template file never gets blocks. A template is added once: a page that already has its first fixed line (::: properties) is left alone. - Properties rows are
name:: valuelines (Dataview's inline field), drawn as a two-columngrid in a card that folds away (
details). In Write a value is typed into on the page (D101). - Details form, the third built-in, is a data block of one record in the
recordsformatwith a typed header (
% status:choice(draft|review|done), due:date, …) shownas cards plain: in Write a click opens the view's form (choices as segments, a date box with a calendar, check boxes), and Save writes the record back (D83). A block's text may be anything a page holds, so a template can lay out a whole page: several blocks, data, plugins. - Templates for whole pages (addendum, 19 Nov): Project tracker, Roadmap, Goals and key
results (Planning), Meeting notes, Book notes, Decision record (Notes), Budget (Money) and Daily review (Life). They are built only from what data blocks already do: tables linked by
choice(from …), totals over linked rows (sum(expenses.amount),count(tasks),avg(results.pct), D139), calculated columns withif,round,daysandtoday. The roadmap spans two years: phases that follow each other, work in lanes per phase with what each waits for (after, arrows, overlaps and load per lane), events as one-day milestones of their own, stage totals (per state), a board by state and views of one stage, dates that follow each other (&,+3w, D225), a pivot (per owner across status, D165), boards, timelines, charts, ratings and switches. Only the view people work in keeps its bar; the others areplain. set group NAMEputs a template under a heading in Insert (Page tops, Planning, Notes,Money, Life first, then any other by name), and
set summary TEXTis the line under its name. Both are for your own templates too.- The settings
place,auto,for,groupandsummaryreach a page that uses thetemplate as variables (01 §2); they mean nothing there.
Nothing in the engine changes: blocks/ is a host's answer to lib:NAME.
Not now. Scoping a block's row rules to inside the block (a block rule entering a named
scope); typed values in name:: value properties (the details form has them); set for on
several folders at once.
D230. Find and replace that shows its work
#Context. D78 gave the find bar its toggles, counts, structure filters and a Search panel. What was missing was seeing a replacement before making it, keeping a word's capitals, writing a regular expression without knowing the syntax, and taking what was found somewhere else.
Adopted.
- Preserve case (Alt+P, in the bar and the panel): a replacement takes the case of each
match. All capitals stay capitals, all small stay small, a capital first letter stays one; mixed case is left as typed. It applies after
$1groups are expanded. - The replacement shown in the text: while the replace field holds something, each match
on screen is struck through with its replacement drawn after it (a widget, not an edit). Replace all stays one undo step. The find bar itself stays two rows.
- The list of matches (Alt+I) is the Search panel, not a list in the bar: it opens on a
new This document scope (beside Open documents and Folder) with the bar's query, toggles, filter and replacement. Rows show old and new while replacing, and a hover button replaces one match (an open tab in the editor as its own undo step, a file written after checking it is unchanged). In preview and Write the rows are source lines; a click scrolls the page there.
- Dragging a row carries the match; its grip carries the block around it: a data record,
a table row, a heading's section, a fenced block or a paragraph. A drag sets
text/plainandtext/markdown; a record isname: valuelines as plain text and a one-row Markdown table with its column names as Markdown. Text held over a tab opens that document. - Pattern pieces (Alt+B): the app's menu, with submenus by kind, of pieces named in plain
words that write regular expression syntax at the caret, or wrap the selected part of the query, plus ready-made patterns. Any pattern, typed or built, is read back as one sentence under the query, groups folded in ("…, one or more times (kept as $1)"). The reading never runs the pattern and never fails on an unfinished one.
in:plugin,in:record,plugin:NAME: a plugin block is a node whose target is notan HTML element; a record is a line of a ```
`data``` block below its column line.plugin:NAMEistarget:NAME. In the preview both keep whole blocks, likesection:.
Nothing here is written to documents or preferences: the switches are remembered per browser, like D78's toggles.
Not now. Dropping onto the Write page itself (the editor and other apps take drops);
records of .csv files in the Search panel; a replacement preview per file in the panel's
list (its confirmation already shows changed lines).
D232. Phones: menus as sheets, panels as tabs, one row of controls
#Context. Tested on an Android emulator (the 3090 worker), the editor worked on a phone but was built for a mouse: submenus opened as a second floating list over the first and ran off the screen, menus showed keyboard shortcuts on a touch screen, the side panel (a drawer on narrow screens) showed one panel with no way to the others, Settings opened at Examples still showed its first tabs, and a data view spent four rows on its controls before its records.
Adopted. On a phone (data-device="phone"):
- Menus are sheets from the bottom of the screen over a dimmed page, with a grab bar and
finger-sized rows; a submenu takes the sheet's place with a back row naming it (
‹ View). Keyboard shortcuts are not shown (menus, Home's New document). The side-by-side modes and Open to the side, which need a wider screen, are not offered (their mode buttons were already hidden). - The drawer's panels are a row of tabs under its title (Files, Outline, Search, Comments…),
scrolling sideways; on desktop the rail beside the panel does this.
- Settings and the Manager bring the open section's tab into view in their scrolling row.
- Data views keep their kinds on one row and put search, Filter, Sort, New and the rest on a
second that scrolls sideways (
.v-actions,display: contentson wider screens, so desktop is unchanged); a timeline's tools are one row too, and its Fit has no sideways scroll. - The examples' search field takes the whole row.
The Export button over a data view now sits above it (it covered the last column header). The
Android app has full screen: View › Full screen hides the status and navigation bars through a
small bridge in MainActivity.kt (window.SelfscriberAndroid), remembered between launches.
In full screen the page runs to the top edge beside a camera cutout (the window opts in with
LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; by default Android moved the whole window below the
cutout's band, a 136-pixel empty strip): the app gives the page the hole's place
(data-cutout, --cutout-left/right/bottom) and the top bar keeps its modes beside Search, away
from it. Outside full screen the band under the status bar takes the top bar's colour, light or
dark with the theme, with status bar icons to match.
D229. Linking tasks by dragging
#Adopted. On a timeline whose records have an after column, each bar has a dot at its
end (shown on hover and focus; always on touch screens). Dragging it draws a line; dropped on
another bar, that task waits for this one: its after gains this task's title (in the
separator the cell already uses, |, ; or a comma), and a start that was a date becomes &
with its length kept as an amount (+3wd), so it moves when this one does. Dropped on a task
that already waits for it, the link is taken out. One undo step each; the status line says
what happened. Not offered when after names another table's records (D228).
D228. Links across tables
#Context. Plans are often kept in two tables: the phases of a project, and the tasks within them. A task should wait for a phase the way it waits for another task.
Adopted. When a table's after column is a choice(from phases.name) (D157), &, &+N
and &s (D225, D226) wait for those records of the other table: the engine reads it (with its
own links worked out) and takes the latest end, or start, of the records named. Move a phase
and every task that waits for it follows. On a timeline the phases the tasks name are shown as
rows of their own at the top ("From phases", hatched, double-click opens the phase) with
arrows into the tasks, and a task's bar says what it waits for (Waits for: Design (phases)); its after is not reported as
naming nothing, and dragging it writes a new gap after the phase (the phase's view, if it is on
the page or put away, gives its dates).
Not now. A record waiting for records of both tables at once.
D227. Places by name
#Context. Typing coordinates is the hardest part of a map; people know "Porto". Looking a name up on the network would send what people write elsewhere (D42), and the user's machine works offline on mobile data.
Adopted. A list of a few hundred places is built into the map client (map/places.ts):
capitals, large and much-visited cities, and countries at a middle point, with other names
(NYC, Oporto, München) and found without regard to case or accents. In a map block:
Lunch @ Porto, a line holding just a known name (Coimbra), a route or area through names
(Porto -> Coimbra -> Lisbon), circle Near @ Faro 5km and center: Lisbon (zoom 12 for a
city, 5 for a country unless zoom: says). Name, Country picks between places of one name.
A name that is neither built in nor another pin is a problem on its line. The text keeps the
name while the pin stays there; dragged away, it is written as numbers. Find a place above
the map searches the list as you type: Enter flies there, Ctrl-Enter or Add puts it on the
map (as its own name, or Porto 2 @ Porto when the name is taken).
A drawn flow's step that stands for no record (D224) shows in the bar under the diagram with Add as a record, which opens the records' form with the step's words as its title.
Not now. Shapes of countries and regions (borders need data this package does not carry); looking up streets and addresses.
D226. The critical path, and start-to-start links
#Adopted. A timeline with links has Critical path: the records that would delay the end
of the plan if they slipped are outlined, as are the arrows between them, and every other
record shows its slack, in working days, as a dotted tail after its bar (and says it). Slack is
counted backwards from the end of the whole plan (slackOf); a start written as a link moves
with the last of what it waits for to end, so its gap is not slack. &s and &s+AMOUNT (D225)
start from when what the record waits for starts; their arrows run from the left of that bar.
A start written & with nothing in after waits for the record above, and is drawn so. In a
table, +4wd typed into a date column that has one before it (an end) is kept as a link.
D225. Dates that follow other dates
#Context. The user (19 Nov) wants plans written the way people think of them: "four
working days", "starts when the survey ends, plus two days", so that moving one task moves
the chain, and a timeline that is edited richly (a menu on a bar: add, move, chain). D119's
short forms only helped typing: +2d became a fixed date at once.
Adopted. A date cell may hold a link instead of a date, kept in the file as written:
+AMOUNT/-AMOUNT(+4wd,+3d,-1w; D119's units): in a record's first date column,that much after the record above starts; in a later date column, that much after the record's own date in the column before (an end four working days after the start).
&,&+AMOUNT,&-AMOUNT: after what the record waits for ends, the latest last date ofthe records its
aftercolumn names (D220), else of the record above.&is the next day, the next working day with awdamount;+is a gap after that,-an overlap.
The engine works the links out (data/schedule.rs) before calculated columns, so filters,
sorts, sums, charts and every view read days, and working days skip the document's holidays.
The payload keeps what was written (linked: record, column, text). A column of dates and
links is a date column; one of links alone is when its name says dates (end, due), so a
column of +1 votes stays text. A link that cannot be worked out (a loop, nothing above) keeps
its text and is warned about at the cell: cannot work out '&': it waits for itself.
In the views: a table shows the date with the link beside it (and says it in words on hover)
and edits the link; typing &… always keeps a link, and +4wd keeps one where the cell had one
(elsewhere it is D119's quick entry). On a timeline a chained bar has a mark at its start and
says its links; dragging or the arrow keys keep links (a start after its wait gets a new gap,
an end counted from the start is written only when the length changes, in the unit it had, in
days when working days cannot say it); a chain that overlaps on purpose (&-2d) is not late.
Right-click, the menu key or Shift-F10 on a bar opens its menu: Open record, Add a task after
this (waiting for it, &, same length), Start after what it waits for, Keep its length when
moved, Fix its dates, Move a week earlier or later, Start today, Delete.
Not now. Start-to-start and finish-to-finish links; links between tables; the critical path drawn.
D224. A drawn flow's steps tied to records
#Context. as flow (D222) draws records in the order of work, but people also draw their
own diagram of a process and want it to show where each piece stands, without redrawing it
from a table.
Adopted. In a flow block, set data=NAME names records (a data block, a .csv file,
db.sqlite/table). A step whose first line of words is a record's title (any case), or that
says record="Title", stands for that record: it takes the colour of the record's status
(toneOf, so done is green, doing the accent, blocked red, as on the timeline), it is marked
when the record is picked in any view and dashed when related (D223), and a click picks the
record everywhere. A bar under the diagram shows the picked step's record: its status as a
segmented control whose choice is written into the records (one undo step), and Open record.
The status is the column called status, state, stage or phase, else the first choice column;
the title is the column called title, name or task, else the first text column. Steps that
stand for no record are drawn as written. A view of the records that is out of sight (parked)
still serves them. Print keeps the colours and leaves the bar out.
Found on the way: a table that took over the element of its newer rendering after an edit
(adopt) no longer picked records on a click, and a click that opened a cell's editor never
picked; both pick now (the listener lives with the element, and a press picks too). A record
changed in place now tells the linked views (linksChanged), so a map layer follows an edit
in the table as well.
Not now. Taking a step's place or text from the record; making new records from steps.
D223. Records related across tables, and the desktop policy checked
#Context. Plans span tables: visits name a person of the people table through
choice(from people.name). Picking a person should show their visits, and a visit its person,
in whatever views those tables have.
Adopted. When a record is picked (D220), every view of another table marks the records
related to it through a choice(from …) column, both ways: the record it points at (a
visit's person) and the records that point at it (a person's visits). The key column of the
other table is the one whose values the link lists. Rows, cards, timeline bars and flow steps
get a dashed mark; map pins a ring. A new pick, in any table, replaces the marks. The click
that picks is taken on the way down, so a record's own handler (opening its form, which
redraws the view) cannot lose it.
A production build served with the desktop app's content security policy (tauri.conf.json)
draws maps (street pictures included), timelines with arrows, flows and layers with nothing
refused (e2e/desktop-csp.spec.ts, run with DESKTOP_CSP=1 against vite preview; the map
pictures are answered locally in the test).
D222. Records as a flow: as flow
#Context. The order of work (what waits for what) is a diagram as much as a timeline, and the flow plugin already draws diagrams well. A table should be able to be one, linked like its other views.
Adopted. view: tasks as flow [by STATUS] [group WHO] draws each record as a step,
an arrow from every record its after names, swimlanes (lane) by group, and a colour by
by (else the first choice column that is not the lanes), chosen by what the value says:
done green, doing the accent, blocked red, waiting yellow, todo grey, other values in turn,
with a key. A step's second line is its dates and progress. The view writes the diagram as
flow text (flowTextOf) and the flow plugin draws it, loaded when first needed. Steps are
records: a click picks the record in every linked view, a double-click or Enter opens it, and
Join (click a step, then the one after it) writes the first one's title into the second
one's after, or takes it out when it is there. Flow is offered among the kinds when the
table has an after column.
A timeline colours its bars the same way (toneOf, toneColor), so a status has one colour
in every view of the records.
Not now. Moving steps by hand (their place comes from the order of work); a step's
state kept in a flow block (D169) tied to a record.
D221. A map of any records, and records as a layer of a drawn map
#Context. Places live in many kinds of records: a data block, a CSV or TSV file, a table of a SQLite database, a query or a pivot. A map should take any of them, and a map someone draws by hand should be able to show them among its own routes and areas.
Adopted.
as mapis a view kind like the others, so it reads every source a view reads, and adragged pin is written where the record lives (text, a file, a database's table).
- The place columns are found by name (
lat/lng, then names that hold them as a word:start_lat,Latitude (deg),lon), then a column calledwhere,location,place, …, then any column whose values all read aslat, lng. - A
mapblock'slayer NAME [by COLUMN]line draws the records of a view on the page (adata block's name, a file,
db.sqlite/table) as pins among the block's own drawing. They are the view's records: a drag goes through that view (its rules, its undo, its source), a pick is shared with every view of them, the days picked for them fade the rest, and the layer follows when the records change. A line under the map says when the view is not on the page or has no places. - The link state (views, picks, days) is its own small module (
view/links.ts), so a mapblock does not load the data view to follow it.
Not tried. A layer of a SQLite table in the desktop app (the write goes the same way as every other view's; tested only through the browser's CSV file).
D220. Plans: linked views, time on the map, a timeline that knows what follows what
#Context. Coordinating people, places and dates means seeing one set of records several ways at once (who, where, when) and having each view answer the others, not three separate pictures.
Adopted.
- Linked views. Every view of the same records on a page (by source and query) shares
the picked record: a click on a table row, a card, a timeline bar, a map pin or a bar of the time strip picks it everywhere; the map brings it into sight, the timeline scrolls to it, without moving the page. They also share a window of days.
- Time on the map. A map of records with a date column (and an end: the view's
to,else a second date column) has a time strip under it: every record a bar, a window to drag out, move, stretch, step, play,
This week,All dates, arrow keys. Pins outside the window fade. Withby, each group's places are joined in date order (Paths), within the window: a person's week as a trail. - The timeline as a plan. Read from column names, no settings:
after(depends on,follows,blocked by) lists the titles a record waits for and draws arrows end to start; a record that starts on or before the end of what it follows is late (red), and Move it after moves it, and what follows it, as far as needed (settle). Records of one group (the view'sgroup) that overlap are marked and listed, with the days.progress(done %) fills the bar. The first other choice column colours the bars, with a key. Zoom: Fit, Weeks, Days (day numbers, quiet weekends), Today. Dragging along the dates picks the shared window. - Workload. With
group, each group's header says how many records, days busy and daysdouble-booked, and a thin Load line under it shows the busy days, double-booked ones in the warning colour.
- A view put away while out of sight stays linked and is brought up to date, so it shows the
picked record when it comes back.
Not now. Arrows between records of different tables; a resource load chart per person;
linking a flow diagram's steps to records.
D219. Maps: a map block and records as map
#Context. People want places, routes and areas in their documents, written plainly and drawn on a real map, and records with a place shown as one, without a library to download.
Adopted.
- A
mapblock, one thing a line:Name @ lat, lng(a place),route Name: a -> b -> …,area Name: a / b / c(alsoregion,zone),circle Name @ lat, lng 300m. A point is a place's name or coordinates. A colour word or#hexand-- notemay end any line;# Title,tiles:,center:,zoom:,height:andunits:set how it shows. Lines that do not read are listed under the map, never dropped. - The map is our own (Web Mercator, tiles under an SVG layer): pan, wheel with focus or Ctrl,
pinch, keys, a card per thing with its length, size or place. Where the host lets plugins write (D83) it is the editor: drag places and points, drag a middle dot to add a point, draw with Place, Route, Area, Circle, rename, recolour and note in the strip under it, delete. Each change rewrites the one line, as one undo step; renaming a place renames it in the routes and areas that go through it.
- GeoJSON out (download) and in (a file picked or dropped on the map).
view: t as map [by COLUMN]: records withlat/lngcolumns (or onelocation,where,coordscolumn oflat, lng) as pins coloured byby(else the first choice column). Dragging a pin writes the record's place (text, CSV or a database's table); Add here opens the new-record form with the place filled. The engine's static output is the table.- Street pictures come from
tile.openstreetmap.org(or the tile server in the settings)only after the reader clicks Show the street map, remembered on that machine; the setting can say always or never. Without them the map draws on a plain grid, offline. Dark themes get the pictures inverted.
Not now. Country and region shapes by name (needs boundary data we do not ship), place names looked up online, routing along roads.
D218. Which files open in Selfscriber: the File types page
#Context. The installer registers .self only. People also keep notes as .md and
.txt and want a double-click to open them here, on every desktop system.
Adopted. Manager › File types shows a card per kind (.self, .md, .markdown,
.txt, .flow), what opens it now, and a switch. The shell (assoc.rs) reads and changes
the system's choice without administrator rights:
- Windows: a ProgID per type under
HKCU\Software\Classes, listed in the type'sOpenWithProgids, and the app underRegisteredApplications. Windows keeps the final choice to the person (itsUserChoiceis hashed), so the page also opens Default apps at Selfscriber. The current choice is read fromUserChoice. - Linux:
xdg-mime defaultandxdg-mime query default. - macOS: the choice is read from Launch Services' preferences; changing it is Finder's
Get Info › Open with › Change All, which the page says.
Every call is a child process with a fixed program and arguments.
Also. A file or folder dragged onto the window from the system opens: a document in a
tab (with its handle, so Save writes back where the browser gives one), a folder as the
open folder, a .zip as a workbook. Pictures dropped into a document are still inserted.
Not tried. The registry writes on a real Windows desktop, xdg-mime on Linux, macOS.
D217. Sync through your own Cloudflare account, and linking a computer by QR code
#Context. People should be able to keep their computers in step without our servers. Cloudflare R2 speaks S3, which sync already supports (D181).
Adopted. Manager › Sync offers Sync through your own Cloudflare account first: a
guided setup in four steps (bucket, token, privacy, finish). It reads the account and bucket
from what the dashboard shows, asks for a token limited to that bucket, asks the person to
tick four checks that keep the bucket private (no r2.dev access, no custom domain, a scoped
token, no open CORS), and seals the place by default. It makes an s3 place on R2.
Linking. A place's form (and the end of the Cloudflare setup) shows Link a device…: a
QR code of selfscriber://pair/DATA and an 8-character short code. DATA is the place's
setup with its secret and passphrase, AES-GCM encrypted with a key from the short code
(PBKDF2-SHA-256, 210 000 rounds, a random salt). The short code is read off one screen by a
person and never sent, so the link alone opens nothing. The other computer chooses **Join
from another device**, pastes the link (or the system opens it from the QR code, through the
selfscriber:// scheme), types the code, and the place is added there, secrets in its
keychain.
What it is not. Phones do not sync yet: the Android shell has no sync host and no keychain. Linking is between computers until it does.
D216. Pro is free to use; a donation buys a supporter key
#Context. The owner wants Pro to work like an evaluation copy that never ends: everyone can use everything, and people who enjoy it are asked kindly to donate.
Adopted. Every Pro feature works in every copy, the web app included. The app calls it a 14-day trial that never runs out: a quiet note in the status bar counts the days (warmer in colour after day 14), and about every fifth start, after the first few days, the Pro dialog opens with a short, friendly ask. A donation brings a supporter key (the licence key of before); with it the note and the ask stop. A lapsed or refused key switches nothing off. Nothing is ever locked. Development builds show neither.
Replaced (27 Nov 2026) by D273: there is no Pro and no supporter key.
D215. A form filled in from a link on your network
#Context. D212's page comes back as a file. With the desktop app open there is a computer that can take the answer itself.
Adopted. The command Share a table's form on your network… (desktop app) serves
the form of a table of the document in front at http://ADDRESS:PORT/live/CODE, by the
relay that carries live documents (D191). Anyone on the same network opens that address
in a browser, on a phone too, fills the form in and presses Send. The answer is added as a
record at the end of the table, in the document, and a note says it came in.
- The page is made from the table as it is when it is asked for.
- An answer is taken only when it has a cell for each stored column of the table as it is
now, and its required cells are filled. Cells of
hiddenandreadonlycolumns are emptied whatever was sent. A cell is one line, at most 2000 characters. - One sharing takes at most 500 answers. It ends when you stop it or close the document.
- The relay answers
GET /live/CODEwith a page only for a session that gives one; awrong code is answered slowly, as before.
What it is not. It is not on the internet: the address is this computer's on the
local network (or a VPN). Whoever has the address can send an answer; there is no
sign-in. The answer is not checked against min, max or pattern by the host: the
browser keeps to them, and the engine marks what is outside them.
Tried. The relay's page request, in its own test. The whole journey in two browser pages with the relay stood in for. Not tried: from a phone to the built app, which needs the Windows firewall question answered on the real screen.
D214. One document as a page by itself
#Adopted. View › Show this document as a page by itself: the app view (D185) for a
single document. Its title (set title, else its first heading, else its file's name) is
at the top, the document shows as it reads, the editor is away, and the pencil brings it
back. It needs no folder and no app.self, and is not remembered for next time. A
document whose only content is a hidden table and view: … as form plain is then one
form and nothing else.
Not adopted. A rule in the document that opens it this way by itself: a document that hides the editor on opening is hard to get back into for whoever wrote it.
D213. How a form shows the record a picked value names: linked
#Adopted. A word on a form's view line: linked card shows the picked record's other
fields (up to twelve) as a small card under the field; linked line is what a form did
already, up to three of them on a line; linked none shows nothing. Left out: a line.
The arrow that goes to the record (D157) is there in each.
Not adopted. linked table: one picked record is one record; the records that point
at this one are a form's lines (D172). A setting per column: one form reads better with
one way.
D212. A form saved as one HTML file
#Context. A form could be filled in only inside Selfscriber. Asking someone outside for records meant sending them the app.
Adopted. The command Save a table's form as a page… makes one .html file from a
table of the document (the one the caret is in, else the first): a field per column a view
would type in, of the browser's own kinds (text, number, date, a list to pick from, a
tick), with required, min, max, pattern, default, help and placeholder kept
by the browser. The file needs nothing else: no Selfscriber, no network, no server.
Whoever gets it fills it in as often as they like. Each answer is kept in their browser.
Get the answers saves a .csv whose first line is the table's own, so its records
paste straight into the table, typed. Calculated columns are not asked for and have no
cell; hidden and readonly columns are not asked for and stay empty.
Not in the page. Fields shown on a test (if), a value that follows another table,
a choice read from another table (it is a plain text field), lines of records. The page
sends nothing anywhere: getting the file back is by mail or a shared folder.
Not yet. A form anyone can fill in from a link, with the answer arriving by itself: that needs a host (T3/T4). A document that is one form and nothing else.
Amended (27 Nov 2026, D270). The table may be a .csv file the document shows (the caret
on its view: line), and its answers paste at the end of the file. A choice read from another
table is now a list of that table's values, read when the page is made. The same holds for the
shared form (D215, D260) and the form online (D254), whose answers go to the end of the file.
D211. A record's history, read from the versions already kept
#Adopted. File › Earlier versions has a third way to look: One record. Pick a table of the document and a record (by its first cell), and it lists, newest first, what each save changed in it: the cells with what they held and what they hold, and when the record was added or removed. A record that is gone now can still be picked. Nothing new is stored: it reads the versions kept at each save (v1.6), on this computer.
What it is not. It does not say who: for that there is the log of changes (D177),
which also covers records in .csv files. A record that was in the oldest version kept
was there before anything was kept, so its first values are not a step. A record whose
first cell was changed shows as one removed and one added.
Not yet. Records of a data file beside the document: versions are kept of documents.
D210. A whole form group shown on a test
#Adopted. A group's heading in a layout may end with a test in brackets, the heading in
quotes: "Tax (if kind = firm)": vat | reg. The group, heading and all, with its fields
and any lines of records in it, is shown only while the test holds; a form does not ask
for a required field of a group that is away. The heading is drawn and printed without
the brackets. A test that cannot be read is a problem on the view's line, and the group is
then always shown.
Known limit. It is one view's layout, not a rule of the table: the engine still
reports an empty required cell. A column that is required only on a test says so itself
(required if kind = firm, D174).
Rejected. A word after the heading (Tax if kind = firm:): a heading is one word or
one quoted text, and a heading may hold the word "if".
D209. warn: a limit that tells, and does not refuse
#Adopted. warn after a column's min, max or pattern (qty:number max 100 warn).
A value outside the limit is written by a view. Where it shows it has a dotted line under
it and the reason on it; in a form the reason stands under the field in the warning
colour, and the form is sent. The engine still reports it as a warning and does not draw
the cell as wrong. The Rules dialog has it as a tick under the limits, shown once a limit
is set; warn with no limit is not written.
Not adopted. warn for required and unique: an empty required cell and a
repeated key break what other records rely on.
D208. Tiles: the last two weeks as bars
#Adopted. The "days in a row" tile of as stats has fourteen small bars under it, today
at the right: each as high as the share of that day's records that are yes, full strength
when the day is complete, a faint mark for a day with no records.
D207. A time zone for an automation
#Adopted. set zone Europe/Lisbon in an automation: its time of day (daily at, a
schedule table's times), its day and its day of the week are read on that place's
clock, on whatever device runs it. Left out, the device's own clock, as before. A zone the
device does not know is a problem shown on the automation, and it does not run by a wrong
clock. Manager → Automations says "by the clock in …".
Not adopted. A zone per record of a schedule: one more column for a case nobody has.
D206. A table of a database reaches a live guest, as records
#Adopted. When a guest's page asks for shop.sqlite/clients.csv, the host's app reads
the table through the desktop shell (a new command, db_read, with the same folder check
as the other database commands) and hands over its records. The document has to name the
table with its database. The database file itself is never handed over, nor its
journal files.
A guest sees the table and does not change it: pressing a cell says the table is in the database of the person sharing. The host changes it, and the guest's page reads it again within 15 seconds of drawing.
Not tried in the built app: it needs two desktop apps. The check that decides what is
handed over, and the command's code path (table_csv, which views already use), are
covered by tests.
D205. A guest's change to a shared data file is written at the host
#Adopted. A guest who changes a view of a file the host lent (`view: prices.csv as
table`) sends the new text to the host, who writes it where it was read from. The host
takes it only when the guest may change something (not "reads"), the document names the
file, it is a .csv, .tsv or .json, and the file is already there. The host's own
page and the other guests then show it.
Known limit. It is the whole file as the guest last read it, with the change: two people changing the same file within the same few seconds, the later one wins. Records in the document itself (a data block) do not have this limit.
D204. The AI prompt teaches actions, buttons and reminders
#Adopted. PROMPT.md has a part automations: what an action, an automation and a
button are, the steps, the moments, the names, and one worked example (a reminder table
that asks and ticks). The prompt builder puts it in when "Buttons and reminders" is
ticked, and asks for each action, automation and data file as a file of its own. An answer
with several files already opens as a folder in memory; it is now named after set app
when there is an app.self, and opens on the first document, not on an action.
Left out of the part. Connectors (requests to servers): an assistant should not write one unasked, and the part says so.
D203. The files a shared document names reach the guest
#Context. A guest got the document's text and nothing beside it: a picture was a broken
frame, a view of a .csv was empty.
Adopted.
- A guest's app asks the host for a file when this computer has none at that path. The
host reads it beside the document, then from the top of the folder.
- The host hands over only what the document names: the file's name has to be in the
document's text as it is now. Never a path with
.., never a file or folder whose name starts with a dot (the app's own.selfscribe/, with its sync places, is one). Only to someone who has joined. - A file over 2.5 MB is not handed over: one answer has to fit what the relay carries.
- The guest keeps a file for 15 seconds, so a page that draws again does not ask again.
- The guest's own files come first: with a folder open that has a file at the same path,
that one is read.
Not adopted. Sending the whole folder at the start: a guest is shown a document, not given a folder. Writing back: a guest who changes a view of a file changes nothing at the host; only the document's own text is shared.
Not yet. Tables of a database; a file that changes at the host is seen by the guest when its page next draws after those 15 seconds, not at once.
D202. A live session keeps to editors, by each guest's name
#Context. D178 said a host could refuse a change that editors does not allow. D197
left it as not yet.
Adopted. For a guest whose right is "the tables only", the host works out what that guest may change from the document as it is now and the name the guest joined with:
- A table whose opening line names
editorswithout them: none of it. - A column that names
editorswithout them: not its cells. The guest changes the othercells of a record, one cell at a time, and cannot type a comma, a quote or a line break there, so cells cannot be made or joined. Such a guest does not add records.
- Everything else as before: the records, not the columns, the fences or the text.
A change outside this is refused by the room and put back on the guest's side, as for any right.
Not adopted. Keeping to it for a guest who may change everything: that guest can
change the line that names the editors. editors on a view's line: it speaks of one view,
and the session sees text, not views.
It is still not a lock. The name is typed by the guest. The host can see who joined, set a guest to read, or take one out (D197).
D201. The built Windows app tried on a desktop nobody sees
#Context. The tests run the editor in a browser and the Rust code by itself. The built Windows app, both together, had only ever been opened by hand.
Adopted. The built Selfscriber-0.9.1-portable.exe is started on a hidden desktop
(ahkh session.start --exe), with a profile folder of its own, so nothing shows on the
screen and the owner's settings, licence and trial are not touched. Its web view is given a
debugging port, and a script speaks to the page over it. On a hidden desktop the web view
draws nothing unless it is started with --no-sandbox; that is a setting of this test
only.
Tried, and passed (18 Nov, the build of 12:21).
- It starts and opens the folder named on its command line.
- The commands are there: Sync, Join a live document, Open this folder as an app, Package
this app; with a document open, Share this document live and its "guests only read".
- A second folder added as a place, to sync every 5 minutes: it synced by itself with
nobody pressing anything ("2 sent"). A change and a new file made in the other folder came back on the next sync.
places.jsonholds no secret. - It can list and fetch its own 656 files, which is what packaging needs.
- The daily plan example was added to the folder on disk and opened as an app: its four
tabs, its title, the editor's toolbar gone. A tick was written to the file on disk. The tiles drew. The pencil went back to the editor.
- On the build of 12:46, with the place kept from the run before: a change typed and saved
was in the other folder 27 seconds later with nothing pressed; a file removed in the other folder was moved to this folder's
.trashwhen Sync was pressed ("1 moved to the trash here").
Not tried there. Sharing live: Windows would ask about the firewall on the real
screen. Running an action: a release build needs a licence for that, and none is entered.
The installer. The harness noted that reg.exe asked for a console window four times;
the app already starts it with no window (link.rs), so nothing shows.
D200. A packaged app works with no network, every screen of it
#Adopted. A package carries the list of its own files. Once a packaged app is up it fetches them all, a few at a time, so the browser holds every one: a screen that was never opened works with no network. It is not done when the browser is asked to save data, and is done again for a newer package. The service worker keeps the package's own files (its screens and pictures) as they were last fetched, and takes them from the network first when there is one, so a newer package still arrives.
Tried as a phone presents itself (touch, a phone's browser name, 390 wide), on a built package: what a phone needs to offer "Install" is there; with the network cut the app opens, a tick is kept, and a screen never opened before draws. Not tried on a phone.
What only a person with a device or an account can check is one page:
docs/CHECK-BY-HAND.md.
D199. SFTP, FTP and Drive tried against servers run in the tests
#Context. D181 said plainly that these three had never met a server. No server can be reached from here, and none may be installed.
Adopted.
- FTP: a small FTP server written in the test, and the system's real
curldoing awhole sync against it, as the app does.
- SFTP: the system's real
sftpspeaking the real protocol to a realsftp-serverprogram on this computer (
sftp -D), with no SSH between.Sftphas adirectfield for that; the app never sets it. - Google Drive: a server that answers as Drive's API does (listing in pages, folders,
an upload in two parts, the trash, the token exchange), at another address than Google's.
Found, and fixed.
- FTP: the first sync into a folder that is not on the server yet was reported as "the
place did not let us in".
curlsays "no such folder" with a code that was read as a refused sign-in. - SFTP: the first sync into a folder that is not there yet could write nothing. The folders
below the place's own were made, the place's own was not.
Still not shown. SSH itself: keys, a server's host key, a password prompt. Google's own
answers, limits and sign-in. FTPS (the encrypted kind) and servers that list differently
from ls -l. An FTP or SFTP change that keeps a file's size within the same minute is not
seen as a change, because the listing is all there is to go by.
D198. A plain view that can be searched
#Adopted. find beside plain keeps a search box over the view and, under it, every
value of the view's list columns with how many records hold it, most first, up to
twenty-four. A tag pressed is the search; pressed again, or "All", clears it. The word is
kept when a view's line is written back. The example's Journal uses it, with a tags
column on its check-ins.
Not adopted. Showing the whole bar in an app's screen with parts hidden by the app view: a screen says what it has in its own line, wherever it is shown.
D197. A right per person in a live session
#Adopted. The host's bar shows each guest as a small menu: everything, the tables only, reads, or take out. The room enforces the new right from the next change. The guest hears at once: the host answers a guest's waiting request whenever what it last told that guest differs from what is so now, so it does not depend on a request happening to wait at that moment (the first version did, and a test caught it). A guest taken out is told the session is over, keeps the copy, and is refused if the same app asks to come back.
Not yet. Rights by table or column (editors, D178) handed to the session.
D196. What could not be sent is sent later
#Adopted.
- A request that failed because the server could not be reached, did not answer, or said
"later" every time is marked so. An action that stopped at a
callof a connector that sends (not a GET) for that reason records the step it stopped at. - The run is kept: the action, what it knew, and that step, per folder on this
computer. It is tried again when the folder opens and every minute after, each one waiting 1, 5, 15, 60, then 180 minutes between its tries. It goes on from the step it stopped at, so the steps before the call are not done twice.
- A run that then fails for another reason is taken out and reported. A refusal is never
kept. A scheduled run that was kept counts as done for the day.
- Manager → Automations → Run log lists what waits, with Send now and Forget.
Not adopted. Keeping the request itself: it would hold the filled-in headers, and a key does not belong in storage. The action is run again instead, and the key is read from the keychain when it is.
Not yet. The waiting runs carried between computers; a run with two sends where the first went through and the second did not is taken up at the second, as it should be, but a send that did arrive and whose answer was lost is sent again.
D195. A mirror: what the server no longer has goes here too
#Adopted. set write mirror KEY merges as merge does and then removes the records
here whose key was not in what the server sent. A record with no key is never removed: it
has not been sent. A mirror removes only when it saw the whole list. It merges and removes
nothing, and says why, when the server sent no records while there are keyed ones here;
when the list went on past the pages asked for; when a later page's address led to another
server; or when the connector keeps only some records (where, limit).
Rejected. Removing by default in merge: a file that loses records nobody asked it to
lose is the worse surprise.
D194. A schedule: the times are records
#Context. The remake's reminders were four automations with the time written in each. The user's app sets its times on a screen.
Adopted. set when schedule FILE.csv [by COLUMN]: once a day for each record of the
table, at the time in its column (at when not named), or when the folder opens after it.
A record whose on cell says no is skipped. The record's cells are names for the action.
Each record is done for the day under its own key and time, so a time changed during the
day runs again at the new one. The example now has one table of reminders on its Setup
screen, one automation and one action, where it had twelve files.
A days cell narrows a record to some days of the week (mon-fri, weekdays, weekends,
mon, wed, fri); empty, or a word that names no day, is every day.
Not yet. A time zone other than the computer's.
D193. Connectors: lists in pages, and trying again
#Adopted.
set pages Nfetches a list that comes in pages. Two ways to the next page:{page}in the address, counted from 1 until a page is empty; orset next PATH, where a reply names its next page. An address there is followed only on the same server as the first request, because the headers that go with it may hold a key; a word there is{next}in the address. An address that does not change ends the run rather than fetching the same page again.- Written once. The pages' records are put together, then filtered, sorted, limited
and written as before. A later page that fails writes nothing and names the page.
set retry N: a request is sent again when the server could not be reached, did notanswer in time, or answered 429 or 5xx, after 0.8 and 3.2 seconds. Left out: twice for a GET, never for a request that sends something, which may have arrived the first time. Any other refusal is not tried again.
Not yet. Sending later what could not be sent (a queue kept across restarts); records deleted on the server.
D192. An app as a package of its own
#Context. The user: mini apps "just as good as apps", packaged, "especially for phone", with screens that stay documents. D185 showed a folder as an app inside Selfscriber only.
Adopted.
- File › Package this app for a web host… saves one zip: Selfscriber's own built
files, the folder's text files under
app/files/with a list of them, and a web manifest with the app's name, colour and an icon drawn from its first sign or letter. The page's title and icon are the app's, and it carries a mark that it is a packaged app. - The build lists its own files (
app-files.json, written when the build closes), sothe running app can gather them. A development copy has no such list and says so.
- A packaged app opens its files as a folder in memory and goes straight to its screens.
What is entered is copied to that browser's storage every few seconds and when the page is put away, and is there the next time.
- Records are the person's, screens are the package's. On opening, files under
data/and
.csv/.tsvfiles come from what the browser kept; everything else comes from the package when it is newer than the kept copy was made from, else from the kept copy. - The tab's title in any app view is the screen and the app's name, not "Selfscriber".
Found on the way. The first storage name clashed with Selfscriber's own app storage, so nothing was kept; the app's own warning ("this browser would not keep what you enter") showed it in the first run on built files.
Tried. From a built web app: the daily plan packaged, unpacked onto a second stand-in host, opened at a phone's size as a new visitor, a line ticked, the page closed and opened again. Not tried: installing it on a phone; a real web host.
Not adopted. Unlocking automations for everyone in a packaged app: what Selfscriber Pro covers is the owner's to decide, so the gate is as it was and the guide says so. A slimmer package without the editor: the screens are documents and the pencil edits them, which needs the editor; 17 MB once, cached, is the price.
Added the same day. Files that are not text (pictures) are carried as they are, up to 8 MB each and 60 MB in all, listed apart in the package's index, and are not copied to a person's storage: they are the package's.
Not yet. Records shared between the people who use one address; a store package for a phone; a single file to double-click.
D190. A live session, in the app
#Adopted.
- A session is a host and guests. The host's document is the room (D187). Each
editor, the host's too, is tied to it by a peer that keeps a copy of the text with the collab state, sends what is typed and applies what arrives. The collab state is kept beside the tab, not in it, so the editor's own state is untouched; the tab is reached through three things: its text, a way to apply a change, and a way to show the others.
- A change nobody told of is found: a peer compares the tab's text with its copy, so a
record written by a view, an action or a file read again travels like typing.
- Four questions, one answer each (hello, push, pull, point, bye): a guest asks, the
host answers. A pull is held by the host until there is news. Anything that can carry a question and its answer is a transport.
- A code names a session: six characters with none that look alike.
- In the app: File › Share live (three kinds, below) and Join a live document; a bar
with the code, the others in their colours, and Stop or Leave. The others' carets and selections are drawn in the editor with their names. A change from someone else is not an undo step. A guest's document is a tab of its own, which stays when the session ends.
- What guests may change is the room's to enforce: everything; only the records of the
data blocks (worked out from the text at each change, so it holds as the table moves); or nothing. A change outside it is taken back in the guest's editor, with a word why.
Found on the way. Two parts of a peer asking for news at once were handed the same changes twice (one at a time now). After a "you are behind" answer a guest waited on a request that is held until something changes, and its own change was that something (it sends again at once now). Both were caught by tests, the second only by the test over the desktop's wires.
Tried. Three people for sixty rounds in the same places; carets; the three kinds of rights; the host stopping; two windows of the real app (an end-to-end test).
D191. A relay in the desktop shell, for another computer
#Context. Between windows of one browser a BroadcastChannel carries a session. Another computer needs the network.
Adopted.
- The shell carries, the window decides.
live.rslistens on a port of this computerwhile a document is shared, and only then. A guest's question is
POST /live/CODE/ask; it is queued for the window, which answers through a command, and the answer goes back on the same request. The relay reads neither. - Written on the standard library: no server crate is at hand offline, and one route
does not need one. A request has a size limit; a wrong code is answered slowly; a guest waiting when the session closes is told at once; the listener stops with the last session.
- The invite is the address and the code:
192.168.1.20:47420/K7M2QX. The address isthe one this computer would use to reach the network.
- A guest's app asks through its own shell, which speaks plain HTTP to private-network
addresses only (which includes a Tailscale address) and to nothing on the open internet. The ordinary request command still refuses plain HTTP to another computer.
Tried. The relay over real sockets on this computer (a Rust test: a question, its answer, a wrong code, a closing session, the listener stopping and starting). The editor's session over the desktop's wires with the shell stood in for. Not tried: the Windows app itself with a second computer; a firewall's prompt; Tailscale.
Not adopted. Encryption of our own on the local network: a key would have to travel with the code, and Tailscale already does it properly for the case that needs it. A WebSocket: no crate at hand, and a held request does the same with nothing new.
Not yet. A guest in the web app reaching another computer (a page on https may not); phones; the files beside the document; a right per person; a form from a link; the Pro service as a relay (T4).
D189. A place sent to the other person
#Context. A folder's places are kept in its own .selfscribe/sync, which is never
synced, so a second person had to type the place again.
Adopted. A place has a share button that copies a line, selfscribe-place:{…}: its
name, kind, where it is, whether it is sealed and how often it syncs. No password, key or
passphrase is in it. The form for a new place has a field to paste it into, which fills
the form; the line may have other words around it. Only the fields its kind has are taken.
Rejected. Syncing places.json itself: a place that listed itself would hand its
address to anyone who can read the place, and two computers reach one share by different
paths.
D187. Two people in one document: the ordering, first
#Context. T3. The roadmap named @codemirror/collab for it; that package is not on this
machine and the user's connection is not for downloads.
Adopted (this slice: no one can use it yet).
- The same algorithm, written here on
@codemirror/state(features/live/collab.ts):an editor keeps its own changes until the room has ordered them; changes from others are applied under the ones still waiting, which are rebased over them. A change from someone else is not an undo step.
- A room (
features/live/room.ts) orders the changes: one is taken only when its senderhad every change before it, else the sender takes in what it misses and sends again. The room keeps who is here and each caret (moved with the text, dropped after 30 seconds of silence), and **refuses a change that reaches outside the lines its sender may change**, whole. That is the hook for
editors(D178) to be enforced, not only kept to. - The room is logic, not a server. It is meant to run in the app of the person who
holds the file, with a small relay in the shell (and later the Pro service, T4) carrying messages. The relay then needs to understand nothing, and can carry sealed messages.
- The file stays plain text: what travels is "replace this range with these characters".
Tried. Two and three editors against a room in one process: changes arriving in either order; three hundred rounds of typing in the same places with people left behind; a refused change; carets. Not built, so not tried: anything over a network, anything on screen.
Not yet (the rest of T3). The relay in the desktop shell and joining from another
computer; a document opened from a room rather than a file; carets and names drawn in the
editor; views, boards and diagrams checked live; editors handed to the room; a live
database through the host; a form anyone can fill in from a link.
D107. Exporting several documents
#Adopted (v1.5 X23). Export takes one document or every document of a workbook (in its
reading order) or folder (by name). Formats: one HTML page (a book: cover, contents, a chapter
per document), a website (.zip: index.html, a page per document, one style.css, pictures
embedded or as files), PDF (the book, printed), EPUB 3, Word (.docx), and Markdown, source or
plain text (a .zip when there are several). Links between documents are rewritten: in a site
a.self#x becomes a.html#x; in a book #doc-a--x (ids prefixed per chapter); a link to a
document not exported becomes its .html name. CSS can be trimmed to the rules the pages use
and minified. The dialog lists, per format, what it cannot keep and what it becomes (formulas
stay vector type in HTML, PDF and EPUB as MathML; Word gets real equations (Office Math converted from the MathML; the TeX when there is none); diagrams become PNG in
Word and stay SVG elsewhere).
Round 1 (independent review agent, 2026-09-11). Derived all 94 fixtures from the spec and D1-D65 before reading expected files. 91 matched; 3 defects (011 folds, 044 lines, 061 empty row) and 11 ambiguities. Verdict: changes required. All fixed; ambiguities resolved in D66; 14 coverage fixtures (095-108) added.
Round 2 (second independent review agent, 2026-09-11). Confirmed the three fixes, derived
095-108 independently (13 of 14 matched; 108 had a stray blank line in its .diag.txt), and
checked D66 against 001-094 with no contradictions. Verdict: changes required, conditional on
exactly: remove the blank line in 108's .diag.txt; record D67 (URL scheme case, byte-level
runner entry, built-in file key, .. above the root); add .diag.txt normalisation to the
conformance README. All three were applied in the Phase 0 gate commit, which meets the
reviewer's stated conditions for sign-off. Phase 0: signed off, 108 fixtures.