feat: Autorenkonventionen nach Eigentum geschnitten - kb/CONVENTIONS.md, deklarierte Collections (3.0.0)
CI / verify (push) Successful in 53s
Release / release (push) Successful in 38s

Files changed:
- .gitea/workflows/ci.yml
- .wikitool-kb.json
- AGENTS.md
- CHANGES.md
- INSTALL.md
- README.md
- VERSION
- instructions/CONTRACT.md
- instructions/dev/testing-conventions.md
- instructions/german-terminology.md
- instructions/kb-profiles.md
- instructions/migrations/3.0.0-authoring-conventions.md
- instructions/private-instance.md
- instructions/setup-instance.md
- instructions/wiki-ingest/SKILL.md
- instructions/wiki-manage/SKILL.md
- kb/CONTRACT.md
- kb/CONVENTIONS.md
- kb/CONVENTIONS.md.template
- kb/comparisons/COLLECTION.md
- kb/concepts/COLLECTION.md
- kb/entities/COLLECTION.md
- kb/sources/COLLECTION.md
- tools/CONTRACT.md
- tools/README.md
- tools/chemenu/commands/dist_cmd.py
- tools/chemenu/commands/docs_verify.py
- tools/chemenu/commands/doctor.py
- tools/chemenu/commands/new_page.py
- tools/chemenu/conventions.py
- tools/chemenu/kb_collections.py
- tools/chemenu/kb_scan.py
- tools/chemenu/provenance.py
- tools/chemenu/sections.py
- tools/chemenu/tests/conftest.py
- tools/chemenu/tests/test_conventions.py
- tools/chemenu/tests/test_dist_cmd.py
- tools/chemenu/tests/test_doctor.py
- tools/chemenu/tests/test_new_page.py
- tools/chemenu/tests/test_types_cmd.py
- types/comparison.md
- types/concept.md
- types/entity.md
- types/source.md
- types/type-spec.md
This commit is contained in:
torben committed 2026-09-02 15:02:10 +02:00
1 parent 9843df99d3
commit 502971d147
45 files changed
+1817 -232

No files matched your search

+33 -1
View File
@@ -8,7 +8,7 @@ from pathlib import Path
import pytest
from chemenu import config
from chemenu import config, conventions
from chemenu.commands import doctor, instructions_cmd
@@ -30,6 +30,12 @@ def instance(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
(kb / "log.md").write_text("# Log\n", encoding="utf-8")
(kb / "provenance.md").write_text("# Provenance\n", encoding="utf-8")
(kb / "CONTRACT.md").write_text("# kb contract\n", encoding="utf-8")
(kb / "CONVENTIONS.md").write_text(
"---\nlanguage: en\nprofile: none\nsections:\n"
" relationships: Relationships\n see_also: See Also\n footnotes: Footnotes\n"
"---\n\n# conventions\n",
encoding="utf-8",
)
(root / "VERSION").write_text("0.1.0\n", encoding="utf-8")
(root / "USER.md").write_text("# USER.md - Fixture\n", encoding="utf-8")
(root / "SOUL.md").write_text("# SOUL.md - Fixture\n", encoding="utf-8")
@@ -194,6 +200,32 @@ def test_a_renamed_but_unfilled_template_fails(instance):
assert "template" in next(c.detail for c in checks if c.name == "personalization")
def test_conventions_are_ok_when_declared(instance):
checks = doctor.run_doctor()
assert _status(checks, "conventions") == "OK"
assert "Relationships" in next(c.detail for c in checks if c.name == "conventions")
def test_missing_conventions_fail(instance):
"""Unlike `ENVIRONMENT.md`, this one is not optional: `xref add` and
`cite add` write headings out of it, so an instance without it is being
answered by whatever the stack hardcoded before the file existed."""
(config.KB_DIR / conventions.CONVENTIONS_FILENAME).unlink()
checks = doctor.run_doctor()
assert _status(checks, "conventions") == "FAIL"
assert "missing" in next(c.detail for c in checks if c.name == "conventions")
def test_conventions_with_an_incomplete_sections_block_fail(instance):
"""Present and deciding nothing - the same failure mode the personalization
sentinel check exists for, one directory down."""
(config.KB_DIR / conventions.CONVENTIONS_FILENAME).write_text(
"---\nlanguage: en\nsections:\n relationships: Relationships\n---\n", encoding="utf-8"
)
conventions.reset_cache()
assert _status(doctor.run_doctor(), "conventions") == "FAIL"
def test_environment_is_ok_when_absent(instance):
"""The file is optional, so absence is a healthy end state - a FAIL here
would make it mandatory through the back door."""