@brandlab-digital/conformance 3.12.1 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -1
- package/dist/analytics-e2e.d.ts +10 -16
- package/dist/analytics-e2e.d.ts.map +1 -1
- package/dist/analytics-e2e.js +61 -3
- package/dist/analytics-e2e.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -1
- package/dist/cli.js.map +1 -1
- package/dist/current-release.js +5 -5
- package/dist/current-release.js.map +1 -1
- package/dist/edge-probe-cli.d.ts +57 -0
- package/dist/edge-probe-cli.d.ts.map +1 -0
- package/dist/edge-probe-cli.js +134 -0
- package/dist/edge-probe-cli.js.map +1 -0
- package/dist/engineering.d.ts +4 -1
- package/dist/engineering.d.ts.map +1 -1
- package/dist/engineering.js +19 -14
- package/dist/engineering.js.map +1 -1
- package/dist/estate-sample.d.ts +60 -0
- package/dist/estate-sample.d.ts.map +1 -0
- package/dist/estate-sample.js +144 -0
- package/dist/estate-sample.js.map +1 -0
- package/dist/estate.d.ts +45 -0
- package/dist/estate.d.ts.map +1 -1
- package/dist/estate.js +82 -22
- package/dist/estate.js.map +1 -1
- package/dist/origin-region.d.ts +14 -0
- package/dist/origin-region.d.ts.map +1 -0
- package/dist/origin-region.js +46 -0
- package/dist/origin-region.js.map +1 -0
- package/dist/prefetch-probe-cli.d.ts +36 -0
- package/dist/prefetch-probe-cli.d.ts.map +1 -0
- package/dist/prefetch-probe-cli.js +163 -0
- package/dist/prefetch-probe-cli.js.map +1 -0
- package/dist/project.d.ts +20 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +92 -2
- package/dist/project.js.map +1 -1
- package/dist/ready-cli.d.ts.map +1 -1
- package/dist/ready-cli.js +8 -3
- package/dist/ready-cli.js.map +1 -1
- package/dist/rule-registry.d.ts +5 -0
- package/dist/rule-registry.d.ts.map +1 -1
- package/dist/rule-registry.js +1 -0
- package/dist/rule-registry.js.map +1 -1
- package/dist/site-system/checks.d.ts +62 -1
- package/dist/site-system/checks.d.ts.map +1 -1
- package/dist/site-system/checks.js +9 -0
- package/dist/site-system/checks.js.map +1 -1
- package/dist/site-system/config.d.ts +27 -0
- package/dist/site-system/config.d.ts.map +1 -1
- package/dist/site-system/config.js +50 -1
- package/dist/site-system/config.js.map +1 -1
- package/dist/site-system/index.d.ts +1 -1
- package/dist/site-system/index.d.ts.map +1 -1
- package/dist/site-system/index.js +1 -1
- package/dist/site-system/index.js.map +1 -1
- package/dist/site-system/journeys/plan.d.ts +9 -2
- package/dist/site-system/journeys/plan.d.ts.map +1 -1
- package/dist/site-system/journeys/plan.js +11 -1
- package/dist/site-system/journeys/plan.js.map +1 -1
- package/dist/site-system/journeys/prefetch-measure.d.ts +28 -0
- package/dist/site-system/journeys/prefetch-measure.d.ts.map +1 -0
- package/dist/site-system/journeys/prefetch-measure.js +94 -0
- package/dist/site-system/journeys/prefetch-measure.js.map +1 -0
- package/dist/site-system/journeys/prefetch-policy.d.ts +85 -0
- package/dist/site-system/journeys/prefetch-policy.d.ts.map +1 -0
- package/dist/site-system/journeys/prefetch-policy.js +152 -0
- package/dist/site-system/journeys/prefetch-policy.js.map +1 -0
- package/dist/site-system/journeys/prefetch.d.ts +3 -0
- package/dist/site-system/journeys/prefetch.d.ts.map +1 -0
- package/dist/site-system/journeys/prefetch.js +37 -0
- package/dist/site-system/journeys/prefetch.js.map +1 -0
- package/dist/site-system/journeys/variants.d.ts +34 -0
- package/dist/site-system/journeys/variants.d.ts.map +1 -0
- package/dist/site-system/journeys/variants.js +139 -0
- package/dist/site-system/journeys/variants.js.map +1 -0
- package/dist/site-system/report.d.ts.map +1 -1
- package/dist/site-system/report.js +19 -5
- package/dist/site-system/report.js.map +1 -1
- package/dist/site-system/rule-modules.d.ts.map +1 -1
- package/dist/site-system/rule-modules.js +10 -0
- package/dist/site-system/rule-modules.js.map +1 -1
- package/dist/site-system/rules/delivery/h13-inbox.d.ts +23 -0
- package/dist/site-system/rules/delivery/h13-inbox.d.ts.map +1 -0
- package/dist/site-system/rules/delivery/h13-inbox.js +208 -0
- package/dist/site-system/rules/delivery/h13-inbox.js.map +1 -0
- package/dist/site-system/rules/delivery/index.d.ts +12 -0
- package/dist/site-system/rules/delivery/index.d.ts.map +1 -0
- package/dist/site-system/rules/delivery/index.js +7 -0
- package/dist/site-system/rules/delivery/index.js.map +1 -0
- package/dist/site-system/rules/full/common.d.ts +3 -0
- package/dist/site-system/rules/full/common.d.ts.map +1 -1
- package/dist/site-system/rules/full/common.js.map +1 -1
- package/dist/site-system/rules/full/e1-pattern.d.ts +4 -0
- package/dist/site-system/rules/full/e1-pattern.d.ts.map +1 -0
- package/dist/site-system/rules/full/e1-pattern.js +47 -0
- package/dist/site-system/rules/full/e1-pattern.js.map +1 -0
- package/dist/site-system/rules/full/estate.d.ts +20 -1
- package/dist/site-system/rules/full/estate.d.ts.map +1 -1
- package/dist/site-system/rules/full/estate.js +33 -5
- package/dist/site-system/rules/full/estate.js.map +1 -1
- package/dist/site-system/rules/full/geography.d.ts +8 -2
- package/dist/site-system/rules/full/geography.d.ts.map +1 -1
- package/dist/site-system/rules/full/geography.js +6 -2
- package/dist/site-system/rules/full/geography.js.map +1 -1
- package/dist/site-system/rules/full/index.d.ts +3 -2
- package/dist/site-system/rules/full/index.d.ts.map +1 -1
- package/dist/site-system/rules/full/index.js +27 -9
- package/dist/site-system/rules/full/index.js.map +1 -1
- package/dist/site-system/rules/full/k12-slots.d.ts +4 -0
- package/dist/site-system/rules/full/k12-slots.d.ts.map +1 -0
- package/dist/site-system/rules/full/k12-slots.js +40 -0
- package/dist/site-system/rules/full/k12-slots.js.map +1 -0
- package/dist/site-system/rules/full/loc-index.d.ts +5 -0
- package/dist/site-system/rules/full/loc-index.d.ts.map +1 -1
- package/dist/site-system/rules/full/loc-index.js +43 -2
- package/dist/site-system/rules/full/loc-index.js.map +1 -1
- package/dist/site-system/rules/full/strategy.d.ts +4 -0
- package/dist/site-system/rules/full/strategy.d.ts.map +1 -1
- package/dist/site-system/rules/full/strategy.js +19 -3
- package/dist/site-system/rules/full/strategy.js.map +1 -1
- package/dist/site-system/rules/full/w3-refresh.d.ts +22 -0
- package/dist/site-system/rules/full/w3-refresh.d.ts.map +1 -0
- package/dist/site-system/rules/full/w3-refresh.js +70 -0
- package/dist/site-system/rules/full/w3-refresh.js.map +1 -0
- package/dist/site-system/rules/guards/index.d.ts +22 -0
- package/dist/site-system/rules/guards/index.d.ts.map +1 -0
- package/dist/site-system/rules/guards/index.js +109 -0
- package/dist/site-system/rules/guards/index.js.map +1 -0
- package/dist/site-system/rules/guards/w10-crawlers.d.ts +55 -0
- package/dist/site-system/rules/guards/w10-crawlers.d.ts.map +1 -0
- package/dist/site-system/rules/guards/w10-crawlers.js +182 -0
- package/dist/site-system/rules/guards/w10-crawlers.js.map +1 -0
- package/dist/site-system/rules/guards/w9-params.d.ts +19 -0
- package/dist/site-system/rules/guards/w9-params.d.ts.map +1 -0
- package/dist/site-system/rules/guards/w9-params.js +84 -0
- package/dist/site-system/rules/guards/w9-params.js.map +1 -0
- package/dist/site-system/rules/sections/k2-skin-coverage.d.ts +2 -2
- package/dist/site-system/rules/sections/k2-skin-coverage.d.ts.map +1 -1
- package/dist/site-system/rules/sections/k2-skin-coverage.js +6 -2
- package/dist/site-system/rules/sections/k2-skin-coverage.js.map +1 -1
- package/dist/site-system/runners.js +1 -1
- package/dist/site-system/runners.js.map +1 -1
- package/dist/site-system-e2e.d.ts +1 -0
- package/dist/site-system-e2e.d.ts.map +1 -1
- package/dist/site-system-e2e.js +8 -2
- package/dist/site-system-e2e.js.map +1 -1
- package/package.json +6 -4
package/dist/engineering.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engineering.js","sourceRoot":"","sources":["../src/engineering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS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,IAAI,EAAE,KAAK,YAAY;QAAE,GAAG,CAAC,WAAW,EAAE,cAAc,EAAE,0CAA0C,CAAC,CAAC;AACtI,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA+B,CAAC;AAEjE,kEAAkE;AAClE,SAAS,gBAAgB,CAAC,IAAY;IACpC,IAAI,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,CAAC;YAAC,OAAO,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC;YAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QAAC,CAAC;QAC5E,iBAAiB,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9D,CAAC","sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';\nimport { join, posix } from 'node:path';\nimport ts from 'typescript';\nimport { globMatch } from './glob.js';\nimport {\n collectBrandlabSource,\n createBrandlabModuleResolver,\n findImportedCalls,\n isDirectory,\n lineOfNode,\n listModuleReferences,\n objectPropertyValue,\n parseBrandlabSourceFile,\n walkProjectFiles,\n type BrandlabSourceFile,\n type BrandlabSourceIndex,\n} from './source-files.js';\nimport { describeCapabilities } from './static-rules.js';\n\nexport const ENGINEERING_FAST_COMMANDS = ['typecheck', 'lint', 'test', 'check:unused', 'check:unused:production', 'check:standards'] as const;\n\n/** The exact fast verification command from the Brandlab 3.0 target (section 6). */\nexport const BRANDLAB_EXPECTED_VERIFY_SCRIPT =\n 'npm run check:standards && npm run typecheck && npm run lint && npm run test && npm run check:unused && npm run check:unused:production';\n\n/** Scripts whose exact values the 3.0 target fixes; dev and start must exist. */\nexport const BRANDLAB_EXPECTED_SCRIPTS: Readonly<Record<string, string>> = Object.freeze({\n build: 'next build',\n typecheck: 'next typegen && tsc --noEmit',\n lint: 'eslint .',\n test: 'vitest run',\n 'test:e2e': 'playwright test',\n 'check:unused': 'knip',\n 'check:unused:production': 'knip --production',\n 'check:standards': 'brandlab-verify --mode ci --engineering',\n});\n\nexport type EngineeringFindingSeverity = 'blocker' | 'info';\nexport interface EngineeringFinding { path: string; rule: string; message: string; severity: EngineeringFindingSeverity; line?: number }\nexport interface EngineeringCheck {\n status: 'pass' | 'blocked';\n findings: EngineeringFinding[];\n coverage: string;\n outstandingEvidence: readonly string[];\n}\n\ninterface PackageManifest {\n type?: string;\n scripts?: Record<string, string>;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n}\n\nconst SRC_DIRECTORIES = new Set(['app', 'config', 'data', 'content', 'lib', 'components', 'types']);\nconst SRC_ROOT_FILES = /^(?:instrumentation(?:-client)?|proxy|mdx-components)\\.(?:ts|tsx)$/;\nconst COMPONENT_ROLES = new Set(['layout', 'ui', 'sections', 'features', 'page-families']);\nconst TEST_DIRECTORIES = new Set(['config', 'data', 'lib', 'components', 'e2e', 'support']);\nconst RETIRED_ROOT_DIRECTORIES = ['app', 'components', 'data', 'lib', 'config', 'content', 'hooks', 'context', 'utils', 'src/components/templates'];\nconst DEV_TOOLING = ['eslint', 'vitest', '@playwright/test', 'knip'];\nconst NEXT_SPECIAL_FILE = /^(?:page|layout|template|loading|error|global-error|not-found|global-not-found|forbidden|unauthorized|default|route|opengraph-image|twitter-image|icon|apple-icon|sitemap|robots|manifest)\\.(?:ts|tsx|js|jsx|mdx)$/;\nconst CODE_OR_STYLE = /\\.(?:[cm]?[jt]sx?|mdx|css)$/;\nconst PASCAL_COMPONENT = /^[A-Z][A-Za-z0-9]*\\.tsx$/;\nconst CAMEL_MODULE = /^[a-z][A-Za-z0-9]*(?:\\.d)?\\.ts$/;\nconst SEMVER = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$/;\n\n/** The Vercel function region of every Brandlab site (3.2.1): Sydney. */\nexport const BRANDLAB_FUNCTION_REGION = 'syd1';\n/**\n * The Vercel ignored build step of every Brandlab site (3.3.3). Exit 0 skips a deployment, anything else builds it:\n * a production deployment is skipped only when git shows every change since the last successful production\n * deployment is in .github/, docs/ or a root Markdown file. Previews, a redeploy of the same commit, a missing or\n * unknown previous commit and any git error all build. brandlab-migrate S10 writes the same command.\n */\nexport const BRANDLAB_VERCEL_IGNORE_COMMAND =\n `[ \"$VERCEL_ENV\" = production ] && [ \"$VERCEL_GIT_PREVIOUS_SHA\" != \"$VERCEL_GIT_COMMIT_SHA\" ] && git diff --quiet \"$VERCEL_GIT_PREVIOUS_SHA\" HEAD -- . ':!.github' ':!docs' ':(exclude,glob)*.md' && exit 0 || exit 1`;\n/** The contact route's delivery options (labels, email style, attachment policy): server-only (3.2.1). */\nconst CONTACT_RUNTIME = 'src/config/contactRuntime.ts';\n/** The business facts' evidence (defineBrandlabBusiness): server-only (3.2.1). */\nconst BUSINESS_EVIDENCE = 'src/data/businessEvidence.ts';\nconst BUSINESS_VALUES = 'src/data/business.ts';\nconst SITE_IDENTITY = 'src/config/site.ts';\nconst BUSINESS_FACT_CALLS = /\\b(?:defineBrandlabBusiness|verifiedFact|unknownFact|notApplicableFact)\\s*\\(/;\nconst GEOGRAPHY_ENTRY = '@brandlab-digital/site-core/geography';\n/**\n * Package entries a browser bundle cannot resolve from 3.3.3 (their exports map `browser` to null): the geography\n * registries and website-location policies, which the location estate reads, and the server halves of contact and reviews\n * (3.5.0 adds the Business Profile reviews feed client).\n */\nconst SERVER_PACKAGE_ENTRIES: ReadonlyMap<string, string> = new Map([\n [GEOGRAPHY_ENTRY, 'The Brandlab geography registry and website-location policy (server data, about 190 KB)'],\n ['@brandlab-digital/site-next/contact/server', 'The contact route runtime'],\n ['@brandlab-digital/site-next/google-reviews/server', 'The Google reviews route runtime'],\n ['@brandlab-digital/site-next/google-business-reviews/server', 'The Business Profile reviews feed client (it reads the feed token)'],\n]);\n\n/** Opt-in structural check. Static success must never masquerade as whole-project acceptance. */\nexport function checkEngineeringStructure(root: string): EngineeringCheck {\n directoryListings.clear();\n const findings: EngineeringFinding[] = [];\n const add = (path: string, rule: string, message: string, extra: { severity?: EngineeringFindingSeverity; line?: number } = {}) =>\n findings.push({ path, rule, message, severity: extra.severity ?? 'blocker', ...(extra.line ? { line: extra.line } : {}) });\n let pkg: PackageManifest = {};\n try { pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')); }\n catch { add('package.json', 'package-readable', 'A readable package.json is required.'); }\n const config = existsSync(join(root, 'brandlab.config.ts')) ? readFileSync(join(root, 'brandlab.config.ts'), 'utf8') : null;\n const capabilities = describeCapabilities(root, config);\n\n const source = collectBrandlabSource(root);\n\n inspectCommands(pkg, add);\n inspectDependencies(pkg, add);\n inspectLayout(root, capabilities, add);\n inspectSourceModules(root, source, add);\n inspectServerBoundaries(root, capabilities, source, add);\n inspectTests(root, capabilities, add);\n inspectToolPresets(root, add);\n inspectDelivery(root, add);\n\n return { status: findings.some(finding => finding.severity === 'blocker') ? 'blocked' : 'pass', findings,\n coverage: 'Static layout, naming, command, dependency-pin, tool-preset, CI, deployment and documentation structure only. This is not engineering-standard completion.',\n outstandingEvidence: ['Usage and deletion review including assets, configuration and dynamic references', 'Business data and component/style ownership review', 'Clean install, fast checks and production build', 'Full discovered technical URL estate', 'All distinct page families and important browser journeys', 'Exact-source protected Preview', 'Reporting/Ads provider cutover and authorised production verification'] };\n}\n\ntype Add = (path: string, rule: string, message: string, extra?: { severity?: EngineeringFindingSeverity; line?: number }) => void;\n\n// --- commands (section 6) ----------------------------------------------------\n\nfunction inspectCommands(pkg: PackageManifest, add: Add) {\n const scripts = pkg.scripts ?? {};\n for (const command of ['dev', 'start', ...ENGINEERING_FAST_COMMANDS, 'verify', 'build', 'test:e2e']) {\n if (!scripts[command]?.trim()) add('package.json', 'command-contract', `Missing ${command} command.`);\n }\n for (const [name, expected] of Object.entries(BRANDLAB_EXPECTED_SCRIPTS)) {\n const actual = scripts[name]?.trim();\n if (actual && actual.replace(/\\s+/g, ' ') !== expected) {\n add('package.json', 'script-contract', `${name} must be exactly \"${expected}\" (found \"${actual}\").`);\n }\n }\n const verify = scripts.verify?.trim();\n if (verify) {\n const unrecognised = splitCommandChain(verify).filter(segment => scriptReferences(segment, scripts) === null);\n if (unrecognised.length > 0) {\n add('package.json', 'verification-command-form',\n `verify may only chain package scripts (npm run <script>, npm test, run-s, run-p); \"${unrecognised.join('\", \"')}\" is not recognised. Expected \"${BRANDLAB_EXPECTED_VERIFY_SCRIPT}\".`);\n }\n }\n const reachable = new Set<string>();\n const visit = (name: string) => {\n if (reachable.has(name)) return;\n reachable.add(name);\n for (const segment of splitCommandChain(scripts[name] ?? '')) {\n for (const reference of scriptReferences(segment, scripts) ?? []) visit(reference);\n }\n };\n visit('verify');\n for (const command of ENGINEERING_FAST_COMMANDS) {\n if (!reachable.has(command)) add('package.json', 'verification-wiring', `verify must execute ${command}. Expected \"${BRANDLAB_EXPECTED_VERIFY_SCRIPT}\".`);\n }\n if (reachable.has('build')) add('package.json', 'single-build', 'Keep the production build separate from fast verify; run it once for the final candidate.');\n}\n\n/** Split a shell command on its chaining operators. */\nexport function splitCommandChain(command: string): string[] {\n return command.split(/&&|\\|\\||[;|&]/).map(segment => segment.trim()).filter(Boolean);\n}\n\n/**\n * The package scripts one command segment runs, or null when the segment is\n * not a recognised script invocation (npm run, npm test, run-s, run-p, npm-run-all).\n */\nexport function scriptReferences(segment: string, scripts: Readonly<Record<string, string>>): string[] | null {\n const words = segment.split(/\\s+/).filter(Boolean);\n while (words[0] && /^[A-Z_][A-Z0-9_]*=/.test(words[0])) words.shift();\n const [tool, ...rest] = words;\n if (tool === 'npm') {\n const [subcommand, ...args] = rest;\n if (subcommand === 'test' || subcommand === 't') return ['test'];\n if (subcommand === 'start' || subcommand === 'stop' || subcommand === 'restart') return [subcommand];\n if (subcommand === 'run' || subcommand === 'run-script') {\n const name = args.find(arg => !arg.startsWith('-'));\n return name ? [name] : null;\n }\n return null;\n }\n if (tool === 'run-s' || tool === 'run-p' || tool === 'npm-run-all') {\n const patterns: string[] = [];\n for (const word of rest) {\n if (word === '--') break;\n if (!word.startsWith('-')) patterns.push(word.replace(/^['\"]|['\"]$/g, ''));\n }\n if (patterns.length === 0) return null;\n // npm-run-all globs: `*` stays within one `:` segment; a whole `**` segment spans several.\n return patterns.flatMap(pattern => pattern.includes('*') || pattern.includes('?') || pattern.includes('[')\n ? Object.keys(scripts).filter(name => globMatch(pattern, name, { separator: ':', globstar: true }))\n : [pattern]);\n }\n return null;\n}\n\n// --- dependencies (section 1) ------------------------------------------------\n\nfunction inspectDependencies(pkg: PackageManifest, add: Add) {\n if (pkg.type !== 'module') add('package.json', 'module-type', 'Declare \"type\": \"module\".');\n const dependencies = { ...pkg.dependencies, ...pkg.devDependencies };\n for (const tool of DEV_TOOLING) {\n const spec = pkg.devDependencies?.[tool];\n if (!spec || !SEMVER.test(spec)) add('package.json', 'dev-tooling', `Pin ${tool} exactly as a development dependency.`);\n }\n // Packed preflight binds the four Brandlab packages to local file: archives; the evaluator verifies those.\n const ranges = Object.entries(dependencies)\n .filter(([name, spec]) => !SEMVER.test(spec) && !(name.startsWith('@brandlab-digital/') && spec.startsWith('file:')))\n .map(([name, spec]) => `${name}@${spec}`);\n if (ranges.length > 0) add('package.json', 'exact-pins', `Pin every dependency to the exact locked version: ${ranges.sort().join(', ')}.`);\n const next = dependencies.next;\n for (const companion of ['eslint-config-next', '@next/mdx']) {\n const spec = dependencies[companion];\n if (spec && spec !== next) add('package.json', 'framework-companion-pin', `${companion} must equal the next version (${next ?? 'missing'}); found ${spec}.`);\n }\n if (!dependencies['eslint-config-next']) add('package.json', 'framework-companion-pin', 'Declare eslint-config-next at the exact next version for brandlab.configs.next.');\n if (pkg.dependencies?.sharp || pkg.devDependencies?.sharp) add('package.json', 'sharp-override-only', 'Remove the direct sharp dependency; the release-owned overrides.sharp pin is the only declaration.');\n}\n\n// --- layout and naming (section 2) --------------------------------------------\n\nfunction inspectLayout(root: string, capabilities: ReturnType<typeof describeCapabilities>, add: Add) {\n for (const path of ['src/app', 'src/config', 'src/data', 'src/lib', 'src/components', 'tests']) {\n if (!isDirectory(join(root, path))) add(path, 'source-organisation', `Place the corresponding implementation under ${path}.`);\n }\n for (const path of RETIRED_ROOT_DIRECTORIES) {\n if (existsSync(join(root, path))) add(path, 'retired-source-layout', 'Migrate consumers to the current src responsibilities and remove the superseded directory.');\n }\n const required = [\n 'src/config/site.ts', 'src/config/analytics.ts', 'src/data/business.ts', 'src/data/routes.ts', 'src/data/redirects.ts',\n 'src/lib/seo/metadata.ts', 'src/instrumentation-client.ts', 'src/app/layout.tsx', 'src/app/robots.ts', 'src/app/sitemap.xml/route.ts',\n 'src/data/businessEvidence.ts',\n ...(capabilities.contactEnabled ? ['src/config/contact.ts', CONTACT_RUNTIME, 'src/app/api/contact/route.ts'] : []),\n ...(capabilities.reviewsEnabled ? ['src/config/reviews.ts'] : []),\n ...(capabilities.locationsDeclared ? ['src/data/locations/estate.ts'] : []),\n ];\n for (const path of required) {\n if (!existsSync(join(root, path))) add(path, 'owner-file', `The 3.0 layout places this owner at ${path}.`);\n }\n for (const [path, message] of [\n ['src/config/env.ts', 'Remove the local environment parser; site configuration is a source constant.'],\n ['src/lib/analytics', 'Remove the local analytics layer; installBrandlabInstrumentation owns it.'],\n ['src/lib/contact/definition.ts', 'Remove the local contact definition; the contract lives in src/config/contact.ts.'],\n ['src/lib/contact/constants.ts', 'Remove the local contact constants; the contract lives in src/config/contact.ts.'],\n ['src/lib/contact/runtime.ts', 'Remove the local contact runtime; POST uses createBrandlabContactRouteHandler.'],\n ['src/components/analytics/GoogleTag.tsx', 'Render BrandlabGoogleTag directly in src/app/layout.tsx.'],\n ['src/components/analytics/CoreWebVitalsReporter.tsx', 'Remove the web-vitals reporter.'],\n ['src/lib/seo/sitemaps', 'Remove the local sitemap builders; the sitemap route uses createBrandlabSitemapRoute.'],\n ['src/lib/seo/sitemaps.ts', 'Remove the local sitemap builders; the sitemap route uses createBrandlabSitemapRoute.'],\n ['src/lib/seo/schema/sanitize.ts', 'Remove the local schema sanitiser; the packages own sanitising.'],\n ['src/lib/seo/schema/SchemaScript.tsx', 'Import SchemaScript from @brandlab-digital/site-next/schema.'],\n ['src/lib/seo/index.ts', 'Remove the SEO barrel and import each module directly.'],\n ] as const) {\n if (existsSync(join(root, path))) add(path, 'retired-file', message);\n }\n\n if (isDirectory(join(root, 'src'))) {\n for (const entry of readdirSync(join(root, 'src'), { withFileTypes: true })) {\n if (entry.name.startsWith('.')) continue;\n const path = `src/${entry.name}`;\n if (entry.isDirectory() && SRC_DIRECTORIES.has(entry.name)) {\n if (entry.name === 'types' && walkProjectFiles(root, path).some(file => !file.endsWith('.d.ts'))) {\n add(path, 'standard-layout', 'src/types may hold only ambient .d.ts declarations.');\n }\n continue;\n }\n if (entry.isFile() && SRC_ROOT_FILES.test(entry.name)) continue;\n add(path, 'standard-layout', `${path} is outside the standard layout (src/{app,config,data,content,lib,components}).`);\n }\n }\n if (isDirectory(join(root, 'src/components'))) {\n for (const entry of readdirSync(join(root, 'src/components'), { withFileTypes: true })) {\n if (entry.name.startsWith('.') || entry.name === 'templates') continue;\n if (!entry.isDirectory() || !COMPONENT_ROLES.has(entry.name)) {\n add(`src/components/${entry.name}`, 'component-role', 'Components belong to one role: layout, ui, sections, features or page-families.');\n }\n }\n }\n for (const path of walkProjectFiles(root, 'src')) inspectFileName(root, path, add);\n}\n\nfunction inspectFileName(root: string, path: string, add: Add) {\n const name = posix.basename(path);\n const directory = posix.dirname(path);\n if (directory === 'src' && SRC_ROOT_FILES.test(name)) return;\n if (name.endsWith('.module.css')) {\n const component = name.replace(/\\.module\\.css$/, '');\n // Exact names from the directory listing: existsSync is case-insensitive on macOS but not on the Linux CI\n // (a button.module.css beside Button.tsx passed locally and failed in CI).\n const siblings = directoryEntries(join(root, directory));\n if (!['tsx', 'ts', 'jsx'].some(extension => siblings.has(`${component}.${extension}`))) {\n add(path, 'file-naming', `Keep ${name} beside the ${component} component it styles (the file names must match exactly, including case).`);\n }\n return;\n }\n if (path.startsWith('src/app/')) {\n // Images, fonts and metadata assets are framework-consumed; only code and styles are placed.\n if (!CODE_OR_STYLE.test(name)) return;\n const segments = path.split('/');\n const privateFolder = segments.slice(2, -1).find(segment => segment.startsWith('_') && segment !== '_components');\n if (privateFolder) {\n add(path, 'route-local-code', `Route-local code belongs in src/app/<route>/_components/, not ${privateFolder}/.`);\n return;\n }\n if (!segments.includes('_components')) {\n if (NEXT_SPECIAL_FILE.test(name) || path === 'src/app/globals.css') return;\n add(path, 'route-local-code', 'Route-local code belongs in src/app/<route>/_components/; framework files keep their reserved names.');\n return;\n }\n }\n if (!/\\.(?:ts|tsx)$/.test(name) || path.startsWith('src/content/')) return;\n if (name.endsWith('.tsx') && !PASCAL_COMPONENT.test(name)) {\n add(path, 'file-naming', 'Components use PascalCase .tsx file names.');\n } else if (name.endsWith('.ts') && !CAMEL_MODULE.test(name)) {\n add(path, 'file-naming', 'Data and helper modules use camelCase .ts file names.');\n }\n if (path.startsWith('src/components/page-families/') && name.endsWith('.tsx') && !/^[A-Z][A-Za-z0-9]*Page\\.tsx$/.test(name)) {\n add(path, 'file-naming', 'Page families are named <RouteKind>Page.tsx.');\n }\n}\n\n// --- module structure: barrels, ui data imports, estate ----------------------\n\nfunction inspectSourceModules(root: string, source: BrandlabSourceIndex, add: Add) {\n const resolver = createBrandlabModuleResolver(root, new Set(source.byPath.keys()));\n for (const file of source.files.filter(candidate => candidate.path.startsWith('src/'))) {\n const references = listModuleReferences(file);\n const forwarding = forwardingExports(file);\n if (isBarrel(file)) {\n add(file.path, 'no-barrels', 'This module only re-exports other modules; import each owner directly.');\n } else {\n for (const line of forwarding) {\n add(file.path, 'no-forwarding-exports', 'This export forwards another module; import the owner directly.', { line });\n }\n }\n if (file.path.startsWith('src/components/ui/')) {\n for (const reference of references.filter(candidate => candidate.kind !== 'export')) {\n const resolved = resolver(file.path, reference.specifier);\n if (resolved?.startsWith('src/data/') || /^@\\/data(?:\\/|$)/.test(reference.specifier)) {\n add(file.path, 'ui-imports-data', 'UI primitives never import data modules; pass prepared props from a section or route.', { line: reference.line });\n }\n }\n }\n inspectRegistryDerivedEstate(file, add);\n }\n const estate = source.byPath.get('src/data/locations/estate.ts');\n if (estate) {\n inspectRetainedExclusions(estate, add);\n inspectSiteOwnedLocations(estate, add);\n }\n}\n\n// --- server-only boundaries (3.2.1) ------------------------------------------\n\n/**\n * What a browser bundle must never carry. The contact route's delivery options and\n * the business evidence live in server-only modules, alias hosts in next.config, and\n * no module a client component reaches imports a server-only module or holds an\n * evidence record. (Next's build also refuses a client import of `server-only`; this\n * names the chain before a build is needed.) From 3.3.3 no module a client component\n * reaches imports the geography registry (site-core/geography, which the location\n * estate reads) or a package server entry: a browser bundle cannot resolve them.\n */\nfunction inspectServerBoundaries(\n root: string,\n capabilities: ReturnType<typeof describeCapabilities>,\n source: BrandlabSourceIndex,\n add: Add,\n) {\n const contact = source.byPath.get('src/config/contact.ts');\n const runtime = source.byPath.get(CONTACT_RUNTIME);\n if (capabilities.contactEnabled && runtime) {\n if (!importsServerOnly(runtime)) {\n add(CONTACT_RUNTIME, 'server-only-module', `${CONTACT_RUNTIME} imports 'server-only', so no client component can bundle the delivery options.`);\n }\n if (!declaresName(runtime, 'contactRuntime')) {\n add(CONTACT_RUNTIME, 'contact-runtime', `${CONTACT_RUNTIME} exports contactRuntime (the labels, email style and attachment policy createBrandlabContactRouteHandler takes).`);\n }\n }\n const moved = contact ? declaresName(contact, 'contactRuntime') : undefined;\n if (contact && moved) {\n add('src/config/contact.ts', 'contact-runtime', `contactRuntime belongs in ${CONTACT_RUNTIME}: the contact form imports src/config/contact.ts, so everything contactRuntime reads (the site identity, business data) reaches the browser.`, { line: moved });\n }\n\n const evidence = source.byPath.get(BUSINESS_EVIDENCE);\n if (evidence) {\n if (!importsServerOnly(evidence)) {\n add(BUSINESS_EVIDENCE, 'server-only-module', `${BUSINESS_EVIDENCE} imports 'server-only', so no client component can bundle the evidence records.`);\n }\n if (findImportedCalls(evidence, /^@brandlab-digital\\/site-core\\/business$/, 'defineBrandlabBusiness').length === 0) {\n add(BUSINESS_EVIDENCE, 'business-evidence', `${BUSINESS_EVIDENCE} declares the business facts with defineBrandlabBusiness, each with its evidence.`);\n }\n }\n const values = source.byPath.get(BUSINESS_VALUES);\n if (values) {\n const call = BUSINESS_FACT_CALLS.exec(values.executable);\n const record = evidenceRecordLines(values)[0];\n if (call || record) {\n add(BUSINESS_VALUES, 'business-evidence', `${BUSINESS_VALUES} holds the display values only (businessFacts); defineBrandlabBusiness and the evidence belong in ${BUSINESS_EVIDENCE}, which stays on the server.`,\n { line: record ?? lineAtIndex(values.text, call!.index) });\n }\n }\n\n const site = source.byPath.get(SITE_IDENTITY);\n const aliasHosts = site ? declaredAliasHosts(site) : undefined;\n if (aliasHosts) {\n add(SITE_IDENTITY, 'alias-hosts', 'Declare the alias hosts in next.config.ts with defineBrandlabNextConfig({ aliasHosts }): client components import the site identity, so its alias hosts reach the browser.', { line: aliasHosts });\n }\n\n const resolver = createBrandlabModuleResolver(root, new Set(source.byPath.keys()));\n const reached = new Map<string, string | null>();\n const queue = source.files.filter(file => file.path.startsWith('src/') && (isClientModule(file) || /^src\\/instrumentation-client\\.[cm]?[jt]sx?$/.test(file.path)));\n for (const file of queue) reached.set(file.path, null);\n while (queue.length > 0) {\n const file = queue.shift()!;\n for (const reference of listModuleReferences(file)) {\n if (reference.typeOnly) continue;\n const target = resolver(file.path, reference.specifier);\n if (!target || reached.has(target)) continue;\n reached.set(target, file.path);\n const next = source.byPath.get(target);\n if (next) queue.push(next);\n }\n }\n const chain = (path: string) => {\n const steps: string[] = [];\n for (let at: string | null | undefined = path; at; at = reached.get(at)) steps.unshift(at);\n return steps.join(' → ');\n };\n for (const path of [...reached.keys()].sort()) {\n const file = source.byPath.get(path);\n if (!file) continue;\n if (importsServerOnly(file)) {\n add(path, 'client-bundle-boundary', `A client component imports this server-only module (${chain(path)}); pass what it needs as props from a server component.`);\n continue;\n }\n const serverEntry = listModuleReferences(file).find(reference => !reference.typeOnly && SERVER_PACKAGE_ENTRIES.has(reference.specifier));\n if (serverEntry) {\n add(path, 'client-bundle-boundary', `${SERVER_PACKAGE_ENTRIES.get(serverEntry.specifier)} reaches the browser (${chain(path)} → ${serverEntry.specifier}), and from 3.3.3 a browser bundle cannot resolve it, so the build fails. ${serverEntry.specifier === GEOGRAPHY_ENTRY ? 'Build the location lists a client component shows (navigation, service areas) in a server component and pass them as plain props; keep error pages and the analytics binding free of location data.' : 'Keep it in server components and route handlers.'}`, { line: serverEntry.line });\n continue;\n }\n const record = evidenceRecordLines(file)[0];\n if (record) {\n add(path, 'client-bundle-boundary', `An evidence record (sourceKind, verifiedAt) reaches the browser (${chain(path)}); keep evidence in ${BUSINESS_EVIDENCE}.`, { line: record });\n }\n }\n}\n\n/** A module whose directive prologue says 'use client'. */\nfunction isClientModule(file: BrandlabSourceFile): boolean {\n for (const statement of parseBrandlabSourceFile(file).statements) {\n if (!ts.isExpressionStatement(statement) || !ts.isStringLiteral(statement.expression)) return false;\n if (statement.expression.text === 'use client') return true;\n }\n return false;\n}\n\n/** `import 'server-only'` at the top level. */\nfunction importsServerOnly(file: BrandlabSourceFile): boolean {\n return parseBrandlabSourceFile(file).statements.some(statement =>\n ts.isImportDeclaration(statement) && !statement.importClause &&\n ts.isStringLiteral(statement.moduleSpecifier) && statement.moduleSpecifier.text === 'server-only');\n}\n\n/** The line of a top-level declaration of `name`, if the module declares it. */\nfunction declaresName(file: BrandlabSourceFile, name: string): number | undefined {\n for (const statement of parseBrandlabSourceFile(file).statements) {\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.name.text === name) return lineOfNode(file, statement);\n }\n } else if ((ts.isFunctionDeclaration(statement) || ts.isClassDeclaration(statement)) && statement.name?.text === name) {\n return lineOfNode(file, statement);\n }\n }\n return undefined;\n}\n\n/** Lines of object literals that are evidence records: they name both sourceKind and verifiedAt. */\nfunction evidenceRecordLines(file: BrandlabSourceFile): number[] {\n const lines: number[] = [];\n const visit = (node: ts.Node) => {\n if (ts.isObjectLiteralExpression(node)) {\n const names = new Set(node.properties.map(property => property.name && (ts.isIdentifier(property.name) || ts.isStringLiteral(property.name)) ? property.name.text : ''));\n if (names.has('sourceKind') && names.has('verifiedAt')) lines.push(lineOfNode(file, node));\n }\n ts.forEachChild(node, visit);\n };\n visit(parseBrandlabSourceFile(file));\n return lines;\n}\n\n/** The line of a non-empty `aliasHosts` in the defineBrandlabSite call. */\nfunction declaredAliasHosts(file: BrandlabSourceFile): number | undefined {\n for (const call of findImportedCalls(file, /^@brandlab-digital\\/site-core\\/site$/, 'defineBrandlabSite')) {\n let definition: ts.Expression | undefined = call.arguments[0];\n while (definition && (ts.isAsExpression(definition) || ts.isSatisfiesExpression(definition) || ts.isParenthesizedExpression(definition))) {\n definition = definition.expression;\n }\n if (!definition || !ts.isObjectLiteralExpression(definition)) continue;\n const property = definition.properties.find(candidate =>\n (ts.isPropertyAssignment(candidate) || ts.isShorthandPropertyAssignment(candidate)) &&\n (ts.isIdentifier(candidate.name) || ts.isStringLiteral(candidate.name)) && candidate.name.text === 'aliasHosts');\n if (!property) continue;\n const array = ts.isPropertyAssignment(property)\n ? arrayLiteral(file, property.initializer)\n : ts.isShorthandPropertyAssignment(property) ? arrayLiteral(file, property.name) : undefined;\n if (array && array.elements.length === 0) continue;\n return lineOfNode(file, property);\n }\n return undefined;\n}\n\n/** Lines of `export ... from` statements and exports of names this module only imported. */\nfunction forwardingExports(file: BrandlabSourceFile): number[] {\n const source = parseBrandlabSourceFile(file);\n const imported = new Set(listModuleReferences(file).filter(reference => reference.kind === 'import').flatMap(reference => reference.bindings.map(binding => binding.local)));\n const lines: number[] = [];\n for (const statement of source.statements) {\n const forwards =\n (ts.isExportDeclaration(statement) && (statement.moduleSpecifier !== undefined ||\n (statement.exportClause !== undefined && ts.isNamedExports(statement.exportClause) &&\n statement.exportClause.elements.some(element => imported.has((element.propertyName ?? element.name).text))))) ||\n (ts.isExportAssignment(statement) && ts.isIdentifier(statement.expression) && imported.has(statement.expression.text));\n if (forwards) lines.push(lineOfNode(file, statement));\n }\n return lines;\n}\n\n/** A module with no declarations or statements of its own besides imports and exports. */\nfunction isBarrel(file: BrandlabSourceFile): boolean {\n const statements = parseBrandlabSourceFile(file).statements;\n return statements.length > 0 && forwardingExports(file).length > 0 &&\n statements.every(statement => ts.isImportDeclaration(statement) || ts.isExportDeclaration(statement) || ts.isExportAssignment(statement));\n}\n\nfunction inspectRegistryDerivedEstate(file: BrandlabSourceFile, add: Add) {\n const derived = listModuleReferences(file)\n .filter(reference => reference.kind === 'import' && /^@brandlab-digital\\/site-core\\//.test(reference.specifier))\n .flatMap(reference => reference.bindings.filter(binding => /WebsiteSuburbs$/.test(binding.imported)).map(binding => ({ ...binding, line: reference.line })));\n const namespaceUse = file.executable.match(/\\.\\s*([a-z][A-Za-z]*WebsiteSuburbs)\\b/);\n const first = derived[0] ?? (namespaceUse ? { imported: namespaceUse[1]!, line: lineAtIndex(file.text, namespaceUse.index ?? 0) } : null);\n if (!first) return;\n add(file.path, 'estate-registry-derived',\n `${first.imported} is a registry candidate list; the published estate in src/data/locations/estate.ts must be literal data, never derived from it.`, { line: first.line });\n}\n\nfunction inspectRetainedExclusions(file: BrandlabSourceFile, add: Add) {\n for (const call of findImportedCalls(file, /^@brandlab-digital\\/site-core\\/locations$/, 'defineLocationEstate')) {\n const retained = objectPropertyValue(call.arguments[0], 'retainedExclusions');\n if (!retained || !ts.isArrayLiteralExpression(retained) || retained.elements.length === 0) continue;\n const slugs = retained.elements.map(element => {\n if (ts.isStringLiteralLike(element)) return element.text;\n const slug = objectPropertyValue(element, 'slug');\n return slug && ts.isStringLiteralLike(slug) ? slug.text : null;\n }).filter((slug): slug is string => Boolean(slug));\n add(file.path, 'estate-retained-exclusions',\n `${retained.elements.length} policy-excluded location(s) stay published for a later SEO decision${slugs.length ? `: ${slugs.join(', ')}` : ''}.`,\n { severity: 'info', line: lineOfNode(file, retained) });\n }\n}\n\n/** An array literal, directly or through a top-level `const name = [...]` (optionally `as const`) in the same file. */\nfunction arrayLiteral(file: BrandlabSourceFile, node: ts.Expression | undefined): ts.ArrayLiteralExpression | undefined {\n const unwrap = (expression: ts.Expression | undefined): ts.Expression | undefined => {\n let current = expression;\n while (current && (ts.isAsExpression(current) || ts.isSatisfiesExpression(current) || ts.isParenthesizedExpression(current))) {\n current = current.expression;\n }\n return current;\n };\n const value = unwrap(node);\n if (value && ts.isArrayLiteralExpression(value)) return value;\n if (!value || !ts.isIdentifier(value)) return undefined;\n for (const statement of parseBrandlabSourceFile(file).statements) {\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.name.text === value.text) {\n const initializer = unwrap(declaration.initializer);\n return initializer && ts.isArrayLiteralExpression(initializer) ? initializer : undefined;\n }\n }\n }\n return undefined;\n}\n\n/** Report the locations the site publishes outside the shared registry, with each group's reason. */\nfunction inspectSiteOwnedLocations(file: BrandlabSourceFile, add: Add) {\n for (const call of findImportedCalls(file, /^@brandlab-digital\\/site-core\\/locations$/, 'defineLocationEstate')) {\n const declared = objectPropertyValue(call.arguments[0], 'siteOwned');\n if (!declared) continue;\n const groups = arrayLiteral(file, declared);\n if (!groups) {\n add(file.path, 'estate-site-owned',\n 'siteOwned must be literal data in src/data/locations/estate.ts: [{ reason, slugs }], never derived.', { line: lineOfNode(file, declared) });\n continue;\n }\n if (groups.elements.length === 0) continue;\n let total = 0;\n const summaries = groups.elements.map(element => {\n const reason = objectPropertyValue(element, 'reason');\n const slugs = arrayLiteral(file, objectPropertyValue(element, 'slugs'));\n const count = slugs?.elements.length;\n total += count ?? 0;\n const label = reason && ts.isStringLiteralLike(reason) ? reason.text : 'a reason that is not a string literal';\n return `${count ?? 'an unknown number of'} for \"${label}\"`;\n });\n add(file.path, 'estate-site-owned',\n `${total} location(s) are published outside the shared geography registry, declared site-owned: ${summaries.join('; ')}.`,\n { severity: 'info', line: lineOfNode(file, groups) });\n }\n}\n\nfunction lineAtIndex(text: string, index: number): number {\n return text.slice(0, index).split('\\n').length;\n}\n\n// --- tests (sections 2 and 6) -------------------------------------------------\n\nfunction inspectTests(root: string, capabilities: ReturnType<typeof describeCapabilities>, add: Add) {\n if (!isDirectory(join(root, 'tests'))) return;\n for (const entry of readdirSync(join(root, 'tests'), { withFileTypes: true })) {\n if (entry.name.startsWith('.')) continue;\n if (!entry.isDirectory() || !TEST_DIRECTORIES.has(entry.name)) {\n add(`tests/${entry.name}`, 'test-layout', 'Tests live in tests/{config,data,lib,components,e2e,support}.');\n }\n }\n const required = [\n 'tests/data/routes.test.ts', 'tests/config/analytics.test.ts',\n 'tests/e2e/estate.spec.ts', 'tests/e2e/analytics.spec.ts', 'tests/e2e/families.spec.ts',\n ...(capabilities.contactEnabled ? ['tests/config/contact.test.ts', 'tests/e2e/contact.spec.ts'] : []),\n ];\n for (const path of required) {\n if (!existsSync(join(root, path))) add(path, 'shared-tests', `The shared 3.0 test set includes ${path}.`);\n }\n for (const path of walkProjectFiles(root, 'tests')) {\n if (/-darwin\\.png$/.test(path)) add(path, 'committed-snapshots', 'Delete committed darwin snapshots; rendered checks run against the CI build.');\n }\n}\n\n// --- dev presets (section 4) -------------------------------------------------\n\n/** The two accepted default exports: the plain preset, or the preset plus the Site System rules (same identifier twice). */\nconst ESLINT_PRESET_EXPORT = /export\\s+default\\s+(?:([A-Za-z_$][\\w$]*)\\.configs\\.next|\\[\\s*\\.\\.\\.\\s*([A-Za-z_$][\\w$]*)\\.configs\\.next\\s*,\\s*\\2\\.configs\\[\\s*(['\"])site-system\\3\\s*\\]\\s*,?\\s*\\])\\s*;?\\s*$/;\n\nfunction inspectToolPresets(root: string, add: Add) {\n const eslint = readOptional(join(root, 'eslint.config.mjs'));\n if (eslint === null) add('eslint.config.mjs', 'tool-preset', 'Add eslint.config.mjs: export default brandlab.configs.next.');\n else if (!/@brandlab-digital\\/eslint-plugin/.test(eslint) || !ESLINT_PRESET_EXPORT.test(eslint.trim())) {\n add('eslint.config.mjs', 'tool-preset', \"eslint.config.mjs is exactly `export default brandlab.configs.next`, or, for a site that declares a siteSystem tier, `export default [...brandlab.configs.next, brandlab.configs['site-system']]` (imported from @brandlab-digital/eslint-plugin).\");\n }\n const knip = readOptional(join(root, 'knip.ts'));\n if (knip === null) add('knip.ts', 'tool-preset', 'Add knip.ts: export default brandlabKnip({ mdx?, entry? }).');\n else if (!/@brandlab-digital\\/conformance\\/knip/.test(knip) || !/export\\s+default\\s+brandlabKnip\\s*\\(/.test(knip)) {\n add('knip.ts', 'tool-preset', 'knip.ts exports brandlabKnip({ mdx?, entry? }) from @brandlab-digital/conformance/knip.');\n }\n if (!['playwright.config.ts', 'playwright.config.mts'].some(name => existsSync(join(root, name)))) {\n add('playwright.config.ts', 'tool-preset', 'Add the Playwright configuration for the shared e2e specs.');\n }\n if (!['vitest.config.ts', 'vitest.config.mts'].some(name => existsSync(join(root, name)))) {\n add('vitest.config.ts', 'tool-preset', 'Add the Vitest configuration for the binding tests.');\n }\n}\n\n// --- CI, dependencies, Vercel and docs (section 6) ---------------------------\n\nfunction inspectDelivery(root: string, add: Add) {\n const workflowDirectory = join(root, '.github/workflows');\n const workflows = isDirectory(workflowDirectory) ? readdirSync(workflowDirectory).filter(name => /\\.ya?ml$/.test(name)).sort() : [];\n const callers = workflows.filter(name => /uses\\s*:\\s*['\"]?RomieDandan\\/brandlab\\/\\.github\\/workflows\\/verify-next\\.yml@/.test(readFileSync(join(workflowDirectory, name), 'utf8')));\n if (callers.length !== 1 || callers[0] !== 'verify.yml') {\n add('.github/workflows/verify.yml', 'ci-workflow', `Exactly one .github/workflows/verify.yml calls RomieDandan/brandlab/.github/workflows/verify-next.yml at the fleet SHA (found ${callers.length ? callers.join(', ') : 'none'}).`);\n }\n for (const path of ['.github/dependabot.yml', '.github/dependabot.yaml', 'renovate.json', 'renovate.json5', '.github/renovate.json', '.renovaterc', '.renovaterc.json']) {\n if (existsSync(join(root, path))) add(path, 'dependency-bots', 'Exact pins move with Brandlab releases; remove Dependabot/Renovate version updates.');\n }\n const vercel = readOptional(join(root, 'vercel.json'));\n let installCommand: unknown;\n try { installCommand = vercel === null ? undefined : JSON.parse(vercel).installCommand; } catch { installCommand = undefined; }\n if (installCommand !== 'npm ci') add('vercel.json', 'vercel-install', 'vercel.json sets installCommand to \"npm ci\".');\n let regions: unknown;\n try { regions = vercel === null ? undefined : JSON.parse(vercel).regions; } catch { regions = undefined; }\n if (!Array.isArray(regions) || regions.length !== 1 || regions[0] !== BRANDLAB_FUNCTION_REGION) {\n add('vercel.json', 'vercel-region', `vercel.json runs the server functions in Sydney: \"regions\": [\"${BRANDLAB_FUNCTION_REGION}\"] (found ${regions === undefined ? 'no regions' : JSON.stringify(regions)}). The visitors are in Australia; a Washington (iad1) function adds a Pacific round trip to every request it serves.`);\n }\n let ignoreCommand: unknown;\n try { ignoreCommand = vercel === null ? undefined : JSON.parse(vercel).ignoreCommand; } catch { ignoreCommand = undefined; }\n if (ignoreCommand !== BRANDLAB_VERCEL_IGNORE_COMMAND) {\n add('vercel.json', 'vercel-ignore-build', `vercel.json skips a production build only when a push changes nothing but .github/, docs/ or root Markdown files: \"ignoreCommand\": ${JSON.stringify(BRANDLAB_VERCEL_IGNORE_COMMAND)} (found ${ignoreCommand === undefined ? 'none' : JSON.stringify(ignoreCommand)}). A CI-only change otherwise rebuilds production and empties its CDN cache; previews and anything git cannot compare still build.`);\n }\n\n if (!existsSync(join(root, 'README.md'))) add('README.md', 'project-docs', 'Add the generated README.md (commands, architecture, environment names, deployment and rollback).');\n const agents = join(root, 'AGENTS.md');\n if (!existsSync(agents)) add('AGENTS.md', 'project-docs', 'Add AGENTS.md with the fixed sources of truth and guardrails.');\n else if (statSync(agents).size > 3_584) add('AGENTS.md', 'project-docs', `AGENTS.md is ${statSync(agents).size} bytes; keep it to about 3 KB and archive history to the control repo.`);\n const claude = readOptional(join(root, 'CLAUDE.md'));\n if (claude === null || claude.trim() !== '@AGENTS.md') add('CLAUDE.md', 'project-docs', 'CLAUDE.md is the single line @AGENTS.md.');\n}\n\nconst directoryListings = new Map<string, ReadonlySet<string>>();\n\n/** The exact file names in a directory (cached per check run). */\nfunction directoryEntries(path: string): ReadonlySet<string> {\n let entries = directoryListings.get(path);\n if (!entries) {\n try { entries = new Set(readdirSync(path)); } catch { entries = new Set(); }\n directoryListings.set(path, entries);\n }\n return entries;\n}\n\nfunction readOptional(path: string): string | null {\n return existsSync(path) ? readFileSync(path, 'utf8') : null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"engineering.js","sourceRoot":"","sources":["../src/engineering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,GAGjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,CAAC,MAAM,yBAAyB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,EAAE,CAAC;QAAC,CAAC;QAC5E,iBAAiB,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9D,CAAC","sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';\nimport { join, posix } from 'node:path';\nimport ts from 'typescript';\nimport { globMatch } from './glob.js';\nimport {\n collectBrandlabSource,\n createBrandlabModuleResolver,\n findImportedCalls,\n isDirectory,\n lineOfNode,\n listModuleReferences,\n objectPropertyValue,\n parseBrandlabSourceFile,\n walkProjectFiles,\n type BrandlabSourceFile,\n type BrandlabSourceIndex,\n} from './source-files.js';\nimport { describeCapabilities } from './static-rules.js';\nimport { originRegionProblems } from './origin-region.js';\nimport { parseProjectHosting } from './site-system/config.js';\n\nexport const ENGINEERING_FAST_COMMANDS = ['typecheck', 'lint', 'test', 'check:unused', 'check:unused:production', 'check:standards'] as const;\n\n/** The exact fast verification command from the Brandlab 3.0 target (section 6). */\nexport const BRANDLAB_EXPECTED_VERIFY_SCRIPT =\n 'npm run check:standards && npm run typecheck && npm run lint && npm run test && npm run check:unused && npm run check:unused:production';\n\n/** Scripts whose exact values the 3.0 target fixes; dev and start must exist. */\nexport const BRANDLAB_EXPECTED_SCRIPTS: Readonly<Record<string, string>> = Object.freeze({\n build: 'next build',\n typecheck: 'next typegen && tsc --noEmit',\n lint: 'eslint .',\n test: 'vitest run',\n 'test:e2e': 'playwright test',\n 'check:unused': 'knip',\n 'check:unused:production': 'knip --production',\n 'check:standards': 'brandlab-verify --mode ci --engineering',\n});\n\nexport type EngineeringFindingSeverity = 'blocker' | 'info';\nexport interface EngineeringFinding { path: string; rule: string; message: string; severity: EngineeringFindingSeverity; line?: number }\nexport interface EngineeringCheck {\n status: 'pass' | 'blocked';\n findings: EngineeringFinding[];\n coverage: string;\n outstandingEvidence: readonly string[];\n}\n\ninterface PackageManifest {\n type?: string;\n scripts?: Record<string, string>;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n}\n\nconst SRC_DIRECTORIES = new Set(['app', 'config', 'data', 'content', 'lib', 'components', 'types']);\nconst SRC_ROOT_FILES = /^(?:instrumentation(?:-client)?|proxy|mdx-components)\\.(?:ts|tsx)$/;\nconst COMPONENT_ROLES = new Set(['layout', 'ui', 'sections', 'features', 'page-families']);\nconst TEST_DIRECTORIES = new Set(['config', 'data', 'lib', 'components', 'e2e', 'support']);\nconst RETIRED_ROOT_DIRECTORIES = ['app', 'components', 'data', 'lib', 'config', 'content', 'hooks', 'context', 'utils', 'src/components/templates'];\nconst DEV_TOOLING = ['eslint', 'vitest', '@playwright/test', 'knip'];\nconst NEXT_SPECIAL_FILE = /^(?:page|layout|template|loading|error|global-error|not-found|global-not-found|forbidden|unauthorized|default|route|opengraph-image|twitter-image|icon|apple-icon|sitemap|robots|manifest)\\.(?:ts|tsx|js|jsx|mdx)$/;\nconst CODE_OR_STYLE = /\\.(?:[cm]?[jt]sx?|mdx|css)$/;\nconst PASCAL_COMPONENT = /^[A-Z][A-Za-z0-9]*\\.tsx$/;\nconst CAMEL_MODULE = /^[a-z][A-Za-z0-9]*(?:\\.d)?\\.ts$/;\nconst SEMVER = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$/;\n\n/**\n * The default Vercel function region (3.2.1): Sydney. From 3.13.0 a site may record another in brandlab.config.ts\n * (`hosting.originRegion`) with an origin-region-v1 decision; `vercel.json` regions must equal the recorded value.\n */\nexport const BRANDLAB_FUNCTION_REGION = 'syd1';\n/**\n * The Vercel ignored build step of every Brandlab site (3.3.3). Exit 0 skips a deployment, anything else builds it:\n * a production deployment is skipped only when git shows every change since the last successful production\n * deployment is in .github/, docs/ or a root Markdown file. Previews, a redeploy of the same commit, a missing or\n * unknown previous commit and any git error all build. brandlab-migrate S10 writes the same command.\n */\nexport const BRANDLAB_VERCEL_IGNORE_COMMAND =\n `[ \"$VERCEL_ENV\" = production ] && [ \"$VERCEL_GIT_PREVIOUS_SHA\" != \"$VERCEL_GIT_COMMIT_SHA\" ] && git diff --quiet \"$VERCEL_GIT_PREVIOUS_SHA\" HEAD -- . ':!.github' ':!docs' ':(exclude,glob)*.md' && exit 0 || exit 1`;\n/** The contact route's delivery options (labels, email style, attachment policy): server-only (3.2.1). */\nconst CONTACT_RUNTIME = 'src/config/contactRuntime.ts';\n/** The business facts' evidence (defineBrandlabBusiness): server-only (3.2.1). */\nconst BUSINESS_EVIDENCE = 'src/data/businessEvidence.ts';\nconst BUSINESS_VALUES = 'src/data/business.ts';\nconst SITE_IDENTITY = 'src/config/site.ts';\nconst BUSINESS_FACT_CALLS = /\\b(?:defineBrandlabBusiness|verifiedFact|unknownFact|notApplicableFact)\\s*\\(/;\nconst GEOGRAPHY_ENTRY = '@brandlab-digital/site-core/geography';\n/**\n * Package entries a browser bundle cannot resolve from 3.3.3 (their exports map `browser` to null): the geography\n * registries and website-location policies, which the location estate reads, and the server halves of contact and reviews\n * (3.5.0 adds the Business Profile reviews feed client).\n */\nconst SERVER_PACKAGE_ENTRIES: ReadonlyMap<string, string> = new Map([\n [GEOGRAPHY_ENTRY, 'The Brandlab geography registry and website-location policy (server data, about 190 KB)'],\n ['@brandlab-digital/site-next/contact/server', 'The contact route runtime'],\n ['@brandlab-digital/site-next/google-reviews/server', 'The Google reviews route runtime'],\n ['@brandlab-digital/site-next/google-business-reviews/server', 'The Business Profile reviews feed client (it reads the feed token)'],\n]);\n\n/** Opt-in structural check. Static success must never masquerade as whole-project acceptance. */\nexport function checkEngineeringStructure(root: string): EngineeringCheck {\n directoryListings.clear();\n const findings: EngineeringFinding[] = [];\n const add = (path: string, rule: string, message: string, extra: { severity?: EngineeringFindingSeverity; line?: number } = {}) =>\n findings.push({ path, rule, message, severity: extra.severity ?? 'blocker', ...(extra.line ? { line: extra.line } : {}) });\n let pkg: PackageManifest = {};\n try { pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')); }\n catch { add('package.json', 'package-readable', 'A readable package.json is required.'); }\n const config = existsSync(join(root, 'brandlab.config.ts')) ? readFileSync(join(root, 'brandlab.config.ts'), 'utf8') : null;\n const capabilities = describeCapabilities(root, config);\n\n const source = collectBrandlabSource(root);\n\n inspectCommands(pkg, add);\n inspectDependencies(pkg, add);\n inspectLayout(root, capabilities, add);\n inspectSourceModules(root, source, add);\n inspectServerBoundaries(root, capabilities, source, add);\n inspectTests(root, capabilities, add);\n inspectToolPresets(root, add);\n inspectDelivery(root, add, config);\n\n return { status: findings.some(finding => finding.severity === 'blocker') ? 'blocked' : 'pass', findings,\n coverage: 'Static layout, naming, command, dependency-pin, tool-preset, CI, deployment and documentation structure only. This is not engineering-standard completion.',\n outstandingEvidence: ['Usage and deletion review including assets, configuration and dynamic references', 'Business data and component/style ownership review', 'Clean install, fast checks and production build', 'Full discovered technical URL estate', 'All distinct page families and important browser journeys', 'Exact-source protected Preview', 'Reporting/Ads provider cutover and authorised production verification'] };\n}\n\ntype Add = (path: string, rule: string, message: string, extra?: { severity?: EngineeringFindingSeverity; line?: number }) => void;\n\n// --- commands (section 6) ----------------------------------------------------\n\nfunction inspectCommands(pkg: PackageManifest, add: Add) {\n const scripts = pkg.scripts ?? {};\n for (const command of ['dev', 'start', ...ENGINEERING_FAST_COMMANDS, 'verify', 'build', 'test:e2e']) {\n if (!scripts[command]?.trim()) add('package.json', 'command-contract', `Missing ${command} command.`);\n }\n for (const [name, expected] of Object.entries(BRANDLAB_EXPECTED_SCRIPTS)) {\n const actual = scripts[name]?.trim();\n if (actual && actual.replace(/\\s+/g, ' ') !== expected) {\n add('package.json', 'script-contract', `${name} must be exactly \"${expected}\" (found \"${actual}\").`);\n }\n }\n const verify = scripts.verify?.trim();\n if (verify) {\n const unrecognised = splitCommandChain(verify).filter(segment => scriptReferences(segment, scripts) === null);\n if (unrecognised.length > 0) {\n add('package.json', 'verification-command-form',\n `verify may only chain package scripts (npm run <script>, npm test, run-s, run-p); \"${unrecognised.join('\", \"')}\" is not recognised. Expected \"${BRANDLAB_EXPECTED_VERIFY_SCRIPT}\".`);\n }\n }\n const reachable = new Set<string>();\n const visit = (name: string) => {\n if (reachable.has(name)) return;\n reachable.add(name);\n for (const segment of splitCommandChain(scripts[name] ?? '')) {\n for (const reference of scriptReferences(segment, scripts) ?? []) visit(reference);\n }\n };\n visit('verify');\n for (const command of ENGINEERING_FAST_COMMANDS) {\n if (!reachable.has(command)) add('package.json', 'verification-wiring', `verify must execute ${command}. Expected \"${BRANDLAB_EXPECTED_VERIFY_SCRIPT}\".`);\n }\n if (reachable.has('build')) add('package.json', 'single-build', 'Keep the production build separate from fast verify; run it once for the final candidate.');\n}\n\n/** Split a shell command on its chaining operators. */\nexport function splitCommandChain(command: string): string[] {\n return command.split(/&&|\\|\\||[;|&]/).map(segment => segment.trim()).filter(Boolean);\n}\n\n/**\n * The package scripts one command segment runs, or null when the segment is\n * not a recognised script invocation (npm run, npm test, run-s, run-p, npm-run-all).\n */\nexport function scriptReferences(segment: string, scripts: Readonly<Record<string, string>>): string[] | null {\n const words = segment.split(/\\s+/).filter(Boolean);\n while (words[0] && /^[A-Z_][A-Z0-9_]*=/.test(words[0])) words.shift();\n const [tool, ...rest] = words;\n if (tool === 'npm') {\n const [subcommand, ...args] = rest;\n if (subcommand === 'test' || subcommand === 't') return ['test'];\n if (subcommand === 'start' || subcommand === 'stop' || subcommand === 'restart') return [subcommand];\n if (subcommand === 'run' || subcommand === 'run-script') {\n const name = args.find(arg => !arg.startsWith('-'));\n return name ? [name] : null;\n }\n return null;\n }\n if (tool === 'run-s' || tool === 'run-p' || tool === 'npm-run-all') {\n const patterns: string[] = [];\n for (const word of rest) {\n if (word === '--') break;\n if (!word.startsWith('-')) patterns.push(word.replace(/^['\"]|['\"]$/g, ''));\n }\n if (patterns.length === 0) return null;\n // npm-run-all globs: `*` stays within one `:` segment; a whole `**` segment spans several.\n return patterns.flatMap(pattern => pattern.includes('*') || pattern.includes('?') || pattern.includes('[')\n ? Object.keys(scripts).filter(name => globMatch(pattern, name, { separator: ':', globstar: true }))\n : [pattern]);\n }\n return null;\n}\n\n// --- dependencies (section 1) ------------------------------------------------\n\nfunction inspectDependencies(pkg: PackageManifest, add: Add) {\n if (pkg.type !== 'module') add('package.json', 'module-type', 'Declare \"type\": \"module\".');\n const dependencies = { ...pkg.dependencies, ...pkg.devDependencies };\n for (const tool of DEV_TOOLING) {\n const spec = pkg.devDependencies?.[tool];\n if (!spec || !SEMVER.test(spec)) add('package.json', 'dev-tooling', `Pin ${tool} exactly as a development dependency.`);\n }\n // Packed preflight binds the four Brandlab packages to local file: archives; the evaluator verifies those.\n const ranges = Object.entries(dependencies)\n .filter(([name, spec]) => !SEMVER.test(spec) && !(name.startsWith('@brandlab-digital/') && spec.startsWith('file:')))\n .map(([name, spec]) => `${name}@${spec}`);\n if (ranges.length > 0) add('package.json', 'exact-pins', `Pin every dependency to the exact locked version: ${ranges.sort().join(', ')}.`);\n const next = dependencies.next;\n for (const companion of ['eslint-config-next', '@next/mdx']) {\n const spec = dependencies[companion];\n if (spec && spec !== next) add('package.json', 'framework-companion-pin', `${companion} must equal the next version (${next ?? 'missing'}); found ${spec}.`);\n }\n if (!dependencies['eslint-config-next']) add('package.json', 'framework-companion-pin', 'Declare eslint-config-next at the exact next version for brandlab.configs.next.');\n if (pkg.dependencies?.sharp || pkg.devDependencies?.sharp) add('package.json', 'sharp-override-only', 'Remove the direct sharp dependency; the release-owned overrides.sharp pin is the only declaration.');\n}\n\n// --- layout and naming (section 2) --------------------------------------------\n\nfunction inspectLayout(root: string, capabilities: ReturnType<typeof describeCapabilities>, add: Add) {\n for (const path of ['src/app', 'src/config', 'src/data', 'src/lib', 'src/components', 'tests']) {\n if (!isDirectory(join(root, path))) add(path, 'source-organisation', `Place the corresponding implementation under ${path}.`);\n }\n for (const path of RETIRED_ROOT_DIRECTORIES) {\n if (existsSync(join(root, path))) add(path, 'retired-source-layout', 'Migrate consumers to the current src responsibilities and remove the superseded directory.');\n }\n const required = [\n 'src/config/site.ts', 'src/config/analytics.ts', 'src/data/business.ts', 'src/data/routes.ts', 'src/data/redirects.ts',\n 'src/lib/seo/metadata.ts', 'src/instrumentation-client.ts', 'src/app/layout.tsx', 'src/app/robots.ts', 'src/app/sitemap.xml/route.ts',\n 'src/data/businessEvidence.ts',\n ...(capabilities.contactEnabled ? ['src/config/contact.ts', CONTACT_RUNTIME, 'src/app/api/contact/route.ts'] : []),\n ...(capabilities.reviewsEnabled ? ['src/config/reviews.ts'] : []),\n ...(capabilities.locationsDeclared ? ['src/data/locations/estate.ts'] : []),\n ];\n for (const path of required) {\n if (!existsSync(join(root, path))) add(path, 'owner-file', `The 3.0 layout places this owner at ${path}.`);\n }\n for (const [path, message] of [\n ['src/config/env.ts', 'Remove the local environment parser; site configuration is a source constant.'],\n ['src/lib/analytics', 'Remove the local analytics layer; installBrandlabInstrumentation owns it.'],\n ['src/lib/contact/definition.ts', 'Remove the local contact definition; the contract lives in src/config/contact.ts.'],\n ['src/lib/contact/constants.ts', 'Remove the local contact constants; the contract lives in src/config/contact.ts.'],\n ['src/lib/contact/runtime.ts', 'Remove the local contact runtime; POST uses createBrandlabContactRouteHandler.'],\n ['src/components/analytics/GoogleTag.tsx', 'Render BrandlabGoogleTag directly in src/app/layout.tsx.'],\n ['src/components/analytics/CoreWebVitalsReporter.tsx', 'Remove the web-vitals reporter.'],\n ['src/lib/seo/sitemaps', 'Remove the local sitemap builders; the sitemap route uses createBrandlabSitemapRoute.'],\n ['src/lib/seo/sitemaps.ts', 'Remove the local sitemap builders; the sitemap route uses createBrandlabSitemapRoute.'],\n ['src/lib/seo/schema/sanitize.ts', 'Remove the local schema sanitiser; the packages own sanitising.'],\n ['src/lib/seo/schema/SchemaScript.tsx', 'Import SchemaScript from @brandlab-digital/site-next/schema.'],\n ['src/lib/seo/index.ts', 'Remove the SEO barrel and import each module directly.'],\n ] as const) {\n if (existsSync(join(root, path))) add(path, 'retired-file', message);\n }\n\n if (isDirectory(join(root, 'src'))) {\n for (const entry of readdirSync(join(root, 'src'), { withFileTypes: true })) {\n if (entry.name.startsWith('.')) continue;\n const path = `src/${entry.name}`;\n if (entry.isDirectory() && SRC_DIRECTORIES.has(entry.name)) {\n if (entry.name === 'types' && walkProjectFiles(root, path).some(file => !file.endsWith('.d.ts'))) {\n add(path, 'standard-layout', 'src/types may hold only ambient .d.ts declarations.');\n }\n continue;\n }\n if (entry.isFile() && SRC_ROOT_FILES.test(entry.name)) continue;\n add(path, 'standard-layout', `${path} is outside the standard layout (src/{app,config,data,content,lib,components}).`);\n }\n }\n if (isDirectory(join(root, 'src/components'))) {\n for (const entry of readdirSync(join(root, 'src/components'), { withFileTypes: true })) {\n if (entry.name.startsWith('.') || entry.name === 'templates') continue;\n if (!entry.isDirectory() || !COMPONENT_ROLES.has(entry.name)) {\n add(`src/components/${entry.name}`, 'component-role', 'Components belong to one role: layout, ui, sections, features or page-families.');\n }\n }\n }\n for (const path of walkProjectFiles(root, 'src')) inspectFileName(root, path, add);\n}\n\nfunction inspectFileName(root: string, path: string, add: Add) {\n const name = posix.basename(path);\n const directory = posix.dirname(path);\n if (directory === 'src' && SRC_ROOT_FILES.test(name)) return;\n if (name.endsWith('.module.css')) {\n const component = name.replace(/\\.module\\.css$/, '');\n // Exact names from the directory listing: existsSync is case-insensitive on macOS but not on the Linux CI\n // (a button.module.css beside Button.tsx passed locally and failed in CI).\n const siblings = directoryEntries(join(root, directory));\n if (!['tsx', 'ts', 'jsx'].some(extension => siblings.has(`${component}.${extension}`))) {\n add(path, 'file-naming', `Keep ${name} beside the ${component} component it styles (the file names must match exactly, including case).`);\n }\n return;\n }\n if (path.startsWith('src/app/')) {\n // Images, fonts and metadata assets are framework-consumed; only code and styles are placed.\n if (!CODE_OR_STYLE.test(name)) return;\n const segments = path.split('/');\n const privateFolder = segments.slice(2, -1).find(segment => segment.startsWith('_') && segment !== '_components');\n if (privateFolder) {\n add(path, 'route-local-code', `Route-local code belongs in src/app/<route>/_components/, not ${privateFolder}/.`);\n return;\n }\n if (!segments.includes('_components')) {\n if (NEXT_SPECIAL_FILE.test(name) || path === 'src/app/globals.css') return;\n add(path, 'route-local-code', 'Route-local code belongs in src/app/<route>/_components/; framework files keep their reserved names.');\n return;\n }\n }\n if (!/\\.(?:ts|tsx)$/.test(name) || path.startsWith('src/content/')) return;\n if (name.endsWith('.tsx') && !PASCAL_COMPONENT.test(name)) {\n add(path, 'file-naming', 'Components use PascalCase .tsx file names.');\n } else if (name.endsWith('.ts') && !CAMEL_MODULE.test(name)) {\n add(path, 'file-naming', 'Data and helper modules use camelCase .ts file names.');\n }\n if (path.startsWith('src/components/page-families/') && name.endsWith('.tsx') && !/^[A-Z][A-Za-z0-9]*Page\\.tsx$/.test(name)) {\n add(path, 'file-naming', 'Page families are named <RouteKind>Page.tsx.');\n }\n}\n\n// --- module structure: barrels, ui data imports, estate ----------------------\n\nfunction inspectSourceModules(root: string, source: BrandlabSourceIndex, add: Add) {\n const resolver = createBrandlabModuleResolver(root, new Set(source.byPath.keys()));\n for (const file of source.files.filter(candidate => candidate.path.startsWith('src/'))) {\n const references = listModuleReferences(file);\n const forwarding = forwardingExports(file);\n if (isBarrel(file)) {\n add(file.path, 'no-barrels', 'This module only re-exports other modules; import each owner directly.');\n } else {\n for (const line of forwarding) {\n add(file.path, 'no-forwarding-exports', 'This export forwards another module; import the owner directly.', { line });\n }\n }\n if (file.path.startsWith('src/components/ui/')) {\n for (const reference of references.filter(candidate => candidate.kind !== 'export')) {\n const resolved = resolver(file.path, reference.specifier);\n if (resolved?.startsWith('src/data/') || /^@\\/data(?:\\/|$)/.test(reference.specifier)) {\n add(file.path, 'ui-imports-data', 'UI primitives never import data modules; pass prepared props from a section or route.', { line: reference.line });\n }\n }\n }\n inspectRegistryDerivedEstate(file, add);\n }\n const estate = source.byPath.get('src/data/locations/estate.ts');\n if (estate) {\n inspectRetainedExclusions(estate, add);\n inspectSiteOwnedLocations(estate, add);\n }\n}\n\n// --- server-only boundaries (3.2.1) ------------------------------------------\n\n/**\n * What a browser bundle must never carry. The contact route's delivery options and\n * the business evidence live in server-only modules, alias hosts in next.config, and\n * no module a client component reaches imports a server-only module or holds an\n * evidence record. (Next's build also refuses a client import of `server-only`; this\n * names the chain before a build is needed.) From 3.3.3 no module a client component\n * reaches imports the geography registry (site-core/geography, which the location\n * estate reads) or a package server entry: a browser bundle cannot resolve them.\n */\nfunction inspectServerBoundaries(\n root: string,\n capabilities: ReturnType<typeof describeCapabilities>,\n source: BrandlabSourceIndex,\n add: Add,\n) {\n const contact = source.byPath.get('src/config/contact.ts');\n const runtime = source.byPath.get(CONTACT_RUNTIME);\n if (capabilities.contactEnabled && runtime) {\n if (!importsServerOnly(runtime)) {\n add(CONTACT_RUNTIME, 'server-only-module', `${CONTACT_RUNTIME} imports 'server-only', so no client component can bundle the delivery options.`);\n }\n if (!declaresName(runtime, 'contactRuntime')) {\n add(CONTACT_RUNTIME, 'contact-runtime', `${CONTACT_RUNTIME} exports contactRuntime (the labels, email style and attachment policy createBrandlabContactRouteHandler takes).`);\n }\n }\n const moved = contact ? declaresName(contact, 'contactRuntime') : undefined;\n if (contact && moved) {\n add('src/config/contact.ts', 'contact-runtime', `contactRuntime belongs in ${CONTACT_RUNTIME}: the contact form imports src/config/contact.ts, so everything contactRuntime reads (the site identity, business data) reaches the browser.`, { line: moved });\n }\n\n const evidence = source.byPath.get(BUSINESS_EVIDENCE);\n if (evidence) {\n if (!importsServerOnly(evidence)) {\n add(BUSINESS_EVIDENCE, 'server-only-module', `${BUSINESS_EVIDENCE} imports 'server-only', so no client component can bundle the evidence records.`);\n }\n if (findImportedCalls(evidence, /^@brandlab-digital\\/site-core\\/business$/, 'defineBrandlabBusiness').length === 0) {\n add(BUSINESS_EVIDENCE, 'business-evidence', `${BUSINESS_EVIDENCE} declares the business facts with defineBrandlabBusiness, each with its evidence.`);\n }\n }\n const values = source.byPath.get(BUSINESS_VALUES);\n if (values) {\n const call = BUSINESS_FACT_CALLS.exec(values.executable);\n const record = evidenceRecordLines(values)[0];\n if (call || record) {\n add(BUSINESS_VALUES, 'business-evidence', `${BUSINESS_VALUES} holds the display values only (businessFacts); defineBrandlabBusiness and the evidence belong in ${BUSINESS_EVIDENCE}, which stays on the server.`,\n { line: record ?? lineAtIndex(values.text, call!.index) });\n }\n }\n\n const site = source.byPath.get(SITE_IDENTITY);\n const aliasHosts = site ? declaredAliasHosts(site) : undefined;\n if (aliasHosts) {\n add(SITE_IDENTITY, 'alias-hosts', 'Declare the alias hosts in next.config.ts with defineBrandlabNextConfig({ aliasHosts }): client components import the site identity, so its alias hosts reach the browser.', { line: aliasHosts });\n }\n\n const resolver = createBrandlabModuleResolver(root, new Set(source.byPath.keys()));\n const reached = new Map<string, string | null>();\n const queue = source.files.filter(file => file.path.startsWith('src/') && (isClientModule(file) || /^src\\/instrumentation-client\\.[cm]?[jt]sx?$/.test(file.path)));\n for (const file of queue) reached.set(file.path, null);\n while (queue.length > 0) {\n const file = queue.shift()!;\n for (const reference of listModuleReferences(file)) {\n if (reference.typeOnly) continue;\n const target = resolver(file.path, reference.specifier);\n if (!target || reached.has(target)) continue;\n reached.set(target, file.path);\n const next = source.byPath.get(target);\n if (next) queue.push(next);\n }\n }\n const chain = (path: string) => {\n const steps: string[] = [];\n for (let at: string | null | undefined = path; at; at = reached.get(at)) steps.unshift(at);\n return steps.join(' → ');\n };\n for (const path of [...reached.keys()].sort()) {\n const file = source.byPath.get(path);\n if (!file) continue;\n if (importsServerOnly(file)) {\n add(path, 'client-bundle-boundary', `A client component imports this server-only module (${chain(path)}); pass what it needs as props from a server component.`);\n continue;\n }\n const serverEntry = listModuleReferences(file).find(reference => !reference.typeOnly && SERVER_PACKAGE_ENTRIES.has(reference.specifier));\n if (serverEntry) {\n add(path, 'client-bundle-boundary', `${SERVER_PACKAGE_ENTRIES.get(serverEntry.specifier)} reaches the browser (${chain(path)} → ${serverEntry.specifier}), and from 3.3.3 a browser bundle cannot resolve it, so the build fails. ${serverEntry.specifier === GEOGRAPHY_ENTRY ? 'Build the location lists a client component shows (navigation, service areas) in a server component and pass them as plain props; keep error pages and the analytics binding free of location data.' : 'Keep it in server components and route handlers.'}`, { line: serverEntry.line });\n continue;\n }\n const record = evidenceRecordLines(file)[0];\n if (record) {\n add(path, 'client-bundle-boundary', `An evidence record (sourceKind, verifiedAt) reaches the browser (${chain(path)}); keep evidence in ${BUSINESS_EVIDENCE}.`, { line: record });\n }\n }\n}\n\n/** A module whose directive prologue says 'use client'. */\nfunction isClientModule(file: BrandlabSourceFile): boolean {\n for (const statement of parseBrandlabSourceFile(file).statements) {\n if (!ts.isExpressionStatement(statement) || !ts.isStringLiteral(statement.expression)) return false;\n if (statement.expression.text === 'use client') return true;\n }\n return false;\n}\n\n/** `import 'server-only'` at the top level. */\nfunction importsServerOnly(file: BrandlabSourceFile): boolean {\n return parseBrandlabSourceFile(file).statements.some(statement =>\n ts.isImportDeclaration(statement) && !statement.importClause &&\n ts.isStringLiteral(statement.moduleSpecifier) && statement.moduleSpecifier.text === 'server-only');\n}\n\n/** The line of a top-level declaration of `name`, if the module declares it. */\nfunction declaresName(file: BrandlabSourceFile, name: string): number | undefined {\n for (const statement of parseBrandlabSourceFile(file).statements) {\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.name.text === name) return lineOfNode(file, statement);\n }\n } else if ((ts.isFunctionDeclaration(statement) || ts.isClassDeclaration(statement)) && statement.name?.text === name) {\n return lineOfNode(file, statement);\n }\n }\n return undefined;\n}\n\n/** Lines of object literals that are evidence records: they name both sourceKind and verifiedAt. */\nfunction evidenceRecordLines(file: BrandlabSourceFile): number[] {\n const lines: number[] = [];\n const visit = (node: ts.Node) => {\n if (ts.isObjectLiteralExpression(node)) {\n const names = new Set(node.properties.map(property => property.name && (ts.isIdentifier(property.name) || ts.isStringLiteral(property.name)) ? property.name.text : ''));\n if (names.has('sourceKind') && names.has('verifiedAt')) lines.push(lineOfNode(file, node));\n }\n ts.forEachChild(node, visit);\n };\n visit(parseBrandlabSourceFile(file));\n return lines;\n}\n\n/** The line of a non-empty `aliasHosts` in the defineBrandlabSite call. */\nfunction declaredAliasHosts(file: BrandlabSourceFile): number | undefined {\n for (const call of findImportedCalls(file, /^@brandlab-digital\\/site-core\\/site$/, 'defineBrandlabSite')) {\n let definition: ts.Expression | undefined = call.arguments[0];\n while (definition && (ts.isAsExpression(definition) || ts.isSatisfiesExpression(definition) || ts.isParenthesizedExpression(definition))) {\n definition = definition.expression;\n }\n if (!definition || !ts.isObjectLiteralExpression(definition)) continue;\n const property = definition.properties.find(candidate =>\n (ts.isPropertyAssignment(candidate) || ts.isShorthandPropertyAssignment(candidate)) &&\n (ts.isIdentifier(candidate.name) || ts.isStringLiteral(candidate.name)) && candidate.name.text === 'aliasHosts');\n if (!property) continue;\n const array = ts.isPropertyAssignment(property)\n ? arrayLiteral(file, property.initializer)\n : ts.isShorthandPropertyAssignment(property) ? arrayLiteral(file, property.name) : undefined;\n if (array && array.elements.length === 0) continue;\n return lineOfNode(file, property);\n }\n return undefined;\n}\n\n/** Lines of `export ... from` statements and exports of names this module only imported. */\nfunction forwardingExports(file: BrandlabSourceFile): number[] {\n const source = parseBrandlabSourceFile(file);\n const imported = new Set(listModuleReferences(file).filter(reference => reference.kind === 'import').flatMap(reference => reference.bindings.map(binding => binding.local)));\n const lines: number[] = [];\n for (const statement of source.statements) {\n const forwards =\n (ts.isExportDeclaration(statement) && (statement.moduleSpecifier !== undefined ||\n (statement.exportClause !== undefined && ts.isNamedExports(statement.exportClause) &&\n statement.exportClause.elements.some(element => imported.has((element.propertyName ?? element.name).text))))) ||\n (ts.isExportAssignment(statement) && ts.isIdentifier(statement.expression) && imported.has(statement.expression.text));\n if (forwards) lines.push(lineOfNode(file, statement));\n }\n return lines;\n}\n\n/** A module with no declarations or statements of its own besides imports and exports. */\nfunction isBarrel(file: BrandlabSourceFile): boolean {\n const statements = parseBrandlabSourceFile(file).statements;\n return statements.length > 0 && forwardingExports(file).length > 0 &&\n statements.every(statement => ts.isImportDeclaration(statement) || ts.isExportDeclaration(statement) || ts.isExportAssignment(statement));\n}\n\nfunction inspectRegistryDerivedEstate(file: BrandlabSourceFile, add: Add) {\n const derived = listModuleReferences(file)\n .filter(reference => reference.kind === 'import' && /^@brandlab-digital\\/site-core\\//.test(reference.specifier))\n .flatMap(reference => reference.bindings.filter(binding => /WebsiteSuburbs$/.test(binding.imported)).map(binding => ({ ...binding, line: reference.line })));\n const namespaceUse = file.executable.match(/\\.\\s*([a-z][A-Za-z]*WebsiteSuburbs)\\b/);\n const first = derived[0] ?? (namespaceUse ? { imported: namespaceUse[1]!, line: lineAtIndex(file.text, namespaceUse.index ?? 0) } : null);\n if (!first) return;\n add(file.path, 'estate-registry-derived',\n `${first.imported} is a registry candidate list; the published estate in src/data/locations/estate.ts must be literal data, never derived from it.`, { line: first.line });\n}\n\nfunction inspectRetainedExclusions(file: BrandlabSourceFile, add: Add) {\n for (const call of findImportedCalls(file, /^@brandlab-digital\\/site-core\\/locations$/, 'defineLocationEstate')) {\n const retained = objectPropertyValue(call.arguments[0], 'retainedExclusions');\n if (!retained || !ts.isArrayLiteralExpression(retained) || retained.elements.length === 0) continue;\n const slugs = retained.elements.map(element => {\n if (ts.isStringLiteralLike(element)) return element.text;\n const slug = objectPropertyValue(element, 'slug');\n return slug && ts.isStringLiteralLike(slug) ? slug.text : null;\n }).filter((slug): slug is string => Boolean(slug));\n add(file.path, 'estate-retained-exclusions',\n `${retained.elements.length} policy-excluded location(s) stay published for a later SEO decision${slugs.length ? `: ${slugs.join(', ')}` : ''}.`,\n { severity: 'info', line: lineOfNode(file, retained) });\n }\n}\n\n/** An array literal, directly or through a top-level `const name = [...]` (optionally `as const`) in the same file. */\nfunction arrayLiteral(file: BrandlabSourceFile, node: ts.Expression | undefined): ts.ArrayLiteralExpression | undefined {\n const unwrap = (expression: ts.Expression | undefined): ts.Expression | undefined => {\n let current = expression;\n while (current && (ts.isAsExpression(current) || ts.isSatisfiesExpression(current) || ts.isParenthesizedExpression(current))) {\n current = current.expression;\n }\n return current;\n };\n const value = unwrap(node);\n if (value && ts.isArrayLiteralExpression(value)) return value;\n if (!value || !ts.isIdentifier(value)) return undefined;\n for (const statement of parseBrandlabSourceFile(file).statements) {\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.name.text === value.text) {\n const initializer = unwrap(declaration.initializer);\n return initializer && ts.isArrayLiteralExpression(initializer) ? initializer : undefined;\n }\n }\n }\n return undefined;\n}\n\n/** Report the locations the site publishes outside the shared registry, with each group's reason. */\nfunction inspectSiteOwnedLocations(file: BrandlabSourceFile, add: Add) {\n for (const call of findImportedCalls(file, /^@brandlab-digital\\/site-core\\/locations$/, 'defineLocationEstate')) {\n const declared = objectPropertyValue(call.arguments[0], 'siteOwned');\n if (!declared) continue;\n const groups = arrayLiteral(file, declared);\n if (!groups) {\n add(file.path, 'estate-site-owned',\n 'siteOwned must be literal data in src/data/locations/estate.ts: [{ reason, slugs }], never derived.', { line: lineOfNode(file, declared) });\n continue;\n }\n if (groups.elements.length === 0) continue;\n let total = 0;\n const summaries = groups.elements.map(element => {\n const reason = objectPropertyValue(element, 'reason');\n const slugs = arrayLiteral(file, objectPropertyValue(element, 'slugs'));\n const count = slugs?.elements.length;\n total += count ?? 0;\n const label = reason && ts.isStringLiteralLike(reason) ? reason.text : 'a reason that is not a string literal';\n return `${count ?? 'an unknown number of'} for \"${label}\"`;\n });\n add(file.path, 'estate-site-owned',\n `${total} location(s) are published outside the shared geography registry, declared site-owned: ${summaries.join('; ')}.`,\n { severity: 'info', line: lineOfNode(file, groups) });\n }\n}\n\nfunction lineAtIndex(text: string, index: number): number {\n return text.slice(0, index).split('\\n').length;\n}\n\n// --- tests (sections 2 and 6) -------------------------------------------------\n\nfunction inspectTests(root: string, capabilities: ReturnType<typeof describeCapabilities>, add: Add) {\n if (!isDirectory(join(root, 'tests'))) return;\n for (const entry of readdirSync(join(root, 'tests'), { withFileTypes: true })) {\n if (entry.name.startsWith('.')) continue;\n if (!entry.isDirectory() || !TEST_DIRECTORIES.has(entry.name)) {\n add(`tests/${entry.name}`, 'test-layout', 'Tests live in tests/{config,data,lib,components,e2e,support}.');\n }\n }\n const required = [\n 'tests/data/routes.test.ts', 'tests/config/analytics.test.ts',\n 'tests/e2e/estate.spec.ts', 'tests/e2e/analytics.spec.ts', 'tests/e2e/families.spec.ts',\n ...(capabilities.contactEnabled ? ['tests/config/contact.test.ts', 'tests/e2e/contact.spec.ts'] : []),\n ];\n for (const path of required) {\n if (!existsSync(join(root, path))) add(path, 'shared-tests', `The shared 3.0 test set includes ${path}.`);\n }\n for (const path of walkProjectFiles(root, 'tests')) {\n if (/-darwin\\.png$/.test(path)) add(path, 'committed-snapshots', 'Delete committed darwin snapshots; rendered checks run against the CI build.');\n }\n}\n\n// --- dev presets (section 4) -------------------------------------------------\n\n/** The two accepted default exports: the plain preset, or the preset plus the Site System rules (same identifier twice). */\nconst ESLINT_PRESET_EXPORT = /export\\s+default\\s+(?:([A-Za-z_$][\\w$]*)\\.configs\\.next|\\[\\s*\\.\\.\\.\\s*([A-Za-z_$][\\w$]*)\\.configs\\.next\\s*,\\s*\\2\\.configs\\[\\s*(['\"])site-system\\3\\s*\\]\\s*,?\\s*\\])\\s*;?\\s*$/;\n\nfunction inspectToolPresets(root: string, add: Add) {\n const eslint = readOptional(join(root, 'eslint.config.mjs'));\n if (eslint === null) add('eslint.config.mjs', 'tool-preset', 'Add eslint.config.mjs: export default brandlab.configs.next.');\n else if (!/@brandlab-digital\\/eslint-plugin/.test(eslint) || !ESLINT_PRESET_EXPORT.test(eslint.trim())) {\n add('eslint.config.mjs', 'tool-preset', \"eslint.config.mjs is exactly `export default brandlab.configs.next`, or, for a site that declares a siteSystem tier, `export default [...brandlab.configs.next, brandlab.configs['site-system']]` (imported from @brandlab-digital/eslint-plugin).\");\n }\n const knip = readOptional(join(root, 'knip.ts'));\n if (knip === null) add('knip.ts', 'tool-preset', 'Add knip.ts: export default brandlabKnip({ mdx?, entry? }).');\n else if (!/@brandlab-digital\\/conformance\\/knip/.test(knip) || !/export\\s+default\\s+brandlabKnip\\s*\\(/.test(knip)) {\n add('knip.ts', 'tool-preset', 'knip.ts exports brandlabKnip({ mdx?, entry? }) from @brandlab-digital/conformance/knip.');\n }\n if (!['playwright.config.ts', 'playwright.config.mts'].some(name => existsSync(join(root, name)))) {\n add('playwright.config.ts', 'tool-preset', 'Add the Playwright configuration for the shared e2e specs.');\n }\n if (!['vitest.config.ts', 'vitest.config.mts'].some(name => existsSync(join(root, name)))) {\n add('vitest.config.ts', 'tool-preset', 'Add the Vitest configuration for the binding tests.');\n }\n}\n\n// --- CI, dependencies, Vercel and docs (section 6) ---------------------------\n\n/** A day before any decision, so a recorded decision's reviewBy never counts as passed. */\nconst ORIGIN_DECISION_NEVER_LAPSED = '0000-01-01';\n\nfunction inspectDelivery(root: string, add: Add, config: string | null) {\n const workflowDirectory = join(root, '.github/workflows');\n const workflows = isDirectory(workflowDirectory) ? readdirSync(workflowDirectory).filter(name => /\\.ya?ml$/.test(name)).sort() : [];\n // CI v2 (verify-next-v2.yml, 3.13.0) is the same verifier with draft, ready-for-review and merge depths.\n const callers = workflows.filter(name => /uses\\s*:\\s*['\"]?RomieDandan\\/brandlab\\/\\.github\\/workflows\\/verify-next(?:-v2)?\\.yml@/.test(readFileSync(join(workflowDirectory, name), 'utf8')));\n if (callers.length !== 1 || callers[0] !== 'verify.yml') {\n add('.github/workflows/verify.yml', 'ci-workflow', `Exactly one .github/workflows/verify.yml calls RomieDandan/brandlab/.github/workflows/verify-next.yml (or verify-next-v2.yml) at the fleet SHA (found ${callers.length ? callers.join(', ') : 'none'}).`);\n }\n for (const path of ['.github/dependabot.yml', '.github/dependabot.yaml', 'renovate.json', 'renovate.json5', '.github/renovate.json', '.renovaterc', '.renovaterc.json']) {\n if (existsSync(join(root, path))) add(path, 'dependency-bots', 'Exact pins move with Brandlab releases; remove Dependabot/Renovate version updates.');\n }\n const vercel = readOptional(join(root, 'vercel.json'));\n let installCommand: unknown;\n try { installCommand = vercel === null ? undefined : JSON.parse(vercel).installCommand; } catch { installCommand = undefined; }\n if (installCommand !== 'npm ci') add('vercel.json', 'vercel-install', 'vercel.json sets installCommand to \"npm ci\".');\n // W5 (3.13.0): the regions equal the recorded origin region, Sydney unless an origin-region-v1 decision says otherwise.\n // This check runs inside every site's `npm run verify`, so it never judges the date: a lapsed reviewBy must not stop\n // a build, a fix or a rollback. The lapse fails only the ready gate's W5 (as site-core's config validation does).\n const hosting = config === null ? undefined : parseProjectHosting(config);\n for (const problem of originRegionProblems({ hosting, vercelJson: vercel, today: ORIGIN_DECISION_NEVER_LAPSED })) {\n add(problem.startsWith('vercel.json') ? 'vercel.json' : 'brandlab.config.ts', 'vercel-region', problem);\n }\n let ignoreCommand: unknown;\n try { ignoreCommand = vercel === null ? undefined : JSON.parse(vercel).ignoreCommand; } catch { ignoreCommand = undefined; }\n if (ignoreCommand !== BRANDLAB_VERCEL_IGNORE_COMMAND) {\n add('vercel.json', 'vercel-ignore-build', `vercel.json skips a production build only when a push changes nothing but .github/, docs/ or root Markdown files: \"ignoreCommand\": ${JSON.stringify(BRANDLAB_VERCEL_IGNORE_COMMAND)} (found ${ignoreCommand === undefined ? 'none' : JSON.stringify(ignoreCommand)}). A CI-only change otherwise rebuilds production and empties its CDN cache; previews and anything git cannot compare still build.`);\n }\n\n if (!existsSync(join(root, 'README.md'))) add('README.md', 'project-docs', 'Add the generated README.md (commands, architecture, environment names, deployment and rollback).');\n const agents = join(root, 'AGENTS.md');\n if (!existsSync(agents)) add('AGENTS.md', 'project-docs', 'Add AGENTS.md with the fixed sources of truth and guardrails.');\n else if (statSync(agents).size > 3_584) add('AGENTS.md', 'project-docs', `AGENTS.md is ${statSync(agents).size} bytes; keep it to about 3 KB and archive history to the control repo.`);\n const claude = readOptional(join(root, 'CLAUDE.md'));\n if (claude === null || claude.trim() !== '@AGENTS.md') add('CLAUDE.md', 'project-docs', 'CLAUDE.md is the single line @AGENTS.md.');\n}\n\nconst directoryListings = new Map<string, ReadonlySet<string>>();\n\n/** The exact file names in a directory (cached per check run). */\nfunction directoryEntries(path: string): ReadonlySet<string> {\n let entries = directoryListings.get(path);\n if (!entries) {\n try { entries = new Set(readdirSync(path)); } catch { entries = new Set(); }\n directoryListings.set(path, entries);\n }\n return entries;\n}\n\nfunction readOptional(path: string): string | null {\n return existsSync(path) ? readFileSync(path, 'utf8') : null;\n}\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type BrandlabEstateScope = 'full' | 'sample';
|
|
2
|
+
/** The route fields the sample reads; a catalogue route has them. */
|
|
3
|
+
export interface BrandlabEstateSampleRoute {
|
|
4
|
+
path: string;
|
|
5
|
+
kind?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface BrandlabEstateSampleOptions {
|
|
9
|
+
/** How many more routes the fixed seed picks beyond hubs, kind ends and changed routes (default 50). */
|
|
10
|
+
size?: number;
|
|
11
|
+
/** The seed; the same seed and catalogue always give the same sample (default `brandlab-estate-sample`). */
|
|
12
|
+
seed?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The routes a changed file feeds, as paths. By default a route is fed by a file
|
|
15
|
+
* named after its id or its last path segment (`src/data/locations/bondi.ts`
|
|
16
|
+
* feeds `/locations/bondi`; an `index` file is named by its folder).
|
|
17
|
+
*/
|
|
18
|
+
routesForFile?: (file: string, routes: readonly BrandlabEstateSampleRoute[]) => readonly string[];
|
|
19
|
+
}
|
|
20
|
+
export interface BrandlabEstateSample<T extends BrandlabEstateSampleRoute> {
|
|
21
|
+
scope: BrandlabEstateScope;
|
|
22
|
+
/** The routes to crawl, in catalogue order. */
|
|
23
|
+
routes: T[];
|
|
24
|
+
total: number;
|
|
25
|
+
counts: {
|
|
26
|
+
hubs: number;
|
|
27
|
+
kindEnds: number;
|
|
28
|
+
changed: number;
|
|
29
|
+
seeded: number;
|
|
30
|
+
};
|
|
31
|
+
/** One line for the test annotation. */
|
|
32
|
+
summary: string;
|
|
33
|
+
}
|
|
34
|
+
/** The scope CI asked for. Anything but `sample` is the full crawl, so a typo never thins a check. */
|
|
35
|
+
export declare function estateScopeFromEnv(env?: NodeJS.ProcessEnv): {
|
|
36
|
+
scope: BrandlabEstateScope;
|
|
37
|
+
note?: string;
|
|
38
|
+
};
|
|
39
|
+
/** The changed files CI listed (`BRANDLAB_CHANGED_FILES` names the list). Unreadable or unset lists none. */
|
|
40
|
+
export declare function changedFilesFromEnv(env?: NodeJS.ProcessEnv): string[];
|
|
41
|
+
/** The name a data file gives the routes it feeds: its file name without extensions, or its folder's for an index file. */
|
|
42
|
+
export declare function changedFileStem(file: string): string | undefined;
|
|
43
|
+
export declare function defaultRoutesForFile(file: string, routes: readonly BrandlabEstateSampleRoute[]): string[];
|
|
44
|
+
/**
|
|
45
|
+
* The routes a sampled crawl checks. The full scope returns every route. The
|
|
46
|
+
* sample keeps the hubs and the not-found page, the first and last route of each
|
|
47
|
+
* kind in catalogue order, the routes the changed files feed and `size` more
|
|
48
|
+
* chosen by a hash of the seed and the path, so the same catalogue always gives
|
|
49
|
+
* the same sample.
|
|
50
|
+
*/
|
|
51
|
+
export declare function sampleEstateRoutes<T extends BrandlabEstateSampleRoute>(routes: readonly T[], input: {
|
|
52
|
+
scope: BrandlabEstateScope;
|
|
53
|
+
changedFiles?: readonly string[];
|
|
54
|
+
} & BrandlabEstateSampleOptions): BrandlabEstateSample<T>;
|
|
55
|
+
/** A fixed-seed sample of other items (redirect rules), in their original order. */
|
|
56
|
+
export declare function sampleBySeed<T>(items: readonly T[], keyOf: (item: T) => string, input?: {
|
|
57
|
+
size?: number;
|
|
58
|
+
seed?: string;
|
|
59
|
+
}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,MAAM,EAAE,CAQlF;AAED,2HAA2H;AAC3H,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMhE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,yBAAyB,EAAE,GAAG,MAAM,EAAE,CAMzG;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,yBAAyB,EACpE,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,KAAK,EAAE;IAAE,KAAK,EAAE,mBAAmB,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG,2BAA2B,GACpG,oBAAoB,CAAC,CAAC,CAAC,CAkDzB;AAED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAAE,KAAK,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,CAAC,EAAE,CAWlI"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sampled estate crawl (3.13.0, client CI v2). A draft pull request checks a
|
|
3
|
+
* sample of the catalogue instead of every route: the hubs, the first and last
|
|
4
|
+
* page of each route kind, the routes a changed data file feeds and a fixed-seed
|
|
5
|
+
* sample of the rest. The full crawl still runs when the pull request is ready
|
|
6
|
+
* for review and before merge; the sample only makes drafts cheaper.
|
|
7
|
+
*
|
|
8
|
+
* CI chooses the scope with `BRANDLAB_ESTATE_SCOPE` (`full`, the default, or
|
|
9
|
+
* `sample`) and lists the changed files in the file `BRANDLAB_CHANGED_FILES`
|
|
10
|
+
* names, one path per line. Any other scope value runs the full crawl.
|
|
11
|
+
*/
|
|
12
|
+
import { createHash } from 'node:crypto';
|
|
13
|
+
import { readFileSync } from 'node:fs';
|
|
14
|
+
/** Hubs: home, every index page, the contact page and the not-found page. */
|
|
15
|
+
const HUB_KINDS = new Set(['home', 'service-index', 'location-index', 'blog-index', 'project-index', 'contact']);
|
|
16
|
+
const DEFAULT_SIZE = 50;
|
|
17
|
+
const DEFAULT_SEED = 'brandlab-estate-sample';
|
|
18
|
+
const GENERIC_STEMS = new Set(['index', 'data', 'content', 'page']);
|
|
19
|
+
/** The scope CI asked for. Anything but `sample` is the full crawl, so a typo never thins a check. */
|
|
20
|
+
export function estateScopeFromEnv(env = process.env) {
|
|
21
|
+
const value = (env.BRANDLAB_ESTATE_SCOPE ?? '').trim();
|
|
22
|
+
if (value === 'sample')
|
|
23
|
+
return { scope: 'sample' };
|
|
24
|
+
if (value === '' || value === 'full')
|
|
25
|
+
return { scope: 'full' };
|
|
26
|
+
return { scope: 'full', note: `BRANDLAB_ESTATE_SCOPE="${value}" is not full or sample; the full estate was crawled` };
|
|
27
|
+
}
|
|
28
|
+
/** The changed files CI listed (`BRANDLAB_CHANGED_FILES` names the list). Unreadable or unset lists none. */
|
|
29
|
+
export function changedFilesFromEnv(env = process.env) {
|
|
30
|
+
const listPath = env.BRANDLAB_CHANGED_FILES?.trim();
|
|
31
|
+
if (!listPath)
|
|
32
|
+
return [];
|
|
33
|
+
try {
|
|
34
|
+
return readFileSync(listPath, 'utf8').split('\n').map((line) => line.trim()).filter(Boolean);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** The name a data file gives the routes it feeds: its file name without extensions, or its folder's for an index file. */
|
|
41
|
+
export function changedFileStem(file) {
|
|
42
|
+
const parts = file.replace(/\\/g, '/').split('/').filter(Boolean);
|
|
43
|
+
const stemOf = (part) => part?.replace(/(?:\.[a-z0-9]+)+$/i, '').toLowerCase() ?? '';
|
|
44
|
+
const own = stemOf(parts.at(-1));
|
|
45
|
+
const stem = GENERIC_STEMS.has(own) ? stemOf(parts.at(-2)) : own;
|
|
46
|
+
return stem && !GENERIC_STEMS.has(stem) ? stem : undefined;
|
|
47
|
+
}
|
|
48
|
+
export function defaultRoutesForFile(file, routes) {
|
|
49
|
+
const stem = changedFileStem(file);
|
|
50
|
+
if (!stem)
|
|
51
|
+
return [];
|
|
52
|
+
return routes
|
|
53
|
+
.filter((route) => route.id?.toLowerCase() === stem || lastSegment(route.path) === stem)
|
|
54
|
+
.map((route) => route.path);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The routes a sampled crawl checks. The full scope returns every route. The
|
|
58
|
+
* sample keeps the hubs and the not-found page, the first and last route of each
|
|
59
|
+
* kind in catalogue order, the routes the changed files feed and `size` more
|
|
60
|
+
* chosen by a hash of the seed and the path, so the same catalogue always gives
|
|
61
|
+
* the same sample.
|
|
62
|
+
*/
|
|
63
|
+
export function sampleEstateRoutes(routes, input) {
|
|
64
|
+
const total = routes.length;
|
|
65
|
+
if (input.scope === 'full') {
|
|
66
|
+
return { scope: 'full', routes: [...routes], total, counts: { hubs: 0, kindEnds: 0, changed: 0, seeded: 0 }, summary: `full: all ${total} routes` };
|
|
67
|
+
}
|
|
68
|
+
const chosen = new Set();
|
|
69
|
+
const add = (path) => {
|
|
70
|
+
const key = normalise(path);
|
|
71
|
+
if (chosen.has(key))
|
|
72
|
+
return false;
|
|
73
|
+
chosen.add(key);
|
|
74
|
+
return true;
|
|
75
|
+
};
|
|
76
|
+
let hubs = 0;
|
|
77
|
+
for (const route of routes) {
|
|
78
|
+
if (HUB_KINDS.has(route.kind ?? '') || normalise(route.path) === '/' || normalise(route.path) === '/404')
|
|
79
|
+
if (add(route.path))
|
|
80
|
+
hubs += 1;
|
|
81
|
+
}
|
|
82
|
+
const byKind = new Map();
|
|
83
|
+
for (const route of routes) {
|
|
84
|
+
if (HUB_KINDS.has(route.kind ?? ''))
|
|
85
|
+
continue;
|
|
86
|
+
const kind = route.kind ?? '';
|
|
87
|
+
byKind.set(kind, [...(byKind.get(kind) ?? []), route]);
|
|
88
|
+
}
|
|
89
|
+
let kindEnds = 0;
|
|
90
|
+
for (const group of byKind.values()) {
|
|
91
|
+
for (const route of [group[0], group.at(-1)])
|
|
92
|
+
if (route && add(route.path))
|
|
93
|
+
kindEnds += 1;
|
|
94
|
+
}
|
|
95
|
+
const known = new Set(routes.map((route) => normalise(route.path)));
|
|
96
|
+
const feeds = input.routesForFile ?? defaultRoutesForFile;
|
|
97
|
+
let changed = 0;
|
|
98
|
+
for (const file of input.changedFiles ?? []) {
|
|
99
|
+
for (const path of feeds(file, routes))
|
|
100
|
+
if (known.has(normalise(path)) && add(path))
|
|
101
|
+
changed += 1;
|
|
102
|
+
}
|
|
103
|
+
const seed = input.seed ?? DEFAULT_SEED;
|
|
104
|
+
const size = Math.max(0, Math.floor(input.size ?? DEFAULT_SIZE));
|
|
105
|
+
const rest = routes
|
|
106
|
+
.filter((route) => !chosen.has(normalise(route.path)))
|
|
107
|
+
.map((route) => ({ path: route.path, rank: seededRank(seed, normalise(route.path)) }))
|
|
108
|
+
.sort((a, b) => a.rank.localeCompare(b.rank) || a.path.localeCompare(b.path))
|
|
109
|
+
.slice(0, size);
|
|
110
|
+
for (const { path } of rest)
|
|
111
|
+
add(path);
|
|
112
|
+
const sampled = routes.filter((route) => chosen.has(normalise(route.path)));
|
|
113
|
+
// A path the catalogue repeats is checked once.
|
|
114
|
+
const unique = sampled.filter((route, index) => sampled.findIndex((other) => normalise(other.path) === normalise(route.path)) === index);
|
|
115
|
+
return {
|
|
116
|
+
scope: 'sample',
|
|
117
|
+
routes: unique,
|
|
118
|
+
total,
|
|
119
|
+
counts: { hubs, kindEnds, changed, seeded: rest.length },
|
|
120
|
+
summary: `sample: ${unique.length} of ${total} routes (hubs ${hubs}, first and last of each kind ${kindEnds}, from changed files ${changed}, fixed-seed ${rest.length}); the full estate is crawled when the pull request is ready for review`,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/** A fixed-seed sample of other items (redirect rules), in their original order. */
|
|
124
|
+
export function sampleBySeed(items, keyOf, input = {}) {
|
|
125
|
+
const seed = input.seed ?? DEFAULT_SEED;
|
|
126
|
+
const size = Math.max(0, Math.floor(input.size ?? DEFAULT_SIZE));
|
|
127
|
+
const picked = new Set(items
|
|
128
|
+
.map((item, index) => ({ index, rank: seededRank(seed, keyOf(item)) }))
|
|
129
|
+
.sort((a, b) => a.rank.localeCompare(b.rank) || a.index - b.index)
|
|
130
|
+
.slice(0, size)
|
|
131
|
+
.map(({ index }) => index));
|
|
132
|
+
return items.filter((_, index) => picked.has(index));
|
|
133
|
+
}
|
|
134
|
+
function seededRank(seed, key) {
|
|
135
|
+
return createHash('sha256').update(`${seed}\u0000${key}`).digest('hex');
|
|
136
|
+
}
|
|
137
|
+
function lastSegment(path) {
|
|
138
|
+
return normalise(path).split('/').filter(Boolean).at(-1)?.toLowerCase() ?? '';
|
|
139
|
+
}
|
|
140
|
+
function normalise(path) {
|
|
141
|
+
const pathname = path.split(/[?#]/)[0] || '/';
|
|
142
|
+
return pathname.length > 1 ? pathname.replace(/\/+$/, '') : '/';
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=estate-sample.js.map
|