docs: audit links, glossary, readability pass #2

Open
eSlider wants to merge 9 commits from docs/improvement into main
15 changed files with 23 additions and 20 deletions
Showing only changes of commit b4de3ed076 - Show all commits
+1 -1
View File
@@ -11,7 +11,7 @@ Write **caveman-full** by default. See [`CONTRIBUTING.md`](../CONTRIBUTING.md#ca
## Test ## Test
- [ ] `pytest tests/ -q` (if code touched) - [ ] `pytest tests/ -q` (if code touched)
- [ ] `python scripts/check_docs.py` (if docs touched) - [ ] `python bin/check_docs.py` (if docs touched)
- [ ] ADR added if boundary/contract changed - [ ] ADR added if boundary/contract changed
## Links ## Links
+2 -2
View File
@@ -37,10 +37,10 @@ jobs:
run: pip install --quiet pyyaml run: pip install --quiet pyyaml
- name: ADR immutability (no edits to accepted records) - name: ADR immutability (no edits to accepted records)
run: python scripts/check_adrs.py --base origin/main run: python bin/check_adrs.py --base origin/main
- name: Documentation rules (links, glossary, readability) - name: Documentation rules (links, glossary, readability)
run: python scripts/check_docs.py run: python bin/check_docs.py
verify: verify:
name: Verify simulator name: Verify simulator
+1 -1
View File
@@ -17,7 +17,7 @@ The CI pipeline enforces this:
| Gate | When it runs | | Gate | When it runs |
| --- | --- | | --- | --- |
| `python scripts/check_docs.py` | Every push/PR (`docs-verify` job) — links, glossary anchors, readability rules ([ci-rules](docs/improvement/ci-rules.md)) | | `python bin/check_docs.py` | Every push/PR (`docs-verify` job) — links, glossary anchors, readability rules ([ci-rules](docs/improvement/ci-rules.md)) |
| `pytest tests/` | Every push/PR (`verify` job) | | `pytest tests/` | Every push/PR (`verify` job) |
| `RUN pytest tests/` in the simulator Docker build | Every `docker build` — a red test blocks the image | | `RUN pytest tests/` in the simulator Docker build | Every `docker build` — a red test blocks the image |
| Smoke flight + DuckDB assertion | Every push/PR | | Smoke flight + DuckDB assertion | Every push/PR |
+1 -1
View File
@@ -166,7 +166,7 @@ def _line_no(text: str, index: int) -> int:
def run_checks(warnings_as_errors: bool = False) -> int: def run_checks(warnings_as_errors: bool = False) -> int:
rules = load_rules(ROOT / "scripts/docs_rules.yaml") rules = load_rules(RULES_PATH)
anchor_cache: dict[Path, set[str]] = {} anchor_cache: dict[Path, set[str]] = {}
all_errors: list[str] = [] all_errors: list[str] = []
all_warnings: list[str] = [] all_warnings: list[str] = []
@@ -1,4 +1,4 @@
# Documentation rules enforced by CI (scripts/check_docs.py). # Documentation rules enforced by CI (bin/check_docs.py).
# See docs/improvement/ci-rules.md for rationale and PR workflow. # See docs/improvement/ci-rules.md for rationale and PR workflow.
markdown_paths: markdown_paths:
+1 -1
View File
@@ -63,7 +63,7 @@ Manual pass over `docs/`, all READMEs, and glossary. Goal: correct links, unify
## Suggested CI checks (for issue #1) ## Suggested CI checks (for issue #1)
Implemented in [`scripts/check_docs.py`](../../scripts/check_docs.py) — see [ci-rules.md](ci-rules.md). Implemented in [`bin/check_docs.py`](../../bin/check_docs.py) — see [ci-rules.md](ci-rules.md).
## Files touched ## Files touched
+1 -1
View File
@@ -15,7 +15,7 @@ Issues, PRs, and reviews default to **caveman-full** ([`CONTRIBUTING.md`](../../
## CI automation ## CI automation
Enforced in Gitea Actions (`docs-verify` job). Rules live in [`scripts/docs_rules.yaml`](../../scripts/docs_rules.yaml); see [ci-rules.md](ci-rules.md). Enforced in Gitea Actions (`docs-verify` job). Rules live in [`bin/docs_rules.yaml`](../../bin/docs_rules.yaml); see [ci-rules.md](ci-rules.md).
Originally tracked in [issue #1](https://git.produktor.io/eSlider/swarm-house/issues/1). Originally tracked in [issue #1](https://git.produktor.io/eSlider/swarm-house/issues/1).
+6 -6
View File
@@ -2,7 +2,7 @@
Automated checks for markdown in this repository. Enforced on every **pull request** and on **push to `main`** (including docs-only pushes that skip the simulator gate). Automated checks for markdown in this repository. Enforced on every **pull request** and on **push to `main`** (including docs-only pushes that skip the simulator gate).
Implementation: [`scripts/check_docs.py`](../../scripts/check_docs.py) reads [`scripts/docs_rules.yaml`](../../scripts/docs_rules.yaml). Implementation: [`bin/check_docs.py`](../../bin/check_docs.py) reads [`bin/docs_rules.yaml`](../../bin/docs_rules.yaml).
Workflow: [`.github/workflows/release.yaml`](../../.github/workflows/release.yaml) job **`Verify documentation`**. Workflow: [`.github/workflows/release.yaml`](../../.github/workflows/release.yaml) job **`Verify documentation`**.
@@ -46,13 +46,13 @@ Docs-only changes therefore still get link and glossary validation on `main`; th
## Local run ## Local run
```bash ```bash
python scripts/check_docs.py python bin/check_docs.py
python scripts/check_adrs.py --base origin/main python bin/check_adrs.py --base origin/main
python scripts/check_docs.py --warnings-as-errors # treat section-link warnings as failures python bin/check_docs.py --warnings-as-errors # treat section-link warnings as failures
``` ```
## Changing rules ## Changing rules
1. Edit `scripts/docs_rules.yaml` (paths, banned targets, preferred anchors). 1. Edit `bin/docs_rules.yaml` (paths, banned targets, preferred anchors).
2. Adjust `scripts/check_docs.py` only when adding a new rule *type*. 2. Adjust `bin/check_docs.py` only when adding a new rule *type*.
3. Add a row to the table above and mention it in the audit/improvement record if the change is significant. 3. Add a row to the table above and mention it in the audit/improvement record if the change is significant.
+1 -1
View File
@@ -1 +1 @@
{"root":["./src/App.tsx","./src/main.tsx","./src/sim.ts"],"version":"5.9.3"} {"root":["./src/App.tsx","./src/live.ts","./src/main.tsx","./src/sim.ts","./src/vite-env.d.ts"],"version":"5.9.3"}
+1
View File
@@ -0,0 +1 @@
+2 -2
View File
@@ -1,4 +1,4 @@
"""Tests for scripts/check_adrs.py — ADR immutability gate.""" """Tests for bin/check_adrs.py — ADR immutability gate."""
from __future__ import annotations from __future__ import annotations
@@ -8,7 +8,7 @@ from pathlib import Path
import pytest import pytest
SCRIPTS = Path(__file__).resolve().parents[2] / "scripts" SCRIPTS = Path(__file__).resolve().parents[2] / "bin"
sys.path.insert(0, str(SCRIPTS)) sys.path.insert(0, str(SCRIPTS))
from check_adrs import find_modified_adrs, run_check # noqa: E402 from check_adrs import find_modified_adrs, run_check # noqa: E402
+3 -3
View File
@@ -1,4 +1,4 @@
"""Tests for scripts/check_docs.py — documentation CI rules.""" """Tests for bin/check_docs.py — documentation CI rules."""
from __future__ import annotations from __future__ import annotations
@@ -7,7 +7,7 @@ from pathlib import Path
import pytest import pytest
SCRIPTS = Path(__file__).resolve().parents[2] / "scripts" SCRIPTS = Path(__file__).resolve().parents[2] / "bin"
sys.path.insert(0, str(SCRIPTS)) sys.path.insert(0, str(SCRIPTS))
from check_docs import ( # noqa: E402 from check_docs import ( # noqa: E402
@@ -57,7 +57,7 @@ def test_broken_link_detected(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -
docs.mkdir() docs.mkdir()
(docs / "00-glossary.md").write_text("# Glossary\n\n## Data & storage\n") (docs / "00-glossary.md").write_text("# Glossary\n\n## Data & storage\n")
(docs / "bad.md").write_text("See [missing](missing.md).\n") (docs / "bad.md").write_text("See [missing](missing.md).\n")
rules = tmp_path / "scripts" rules = tmp_path / "bin"
rules.mkdir() rules.mkdir()
(rules / "docs_rules.yaml").write_text( (rules / "docs_rules.yaml").write_text(
"markdown_paths:\n - docs/**/*.md\n" "markdown_paths:\n - docs/**/*.md\n"
+1
View File
@@ -0,0 +1 @@
+1
View File
@@ -0,0 +1 @@