Skip to content

Commit dd4beba

Browse files
hf-kkleinclaude
andcommitted
fix: target the AHB tables' current Formatversion, not a pinned one
AHB_PID_URL pointed at /ahb/FV2604/{pid}. It is the pipeline's single source of truth for AHB deep links: makoralle's markdown serializer formats it directly, and makorele's sequence-diagram renderer splits it on {pid} into the PRE/SUF the viewer HTML bakes in — which the web app reads back as overlay.ahbBase for the clickable PIDs. So one pinned FV froze every generated artifact to the version it happened to be rendered with, and those links rot when the next FV publishes. Point it at /ahb/current/ instead, and guard the constant in test_config.py so it cannot silently regress to a pinned FV. Verified /ahb/current/ serves the PIDs used in the tests (55001, 17115, 19116). The split now yields SUF = "", which the viewer template concatenates, so it is a no-op there. NOTE this does not retro-fix already-rendered artifacts: the dataset's committed viewer HTMLs still carry PRE = ".../ahb/FV2604/". Updating those is a text substitution in the data repo, the same mechanism recolor_sequence_svgs used for the palette work — no re-render, no Vision cost. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent f32966b commit dd4beba

3 files changed

Lines changed: 28 additions & 5 deletions

File tree

src/makoralle/config.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
"""Static configuration constants for makoralle (AHB deep-link URL template)."""
22

33
# Per-Prüfidentifikator deep link to the Hochfrequenz AHB tables.
4-
# FV2604 is the format version; {pid} is the 5-digit Prüfidentifikator.
5-
AHB_PID_URL = "https://ahb-tabellen.hochfrequenz.de/ahb/FV2604/{pid}"
4+
# `current` resolves to whatever the newest published Formatversion is, so links
5+
# in generated artifacts keep working when a new FV lands. Pinning the FV instead
6+
# (this was "FV2604") froze every rendered viewer and markdown file to the version
7+
# it happened to be generated with, and those links go stale without anything
8+
# noticing. {pid} is the 5-digit Prüfidentifikator.
9+
AHB_PID_URL = "https://ahb-tabellen.hochfrequenz.de/ahb/current/{pid}"

unittests/test_config.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import re
2+
3+
from makoralle.config import AHB_PID_URL
4+
5+
6+
def test_ahb_deep_link_is_not_pinned_to_a_formatversion() -> None:
7+
"""AHB links must target `current`, not a frozen Formatversion.
8+
9+
A pinned FV (this was FV2604) freezes every generated viewer and markdown file
10+
to whatever version it was rendered with, and the links rot silently when the
11+
next FV publishes. Both the markdown serializer here and makorele's
12+
sequence-diagram viewer template read this one constant, so this is the single
13+
place the whole pipeline can regress.
14+
15+
The `/FV\\d+/` check is not redundant with the equality above: it also rejects
16+
a value that keeps `current` but reintroduces an FV segment beside it.
17+
"""
18+
assert AHB_PID_URL == "https://ahb-tabellen.hochfrequenz.de/ahb/current/{pid}"
19+
assert not re.search(r"/FV\d+/", AHB_PID_URL)

unittests/test_p15_emit_markdown.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ def test_pid_table_links_each_pid_to_ahb() -> None:
8888
allow_unicode=True,
8989
)
9090
md = yaml_to_markdown(content, has_sequence=True)
91-
assert "https://ahb-tabellen.hochfrequenz.de/ahb/FV2604/17115" in md
92-
assert "[19116](https://ahb-tabellen.hochfrequenz.de/ahb/FV2604/19116)" in md
93-
assert "[19117](https://ahb-tabellen.hochfrequenz.de/ahb/FV2604/19117)" in md
91+
assert "https://ahb-tabellen.hochfrequenz.de/ahb/current/17115" in md
92+
assert "[19116](https://ahb-tabellen.hochfrequenz.de/ahb/current/19116)" in md
93+
assert "[19117](https://ahb-tabellen.hochfrequenz.de/ahb/current/19117)" in md
9494
assert "Prüfidentifikator" in md # table present
9595

9696

0 commit comments

Comments
 (0)