Make great documentation goal 1.2, and plan the README's reorganisation and the nested-template gaps #33

Open
lilleman wants to merge 966 commits from worktree-todo-relative-dates-exact-counts into main
3 changed files with 36 additions and 42 deletions
Showing only changes of commit 7acb2136ec - Show all commits
+2 -3
View File
@@ -73,7 +73,7 @@ In [docs/decisions.md](docs/decisions.md):
- After a row, a path names a column or a linked table - 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 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 link column after a row steps up to the parent row, and a path may not end on it
- A selector names a row by its key alone - 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 - 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 - The choice-of-rows fence guards a data file's root, and requires string fields
- A table is a record of string columns - A table is a record of string columns
@@ -94,7 +94,6 @@ In [docs/decisions.md](docs/decisions.md):
- A title is a table under `sex` - A title is a table under `sex`
- A table owns the spelling of a selector on it - A table owns the spelling of a selector on it
- No builtin reads the clock, so a date is bounded by days, never by an age - No builtin reads the clock, so a date is bounded by days, never by an age
- A name column without a key resolves inside its parent
- `misc` is what every locale shares - `misc` is what every locale shares
- A register's canonical spelling loses to the one its domain writes - A register's canonical spelling loses to the one its domain writes
- `misc.territory` is the spine, and a `misc` table naming a territory links to it - `misc.territory` is the spine, and a `misc` table naming a territory links to it
@@ -103,7 +102,7 @@ In [docs/decisions.md](docs/decisions.md):
- `misc.port` selects by number, and carries no `name` - `misc.port` selects by number, and carries no `name`
- `misc.car` is one flat table, not a make linked to its models - `misc.car` is one flat table, not a make linked to its models
- `misc.territory` names its sovereign in a column, and there is no `misc.country` table - `misc.territory` names its sovereign in a column, and there is no `misc.country` table
- `misc.loglevel` is a table keyed by the code, rendering POSIX's keyword - `misc.loglevel` is a table keyed by POSIX's keyword, carrying the code
- `misc.tld` keys carry the leading dot, where other tables key on a bare code - `misc.tld` keys carry the leading dot, where other tables key on a bare code
- `misc.tld` is a table of its own, and `misc.territory.tld` stays a column - `misc.tld` is a table of its own, and `misc.territory.tld` stays a column
- `misc.territory` carries a currency code, it does not link to `misc.currency` - `misc.territory` carries a currency code, it does not link to `misc.currency`
+17 -17
View File
@@ -385,8 +385,8 @@ parent. A row is selected or drawn alike.
- Where a segment follows, the link column's name reads the parent row, one level per - 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` step, chained: `city[Oslo].country.name` renders `Norway`, `locality.municipality.name`
the drawn locality's municipality, and `geo.SE.locality[Lund].municipality.region.name` the drawn locality's municipality, and
Lund's region. `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 - 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 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 of `{name} ({alpha2})`, `city[Oslo].country` names `city[Oslo].country.alpha2` and
@@ -404,13 +404,21 @@ Checked against three simulated template writers from the Audience: all three re
parent row where a segment followed, and they split between the code and the name where parent row where a segment followed, and they split between the code and the name where
the path ended. the path ended.
## A selector names a row by its key alone ## A table selects by one key column, a code, never a free-form name
Decided 2026-09-27 by the maintainer, for goal 4's one spelling per result; valid while Decided 2026-09-27 by the maintainer, for goal 4's one spelling per result; valid while
every table either has a `key` or names its rows inside a parent. A table with a `key` the key is the code a user writes, as a database keys a table. `country[NO]` loads, and
selects by it alone: `country[NO]` loads, and `country[Norway]` is refused naming `country[Norway]` is refused naming `[NO]`, found by the row whose cell spells the
`[NO]`, found by the row whose cell spells the selector. A table with no `key` selects by selector. The key is the friendliest code the register holds, `misc.territory[SE]` and
its `name` inside its parent, which is the key it has. `misc.currency[EUR]`, and only where it holds none an id the import assigns and never
moves to another row. There is no `name` option.
- `misc.loglevel` keys on the keyword, `[err]`, which a configuration writes.
- `misc.tld` keys on the ASCII form, `[.xn--p1ai]`, the one DNS carries.
- `geo.US.locality` keys on the Census GEOID, `[1714000]` for Chicago.
- `geo.SE.locality` keys on an assigned id: a postort has no code of its own.
- A name table, `first-name`, `last-name` and `title`, carries no key, so it is drawn
from and never selected.
## A parent row with no child row is a load error ## A parent row with no child row is a load error
@@ -546,8 +554,7 @@ are a curated proportion rather than bearers anyone counted.
A reference reaches a table by a path that carries no selector — `sv_SE.person.first` A reference reaches a table by a path that carries no selector — `sv_SE.person.first`
reads `first-name` through `sex` — so the walk that resolved a name cannot say where a reads `first-name` through `sex` — so the walk that resolved a name cannot say where a
reader would type one. The table's own location can, which is why it keeps its path, and reader would type one. The table's own location can, which is why it keeps its path, and
why an ambiguity error names `sv_SE.sex[f].first-name[Kim]` rather than the table's own why an error names `geo.SE.municipality[1281]` rather than `municipality[1281]`.
name.
## No builtin reads the clock, so a date is bounded by days, never by an age ## No builtin reads the clock, so a date is bounded by days, never by an age
@@ -555,13 +562,6 @@ An `age(min,max)` would make a seeded fixture change with the day it runs on, wh
what a seed exists to prevent; a birthdate for someone 20 to 60 is what a seed exists to prevent; a birthdate for someone 20 to 60 is
`date(1966-01-01,2006-12-31,…)`, re-pinned as any fixture is. `date(1966-01-01,2006-12-31,…)`, re-pinned as any fixture is.
## A name column without a key resolves inside its parent
A given name both sexes carry is a row under each, so `name` cannot be the key; the
parent's row tells the two apart, `sex[f].first-name[Kim]`, the ambiguity error spells
each row inside its parent, and a name repeating inside one parent row is refused at
load, since nothing could then select it.
## `misc` is what every locale shares ## `misc` is what every locale shares
A category whose facts differ by country belongs in that country's locale, read from the A category whose facts differ by country belongs in that country's locale, read from the
@@ -627,7 +627,7 @@ own family; a test proves every value names a row instead. A territory the regis
records no state for stands alone, which is `EH` alone, and naming one for it would be a records no state for stands alone, which is `EH` alone, and naming one for it would be a
claim fejkdata has no business making. claim fejkdata has no business making.
## `misc.loglevel` is a table keyed by the code, rendering POSIX's keyword ## `misc.loglevel` is a table keyed by POSIX's keyword, carrying the code
A flat list of names carries neither the code a PRI encodes nor a selector reaching it, A flat list of names carries neither the code a PRI encodes nor a selector reaching it,
and goal 3 draws the two as one fact. The canonical spelling losing to the one its and goal 3 draws the two as one fact. The canonical spelling losing to the one its
+17 -22
View File
@@ -178,23 +178,28 @@ by a `data-import/` script, as README goal 12 asks.
cell `NO`, as `locality.municipality` does, which `List` stops advertising. Replace the cell `NO`, as `locality.municipality` does, which `List` stops advertising. Replace the
README's `city[Oslo].country` example with README's `city[Oslo].country` example with
`fejkdata -d ./mydata 'city[Oslo].country.name'`, rendering `Norway`. `fejkdata -d ./mydata 'city[Oslo].country.name'`, rendering `Norway`.
- Select a row by its key alone, as the decision "A selector names a row by its key - Key every table as the decision "A table selects by one key column, a code, never a
alone" states, once the open question on each table's key is settled: free-form name" states: `geo.SE.municipality[Lund]` and `misc.territory[Sweden]` select
`geo.SE.municipality[Lund]` and `misc.territory[Sweden]` select a row today. a row today.
- Have a selector that misses name the key of every row whose cell spells it, - Have a selector that misses name the key of every row whose cell spells it,
matched without case, else say the table selects by its key: matched without case, else say the table selects by its key:
`misc.territory[Sweden]` and `misc.territory[se]` name `[SE]`, `misc.protocol[tcp]` `misc.territory[Sweden]` and `misc.territory[se]` name `[SE]`, `misc.protocol[tcp]`
its key, and `misc.loglevel[Error]` the row a column spells `Error` in. its key, and `misc.loglevel[Error]` `[err]`.
- Refuse a `name` option beside `key`, which then selects nothing, drop it from the - Delete the `name` option, and the load checks it carries: a name spelling another
shipped tables, and delete the load check refusing a name that spells another row's row's key, and a name repeating inside its parent.
key. - Key `misc.loglevel` on `keyword`, and `geo.SE.locality` on an id `data-import/geo-se.py`
assigns and keeps across imports, linking `street` and `postal-code` by it.
- Drop `key` from `last-name` and `sv_SE.title`.
- Rewrite what selects by name: in README.md, "selected by key or name", - Rewrite what selects by name: in README.md, "selected by key or name",
`misc.currency[Euro]`, "selects by either spelling", `misc.tld[.рф]`, `misc.currency[Euro]`, "selects by either spelling", `misc.tld[.рф]`,
`misc.loglevel[err]` and "the code and the keyword do", the `geo` table's "by code `misc.loglevel[3]`, `misc.loglevel[err]` and "the code and the keyword do", the `geo`
or name", "by USPS abbreviation or name" and "by GEOID or name", table's "by code or name", "by USPS abbreviation or name", "by GEOID or name" and
`geo.SE.region[Skåne län]`, `geo.US.region[IL].locality[Springfield]`, "selection by "by name", `geo.SE.locality[Lund]`, `geo.SE.region[Skåne län]`,
name", the `name` option's paragraph and "`[key]` or `[name]`"; in CHANGELOG.md, "a `geo.US.region[IL].locality[Springfield]`, "selection by name",
path selects a row by key or name", "a name spelling another row's key" and `first-name[Taylor]`, `first-name[Kim]`, `sv_SE.title[dr]`, the `name` option's
paragraph and "`[key]` or `[name]`"; `locality[Lund]` in docs/decisions.md; in
CHANGELOG.md, "a path selects a row by key or name", "a name spelling another row's
key", "a name repeating inside one parent row", "A `name` without a `key`" and
`misc.tld[.рф]`. `misc.tld[.рф]`.
- Render selected rows as the decision "A selected row is fixed, not drawn, and an - Render selected rows as the decision "A selected row is fixed, not drawn, and an
unnamed read beside it is refused" states: `New` refuses unnamed read beside it is refused" states: `New` refuses
@@ -238,16 +243,6 @@ by a `data-import/` script, as README goal 12 asks.
### Open questions to settle ### Open questions to settle
- Decide which spelling each shipped table selects by, now a selector names its key
alone. Keeping today's key loses `geo.US.region[IL].locality[Springfield]` to a
numeric GEOID, `misc.loglevel[err]` to `[3]`, `misc.tld[.рф]` to `[.xn--p1ai]`,
`misc.currency[Euro]`, `misc.protocol`'s second spelling and
`geo.SE.region[Skåne län]`. The tables carrying both today: `geo.SE` and `geo.US`
region, municipality and US locality, `misc` currency, httpstatus, language,
loglevel, mimetype, protocol, territory and tld, and both locales' `sex`. Decide too
whether the `name` option, left meaning "the key inside a parent", keeps its name.
Record each answer in `docs/decisions.md`, amending the `misc.tld` and `misc.loglevel`
entries it changes.
- Decide whether a goal 5 violation joins the comprehension gate's exception list: the - Decide whether a goal 5 violation joins the comprehension gate's exception list: the
`{/sel}|{/sel}` panic waits behind the whole round at 5.9, and `{/sel}|{/sel}` panic waits behind the whole round at 5.9, and
`{/geo.SE.locality}|{/geo.SE.municipality}` mispairs the shipped data meanwhile, though a `{/geo.SE.locality}|{/geo.SE.municipality}` mispairs the shipped data meanwhile, though a