stack: TOC-Pflicht fuer Referenzdateien ueber 100 Zeilen (docs toc); session-setup.md/gates.md nennen die tatsaechliche Budget-Ausnahmeliste (schliesst #73, #76)
Files changed: - AGENTS.md - CHANGES.md - VERSION - instructions/CONTRACT.md - instructions/capture-session.md - instructions/claude-code-model-selection.md - instructions/dev/issue-tracking.md - instructions/dev/testing-conventions.md - instructions/dev/version-parts.md - instructions/evolve-subtypes.md - instructions/gates.md - instructions/german-terminology.md - instructions/ingest-large-tree.md - instructions/kb-profiles.md - instructions/link-taxonomy.md - instructions/mcp-read-server.md - instructions/migrate-corpus.md - instructions/migrations/3.0.0-authoring-conventions.md - instructions/migrations/4.0.0-link-taxonomy.md - instructions/private-instance.md - instructions/session-setup.md - instructions/setup-instance.md - kb/CONTRACT.md - kb/CONVENTIONS.md - kb/concepts/COLLECTION.md - raw/CONTRACT.md - tools/CONTRACT.md - tools/chemenu/commands/docs_verify.py - tools/chemenu/commands/instructions_cmd.py - tools/chemenu/tests/test_docs_verify.py - tools/chemenu/tests/test_instructions_cmd.py - tools/chemenu/tests/test_toc.py - tools/chemenu/toc.py - types/type-spec.md
This commit is contained in:
1 parent
a51d7a322f
commit
2c4c2b1c7c
34 files changed
+929
-15
No files matched your search
@@ -353,6 +353,14 @@ def test_verify_raises_when_content_is_ignored(monkeypatch):
|
||||
# --- issue references in shipped documents -----------------------------------
|
||||
|
||||
|
||||
def test_every_reference_files_toc_is_current():
|
||||
"""Forward direction, against the real tree: every file `toc.target_files()`
|
||||
covers must already carry the region `wikitool docs toc --apply` would
|
||||
write - this is what a session forgetting to re-run it after adding a
|
||||
heading is caught by."""
|
||||
assert docs_verify.check_toc_regions() == []
|
||||
|
||||
|
||||
def test_no_shipped_document_cites_an_issue():
|
||||
"""Forward direction, against the real tree: a `#42` in a file `dist export`
|
||||
ships points at a board only the origin repo has, and the reader of a
|
||||
@@ -374,8 +382,9 @@ def test_a_cited_issue_number_is_reported(monkeypatch):
|
||||
|
||||
|
||||
def test_a_markdown_anchor_is_not_an_issue_reference(monkeypatch):
|
||||
"""The reason this check can be a bare pattern at all: a link anchor and a
|
||||
heading are word characters, so neither collides with `#<digits>`."""
|
||||
"""An ordinary heading's slug is word characters, so it never collides
|
||||
with `#<digits>` in the first place - this pins that the lookbehind
|
||||
exclusion does not accidentally start matching it either."""
|
||||
monkeypatch.setattr(
|
||||
docs_verify,
|
||||
"shipped_prose",
|
||||
@@ -390,6 +399,38 @@ def test_a_markdown_anchor_is_not_an_issue_reference(monkeypatch):
|
||||
assert docs_verify.check_no_issue_references() == []
|
||||
|
||||
|
||||
def test_a_numbered_heading_anchor_is_not_an_issue_reference(monkeypatch):
|
||||
"""A table-of-contents entry for a numbered step (`toc.py`) anchors on
|
||||
the number itself - `#2-fix-the-fidelity-before-writing-a-word` - unlike
|
||||
an ordinary heading's slug, which starts with a letter. The bare
|
||||
`#\\d+` pattern would flag that as citing issue #2; the lookbehind
|
||||
excludes exactly the `](#...` link-fragment shape it appears in."""
|
||||
monkeypatch.setattr(
|
||||
docs_verify,
|
||||
"shipped_prose",
|
||||
lambda: {
|
||||
"instructions/example.md": (
|
||||
"# Heading\n"
|
||||
"- [2. Fix the fidelity before writing a word](#2-fix-the-fidelity-before-writing-a-word)\n"
|
||||
)
|
||||
},
|
||||
)
|
||||
assert docs_verify.check_no_issue_references() == []
|
||||
|
||||
|
||||
def test_a_parenthesized_issue_number_is_still_reported(monkeypatch):
|
||||
"""The lookbehind excludes `](#...`, not bare `(#...` - a real citation
|
||||
written as a plain parenthetical must still be caught."""
|
||||
monkeypatch.setattr(
|
||||
docs_verify,
|
||||
"shipped_prose",
|
||||
lambda: {"instructions/example.md": "A rule (#66).\n"},
|
||||
)
|
||||
issues = docs_verify.check_no_issue_references()
|
||||
assert len(issues) == 1
|
||||
assert "#66" in issues[0]
|
||||
|
||||
|
||||
def test_python_source_is_out_of_scope():
|
||||
"""The scope decision, pinned: `tools/` ships as runtime machinery, and a
|
||||
code comment addresses whoever edits that line - which only ever happens in
|
||||
|
||||
Reference in new issue
Block a user