import { access, readFile, readdir } from "node:fs/promises"; import { join } from "node:path"; const root = new URL("../dist/", import.meta.url); const required = [ "index.html", "archive/index.html", "method/index.html", "articles/research-publishing-method/index.html", "articles/git-collaboration-ai-development/index.html", "articles/git-collaboration-ai-development/git-collaboration-flow.png", "articles/git-collaboration-ai-development/ai-responsibility-lanes.png", "articles/git-collaboration-ai-development/ai-project-workflow-positions.png", "articles/git-collaboration-ai-development/change-evidence-state.svg", "articles/git-collaboration-ai-development/test-selection-funnel.svg", "articles/git-collaboration-ai-development/agent-trust-boundary.svg", "rss.xml", "sitemap.xml" ]; for (const path of required) await access(new URL(path, root)); async function walk(path) { const entries = await readdir(path, { withFileTypes: true }); const found = []; for (const entry of entries) { const child = join(path, entry.name); if (entry.isDirectory()) found.push(...await walk(child)); else if (/\.(?:html|xml|css|js|svg)$/.test(entry.name)) found.push(child); } return found; } const files = await walk(root.pathname); const forbidden = /(?:git\.n\.xiaomi\.com|coro\.doc|\.codex\/sessions|