diff --git a/AGENTS.md b/AGENTS.md index a64f3c8..f9974c9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -80,7 +80,6 @@ In [docs/decisions.md](docs/decisions.md): - `parent` names the link column and the table alike - After a row, a path names a column or a linked table - A selected row is fixed, not drawn, and an unnamed read beside it is refused -- A link column after a row steps up to the parent row, and a path may not end on it - A table selects by one key column, a code, never a free-form name - A parent row with no child row is a load error - The choice-of-rows fence guards a data file's root, and requires string fields @@ -119,4 +118,4 @@ In [docs/decisions.md](docs/decisions.md): - `List` advertises direct descents only - A path draws through its compiled steps - A name lives in the category binding it, or in the repeat binding it, and is drawn on its first read -- comprehension floor: every dimension and the overall at 7.0 or above; items 2, 71, 3, 4 and 90 ship with no scoring run, and item 5 scores them +- comprehension floor: every dimension and the overall at 7.0 or above; items 71, 3, 4 and 90 ship with no scoring run, and item 5 scores them diff --git a/CHANGELOG.md b/CHANGELOG.md index 7def0fd..b888b2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ replacement, and each removed path, column or flag. ### Added +- Step up: `..` after a row steps up to the row its link column names, so + `{/city[Oslo]..country.name}` renders `Norway`, and `.` after it steps down again, + drawing afresh. `New` refuses a `..` naming anything but the parent table, and a + selector after a `..`. - Names: `{/misc.territory as t}` binds one row of `misc.territory` to `t` and prints nothing; `{t}`, `{t.capital}` and `{lowercase(t.name)}` read that one row. A name lives in the category binding it, and a `repeat` binding it picks again on every iteration. diff --git a/README.md b/README.md index 0b2a5a2..cd53345 100644 --- a/README.md +++ b/README.md @@ -572,6 +572,26 @@ reference renders one row of a table, so reads in cells of different rows of it, different rows of their ancestors, never render together, whether `[key]` selects the row or the reference draws it. +### Step up + +`..` after a row steps up to the row its link column names, and the parent table's name +follows it, as a folder's does in a filesystem path: + +```sh +fejkdata -d ./mydata 'city[Oslo]..country.name' # Norway +fejkdata -d ./mydata 'city..country' # a city drawn, then its country: Sweden (SE) +fejkdata -d ./mydata 'city[Göteborg]..country.city' # Stockholm or Göteborg, drawn afresh +fejkdata -d ./mydata '{/city as c}{c}, {c..country.name}' # Oslo, Norway +``` + +It steps up from a selected row, a drawn row or a [name](#names) bound to a row, one level +per `..`: `{l..municipality..region.name}`. After it, `.` steps down again, drawing +inside the row stepped up to. `.country` after a row still reads the link column's cell, +`NO`. A `..` that names anything but the parent table is an error naming the parent, and +so is a selector after a `..`, which could name a row outside the one stepped up to: +select rows before the `..`. `--list` advertises no path with a `..`. At the start of a +reference, `..` is the folder above ([References](#references)). + ### Options and fields `format`, `weight`, `repeat`, `separator`, `datatype` and `drawGroup` are the only options; diff --git a/docs/decisions.md b/docs/decisions.md index d81b87e..dbe5b36 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -511,36 +511,6 @@ case but the last, where two expected a render and all three accepted the refusa Goal 5.2 overrides its shared draw beneath a selection and its refusal of an unnamed read; `todo.md` item 4 replaces them. -## A link column after a row steps up to the parent row, and a path may not end on it - -Decided 2026-09-27 by the maintainer, for goal 5; valid while a link column holds the -parent's key. It extends [After a row, a path names a column or a linked -table](#after-a-row-a-path-names-a-column-or-a-linked-table) from child tables to the -parent. A row is selected or drawn alike. - -- Where a segment follows, the link column's name reads the parent row, one level per - step, chained: `city[Oslo].country.name` renders `Norway`, `locality.municipality.name` - the drawn locality's municipality, and - `geo.US.locality[1714000].municipality.region.name` Chicago's state. -- A path ending on it is refused at `New`, `NewTemplate` and `Fake` alike, naming the - parent's key column and the parent's format spelled as paths: with a `country` format - of `{name} ({alpha2})`, `city[Oslo].country` names `city[Oslo].country.alpha2` and - `{/city[Oslo].country.name} ({/city[Oslo].country.alpha2})`. `List` leaves such a path - out, and a record's link column still holds the key, since it is a column, not a path. -- A path may not step back down into a child table after a step up: - `city[Oslo].country.city.name` could be Oslo or a city of Norway drawn afresh, so it is - refused, naming the path to the row it stepped up from, `city[Oslo].name`, and the path - down from the parent, `country[NO].city.name`; after a drawn row, `city.country.city.name` - names `city.name` and `country.city.name`. -- A route through another row is another path to the same data, not a second spelling: - `city[Oslo].country.name` and `country[NO].name` both load. - -Checked against three simulated template writers from the Audience: all three read the -parent row where a segment followed, and they split between the code and the name where -the path ended. - -Goal 5.4 overrides this; `todo.md` item 2 replaces it. - ## A table selects by one key column, a code, never a free-form name Decided 2026-09-27 by the maintainer, for goal 5's one spelling per result; valid while @@ -938,6 +908,6 @@ the render. Valid while names are read only inside the category binding them. -## comprehension floor: every dimension and the overall at 7.0 or above; items 2, 71, 3, 4 and 90 ship with no scoring run, and item 5 scores them +## comprehension floor: every dimension and the overall at 7.0 or above; items 71, 3, 4 and 90 ship with no scoring run, and item 5 scores them 2026-10-04, Lilleman auf Larv. Serves goal 3. The nine-seat panels in `todo.md`'s git history, 2026-09-22 to 2026-09-30, held the score between 5.2 and 6.1, with Locality lowest at every seat, and the hardest units are the draw fences item 4 deletes. Items 4 and 90 delete or move what the earlier items touch, so a scoring run before item 90 merges would score code about to go. Items 2, 71, 3, 4 and 90 are the round `AGENTS.md`'s comprehension rule lets merge below the floor, a restructure the maintainer approved. No scoring run or panel runs until item 5, which runs the nine-seat panel and larv-review's scoring run. The scoring run writes this entry's first scores. Valid until item 5 runs. diff --git a/todo.md b/todo.md index f3f6acb..c0cfe6d 100644 --- a/todo.md +++ b/todo.md @@ -73,7 +73,6 @@ | 3 | 0.1.0 | decision | **Rewrite the shipped categories so facts that belong together come from one named pick.** | 5 | 5 | 8 | 9 | 4.1 | 25.0 | | 4 | 0.1.0 | decision | **Draw every `{…}` afresh, keep a pick only by name, and delete `drawGroup` with the fences that held picks implicitly.** | 7 | 8 | 8 | 10 | 5.2, 4.1 | 24.0 | | 57 | 0.1.0 | | **Rewrite `CHANGELOG.md`'s `[Unreleased]` as what v0.1.0 holds.** | 1 | 2 | 6 | 6 | 1.1 | 22.5 | -| 2 | 0.1.0 | decision | **Step up from a row to the row it links to with `..`: `{/city[Oslo]..country.name}` renders `Norway`, and `city[Oslo].country` stays the cell `NO`.** | 4 | 5 | 7 | 8 | 5.4 | 21.6 | | 34 | 0.1.0 | | **Add `{isin()}`, `{cusip()}`, `{aba()}` and `{vin()}`.** | 2 | 4 | 6 | 7 | 4 | 20.9 | | 5 | 0.1.0 | | **Run the nine-seat comprehension panel after the draw restructure, and file what it names.** | 1 | 3 | 3 | 9 | 3 | 20.4 | | 71 | 0.1.0 | | **Accept a name as a `calc` operand, so `{calc(n * 2)}` computes from the pick `{n}` prints.** | 3 | 4 | 5 | 7 | 5.3 | 17.2 | @@ -230,12 +229,12 @@ Shape: T = table, t = template, c = choice. - `sv_SE.person` and `en_US.person` bind the first name and read sex and title through it: `"first": "{.first-name as n}{n.name}"`, `"sex": "{n..sex.name}"`, a title from `{n..sex.title.name}`. - `geo.SE.address` and `geo.US.address` bind the street and read locality, postal code and region through it; the locale `address` categories bind `/geo.XX.address` once. They print it whole as `{a}`, so the country record's format appears once; revise the decision "A locale's `address` restates its country record's format". -- Needs item 2. Every shipped value must still pass its consumer's check before and after item 4. +- Every shipped value must still pass its consumer's check before and after item 4. - Re-pin seeded output in its own commit. ### 4. Draw every `{…}` afresh, keep a pick only by name, and delete `drawGroup` with the fences that held picks implicitly. -- Needs items 2, 3 and 71. After it, `{/person} ({/person.first})` renders two people, as does `{/sv_SE.person as a}{/sv_SE.person as b}{a} & {b}`. `{w} {uppercase(w)}` renders `b G` where `w` is a choice of letters, and `{/city.name}, {/country[SE].name}` and `{/country[SE].name} / {/country[NO].name}` both load. +- Needs items 3 and 71. After it, `{/person} ({/person.first})` renders two people, as does `{/sv_SE.person as a}{/sv_SE.person as b}{a} & {b}`. `{w} {uppercase(w)}` renders `b G` where `w` is a choice of letters, and `{/city.name}, {/country[SE].name}` and `{/country[SE].name} / {/country[NO].name}` both load. - Deletes the token-order rules (`drawsApart`, `readFold`, `branches`, the pairwise replay), the expansion hold fence, `drawGroup`, the own-family fence and the cell-reference fences, and revises the decisions that point here. The remaining draw checks are names, paths through names, cycles and the repeat cap. - Fixes on the way: `{/sel}|{/sel}` panics out of `Fake` today where two draws land on rows whose cells select different rows of another table; it must render. - Rewrites the README's References, Draw group, Correlated fields, Linked tables, Names and "One draw, one spelling" sections; the Linked tables section says which pick's weights govern a family, since the bound row decides. @@ -246,21 +245,13 @@ Shape: T = table, t = template, c = choice. Nothing has shipped, so "no longer paths", "where it used to fail" and "where it used to be an empty string" describe versions no reader can have installed. -### 2. Step up from a row to the row it links to with `..`: `{/city[Oslo]..country.name}` renders `Norway`, and `city[Oslo].country` stays the cell `NO`. - -- `..` goes up one level, to the parent table, and the name after it is that parent's: `{c..country.name}`, and from a locality `{l..municipality..region.name}`. Naming any other table is a load error naming the parent. -- It steps up from a selected row, a drawn row or a name bound to a row. -- After `..`, `.` steps down again: `{c..country.city.name}` is a city of `c`'s country, drawn afresh. -- `.country` after a row keeps reading the link column's cell, so the README's `city[Oslo].country` example stays true. -- A `Fake` path and `--list` take `..` too; `List` keeps advertising direct descents only. - ### 34. Add `{isin()}`, `{cusip()}`, `{aba()}` and `{vin()}`. `isin`: Luhn over letters expanded to digits. `aba`: 3-7-1 weights. `vin`: position 9 over the whole; a sample taking the WMI, since the check sits mid-string. ### 5. Run the nine-seat comprehension panel after the draw restructure, and file what it names. -Needs items 2, 71, 3, 4 and 90. The decision "comprehension floor: every dimension and the overall at 7.0 or above; items 2, 71, 3, 4 and 90 ship with no scoring run, and item 5 scores them" suspends every scoring run and panel until then. +Needs items 71, 3, 4 and 90. The decision "comprehension floor: every dimension and the overall at 7.0 or above; items 71, 3, 4 and 90 ship with no scoring run, and item 5 scores them" suspends every scoring run and panel until then. ### 71. Accept a name as a `calc` operand, so `{calc(n * 2)}` computes from the pick `{n}` prints.