Repository navigation
Description
Part of #14
What is wrong: docs/14-authorization.md, docs/15-keycloak-integration.md and docs/16-data-model.md cite code as file:line. A change to a cited file moves its lines, and the citation then points at other code. No test finds this. Four citations are wrong on main at b83391c, after PR #177 changed main.py, core/docs.py and routers/admin.py.
Where: on b83391c:
docs/14-authorization.md:81citescmapi/src/cmapi/core/docs.py:135-138for the "Requires" line. Those lines holdcodes = list(problems). The "Requires" line is at:143-144.docs/14-authorization.md:128citescmapi/src/cmapi/main.py:87for the token dependency. That line is areturn JSONResponse(...)of an exception handler. The dependency is at:98.docs/14-authorization.md:178citescmapi/src/cmapi/routers/admin.py:78for the environment check of a prune. That line is a field ofKpiDatabase. The check is at:112.docs/15-keycloak-integration.md:103citescmapi/src/cmapi/main.py:62-63for the Swagger UI PKCE settings. They are at:63-64.
The three documents hold 79 such citations (47, 12 and 20). The other 75 are not checked yet.
How to prove it: git show b83391c:cmapi/src/cmapi/core/docs.py | sed -n 135,138p prints no "Requires" text. After the fix, a check in the service suite fails when the text of a cited line range is not the text that was recorded for it, and a change that moves a cited line fails that check until the citation is updated.
Measured or inferred: Measured on 2026-11-13 on macOS, by reading each of the four cited ranges with git show b83391c:<file> | sed -n.
Severity: Low. The documents send a reader to the wrong code. No behaviour of the service is wrong.
What must hold after the fix: Each file:line citation of the three documents points at the code that the sentence names. A check in CI fails when a cited range changes or moves. The check can move a citation by itself when the cited text is at one other place in the file, so the cost of a refactor stays small.
Research: The handover records the cause as a lesson after PR #152 ("Check them after each change to a cited file"), and a rule that a person must remember did not hold for PR #177. Options: (1) cite a symbol and not a line; (2) record a hash of each cited range in a lock file and check it in CI; (3) GitHub permalinks to a commit, which never go stale and never show the current code. Research the options and choose in the pull request.
Solution (inline, not applied): Not written here.
Class: TDT. The documents drifted from the code, and the fix adds the check that stops the drift.
Activity
Records: #144 merged (PR #180), #143 in PR #188, #178 to #187 filed, …
Merge main into doc-citations, and record the citation of core/docs.p…
ephico2real2 commentedon Nov 13, 2026
In-QA: pull request for branch
doc-citations. Measured onmainat8afac6d: 28 of the 89 citations were at other lines than their text, more than the four that this issue named. Each is corrected from history, andscripts/doc-citations.py --checknow runs in the service suite.ephico2real2 commentedon Nov 13, 2026
Done: pull request #192 merged to
mainasea955c0. GitHub Actions run 43511953308 was green on the exact head547ea72(six jobs). 28 of 89 citations were at other lines on8afac6d; each is corrected, andscripts/doc-citations.py --checkruns in the service suite (9 cases prove the script).Records at 22:15Z: #143, #179, #183, #178 merged; #181, #185, #186 in…