Merge RB-32 — add the missing language-switcher row to the CIBG gap register
ADR-C-008: 9 files carried a CIBG-GAP EXTENSION marker against 8 register rows. language-switcher had a well-formed marker and no row. Adds the row, plus an optional ~14-line drift guard in check-tokens.sh that diffs the marker set against the register and fails naming any missing row, so this drift cannot silently reoccur. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> # Conflicts: # docs/project/refactor-backlog-setup/refactor-backlog/99-backlog.md
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
# RB-32 — add the missing `language-switcher` row to the CIBG gap register
|
||||
|
||||
Status: **implemented** · 2026-08-28 · Source finding: `06-adr-conformance.md`
|
||||
ADR-C-008 · `99-backlog.md` RB-32 · Depends on
|
||||
`implementation/adr-c-007.md` (the same file, left one row short on purpose,
|
||||
filed forward as this ticket)
|
||||
|
||||
## What was wrong
|
||||
|
||||
ADR-0003 §Consequences' final bullet requires every `// CIBG-GAP EXTENSION:`
|
||||
marker in code to have a row in `libs/shared/docs/cibg-gaps.mdx`, "so it's
|
||||
auditable rather than silently drifting." `libs/shared/src/layout/language-switcher/
|
||||
language-switcher.component.ts:7-9` carries a full, well-formed marker
|
||||
("Taal instellen" — no vendored Huisstijl class ships for it — see
|
||||
`cibg-gaps.mdx`) but the register table had no row for it.
|
||||
|
||||
## Verified before editing
|
||||
|
||||
```
|
||||
grep -rln "CIBG-GAP EXTENSION" apps libs --include=*.ts | wc -l # 9
|
||||
```
|
||||
|
||||
Nine files carry the marker: `debug-state`, `language-switcher`, `wizard-shell`,
|
||||
`application-link`, `placeholder-chip`, `rich-text-editor`, `skeleton`,
|
||||
`spinner`, `status-badge`. The register table had 8 rows, and `language-switcher`
|
||||
was the one missing — matching ADR-C-008's finding exactly, re-verified rather
|
||||
than trusted from the finding's own snapshot (per this ticket's DoD point 1, and
|
||||
per `adr-c-007.md`'s own note that it left this exact row for a later ticket).
|
||||
|
||||
## What changed
|
||||
|
||||
One row added to `libs/shared/docs/cibg-gaps.mdx`'s register table, matching the
|
||||
existing rows' two-column shape (component name, closest CIBG concept, reason —
|
||||
wording taken from the component's own marker comment, not invented):
|
||||
|
||||
| Component | Closest CIBG concept | Why hand-rolled |
|
||||
| ------------------- | -------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `language-switcher` | Taal instellen | No vendored Huisstijl class ships for it; a small hand-rolled surface built from the token bridge. |
|
||||
|
||||
No other row was touched. The 8 existing rows were each re-checked against their
|
||||
component's current marker comment while the file was open; none needed a change.
|
||||
|
||||
## Optional CI script: taken
|
||||
|
||||
ADR-C-008 flags a ~10-line `grep -l CIBG-GAP | diff`-style script folded into
|
||||
`check:tokens` as an explicitly optional second step. It is genuinely small and
|
||||
fits the existing script's shape, so `scripts/check-tokens.sh` gained one more
|
||||
guard after its existing hardcoded-colour check:
|
||||
|
||||
```bash
|
||||
gap_register='libs/shared/docs/cibg-gaps.mdx'
|
||||
markers=$(grep -rl 'CIBG-GAP EXTENSION' apps libs --include='*.component.ts' | xargs -n1 dirname | xargs -n1 basename | sort -u)
|
||||
rows=$(grep -oP '^\| `\K[^`]+' "$gap_register" | sort -u)
|
||||
missing=$(comm -23 <(echo "$markers") <(echo "$rows"))
|
||||
if [ -n "$missing" ]; then
|
||||
echo "$missing"
|
||||
echo "FAIL: CIBG-GAP EXTENSION marker(s) with no row in $gap_register"
|
||||
exit 1
|
||||
fi
|
||||
echo 'OK: every CIBG-GAP EXTENSION marker has a cibg-gaps.mdx row'
|
||||
```
|
||||
|
||||
The marker's component directory basename (`dirname` of the flagged file,
|
||||
`.component.ts` files only) is compared against the table's backtick-quoted
|
||||
first column, extracted with `grep -oP`. This matches for all 9 current
|
||||
markers, including the two rows with a parenthetical suffix
|
||||
(`` `wizard-shell` (error summary only) ``, `` `application-link` (non-navigating
|
||||
row) ``) — the regex stops at the closing backtick, before the parenthetical.
|
||||
|
||||
**Verified working, not just written.** Added a scratch component
|
||||
(`libs/shared/src/ui/scratch-gap-test/scratch-gap-test.component.ts`, a single
|
||||
`// CIBG-GAP EXTENSION:` line plus a dummy export) with no matching row. Ran
|
||||
`bash scripts/check-tokens.sh`: failed with exit 1, printing `scratch-gap-test`
|
||||
and the expected `FAIL:` line. Deleted the scratch file and its directory (`rm`,
|
||||
not `git checkout` — it was never tracked). Re-ran the script: passed, exit 0.
|
||||
`git status` confirms no trace of the scratch file remains.
|
||||
|
||||
## Verification
|
||||
|
||||
- `npm run check:tokens` (includes the new guard): passes — 9 markers, 9 rows,
|
||||
after the register row was added.
|
||||
- `npm run ci`: result and step count reported in the implementing agent's final
|
||||
answer.
|
||||
- No code changed outside `libs/shared/docs/cibg-gaps.mdx`,
|
||||
`scripts/check-tokens.sh`, `99-backlog.md`, and this note — a doc-only ticket
|
||||
plus its optional, self-verifying guard script.
|
||||
Reference in New Issue
Block a user