CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
docs-terminal-debt.test.ts
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| 9dd96b9 | 1 | /** |
| 2 | * BLOCK R4 — Docs sweep smoke checks. | |
| 3 | * | |
| 4 | * Verifies the "web-first, terminal-fallback" treatment is in place: | |
| 5 | * | |
| 6 | * 1. README.md contains no `ssh root@gluecron.com` and no | |
| 7 | * `bun run scripts/` references outside `<details>` blocks. | |
| 8 | * 2. DEPLOY.md has a "Day-to-day operations" section that points | |
| 9 | * at `/admin/ops`. | |
| 10 | * 3. `docs/terminal-debt.md` exists and is non-empty. | |
| 11 | * | |
| 12 | * No mocks — pure filesystem reads. | |
| 13 | */ | |
| 14 | ||
| 15 | import { describe, it, expect } from "bun:test"; | |
| 16 | import { readFile } from "node:fs/promises"; | |
| 17 | import { join } from "node:path"; | |
| 18 | ||
| 19 | const ROOT = join(import.meta.dir, "..", ".."); | |
| 20 | ||
| 21 | /** Strip every `<details>...</details>` block (case-insensitive, multiline). */ | |
| 22 | function stripDetails(markdown: string): string { | |
| 23 | return markdown.replace(/<details[\s\S]*?<\/details>/gi, ""); | |
| 24 | } | |
| 25 | ||
| 26 | describe("BLOCK R4 — docs sweep", () => { | |
| 27 | describe("README.md", () => { | |
| 28 | it("does not reference `ssh root@gluecron.com` outside <details>", async () => { | |
| 29 | const md = await readFile(join(ROOT, "README.md"), "utf8"); | |
| 30 | const stripped = stripDetails(md); | |
| 31 | expect(stripped).not.toContain("ssh root@gluecron.com"); | |
| 32 | }); | |
| 33 | ||
| 34 | it("does not reference `bun run scripts/` outside <details>", async () => { | |
| 35 | const md = await readFile(join(ROOT, "README.md"), "utf8"); | |
| 36 | const stripped = stripDetails(md); | |
| 37 | expect(stripped).not.toContain("bun run scripts/"); | |
| 38 | }); | |
| 39 | }); | |
| 40 | ||
| 41 | describe("DEPLOY.md", () => { | |
| 42 | it("has a Day-to-day operations section that points at /admin/ops", async () => { | |
| 43 | const md = await readFile(join(ROOT, "DEPLOY.md"), "utf8"); | |
| 44 | expect(md).toContain("Day-to-day operations"); | |
| 45 | expect(md).toContain("/admin/ops"); | |
| 46 | }); | |
| 47 | }); | |
| 48 | ||
| 49 | describe("docs/terminal-debt.md", () => { | |
| 50 | it("exists and is non-empty", async () => { | |
| 51 | const md = await readFile( | |
| 52 | join(ROOT, "docs", "terminal-debt.md"), | |
| 53 | "utf8", | |
| 54 | ); | |
| 55 | expect(md.trim().length).toBeGreaterThan(0); | |
| 56 | }); | |
| 57 | }); | |
| 58 | }); |