nested_pages: Katalogtiefe 1 durchgesetzt, layout:-dir validiert, move raeumt geleerte Verzeichnisse - die drei #57-Seiten hochgezogen (schliesst #57)
Files changed: - CHANGES.md - VERSION - kb/CONTRACT.md - kb/entities/projects/kfchou/wiki-skills.md - kb/entities/projects/llm-wiki-skills.md - kb/entities/projects/vanillaflava/wiki-skills-vanillaflava.md - kb/entities/projects/wiki-skills-vanillaflava.md - kb/entities/projects/wiki-skills.md - kb/entities/projects/yugasun/llm-wiki-skills.md - kb/log.md - tools/CONTRACT.md - tools/chemenu/commands/index_build.py - tools/chemenu/commands/page_ops.py - tools/chemenu/kb_scan.py - tools/chemenu/lint_core.py - tools/chemenu/tests/test_index_build.py - tools/chemenu/tests/test_kb_scan.py - tools/chemenu/tests/test_lint.py - tools/chemenu/tests/test_page_ops.py - tools/chemenu/tests/test_type_resolver.py - tools/chemenu/type_resolver.py
This commit is contained in:
@@ -6,6 +6,7 @@ from chemenu.commands.index_build import (
|
||||
SHARD_THRESHOLD,
|
||||
_anchor,
|
||||
build_index,
|
||||
index_rebuild,
|
||||
plan_index,
|
||||
stale_shards,
|
||||
)
|
||||
@@ -202,3 +203,25 @@ def test_scanner_ignores_generated_shards_at_any_depth(kb_dir, plan):
|
||||
|
||||
def test_rebuild_is_idempotent(kb_dir):
|
||||
assert plan_index(kb_dir) == plan_index(kb_dir)
|
||||
|
||||
|
||||
def test_rebuild_warns_about_a_nested_page_without_failing(kb_dir, capsys):
|
||||
"""#57: `group_pages` still folds a nested page into its area silently -
|
||||
that part is unchanged, reporting is the fix - so `index rebuild` warns
|
||||
rather than refusing, and must not raise."""
|
||||
write_page(
|
||||
kb_dir / "entities/projects/someowner/nested-tool.md",
|
||||
{"type": "types/entity.md", "entity_type": "project", "tags": [],
|
||||
"created": "2026-07-25", "modified": "2026-07-25",
|
||||
"related": [], "sources": [], "confidence": 0.8},
|
||||
"\n# nested-tool\n",
|
||||
)
|
||||
index_rebuild(dry_run=False)
|
||||
out = capsys.readouterr().out
|
||||
assert "WARNING" in out
|
||||
assert "nested-tool" in out
|
||||
|
||||
|
||||
def test_rebuild_is_silent_about_a_healthy_tree(kb_dir, capsys):
|
||||
index_rebuild(dry_run=False)
|
||||
assert "WARNING" not in capsys.readouterr().out
|
||||
|
||||
Reference in New Issue
Block a user