fix: stale wiki/ path literals nach kb/ nachgezogen, mit Test-Guard gegen die naechste Umbenennung
Files changed: - CHANGES.md - VERSION - kb/entities/projects/Chemenu.md - kb/log.md - tools/chemenu/commands/_util.py - tools/chemenu/commands/cite_cmd.py - tools/chemenu/commands/git_publish.py - tools/chemenu/commands/log_append.py - tools/chemenu/commands/page_ops.py - tools/chemenu/commands/provenance_cmd.py - tools/chemenu/commands/raw_cmd.py - tools/chemenu/commands/run_budget.py - tools/chemenu/commands/touch.py - tools/chemenu/commands/xref.py - tools/chemenu/frontmatter_io.py - tools/chemenu/lint_core.py - tools/chemenu/tests/test_log_append.py - tools/chemenu/tests/test_source_hygiene.py - tools/chemenu/tests/test_touch.py - tools/chemenu/tests/test_type_resolver.py - tools/chemenu/type_resolver.py - tools/wikitool - types/type-spec.md - types/type-spec.schema.yaml
This commit is contained in:
1 parent
aa31d431fc
commit
24cd221b21
24 files changed
+154
-36
No files matched your search
@@ -179,7 +179,7 @@ def rel_path(path: Path) -> str:
|
||||
|
||||
|
||||
def check_collision(name: str) -> None:
|
||||
"""Fail if any page under wiki/ already has `name` as its filename stem.
|
||||
"""Fail if any page under kb/ already has `name` as its filename stem.
|
||||
|
||||
The stem *is* the page title and wikilinks resolve by title alone, so two
|
||||
files sharing a stem in different directories are indistinguishable to
|
||||
|
||||
@@ -38,7 +38,7 @@ app = typer.Typer(help="Manage [^cite-id] footnote citations and their Footnotes
|
||||
|
||||
def _find_page(pages: dict[str, Page], title: str) -> Page:
|
||||
if title not in pages:
|
||||
fail(f"No page titled '{title}' found under wiki/.")
|
||||
fail(f"No page titled '{title}' found under kb/.")
|
||||
return pages[title]
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ def cite_add(
|
||||
pages = load_kb_pages(config.KB_DIR)
|
||||
page = _find_page(pages, page_title)
|
||||
if source not in pages:
|
||||
fail(f"No page titled '{source}' found under wiki/ - citing a page that doesn't exist would be a dangling reference.")
|
||||
fail(f"No page titled '{source}' found under kb/ - citing a page that doesn't exist would be a dangling reference.")
|
||||
|
||||
marker_id, new_body, changed = upsert_citation(page, source, file)
|
||||
marker = f"[^{marker_id}]"
|
||||
@@ -159,7 +159,7 @@ def sync_page(page: Page) -> tuple[str, bool, list[str], list[str]]:
|
||||
@app.command("sync")
|
||||
def cite_sync(
|
||||
page_title: Optional[str] = typer.Option(None, "--page", help="Sync just this page"),
|
||||
all_pages: bool = typer.Option(False, "--all", help="Sync every page under wiki/"),
|
||||
all_pages: bool = typer.Option(False, "--all", help="Sync every page under kb/"),
|
||||
dry_run: bool = typer.Option(False, "--dry-run", help="Report what would change instead of writing"),
|
||||
):
|
||||
"""Prune orphan Footnotes definitions and re-render each page's block in
|
||||
|
||||
@@ -14,7 +14,7 @@ whose push failed leaves a real, unpushed commit sitting on the branch, and
|
||||
the next `publish` now pushes it instead of reporting "Nothing to commit"
|
||||
forever.
|
||||
|
||||
Also implements the Mass-Update Gate (wiki/concepts/Mass-Update Gate.md):
|
||||
Also implements the Mass-Update Gate (kb/concepts/workflows/Mass-Update Gate.md):
|
||||
a push to origin/main is the one action in this system with a real,
|
||||
irreversible external effect (publicly visible commit history, possible CI
|
||||
triggers, other clients pulling). Small/normal publishes (< threshold
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Append correctly-formatted entries to wiki/log.md."""
|
||||
"""Append correctly-formatted entries to kb/log.md."""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
@@ -10,7 +10,7 @@ import typer
|
||||
from chemenu import config
|
||||
from chemenu.commands._util import fail, rel_path, success, today_iso
|
||||
|
||||
app = typer.Typer(help="Manage wiki/log.md.")
|
||||
app = typer.Typer(help="Manage kb/log.md.")
|
||||
|
||||
VALID_OPS = ["ingest", "query", "lint", "create", "update", "delete", "rename", "move"]
|
||||
|
||||
@@ -74,7 +74,7 @@ def log_status():
|
||||
`lint` - the deterministic trigger for the Maintenance Schedule's "every
|
||||
10 sources" full-lint cadence. Read-only."""
|
||||
if not config.LOG_FILE.exists():
|
||||
success("No wiki/log.md yet; nothing logged.")
|
||||
success("No kb/log.md yet; nothing logged.")
|
||||
return
|
||||
entries = parse_log_entries(config.LOG_FILE.read_text(encoding="utf-8"))
|
||||
count = ingests_since_last_lint(entries)
|
||||
|
||||
@@ -236,7 +236,7 @@ def rename_command(
|
||||
if references_only:
|
||||
if new not in pages:
|
||||
fail(
|
||||
f"Neither '{old}' nor '{new}' is a page under wiki/. Repointing references "
|
||||
f"Neither '{old}' nor '{new}' is a page under kb/. Repointing references "
|
||||
f"to '{new}' would just move the dangling reference; create the page first "
|
||||
"with `wikitool new ...`, or drop the reference with `wikitool xref remove`."
|
||||
)
|
||||
@@ -316,7 +316,7 @@ def rm_command(
|
||||
pages = load_kb_pages(config.KB_DIR)
|
||||
target = pages.get(page_title)
|
||||
if target is None:
|
||||
fail(f"No page titled '{page_title}' found under wiki/.")
|
||||
fail(f"No page titled '{page_title}' found under kb/.")
|
||||
|
||||
inbound = inbound_pages(pages, page_title)
|
||||
if inbound and not yes:
|
||||
@@ -404,7 +404,7 @@ def move_command(
|
||||
None, "--page", help="Exact title of the page to move to its computed location"
|
||||
),
|
||||
reconcile: bool = typer.Option(
|
||||
False, "--reconcile", help="Move every page under wiki/ that is not at its computed location"
|
||||
False, "--reconcile", help="Move every page under kb/ that is not at its computed location"
|
||||
),
|
||||
dry_run: bool = typer.Option(False, "--dry-run", help="List what would move without writing"),
|
||||
):
|
||||
@@ -475,7 +475,7 @@ def move_command(
|
||||
|
||||
target = pages.get(page_title)
|
||||
if target is None:
|
||||
fail(f"No page titled '{page_title}' found under wiki/.")
|
||||
fail(f"No page titled '{page_title}' found under kb/.")
|
||||
|
||||
type_path = target.frontmatter.get("type")
|
||||
if not type_path:
|
||||
|
||||
@@ -171,7 +171,7 @@ def build_provenance_index(kb_dir: Path, raw_dir: Path) -> str:
|
||||
|
||||
@app.command("rebuild-index")
|
||||
def rebuild_index(
|
||||
dry_run: bool = typer.Option(False, "--dry-run", help="Print the result instead of writing wiki/provenance.md"),
|
||||
dry_run: bool = typer.Option(False, "--dry-run", help="Print the result instead of writing kb/provenance.md"),
|
||||
):
|
||||
content = build_provenance_index(config.KB_DIR, config.RAW_DIR)
|
||||
provenance_file = config.KB_DIR / "provenance.md"
|
||||
|
||||
@@ -382,7 +382,7 @@ def raw_accept_command(
|
||||
pages = load_kb_pages(config.KB_DIR)
|
||||
target_page = pages.get(page)
|
||||
if target_page is None:
|
||||
fail(f"No page titled '{page}' found under wiki/. Create it first, or omit --page.")
|
||||
fail(f"No page titled '{page}' found under kb/. Create it first, or omit --page.")
|
||||
existing_rel = source_raw_files(target_page)
|
||||
if not existing_rel:
|
||||
fail(
|
||||
|
||||
@@ -7,7 +7,7 @@ This closes the gap documented in AGENTS.md's "Gates" section: unlike a
|
||||
prompt instruction ("stop after N steps"), this check runs
|
||||
in-process on every `wikitool` invocation and cannot be skipped by the
|
||||
calling agent "politely trying again". It mirrors the Mass-Update Gate
|
||||
pattern (see git_publish.py / wiki/concepts/Mass-Update Gate.md), but that
|
||||
pattern (see git_publish.py / kb/concepts/workflows/Mass-Update Gate.md), but that
|
||||
gate is scoped to the *size* of a single publish, while this one is scoped to
|
||||
*iteration volume* across a whole session (e.g. a wiki-ingest or wiki-lint run
|
||||
that could otherwise loop unbounded over many entity/concept pages).
|
||||
|
||||
@@ -232,7 +232,7 @@ def touch_command(
|
||||
pages = load_kb_pages(config.KB_DIR)
|
||||
page = pages.get(page_title)
|
||||
if page is None:
|
||||
fail(f"No page titled '{page_title}' found under wiki/. Create it first with `wikitool new ...`.")
|
||||
fail(f"No page titled '{page_title}' found under kb/. Create it first with `wikitool new ...`.")
|
||||
|
||||
type_path = page.frontmatter.get("type")
|
||||
if not type_path:
|
||||
|
||||
@@ -37,7 +37,7 @@ app = typer.Typer(help="Manage bidirectional cross-references between wiki pages
|
||||
|
||||
def _find_page(pages: dict[str, Page], name: str) -> Page:
|
||||
if name not in pages:
|
||||
fail(f"No page titled '{name}' found under wiki/. Create it first with `wikitool new ...`.")
|
||||
fail(f"No page titled '{name}' found under kb/. Create it first with `wikitool new ...`.")
|
||||
return pages[name]
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user