diff --git a/CHANGES.md b/CHANGES.md index 57fc2f0..79165cc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -59,7 +59,7 @@ concern - readable here, never shipped as something to parse. --- -## 7.1.0-beta.30 - 2026-09-26 - new: concept/source record notes name their layout-computed subdirectory; source usage names its required fields (Gitea #150) +## 7.1.0-beta.31 - 2026-09-26 - new_page/type_resolver comments no longer claim only entities declare a layout: **Author:** Torben Nehmer @@ -99,18 +99,27 @@ concern - readable here, never shipped as something to parse. - gates.md and a run_budget comment name kb pages by title, not by a path that moved - cli.py: removed a stale duplicate help-patch line outside the typer._click fallback's try (Gitea #148) - new: concept/source record notes name their layout-computed subdirectory; source usage names its required fields (Gitea #150) +- new_page/type_resolver comments no longer claim only entities declare a layout: +### new_page/type_resolver comments no longer claim only entities declare a layout: + +Two code comments - `new_page.py`'s module docstring and `TypeResolver.get_layout`'s - still said +subtype-driven placement applied to "currently just entities", the same stale assumption behind +the `new` record's flat `concept`/`source` paths. They now name the four shipped type-specs that +declare a `layout:`. A test docstring that claimed to run `new source`'s `usage` line verbatim +now says what the test does: it passes the fields that line names. Comments only. + ### new: concept/source record notes name their layout-computed subdirectory; source usage names its required fields (Gitea #150) -The `new`-command's `cli_contract` record promised `kb/concepts/.md` and +`new`'s `cli_contract` record promised `kb/concepts/.md` and `kb/sources/Source - .md` for the `concept` and `source` variants - flat, with no subdirectory. Both type-specs have carried a `layout:` for a while (`concept_type`/`source_type` picks the area, same rule an entity or a project already follows), so the actual path is `kb/concepts//.md` and `kb/sources//Source - .md`. Nothing wrote a page to the wrong place - `new` computes the path itself - but the record is exactly what an agent reads to find one afterwards, and it was wrong: `instructions/gates.md` named two concept -pages by their old flat path (fixed above) with the record itself as the plausible source of that +pages by their old flat path (fixed in the gates.md entry further down) with the record itself as the plausible source of that assumption. Both notes now name the subdirectory and where it comes from; `comparison`'s note was checked against `types/comparison.md` and left alone; it genuinely has no `layout:`. diff --git a/VERSION b/VERSION index cbc4b30..d4cc798 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.1.0-beta.30 +7.1.0-beta.31 diff --git a/tools/chemenu/commands/new_page.py b/tools/chemenu/commands/new_page.py index 54c80f5..0ba75bf 100644 --- a/tools/chemenu/commands/new_page.py +++ b/tools/chemenu/commands/new_page.py @@ -15,8 +15,8 @@ A schema `default:` is materialized only for a field the schema also lists in `required:` - an optional field's default is a reader-side assumption (what a missing field means), and writing it into every scaffolded page would turn that assumption into a stated claim instead (Gitea #109). -Directory placement for subtype-driven types (currently just entities) also -comes from the type-spec, via its `layout:` frontmatter (see +Directory placement for subtype-driven types (in the shipped specs: entity, +concept, source and project) also comes from the type-spec, via its `layout:` frontmatter (see `TypeResolver.get_layout`) - not a hand-maintained Python dict. """ from __future__ import annotations diff --git a/tools/chemenu/tests/test_new_page.py b/tools/chemenu/tests/test_new_page.py index 79d31b0..543c803 100644 --- a/tools/chemenu/tests/test_new_page.py +++ b/tools/chemenu/tests/test_new_page.py @@ -775,8 +775,9 @@ def test_new_concept_path_matches_its_record_note(monkeypatch, kb_dir): def test_new_source_path_matches_its_record_note_and_its_usage_is_runnable(monkeypatch, kb_dir): """Also #150's second finding: the `usage` line itself omitted `source_type`/`fidelity`/`authority` and could never succeed as written. - Running the corrected `usage` verbatim (substituting ``/``/etc.) - is the test that it now can.""" + The call below passes exactly the fields the corrected `usage` names, + with valid values for its placeholders - it does not parse the `usage` + string itself.""" monkeypatch.setenv("WIKI_AUTHOR", "Torben") name = "gateway.example.net" _fixture_raw_file(monkeypatch, kb_dir, "raw/notes/gateway.example.net.md") diff --git a/tools/chemenu/type_resolver.py b/tools/chemenu/type_resolver.py index 6091e9a..62b9fbf 100644 --- a/tools/chemenu/type_resolver.py +++ b/tools/chemenu/type_resolver.py @@ -306,7 +306,8 @@ class TypeResolver: need a hand-maintained `entity_type -> subdirectory` Python dict. Only types with subtype-driven directory placement declare a - `layout:` (currently just `types/entity.md`); returns None for types + `layout:` (in the shipped specs: `types/entity.md`, `types/concept.md`, + `types/source.md`, `types/project.md`); returns None for types that don't (e.g. `types/comparison.md`, which has a single flat directory regardless of subtype).