Fix false-positive broken-edge findings in ckb-lint graph check
Graph edge endpoints use project-root-absolute paths per Rule C (`/wiki/entities/foo.md`), while the `known` page set is keyed on paths relative to `wiki/`. check_graph compared them directly, so every conformant edge was reported as pointing at a missing page. Add the `/wiki/`-stripped form to the candidate set, matching the normalisation the decision-record check already performs. Bump VERSION 1.6.0 -> 1.6.1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
65b1e422b3
commit
491ca8a15f
3 changed files with 9 additions and 1 deletions
|
|
@ -385,9 +385,16 @@ def check_graph(root, docs):
|
|||
if not value:
|
||||
findings.append(f"graph/edges.json: edge {i} has no `{side}`")
|
||||
continue
|
||||
# Edge paths are project-root-absolute per Rule C
|
||||
# (`/wiki/entities/foo.md`), while `known` holds paths relative to
|
||||
# wiki/. Strip the prefix the same way the decision-record check
|
||||
# above already does, or every conformant edge reads as broken.
|
||||
stripped = value[len("/wiki/"):] if value.startswith("/wiki/") else value.lstrip("/")
|
||||
candidates = {
|
||||
value,
|
||||
value.removesuffix(".md"),
|
||||
stripped,
|
||||
stripped.removesuffix(".md"),
|
||||
f"entities/{value}",
|
||||
f"entities/{value}".removesuffix(".md"),
|
||||
}
|
||||
|
|
|
|||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
1.6.0
|
||||
1.6.1
|
||||
|
|
|
|||
|
|
@ -42,3 +42,4 @@
|
|||
- Graph gained `decided_by` (decision → person) and `affects` (decision → constrained entity) edge types.
|
||||
- Docs updated in both languages (README/README.pl feature + skill sections, MANUAL/MANUAL.pl new §2.D walkthrough and "say this" table rows, ownership table row noting the append-only convention), plus `ckb-init` (scaffold + skill list). Also fixed five stale `cbk-quiz` path references left from the upstream rename.
|
||||
- End-to-end tested on a scratch copy: a sample decision record passes lint clean and exports to OKF conformantly. That test surfaced a real bug in `export_okf.py` — a Rule B log line naming a directory (`wiki/decisions/` (directory)) was being turned into a broken intra-bundle link; `files_to_links` now only linkifies entries that name an actual `.md` file.
|
||||
- Fixed a second bug in `lint_report.py`'s `check_graph`: graph edge endpoints are project-root-absolute per Rule C (`/wiki/entities/foo.md`), but the `known` set holds paths relative to `wiki/`, so every conformant edge was reported as pointing at a missing page. The candidate set now also tries the `/wiki/`-stripped form, matching what the decision-record check already did. Root `VERSION` 1.6.0 → 1.6.1 (patch).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue