Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-389-hive-adr-nav-drift.md
Original file line number Diff line number Diff line change
@@ -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.
19 changes: 19 additions & 0 deletions src/__tests__/page-map-adr-nav-drift.test.ts
Original file line number Diff line number Diff line change
@@ -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);
});
});
6 changes: 6 additions & 0 deletions src/app/docs/page-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
]
Expand Down
Loading