Design decisions¶
Decisions made by the maintainer, newest last. The reason is kept with each one.
2026-10-26¶
| # | Decision | Notes |
|---|---|---|
| D1 | The efficiency target is adopted as proposed in docs/benchmarks.md: 3x faster scalar evaluation, half the memory per compiled expression, compile no slower, evaluate only what reads a changed input, every limit fails in under 50 ms. |
Measured against the expr.py baseline with benchmarks/run.py. Closes the T14 open item. |
| D2 | ~~Statements are part of TEL~~ (superseded by D10), not only expressions: assignments and calls, as in Tesserae's handlers. | Their syntax, the set of statements, and how a scope says what is writable or callable are still to be designed (step 3 and 4). The sandbox rules apply to them as to expressions (step 7). |
| D3 | ~~The template delimiter is {{ }}: text with expressions embedded in it; one whole part keeps the type of its value. |
Open: the brief's own example, {if condition, a, b}, uses single braces. How a single-brace form and {{ }} fit together is not decided. Superseded by D19: TEL has no template form. |
| D4 | Built-in functions are kept where they make sense and are efficient. The Tesserae-flavoured ones (format_number, pluralize, clamp, the date helpers) are judged one by one in step 3: a built-in stays if it is generally useful, safe, and cheap to call. |
Each kept built-in gets a test and an entry in the whitelist; each dropped one is listed with the reason. |
| D5 | ~~event stays~~ (superseded by D10), but its design is open: it may be redesigned for stability, efficiency and performance. |
Where an event value comes from, what it may hold, and how a handler reads it are designed in step 3 and 4. Until then the reference cases do not depend on it. |
2026-10-26 (later)¶
| # | Decision | Notes |
|---|---|---|
| D6 | elif and else are supported alongside if. |
The brief reserved them in Tesserae's directives. Where they live (structure, step 5; statements, step 3) follows the syntax design. |
| D7 | Generated names follow <name>_0001 and increment (<name>_0002, ...). |
Stated by the maintainer for naming what a repeater makes. Confirmed reading: the counter names the entry; identity still comes from the key, so a counter is assigned when a key is first seen and never reused. Built in step 5. |
| D8 | The language version starts at 0.1.0. A file declares only major and minor: shell: 0.1 is enough. |
TEL is an expression language, not a file format, so it has no file key of its own: the host format declares the version (the Shell's shell: key, or any other host's) and passes it to TEL's API. The patch number never changes the language. How the API takes the version (for example a language="0.1" argument) is designed in step 3. |
| D9 | import: belongs to the Shell, not to TEL. |
Closes the open item in brief section 7. TEL does no file composition. |
2026-10-26 (statements and events)¶
| # | Decision | Notes |
|---|---|---|
| D10 | TEL is an expression language and nothing else. Statements, handlers and event handling are not in TEL; they belong to the consumer (the Shell). A consumer may use TEL to evaluate expressions, such as argument expressions, when an event fires. | Supersedes D2 and D5. event, if a host wants one, is an ordinary name in the scope it supplies. Raised by a message from the shell session; the maintainer confirmed it directly in this project. Phase 5 (#14) is dropped. |
2026-10-28¶
| # | Decision | Notes |
|---|---|---|
| D11 | Memory criterion of D1 (at most half of expr.py's) is accepted as measured in phase 4 (median 0.56, worst 0.76) and improved in step 8. |
Option 1 of the phase 4 review. The other four criteria of D1 stand. |
2026-10-29¶
| # | Decision | Notes |
|---|---|---|
| D12 | Step 4 design approved (docs/language.md section 12): evaluate_tracked(scope) returns the value and the top-level names actually read, with plain evaluate unchanged (A, B); a missing name is still reported (C); host functions are pure, plain-in plain-out, registered at compile time (D); host methods are supported too, registered by the host per type, never found by asking the object (G), and allowed on plain types without replacing a built-in method (H); results must be plain (I); a bad registration is a ValueError or TypeError at compile (J); a failing tracked evaluation puts the names read on TelError.reads (K). |
Extends the 2026-10-26 plan: host methods were added by the maintainer on 2026-10-29. |
2026-10-31¶
| # | Decision | Notes |
|---|---|---|
| D13 | Path tracking is wanted: a tracked evaluation reports the full path read (RootShell.DP1.Top_Bar.Width), not only the top-level name. Changes decision B/D12 (top-level names only). Build only on the maintainer's go-ahead. |
Asked for by the Shell (its T20): it supplies a tree of plain objects as the scope. Built 2026-10-31 (phase 4b). Design approved 2026-10-31 (docs/language.md 12.8, L to R as recommended): reads holds dotted paths in place of top-level names, Tracked stays (value, reads) with a Tracked.names property, a path stops at the first subscript or call, full chains only, the failing path is reported, Expression.paths and Template.paths give the paths in the text. Measured: recording a path costs about 5 ns. |
| D14 | cond ? a : b as another spelling of a if cond else b: to be added if testing shows it is not too costly. Not built, not yet decided as language. |
The maintainer expects the cost to be small and wants it measured first: a read-time rewrite into the same tree (nothing new allowed), error columns mapped back to the original text, : in slices, dicts and format specs, nesting and precedence. A spike measures compile time, memory and the cost of error positions. Language version impact to be settled (0.1 or later). Spike done 2026-10-31 (language.md section 15): evaluation and memory identical, compile of an expression that uses it about 2x (10 to 22 µs), nothing else changes; YAML plain scalars need quoting around :. Decided 2026-10-31 (maintainer): S add it; T in language 0.1; U allowed inside f-string fields; V mixing with if/else without brackets is refused; W same precedence as if/else (lowest, right-associative). Not built yet. Built 2026-11-01 (#24). |
2026-11-01¶
| # | Decision | Notes |
|---|---|---|
| D15 | Step 5 (structure), boundary and surface form. (1) TEL owns expressions and keyed reconciliation only: a condition is an expression that gives a bool, a repeater is an expression that gives a list plus a key expression, and TEL reconciles the previous and the new keyed items (kept, added, removed, moved) and assigns <name>_0001 names (D7). The Shell owns the YAML keys (if:, elif:, else:, for:, key:), the tree and the UIDs. (2) Condition: no new syntax; confirmed 2026-11-01: if/elif/else are the Shell's sibling keys around a TEL bool (the brief's {if c, a, b} is not adopted: YAML reads it as a flow mapping and it collides with {{ }}). (3) Repeater: item in items with a separate key, as Tesserae UI's for: does today (for: item in items or for: i, item in enumerate(items), key: item.id): TEL parses the name in expression header and the key expression; child expressions see the item name in a layered scope. (Chosen after reading the UI's form; the first choice, split repeat/as/key, was withdrawn.) (4) A missing or duplicate key is an error with a position, never an index key. (5) The previous keys and the _0001 counters are a state object the host owns, passed in and returned; TEL keeps no state. |
Decided by the maintainer 2026-11-01 (option A, error plus host state, and the UI's item in items form after reconfirming). Keeps D10: TEL stays an expression language. The YAML proof for T8 loads YAML with PyYAML as a dev-only dependency and hands TEL the loaded values; TEL has no runtime dependency. Supersedes brief section 7 for the row "Conditions and repeaters (structure): TEL": TEL owns the expressions and the keyed reconciliation, not the structure nodes. Design to be written in docs/language.md before building; the language-version impact and the error codes are settled there. |
| D16 | Step 5 design approved (docs/language.md section 16, decisions 5A to 5M, as written): a truthy bool condition and a select chain helper with tracking; the header target in expression; keys of int, str or tuples of those; compile_repeater/reconcile/RepeaterState; TEL formats <name>_0001; entry.scope(parent); reads through the item reported as written (the host re-bases); new codes repeater-header, bad-key-type, duplicate-key; PyYAML as a dev-only dependency for the T8 proof. |
Approved by the maintainer 2026-11-01, together with the five phases (#26 to #30). Builds D15. 5A amended 2026-11-01 (maintainer, phase 2 review): a host object is true without being asked, as the evaluator does for not x, instead of being refused. 5K amended 2026-11-01 (maintainer, phase 3 review): the list and every key of a repeater share one max_steps budget per call, instead of each key having its own. 5E/5H amended 2026-11-01 (maintainer, sharp-edges question): a RepeaterState belongs to the repeater that made it; reconcile raises ValueError for a state with another repeater's name. |
2026-11-02¶
| # | Decision | Notes |
|---|---|---|
| D17 | Step 6 is TEL's Python form of expressions, not a shell-tree builder. (1) The shell tree builder (Shell, Bar, If, For) and its parity test against the TDL parser belong to the Shell (vault Python Builder P1 to P4); TEL owes the vault's P5: an expression or template built from Python gives the same compiled expression as the text. (2) TEL's Python form is strings with safe Python values (A+): text with $name placeholders, each replaced by a checked literal; no operator builder, no lambda reading. (3) Expression.canonical is the text re-read from the checked tree, so the parity test compares it; there is no __eq__. (4) compile_repeater gets a separate-pieces form (names, list text, key text, each with its own origin) next to the header form, because the Shell's TDL for item in {{ ... }} key {{ ... }} has them as separate slots. |
Decided by the maintainer 2026-11-02, as recommended, after reading the vault (ADR-0008, ADR-0014 D11, D15, D64, D65, Python Builder, Expression Language Requirements T7). The brief's "Python builder with YAML parity" is superseded: the Shell's files are TDL, not YAML. Board #6 is retitled. Design: docs/language.md section 17. |
| D18 | Step 6 design approved (docs/language.md section 17, decisions 6A to 6L, as written): fill, fill_template and literal build text with $name placeholders outside strings and comments, each value a checked literal; unknown and unused placeholders are errors; Expression.canonical and Template.canonical are lazy ast.unparse forms for parity, with no __eq__; compile_repeater_parts takes the names, list and key texts, each with its own origin; language version stays 0.1. |
Approved by the maintainer 2026-11-02, together with the five phases (#31 to #35). Builds D17. Also 2026-11-02: compile_template always returns a Template (Template.is_text), at the maintainer's choice after the step 5 review. |
| D19 | TEL has no template form (language and API unchanged; package 0.2.0). TEL is an expression language only. The host finds the slots in its own text and splits it; TEL gets one expression's text and an Origin per slot. Removed: Template (with is_text, canonical, names, paths, evaluate_tracked), compile_template, fill_template, reads_as_expression, the error codes template-unclosed and template-empty. Supersedes D3 and the template half of D18 (fill_template, Template.canonical). Kept: compile_expression, compile_condition, compile_repeater, compile_repeater_parts, reconcile, fill, literal, Expression.canonical. |
Decided by the maintainer 2026-11-16, relayed by the Shell vault (ADR-0008 amendment) and confirmed by him to this session; issue #39. Why: the slot delimiter belongs to the file format (TDL <| |>, Tesserae UI {{ }}), so a delimiter inside TEL matched only one of them. Breaking, so the next version is a minor bump (0.2.0); the bump, tag and release are the maintainer's. Tesserae UI pins tesserae-el and splits text itself. |
Still open¶
- The package's own versioning and release process.