diff --git a/context/code/tooling.md b/context/code/tooling.md index f928e605..5c0e04b8 100644 --- a/context/code/tooling.md +++ b/context/code/tooling.md @@ -1055,14 +1055,20 @@ pipeline is also an end-to-end run of improvise's headless product: `import`, week, the path (`entity`, code-maat's own name for it), the area, the kind (prose, code or other), and the lines added and deleted. It also adds two flags to code-maat's `coupling.csv`: `crosses-crate` and `agent-rules`. -4. `improvise import` merges the five CSVs into **one** sparse model, - `repo-stats.improv`. The merge's `File` category names each source. That is - the user's ruling: "Records are already sparse: the model can just leave - null/empty values for columns not in a given CSV file." -5. `improvise script` runs two scripts. The first, generated, makes one records - view per source file, paged to it. The second, `scripts/repo-stats.improvise`, - is checked in. It adds the prose-to-code formula, builds four views and - `export`s each one to `report/*.csv`. +4. `improvise import ` (improvise-lpzu) merges the directory's five CSVs + into **one** sparse model, `repo-stats.improv`. The merge's `File` category + names each source, and the import makes one view per file, named after its + stem and filtered to it. That is the user's ruling: "Records are already + sparse: the model can just leave null/empty values for columns not in a + given CSV file." A record keeps no coordinate in a category its file lacks. +5. `improvise script` runs the checked-in `scripts/repo-stats.improvise`. It + adds the prose-to-code formula, builds four views on top of the per-file + ones and `export`s each to `report/*.csv`. The four names (`By area`, + `By kind`, `Area by week`, `By day`) must never be a file's stem: + `create-view` of an existing name replaces that view silently (gap 17). The + suite's view count, 10, fails if one does. None of the report reads the + merged `Default` view, which can be empty for a typical code-maat pair + (improvise-8jk6.15). 6. The text report is those exports laid out as tables. The code-maat rankings, doc sizes and the coupling flags are added to it. `--json` gives the same data as JSON. @@ -1162,9 +1168,10 @@ names it. category formula is added there. improvise-8jk6.5. 3. **A record that lacks any category's value is skipped.** A merge of CSVs with different headers, which is the user's sparse model, imports **no records**. - Workaround: every CSV is padded with `-` for the categories it lacks. The - padding shows up as a `-` item in each category. improvise-lpzu makes - the import sparse. + Closed by improvise-lpzu, whose sparse import this pipeline now uses. Until + it landed, every CSV was padded with `-` for the categories it lacked. A + related hole is still open: a record with no measure value stores nothing + (improvise-8jk6.14). 4. **An import that skipped records exits 0**, even when it skipped all of them. It saves an empty model and prints only a warning. improvise-8jk6.6. 5. **`set-axis` and `set-page` accept names that do not exist, and exit 0.** An @@ -1178,7 +1185,7 @@ names it. first item selected. That silently filters the view. Every view has to set every category's axis, one `set-axis` line each. improvise-31oe.4. 8. **A view cannot hide a category's column.** A per-file records view shows - every category and measure, including the `-` padding. improvise-31oe.5. + every category and measure in the model. improvise-31oe.5. 9. **`export` of a records view writes the editor's `+cat` and `+` columns.** improvise-8jk6.7. 10. **`export` writes display text.** It uses the view's number format, so the @@ -1195,15 +1202,15 @@ names it. 14. **The saved model opens on the import's `Default` view**, which puts `File` on rows and `area` on columns, and not on the view the script left active. That is improvise-azhb. -15. **No folder import.** The script names the five files. improvise-lpzu is - folder import, and it will also make the per-file views. Both of the - script's steps for these are marked interim. +15. **No folder import.** Closed by improvise-lpzu (PR #314), which this + pipeline now uses. Until it landed, the script named the five files and + generated its own per-file views. 16. **There is no headless output but a file.** `export` writes a CSV, and the tables are laid out in Python. improvise-31oe.7. 17. **`create-view` of an existing name replaces that view, and exits 0.** `Workbook::create_view` inserts into an `IndexMap`, so it overwrites without - a word. It matters here once folder import makes its own per-file views: the - script's interim `create-view` of the same name would replace them. + a word. Folder import makes a view per file stem, so a report view named + like a stem would replace that file's view. improvise-31oe.8. ### The suite diff --git a/context/test-evidence/tooling.md b/context/test-evidence/tooling.md index 33246bf8..54012a12 100644 --- a/context/test-evidence/tooling.md +++ b/context/test-evidence/tooling.md @@ -1843,8 +1843,10 @@ through `checkers.sh repo-stats`: - A crate crossing as "the crates differ", so a crate against no crate counts: the crate-crossing case fails. - `kb.pl` counted as prose: the prose row and the ratio fail. -- The category padding removed: the import skips every record, and both - pipeline runs fail with exit 3. +- The category padding removed: the import skipped every record, and both + pipeline runs failed with exit 3. That rival is retired: folder import + (improvise-lpzu) keeps sparse records, and the padding is gone. The suite + passes 41 of 41 without it. - Months instead of ISO weeks: both week cases fail. - A `warning:` from improvise ignored: the warning-stub case fails. @@ -1879,3 +1881,14 @@ with the traceback. **Also counted now:** `docs/guide.md` as other docs and `.codex/config.toml` as agent docs. The coupling count is 16, not 15: `web/app.js` and `scripts/foo.sh` change together in two commits, the 06-04 one and the rename. + +### The pipeline on folder import — `scripts/repo-stats-test.sh` (improvise-1xfb.5.1) + +Once #314 merged, `improvise import ` replaced the file list, the `-` +padding and the generated per-file views. The suite needed no change of +expectations and still passes 41 of 41. That is the evidence that the sparse +merge aggregates the same numbers the padded one did. The case "the model keeps +a view per file and the report's four" counts 10 views: `Default`, one per file +from the import, and the report's four. So a report view named like a file +stem, which `create-view` would replace silently (improvise-31oe.8), shows up +as 9.