From 449e8e3233c253a09e80ba1ee0038e17851423cf Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 5 Oct 2026 21:14:14 +0200 Subject: [PATCH] Answer prose round 1 and product-owner round 1: plainer walk, link and ancestor comments, a complexity rule that reads one way, shorter items 115 and 116, and a cycle through a cell filed under item 115 --- AGENTS.md | 2 +- docs/decisions.md | 6 +++--- graph.go | 8 ++++---- table.go | 8 ++++---- todo.md | 12 ++++++------ 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5160ba1..3a96aa5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,7 +24,7 @@ before paraphrasing it, and name the register you read before claiming none publishes a spelling. - A README example is a `json` block that loads and renders as a category; `readme_test.go` runs every one. -- Cyclomatic complexity is gated at 14. A function that would pass it is decomposed; a table-shaped dispatch at 14, one case per kind, stays whole. +- Cyclomatic complexity is gated at 14. Split a function that would go over it, except a table-shaped dispatch at 14, a switch with one case per kind of its input, which stays whole. # Decisions diff --git a/docs/decisions.md b/docs/decisions.md index 048d9fb..5e0e143 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -827,7 +827,7 @@ Valid while names are read only inside the category binding them. ## comprehension floor: every dimension and the overall at 7.0 or above; item 5 scores the restructure, which ships unscored: every `{…}` drawing afresh, the moves into `internal/`, cutting a template's pointer to its table, and items 102 and 104 to 106 -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. The hardest units were the draw fences, which the change making every `{…}` draw afresh deleted. The restructure deletes or moves what the earlier chunks of the below-floor round touched. It is three things: the change making every `{…}` draw afresh; the moves of the draw state, the grammar, `DataType`, what a proof knows of a value, the builtins and the reading of data files into `internal/`; and the untangling of the engine's own structs: the change that set a table's path where it compiles, linked a table family in one function and labelled a cell from the walk, and `todo.md` items 102 and 104 to 106. The maintainer approved these three, and `AGENTS.md`'s comprehension rule lets them merge below the floor. A scoring run before item 106 merges would score code about to go; for that reason the calc change accepting a name as an operand shipped unscored on 2026-10-05. 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 `todo.md` item 5 runs. +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. The hardest units were the draw fences, which the change making every `{…}` draw afresh deleted. The restructure deletes or moves what the earlier chunks of the below-floor round touched. It is three things: the change making every `{…}` draw afresh; the moves of the draw state, the grammar, `DataType`, what a proof knows of a value, the builtins and the reading of data files into `internal/`; and the untangling of the engine's own structs, which is the change cutting a template's pointer to its table plus `todo.md` items 102 and 104 to 106. The maintainer approved these three, and `AGENTS.md`'s comprehension rule lets them merge below the floor. A scoring run before item 106 merges would score code about to go; for that reason the calc change accepting a name as an operand shipped unscored on 2026-10-05. 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 `todo.md` item 5 runs. ## The template engine stays the root package until item 107; what reads no engine type sits in `internal/`, and item 102 moves a table's rows there @@ -839,8 +839,8 @@ each value one writer would spread that knot across packages, behind forwarding every public method. The draw state, the grammar, `DataType`, what a proof knows of a value, the builtins and the reading of data files read no engine type, so each sits in a package under `internal/`, behind the import list `imports_test.go` checks. Item -102 removes a table's rows' reads of engine types, moves the rows into `internal/rows` and -adds it to that list. Valid until `todo.md` item 107 moves the engine. +102 stops a table's rows reading engine types, moves them into `internal/rows`, and adds +that package to the list. Valid until `todo.md` item 107 moves the engine. ## Goal 5.1's `{…}` covers `{{`, `}}` and a lone `}`, so the goal names no escape diff --git a/graph.go b/graph.go index 76f905f..d9ddb5f 100644 --- a/graph.go +++ b/graph.go @@ -8,10 +8,10 @@ import ( "github.com/larvit/fejkdata/internal/invariant" ) -// eachNode visits n and every node contained within it once, passing the label naming -// each in an error: the dot path reaching it, and a table cell's line after it. It never -// crosses a reference edge — a {/path} reference is skipped — so a single inline node is -// walked on its own. +// eachNode visits n and every node inside it once, passing fn the label an error names each +// by: the dot path reaching it, then ", line N" for a table cell. It never crosses a +// reference edge — a {/path} reference is skipped — so a single inline node is walked on +// its own. func eachNode(n node, label string, fn func(label string, n node) error) error { seen := map[node]bool{} var visit func(string, node) error diff --git a/table.go b/table.go index 7029075..47b7808 100644 --- a/table.go +++ b/table.go @@ -382,7 +382,7 @@ func refuseTableBinding(toks []grammar.Token) error { return nil } -// linkTables links every table to its parent beside it, the one writer of parentT and +// linkTables links each table to the parent beside it; it is the only writer of parentT and // children. func linkTables(sites []categorySite) error { for _, s := range sites { @@ -404,7 +404,7 @@ func linkTables(sites []categorySite) error { } // proveParent is the table among siblings that t's link column names, proved: it has a key, -// every link cell is one, every row of it is linked to, and its ancestors pass checkAncestors. +// every link cell is one, and every row of it is linked to; checkAncestors proves the rest. // docs/decisions.md#a-parent-row-with-no-child-row-is-a-load-error func (t *table) proveParent(siblings map[string]node) (*table, error) { name := t.header[t.parentIndex] @@ -436,8 +436,8 @@ func (t *table) proveParent(siblings map[string]node) (*table, error) { return p, nil } -// checkAncestors proves the chain of parents from p, t's parent, closes nowhere, and holds no -// column named like t. +// checkAncestors refuses a cycle in the chain of parents from p, t's parent, and an ancestor +// with a column named like t. func (t *table) checkAncestors(p *table, siblings map[string]node) error { var ancestors []*table for q, seen := p, map[*table]bool{t: true}; q != nil; q, _ = siblings[q.header[q.parentIndex]].(*table) { diff --git a/todo.md b/todo.md index 1009488..0934939 100644 --- a/todo.md +++ b/todo.md @@ -118,7 +118,7 @@ | 13 | 0.3.0 | defect | **Place xlsx cells by their `r` reference in `data-import/xlsx.py`.** | 2 | 2 | 3 | 6 | 4 | 13.7 | | 39 | 0.3.0 | | **Stop the `columnKinds` suggestion naming a field's own kind or a narrower one.** | 1 | 2 | 3 | 6 | 6 | 13.5 | | 51 | 0.3.0 | | **Spell a table one way across the errors that name it.** | 1 | 2 | 3 | 6 | 6 | 13.5 | -| 115 | 0.3.0 | | **Spell a rows file's line one way in every error, naming the file: today a cell reads `g.t.b, line 3`, a cell check `t.tsv: line 3, b` and a link `t.tsv line 3`.** | 1 | 2 | 3 | 6 | 6 | 13.5 | +| 115 | 0.3.0 | | **Spell a rows file's line one way in every error, naming the file.** | 1 | 2 | 3 | 6 | 6 | 13.5 | | 10 | 0.3.0 | | **Test that every node kind reaches each switch over node kinds.** | 1 | 3 | 2 | 6 | 3.2 | 13.1 | | 11 | 0.3.0 | | **Test that every `geo` tree holds the five table names and the `address` columns that port across countries.** | 1 | 2 | 3 | 5 | 4 | 13.0 | | 35 | 0.3.0 | | **Add `{base64url(n)}` for JWT shapes.** | 1 | 2 | 4 | 5 | 8 | 13.0 | @@ -133,7 +133,7 @@ | 72 | 0.3.0 | principle | **Fail the merge gate when test coverage falls below the last recorded figure.** | 2 | 3 | 2 | 5 | 3 | 10.2 | | 43 | 0.3.0 | | **Call `templateError` a compile failure in its doc.** | 1 | 1 | 1 | 5 | 3.3 | 9.8 | | 95 | 0.3.0 | principle | **Hold a struct's columns and the field each fills in one slice.** | 1 | 2 | 1 | 5 | 3.2 | 9.5 | -| 116 | 0.3.0 | | **Turn a row index into its rows file's line in one function, where eleven sites add 2 today.** | 1 | 2 | 1 | 5 | 3.2 | 9.5 | +| 116 | 0.3.0 | | **Turn a row index into its rows file's line in one function.** | 1 | 2 | 1 | 5 | 3.2 | 9.5 | | 19 | 0.3.0 | | **Fill the 398 Swedish localities weighted 200 from SCB småorter.** | 2 | 4 | 4 | 6 | 14 | 9.2 | | 56 | 0.3.0 | defect | **Build on a manual run of `test.yml`.** | 1 | 1 | 1 | 4 | 1 | 8.8 | | 109 | 0.3.0 | principle | **Indent every script under `data-import/` with hard tabs, as `AGENTS.md` requires and `release-tooling/` does.** | 2 | 4 | 1 | 4 | 3 | 6.2 | @@ -423,9 +423,9 @@ An `int64` or `float64` field unproven in range is told to become itself, and a `pinRow` names `t.path` and `mustRow` panics with `t.category`, so one table is `territory` and `misc.territory`, and the short spelling names no file where two folders hold that name. -### 115. Spell a rows file's line one way in every error, naming the file: today a cell reads `g.t.b, line 3`, a cell check `t.tsv: line 3, b` and a link `t.tsv line 3`. +### 115. Spell a rows file's line one way in every error, naming the file. -The cell's label names the category and column but not the TSV the line is in. +Today a cell reads `g.t.b, line 3` (`namedNode.labelIn`), a cell check `t.tsv: line 3, b` (`checkCells`) and a link `t.tsv line 3` (`proveParent`). A reference cycle found from a table's format through a cell names no line at all: `reference cycle: g.t -> format -> b -> b -> /h -> …`, where the column-to-cell step in `renderEdges` repeats the column name. ### 10. Test that every node kind reaches each switch over node kinds. @@ -467,9 +467,9 @@ Its doc says render failure, and it wraps what `NewTemplate` and `NewRecordTempl `structShape.columns` and `structShape.fieldIndexes` pair up by index alone, against the technical principle "one owner per value". -### 116. Turn a row index into its rows file's line in one function, where eleven sites add 2 today. +### 116. Turn a row index into its rows file's line in one function. -`namedNode`'s cell line in `graph.go` and ten sites in `table.go` each add the header line and the one-based count. Item 102 moves the rows into `internal/rows`; the function goes with them. +Today `namedNode`'s cell line in `graph.go` and each error in `table.go` add the header line and the one-based count. Item 102 moves the rows into `internal/rows`; the function goes with them. ### 56. Build on a manual run of `test.yml`.