runtime-pin-check 0.1.0 → 0.1.1

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/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  scopesOf,
14
14
  toRange,
15
15
  walkFiles
16
- } from "./chunk-DBYFB476.js";
16
+ } from "./chunk-TRO76P2I.js";
17
17
  export {
18
18
  IGNORED_DIRS,
19
19
  ROOT_MARKERS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runtime-pin-check",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Find Node, Python and Go version pins that disagree across a repo's files, with file and line.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/constraint.ts","../src/compare.ts","../src/scan.ts"],"sourcesContent":["/**\n * Turns the raw text of a version pin into a `Constraint`, and a constraint into a semver range.\n * Node pins use npm semver syntax; Python pins use PEP 440 specifiers (plus Poetry's `^`/`~`);\n * Go pins use `1.22`, `1.22.3` or `go1.22.3`. Nothing here guesses: text that does not fit\n * becomes an `unknown` constraint carrying the reason.\n */\nimport semver from 'semver'\nimport type { Constraint, Runtime } from './types'\n\n/** Aliases that float to whatever is newest: reported as FLOATING_ALIAS, never compared. */\nconst FLOATING = new Set(['latest', 'node', 'stable', 'current', 'system', 'oldstable'])\n\n/** Alias words each runtime accepts in version files and CI inputs. */\nconst ALIAS = /^(lts\\/\\*|lts\\/[a-z][a-z-]*|lts|latest|node|stable|current|system|oldstable)$/i\n\n/** Docker tag words that name an image variant, not a version (`python:slim`, `golang:alpine`). */\nconst DOCKER_VARIANTS = new Set([\n 'alpine',\n 'slim',\n 'bookworm',\n 'bullseye',\n 'buster',\n 'stretch',\n 'jessie',\n 'trixie',\n 'noble',\n 'jammy',\n 'focal',\n 'windowsservercore',\n 'nanoserver',\n])\n\n/** True for `latest`, `node`, `stable` and the like: pins that move by themselves. */\nexport function isFloatingAlias(alias: string): boolean {\n return FLOATING.has(alias.toLowerCase())\n}\n\nconst EXACT = /^\\d+\\.\\d+\\.\\d+$/\nconst PARTIAL = /^(\\d+)(?:\\.(\\d+))?(?:\\.[xX*])?$/\n\nfunction versionPart(text: string, runtime: Runtime): string {\n let t = text.trim()\n if (runtime === 'go') t = t.replace(/^go(?=\\d)/, '')\n if (runtime === 'python') t = t.replace(/^python-?(?=\\d)/i, '')\n return t.replace(/^[vV](?=\\d)/, '')\n}\n\n/** Exact or partial when the text is a plain version (`22`, `22.11`, `22.x`, `v22.11.0`). */\nfunction plainVersion(text: string): Constraint | undefined {\n if (EXACT.test(text)) return { kind: 'exact', version: text }\n const m = PARTIAL.exec(text)\n if (m) return { kind: 'partial', version: m[2] === undefined ? (m[1] as string) : `${m[1]}.${m[2]}` }\n return undefined\n}\n\nfunction pad(version: string): string {\n const parts = version.split('.')\n while (parts.length < 3) parts.push('0')\n return parts.slice(0, 3).join('.')\n}\n\n/** One PEP 440 / Poetry clause as semver, '' for a clause semver cannot express (`!=`), undefined if invalid. */\nfunction pythonClause(clause: string): string | undefined {\n const m = /^(~=|===|==|!=|<=|>=|<|>|\\^|~)?\\s*(\\d+(?:\\.\\d+){0,3})(\\.\\*)?$/.exec(clause.trim())\n if (!m) return undefined\n const op = m[1] ?? '=='\n const version = m[2] as string\n const wildcard = m[3] !== undefined\n const parts = version.split('.').map(Number)\n if (parts.length > 3) return undefined\n if (wildcard && op !== '==' && op !== '!=') return undefined\n switch (op) {\n case '===':\n return undefined\n case '!=':\n // An exclusion only narrows the range; semver has no \"not equal\", so it is left out.\n return ''\n case '==':\n // PEP 440 pads with zeros: '==3.10' is 3.10.0 only; '==3.10.*' is the whole 3.10 series.\n return wildcard ? partialRange(version) : `=${pad(version)}`\n case '~=': {\n if (parts.length < 2) return undefined\n const upper = parts.slice(0, -1)\n upper[upper.length - 1] = (upper[upper.length - 1] as number) + 1\n return `>=${pad(version)} <${pad(upper.join('.'))}-0`\n }\n case '<':\n return `<${pad(version)}-0`\n case '<=':\n return `<=${pad(version)}`\n case '>':\n return `>${pad(version)}`\n case '>=':\n return `>=${pad(version)}`\n case '^':\n case '~':\n return semver.validRange(`${op}${version}`) ?? undefined\n default:\n return undefined\n }\n}\n\nfunction pythonRange(text: string): string | undefined {\n const alternatives: string[] = []\n for (const alt of text.split(/\\|\\|?/)) {\n const clauses = alt.split(',').map((c) => c.trim()).filter((c) => c !== '')\n if (clauses.length === 0) return undefined\n const converted: string[] = []\n for (const clause of clauses) {\n const r = pythonClause(clause)\n if (r === undefined) return undefined\n if (r !== '') converted.push(r)\n }\n alternatives.push(converted.length > 0 ? converted.join(' ') : '*')\n }\n return semver.validRange(alternatives.join(' || ')) ?? undefined\n}\n\n/**\n * Parses the raw text of one pin for a runtime.\n *\n * @example\n * parseConstraint('v22', 'node') // { kind: 'partial', version: '22' }\n * parseConstraint('>=20 <23', 'node') // { kind: 'range', range: '>=20.0.0 <23.0.0-0' }\n * parseConstraint('>=3.10,<3.14', 'python') // { kind: 'range', range: '>=3.10.0 <3.14.0-0' }\n * parseConstraint('go1.24.4', 'go') // { kind: 'exact', version: '1.24.4' }\n * parseConstraint('lts/iron', 'node') // { kind: 'alias', alias: 'lts/iron' }\n */\nexport function parseConstraint(raw: string, runtime: Runtime): Constraint {\n const text = versionPart(raw, runtime)\n if (text === '') return { kind: 'unknown', reason: 'empty value' }\n if (ALIAS.test(text)) return { kind: 'alias', alias: text.toLowerCase() }\n const plain = plainVersion(text)\n if (plain) return plain\n if (/\\$\\{|\\$\\(|\\{\\{/.test(text)) return { kind: 'unknown', reason: 'contains a variable or template expression' }\n const range = runtime === 'python' ? pythonRange(text) : semver.validRange(text)\n if (range) return { kind: 'range', range }\n return { kind: 'unknown', reason: `not a ${runtime} version or version range` }\n}\n\n/**\n * The constraint of a Docker image tag: the version part only (`22-alpine` → partial 22,\n * `22.11.0-bookworm-slim` → exact, `lts-alpine` → alias lts). A missing tag or a variant-only tag\n * (`slim`, `alpine`) means `latest`. A digest (`@sha256:…`) is ignored.\n */\nexport function dockerTagConstraint(tag: string | undefined, runtime: Runtime): Constraint {\n const t = (tag ?? '').split('@')[0]?.trim() ?? ''\n if (t === '') return { kind: 'alias', alias: 'latest' }\n if (/\\$\\{?[A-Za-z_]/.test(t)) return { kind: 'unknown', reason: 'tag contains an unresolved variable' }\n const head = t.split('-')[0] as string\n const plain = plainVersion(versionPart(head, runtime))\n if (plain) return plain\n const word = head.toLowerCase()\n // A variant may carry its own OS version (`alpine3.20`, `windowsservercore1809`): still no runtime version.\n if (DOCKER_VARIANTS.has(word.replace(/[\\d.]+$/, ''))) return { kind: 'alias', alias: 'latest' }\n if (ALIAS.test(word)) return { kind: 'alias', alias: word }\n // Node images are also tagged by LTS codename (`node:iron`, `node:jod-alpine`).\n if (runtime === 'node' && /^[a-z]+$/.test(word)) return { kind: 'alias', alias: `lts/${word}` }\n return { kind: 'unknown', reason: 'tag has no recognisable version' }\n}\n\nfunction partialRange(version: string): string {\n const parts = version.split('.').map(Number)\n if (parts.length === 1) return `>=${parts[0]}.0.0 <${(parts[0] as number) + 1}.0.0-0`\n if (parts.length === 2) return `>=${parts[0]}.${parts[1]}.0 <${parts[0]}.${(parts[1] as number) + 1}.0-0`\n return `=${pad(version)}`\n}\n\n/**\n * The semver range a constraint allows, for comparison (`partial 22` → `>=22.0.0 <23.0.0-0`).\n * Aliases and unknown constraints have none and return undefined.\n */\nexport function toRange(c: Constraint): string | undefined {\n switch (c.kind) {\n case 'exact':\n return c.version\n case 'partial':\n return partialRange(c.version)\n case 'range':\n return c.range\n default:\n return undefined\n }\n}\n\n/** Human-readable form of a constraint for messages (`22`, `>=20 <23`, `lts/iron`). */\nexport function describeConstraint(c: Constraint): string {\n switch (c.kind) {\n case 'exact':\n case 'partial':\n return c.version\n case 'range':\n return c.range\n case 'alias':\n return c.alias\n case 'unknown':\n return `unparseable (${c.reason})`\n }\n}\n","/**\n * Per-scope comparison (docs/TASKS.md, Domain model and Finding codes). Sources are grouped by\n * project root and runtime; within a group every pair of pins is checked for overlap.\n * EOL findings are not produced here (rpc-eol adds them).\n */\nimport semver from 'semver'\nimport { describeConstraint, isFloatingAlias, toRange } from './constraint'\nimport type { CompareOptions, Finding, FindingCode, Runtime, Scope, Severity, Source, SourceRef } from './types'\n\nconst MANIFESTS = new Set(['package.json', 'pyproject.toml', 'go.mod'])\n\nfunction dirOf(file: string): string {\n const i = file.lastIndexOf('/')\n return i < 0 ? '.' : file.slice(0, i)\n}\n\nfunction baseOf(file: string): string {\n return file.slice(file.lastIndexOf('/') + 1)\n}\n\nfunction normalizeDir(dir: string): string {\n const d = dir.replace(/\\\\/g, '/').replace(/^\\.\\/+/, '').replace(/\\/+$/, '')\n return d === '' ? '.' : d\n}\n\n/**\n * True for a repo-level CI or tool file that applies to every project root: anything under\n * `.github/` (any letter case: `.GitHub/` exists in the wild), `.gitlab-ci.yml`, and root-level\n * version files (`.nvmrc`, `.tool-versions`, `mise.toml` …). Root manifests and Dockerfiles belong\n * to the repo-root project only.\n */\nexport function isSharedFile(file: string): boolean {\n const f = file.replace(/\\\\/g, '/')\n if (/^\\.github\\//i.test(f)) return true\n if (f.includes('/')) return false\n const base = baseOf(f)\n if (MANIFESTS.has(base)) return false\n if (/^dockerfile/i.test(base) || /\\.dockerfile$/i.test(base)) return false\n return true\n}\n\n/** The deepest project root that contains `dir` (`.` when none does). */\nfunction deepestRoot(dir: string, roots: readonly string[]): string {\n let best = '.'\n for (const r of roots) {\n if (r === '.') continue\n if ((dir === r || dir.startsWith(`${r}/`)) && r.length > best.length) best = r\n }\n return best\n}\n\n/**\n * The project roots a source applies to. After `bindSources` this is `source.boundTo` (`[]` for an\n * UNBOUND source). Without binding it falls back to the pre-A12 rule: the deepest containing root,\n * or every root for a shared CI/tool file (only the `workingDirectory` root when a step sets one).\n *\n * @param roots - Project roots from `findProjectRoots` (relative, `.` = repo root).\n */\nexport function scopesOf(source: Source, roots: readonly string[]): string[] {\n if (source.boundTo !== undefined) return [...source.boundTo]\n const all = roots.length > 0 ? [...roots] : ['.']\n if (isSharedFile(source.file)) {\n if (source.workingDirectory === undefined) return all\n return [deepestRoot(normalizeDir(source.workingDirectory), all)]\n }\n return [deepestRoot(dirOf(source.file.replace(/\\\\/g, '/')), all)]\n}\n\n/** Tool pin files that version managers look up from the working directory upwards. */\nfunction toolPinKind(file: string): string | undefined {\n const base = baseOf(file)\n if (base === '.nvmrc' || base === '.node-version' || base === '.python-version' || base === '.tool-versions') return base\n if (/^\\.?mise(\\.[\\w-]+)?\\.toml$/i.test(base)) return 'mise'\n return undefined\n}\n\n/** CI files at the repo root: `.github/**` (any letter case) and `.gitlab-ci.yml`. */\nfunction isRootCiFile(file: string): boolean {\n return /^\\.github\\//i.test(file) || /^\\.gitlab-ci\\.ya?ml$/i.test(file)\n}\n\n/** A Dockerfile (`Dockerfile`, `Dockerfile.dev`, `api.Dockerfile`) or a Compose file, in any folder. */\nfunction isContainerFile(file: string): boolean {\n const base = baseOf(file)\n return /^dockerfile/i.test(base) || /\\.dockerfile$/i.test(base) || /^(docker-)?compose(\\.[\\w-]+)*\\.ya?ml$/i.test(base)\n}\n\n/** Paths written as globs (`**\\/package-lock.json`) name no single project (A14): ignored. */\nfunction isGlobPath(path: string): boolean {\n return /[*?[{]/.test(path)\n}\n\n/** The parent directories of `dir`, nearest first, up to but not including `stop`. */\nfunction dirsBetween(dir: string, stop: string): string[] {\n const out: string[] = []\n let d = dir\n while (d !== stop && d !== '.') {\n out.push(d)\n const i = d.lastIndexOf('/')\n d = i < 0 ? '.' : d.slice(0, i)\n }\n return out\n}\n\n/**\n * Binds every source to the project roots it really belongs to (docs/TASKS.md A12) and returns\n * copies with `boundTo` set. Precision over recall: when the files do not say which project a\n * source serves, it is UNBOUND (`[]`) and is never compared with other pins.\n *\n * - A file inside a project root binds to its nearest enclosing root only.\n * - A tool pin file (`.nvmrc`, `.node-version`, `.python-version`, `.tool-versions`, `mise.toml`)\n * also binds to every project root below its directory that has no pin file of the same kind\n * for that runtime on the way down (nvm, pyenv, asdf and mise look upwards).\n * - A root CI setup step (`.github/**`, `.gitlab-ci.yml`), and any Dockerfile or Compose file whose\n * nearest project root is the repo root (root, `docker/`, `deploy/`, `.devcontainer/` …; A14),\n * binds to its `workingDirectory` root when set; else to the repo root if the repo root has a\n * manifest for that runtime (`package.json`, `pyproject.toml`/`setup.py`/`setup.cfg`, `go.mod`);\n * else to the roots named by `source.paths` (glob paths ignored); else it is UNBOUND.\n *\n * @param roots - Project roots (relative, `.` = repo root).\n * @param manifests - `manifestRuntimesOf(files)`: runtimes whose manifest each directory holds.\n */\nexport function bindSources(\n sources: readonly Source[],\n roots: readonly string[],\n manifests: ReadonlyMap<string, ReadonlySet<Runtime>>,\n): Source[] {\n const all = roots.length > 0 ? [...roots] : ['.']\n const pinDirs = new Set<string>()\n for (const s of sources) {\n const kind = toolPinKind(s.file)\n if (kind) pinDirs.add(`${s.runtime}\\u0000${kind}\\u0000${dirOf(s.file)}`)\n }\n const bindOne = (s: Source): string[] => {\n const file = s.file.replace(/\\\\/g, '/')\n const dir = dirOf(file)\n const kind = toolPinKind(file)\n // A12 + A14: root CI, and any Dockerfile/Compose file whose nearest project root is the repo root\n // (docker/, deploy/, .devcontainer/ …), say nothing about which project they serve by location.\n if (isRootCiFile(file) || (!kind && isContainerFile(file) && deepestRoot(dir, all) === '.')) {\n if (s.workingDirectory !== undefined) return [deepestRoot(normalizeDir(s.workingDirectory), all)]\n if (manifests.get('.')?.has(s.runtime)) return ['.']\n const named = (s.paths ?? []).filter((p) => !isGlobPath(p)).map((p) => deepestRoot(normalizeDir(p), all))\n return [...new Set(named)].sort()\n }\n if (kind) {\n const below = all.filter((r) => r === dir || dir === '.' || r.startsWith(`${dir}/`))\n if (below.length === 0) return [deepestRoot(dir, all)]\n return below.filter((r) => !dirsBetween(r, dir).some((d) => pinDirs.has(`${s.runtime}\\u0000${kind}\\u0000${d}`)))\n }\n return [deepestRoot(dir, all)]\n }\n return sources.map((s) => ({ ...s, boundTo: bindOne(s) }))\n}\n\n/** Groups sources by project root and runtime, in a stable order. */\nexport function groupByScope(sources: readonly Source[], roots: readonly string[]): Scope[] {\n const groups = new Map<string, Scope>()\n for (const source of sources) {\n for (const root of scopesOf(source, roots)) {\n const key = `${root}\\u0000${source.runtime}`\n let g = groups.get(key)\n if (!g) groups.set(key, (g = { root, runtime: source.runtime, sources: [] }))\n g.sources.push(source)\n }\n }\n return [...groups.values()].sort((a, b) => (a.root === b.root ? a.runtime.localeCompare(b.runtime) : a.root < b.root ? -1 : 1))\n}\n\nfunction ref(s: Source): SourceRef {\n return { file: s.file, line: s.line, raw: s.raw, constraint: s.constraint }\n}\n\nfunction where(s: Source): string {\n return `${s.file}:${s.line}`\n}\n\nfunction byPosition(a: Source, b: Source): number {\n return a.file === b.file ? a.line - b.line : a.file < b.file ? -1 : 1\n}\n\nconst SEVERITY: Record<FindingCode, Severity> = {\n VERSION_CONFLICT: 'error',\n OUTSIDE_RANGE: 'error',\n PRECISION_MISMATCH: 'info',\n EOL_RUNTIME: 'warning',\n EOL_SOON: 'info',\n FLOATING_ALIAS: 'info',\n UNPARSEABLE: 'info',\n}\n\nconst SEVERITY_ORDER: Record<Severity, number> = { error: 0, warning: 1, info: 2 }\n\n/** A source ready for comparison: its range, and whether it is a pin (one version or a prefix). */\ninterface Comparable {\n source: Source\n range: string\n pin: boolean\n}\n\nfunction comparable(source: Source, options: CompareOptions): Comparable | undefined {\n const c = source.constraint\n if (c.kind === 'alias') {\n if (isFloatingAlias(c.alias)) return undefined\n const range = options.resolveAlias?.(source.runtime, c.alias)\n return range && semver.validRange(range) ? { source, range, pin: true } : undefined\n }\n const range = toRange(c)\n if (range === undefined) return undefined\n return { source, range, pin: c.kind === 'exact' || c.kind === 'partial' }\n}\n\nfunction overlaps(a: string, b: string): boolean {\n try {\n return semver.intersects(a, b)\n } catch {\n // Both ranges were validated; treat a library failure as \"no evidence of a conflict\".\n return true\n }\n}\n\nfunction pinText(s: Source): string {\n return `${s.runtime} ${describeConstraint(s.constraint)}`\n}\n\nclass Collector {\n private readonly found = new Map<string, Finding>()\n\n /** `scope` undefined = an UNBOUND source: the finding gets no scope. */\n add(code: FindingCode, runtime: Runtime, sources: Source[], scope: string | undefined, message: string): void {\n const ordered = [...sources].sort(byPosition)\n const key = `${code}\\u0000${runtime}\\u0000${ordered.map((s) => `${where(s)}\\u0000${s.raw}`).join('\\u0001')}`\n const existing = this.found.get(key)\n if (existing) {\n if (scope !== undefined && !existing.scopes.includes(scope)) existing.scopes.push(scope)\n return\n }\n this.found.set(key, { code, severity: SEVERITY[code], runtime, sources: ordered.map(ref), scopes: scope === undefined ? [] : [scope], message })\n }\n\n findings(): Finding[] {\n const list = [...this.found.values()]\n for (const f of list) f.scopes.sort()\n return list.sort(\n (a, b) =>\n SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity] ||\n (a.sources[0]?.file ?? '').localeCompare(b.sources[0]?.file ?? '') ||\n (a.sources[0]?.line ?? 0) - (b.sources[0]?.line ?? 0) ||\n a.code.localeCompare(b.code),\n )\n }\n}\n\nfunction outsideRange(out: Collector, scope: Scope, pin: Comparable, range: Comparable): void {\n if (overlaps(pin.range, range.range)) return\n out.add(\n 'OUTSIDE_RANGE',\n scope.runtime,\n [pin.source, range.source],\n scope.root,\n `${where(pin.source)} pins ${pinText(pin.source)}, outside the range ${describeConstraint(range.source.constraint)} required by ${where(range.source)}.`,\n )\n}\n\n/** True when some two of the comparables have no version in common. */\nfunction anyDisjoint(list: readonly Comparable[]): boolean {\n for (let i = 0; i < list.length; i++) {\n for (let j = i + 1; j < list.length; j++) if (!overlaps((list[i] as Comparable).range, (list[j] as Comparable).range)) return true\n }\n return false\n}\n\n/** `18 (.nvmrc:1), 22 (Dockerfile:1, Dockerfile:7)`: sources grouped by the version they pin. */\nfunction groupedList(sources: readonly Source[]): { text: string; groups: number; files: number } {\n const groups = new Map<string, Source[]>()\n for (const s of [...sources].sort(byPosition)) {\n const key = describeConstraint(s.constraint)\n const list = groups.get(key)\n if (list) list.push(s)\n else groups.set(key, [s])\n }\n const text = [...groups].map(([version, list]) => `${version} (${list.map(where).join(', ')})`).join(', ')\n return { text, groups: groups.size, files: new Set(sources.map((s) => s.file)).size }\n}\n\nfunction plural(n: number, word: string): string {\n return `${n} ${word}${n === 1 ? '' : 's'}`\n}\n\n/**\n * One VERSION_CONFLICT for the scope (docs/TASKS.md A10): every pin when two pins cannot both hold,\n * plus every range source when two ranges have nothing in common, grouped by version.\n */\nfunction versionConflict(out: Collector, scope: Scope, pins: readonly Comparable[], ranges: readonly Comparable[]): void {\n const involved: Source[] = []\n if (anyDisjoint(pins)) involved.push(...pins.map((p) => p.source))\n if (anyDisjoint(ranges)) involved.push(...ranges.map((r) => r.source))\n if (involved.length === 0) return\n const { text, groups, files } = groupedList(involved)\n out.add(\n 'VERSION_CONFLICT',\n scope.runtime,\n involved,\n scope.root,\n `${scope.runtime}: ${groups} different versions across ${plural(files, 'file')}: ${text}; no version satisfies all of them.`,\n )\n}\n\n/** One PRECISION_MISMATCH for the scope: pins that agree but are written at different precision. */\nfunction precisionMismatch(out: Collector, scope: Scope, pins: readonly Comparable[]): void {\n const involved = new Set<Source>()\n for (let i = 0; i < pins.length; i++) {\n for (let j = i + 1; j < pins.length; j++) {\n const a = pins[i] as Comparable\n const b = pins[j] as Comparable\n const ca = a.source.constraint\n const cb = b.source.constraint\n if (\n (ca.kind === 'exact' || ca.kind === 'partial') &&\n (cb.kind === 'exact' || cb.kind === 'partial') &&\n ca.version !== cb.version &&\n overlaps(a.range, b.range)\n ) {\n involved.add(a.source)\n involved.add(b.source)\n }\n }\n }\n if (involved.size === 0) return\n const { text } = groupedList([...involved])\n out.add(\n 'PRECISION_MISMATCH',\n scope.runtime,\n [...involved],\n scope.root,\n `${scope.runtime}: these pins agree but are written at different precision: ${text}.`,\n )\n}\n\n/**\n * The findings one source earns on its own (UNPARSEABLE, FLOATING_ALIAS, an alias the resolver\n * cannot place), or the source ready for comparison.\n */\nfunction checkAlone(out: Collector, source: Source, scope: string | undefined, options: CompareOptions): Comparable | undefined {\n const c = source.constraint\n if (c.kind === 'unknown') {\n out.add('UNPARSEABLE', source.runtime, [source], scope, `${where(source)}: could not read \"${source.raw}\" as a ${source.runtime} version (${c.reason}).`)\n return undefined\n }\n if (c.kind === 'alias' && isFloatingAlias(c.alias)) {\n out.add(\n 'FLOATING_ALIAS',\n source.runtime,\n [source],\n scope,\n `${where(source)} pins ${source.runtime} to \"${source.raw}\", which moves with every new release; pin a version instead.`,\n )\n return undefined\n }\n const cmp = comparable(source, options)\n if (!cmp && c.kind === 'alias' && options.resolveAlias) {\n // Constraint 9: with a resolver, an alias it cannot resolve is reported, never skipped.\n out.add(\n 'UNPARSEABLE',\n source.runtime,\n [source],\n scope,\n `${where(source)}: the ${source.runtime} alias \"${source.raw}\" does not match any release line in the bundled data.`,\n )\n }\n return cmp\n}\n\n/**\n * Compares the sources of every project root and runtime and returns the findings, most severe\n * first. A finding that several roots share (a root-level file against another) is reported once\n * with every root in `scopes`.\n *\n * Rules (docs/TASKS.md A10): a pin (exact/partial/resolved alias) outside a range source →\n * OUTSIDE_RANGE, one per (pin, range) pair since each is a separate fix; pins that cannot all hold,\n * or ranges with nothing in common → ONE VERSION_CONFLICT per runtime and scope listing every pin\n * (and every range) grouped by version; agreeing pins written at different precision → ONE\n * PRECISION_MISMATCH per runtime and scope. CI matrix entries are checked only against ranges. `latest`/`node`/`stable` → FLOATING_ALIAS and are not compared;\n * text the extractor could not parse → UNPARSEABLE. Scopes with a single source produce nothing.\n * Sources bound by `bindSources` are grouped by `boundTo`; UNBOUND ones (`boundTo: []`) only get\n * UNPARSEABLE / FLOATING_ALIAS findings, with no scope (docs/TASKS.md A12).\n *\n * @param sources - Every source found in the repo.\n * @param roots - Project roots (relative, `.` = repo root); defaults to the repo root only.\n */\nexport function compareSources(sources: readonly Source[], roots: readonly string[] = ['.'], options: CompareOptions = {}): Finding[] {\n const out = new Collector()\n // UNBOUND sources (A12): their own problems are still reported, they are compared with nothing.\n for (const source of [...sources].sort(byPosition)) {\n if (source.boundTo !== undefined && source.boundTo.length === 0) checkAlone(out, source, undefined, options)\n }\n for (const scope of groupByScope(sources, roots)) {\n const pins: Comparable[] = []\n const matrix: Comparable[] = []\n for (const source of [...scope.sources].sort(byPosition)) {\n const cmp = checkAlone(out, source, scope.root, options)\n if (cmp) (source.matrix ? matrix : pins).push(cmp)\n }\n const fixed = pins.filter((p) => p.pin)\n const ranges = pins.filter((p) => !p.pin)\n for (const p of [...fixed, ...matrix]) for (const r of ranges) outsideRange(out, scope, p, r)\n versionConflict(out, scope, fixed, ranges)\n precisionMismatch(out, scope, fixed)\n }\n return out.findings()\n}\n","/**\n * Finds project roots and walks repo files (docs/TASKS.md, Domain model: Scope).\n */\nimport { readdir } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport type { Runtime } from './types'\n\n/** Directories never entered: dependencies, VCS data, build output, virtualenvs. */\nexport const IGNORED_DIRS: ReadonlySet<string> = new Set(['node_modules', '.git', 'dist', 'build', 'vendor', '.venv'])\n\n/** Manifests that say which runtime a directory's project uses (A12 root-CI rule). */\nconst MANIFEST_RUNTIME: Readonly<Record<string, Runtime>> = {\n 'package.json': 'node',\n 'pyproject.toml': 'python',\n 'setup.py': 'python',\n 'setup.cfg': 'python',\n 'go.mod': 'go',\n}\n\n/**\n * For every directory that has one, the runtimes whose manifest it holds (`package.json` → node,\n * `pyproject.toml`/`setup.py`/`setup.cfg` → python, `go.mod` → go). Keys are relative dirs, `.` = root.\n */\nexport function manifestRuntimesOf(files: readonly string[]): Map<string, Set<Runtime>> {\n const out = new Map<string, Set<Runtime>>()\n for (const file of files) {\n const i = file.lastIndexOf('/')\n const runtime = MANIFEST_RUNTIME[file.slice(i + 1)]\n if (!runtime) continue\n const dir = i < 0 ? '.' : file.slice(0, i)\n let set = out.get(dir)\n if (!set) out.set(dir, (set = new Set()))\n set.add(runtime)\n }\n return out\n}\n\n/** Files whose presence makes a directory a project root. */\nexport const ROOT_MARKERS: ReadonlySet<string> = new Set(['package.json', 'pyproject.toml', 'go.mod'])\n\n/**\n * Directory names skipped by default because they hold test fixtures, not the project's own pins\n * (docs/TASKS.md A12): `fixtures`, `fixture`, `__fixtures__`, `testdata`, `test_data`, `_testdata`,\n * `test-fixtures`, `test_fixtures`, `testfixtures`, any letter case. Matched per directory segment.\n */\nexport const FIXTURE_DIR = /^(_?test[-_]?data|test[-_]?fixtures?|__fixtures__|fixtures?|testdata)$/i\n\n/** True when a directory name is a fixture folder (see `FIXTURE_DIR`). */\nexport function isFixtureDir(name: string): boolean {\n return FIXTURE_DIR.test(name)\n}\n\n/** Options of `scanFiles` / `walkFiles`. */\nexport interface ScanOptions {\n /** Also scan fixture folders (`FIXTURE_DIR`; default false). */\n includeFixtures?: boolean\n /**\n * Extra paths to skip, as globs relative to the scanned directory: `*` and `?` stay inside one\n * path segment, `**` crosses segments. A pattern without `/` matches a file or directory name at\n * any depth (`examples`, `*.Dockerfile`); a pattern with `/` matches the whole relative path\n * (`docs/**`, `services/legacy`). A matching directory is skipped with everything under it.\n */\n exclude?: readonly string[]\n}\n\n/** What a scan found, and how many files it skipped because of fixture or `exclude` rules. */\nexport interface ScanResult {\n files: string[]\n /** Files under directories or matching paths skipped by the fixture rule or `exclude`. */\n excluded: number\n}\n\nfunction escapeRegex(text: string): string {\n return text.replace(/[.+^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n/** Converts one exclude glob to a test on a relative path (see `ScanOptions.exclude`). */\nexport function globMatcher(glob: string): (path: string) => boolean {\n const pattern = glob.trim().replace(/\\\\/g, '/').replace(/^\\.\\//, '').replace(/\\/+$/, '')\n let re = ''\n for (let i = 0; i < pattern.length; i++) {\n const c = pattern[i] as string\n if (c === '*') {\n if (pattern[i + 1] === '*') {\n i++\n if (pattern[i + 1] === '/') {\n i++\n re += '(?:.*/)?'\n } else {\n re += '.*'\n }\n } else {\n re += '[^/]*'\n }\n } else if (c === '?') {\n re += '[^/]'\n } else {\n re += escapeRegex(c)\n }\n }\n const regex = new RegExp(`^${re}$`)\n if (!pattern.includes('/')) return (path) => regex.test(path.slice(path.lastIndexOf('/') + 1))\n return (path) => regex.test(path)\n}\n\nasync function countFiles(abs: string): Promise<number> {\n let n = 0\n for (const entry of await readdir(abs, { withFileTypes: true })) {\n if (entry.isSymbolicLink()) continue\n if (entry.isDirectory()) n += await countFiles(join(abs, entry.name))\n else if (entry.isFile()) n++\n }\n return n\n}\n\n/**\n * Every file under `dir`, as a path relative to `dir` with '/' separators, sorted, and the number\n * of files skipped by the fixture rule and `exclude`. Never enters `IGNORED_DIRS` (not counted) or\n * symbolic links (so a link cycle cannot hang the walk).\n */\nexport async function scanFiles(dir: string, options: ScanOptions = {}): Promise<ScanResult> {\n const files: string[] = []\n let excluded = 0\n const matchers = (options.exclude ?? []).filter((g) => g.trim() !== '').map(globMatcher)\n const skip = (path: string) => matchers.some((m) => m(path))\n async function visit(rel: string): Promise<void> {\n const abs = rel === '' ? dir : join(dir, rel)\n const entries = await readdir(abs, { withFileTypes: true })\n for (const entry of entries) {\n if (entry.isSymbolicLink()) continue\n const path = rel === '' ? entry.name : `${rel}/${entry.name}`\n if (entry.isDirectory()) {\n if (IGNORED_DIRS.has(entry.name)) continue\n if ((!options.includeFixtures && isFixtureDir(entry.name)) || skip(path)) {\n excluded += await countFiles(join(abs, entry.name))\n continue\n }\n await visit(path)\n } else if (entry.isFile()) {\n if (skip(path)) excluded++\n else files.push(path)\n }\n }\n }\n await visit('')\n return { files: files.sort(), excluded }\n}\n\n/** The files `scanFiles` keeps (fixtures and `exclude` matches left out unless asked for). */\nexport async function walkFiles(dir: string, options: ScanOptions = {}): Promise<string[]> {\n return (await scanFiles(dir, options)).files\n}\n\n/**\n * The project roots of a repo: `.` (the repo root, always) plus every directory that contains a\n * `package.json`, `pyproject.toml` or `go.mod` outside the `IGNORED_DIRS`. Relative paths with\n * '/' separators, sorted.\n *\n * @param files - Optional result of `walkFiles(dir)`, to avoid walking twice.\n */\nexport async function findProjectRoots(dir: string, files?: readonly string[]): Promise<string[]> {\n const list = files ?? (await walkFiles(dir))\n return projectRootsOf(list)\n}\n\n/** The project roots implied by a list of relative file paths (see `findProjectRoots`). */\nexport function projectRootsOf(files: readonly string[]): string[] {\n const roots = new Set<string>(['.'])\n for (const file of files) {\n const i = file.lastIndexOf('/')\n const base = file.slice(i + 1)\n if (!ROOT_MARKERS.has(base)) continue\n const parts = file.split('/').slice(0, -1)\n if (parts.some((p) => IGNORED_DIRS.has(p))) continue\n roots.add(i < 0 ? '.' : file.slice(0, i))\n }\n return [...roots].sort()\n}\n"],"mappings":";AAMA,OAAO,YAAY;AAInB,IAAM,WAAW,oBAAI,IAAI,CAAC,UAAU,QAAQ,UAAU,WAAW,UAAU,WAAW,CAAC;AAGvF,IAAM,QAAQ;AAGd,IAAM,kBAAkB,oBAAI,IAAI;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,SAAS,gBAAgB,OAAwB;AACtD,SAAO,SAAS,IAAI,MAAM,YAAY,CAAC;AACzC;AAEA,IAAM,QAAQ;AACd,IAAM,UAAU;AAEhB,SAAS,YAAY,MAAc,SAA0B;AAC3D,MAAI,IAAI,KAAK,KAAK;AAClB,MAAI,YAAY,KAAM,KAAI,EAAE,QAAQ,aAAa,EAAE;AACnD,MAAI,YAAY,SAAU,KAAI,EAAE,QAAQ,oBAAoB,EAAE;AAC9D,SAAO,EAAE,QAAQ,eAAe,EAAE;AACpC;AAGA,SAAS,aAAa,MAAsC;AAC1D,MAAI,MAAM,KAAK,IAAI,EAAG,QAAO,EAAE,MAAM,SAAS,SAAS,KAAK;AAC5D,QAAM,IAAI,QAAQ,KAAK,IAAI;AAC3B,MAAI,EAAG,QAAO,EAAE,MAAM,WAAW,SAAS,EAAE,CAAC,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