Answer prose round 1 and product-owner round 1: modules not packages, goal 13 split, the decisions item 77 ends, and a manifest naming every default it reaches

This commit is contained in:
2026-10-04 22:10:23 +02:00
committed by Lillem4n
parent 90be0ee6d8
commit eee7572360
3 changed files with 26 additions and 20 deletions
+12 -13
View File
@@ -889,8 +889,7 @@ Where the project is heading; the sections before Audience document what ships t
1. It covers the ten most-spoken languages and the Nordic countries. 1. It covers the ten most-spoken languages and the Nordic countries.
2. Each locale covers the common categories: names, addresses, phone numbers, ids, 2. Each locale covers the common categories: names, addresses, phone numbers, ids,
companies and dates. companies and dates.
3. A library gets only the data and functions it hands to `New`, and fejkdata's own 3. A library gets only the data and the module functions it is handed.
load the same way as anyone else's.
3. **The code is easy to understand.** 3. **The code is easy to understand.**
1. You can go from a bug to the code behind it without asking anyone. 1. You can go from a bug to the code behind it without asking anyone.
2. You can change one part without keeping the rest in your head. 2. You can change one part without keeping the rest in your head.
@@ -919,35 +918,35 @@ Where the project is heading; the sections before Audience document what ships t
1. A template that could render a value its own rules forbid, such as `NaN` or `Inf`, 1. A template that could render a value its own rules forbid, such as `NaN` or `Inf`,
fails to load instead. fails to load instead.
2. Data that reads something nobody provided fails to load, and the error names the 2. Data that reads something nobody provided fails to load, and the error names the
package that provides it by default. module that provides it by default, or says that none does.
7. **One command gets you a value.** 7. **One command gets you a value.**
1. Flags work like in other command-line tools, and can go anywhere on the line. 1. Flags work like in other command-line tools, and can go anywhere on the line.
2. Your first template of your own needs no escaping and no options. 2. Your first template of your own needs no escaping and no options.
3. The CLI fills in what you leave out with a sane default: all the shipped data, the 3. The CLI fills in what you leave out with a sane default: all the shipped data, the
system's randomness and today's date. system's randomness and today's date.
8. **Data is JSON files and TSV tables. Code is only for what they can't express.** 8. **Data is JSON files and TSV tables. Code is only for what they can't express.**
9. **Everything is replaceable.** Data, functions, and the packages they depend on can 9. **Everything is replaceable.** Data, functions and the modules they come in can come
come from fejkdata or anyone else. from fejkdata or anyone else.
1. A package names the packages it reads by default, and anything providing the same 1. A module names the modules it reads by default, and anything providing the same
paths can stand in for one. paths can stand in for one.
2. Loading two things under one name fails, in the library and the CLI alike, unless 2. Loading two things under one name fails, in the library and the CLI alike, unless
you say the second replaces the first. you say the second replaces the first.
3. The template language's own functions stay in the core, so a template means the 3. The builtins ship with fejkdata itself, so a template means the same in every
same in every program. program.
4. A function loaded from a package can ask for the input it needs, and gets the 4. A function loaded from a module can ask for the input it needs, and gets the
randomness and the date the generator uses. randomness and the date the generator uses.
5. A CLI carrying your own packages is a few lines of Go, and works just like 5. A CLI carrying your own modules is a few lines of Go, and works just like
`fejkdata`. `fejkdata`.
10. **The same seed, version and data always give the same output.** 10. **The same seed, version and data always give the same output.**
1. A library call takes everything that can change its output from its caller: data, 1. In the library, the caller supplies everything that can change the output: data,
randomness and the date. randomness and the date.
11. **It depends on nothing but Go's standard library.** 11. **It depends on nothing but Go's standard library.**
12. **The docs are a map of the template language.** 12. **The docs are a map of the template language.**
1. Every feature has its own heading. 1. Every feature has its own heading.
2. Every example runs as a test and shows its output. 2. Every example runs as a test and shows its output.
3. Each rule is stated in one place. 3. Each rule is stated in one place.
13. **It is fast enough that you never notice with the shipped data, and its cost grows 13. **It is fast enough that you never notice it with the shipped data.**
with the data a render reaches, not with all the data loaded.** 1. A render's cost grows only with the data it reaches.
14. **Every fact comes from an official or open source,** such as a government 14. **Every fact comes from an official or open source,** such as a government
register. register.
1. A table holds every row its source holds, and nothing added by hand. 1. A table holds every row its source holds, and nothing added by hand.
+4
View File
@@ -134,6 +134,8 @@ set, against goal 13, until `todo.md` item 79 ends it.
Valid while CI proves the shipped set whole and each category alone. Valid while CI proves the shipped set whole and each category alone.
Works against goal 2.3 until `todo.md` item 77 ends it.
## A bare reference draws each time; a reference path is held ## A bare reference draws each time; a reference path is held
2026-09-02, Lilleman auf Larv. 2026-09-02, Lilleman auf Larv.
@@ -231,6 +233,8 @@ references read. Accepted: overriding is the point of layering, the error names
reference and the field, and the fix is the consumer's file carrying the fields the reference and the field, and the fix is the consumer's file carrying the fields the
shipped tree reads. shipped tree reads.
Works against goal 9.2 until `todo.md` item 77 ends it.
## The repeat cap bounds renders, not bytes ## The repeat cap bounds renders, not bytes
2026-09-02, Lilleman auf Larv. 2026-09-02, Lilleman auf Larv.
+10 -7
View File
@@ -54,6 +54,7 @@
| 12.2 | 0.45 | | 12.2 | 0.45 |
| 12.3 | 0.45 | | 12.3 | 0.45 |
| 13 | 0.40 | | 13 | 0.40 |
| 13.1 | 0.40 |
| 14 | 0.35 | | 14 | 0.35 |
| 14.1 | 0.35 | | 14.1 | 0.35 |
| 15 | 0.30 | | 15 | 0.30 |
@@ -146,14 +147,14 @@
### 77. Split the shipped data into Go modules per locale and country, which a library imports by choice, and embed every one in the CLI. ### 77. Split the shipped data into Go modules per locale and country, which a library imports by choice, and embed every one in the CLI.
The CLI binary carries every module and may grow to hundreds of MB; a library imports only what it uses, as it imports any dependency, and nothing is fetched at run time. The maintainer decided on 2026-10-04, under goals 2.3, 6.2, 7.3, 9 and 10.1: The CLI binary may grow to hundreds of MB. The maintainer decided on 2026-10-04, under goals 2.3, 6.2, 7.3, 9 and 10.1:
- One module per locale, one per country's `geo/` tree, and one for `misc`. A module registers nothing when imported. - One module per locale, one per country's `geo/` tree, and one for `misc`. A module registers nothing when imported.
- A bare `New()` loads no data, and its error names the option to add. `WithoutShippedData` goes. - A bare `New()` loads no data and fails, naming the option to add. `WithoutShippedData` goes.
- A data module is an `fs.FS` passed to `WithDataFS`, as anyone's data is, and several load at once. A module carrying functions loads through an option of its own; gaining one is a breaking change for that module's users. - A data module is an `fs.FS` passed to `WithDataFS`, as anyone's data is, and `New` takes several. A module carrying functions loads through an option of its own, so a data module that starts carrying functions breaks its users.
- A module names, in a manifest, what it reads and the module providing each by default. Nothing loads a default on its own: loading fails naming it, and anything providing the same paths stands in. - A module names, in a manifest, every module it reads by default, directly or through another, so the first error names the whole set to import. Nothing loads a default on its own: loading fails naming it, and anything providing the same paths stands in.
- Two sources defining one name fail to load, unless an option says the second replaces the first. The CLI's `--data-path` takes `--replace` to override a shipped category. This revises the decisions "A `--data-path` override rebinds every reference to the category it replaces" and "With only the shipped set, a category loads on the first call reaching it; beside a `--data-path`, every category loads in `New`". - Two sources defining one name fail to load, unless an option says the second replaces the first. In the CLI, a flag standing on its own, benched with the data and hand fixture authors, does the same for a `--data-path`, so flags still go anywhere on the line. This revises the decisions "A `--data-path` override rebinds every reference to the category it replaces" and "With only the shipped set, a category loads on the first call reaching it; beside a `--data-path`, every category loads in `New`".
- The template language's builtins stay in the core. A module's function asks for the inputs it needs through one generic mechanism, and gets the randomness and the date the generator uses. The README strongly encourages functions with no side effects of their own. - The builtins stay in fejkdata itself. A module's function asks for the inputs it needs through one generic mechanism, and gets the randomness and the date the generator uses. The README asks for functions with no side effects of their own.
- The CLI is a library call, so a custom CLI carrying other modules is a few lines of Go and works just like `fejkdata`. A README section shows it with example code. - The CLI is a library call, so a custom CLI carrying other modules is a few lines of Go and works just like `fejkdata`. A README section shows it with example code, and the README's Library quick start shows the whole import block for one locale.
Split it into items before starting. Before the module API ships, a panel of the README's audience personas tries pulling in data with it. Split it into items before starting. Before the module API ships, a panel of the README's audience personas tries pulling in data with it.
@@ -264,6 +265,8 @@ Needs item 4.
### 79. Beside a `--data-path`, load in `New` the user's categories, the shipped ones they override or read, and the shipped ones whose reads reach an overridden one; load the rest on first reach. ### 79. Beside a `--data-path`, load in `New` the user's categories, the shipped ones they override or read, and the shipped ones whose reads reach an overridden one; load the rest on first reach.
Needs item 77, which makes an override fail unless it says it replaces.
The decision "With only the shipped set, a category loads on the first call reaching it; beside a `--data-path`, every category loads in `New`" parses the whole shipped set on every `--data-path` run, about 45 ms today and seconds once items 61 and 78 land. Goal 6 needs only the user's categories, the shipped ones they override, the shipped ones they read, and the shipped ones whose reads reach an overridden category, so the index would carry each category's reads. The decision "With only the shipped set, a category loads on the first call reaching it; beside a `--data-path`, every category loads in `New`" parses the whole shipped set on every `--data-path` run, about 45 ms today and seconds once items 61 and 78 land. Goal 6 needs only the user's categories, the shipped ones they override, the shipped ones they read, and the shipped ones whose reads reach an overridden category, so the index would carry each category's reads.
### 87. Split the README's last Records paragraph into one paragraph per rule, name the two shapes "either shape" means, and define or replace "a field hold". ### 87. Split the README's last Records paragraph into one paragraph per rule, name the two shapes "either shape" means, and define or replace "a field hold".