diff --git a/changelog.d/fixed-389-hive-adr-nav-drift.md b/changelog.d/fixed-389-hive-adr-nav-drift.md new file mode 100644 index 0000000..1b5f66a --- /dev/null +++ b/changelog.d/fixed-389-hive-adr-nav-drift.md @@ -0,0 +1 @@ +- List ADRs 0018–0024 in the hive docs sidebar and add a test that fails when the ADR sync list and sidebar navigation drift apart. diff --git a/src/__tests__/page-map-adr-nav-drift.test.ts b/src/__tests__/page-map-adr-nav-drift.test.ts new file mode 100644 index 0000000..ec62bb2 --- /dev/null +++ b/src/__tests__/page-map-adr-nav-drift.test.ts @@ -0,0 +1,19 @@ +import fs from "fs"; +import path from "path"; +import { describe, expect, it } from "vitest"; + +const ADR_RE = /adr\/(\d{4}-[a-z0-9-]+\.md)/g; + +function adrEntries(file: string): string[] { + const src = fs.readFileSync(path.join(process.cwd(), file), "utf8"); + return [...new Set([...src.matchAll(ADR_RE)].map(m => m[1]))].sort(); +} + +describe("hive ADR navigation stays in step with sync-hive-docs", () => { + it("lists every synced ADR in NAV_STRUCTURE_HIVE", () => { + const synced = adrEntries("scripts/sync-hive-docs.ts"); + const inNav = adrEntries("src/app/docs/page-map.ts"); + expect(synced.length).toBeGreaterThan(0); + expect(inNav).toEqual(synced); + }); +}); diff --git a/src/app/docs/page-map.ts b/src/app/docs/page-map.ts index b665c61..10db28f 100644 --- a/src/app/docs/page-map.ts +++ b/src/app/docs/page-map.ts @@ -174,6 +174,12 @@ const NAV_STRUCTURE_HIVE: Array<{ title: string; items: NavItem[] }> = [ { '0015 CSP style-src scope': 'adr/0015-csp-style-src-scope.md' }, { '0016 CSP script-src scope': 'adr/0016-csp-script-src-scope.md' }, { '0017 Podman Quadlet lifecycle': 'adr/0017-podman-quadlet-lifecycle.md' }, + { '0018 Dashboard design tokens': 'adr/0018-dashboard-design-tokens.md' }, + { '0019 Escalation over stalling': 'adr/0019-escalation-over-stalling.md' }, + { '0020 Spek continuous convergence': 'adr/0020-spek-continuous-convergence.md' }, + { '0022 Opt-in earned Codex reset redemption': 'adr/0022-opt-in-earned-codex-reset-redemption.md' }, + { '0023 Trusted-author automerge': 'adr/0023-trusted-author-automerge.md' }, + { '0024 Provider credential lifecycle': 'adr/0024-provider-credential-lifecycle.md' }, ] }, { 'Environment variable reference': 'env-vars.md' }, ]