- Split TODO into a thin status index plus docs/roadmap/ with one file per task (v0.4 reliability, v0.5 product, v0.6 research, icebox). - Add docs/architecture.md (current processes, packet/data path, layers, storage, metrics) and docs/development.md (rules, gates, DoD). - Add CHANGELOG.md reconstructed from history; move round details out of TODO. - Align docs with the code: config defaults and missing [detect]/ [protocol.http] sections, XDP metric names, ClickHouse table and TTL, Redis RDB restore, multiarch clang include, CLI binary name. - Add scripts/check_docs_links.sh and run it in CI. - release profile: thin LTO + one codegen unit. Binary 12.3 MB -> 9.7 MB, http parser bench 314 ns -> 278 ns; panic=abort stays off for catch_unwind in the Redis subscriber. - Drop the unused JWT role claim; fix 'rampart doctor' hints in the CLI.
47 lines
1.5 KiB
Bash
Executable file
47 lines
1.5 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Verifies that every relative Markdown link in the tracked documentation points
|
|
# at an existing file. External links are not fetched: CI must stay offline and
|
|
# deterministic, and a dead third-party URL is not a repo defect.
|
|
#
|
|
# Usage: bash scripts/check_docs_links.sh
|
|
set -euo pipefail
|
|
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$repo_root"
|
|
|
|
python3 - <<'PY'
|
|
import pathlib
|
|
import re
|
|
import sys
|
|
|
|
ROOTS = ["README.md", "TODO.md", "CHANGELOG.md"]
|
|
ROOTS += [str(p) for p in pathlib.Path("docs").rglob("*.md")]
|
|
ROOTS += [str(p) for p in pathlib.Path("deploy").rglob("*.md")]
|
|
|
|
LINK = re.compile(r"\]\(([^)]+)\)")
|
|
SKIP_PREFIX = ("http://", "https://", "mailto:", "#")
|
|
|
|
missing = []
|
|
for name in sorted(set(ROOTS)):
|
|
path = pathlib.Path(name)
|
|
if not path.is_file():
|
|
continue
|
|
base = path.parent
|
|
for match in LINK.finditer(path.read_text(encoding="utf-8")):
|
|
target = match.group(1).strip()
|
|
# Drop the anchor and an optional title: ](file.md "title")
|
|
target = target.split("#", 1)[0].split(" ", 1)[0]
|
|
if not target or target.startswith(SKIP_PREFIX):
|
|
continue
|
|
resolved = (base / target).resolve()
|
|
if not resolved.exists():
|
|
missing.append(f"{name}: {match.group(1)}")
|
|
|
|
if missing:
|
|
print("Broken documentation links:", file=sys.stderr)
|
|
for item in missing:
|
|
print(f" {item}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
print(f"Documentation links OK ({len(set(ROOTS))} files)")
|
|
PY
|