|
| 1 | +/** Shared manifest for the self-host docs accuracy audit (#1829). Imported by the docs page and CI drift tests. */ |
| 2 | + |
| 3 | +export type SelfHostDocsPageLink = { |
| 4 | + title: string; |
| 5 | + path: string; |
| 6 | + routeFile: string; |
| 7 | +}; |
| 8 | + |
| 9 | +export const SELFHOST_DOCS_PAGES = [ |
| 10 | + { |
| 11 | + title: "Quickstart", |
| 12 | + path: "/docs/self-hosting-quickstart", |
| 13 | + routeFile: "docs.self-hosting-quickstart.tsx", |
| 14 | + }, |
| 15 | + { |
| 16 | + title: "Configuration", |
| 17 | + path: "/docs/self-hosting-configuration", |
| 18 | + routeFile: "docs.self-hosting-configuration.tsx", |
| 19 | + }, |
| 20 | + { |
| 21 | + title: "GitHub App and Orb", |
| 22 | + path: "/docs/self-hosting-github-app", |
| 23 | + routeFile: "docs.self-hosting-github-app.tsx", |
| 24 | + }, |
| 25 | + { |
| 26 | + title: "AI providers", |
| 27 | + path: "/docs/self-hosting-ai-providers", |
| 28 | + routeFile: "docs.self-hosting-ai-providers.tsx", |
| 29 | + }, |
| 30 | + { |
| 31 | + title: "REES enrichment", |
| 32 | + path: "/docs/self-hosting-rees", |
| 33 | + routeFile: "docs.self-hosting-rees.tsx", |
| 34 | + }, |
| 35 | + { |
| 36 | + title: "REES analyzer reference", |
| 37 | + path: "/docs/self-hosting-rees-analyzers", |
| 38 | + routeFile: "docs.self-hosting-rees-analyzers.tsx", |
| 39 | + }, |
| 40 | + { title: "RAG indexing", path: "/docs/self-hosting-rag", routeFile: "docs.self-hosting-rag.tsx" }, |
| 41 | + { |
| 42 | + title: "Operations", |
| 43 | + path: "/docs/self-hosting-operations", |
| 44 | + routeFile: "docs.self-hosting-operations.tsx", |
| 45 | + }, |
| 46 | + { |
| 47 | + title: "Backup and scaling", |
| 48 | + path: "/docs/self-hosting-backup-scaling", |
| 49 | + routeFile: "docs.self-hosting-backup-scaling.tsx", |
| 50 | + }, |
| 51 | + { |
| 52 | + title: "Releases and images", |
| 53 | + path: "/docs/self-hosting-releases", |
| 54 | + routeFile: "docs.self-hosting-releases.tsx", |
| 55 | + }, |
| 56 | + { |
| 57 | + title: "Release checklist", |
| 58 | + path: "/docs/self-hosting-release-checklist", |
| 59 | + routeFile: "docs.self-hosting-release-checklist.tsx", |
| 60 | + }, |
| 61 | + { |
| 62 | + title: "Security", |
| 63 | + path: "/docs/self-hosting-security", |
| 64 | + routeFile: "docs.self-hosting-security.tsx", |
| 65 | + }, |
| 66 | + { |
| 67 | + title: "Troubleshooting", |
| 68 | + path: "/docs/self-hosting-troubleshooting", |
| 69 | + routeFile: "docs.self-hosting-troubleshooting.tsx", |
| 70 | + }, |
| 71 | + { |
| 72 | + title: "Docs accuracy audit", |
| 73 | + path: "/docs/self-hosting-docs-audit", |
| 74 | + routeFile: "docs.self-hosting-docs-audit.tsx", |
| 75 | + }, |
| 76 | +] as const; |
| 77 | + |
| 78 | +export type SelfHostDocsPath = (typeof SELFHOST_DOCS_PAGES)[number]["path"]; |
| 79 | + |
| 80 | +export type SelfHostSourceOfTruthRow = { |
| 81 | + topic: string; |
| 82 | + runtimeSources: readonly string[]; |
| 83 | + docsPath: SelfHostDocsPath; |
| 84 | + driftGuard?: string; |
| 85 | + notes?: string; |
| 86 | +}; |
| 87 | + |
| 88 | +export type LooseDocsRow = { |
| 89 | + path: string; |
| 90 | + role: string; |
| 91 | + action: "keep" | "link-only" | "consolidated"; |
| 92 | + websiteDocsPath?: SelfHostDocsPath; |
| 93 | + notes?: string; |
| 94 | +}; |
| 95 | + |
| 96 | +export const SELFHOST_SOURCE_OF_TRUTH_ROWS: readonly SelfHostSourceOfTruthRow[] = [ |
| 97 | + { |
| 98 | + topic: "Compose stack and profiles", |
| 99 | + runtimeSources: ["docker-compose.yml", ".env.selfhost.example", ".env.example"], |
| 100 | + docsPath: "/docs/self-hosting-quickstart", |
| 101 | + notes: "Profiles (postgres, rees, observability, backup) and conservative first-boot defaults.", |
| 102 | + }, |
| 103 | + { |
| 104 | + topic: "Env vars (exhaustive list)", |
| 105 | + runtimeSources: [ |
| 106 | + "scripts/gen-selfhost-env-reference.mjs", |
| 107 | + "apps/gittensory-ui/src/lib/selfhost-env-reference.ts", |
| 108 | + ], |
| 109 | + docsPath: "/docs/self-hosting-configuration", |
| 110 | + driftGuard: "selfhost-env-reference-script.test.ts", |
| 111 | + notes: "Generated from every env.SOMETHING read; npm run selfhost:env-reference:check in CI.", |
| 112 | + }, |
| 113 | + { |
| 114 | + topic: "GitHub App manifest and setup wizard", |
| 115 | + runtimeSources: ["src/selfhost/setup-wizard.ts", ".env.selfhost.example"], |
| 116 | + docsPath: "/docs/self-hosting-github-app", |
| 117 | + driftGuard: "setup-wizard-docs-parity.test.ts", |
| 118 | + }, |
| 119 | + { |
| 120 | + topic: "Activation and onboarding paths", |
| 121 | + runtimeSources: ["src/server.ts", "config/examples/global.gittensory.yml"], |
| 122 | + docsPath: "/docs/self-hosting-configuration", |
| 123 | + driftGuard: "docs-selfhost-activation-paths.test.ts", |
| 124 | + }, |
| 125 | + { |
| 126 | + topic: "AI providers and unsafe Codex opt-in", |
| 127 | + runtimeSources: ["src/selfhost/ai-config.ts", "src/selfhost/ai.ts"], |
| 128 | + docsPath: "/docs/self-hosting-ai-providers", |
| 129 | + notes: "Codex PR review is fail-closed unless GITTENSORY_ENABLE_UNSAFE_CODEX_REVIEWER=1.", |
| 130 | + }, |
| 131 | + { |
| 132 | + topic: "REES sidecar (compose profile)", |
| 133 | + runtimeSources: ["docker-compose.yml", "review-enrichment/Dockerfile"], |
| 134 | + docsPath: "/docs/self-hosting-rees", |
| 135 | + notes: |
| 136 | + "Analyzer metadata tables live on the REES analyzer page; generation is a separate roadmap item.", |
| 137 | + }, |
| 138 | + { |
| 139 | + topic: "RAG / embeddings / Qdrant", |
| 140 | + runtimeSources: ["src/selfhost/qdrant-vectorize.ts", "docker-compose.yml"], |
| 141 | + docsPath: "/docs/self-hosting-rag", |
| 142 | + }, |
| 143 | + { |
| 144 | + topic: "Update, rollback, and deploy scripts", |
| 145 | + runtimeSources: [ |
| 146 | + "scripts/deploy-selfhost-image.sh", |
| 147 | + "scripts/deploy-selfhost-prebuilt.sh", |
| 148 | + "scripts/selfhost-post-update-check.sh", |
| 149 | + ], |
| 150 | + docsPath: "/docs/self-hosting-operations", |
| 151 | + driftGuard: "docs-selfhost-update-rollback.test.ts", |
| 152 | + notes: "Migrations are forward-only; rollback is image-only.", |
| 153 | + }, |
| 154 | + { |
| 155 | + topic: "Runner temp storage (multi-runner)", |
| 156 | + runtimeSources: ["docker-compose.yml"], |
| 157 | + docsPath: "/docs/self-hosting-operations", |
| 158 | + driftGuard: "docs-selfhost-operations-runner-tmpdir.test.ts", |
| 159 | + }, |
| 160 | + { |
| 161 | + topic: "Backup, restore, and Litestream", |
| 162 | + runtimeSources: ["scripts/backup.sh", "scripts/verify-backup.sh", "scripts/backup-metrics.sh"], |
| 163 | + docsPath: "/docs/self-hosting-backup-scaling", |
| 164 | + driftGuard: "selfhost-backup-script.test.ts", |
| 165 | + }, |
| 166 | + { |
| 167 | + topic: "Official orb-v* releases and GHCR tags", |
| 168 | + runtimeSources: [".github/workflows/release-selfhost.yml", "Dockerfile"], |
| 169 | + docsPath: "/docs/self-hosting-releases", |
| 170 | + notes: |
| 171 | + "Release workflow uploads source maps to Sentry; maps never ship inside the runtime image.", |
| 172 | + }, |
| 173 | + { |
| 174 | + topic: "Release smoke matrix and image-contents audit", |
| 175 | + runtimeSources: ["scripts/smoke-selfhost.sh", "Dockerfile", ".dockerignore"], |
| 176 | + docsPath: "/docs/self-hosting-release-checklist", |
| 177 | + driftGuard: "docs-selfhost-release-checklist-event-names.test.ts", |
| 178 | + }, |
| 179 | + { |
| 180 | + topic: "Sentry (opt-in, operator-owned DSN)", |
| 181 | + runtimeSources: ["src/selfhost/sentry.ts", "docker-compose.yml"], |
| 182 | + docsPath: "/docs/self-hosting-operations", |
| 183 | + driftGuard: "docs-selfhost-sentry-observability.test.ts", |
| 184 | + notes: "Sentry is off by default until SENTRY_DSN or SENTRY_DSN_FILE is set.", |
| 185 | + }, |
| 186 | + { |
| 187 | + topic: "OTEL metrics/traces and Grafana dashboards", |
| 188 | + runtimeSources: [ |
| 189 | + "src/selfhost/otel.ts", |
| 190 | + "scripts/validate-observability-configs.mjs", |
| 191 | + "grafana/dashboards/", |
| 192 | + "prometheus/rules/alerts.yml", |
| 193 | + ], |
| 194 | + docsPath: "/docs/self-hosting-operations", |
| 195 | + driftGuard: "docs-selfhost-troubleshooting-metric-names.test.ts", |
| 196 | + notes: "Observability profile is optional; npm run selfhost:validate-observability in CI.", |
| 197 | + }, |
| 198 | + { |
| 199 | + topic: "Security boundaries and secret handling", |
| 200 | + runtimeSources: ["src/selfhost/private-config.ts", "src/selfhost/preflight.ts"], |
| 201 | + docsPath: "/docs/self-hosting-security", |
| 202 | + }, |
| 203 | + { |
| 204 | + topic: "Prometheus alert runbooks", |
| 205 | + runtimeSources: ["prometheus/rules/alerts.yml", "src/selfhost/metrics.ts"], |
| 206 | + docsPath: "/docs/self-hosting-troubleshooting", |
| 207 | + driftGuard: "docs-selfhost-troubleshooting-metric-names.test.ts", |
| 208 | + }, |
| 209 | +] as const; |
| 210 | + |
| 211 | +export const LOOSE_DOCS_ROWS: readonly LooseDocsRow[] = [ |
| 212 | + { |
| 213 | + path: "CONVERGENCE_RUNBOOK.md", |
| 214 | + role: "Native-port convergence and hosted Cloudflare inventory (#1030 / #1826).", |
| 215 | + action: "keep", |
| 216 | + notes: "Intentional root runbook — not a duplicate of the website self-host section.", |
| 217 | + }, |
| 218 | + { |
| 219 | + path: "config/examples/README.md", |
| 220 | + role: "Private config mount examples and template pointers.", |
| 221 | + action: "link-only", |
| 222 | + websiteDocsPath: "/docs/self-hosting-configuration", |
| 223 | + }, |
| 224 | + { |
| 225 | + path: "review-enrichment/README.md", |
| 226 | + role: "REES analyzer developer notes for contributors.", |
| 227 | + action: "link-only", |
| 228 | + websiteDocsPath: "/docs/self-hosting-rees", |
| 229 | + }, |
| 230 | + { |
| 231 | + path: "packages/gittensory-miner/DEPLOYMENT.md", |
| 232 | + role: "Miner CLI deployment — explicitly not the self-host review stack.", |
| 233 | + action: "keep", |
| 234 | + }, |
| 235 | +] as const; |
| 236 | + |
| 237 | +export const SELFHOST_DOCS_VALIDATION_COMMANDS = [ |
| 238 | + "npm run docs:drift-check", |
| 239 | + "npm run selfhost:env-reference:check", |
| 240 | + "npm run selfhost:validate-observability", |
| 241 | + "npm run ui:lint", |
| 242 | + "npm run ui:typecheck", |
| 243 | + "npm run ui:test", |
| 244 | + "npm run ui:build", |
| 245 | + "npm run test:ci", |
| 246 | +] as const; |
0 commit comments