feat: Prosa ist kein Identifier - Link-Taxonomie als Enum, generierte Regionen mit Markern (4.0.0)
Files changed: - .gitea/workflows/ci.yml - AGENTS.md - CHANGES.md - VERSION - instructions/CONTRACT.md - instructions/link-taxonomy.md - instructions/migrations/4.0.0-link-taxonomy.md - instructions/setup-instance.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/blocks.py - tools/chemenu/cli.py - tools/chemenu/commands/cite_cmd.py - tools/chemenu/commands/dist_cmd.py - tools/chemenu/commands/docs_verify.py - tools/chemenu/commands/doctor.py - tools/chemenu/commands/links_cmd.py - tools/chemenu/commands/migrate_cmd.py - tools/chemenu/commands/new_page.py - tools/chemenu/commands/page_ops.py - tools/chemenu/commands/run_budget.py - tools/chemenu/commands/xref.py - tools/chemenu/conventions.py - tools/chemenu/corpus_diff.py - tools/chemenu/frontmatter_io.py - tools/chemenu/kb_collections.py - tools/chemenu/kb_state.py - tools/chemenu/links.py - tools/chemenu/lint_core.py - tools/chemenu/provenance.py - tools/chemenu/sections.py - tools/chemenu/tests/conftest.py - tools/chemenu/tests/test_blocks.py - tools/chemenu/tests/test_cite_cmd.py - tools/chemenu/tests/test_conventions.py - tools/chemenu/tests/test_dist_cmd.py - tools/chemenu/tests/test_doctor.py - tools/chemenu/tests/test_migrate_cmd.py - tools/chemenu/tests/test_new_page.py - tools/chemenu/tests/test_pipeline_l0.py - tools/chemenu/tests/test_types_cmd.py - tools/chemenu/tests/test_xref.py - types/concept.schema.yaml - types/entity.md - types/entity.schema.yaml - types/instruction.schema.yaml - types/type-spec.md - work/link-taxonomy-migration/README.md - work/link-taxonomy-migration/plan.md
This commit is contained in:
1 parent
502971d147
commit
177c7e9ce8
56 files changed
+2692
-750
No files matched your search
@@ -41,7 +41,11 @@ def empty_kb(tmp_path, monkeypatch):
|
||||
for collection in COLLECTIONS:
|
||||
(kb / collection).mkdir(parents=True)
|
||||
(kb / collection / "COLLECTION.md").write_text(
|
||||
f"# kb/{collection}/ - Collection Contract\n", encoding="utf-8"
|
||||
f"---\nprofile: {collection}\n"
|
||||
f"required_by_stack: {'true' if collection == 'sources' else 'false'}\n"
|
||||
"outbound:\n any: [implements, uses, see-also]\n---\n\n"
|
||||
f"# kb/{collection}/ - Collection Contract\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
raw = tmp_path / "raw"
|
||||
raw.mkdir()
|
||||
@@ -76,7 +80,8 @@ def build_wiki(kb):
|
||||
"--set", "summary=A concept created by the pipeline test"])
|
||||
for page in kb.rglob("Pipeline *.md"):
|
||||
finish_page(page)
|
||||
invoke(["xref", "add", "--a", "Pipeline Host", "--b", "Pipeline Concept"])
|
||||
invoke(["xref", "add", "--a", "Pipeline Host", "--b", "Pipeline Concept",
|
||||
"--rel", "implements"])
|
||||
invoke(["index", "rebuild"])
|
||||
|
||||
|
||||
@@ -101,12 +106,23 @@ def test_a_wiki_built_by_the_tools_lints_clean(empty_kb):
|
||||
assert not has_hard_errors(report), f"hard errors after a clean build: {found}"
|
||||
|
||||
|
||||
def test_the_pages_reach_each_other(empty_kb):
|
||||
"""`xref add` is what makes two pages findable from one another; if it and
|
||||
the link checker disagreed, the lint above would report a broken link."""
|
||||
def test_an_edge_points_one_way_and_the_far_end_stops_being_an_orphan(empty_kb):
|
||||
"""`xref add` declares one direction, and that is what the orphan check now
|
||||
measures: reachability.
|
||||
|
||||
It used to assert that *neither* page was an orphan, which only held because
|
||||
`xref add` wrote a mirror edge on the target. With authored directional
|
||||
edges the source of the only edge in a two-page wiki genuinely has nothing
|
||||
pointing at it - so the check reporting it is the check working, not a
|
||||
regression. A real corpus answers this by having entry points that other
|
||||
pages point at."""
|
||||
build_wiki(empty_kb)
|
||||
|
||||
assert run_lint(empty_kb)["orphan_pages"] == []
|
||||
report = run_lint(empty_kb)
|
||||
assert "Pipeline Concept" not in report["orphan_pages"]
|
||||
assert report["orphan_pages"] == ["Pipeline Host"]
|
||||
assert report["broken_links"] == []
|
||||
assert report["dangling_frontmatter_refs"] == []
|
||||
|
||||
|
||||
def test_the_catalog_covers_what_was_created(empty_kb):
|
||||
|
||||
Reference in new issue
Block a user