runtime-pin-check 0.0.0-stage → 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/LICENSE +24 -0
- package/README.md +418 -2
- package/dist/chunk-TRO76P2I.js +577 -0
- package/dist/chunk-TRO76P2I.js.map +1 -0
- package/dist/cli.d.ts +103 -0
- package/dist/cli.js +2779 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +96 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/types-Dgq4vv3C.d.ts +124 -0
- package/package.json +59 -4
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts","../src/eol.ts","../data/eol.json","../src/extract/shared/yaml-util.ts","../src/extract/shared/imageref.ts","../src/extract/shared/dockerfile.ts","../src/extract/shared/gitlab.ts","../src/extract/shared/images.ts","../src/extract/shared/toml.ts","../src/extract/shared/mise.ts","../src/extract/shared/tool-versions.ts","../src/extract/shared/workflow.ts","../src/extract/diagnose.ts","../src/extract/python/adapters.ts","../src/extract/go/gomod.ts","../src/extract/go/index.ts","../src/extract/node/util.ts","../src/extract/node/ci.ts","../src/extract/node/package-json.ts","../src/extract/node/version-files.ts","../src/extract/node/index.ts","../src/extract/python/files.ts","../src/extract/python/index.ts","../src/fix.ts","../src/report.ts","../package.json"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Command line (docs/TASKS.md, CLI):\n * `runtime-pin-check [dir] [--json] [--runtime node,python,go] [--fail-on error|warning|info]\n * [--date YYYY-MM-DD] [--fix --to <version> [--runtime <one>] [--dry-run] [--fix-ranges]]`\n *\n * Exit codes: 0 = no finding at or above `--fail-on` (default `error`); 1 = at least one;\n * 2 = usage or I/O error. Under `GITHUB_ACTIONS=true` it also prints workflow annotations.\n * Offline: reads only the files of the scanned directory and the bundled end-of-life data.\n */\nimport { realpathSync } from 'node:fs'\nimport { readFile, stat, writeFile } from 'node:fs/promises'\nimport { relative, resolve, sep } from 'node:path'\nimport { pathToFileURL } from 'node:url'\nimport { parseArgs } from 'node:util'\nimport { bindSources, compareSources, groupByScope } from './compare'\nimport { isFloatingAlias } from './constraint'\nimport { bundledSnapshot, checkDate, createAliasResolver, eolFindings } from './eol'\nimport { diagnoseFile } from './extract/diagnose'\nimport { extractGo } from './extract/go'\nimport { extractNode } from './extract/node'\nimport { extractPython } from './extract/python'\nimport { exactUtf8, FixError, planFix, splitBom, unifiedDiff, type FixPlan } from './fix'\nimport { failsAt, formatAnnotations, formatDiagnosticAnnotations, formatJson, formatText, type CheckReport } from './report'\nimport { manifestRuntimesOf, projectRootsOf, scanFiles } from './scan'\nimport type { Diagnostic, Finding, Runtime, Severity, Source } from './types'\nimport packageJson from '../package.json'\n\n/** The package version, from package.json at build time. */\nexport const VERSION: string = packageJson.version\n\nconst RUNTIMES: readonly Runtime[] = ['node', 'python', 'go']\nconst SEVERITIES: readonly Severity[] = ['error', 'warning', 'info']\nconst RANK: Record<Severity, number> = { error: 0, warning: 1, info: 2 }\n\n/** Files larger than this are not version files; they are skipped unread. */\nconst MAX_FILE_BYTES = 1024 * 1024\n\n/**\n * Names that can hold a pin. The extractors decide precisely; this only avoids reading every file\n * of a large repo.\n */\nconst CANDIDATE =\n /(^|\\/)(\\.nvmrc|\\.node-version|\\.python-version|\\.tool-versions|package\\.json|pyproject\\.toml|runtime\\.txt|go\\.mod|[^/]*mise[^/]*\\.toml|config\\.toml|[^/]*dockerfile[^/]*|\\.gitlab-ci\\.ya?ml|action\\.ya?ml)$/i\nconst GITHUB_YAML = /^\\.github\\/.+\\.ya?ml$/i\n\nexport const USAGE = `Usage: runtime-pin-check [dir] [options]\n\nFinds Node, Python and Go version pins that disagree across a repo's files.\n\nOptions:\n --json print the result as JSON\n --runtime node,python,go only these runtimes (default: all)\n --fail-on error|warning|info exit 1 when a finding is at or above this level (default: error)\n --date YYYY-MM-DD check end-of-life and LTS aliases as of this date (default: today, UTC)\n --include-fixtures also scan fixture folders (skipped by default: fixtures/, fixture/,\n __fixtures__/, test_fixtures/, test-fixtures/, testdata/, test_data/ ...)\n --exclude <glob> skip matching paths (repeatable; 'examples', 'docs/**', '*.Dockerfile')\n --fix --to <version> rewrite pins to <version> (with --runtime <one>, --dry-run, --fix-ranges)\n -v, --version print the version\n -h, --help show this help\n\nExit codes: 0 no finding at or above --fail-on, 1 findings, 2 usage or I/O error.\n`\n\n/** Where `run` writes and what it reads from the environment; tests replace it. */\nexport interface CliIo {\n stdout: (text: string) => void\n stderr: (text: string) => void\n env: Readonly<Record<string, string | undefined>>\n cwd: string\n}\n\n/** Parsed command line. */\nexport interface CliOptions {\n dir: string\n json: boolean\n runtimes: Runtime[]\n failOn: Severity\n date: string | undefined\n includeFixtures: boolean\n exclude: string[]\n fix: boolean\n to: string | undefined\n dryRun: boolean\n fixRanges: boolean\n help: boolean\n version: boolean\n}\n\nclass UsageError extends Error {}\n\n/**\n * Parses the arguments (without `node` and the script path).\n *\n * @throws UsageError (exit 2) on unknown options, bad values or flags used without `--fix`.\n */\nexport function parseCliArgs(argv: readonly string[]): CliOptions {\n let parsed\n try {\n parsed = parseArgs({\n args: [...argv],\n allowPositionals: true,\n strict: true,\n options: {\n json: { type: 'boolean' },\n runtime: { type: 'string' },\n 'fail-on': { type: 'string' },\n date: { type: 'string' },\n 'include-fixtures': { type: 'boolean' },\n exclude: { type: 'string', multiple: true },\n fix: { type: 'boolean' },\n to: { type: 'string' },\n 'dry-run': { type: 'boolean' },\n 'fix-ranges': { type: 'boolean' },\n help: { type: 'boolean', short: 'h' },\n version: { type: 'boolean', short: 'v' },\n },\n })\n } catch (err) {\n throw new UsageError(err instanceof Error ? err.message : String(err))\n }\n const v = parsed.values\n if (parsed.positionals.length > 1) throw new UsageError(`expected one directory, got ${parsed.positionals.length}`)\n\n let runtimes: Runtime[] = [...RUNTIMES]\n if (v.runtime !== undefined) {\n const list = v.runtime.split(',').map((r) => r.trim().toLowerCase()).filter((r) => r !== '')\n const bad = list.filter((r) => !RUNTIMES.includes(r as Runtime))\n if (list.length === 0 || bad.length > 0) throw new UsageError(`--runtime takes node, python and/or go, got \"${v.runtime}\"`)\n runtimes = [...new Set(list)] as Runtime[]\n }\n\n const failOn = (v['fail-on'] ?? 'error').toLowerCase()\n if (!SEVERITIES.includes(failOn as Severity)) throw new UsageError(`--fail-on takes error, warning or info, got \"${v['fail-on']}\"`)\n\n const fix = v.fix === true\n if (!fix) {\n for (const flag of ['to', 'dry-run', 'fix-ranges'] as const) {\n if (v[flag] !== undefined) throw new UsageError(`--${flag} only works together with --fix`)\n }\n } else {\n if (v.to === undefined || v.to.trim() === '') throw new UsageError('--fix needs --to <version>')\n if (v.json) throw new UsageError('--fix cannot be combined with --json')\n }\n\n return {\n dir: parsed.positionals[0] ?? '.',\n json: v.json === true,\n runtimes,\n failOn: failOn as Severity,\n date: v.date,\n includeFixtures: v['include-fixtures'] === true,\n exclude: v.exclude ?? [],\n fix,\n to: v.to,\n dryRun: v['dry-run'] === true,\n fixRanges: v['fix-ranges'] === true,\n help: v.help === true,\n version: v.version === true,\n }\n}\n\n/** What reading a directory produced: the pins, and the files that could not be fully read. */\nexport interface ReadResult {\n sources: Source[]\n diagnostics: Diagnostic[]\n}\n\n/**\n * Every pin in the directory, read with the three runtime extractors, plus a diagnostic for each\n * file with a YAML/TOML/JSON syntax error (never silent: docs/TASKS.md constraint 9).\n */\nexport async function readDirectory(dir: string, files: readonly string[], runtimes: readonly Runtime[] = RUNTIMES): Promise<ReadResult> {\n const sources: Source[] = []\n const diagnostics: Diagnostic[] = []\n for (const file of files) {\n if (!CANDIDATE.test(file) && !GITHUB_YAML.test(file)) continue\n const path = resolve(dir, file)\n const info = await stat(path)\n if (info.size > MAX_FILE_BYTES) continue\n // A leading byte-order mark is not part of the file's content: without this a BOM package.json\n // yields no pins and every line-1 column is off by one. One place, so no extractor needs to know.\n const text = splitBom(await readFile(path, 'utf8')).body\n sources.push(...extractNode(file, text), ...extractPython(file, text), ...extractGo(file, text))\n diagnostics.push(...diagnoseFile(file, text, runtimes))\n }\n return { sources, diagnostics }\n}\n\n/** Every pin in the directory, read with the three runtime extractors. */\nexport async function collectSources(dir: string, files: readonly string[]): Promise<Source[]> {\n return (await readDirectory(dir, files)).sources\n}\n\nfunction sortFindings(findings: Finding[]): Finding[] {\n return findings.sort(\n (a, b) =>\n RANK[a.severity] - RANK[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/**\n * Checks a directory and builds the report (no output, no exit code).\n *\n * @throws RangeError for an invalid `date`; I/O errors from reading the directory.\n */\nexport async function checkDirectory(\n dir: string,\n options: { runtimes?: readonly Runtime[]; date?: string; includeFixtures?: boolean; exclude?: readonly string[] } = {},\n): Promise<CheckReport> {\n const runtimes = options.runtimes ?? RUNTIMES\n const date = checkDate(options.date)\n const snapshot = bundledSnapshot()\n const resolveAlias = createAliasResolver(snapshot, date)\n const scan = await scanFiles(dir, { includeFixtures: options.includeFixtures, exclude: options.exclude })\n const files = scan.files\n const roots = projectRootsOf(files)\n // A12: tie every source to the project roots it serves before comparing or judging EOL.\n const read = await readDirectory(dir, files, runtimes)\n const sources = bindSources(\n read.sources.filter((s) => runtimes.includes(s.runtime)),\n roots,\n manifestRuntimesOf(files),\n )\n const findings = sortFindings([\n ...compareSources(sources, roots, { resolveAlias }),\n ...eolFindings(sources, roots, { snapshot, date }),\n ])\n // Floating and unreadable pins are already findings; the list is for pins that had nothing to compare with.\n const singleSource = groupByScope(sources, roots)\n .filter((g) => g.sources.length === 1)\n .filter((g) => {\n const c = (g.sources[0] as Source).constraint\n return c.kind !== 'unknown' && !(c.kind === 'alias' && isFloatingAlias(c.alias))\n })\n .map((g) => {\n const s = g.sources[0] as Source\n return { root: g.root, runtime: g.runtime, file: s.file, line: s.line, raw: s.raw }\n })\n return { directory: dir, date, dataDate: snapshot.fetchedAt, roots, sources, findings, singleSource, excludedFiles: scan.excluded, diagnostics: read.diagnostics, resolveAlias }\n}\n\nconst defaultIo = (): CliIo => ({\n stdout: (t) => process.stdout.write(t),\n stderr: (t) => process.stderr.write(t),\n env: process.env,\n cwd: process.cwd(),\n})\n\n/** The text of the plan for people: what changed, what was left alone and why. */\nfunction formatFixSummary(plan: FixPlan, options: CliOptions, dryRun: boolean): string {\n const files = plan.files.size\n const lines = [\n `runtime-pin-check --fix --to ${plan.target}${options.fixRanges ? ' --fix-ranges' : ''}${dryRun ? ' (dry run: nothing written)' : ''}`,\n plan.edits.length === 0\n ? 'nothing to change'\n : `${dryRun ? 'would change' : 'changed'} ${plan.edits.length} pin${plan.edits.length === 1 ? '' : 's'} in ${files} file${files === 1 ? '' : 's'}:`,\n ]\n for (const e of plan.edits) lines.push(` ${e.file}:${e.line} ${e.from} -> ${e.to}`)\n if (plan.unchanged.length > 0) lines.push(`already at ${plan.target}: ${plan.unchanged.length} pin${plan.unchanged.length === 1 ? '' : 's'}`)\n if (plan.skipped.length > 0) {\n lines.push(`left alone (${plan.skipped.length}); nothing is guessed:`)\n // Pins on one line for one reason (a CI matrix of eight versions) are listed together.\n const groups = new Map<string, { file: string; line: number; raws: string[]; reason: string; detail: string }>()\n for (const s of plan.skipped) {\n const key = `${s.source.file}\\0${s.source.line}\\0${s.reason}`\n const group = groups.get(key)\n if (group) group.raws.push(s.source.raw)\n else groups.set(key, { file: s.source.file, line: s.source.line, raws: [s.source.raw], reason: s.reason, detail: s.detail })\n }\n for (const g of groups.values()) lines.push(` ${g.file}:${g.line} ${g.raws.map((r) => `\"${r}\"`).join(', ')} (${g.reason}): ${g.detail}`)\n }\n return `${lines.join('\\n')}\\n`\n}\n\n/**\n * `--fix --to <version>`: moves every exact/partial pin (and, with `--fix-ranges`, every range) to\n * one version, keeping each pin's style and every other byte of its file (src/fix.ts decides what is\n * safe). `--dry-run` prints a unified diff on stdout and writes nothing. Reads the same files as the\n * check (fixtures and `--exclude` respected), refuses files that are not valid UTF-8, and never\n * writes a file that changed since it was read.\n *\n * @returns 0 when done (including \"nothing to change\"); 2 for a usage or I/O error.\n */\nexport async function runFix(options: CliOptions, io: CliIo): Promise<number> {\n const dir = resolve(io.cwd, options.dir)\n try {\n if (!(await stat(dir)).isDirectory()) throw new Error(`${options.dir} is not a directory`)\n } catch (err) {\n io.stderr(`runtime-pin-check: cannot read ${options.dir}: ${(err as Error).message}\\n`)\n return 2\n }\n const written: string[] = []\n try {\n const scan = await scanFiles(dir, { includeFixtures: options.includeFixtures, exclude: options.exclude })\n const sources = (await collectSources(dir, scan.files)).filter((s) => options.runtimes.includes(s.runtime))\n // Keep the exact bytes: a file that is not valid UTF-8 is never rewritten.\n const originals = new Map<string, Buffer>()\n const texts = new Map<string, string>() // without the BOM: the coordinates the sources use\n const boms = new Map<string, string>() // '' or the BOM each file starts with, written back as it was\n for (const file of new Set(sources.map((s) => s.file))) {\n const bytes = await readFile(resolve(dir, file))\n const text = exactUtf8(bytes)\n originals.set(file, bytes)\n if (text === undefined) continue\n const { bom, body } = splitBom(text)\n texts.set(file, body)\n boms.set(file, bom)\n }\n const plan = planFix({\n sources,\n files: texts,\n to: options.to as string,\n ...(options.runtimes.length === 1 ? { runtime: options.runtimes[0] as Runtime } : {}),\n fixRanges: options.fixRanges,\n })\n if (options.dryRun) {\n // The diff shows the file as it is on disk (BOM included), so `git apply` matches line 1.\n for (const [file, after] of plan.files) {\n const bom = boms.get(file) as string\n io.stdout(unifiedDiff(file, bom + (texts.get(file) as string), bom + after))\n }\n io.stderr(formatFixSummary(plan, options, true))\n return 0\n }\n for (const [file, after] of plan.files) {\n const path = resolve(dir, file)\n // The file must still be what the plan was made from.\n if (!(await readFile(path)).equals(originals.get(file) as Buffer)) {\n throw new Error(`${file} changed while --fix was running; nothing more was written, run it again`)\n }\n await writeFile(path, (boms.get(file) as string) + after, 'utf8')\n written.push(file)\n }\n io.stdout(formatFixSummary(plan, options, false))\n return 0\n } catch (err) {\n const done = written.length > 0 ? ` (already written: ${written.join(', ')})` : ''\n io.stderr(`runtime-pin-check: ${err instanceof FixError ? err.message : (err as Error).message}${done}\\n`)\n return 2\n }\n}\n\n/**\n * Runs the command line and returns the exit code (it never calls `process.exit`).\n *\n * @param argv - Arguments without `node` and the script path.\n */\nexport async function run(argv: readonly string[], io: CliIo = defaultIo()): Promise<number> {\n let options: CliOptions\n try {\n options = parseCliArgs(argv)\n } catch (err) {\n io.stderr(`runtime-pin-check: ${(err as Error).message}\\n\\n${USAGE}`)\n return 2\n }\n if (options.version) {\n io.stdout(`${VERSION}\\n`)\n return 0\n }\n if (options.help) {\n io.stdout(USAGE)\n return 0\n }\n if (options.fix) return runFix(options, io)\n\n const dir = resolve(io.cwd, options.dir)\n try {\n const info = await stat(dir)\n if (!info.isDirectory()) throw new Error(`${options.dir} is not a directory`)\n } catch (err) {\n io.stderr(`runtime-pin-check: cannot read ${options.dir}: ${(err as Error).message}\\n`)\n return 2\n }\n\n let report: CheckReport\n try {\n report = await checkDirectory(dir, {\n runtimes: options.runtimes,\n date: options.date,\n includeFixtures: options.includeFixtures,\n exclude: options.exclude,\n })\n } catch (err) {\n io.stderr(`runtime-pin-check: ${(err as Error).message}\\n`)\n return 2\n }\n report.directory = options.dir\n\n const text = options.json ? formatJson(report) : formatText(report)\n io.stdout(text)\n if (io.env.GITHUB_ACTIONS === 'true') {\n // Paths in annotations are relative to the workspace (the working directory in Actions).\n const pathOf = (file: string) => relative(io.cwd, resolve(dir, file)).split(sep).join('/')\n const annotations = formatAnnotations(report.findings, pathOf) + formatDiagnosticAnnotations(report.diagnostics, pathOf)\n // With --json, stdout must stay valid JSON; the runner reads workflow commands from stderr too.\n if (options.json) io.stderr(annotations)\n else io.stdout(annotations)\n }\n return failsAt(report.findings, options.failOn) ? 1 : 0\n}\n\n/** True when this module is the program being run (not imported by a test or another module). */\nfunction isMain(): boolean {\n const entry = process.argv[1]\n if (entry === undefined) return false\n try {\n // npm runs the bin through a symlink (node_modules/.bin/runtime-pin-check): compare real paths.\n return import.meta.url === pathToFileURL(realpathSync(entry)).href\n } catch {\n return false\n }\n}\n\nif (isMain()) {\n run(process.argv.slice(2)).then(\n (code) => {\n process.exitCode = code\n },\n (err: unknown) => {\n process.stderr.write(`runtime-pin-check: ${err instanceof Error ? err.message : String(err)}\\n`)\n process.exitCode = 2\n },\n )\n}\n","/**\n * End-of-life data and checks (docs/TASKS.md, Finding codes). Everything here is offline: the data\n * is the snapshot in `data/eol.json`, built by `scripts/update-eol.mjs` from endoflife.date and\n * shipped with the package. Three things use it:\n *\n * - `createAliasResolver` turns `lts/*`, `lts/iron`, `lts/-1` into a semver range, so\n * `compareSources` can compare an alias with the other pins.\n * - `eolFindings` reports EOL_RUNTIME (every version a source allows is past end-of-life) and\n * EOL_SOON (the last of them ends within 90 days).\n * - `checkDate` validates the `--date` option so results can be reproduced on any day.\n */\nimport semver from 'semver'\nimport snapshotData from '../data/eol.json'\nimport { scopesOf } from './compare'\nimport { describeConstraint, isFloatingAlias, toRange } from './constraint'\nimport type { AliasResolver, Finding, FindingCode, Runtime, Severity, Source, SourceRef } from './types'\n\n/** How many days ahead of the check date an end-of-life counts as \"soon\". */\nexport const EOL_SOON_DAYS = 90\n\n/** One release line of a runtime, as stored in the snapshot. Dates are `YYYY-MM-DD`. */\nexport interface EolCycle {\n /** The line: `22` for Node, `3.12` for Python, `1.25` for Go. */\n cycle: string\n /** Date support ends, or null when it has not been announced (the newest Go lines). */\n eolFrom: string | null\n /** Date the line became LTS (Node), or null. */\n ltsFrom: string | null\n /** Newest release of the line at fetch time, e.g. `22.23.5`, or null. */\n latest: string | null\n /** Node LTS codename in lower case (`iron`), when known. */\n codename?: string | null\n}\n\n/** One data source recorded in the snapshot, with its terms. */\nexport interface EolSource {\n name: string\n url: string\n license: string\n copyright: string\n /** What was taken from it. */\n usedFor: string\n}\n\n/** The shipped end-of-life data. */\nexport interface EolSnapshot {\n schema: 1\n /** `YYYY-MM-DD` the snapshot was fetched. */\n fetchedAt: string\n /** Credit line to show wherever the data is shown (CC/MIT notice requirement). */\n attribution: string\n sources: EolSource[]\n products: Record<Runtime, EolCycle[]>\n}\n\nconst RUNTIMES: readonly Runtime[] = ['node', 'python', 'go']\nconst DATE = /^\\d{4}-\\d{2}-\\d{2}$/\n\nfunction fail(message: string): never {\n throw new TypeError(`Invalid end-of-life snapshot: ${message}`)\n}\n\nfunction validDate(value: string): boolean {\n if (!DATE.test(value)) return false\n const d = new Date(`${value}T00:00:00Z`)\n return !Number.isNaN(d.getTime()) && d.toISOString().slice(0, 10) === value\n}\n\nfunction optionalDate(value: unknown, where: string): string | null {\n if (value === null) return null\n if (typeof value !== 'string' || !validDate(value)) fail(`${where} must be YYYY-MM-DD or null, got ${JSON.stringify(value)}`)\n return value\n}\n\nfunction text(value: unknown, where: string): string {\n if (typeof value !== 'string' || value === '') fail(`${where} must be a non-empty string`)\n return value\n}\n\n/**\n * Checks the shape of a snapshot read from JSON and returns it typed. Throws a `TypeError` that\n * names the offending field, so a hand-edited or half-written file is never used silently.\n */\nexport function parseSnapshot(data: unknown): EolSnapshot {\n if (typeof data !== 'object' || data === null) return fail('the file is not an object')\n const d = data as Record<string, unknown>\n if (d.schema !== 1) fail(`schema must be 1, got ${JSON.stringify(d.schema)}`)\n const fetchedAt = text(d.fetchedAt, 'fetchedAt')\n if (!validDate(fetchedAt)) fail(`fetchedAt must be YYYY-MM-DD, got \"${fetchedAt}\"`)\n const attribution = text(d.attribution, 'attribution')\n if (!Array.isArray(d.sources) || d.sources.length === 0) fail('sources must list at least one source')\n const sources = d.sources.map((s: unknown, i): EolSource => {\n const o = (typeof s === 'object' && s !== null ? s : {}) as Record<string, unknown>\n return {\n name: text(o.name, `sources[${i}].name`),\n url: text(o.url, `sources[${i}].url`),\n license: text(o.license, `sources[${i}].license`),\n copyright: text(o.copyright, `sources[${i}].copyright`),\n usedFor: text(o.usedFor, `sources[${i}].usedFor`),\n }\n })\n const rawProducts = (typeof d.products === 'object' && d.products !== null ? d.products : {}) as Record<string, unknown>\n const products = {} as Record<Runtime, EolCycle[]>\n for (const runtime of RUNTIMES) {\n const list = rawProducts[runtime]\n if (!Array.isArray(list) || list.length === 0) fail(`products.${runtime} must list at least one release line`)\n products[runtime] = list.map((c: unknown, i): EolCycle => {\n const where = `products.${runtime}[${i}]`\n const o = (typeof c === 'object' && c !== null ? c : {}) as Record<string, unknown>\n const cycle = text(o.cycle, `${where}.cycle`)\n if (!/^\\d+(\\.\\d+)?$/.test(cycle)) fail(`${where}.cycle must look like 22 or 3.12, got \"${cycle}\"`)\n const out: EolCycle = {\n cycle,\n eolFrom: optionalDate(o.eolFrom, `${where}.eolFrom`),\n ltsFrom: optionalDate(o.ltsFrom, `${where}.ltsFrom`),\n latest: o.latest === null || typeof o.latest === 'string' ? (o.latest ?? null) : fail(`${where}.latest must be a string or null`),\n }\n if (o.codename !== undefined) {\n if (o.codename !== null && typeof o.codename !== 'string') fail(`${where}.codename must be a string or null`)\n out.codename = o.codename\n }\n return out\n })\n }\n return { schema: 1, fetchedAt, attribution, sources, products }\n}\n\nlet bundled: EolSnapshot | undefined\n\n/** The snapshot shipped in `data/eol.json`, validated once. */\nexport function bundledSnapshot(): EolSnapshot {\n bundled ??= parseSnapshot(snapshotData)\n return bundled\n}\n\n/**\n * The date to check against as `YYYY-MM-DD`. Without an argument: today in UTC.\n *\n * @throws RangeError when the text is not a real calendar date in `YYYY-MM-DD` form.\n */\nexport function checkDate(input?: string): string {\n if (input === undefined) return new Date().toISOString().slice(0, 10)\n if (!validDate(input)) throw new RangeError(`--date must be a real date as YYYY-MM-DD, got \"${input}\"`)\n return input\n}\n\nfunction addDays(date: string, days: number): string {\n const d = new Date(`${date}T00:00:00Z`)\n d.setUTCDate(d.getUTCDate() + days)\n return d.toISOString().slice(0, 10)\n}\n\n/** The semver span of one release line: `22` → `>=22.0.0 <23.0.0-0`, `3.12` → `>=3.12.0 <3.13.0-0`. */\nfunction cycleRange(cycle: string): string {\n const parts = cycle.split('.')\n const major = Number(parts[0])\n if (parts.length === 1) return `>=${major}.0.0 <${major + 1}.0.0-0`\n const minor = Number(parts[1])\n return `>=${major}.${minor}.0 <${major}.${minor + 1}.0-0`\n}\n\n/** Upper bound (exclusive) of the newest known line: versions from here on are not in the snapshot. */\nfunction newestBound(cycles: readonly EolCycle[]): string {\n let best = '0.0.0'\n for (const c of cycles) {\n const upper = cycleRange(c.cycle).split(' <')[1]?.replace(/-0$/, '') ?? '0.0.0'\n if (semver.gt(upper, best)) best = upper\n }\n return best\n}\n\nfunction byCycleDesc(a: EolCycle, b: EolCycle): number {\n return semver.rcompare(semver.coerce(a.cycle) ?? '0.0.0', semver.coerce(b.cycle) ?? '0.0.0')\n}\n\n/**\n * Resolves Node aliases against a snapshot: `lts/*` (and bare `lts`) is the newest line that was\n * already LTS on `date`, `lts/-1` the one before it, `lts/<codename>` the line with that codename.\n * Python and Go have no such aliases, and unknown codenames resolve to nothing (the comparison then\n * reports the alias as unreadable rather than guessing). `latest`/`node`/`stable` are never resolved\n * here; they are FLOATING_ALIAS findings.\n *\n * @param snapshot - Defaults to the bundled snapshot.\n * @param date - `YYYY-MM-DD`, defaults to today (UTC); decides which line is \"current LTS\".\n */\nexport function createAliasResolver(snapshot: EolSnapshot = bundledSnapshot(), date: string = checkDate()): AliasResolver {\n const lts = snapshot.products.node.filter((c) => c.ltsFrom !== null && c.ltsFrom <= date).sort(byCycleDesc)\n return (runtime, alias) => {\n if (runtime !== 'node') return undefined\n const a = alias.toLowerCase()\n let line: EolCycle | undefined\n if (a === 'lts/*' || a === 'lts') line = lts[0]\n else {\n const back = /^lts\\/-(\\d+)$/.exec(a)\n if (back) line = lts[Number(back[1])]\n else {\n const name = /^lts\\/([a-z][a-z-]*)$/.exec(a)?.[1]\n if (name) line = snapshot.products.node.find((c) => c.codename === name)\n }\n }\n return line ? cycleRange(line.cycle) : undefined\n }\n}\n\nconst SEVERITY: Partial<Record<FindingCode, Severity>> = { EOL_RUNTIME: 'warning', EOL_SOON: 'info' }\n\nfunction ref(s: Source): SourceRef {\n return { file: s.file, line: s.line, raw: s.raw, constraint: s.constraint }\n}\n\nfunction list(cycles: readonly EolCycle[]): string {\n const names = cycles.map((c) => c.cycle)\n return names.length <= 4 ? names.join(', ') : `${names.slice(0, 4).join(', ')} and ${names.length - 4} more`\n}\n\n/** The range of versions a source allows, or undefined when it allows nothing we can judge. */\nfunction allowedRange(source: Source, resolve: AliasResolver): string | undefined {\n const c = source.constraint\n if (c.kind === 'unknown') return undefined\n if (c.kind === 'alias') {\n if (isFloatingAlias(c.alias)) return undefined\n const range = resolve(source.runtime, c.alias)\n return range && semver.validRange(range) ? range : undefined\n }\n const range = toRange(c)\n return range !== undefined && semver.validRange(range) ? range : undefined\n}\n\nfunction judge(source: Source, range: string, cycles: readonly EolCycle[], date: string): { code: FindingCode; message: string } | undefined {\n // A range that reaches past the newest line includes versions the snapshot does not know: not EOL.\n if (semver.intersects(range, `>=${newestBound(cycles)}`)) return undefined\n const allowed = cycles.filter((c) => semver.intersects(range, cycleRange(c.cycle))).sort(byCycleDesc)\n if (allowed.length === 0) return undefined\n const pin = `${source.runtime} ${describeConstraint(source.constraint)}`\n const where = `${source.file}:${source.line}`\n const ended = (c: EolCycle): boolean => c.eolFrom !== null && c.eolFrom <= date\n if (allowed.every(ended)) {\n const last = allowed.map((c) => c.eolFrom as string).sort().at(-1) as string\n const what =\n allowed.length === 1\n ? `${source.runtime} ${(allowed[0] as EolCycle).cycle} reached end-of-life on ${last}`\n : `every ${source.runtime} line it allows (${list(allowed)}) is past end-of-life; the newest of them ended on ${last}`\n return { code: 'EOL_RUNTIME', message: `${where} pins ${pin} (\"${source.raw}\"): ${what} (check date ${date}).` }\n }\n if (allowed.every((c) => c.eolFrom !== null)) {\n const last = allowed.map((c) => c.eolFrom as string).sort().at(-1) as string\n const limit = addDays(date, EOL_SOON_DAYS)\n if (last <= limit) {\n const what =\n allowed.length === 1\n ? `${source.runtime} ${(allowed[0] as EolCycle).cycle} reaches end-of-life on ${last}`\n : `the newest ${source.runtime} line it allows reaches end-of-life on ${last}`\n return { code: 'EOL_SOON', message: `${where} pins ${pin} (\"${source.raw}\"): ${what}, within ${EOL_SOON_DAYS} days of the check date ${date}.` }\n }\n }\n return undefined\n}\n\n/** Options of `eolFindings`. */\nexport interface EolOptions {\n /** Defaults to the bundled snapshot. */\n snapshot?: EolSnapshot\n /** `YYYY-MM-DD`; defaults to today (UTC). Use it to reproduce a result. */\n date?: string\n}\n\n/**\n * EOL_RUNTIME and EOL_SOON findings for a set of sources.\n *\n * A source is judged on every version it allows: EOL_RUNTIME when all of them are past end-of-life on\n * the check date, EOL_SOON when none is supported beyond `EOL_SOON_DAYS` days from it. A range that\n * also allows versions newer than the snapshot knows is never reported. Floating aliases, unreadable\n * sources and unresolvable aliases produce nothing here (the comparison reports them). CI matrix\n * entries are judged like any other source. Output order matches `compareSources`: severity, then\n * file and line; a source shared by several project roots is reported once with every root in `scopes`.\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 * @throws RangeError when `options.date` is not a real `YYYY-MM-DD` date.\n */\nexport function eolFindings(sources: readonly Source[], roots: readonly string[] = ['.'], options: EolOptions = {}): Finding[] {\n const snapshot = options.snapshot ?? bundledSnapshot()\n const date = checkDate(options.date)\n const resolve = createAliasResolver(snapshot, date)\n const found = new Map<string, Finding>()\n for (const source of sources) {\n const range = allowedRange(source, resolve)\n if (range === undefined) continue\n const verdict = judge(source, range, snapshot.products[source.runtime], date)\n if (!verdict) continue\n const key = `${verdict.code}\\u0000${source.runtime}\\u0000${source.file}:${source.line}\\u0000${source.raw}`\n const existing = found.get(key)\n const scopes = scopesOf(source, roots)\n if (existing) {\n for (const s of scopes) if (!existing.scopes.includes(s)) existing.scopes.push(s)\n continue\n }\n found.set(key, {\n code: verdict.code,\n severity: SEVERITY[verdict.code] as Severity,\n runtime: source.runtime,\n sources: [ref(source)],\n scopes: [...scopes],\n message: verdict.message,\n })\n }\n const order: Record<Severity, number> = { error: 0, warning: 1, info: 2 }\n const out = [...found.values()]\n for (const f of out) f.scopes.sort()\n return out.sort(\n (a, b) =>\n order[a.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 \"schema\": 1,\n \"fetchedAt\": \"2026-11-25\",\n \"attribution\": \"EOL data from endoflife.date (https://endoflife.date), MIT License, © endoflife.date contributors, fetched 2026-11-25. Node.js LTS codenames from https://nodejs.org/download/release/index.json (Node.js, MIT License).\",\n \"sources\": [\n {\n \"name\": \"endoflife.date\",\n \"url\": \"https://endoflife.date/api/v1/products/\",\n \"license\": \"MIT\",\n \"copyright\": \"© 2020 endoflife.date contributors (https://github.com/endoflife-date/endoflife.date)\",\n \"usedFor\": \"release lines, end-of-life dates, LTS start dates and latest releases of nodejs, python and go\"\n },\n {\n \"name\": \"Node.js release index\",\n \"url\": \"https://nodejs.org/download/release/index.json\",\n \"license\": \"MIT (Node.js project; no separate terms page for the index was found)\",\n \"copyright\": \"© Node.js contributors\",\n \"usedFor\": \"LTS codenames (major version to name) only\"\n }\n ],\n \"products\": {\n \"node\": [\n {\n \"cycle\": \"26\",\n \"eolFrom\": \"2029-04-30\",\n \"ltsFrom\": \"2026-10-28\",\n \"latest\": \"26.13.1\",\n \"codename\": \"lithium\"\n },\n {\n \"cycle\": \"25\",\n \"eolFrom\": \"2026-06-01\",\n \"ltsFrom\": null,\n \"latest\": \"25.9.0\",\n \"codename\": null\n },\n {\n \"cycle\": \"24\",\n \"eolFrom\": \"2028-04-30\",\n \"ltsFrom\": \"2025-10-28\",\n \"latest\": \"24.22.3\",\n \"codename\": \"krypton\"\n },\n {\n \"cycle\": \"23\",\n \"eolFrom\": \"2025-06-01\",\n \"ltsFrom\": null,\n \"latest\": \"23.11.1\",\n \"codename\": null\n },\n {\n \"cycle\": \"22\",\n \"eolFrom\": \"2027-04-30\",\n \"ltsFrom\": \"2024-10-29\",\n \"latest\": \"22.23.5\",\n \"codename\": \"jod\"\n },\n {\n \"cycle\": \"21\",\n \"eolFrom\": \"2024-06-01\",\n \"ltsFrom\": null,\n \"latest\": \"21.7.3\",\n \"codename\": null\n },\n {\n \"cycle\": \"20\",\n \"eolFrom\": \"2026-04-30\",\n \"ltsFrom\": \"2023-10-24\",\n \"latest\": \"20.20.2\",\n \"codename\": \"iron\"\n },\n {\n \"cycle\": \"19\",\n \"eolFrom\": \"2023-06-01\",\n \"ltsFrom\": null,\n \"latest\": \"19.9.0\",\n \"codename\": null\n },\n {\n \"cycle\": \"18\",\n \"eolFrom\": \"2025-04-30\",\n \"ltsFrom\": \"2022-10-25\",\n \"latest\": \"18.20.8\",\n \"codename\": \"hydrogen\"\n },\n {\n \"cycle\": \"17\",\n \"eolFrom\": \"2022-06-01\",\n \"ltsFrom\": null,\n \"latest\": \"17.9.1\",\n \"codename\": null\n },\n {\n \"cycle\": \"16\",\n \"eolFrom\": \"2023-09-11\",\n \"ltsFrom\": \"2021-10-26\",\n \"latest\": \"16.20.2\",\n \"codename\": \"gallium\"\n },\n {\n \"cycle\": \"15\",\n \"eolFrom\": \"2021-06-01\",\n \"ltsFrom\": null,\n \"latest\": \"15.14.0\",\n \"codename\": null\n },\n {\n \"cycle\": \"14\",\n \"eolFrom\": \"2023-04-30\",\n \"ltsFrom\": \"2020-10-27\",\n \"latest\": \"14.21.3\",\n \"codename\": \"fermium\"\n },\n {\n \"cycle\": \"13\",\n \"eolFrom\": \"2020-06-01\",\n \"ltsFrom\": null,\n \"latest\": \"13.14.0\",\n \"codename\": null\n },\n {\n \"cycle\": \"12\",\n \"eolFrom\": \"2022-04-30\",\n \"ltsFrom\": \"2019-10-21\",\n \"latest\": \"12.22.12\",\n \"codename\": \"erbium\"\n },\n {\n \"cycle\": \"11\",\n \"eolFrom\": \"2019-06-30\",\n \"ltsFrom\": null,\n \"latest\": \"11.15.0\",\n \"codename\": null\n },\n {\n \"cycle\": \"10\",\n \"eolFrom\": \"2021-04-30\",\n \"ltsFrom\": \"2018-10-30\",\n \"latest\": \"10.24.1\",\n \"codename\": \"dubnium\"\n },\n {\n \"cycle\": \"9\",\n \"eolFrom\": \"2018-06-30\",\n \"ltsFrom\": null,\n \"latest\": \"9.11.2\",\n \"codename\": null\n },\n {\n \"cycle\": \"8\",\n \"eolFrom\": \"2019-12-31\",\n \"ltsFrom\": \"2017-10-31\",\n \"latest\": \"8.17.0\",\n \"codename\": \"carbon\"\n },\n {\n \"cycle\": \"7\",\n \"eolFrom\": \"2017-06-30\",\n \"ltsFrom\": null,\n \"latest\": \"7.10.1\",\n \"codename\": null\n },\n {\n \"cycle\": \"6\",\n \"eolFrom\": \"2019-04-30\",\n \"ltsFrom\": \"2016-10-18\",\n \"latest\": \"6.17.1\",\n \"codename\": \"boron\"\n },\n {\n \"cycle\": \"5\",\n \"eolFrom\": \"2016-06-30\",\n \"ltsFrom\": null,\n \"latest\": \"5.12.0\",\n \"codename\": null\n },\n {\n \"cycle\": \"4\",\n \"eolFrom\": \"2018-04-30\",\n \"ltsFrom\": \"2015-10-01\",\n \"latest\": \"4.9.1\",\n \"codename\": \"argon\"\n },\n {\n \"cycle\": \"3\",\n \"eolFrom\": null,\n \"ltsFrom\": null,\n \"latest\": \"3.3.1\",\n \"codename\": null\n },\n {\n \"cycle\": \"2\",\n \"eolFrom\": null,\n \"ltsFrom\": null,\n \"latest\": \"2.5.0\",\n \"codename\": null\n },\n {\n \"cycle\": \"1\",\n \"eolFrom\": null,\n \"ltsFrom\": null,\n \"latest\": \"1.8.4\",\n \"codename\": null\n }\n ],\n \"python\": [\n {\n \"cycle\": \"3.15\",\n \"eolFrom\": \"2031-10-31\",\n \"ltsFrom\": null,\n \"latest\": \"3.15.2\"\n },\n {\n \"cycle\": \"3.14\",\n \"eolFrom\": \"2030-10-31\",\n \"ltsFrom\": null,\n \"latest\": \"3.14.10\"\n },\n {\n \"cycle\": \"3.13\",\n \"eolFrom\": \"2029-10-31\",\n \"ltsFrom\": null,\n \"latest\": \"3.13.18\"\n },\n {\n \"cycle\": \"3.12\",\n \"eolFrom\": \"2028-10-31\",\n \"ltsFrom\": null,\n \"latest\": \"3.12.16\"\n },\n {\n \"cycle\": \"3.11\",\n \"eolFrom\": \"2027-10-31\",\n \"ltsFrom\": null,\n \"latest\": \"3.11.18\"\n },\n {\n \"cycle\": \"3.10\",\n \"eolFrom\": \"2026-10-01\",\n \"ltsFrom\": null,\n \"latest\": \"3.10.22\"\n },\n {\n \"cycle\": \"3.9\",\n \"eolFrom\": \"2025-10-31\",\n \"ltsFrom\": null,\n \"latest\": \"3.9.25\"\n },\n {\n \"cycle\": \"3.8\",\n \"eolFrom\": \"2024-10-07\",\n \"ltsFrom\": null,\n \"latest\": \"3.8.20\"\n },\n {\n \"cycle\": \"3.7\",\n \"eolFrom\": \"2023-06-27\",\n \"ltsFrom\": null,\n \"latest\": \"3.7.17\"\n },\n {\n \"cycle\": \"3.6\",\n \"eolFrom\": \"2021-12-23\",\n \"ltsFrom\": null,\n \"latest\": \"3.6.15\"\n },\n {\n \"cycle\": \"3.5\",\n \"eolFrom\": \"2020-09-30\",\n \"ltsFrom\": null,\n \"latest\": \"3.5.10\"\n },\n {\n \"cycle\": \"3.4\",\n \"eolFrom\": \"2019-03-18\",\n \"ltsFrom\": null,\n \"latest\": \"3.4.10\"\n },\n {\n \"cycle\": \"3.3\",\n \"eolFrom\": \"2017-09-29\",\n \"ltsFrom\": null,\n \"latest\": \"3.3.7\"\n },\n {\n \"cycle\": \"3.2\",\n \"eolFrom\": \"2016-02-20\",\n \"ltsFrom\": null,\n \"latest\": \"3.2.6\"\n },\n {\n \"cycle\": \"2.7\",\n \"eolFrom\": \"2020-01-01\",\n \"ltsFrom\": null,\n \"latest\": \"2.7.18\"\n },\n {\n \"cycle\": \"3.1\",\n \"eolFrom\": \"2012-04-09\",\n \"ltsFrom\": null,\n \"latest\": \"3.1.5\"\n },\n {\n \"cycle\": \"3.0\",\n \"eolFrom\": \"2009-06-27\",\n \"ltsFrom\": null,\n \"latest\": \"3.0.1\"\n },\n {\n \"cycle\": \"2.6\",\n \"eolFrom\": \"2013-10-29\",\n \"ltsFrom\": null,\n \"latest\": \"2.6.9\"\n },\n {\n \"cycle\": \"2.5\",\n \"eolFrom\": \"2011-05-26\",\n \"ltsFrom\": null,\n \"latest\": \"2.5.6\"\n },\n {\n \"cycle\": \"2.4\",\n \"eolFrom\": \"2008-12-19\",\n \"ltsFrom\": null,\n \"latest\": \"2.4.6\"\n },\n {\n \"cycle\": \"2.3\",\n \"eolFrom\": \"2008-03-11\",\n \"ltsFrom\": null,\n \"latest\": \"2.3.7\"\n },\n {\n \"cycle\": \"2.2\",\n \"eolFrom\": \"2003-05-30\",\n \"ltsFrom\": null,\n \"latest\": \"2.2.3\"\n },\n {\n \"cycle\": \"2.1\",\n \"eolFrom\": \"2002-04-09\",\n \"ltsFrom\": null,\n \"latest\": \"2.1.3\"\n }\n ],\n \"go\": [\n {\n \"cycle\": \"1.27\",\n \"eolFrom\": null,\n \"ltsFrom\": null,\n \"latest\": \"1.27.4\"\n },\n {\n \"cycle\": \"1.26\",\n \"eolFrom\": null,\n \"ltsFrom\": null,\n \"latest\": \"1.26.11\"\n },\n {\n \"cycle\": \"1.25\",\n \"eolFrom\": \"2026-08-19\",\n \"ltsFrom\": null,\n \"latest\": \"1.25.14\"\n },\n {\n \"cycle\": \"1.24\",\n \"eolFrom\": \"2026-02-10\",\n \"ltsFrom\": null,\n \"latest\": \"1.24.13\"\n },\n {\n \"cycle\": \"1.23\",\n \"eolFrom\": \"2025-08-12\",\n \"ltsFrom\": null,\n \"latest\": \"1.23.12\"\n },\n {\n \"cycle\": \"1.22\",\n \"eolFrom\": \"2025-02-11\",\n \"ltsFrom\": null,\n \"latest\": \"1.22.12\"\n },\n {\n \"cycle\": \"1.21\",\n \"eolFrom\": \"2024-08-13\",\n \"ltsFrom\": null,\n \"latest\": \"1.21.13\"\n },\n {\n \"cycle\": \"1.20\",\n \"eolFrom\": \"2024-02-06\",\n \"ltsFrom\": null,\n \"latest\": \"1.20.14\"\n },\n {\n \"cycle\": \"1.19\",\n \"eolFrom\": \"2023-09-06\",\n \"ltsFrom\": null,\n \"latest\": \"1.19.13\"\n },\n {\n \"cycle\": \"1.18\",\n \"eolFrom\": \"2023-02-01\",\n \"ltsFrom\": null,\n \"latest\": \"1.18.10\"\n },\n {\n \"cycle\": \"1.17\",\n \"eolFrom\": \"2022-08-02\",\n \"ltsFrom\": null,\n \"latest\": \"1.17.13\"\n },\n {\n \"cycle\": \"1.16\",\n \"eolFrom\": \"2022-03-15\",\n \"ltsFrom\": null,\n \"latest\": \"1.16.15\"\n },\n {\n \"cycle\": \"1.15\",\n \"eolFrom\": \"2021-08-16\",\n \"ltsFrom\": null,\n \"latest\": \"1.15.15\"\n },\n {\n \"cycle\": \"1.14\",\n \"eolFrom\": \"2021-02-16\",\n \"ltsFrom\": null,\n \"latest\": \"1.14.15\"\n },\n {\n \"cycle\": \"1.13\",\n \"eolFrom\": \"2020-08-11\",\n \"ltsFrom\": null,\n \"latest\": \"1.13.15\"\n },\n {\n \"cycle\": \"1.12\",\n \"eolFrom\": \"2020-02-25\",\n \"ltsFrom\": null,\n \"latest\": \"1.12.17\"\n },\n {\n \"cycle\": \"1.11\",\n \"eolFrom\": \"2019-09-03\",\n \"ltsFrom\": null,\n \"latest\": \"1.11.13\"\n },\n {\n \"cycle\": \"1.10\",\n \"eolFrom\": \"2019-02-25\",\n \"ltsFrom\": null,\n \"latest\": \"1.10.8\"\n },\n {\n \"cycle\": \"1.9\",\n \"eolFrom\": \"2018-08-24\",\n \"ltsFrom\": null,\n \"latest\": \"1.9.7\"\n },\n {\n \"cycle\": \"1.8\",\n \"eolFrom\": \"2018-02-16\",\n \"ltsFrom\": null,\n \"latest\": \"1.8.7\"\n },\n {\n \"cycle\": \"1.7\",\n \"eolFrom\": \"2017-08-24\",\n \"ltsFrom\": null,\n \"latest\": \"1.7.6\"\n },\n {\n \"cycle\": \"1.6\",\n \"eolFrom\": \"2017-02-16\",\n \"ltsFrom\": null,\n \"latest\": \"1.6.4\"\n },\n {\n \"cycle\": \"1.5\",\n \"eolFrom\": \"2016-08-15\",\n \"ltsFrom\": null,\n \"latest\": \"1.5.4\"\n },\n {\n \"cycle\": \"1.4\",\n \"eolFrom\": \"2016-02-17\",\n \"ltsFrom\": null,\n \"latest\": \"1.4.3\"\n },\n {\n \"cycle\": \"1.3\",\n \"eolFrom\": \"2015-08-19\",\n \"ltsFrom\": null,\n \"latest\": \"1.3.3\"\n },\n {\n \"cycle\": \"1.2\",\n \"eolFrom\": \"2014-12-10\",\n \"ltsFrom\": null,\n \"latest\": \"1.2.2\"\n }\n ]\n }\n}\n","/** Thin helpers over the `yaml` package: parse once, then read nodes with 1-based line and column. */\nimport { LineCounter, parseAllDocuments, parseDocument, isAlias, isMap, isScalar, isSeq, Scalar } from 'yaml'\nimport type { Document, Node, Pair, YAMLMap, YAMLSeq } from 'yaml'\n\n/** A parsed YAML text with position lookup. */\nexport interface Yaml {\n doc: Document.Parsed\n text: string\n /** 1-based line and column of an offset into the text. */\n pos(offset: number): { line: number; column: number }\n}\n\n/** Parses YAML text; undefined when it cannot be read at all. Recoverable errors still yield a document. */\nexport function loadYaml(text: string): Yaml | undefined {\n try {\n const lineCounter = new LineCounter()\n const doc = parseDocument(text, { lineCounter, prettyErrors: false, strict: false, uniqueKeys: false, merge: true })\n return {\n doc,\n text,\n pos(offset) {\n const p = lineCounter.linePos(offset)\n return { line: p.line, column: p.col }\n },\n }\n } catch {\n return undefined\n }\n}\n\n/**\n * Parses a YAML stream and returns one `Yaml` per document (`---` separated), all sharing one line\n * counter. A multi-document stream is valid YAML and is read in full; undefined when it cannot be\n * parsed at all.\n */\nexport function loadYamlAll(text: string): Yaml[] | undefined {\n try {\n const lineCounter = new LineCounter()\n const docs = parseAllDocuments(text, { lineCounter, prettyErrors: false, strict: false, uniqueKeys: false, merge: true })\n const list = Array.isArray(docs) ? docs : [docs]\n return list.map((doc) => ({\n doc: doc as Document.Parsed,\n text,\n pos(offset: number) {\n const p = lineCounter.linePos(offset)\n return { line: p.line, column: p.col }\n },\n }))\n } catch {\n return undefined\n }\n}\n\n/** A scalar read as written in the file. */\nexport interface ScalarText {\n /** The text as written, without surrounding quotes (`3.10` stays `3.10`; `'3.10'` is `3.10`). */\n text: string\n /** True when the value was written in quotes (so YAML reads it as a string). */\n quoted: boolean\n line: number\n column: number\n}\n\n/** Follows an alias to the node it points at. */\nexport function resolveNode(y: Yaml, node: unknown): unknown {\n let n = node\n for (let i = 0; i < 8 && isAlias(n); i++) n = (n as { resolve(doc: unknown): unknown }).resolve(y.doc)\n return n\n}\n\n/** Reads a scalar node as written; undefined when the node is not a scalar. */\nexport function scalarText(y: Yaml, node: unknown): ScalarText | undefined {\n const n = resolveNode(y, node)\n if (!isScalar(n)) return undefined\n const sc = n as Scalar\n const range = sc.range\n if (!range) return undefined\n const { line, column } = y.pos(range[0])\n const type = sc.type\n const quoted = type === Scalar.QUOTE_DOUBLE || type === Scalar.QUOTE_SINGLE\n if (type === Scalar.BLOCK_FOLDED || type === Scalar.BLOCK_LITERAL) {\n return { text: String(sc.value ?? '').replace(/\\n$/, ''), quoted: false, line, column }\n }\n const raw = y.text.slice(range[0], range[1])\n const inner = quoted ? raw.slice(1, -1) : raw\n return { text: quoted ? String(sc.value ?? inner) : inner.trim(), quoted, line, column: quoted ? column + 1 : column }\n}\n\n/** Looks a key up in a map (merge keys included); returns the value node and the key position. */\nexport function getPair(y: Yaml, map: unknown, key: string): { value: unknown; line: number; column: number } | undefined {\n const m = resolveNode(y, map)\n if (!isMap(m)) return undefined\n const pairs = (m as YAMLMap).items as Pair[]\n for (const pair of pairs) {\n const k = scalarKey(pair.key)\n if (k === key) {\n const kn = pair.key as Node | null\n const range = kn && (kn as Node).range\n const p = range ? y.pos(range[0]) : { line: 1, column: 1 }\n return { value: pair.value, line: p.line, column: p.column }\n }\n }\n // `<<: *anchor` merge keys: look inside the merged maps.\n for (const pair of pairs) {\n if (scalarKey(pair.key) !== '<<') continue\n const v = resolveNode(y, pair.value)\n const targets = isSeq(v) ? ((v as YAMLSeq).items as unknown[]) : [v]\n for (const t of targets) {\n const found = getPair(y, t, key)\n if (found) return found\n }\n }\n return undefined\n}\n\nfunction scalarKey(key: unknown): string | undefined {\n if (isScalar(key)) {\n const v = (key as Scalar).value\n // With `merge: true` the `<<` key is a Scalar whose value is the symbol Symbol(<<).\n return typeof v === 'symbol' ? '<<' : String(v)\n }\n return undefined\n}\n\n/** The keys and values of a map in document order, merge keys excluded. */\nexport function entries(y: Yaml, map: unknown): { key: string; value: unknown; line: number; column: number }[] {\n const m = resolveNode(y, map)\n if (!isMap(m)) return []\n const out: { key: string; value: unknown; line: number; column: number }[] = []\n for (const pair of (m as YAMLMap).items as Pair[]) {\n const key = scalarKey(pair.key)\n if (key === undefined || key === '<<') continue\n const kn = pair.key as Node\n const p = kn.range ? y.pos(kn.range[0]) : { line: 1, column: 1 }\n out.push({ key, value: pair.value, line: p.line, column: p.column })\n }\n return out\n}\n\n/** The items of a sequence, aliases followed; [] when the node is not a sequence. */\nexport function items(y: Yaml, seq: unknown): unknown[] {\n const s = resolveNode(y, seq)\n return isSeq(s) ? ((s as YAMLSeq).items as unknown[]) : []\n}\n\nexport { isMap, isSeq, isScalar }\n","/**\n * Splits a Docker image reference such as `public.ecr.aws/lambda/nodejs:24` or\n * `node:22.11.0-bookworm-slim@sha256:ab…` into its parts. Format only: no runtime knowledge.\n */\n\n/** The parts of an image reference. `image` keeps any registry and path (`public.ecr.aws/lambda/nodejs`). */\nexport interface ImageRef {\n image: string\n tag?: string\n digest?: string\n}\n\n/**\n * Splits `name[:tag][@digest]`. A colon belongs to the tag only when it comes after the last `/`,\n * so a registry port (`localhost:5000/node`) is not mistaken for a tag.\n */\nexport function splitImageRef(ref: string): ImageRef {\n let rest = ref\n let digest: string | undefined\n const at = rest.indexOf('@')\n if (at >= 0) {\n digest = rest.slice(at + 1)\n rest = rest.slice(0, at)\n }\n const colon = rest.lastIndexOf(':')\n const tagColon = colon > rest.lastIndexOf('/') ? colon : -1\n const out: ImageRef = { image: tagColon >= 0 ? rest.slice(0, tagColon) : rest }\n if (tagColon >= 0) out.tag = rest.slice(tagColon + 1)\n if (digest !== undefined && digest !== '') out.digest = digest\n return out\n}\n","/**\n * Dockerfile `FROM` parser. Handles line continuations, comments, `--platform=` flags, `AS stage`,\n * and substitutes global `ARG` defaults into `FROM` (docs/TASKS.md A8). Pure; never throws.\n */\nimport { splitImageRef } from './imageref'\n\n/** One `FROM` instruction. */\nexport interface DockerFrom {\n /** Image name with registry and path, `ARG` defaults substituted (e.g. `node`, `public.ecr.aws/lambda/nodejs`). */\n image: string\n /** Tag, `ARG` defaults substituted; a variable with no default stays raw (`${NODE_VERSION}-alpine`). */\n tag?: string\n /** Digest without the `@` (e.g. `sha256:ab…`). */\n digest?: string\n /** 1-based line of the `FROM` keyword. */\n line: number\n /** 1-based column of the image reference as written. */\n column: number\n /** Stage name after `AS`. */\n stage?: string\n /** The image reference exactly as written, before any substitution (`node:${NODE_VERSION}-alpine`). */\n raw: string\n /** Set when a global `ARG` default was substituted: the first such variable and its `ARG` line. */\n arg?: { name: string; line: number }\n}\n\ninterface Logical {\n /** Instruction text with continuations joined by a single space. */\n text: string\n line: number\n /** Offsets: column in the first physical line where `text` starts (after leading whitespace). */\n firstColumn: number\n}\n\nfunction logicalLines(text: string): Logical[] {\n const physical = text.split(/\\r?\\n/)\n let escape = '\\\\'\n for (const l of physical) {\n const m = /^\\s*#\\s*([A-Za-z]+)\\s*=\\s*(\\S+)\\s*$/.exec(l)\n if (!m) break\n if ((m[1] as string).toLowerCase() === 'escape' && (m[2] === '`' || m[2] === '\\\\')) escape = m[2] as string\n }\n const out: Logical[] = []\n for (let i = 0; i < physical.length; i++) {\n const raw = physical[i] as string\n if (/^\\s*#/.test(raw) || raw.trim() === '') continue\n const firstColumn = raw.length - raw.trimStart().length + 1\n let joined = raw.trimStart()\n const startLine = i + 1\n let continuing = joined.trimEnd().endsWith(escape)\n while (continuing && i + 1 < physical.length) {\n if (joined.trimEnd().endsWith(escape)) joined = joined.trimEnd().slice(0, -1)\n i++\n const next = physical[i] as string\n if (/^\\s*#/.test(next)) {\n // A comment line inside a continuation is dropped; the continuation goes on.\n joined += ' '\n continue\n }\n joined += ` ${next.trim()}`\n continuing = next.trimEnd().endsWith(escape)\n }\n if (joined.trimEnd().endsWith(escape)) joined = joined.trimEnd().slice(0, -1)\n out.push({ text: joined.trim(), line: startLine, firstColumn })\n }\n return out\n}\n\nfunction unquote(v: string): string {\n const m = /^([\"'])(.*)\\1$/.exec(v)\n return m ? (m[2] as string) : v\n}\n\n/** `${VAR}`, `${VAR:-x}`, `${VAR-x}` and `$VAR`, replaced from `args`; unresolved ones stay as written. */\nfunction substitute(\n s: string,\n args: ReadonlyMap<string, { value: string | undefined; line: number }>,\n): { text: string; arg?: { name: string; line: number } } {\n let arg: { name: string; line: number } | undefined\n const text = s.replace(/\\$\\{([A-Za-z_][A-Za-z0-9_]*)(?:(:?-)([^}]*))?\\}|\\$([A-Za-z_][A-Za-z0-9_]*)/g, (whole, braced, op, fallback, bare) => {\n const name = (braced ?? bare) as string\n const known = args.get(name)\n if (known && known.value !== undefined && known.value !== '') {\n arg ??= { name, line: known.line }\n return known.value\n }\n if (op !== undefined && fallback !== undefined) return fallback as string\n return whole\n })\n return arg ? { text, arg } : { text }\n}\n\n/**\n * Lists every `FROM` of a Dockerfile in order. Global `ARG` defaults (those before the first\n * `FROM`) are substituted into the image reference; a variable without a default stays raw so the\n * caller can report it. Anything that is not a `FROM` is ignored.\n *\n * @example\n * parseDockerfile('ARG V=22\\nFROM node:${V}-alpine AS build')\n * // [{ image: 'node', tag: '22-alpine', line: 2, stage: 'build', raw: 'node:${V}-alpine', … }]\n */\nexport function parseDockerfile(text: string): DockerFrom[] {\n try {\n const out: DockerFrom[] = []\n const args = new Map<string, { value: string | undefined; line: number }>()\n let seenFrom = false\n for (const ins of logicalLines(text)) {\n const word = /^([A-Za-z]+)\\b/.exec(ins.text)\n const keyword = word ? (word[1] as string).toUpperCase() : ''\n if (keyword === 'ARG' && !seenFrom) {\n for (const tok of ins.text.slice(3).trim().split(/\\s+/)) {\n const eq = tok.indexOf('=')\n if (eq < 0) args.set(tok, { value: undefined, line: ins.line })\n else args.set(tok.slice(0, eq), { value: unquote(tok.slice(eq + 1)), line: ins.line })\n }\n continue\n }\n if (keyword !== 'FROM') continue\n seenFrom = true\n const tokens = ins.text.slice(4).trim().split(/\\s+/).filter((t) => t !== '')\n let i = 0\n while (i < tokens.length && (tokens[i] as string).startsWith('--')) i++\n const rawRef = tokens[i]\n if (rawRef === undefined) continue\n const as = (tokens[i + 1] ?? '').toUpperCase() === 'AS' ? tokens[i + 2] : undefined\n const sub = substitute(rawRef, args)\n const parts = splitImageRef(sub.text)\n const column = ins.firstColumn + ins.text.indexOf(rawRef)\n const from: DockerFrom = { image: parts.image, line: ins.line, column, raw: rawRef }\n if (parts.tag !== undefined) from.tag = parts.tag\n if (parts.digest !== undefined) from.digest = parts.digest\n if (as !== undefined) from.stage = as\n if (sub.arg) from.arg = sub.arg\n out.push(from)\n }\n return out\n } catch {\n return []\n }\n}\n","/** `.gitlab-ci.yml` image parser. Pure; never throws. */\nimport { splitImageRef } from './imageref'\nimport { entries, getPair, loadYamlAll, resolveNode, scalarText, isMap } from './yaml-util'\nimport type { Yaml } from './yaml-util'\n\n/** One `image:` of a GitLab CI file. */\nexport interface GitlabImage {\n /** Image name with registry and path (`node`). */\n image: string\n /** Tag as written; `${NODE_VERSION}`-style variables are NOT resolved and stay raw. */\n tag?: string\n digest?: string\n /** 1-based line and column of the image reference. */\n line: number\n column: number\n /** Job name; `default` for the top-level `image:` and for `default: image:`. */\n job: string\n /** The reference exactly as written. */\n raw: string\n}\n\nfunction imageOf(y: Yaml, node: unknown, job: string): GitlabImage | undefined {\n const direct = scalarText(y, node)\n const target = direct ?? scalarText(y, getPair(y, node, 'name')?.value)\n if (!target || target.text === '') return undefined\n const parts = splitImageRef(target.text)\n const out: GitlabImage = { image: parts.image, line: target.line, column: target.column, job, raw: target.text }\n if (parts.tag !== undefined) out.tag = parts.tag\n if (parts.digest !== undefined) out.digest = parts.digest\n return out\n}\n\n/**\n * Lists every `image:` in a `.gitlab-ci.yml`: the top-level one, `default: image:` and each job's\n * (a plain string or `{name: …}`). Hidden template jobs (`.name`) are included. `extends:` and\n * `include:` are not followed; YAML merge keys (`<<: *x`) are.\n */\nexport function parseGitlabCi(text: string): GitlabImage[] {\n try {\n return (loadYamlAll(text) ?? []).flatMap((y) => parseGitlabDocument(y))\n } catch {\n return []\n }\n}\n\nfunction parseGitlabDocument(y: Yaml): GitlabImage[] {\n try {\n const root = resolveNode(y, y.doc.contents)\n if (!isMap(root)) return []\n const out: GitlabImage[] = []\n const top = getPair(y, root, 'image')\n if (top) {\n const found = imageOf(y, top.value, 'default')\n if (found) out.push(found)\n }\n for (const { key, value } of entries(y, root)) {\n if (key === 'image') continue\n if (key === 'default') {\n const found = imageOf(y, getPair(y, value, 'image')?.value, 'default')\n if (found) out.push(found)\n continue\n }\n if (['stages', 'variables', 'include', 'workflow', 'services', 'cache', 'before_script', 'after_script'].includes(key)) continue\n const pair = getPair(y, value, 'image')\n if (!pair) continue\n const found = imageOf(y, pair.value, key)\n if (found) out.push(found)\n }\n return out\n } catch {\n return []\n }\n}\n","/**\n * Which Docker images are a runtime's own image (docs/TASKS.md A12). An image maps to a runtime\n * only when it is the official image or a well-known mirror of it; any other repository whose name\n * merely ends in `/python` (for example `mcr.microsoft.com/playwright/python`, whose tag is the\n * Playwright version) is not a runtime pin and is ignored, never guessed.\n */\nimport type { Runtime } from '../../types'\n\n/** Registries that serve Docker Hub's `library/<name>` images under another host. */\nconst LIBRARY_HOSTS = ['docker.io', 'index.docker.io', 'registry-1.docker.io', 'registry.hub.docker.com', 'mirror.gcr.io', 'public.ecr.aws/docker']\n\n/** Official and well-known images per runtime, after the library host and `library/` are removed. */\nconst IMAGES: Record<Runtime, readonly string[]> = {\n node: ['node', 'cimg/node', 'circleci/node', 'public.ecr.aws/lambda/nodejs', 'mcr.microsoft.com/devcontainers/javascript-node'],\n python: ['python', 'cimg/python', 'circleci/python', 'public.ecr.aws/lambda/python'],\n go: ['golang', 'cimg/go', 'circleci/golang'],\n}\n\n/** `docker.io/library/node` and `public.ecr.aws/docker/library/node` become `node`; other names stay. */\nfunction canonicalImage(image: string): string {\n let n = image.trim().toLowerCase()\n for (const host of LIBRARY_HOSTS) {\n if (n.startsWith(`${host}/`)) {\n n = n.slice(host.length + 1)\n break\n }\n }\n return n.startsWith('library/') ? n.slice('library/'.length) : n\n}\n\n/**\n * True when `image` (a name without tag or digest, registry and path included) is the official\n * image of `runtime` or a well-known mirror: `node`, `library/node`, `docker.io/library/node`,\n * `public.ecr.aws/docker/library/node`, `cimg/node`, `public.ecr.aws/lambda/nodejs`, and so on.\n */\nexport function isRuntimeImage(image: string, runtime: Runtime): boolean {\n return IMAGES[runtime].includes(canonicalImage(image))\n}\n","/**\n * TOML helpers. `smol-toml` gives values but no positions, so the tables are located by a small\n * line scanner that only has to understand table headers and `key =` lines (docs/TASKS.md A8).\n * Pure; never throws.\n */\nimport { parse } from 'smol-toml'\n\n/** Where a key's value sits in the file. */\nexport interface TomlLocation {\n /** 1-based line of the key. */\n line: number\n /** 1-based column of the value start. */\n column: number\n /** The value text exactly as written on that line (`\"22\"`, `[\"22\", \"20\"]`, `{ version = \"22\" }`). */\n raw: string\n}\n\n/**\n * A `[table.header]` line. The capture is unambiguous (`[^\\]]*`, trimmed in code) so a crafted line\n * such as `[` followed by thousands of spaces cannot cause catastrophic backtracking.\n */\nconst HEADER = /^\\s*\\[(?!\\[)([^\\]]*)\\]\\s*(#.*)?$/\n\nfunction stripKey(key: string): string {\n return key.trim().replace(/^([\"'])(.*)\\1$/, '$2')\n}\n\n/** Splits `a.\"b.c\".d` on dots outside quotes. */\nfunction splitDotted(path: string): string[] {\n const parts: string[] = []\n let cur = ''\n let quote = ''\n for (const ch of path) {\n if (quote) {\n if (ch === quote) quote = ''\n cur += ch\n } else if (ch === '\"' || ch === \"'\") {\n quote = ch\n cur += ch\n } else if (ch === '.') {\n parts.push(stripKey(cur))\n cur = ''\n } else cur += ch\n }\n if (cur.trim() !== '') parts.push(stripKey(cur))\n return parts\n}\n\n/**\n * Finds `key` inside the table `table` (`['project']`, `['tool', 'poetry', 'dependencies']`; `[]`\n * is the top level). Dotted keys at the top level (`tools.node = \"22\"`) and in parent tables are\n * understood. A value that spans lines (an array) is returned as far as the first line.\n */\nexport function locateTomlKey(text: string, table: readonly string[], key: string): TomlLocation | undefined {\n try {\n let current: string[] = []\n const lines = text.split(/\\r?\\n/)\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] as string\n const header = HEADER.exec(line)\n if (header) {\n current = splitDotted((header[1] as string).trim())\n continue\n }\n if (/^\\s*\\[\\[/.test(line)) {\n current = ['\\u0000array-of-tables']\n continue\n }\n const kv = /^(\\s*)((?:\"[^\"]*\"|'[^']*'|[A-Za-z0-9_-]+)(?:\\s*\\.\\s*(?:\"[^\"]*\"|'[^']*'|[A-Za-z0-9_-]+))*)\\s*=\\s*(.*)$/.exec(line)\n if (!kv) continue\n const full = [...current, ...splitDotted(kv[2] as string)]\n const want = [...table, key]\n if (full.length === want.length && full.every((p, k) => p === want[k])) {\n const rest = kv[3] as string\n const column = line.length - rest.length + 1\n return { line: i + 1, column, raw: rest.replace(/\\s+#.*$/, '').trimEnd() }\n }\n }\n return undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * The 1-based line of the table header `[a.b]` (and, as a fallback, of a top-level dotted or inline\n * `a = { … }` key) for `path`; undefined when the table is not written in the text.\n */\nexport function locateTomlTable(text: string, path: readonly string[]): number | undefined {\n try {\n const lines = text.split(/\\r?\\n/)\n for (let i = 0; i < lines.length; i++) {\n const header = HEADER.exec(lines[i] as string)\n if (!header) continue\n const got = splitDotted((header[1] as string).trim())\n if (got.length === path.length && got.every((p, k) => p === path[k])) return i + 1\n }\n if (path.length === 1) return locateTomlKey(text, [], path[0] as string)?.line\n return undefined\n } catch {\n return undefined\n }\n}\n\n/** Parses TOML; undefined when it is not valid TOML. */\nexport function parseToml(text: string): Record<string, unknown> | undefined {\n try {\n return parse(text) as Record<string, unknown>\n } catch {\n return undefined\n }\n}\n\n/** The error of a TOML text that does not parse, with the position `smol-toml` reports. */\nexport interface TomlProblem {\n line: number\n column: number\n message: string\n}\n\n/** Like `parseToml`, but returns the syntax error (line, column, first line of the message) instead of dropping it. */\nexport function parseTomlDetailed(text: string): { data: Record<string, unknown> } | { error: TomlProblem } {\n try {\n return { data: parse(text) as Record<string, unknown> }\n } catch (err) {\n const e = err as { line?: unknown; column?: unknown; message?: unknown }\n const first = String(e.message ?? 'invalid TOML').split('\\n')[0] as string\n return {\n error: {\n line: typeof e.line === 'number' && e.line > 0 ? e.line : 1,\n column: typeof e.column === 'number' && e.column > 0 ? e.column : 1,\n message: first.replace(/^Invalid TOML document:\\s*/i, ''),\n },\n }\n }\n}\n","/** `mise.toml` / `.mise.toml` `[tools]` parser. Pure; never throws. */\nimport { locateTomlKey, locateTomlTable, parseToml } from './toml'\n\n/** One tool of a mise `[tools]` table. */\nexport interface MiseTool {\n /** Tool name as written (`node`, `go`, `\"core:node\"`'s unquoted `core:node`). */\n tool: string\n /** Versions as written: one for `node = \"22\"`, several for an array, `version` for an inline table. */\n versions: string[]\n /** 1-based line of the tool key. */\n line: number\n /** 1-based column of the value. */\n column?: number\n}\n\nfunction versionsOf(value: unknown): string[] | undefined {\n if (typeof value === 'string') return [value]\n if (typeof value === 'number') return [String(value)]\n if (Array.isArray(value)) {\n const list = value.filter((v): v is string | number => typeof v === 'string' || typeof v === 'number').map(String)\n return list.length === value.length ? list : undefined\n }\n if (value && typeof value === 'object') {\n const v = (value as Record<string, unknown>).version\n return v === undefined ? undefined : versionsOf(v)\n }\n return undefined\n}\n\n/**\n * Lists the `[tools]` entries of a mise config, with the line of each key. A tool whose value has\n * no readable version (an inline table without `version`) is returned with `versions: []`.\n * Invalid TOML gives []. `idiomatic_version_file_enable_tools` and other settings are not pins and\n * are ignored.\n */\nexport function parseMise(text: string): MiseTool[] {\n try {\n const data = parseToml(text)\n const tools = data?.tools\n if (!tools || typeof tools !== 'object' || Array.isArray(tools)) return []\n const out: MiseTool[] = []\n for (const [tool, value] of Object.entries(tools as Record<string, unknown>)) {\n // `node = \"22\"` under [tools], or the table form `[tools.node]` with a `version` key (or the\n // header itself when it has none). A line is never invented: no location, no entry.\n const where = locateTomlKey(text, ['tools'], tool) ?? locateTomlKey(text, ['tools', tool], 'version')\n const line = where?.line ?? locateTomlTable(text, ['tools', tool]) ?? locateTomlTable(text, ['tools'])\n if (line === undefined) continue\n const entry: MiseTool = { tool, versions: versionsOf(value) ?? [], line }\n if (where) entry.column = where.column\n out.push(entry)\n }\n return out\n } catch {\n return []\n }\n}\n","/** `.tool-versions` (asdf, and mise's legacy format) parser. Pure; never throws. */\n\n/** One line of a `.tool-versions` file. */\nexport interface ToolEntry {\n /** Tool name as written (`nodejs`, `golang`, `python`). */\n tool: string\n /** Every version on the line, as written (`22.12.0`, `ref:master`, `system`). Empty when the line names only a tool. */\n versions: string[]\n /** 1-based line. */\n line: number\n}\n\n/**\n * Lists the tools of a `.tool-versions` file. Blank lines and `#` comments (whole-line or trailing)\n * are skipped; fields are separated by any run of whitespace (chainlink aligns them with spaces).\n */\nexport function parseToolVersions(text: string): ToolEntry[] {\n try {\n const out: ToolEntry[] = []\n text.split(/\\r?\\n/).forEach((raw, i) => {\n const body = raw.replace(/(^|\\s)#.*$/, '').trim()\n if (body === '') return\n const [tool, ...versions] = body.split(/\\s+/)\n if (tool === undefined) return\n out.push({ tool, versions, line: i + 1 })\n })\n return out\n } catch {\n return []\n }\n}\n","/**\n * GitHub workflow (and composite action) parser: every step that has `uses:`, with its `with:`\n * inputs, the `working-directory` that applies, and the job's matrix; `${{ matrix.x }}` inputs are\n * resolved to the matrix values with their own line numbers (docs/TASKS.md A8). Pure; never throws.\n */\nimport { entries, getPair, isMap, isScalar, items, loadYamlAll, resolveNode, scalarText } from './yaml-util'\nimport type { Yaml } from './yaml-util'\n\n/** The values of one matrix key, in document order, each with its position. */\nexport interface MatrixEntry {\n /** Each value as written (`'3.10'` and `3.10` both give `3.10`; see `quoted`). */\n values: string[]\n /** 1-based line and column of each value, parallel to `values`. */\n lines: number[]\n columns: number[]\n /** True per value when it was written in quotes. An unquoted `3.10` is the number 3.1 to YAML. */\n quoted: boolean[]\n /** 1-based line of the matrix key. */\n line: number\n /** Set when the key's value is an expression (`${{ fromJSON(…) }}`) that cannot be read statically. */\n expression?: string\n}\n\n/** One `with:` input of a step. */\nexport interface WorkflowInput {\n /** The value as written (`20`, `'3.10'`, `${{ matrix.node }}`). */\n value: string\n line: number\n column: number\n /** True when written in quotes. */\n quoted: boolean\n /** Set when the whole value is `${{ matrix.<key> }}` and that key exists in the job's matrix. */\n matrixKey?: string\n /** The matrix values `${{ matrix.<key> }}` stands for. Present exactly when `matrixKey` is. */\n resolved?: MatrixEntry\n /**\n * Set when the whole value is `${{ env.<NAME> }}` and `NAME` is defined as a plain value in the\n * `env:` of the same step, job or workflow (searched in that order). `value`, `line` and `column`\n * still describe the `with:` input as written; `env` is where the version really comes from.\n * An env value that is itself an expression is not resolved.\n */\n env?: { name: string; value: string; quoted: boolean; line: number; column: number }\n}\n\n/** One step that has `uses:`. */\nexport interface WorkflowStep {\n /** The `uses:` value as written (`actions/setup-node@v4`). */\n uses: string\n /** 1-based line and column of the `uses:` value. */\n line: number\n column: number\n /** Job name (`''` for the steps of a composite action). */\n job: string\n with: Record<string, WorkflowInput>\n /** The job's matrix (keys of `strategy.matrix`, plus keys that only appear under `include`). */\n matrix: Record<string, MatrixEntry>\n /** The step's `working-directory`, or the job's / workflow's `defaults.run.working-directory`. */\n workingDirectory?: string\n /**\n * Every distinct `working-directory` set anywhere in the same job (on `run:` steps or in\n * `defaults.run`), in order. A `uses:` step such as `setup-node` has none of its own, but its job\n * usually works in one project directory; the runtime module decides whether that applies.\n */\n jobWorkingDirectories: string[]\n /**\n * Repo-relative paths this step names (docs/TASKS.md A13): `cache-dependency-path`, `node-version-file`,\n * `python-version-file`, `go-version-file`, and its own `working-directory`. Cleaned by `cleanWorkflowPath`;\n * entries that are expressions, negations, absolute or `..` paths are left out; globs are kept as written.\n */\n paths: string[]\n}\n\nconst PATH_INPUTS = ['cache-dependency-path', 'node-version-file', 'python-version-file', 'go-version-file', 'working-directory']\n\n/**\n * A path written in a workflow as a repo-relative path: leading `./` and trailing `/` removed. A glob\n * (`*`, `?`, `[`, `{`) is kept exactly as written: it does not name one directory, and cutting it to a\n * prefix would invent one (`apps/*\\/x` is not `apps`), so the binding (docs/TASKS.md A14) ignores glob\n * entries itself. A negation (`!x`), an expression (`${{ }}`), an absolute path or a `..` path gives\n * undefined. `.` stays `.` (the repo root).\n */\nexport function cleanWorkflowPath(raw: string): string | undefined {\n let p = raw.trim().replace(/^[\"']|[\"']$/g, '')\n if (p === '' || p.startsWith('!') || p.startsWith('/') || p.includes('${{') || p.split('/').includes('..')) return undefined\n p = p.replace(/^(\\.\\/)+/, '')\n const segments = p.split('/').filter((x) => x !== '' && x !== '.')\n return segments.length === 0 ? '.' : segments.join('/')\n}\n\nconst ENV_REF = /^\\$\\{\\{\\s*env\\.([A-Za-z_][A-Za-z0-9_]*)\\s*\\}\\}$/\nconst MATRIX_REF = /^\\$\\{\\{\\s*matrix\\.([A-Za-z0-9_-]+)\\s*\\}\\}$/\n\nfunction readMatrix(y: Yaml, matrixNode: unknown): Record<string, MatrixEntry> {\n const out: Record<string, MatrixEntry> = {}\n const add = (key: string, line: number, node: unknown): void => {\n const target = (out[key] ??= { values: [], lines: [], columns: [], quoted: [], line })\n const one = scalarText(y, node)\n const list = one ? [one] : items(y, node).map((n) => scalarText(y, n)).filter((s): s is NonNullable<typeof s> => s !== undefined)\n if (one && /^\\$\\{\\{/.test(one.text)) {\n target.expression = one.text\n return\n }\n for (const v of list) {\n if (target.values.includes(v.text)) continue\n target.values.push(v.text)\n target.lines.push(v.line)\n target.columns.push(v.column)\n target.quoted.push(v.quoted)\n }\n }\n for (const { key, value, line } of entries(y, matrixNode)) {\n if (key === 'exclude') continue\n if (key === 'include') {\n for (const inc of items(y, value)) for (const e of entries(y, inc)) add(e.key, e.line, e.value)\n continue\n }\n add(key, line, value)\n }\n return out\n}\n\n/** The plain value of `name` in an `env:` map, or undefined (also for an expression value). */\nfunction envValue(y: Yaml, envNode: unknown, name: string): { value: string; quoted: boolean; line: number; column: number } | undefined {\n const found = entries(y, envNode).find((e) => e.key === name)\n const v = found ? scalarText(y, found.value) : undefined\n if (!v || v.text === '' || v.text.includes('${{')) return undefined\n return { value: v.text, quoted: v.quoted, line: v.line, column: v.column }\n}\n\nfunction stepsOf(y: Yaml, job: string, node: unknown, matrix: Record<string, MatrixEntry>, inherited: string | undefined, out: WorkflowStep[], jobEnv?: unknown, workflowEnv?: unknown): void {\n const list = items(y, getPair(y, node, 'steps')?.value ?? node)\n const dirs: string[] = inherited === undefined ? [] : [inherited]\n for (const step of list) {\n const d = scalarText(y, getPair(y, step, 'working-directory')?.value)?.text\n if (d !== undefined && !dirs.includes(d)) dirs.push(d)\n }\n for (const step of list) {\n const uses = scalarText(y, getPair(y, step, 'uses')?.value)\n if (!uses || uses.text === '') continue\n const inputs: Record<string, WorkflowInput> = {}\n for (const { key, value } of entries(y, getPair(y, step, 'with')?.value)) {\n const v = scalarText(y, value)\n if (!v) continue\n const input: WorkflowInput = { value: v.text, line: v.line, column: v.column, quoted: v.quoted }\n const ref = MATRIX_REF.exec(v.text)\n const hit = ref ? matrix[ref[1] as string] : undefined\n if (ref && hit && hit.values.length > 0) {\n input.matrixKey = ref[1] as string\n input.resolved = hit\n }\n const envRef = ENV_REF.exec(v.text)\n if (envRef) {\n const name = envRef[1] as string\n const hitEnv = envValue(y, getPair(y, step, 'env')?.value, name) ?? envValue(y, jobEnv, name) ?? envValue(y, workflowEnv, name)\n if (hitEnv) input.env = { name, ...hitEnv }\n }\n inputs[key] = input\n }\n const own = scalarText(y, getPair(y, step, 'working-directory')?.value)\n const wd = own?.text ?? scalarText(y, getPair(y, step, 'with')?.value && getPair(y, getPair(y, step, 'with')?.value, 'working-directory')?.value)?.text ?? inherited\n const paths: string[] = []\n for (const [key, input] of Object.entries(inputs)) {\n if (!PATH_INPUTS.includes(key)) continue\n for (const piece of input.value.split(/\\r?\\n/)) {\n const cleaned = cleanWorkflowPath(piece)\n if (cleaned !== undefined && !paths.includes(cleaned)) paths.push(cleaned)\n }\n }\n const ownDir = own?.text === undefined ? undefined : cleanWorkflowPath(own.text)\n if (ownDir !== undefined && !paths.includes(ownDir)) paths.push(ownDir)\n const entry: WorkflowStep = { uses: uses.text, line: uses.line, column: uses.column, job, with: inputs, matrix, jobWorkingDirectories: dirs, paths }\n if (wd !== undefined) entry.workingDirectory = wd\n out.push(entry)\n }\n}\n\nfunction defaultsWd(y: Yaml, node: unknown): string | undefined {\n return scalarText(y, getPair(y, getPair(y, getPair(y, node, 'defaults')?.value, 'run')?.value, 'working-directory')?.value)?.text\n}\n\n/**\n * Lists every `uses:` step of a workflow (`jobs.*.steps`) or composite action (`runs.steps`).\n * Reusable-workflow jobs (`jobs.x.uses`) are not steps and are skipped.\n */\nexport function parseWorkflow(text: string): WorkflowStep[] {\n try {\n // A multi-document stream is valid YAML: every document is read.\n return (loadYamlAll(text) ?? []).flatMap((y) => parseWorkflowDocument(y))\n } catch {\n return []\n }\n}\n\nfunction parseWorkflowDocument(y: Yaml): WorkflowStep[] {\n try {\n const root = resolveNode(y, y.doc.contents)\n if (!isMap(root)) return []\n const out: WorkflowStep[] = []\n const topWd = defaultsWd(y, root)\n const topEnv = getPair(y, root, 'env')?.value\n for (const { key, value } of entries(y, getPair(y, root, 'jobs')?.value)) {\n const matrixNode = getPair(y, getPair(y, value, 'strategy')?.value, 'matrix')?.value\n const matrix = isScalar(resolveNode(y, matrixNode)) ? {} : readMatrix(y, matrixNode)\n stepsOf(y, key, getPair(y, value, 'steps')?.value, matrix, defaultsWd(y, value) ?? topWd, out, getPair(y, value, 'env')?.value, topEnv)\n }\n const composite = getPair(y, getPair(y, root, 'runs')?.value, 'steps')?.value\n if (composite) stepsOf(y, '', composite, {}, undefined, out)\n return out\n } catch {\n return []\n }\n}\n\n/**\n * The paths a workflow step is tied to (docs/TASKS.md A13): the step's own (`paths`) plus the\n * `working-directory` values used anywhere in its job, cleaned and without duplicates. Used to bind a\n * root CI source to the sub-projects it builds; empty when the step names no path.\n */\nexport function workflowSourcePaths(step: WorkflowStep): string[] {\n const out = [...step.paths]\n for (const dir of step.jobWorkingDirectories) {\n const cleaned = cleanWorkflowPath(dir)\n if (cleaned !== undefined && !out.includes(cleaned)) out.push(cleaned)\n }\n return out\n}\n","/**\n * File-level read diagnostics (docs/TASKS.md constraint 9): a YAML, TOML or JSON syntax error is\n * reported with its file, line and column instead of silently dropping pins. A broken file is not\n * a finding (it has no runtime to compare) and never changes the exit code.\n */\nimport type { Diagnostic, Runtime } from '../types'\nimport { loadYamlAll } from './shared/yaml-util'\nimport { parseTomlDetailed } from './shared'\n\n/**\n * The YAML files the extractors read as CI files: top-level `.github/workflows/*.yml|yaml` (GitHub\n * ignores subfolders, so `.github/workflows/resources/*.yaml` are NOT workflows) and composite\n * `action.yml|yaml` where the extractors recognise them (docs/TASKS.md A15).\n */\nconst WORKFLOW_YAML = /(^|\\/)\\.github\\/workflows\\/[^/]+\\.ya?ml$/i\nconst ACTION_YAML = /(^|\\/)action\\.ya?ml$/i\nconst GITLAB_YAML = /(^|\\/)\\.gitlab-ci\\.ya?ml$/i\nconst MISE_TOML = /(^|\\/)(\\.?mise(\\..+)?\\.toml|\\.config\\/mise\\/config(\\..+)?\\.toml|\\.config\\/mise\\.toml)$/i\n\nfunction firstLine(text: string): string {\n return (text.split('\\n')[0] ?? '').trim()\n}\n\nfunction yamlDiagnostic(file: string, text: string): Diagnostic | undefined {\n const docs = loadYamlAll(text)\n if (!docs) return { file, line: 1, message: 'YAML could not be parsed at all; no pins were read from this file.' }\n // A multi-document stream is valid YAML; the errors of every document count, in file order.\n const errors = docs.flatMap((y) => y.doc.errors.map((e) => ({ e, y })))\n const first = errors[0]\n if (!first) return undefined\n const { line, column } = first.y.pos(first.e.pos[0])\n const more = errors.length > 1 ? ` (${errors.length - 1} more error${errors.length === 2 ? '' : 's'} in this file)` : ''\n return {\n file,\n line,\n column,\n message: `YAML syntax error: ${firstLine(first.e.message)}${more}. Pins before this point were read; pins after it may not have been.`,\n }\n}\n\nfunction tomlDiagnostic(file: string, text: string): Diagnostic | undefined {\n const r = parseTomlDetailed(text)\n if (!('error' in r)) return undefined\n return { file, line: r.error.line, column: r.error.column, message: `TOML syntax error: ${r.error.message}. No pins were read from this file.` }\n}\n\nfunction jsonDiagnostic(file: string, text: string): Diagnostic | undefined {\n try {\n JSON.parse(text)\n return undefined\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n let line = 1\n let column: number | undefined\n const lc = /\\(line (\\d+) column (\\d+)\\)/.exec(message)\n const pos = /position (\\d+)/.exec(message)\n if (lc) {\n line = Number(lc[1])\n column = Number(lc[2])\n } else if (pos) {\n const before = text.slice(0, Number(pos[1]))\n line = before.split('\\n').length\n column = Number(pos[1]) - (before.lastIndexOf('\\n') + 1) + 1\n }\n const d: Diagnostic = { file, line, message: `JSON syntax error: ${message.replace(/\\s*\\(line \\d+ column \\d+\\)/, '')}. No pins were read from this file.` }\n if (column !== undefined) d.column = column\n return d\n }\n}\n\n/**\n * The parse error of one file, if it has one. Only files the extractors read are checked: GitHub\n * workflows and composite actions and `.gitlab-ci.yml` (YAML), `pyproject.toml` and mise files\n * (TOML), `package.json` (JSON). `runtimes` limits the check to files that matter for the\n * selected runtimes (`package.json` is Node's, `pyproject.toml` Python's).\n *\n * @param file - Repo-relative path with `/` separators.\n * @param text - The file's content (byte-order mark already removed).\n */\nexport function diagnoseFile(file: string, text: string, runtimes: readonly Runtime[] = ['node', 'python', 'go']): Diagnostic[] {\n try {\n const base = file.slice(file.lastIndexOf('/') + 1)\n let d: Diagnostic | undefined\n if (WORKFLOW_YAML.test(file) || ACTION_YAML.test(file) || GITLAB_YAML.test(file)) d = yamlDiagnostic(file, text)\n else if (base === 'package.json' && runtimes.includes('node')) d = jsonDiagnostic(file, text)\n else if (base === 'pyproject.toml' && runtimes.includes('python')) d = tomlDiagnostic(file, text)\n else if (MISE_TOML.test(file)) d = tomlDiagnostic(file, text)\n return d ? [d] : []\n } catch {\n return []\n }\n}\n","/**\n * Runtime-parameterised adapters from the shared format parsers (src/extract/shared) to `Source`s.\n * Used by the python and go extractors; the version meaning stays in `parseConstraint` /\n * `dockerTagConstraint`. Everything here is pure and never throws (docs/TASKS.md A8).\n */\nimport { dockerTagConstraint, parseConstraint } from '../../constraint'\nimport type { Constraint, Runtime, Source } from '../../types'\nimport {\n parseDockerfile,\n parseGitlabCi,\n parseMise,\n parseToolVersions,\n isRuntimeImage,\n parseWorkflow,\n splitImageRef,\n workflowSourcePaths,\n} from '../shared'\nimport type { WorkflowInput, WorkflowStep } from '../shared'\n\n/** The last path segment of a repo-relative file path. */\nexport function baseName(file: string): string {\n return file.slice(file.lastIndexOf('/') + 1)\n}\n\n/** `Dockerfile`, `Dockerfile.dev`, `app.Dockerfile`, `dev.dockerfile` (any case). */\nexport function isDockerfile(file: string): boolean {\n return /^(.+\\.)?dockerfile(\\..+)?$/i.test(baseName(file))\n}\n\n/**\n * `.github/workflows/*.yml|yaml`, composite actions under `.github/workflows/<dir>/action.yml` and\n * `.github/actions/**\\/action.yml`, at the repo root, in any letter case.\n */\nexport function isWorkflowFile(file: string): boolean {\n return /^\\.github\\/(workflows\\/([^/]+|.+\\/action)|actions\\/.+\\/action)\\.ya?ml$/i.test(file)\n}\n\n/** `mise.toml`, `.mise.toml`, `mise.local.toml`, `.mise.<env>.toml`, `.config/mise.toml`, `.config/mise/config.toml`. */\nexport function isMiseFile(file: string): boolean {\n if (/^\\.?mise(\\..+)?\\.toml$/i.test(baseName(file))) return true\n return /(^|\\/)\\.config\\/mise(\\/config(\\..+)?)?\\.toml$/i.test(file) || /(^|\\/)\\.config\\/mise\\/config(\\..+)?\\.toml$/i.test(file)\n}\n\n/** True for the file `.tool-versions`. */\nexport function isToolVersions(file: string): boolean {\n return baseName(file) === '.tool-versions'\n}\n\n/** A value read as text: what the YAML number rule does to an unquoted `3.10` or `1.20`. */\nexport function yamlNumberPitfall(text: string, quoted: boolean): string | undefined {\n if (quoted) return undefined\n if (/^\\d+\\.\\d*0$/.test(text)) {\n const read = String(Number(text))\n return `unquoted ${text} is read by YAML as the number ${read}; write it in quotes ('${text}')`\n }\n return undefined\n}\n\n/** Builds a constraint, turning the unquoted-number pitfall into an `unknown` with a clear reason. */\nexport function ciConstraint(text: string, quoted: boolean, runtime: Runtime): Constraint {\n const pitfall = yamlNumberPitfall(text, quoted)\n return pitfall ? { kind: 'unknown', reason: pitfall } : parseConstraint(text, runtime)\n}\n\n/** Takes `.` or a clean relative directory; anything else (absolute, expression) is undefined. */\nexport function cleanDirectory(dir: string): string | undefined {\n const d = dir.trim().replace(/^\\.\\//, '').replace(/\\/+$/, '')\n if (d === '' || d === '.') return '.'\n if (d.startsWith('/') || d.includes('${{') || d.includes('..')) return undefined\n return d\n}\n\n// ---------- Dockerfile ----------\n\n/** A tag gives the version; a digest with no tag is immutable but names no version, so it is not `latest`. */\nfunction dockerConstraint(tag: string | undefined, digest: string | undefined, runtime: Runtime): Constraint {\n if (tag === undefined && digest !== undefined) {\n return { kind: 'unknown', reason: 'image is pinned by digest only, so its version cannot be read' }\n }\n return dockerTagConstraint(tag, runtime)\n}\n\n/**\n * Sources for every `FROM <image>` that is the runtime's official image or a well-known mirror\n * (docs/TASKS.md A12). Other images, even ones named `.../python`, are not runtime pins.\n */\nexport function dockerfileSources(file: string, text: string, runtime: Runtime): Source[] {\n const out: Source[] = []\n for (const from of parseDockerfile(text)) {\n if (!isRuntimeImage(from.image, runtime)) continue\n const written = splitImageRef(from.raw)\n const raw = written.tag ?? from.raw\n const tagOffset = written.tag === undefined ? 0 : written.image.length + 1\n out.push({\n runtime,\n file,\n line: from.line,\n column: from.column + tagOffset,\n raw,\n kind: 'dockerfile',\n constraint: dockerConstraint(from.tag, from.digest, runtime),\n })\n }\n return out\n}\n\n/** `.gitlab-ci.yml` at any depth (GitLab reads the root one; the binding rules decide its scope). */\nexport function isGitlabCi(file: string): boolean {\n return /^\\.gitlab-ci\\.ya?ml$/i.test(baseName(file))\n}\n\n/**\n * Sources for every `image:` of a `.gitlab-ci.yml` (top level, `default:` and each job) that is an\n * official image of `runtime` (`python:3.12-slim`, `golang:1.24`; rpc-harden F7).\n */\nexport function gitlabSources(file: string, text: string, runtime: Runtime): Source[] {\n const out: Source[] = []\n for (const img of parseGitlabCi(text)) {\n if (!isRuntimeImage(img.image, runtime)) continue\n const written = splitImageRef(img.raw)\n const raw = written.tag ?? img.raw\n const tagOffset = written.tag === undefined ? 0 : written.image.length + 1\n out.push({\n runtime,\n file,\n line: img.line,\n column: img.column + tagOffset,\n raw,\n kind: 'gitlab-ci',\n constraint: dockerConstraint(img.tag, img.digest, runtime),\n })\n }\n return out\n}\n\n// ---------- .tool-versions and mise ----------\n\n/** The first version of each `.tool-versions` line whose tool is one of `tools` (asdf uses the first). */\nexport function toolVersionsSources(file: string, text: string, runtime: Runtime, tools: readonly string[]): Source[] {\n const out: Source[] = []\n const lines = text.split(/\\r?\\n/)\n for (const entry of parseToolVersions(text)) {\n if (!tools.includes(entry.tool)) continue\n const raw = entry.versions[0]\n const source: Source = {\n runtime,\n file,\n line: entry.line,\n raw: raw ?? '',\n kind: 'tool-versions',\n constraint: raw === undefined ? { kind: 'unknown', reason: 'no version after the tool name' } : parseConstraint(raw, runtime),\n }\n // The version starts after the tool name; searching from there keeps `go 1.22` from matching inside the name.\n const lineText = lines[entry.line - 1] ?? ''\n const toolEnd = lineText.indexOf(entry.tool) + entry.tool.length\n const at = raw === undefined ? -1 : lineText.indexOf(raw, toolEnd)\n if (at >= 0) source.column = at + 1\n out.push(source)\n }\n return out\n}\n\n/**\n * Where the first version's text sits: `parseMise` reports the value token (a quote, `[` or `{`),\n * but `--fix` needs the version text itself. Looks on the key's line, then on the next few lines\n * (an array may continue below its key). Returns the original position when the text is not found.\n */\nfunction miseRawPosition(lines: readonly string[], line: number, column: number | undefined, raw: string): { line: number; column?: number } {\n for (let k = 0; k < 20 && line - 1 + k < lines.length; k++) {\n const text = lines[line - 1 + k] as string\n const from = k === 0 && column !== undefined ? column - 1 : 0\n let rest = text.slice(from)\n let offset = from\n if (k === 0 && rest.startsWith('{')) {\n const m = /version\\s*=\\s*[\"']?/.exec(rest)\n if (m) {\n offset += m.index + m[0].length\n rest = text.slice(offset)\n }\n }\n const at = rest.indexOf(raw)\n if (at >= 0) return { line: line + k, column: offset + at + 1 }\n }\n return column === undefined ? { line } : { line, column }\n}\n\n/** The first version of each mise `[tools]` entry whose tool is one of `tools`. */\nexport function miseSources(file: string, text: string, runtime: Runtime, tools: readonly string[]): Source[] {\n const out: Source[] = []\n const lines = text.split(/\\r?\\n/)\n for (const entry of parseMise(text)) {\n if (!tools.includes(entry.tool)) continue\n const raw = entry.versions[0]\n const where = raw === undefined ? miseRawPosition([], entry.line, entry.column, '') : miseRawPosition(lines, entry.line, entry.column, raw)\n const source: Source = {\n runtime,\n file,\n line: where.line,\n raw: raw ?? '',\n kind: 'mise',\n constraint: raw === undefined ? { kind: 'unknown', reason: 'no version in the mise tool entry' } : parseConstraint(raw, runtime),\n }\n if (where.column !== undefined) source.column = where.column\n out.push(source)\n }\n return out\n}\n\n// ---------- GitHub workflows ----------\n\n/**\n * The directory a step's `uses:` applies to: its own `working-directory` or the workflow's / job's\n * `defaults.run.working-directory`. Nothing is inferred from the `run:` steps of the same job: a run\n * step without `working-directory` works in the repo root, which the shared parser does not report,\n * so inferring would narrow the scope and hide a real conflict (docs/TASKS.md, review F1).\n */\nfunction stepDirectory(step: WorkflowStep): string | undefined {\n return step.workingDirectory === undefined ? undefined : cleanDirectory(step.workingDirectory)\n}\n\nfunction inputSources(step: WorkflowStep, input: WorkflowInput, file: string, runtime: Runtime, kind: string, dir: string | undefined): Source[] {\n const base = { runtime, file, kind } as const\n const paths = workflowSourcePaths(step)\n const withDir = (s: Source): Source => {\n if (dir !== undefined) s.workingDirectory = dir\n if (paths.length > 0) s.paths = paths\n return s\n }\n const resolved = input.resolved\n if (resolved) {\n return resolved.values.map((value, i) =>\n withDir({\n ...base,\n line: resolved.lines[i] as number,\n column: resolved.columns[i] as number,\n raw: value,\n constraint: ciConstraint(value, resolved.quoted[i] as boolean, runtime),\n matrix: true,\n }),\n )\n }\n if (input.env) {\n // `${{ env.X }}` defined in an `env:` of the step, job or workflow: the constraint is the env value, the\n // source still points at the `with:` input as written.\n return [withDir({ ...base, line: input.line, column: input.column, raw: input.value, constraint: ciConstraint(input.env.value, input.env.quoted, runtime) })]\n }\n if (/^\\$\\{\\{/.test(input.value) || (input.value.includes('${{') && !input.quoted)) {\n return [withDir({ ...base, line: input.line, column: input.column, raw: input.value, constraint: { kind: 'unknown', reason: 'value is a workflow expression that cannot be read statically' } })]\n }\n if (!input.quoted && input.value.includes('\\n')) {\n // A block scalar listing several versions, one per line (the content starts on the line after `|`).\n return input.value\n .split('\\n')\n .map((v, i) => ({ v: v.trim(), i }))\n .filter(({ v }) => v !== '')\n .map(({ v, i }) => withDir({ ...base, line: input.line + 1 + i, raw: v, constraint: parseConstraint(v, runtime) }))\n }\n return [withDir({ ...base, line: input.line, column: input.column, raw: input.value, constraint: ciConstraint(input.value, input.quoted, runtime) })]\n}\n\n/**\n * Sources of every `uses: <action>` step for the given action (`actions/setup-python`) from its\n * version input (`python-version`). A `*-version-file` input is a reference, not a pin, and gives\n * nothing. Matrix values become one source each with `matrix: true`.\n */\nexport function workflowSources(file: string, text: string, runtime: Runtime, action: string, input: string): Source[] {\n const out: Source[] = []\n const name = action.toLowerCase()\n for (const step of parseWorkflow(text)) {\n const used = step.uses.toLowerCase()\n if (used !== name && !used.startsWith(`${name}@`)) continue\n const value = step.with[input]\n if (!value) continue\n out.push(...inputSources(step, value, file, runtime, action.slice(action.lastIndexOf('/') + 1), stepDirectory(step)))\n }\n // Block-scalar versions (`|`, `>-`, `|2`, one per line or just one) are on the lines after the header\n // line the parser reports; move such a source to its own line and column, or leave it without one.\n const lines = text.split(/\\r?\\n/)\n for (const source of out) {\n if (source.raw === '') continue\n if (source.column !== undefined && lines[source.line - 1]?.startsWith(source.raw, source.column - 1)) continue\n delete source.column\n const own = lines[source.line - 1] ?? ''\n if (own.trim() === source.raw) {\n // A version listed alone on its line (one per line in a block scalar).\n source.column = own.indexOf(source.raw) + 1\n continue\n }\n const header = lines[source.line - 1] ?? ''\n if (/[|>][+-]?\\d*\\s*(#.*)?$/.test(header)) {\n for (let k = 1; k <= 20; k++) {\n const below = lines[source.line - 1 + k]\n if (below === undefined) break\n if (below.trim() === source.raw) {\n source.line += k\n source.column = below.indexOf(source.raw) + 1\n break\n }\n }\n }\n }\n return out\n}\n\n/**\n * Final guard for every extractor: a `column` is kept only when the text at that column on that line\n * really is `raw`. A wrong byte offset would let `--fix` edit the wrong bytes, so when the position\n * cannot be vouched for (a value split over several lines, a folded or escaped string) it is dropped.\n */\nexport function guardColumns(text: string, sources: Source[]): Source[] {\n const lines = text.split(/\\r?\\n/)\n for (const source of sources) {\n if (source.column === undefined) continue\n if (!(lines[source.line - 1] ?? '').startsWith(source.raw, source.column - 1)) delete source.column\n }\n return sources\n}\n","/** `go.mod` directives: `go 1.22` (a minimum) and `toolchain go1.22.3` (an exact toolchain). */\nimport { parseConstraint } from '../../constraint'\nimport type { Constraint, Source } from '../../types'\n\n/**\n * Reads the top-level `go` and `toolchain` directives. Lines inside `( … )` blocks (`require`,\n * `replace`, …) are skipped, `//` comments are ignored.\n *\n * - `go 1.22` / `go 1.22.3`: the module's minimum Go version, so the constraint is `>=1.22.0` /\n * `>=1.22.3` (docs/TASKS.md A8). `raw` stays as written.\n * - `toolchain go1.22.3`: exact. `toolchain default` and `toolchain local` choose the toolchain\n * at build time and become `unknown` with that reason.\n */\nexport function goModSources(file: string, text: string): Source[] {\n const out: Source[] = []\n let depth = 0\n text.split(/\\r?\\n/).forEach((line, i) => {\n const code = line.replace(/\\/\\/.*$/, '')\n const openers = (code.match(/\\(/g) ?? []).length\n const closers = (code.match(/\\)/g) ?? []).length\n const inBlock = depth > 0\n depth = Math.max(0, depth + openers - closers)\n if (inBlock) return\n const m = /^(\\s*)(go|toolchain)\\s+(\\S+)\\s*$/.exec(code)\n if (!m) return\n const directive = m[2] as string\n const raw = m[3] as string\n const column = (m[1] as string).length + directive.length + (code.slice((m[1] as string).length + directive.length).length - code.slice((m[1] as string).length + directive.length).trimStart().length) + 1\n let constraint: Constraint\n if (directive === 'go') {\n const exact = /^\\d+\\.\\d+(\\.\\d+)?$/.test(raw)\n constraint = exact ? parseConstraint(`>=${raw}`, 'go') : { kind: 'unknown', reason: `go directive ${raw} is not a plain version` }\n } else if (raw === 'default' || raw === 'local') {\n constraint = { kind: 'unknown', reason: `toolchain ${raw} selects the toolchain at build time` }\n } else {\n constraint = parseConstraint(raw, 'go')\n }\n out.push({ runtime: 'go', file, line: i + 1, column, raw, kind: directive === 'go' ? 'go-mod' : 'go-toolchain', constraint })\n })\n return out\n}\n","/**\n * Go version pins (docs/TASKS.md, Extractors): `go.mod` (`go` and `toolchain` directives),\n * `.tool-versions` (`golang`/`go`), `mise.toml`, `Dockerfile*` (`FROM golang:`), and\n * `actions/setup-go` (`go-version`; `go-version-file` is a reference, not a pin).\n * Not read in v1: `go.work`, and `GOTOOLCHAIN` in the environment.\n */\nimport type { Source } from '../../types'\nimport { baseName, dockerfileSources, gitlabSources, isGitlabCi, guardColumns, isDockerfile, isMiseFile, isToolVersions, isWorkflowFile, miseSources, toolVersionsSources, workflowSources } from '../python/adapters'\nimport { goModSources } from './gomod'\n\nconst GO_TOOLS = ['golang', 'go'] as const\n\nfunction dispatch(file: string, text: string): Source[] {\n if (baseName(file) === 'go.mod') return goModSources(file, text)\n if (isToolVersions(file)) return toolVersionsSources(file, text, 'go', GO_TOOLS)\n if (isMiseFile(file)) return miseSources(file, text, 'go', GO_TOOLS)\n if (isDockerfile(file)) return dockerfileSources(file, text, 'go')\n if (isGitlabCi(file)) return gitlabSources(file, text, 'go')\n if (isWorkflowFile(file)) return workflowSources(file, text, 'go', 'actions/setup-go', 'go-version')\n return []\n}\n\n/**\n * Extracts the Go pins of one file. Returns [] for files it does not handle. Pure; never throws.\n *\n * @param file - Repo-relative path with `/` separators.\n * @param text - The file's content.\n */\nexport function extractGo(file: string, text: string): Source[] {\n try {\n return guardColumns(text, dispatch(file, text))\n } catch {\n return []\n }\n}\n","/** Helpers shared by the Node extractors. */\nimport { isRuntimeImage } from '../shared'\nimport { parseConstraint } from '../../constraint'\nimport type { Constraint, Source } from '../../types'\n\n/** Builds a Node `Source`. `extra` carries `matrix` / `workingDirectory` / `column` / `paths`. */\nexport function nodeSource(\n file: string,\n kind: string,\n line: number,\n raw: string,\n constraint: Constraint,\n extra: Partial<Pick<Source, 'column' | 'matrix' | 'workingDirectory' | 'paths'>> = {},\n): Source {\n const source: Source = { runtime: 'node', file, line, raw, kind, constraint }\n if (extra.column !== undefined) source.column = extra.column\n if (extra.matrix) source.matrix = true\n if (extra.workingDirectory !== undefined) source.workingDirectory = extra.workingDirectory\n if (extra.paths !== undefined && extra.paths.length > 0) source.paths = extra.paths\n return source\n}\n\n/** The constraint of a version written in a file; a variable or template is `unknown`, never guessed. */\nexport function nodeConstraint(raw: string): Constraint {\n return parseConstraint(raw, 'node')\n}\n\n/** True when `image` is the official Node image or a well-known mirror (docs/TASKS.md A12). */\nexport function isNodeImage(image: string): boolean {\n return isRuntimeImage(image, 'node')\n}\n\n/** 1-based column of `needle` in line `line` of `text` (searching from `from`), or undefined. */\nexport function columnOf(text: string, line: number, needle: string, from = 0): number | undefined {\n const l = text.split(/\\r?\\n/)[line - 1]\n if (l === undefined) return undefined\n const i = l.indexOf(needle, from)\n return i < 0 ? undefined : i + 1\n}\n","/** Container and CI files: Dockerfile `FROM`, GitHub `actions/setup-node`, GitLab `image:`. */\nimport { dockerTagConstraint } from '../../constraint'\nimport { parseDockerfile, parseGitlabCi, parseWorkflow, workflowSourcePaths } from '../shared'\nimport type { Constraint, Source } from '../../types'\nimport { isNodeImage, nodeConstraint, nodeSource } from './util'\n\n/** A tag with an unresolved variable, or a digest with no tag, is `unknown` (never guessed); otherwise Docker tag rules apply. */\nfunction tagConstraint(tag: string | undefined, digest?: string): Constraint {\n // A digest is immutable, so a digest-only reference is not floating; the version it holds is unknown.\n if (tag === undefined && digest !== undefined) return { kind: 'unknown', reason: 'pinned by digest, the version is not in the reference' }\n if (tag !== undefined && /\\$/.test(tag)) return { kind: 'unknown', reason: 'tag contains an unresolved variable' }\n return dockerTagConstraint(tag, 'node')\n}\n\n/**\n * Dockerfile: every `FROM` of a Node image, multi-stage included. A global `ARG` default that\n * fills the tag is substituted; the Source then points at the `ARG` value, the text a fix would\n * edit (listed once however many stages use it), while the constraint is read from the whole tag (`18.18.2-slim`, `22.17.0-bullseye-slim`).\n * A `FROM` of an earlier stage that happens to be named `node` is not an image.\n */\nexport function extractDockerfile(file: string, text: string): Source[] {\n const out: Source[] = []\n const stages = new Set<string>()\n // Several stages can read one ARG; that is one pin at one place, listed once.\n const seenArgs = new Set<string>()\n for (const from of parseDockerfile(text)) {\n // `FROM <stage>` never has a tag or digest; `FROM node:22` is always an image.\n const isStage = from.tag === undefined && from.digest === undefined && stages.has(from.image.toLowerCase())\n if (from.stage) stages.add(from.stage.toLowerCase())\n if (isStage || !isNodeImage(from.image)) continue\n const constraint = tagConstraint(from.tag, from.digest)\n if (from.arg) {\n const value = new RegExp(`\\\\b${from.arg.name}=([\"']?)([^\\\\s\"']*)`).exec(text.split(/\\r?\\n/)[from.arg.line - 1] ?? '')\n if (value) {\n const line = text.split(/\\r?\\n/)[from.arg.line - 1] as string\n const column = value.index + value[0].length - (value[2] as string).length + 1\n const key = `${from.arg.line}:${column}`\n if (!seenArgs.has(key)) {\n seenArgs.add(key)\n out.push(nodeSource(file, 'dockerfile', from.arg.line, value[2] as string, constraint, { column: Math.min(column, line.length + 1) }))\n }\n continue\n }\n }\n const raw = from.tag ?? from.raw\n const column = from.tag !== undefined && !from.arg && from.raw.startsWith(`${from.image}:`) ? from.column + from.image.length + 1 : from.column\n out.push(nodeSource(file, 'dockerfile', from.line, raw, constraint, { column }))\n }\n return out\n}\n\n/** `working-directory` as a project root relative to the repo: `./a/` becomes `a`; templates are left out. */\nfunction projectRoot(dir: string | undefined): string | undefined {\n if (dir === undefined || /\\$\\{\\{/.test(dir) || dir.startsWith('/')) return undefined\n const clean = dir.replace(/^(\\.\\/)+/, '').replace(/\\/+$/, '')\n return clean === '' ? '.' : clean\n}\n\n/**\n * GitHub workflows and composite actions: `node-version` of every `actions/setup-node` step. Each\n * value of a matrix it points to is its own matrix Source. `node-version-file` is a reference to\n * a file that is read on its own, not a pin. Only the step's own `working-directory` (or the\n * `defaults.run` one) scopes it; a job that works in a subdirectory elsewhere does not.\n */\nexport function extractWorkflow(file: string, text: string): Source[] {\n const out: Source[] = []\n for (const step of parseWorkflow(text)) {\n if (!/^actions\\/setup-node(@|$)/i.test(step.uses)) continue\n const input = step.with['node-version']\n if (!input) continue\n const dir = projectRoot(step.workingDirectory)\n const paths = workflowSourcePaths(step)\n const base = dir === undefined ? { paths } : { workingDirectory: dir, paths }\n const ref = /^\\$\\{\\{\\s*matrix\\.([A-Za-z0-9_-]+)\\s*\\}\\}$/.exec(input.value.trim())\n const m = input.resolved ?? (ref ? step.matrix[ref[1] as string] : undefined)\n if (m) {\n if (m.expression !== undefined || m.values.length === 0) {\n // The matrix is computed (fromJSON, ...): there is nothing static to read.\n out.push(nodeSource(file, 'setup-node', input.line, input.value, { kind: 'unknown', reason: 'matrix is computed by an expression' }, { ...base, matrix: true, column: input.column }))\n continue\n }\n m.values.forEach((value, i) => {\n out.push(nodeSource(file, 'setup-node', m.lines[i] as number, value, nodeConstraint(value), { ...base, matrix: true, column: m.columns[i] as number }))\n })\n continue\n }\n // `${{ env.X }}` resolved from an `env:` of the step, job or workflow: the constraint is the env value,\n // the source still points at the `with:` input as written (docs/TASKS.md A12).\n out.push(nodeSource(file, 'setup-node', input.line, input.value, nodeConstraint(input.env?.value ?? input.value), { ...base, column: input.column }))\n }\n return out\n}\n\n/** `.gitlab-ci.yml`: every `image:` of a Node image; a `${VAR}` tag is `unknown`, not a crash. */\nexport function extractGitlabCi(file: string, text: string): Source[] {\n const out: Source[] = []\n for (const img of parseGitlabCi(text)) {\n if (!isNodeImage(img.image)) continue\n const constraint = tagConstraint(img.tag, img.digest)\n const raw = img.tag ?? img.raw\n const column = img.tag !== undefined && img.raw.startsWith(`${img.image}:`) ? img.column + img.image.length + 1 : img.column\n out.push(nodeSource(file, 'gitlab-ci', img.line, raw, constraint, { column }))\n }\n return out\n}\n","/** `package.json`: `engines.node`, `volta.node` and `devEngines.runtime` (name `node`). */\nimport type { Source } from '../../types'\nimport { nodeConstraint, nodeSource } from './util'\n\nfunction isObject(v: unknown): v is Record<string, unknown> {\n return typeof v === 'object' && v !== null && !Array.isArray(v)\n}\n\nfunction position(text: string, offset: number): { line: number; column: number } {\n const before = text.slice(0, offset)\n const line = before.split('\\n').length\n return { line, column: offset - (before.lastIndexOf('\\n') + 1) + 1 }\n}\n\n/** Offset of the first `\"key\": ` after `from` whose value is the string `raw`; the value's first character. */\nfunction findValue(text: string, from: number, key: string, raw: string, within?: { start: number; end: number }): number | undefined {\n const re = new RegExp(`\"${key.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}\"\\\\s*:\\\\s*\"`, 'g')\n re.lastIndex = from\n const escaped = JSON.stringify(raw).slice(1, -1)\n for (let m = re.exec(text); m; m = re.exec(text)) {\n const at = m.index + m[0].length\n if (within && at > within.end) return undefined\n if (text.startsWith(escaped, at) && text[at + escaped.length] === '\"') return at\n }\n return undefined\n}\n\n/** Offset of the `{` that opens the object value of top-level-ish key `key` (first match), or undefined. */\nfunction objectStart(text: string, key: string): number | undefined {\n const m = new RegExp(`\"${key}\"\\\\s*:\\\\s*[\\\\[{]`).exec(text)\n return m ? m.index : undefined\n}\n\nexport function extractPackageJson(file: string, text: string): Source[] {\n let json: unknown\n try {\n json = JSON.parse(text)\n } catch {\n return []\n }\n if (!isObject(json)) return []\n const out: Source[] = []\n\n const add = (kind: string, parentKey: string, key: string, value: unknown, near?: (at: number) => boolean): void => {\n const parent = objectStart(text, parentKey) ?? 0\n if (typeof value === 'string') {\n let at = findValue(text, parent, key, value)\n if (near) {\n // devEngines: pick the match that sits inside the object whose name is node.\n let from = parent\n for (let n = 0; n < 50; n++) {\n at = findValue(text, from, key, value)\n if (at === undefined || near(at)) break\n from = at\n }\n }\n const pos = position(text, at ?? parent)\n out.push(nodeSource(file, kind, pos.line, value, nodeConstraint(value), at === undefined ? {} : { column: pos.column }))\n } else {\n const pos = position(text, parent)\n out.push(nodeSource(file, kind, pos.line, JSON.stringify(value), { kind: 'unknown', reason: 'expected a string' }))\n }\n }\n\n const engines = json.engines\n if (isObject(engines) && engines.node !== undefined) add('engines', 'engines', 'node', engines.node)\n\n const volta = json.volta\n if (isObject(volta) && volta.node !== undefined) add('volta', 'volta', 'node', volta.node)\n\n const dev = json.devEngines\n if (isObject(dev) && dev.runtime !== undefined) {\n const runtimes = Array.isArray(dev.runtime) ? dev.runtime : [dev.runtime]\n for (const rt of runtimes) {\n if (!isObject(rt) || rt.name !== 'node' || rt.version === undefined) continue\n const inNodeObject = (at: number): boolean => {\n const open = text.lastIndexOf('{', at)\n const close = text.indexOf('}', at)\n return /\"name\"\\s*:\\s*\"node\"/.test(text.slice(open, close < 0 ? undefined : close))\n }\n add('dev-engines', 'devEngines', 'version', rt.version, inNodeObject)\n }\n }\n return out\n}\n","/**\n * Plain version files: `.nvmrc`, `.node-version`, `.tool-versions` (`nodejs`) and mise (`node`).\n */\nimport { parseMise, parseToolVersions } from '../shared'\nimport type { Source } from '../../types'\nimport { columnOf, nodeConstraint, nodeSource } from './util'\n\n/** `.nvmrc` / `.node-version`: the first line that is not blank or a comment holds the version. */\nexport function extractVersionFile(file: string, text: string, kind: 'nvmrc' | 'node-version'): Source[] {\n const lines = text.split(/\\r?\\n/)\n for (let i = 0; i < lines.length; i++) {\n const raw = (lines[i] as string).trim()\n if (raw === '' || raw.startsWith('#')) continue\n const column = (lines[i] as string).indexOf(raw) + 1\n return [nodeSource(file, kind, i + 1, raw, nodeConstraint(raw), { column })]\n }\n return []\n}\n\n/**\n * `.tool-versions`: the `nodejs` (or `node`) line. asdf uses the first version on the line and\n * keeps the rest as fallbacks, so only the first is a pin. A line naming the tool with no version\n * is a recognised field with nothing to read: `unknown`.\n */\nexport function extractToolVersions(file: string, text: string): Source[] {\n const out: Source[] = []\n for (const entry of parseToolVersions(text)) {\n if (entry.tool !== 'nodejs' && entry.tool !== 'node') continue\n const raw = entry.versions[0]\n if (raw === undefined) {\n out.push(nodeSource(file, 'tool-versions', entry.line, entry.tool, { kind: 'unknown', reason: 'no version on the line' }))\n continue\n }\n const column = columnOf(text, entry.line, raw, (text.split(/\\r?\\n/)[entry.line - 1] ?? '').indexOf(entry.tool) + entry.tool.length)\n out.push(nodeSource(file, 'tool-versions', entry.line, raw, nodeConstraint(raw), column === undefined ? {} : { column }))\n }\n return out\n}\n\n/** Column of `raw` itself: the TOML value token starts at a quote, `[` or `{`, one or more characters before it. */\nfunction miseColumn(text: string, line: number, valueColumn: number | undefined, raw: string): { column?: number } {\n if (valueColumn === undefined) return {}\n const l = text.split(/\\r?\\n/)[line - 1] ?? ''\n let from = valueColumn - 1\n if (l[from] === '{') from += Math.max(l.slice(from).search(/\\bversion\\b/), 0)\n const column = columnOf(text, line, raw, from)\n return column === undefined ? {} : { column }\n}\n\n/**\n * mise `[tools]`: `node` (also `nodejs`, `core:node`). An array lists several installed versions,\n * the first is the active one. A tool with no readable version is not a pin and is skipped.\n */\nexport function extractMise(file: string, text: string): Source[] {\n const out: Source[] = []\n for (const tool of parseMise(text)) {\n if (!['node', 'nodejs', 'core:node'].includes(tool.tool)) continue\n const raw = tool.versions[0]\n if (raw === undefined) continue\n out.push(nodeSource(file, 'mise', tool.line, raw, nodeConstraint(raw), miseColumn(text, tool.line, tool.column, raw)))\n }\n return out\n}\n","/**\n * Node pins (docs/TASKS.md, Extractors and A8): `extractNode(file, text)` reads one file and\n * returns every Node version it pins, or [] for a file it does not handle. Pure; never throws.\n */\nimport type { Source } from '../../types'\nimport { extractDockerfile, extractGitlabCi, extractWorkflow } from './ci'\nimport { extractPackageJson } from './package-json'\nimport { extractMise, extractToolVersions, extractVersionFile } from './version-files'\n\nconst WORKFLOW = /(^|\\/)\\.github\\/(workflows\\/[^/]+|actions\\/.+\\/action)\\.ya?ml$/i\nconst ACTION = /(^|\\/)action\\.ya?ml$/i\nconst GITLAB = /(^|\\/)\\.gitlab-ci\\.ya?ml$/i\nconst MISE = /(^|\\/)(\\.?mise(\\.[\\w-]+)?\\.toml|\\.config\\/mise(\\/config)?\\.toml|mise\\/config\\.toml)$/i\nconst DOCKERFILE = /^(Dockerfile(\\..+)?|.+\\.Dockerfile)$/i\n/** `Dockerfile.md` and friends are documents about a Dockerfile, not one. */\nconst NOT_DOCKERFILE = /\\.(md|markdown|txt|rst|json|ya?ml|toml|sh|bak|orig)$/i\n\n/** The Node pins in one file. `file` is repo-relative with '/' separators. */\nexport function extractNode(file: string, text: string): Source[] {\n try {\n const base = file.slice(file.lastIndexOf('/') + 1)\n if (base === '.nvmrc') return extractVersionFile(file, text, 'nvmrc')\n if (base === '.node-version') return extractVersionFile(file, text, 'node-version')\n if (base === 'package.json') return extractPackageJson(file, text)\n if (base === '.tool-versions') return extractToolVersions(file, text)\n if (MISE.test(file)) return extractMise(file, text)\n if (DOCKERFILE.test(base) && !NOT_DOCKERFILE.test(base)) return extractDockerfile(file, text)\n if (GITLAB.test(file)) return extractGitlabCi(file, text)\n if (WORKFLOW.test(file) || ACTION.test(file)) return extractWorkflow(file, text)\n return []\n } catch {\n return []\n }\n}\n","/** Python-specific single-purpose files: `.python-version`, `pyproject.toml`, `runtime.txt`. */\nimport { parseConstraint } from '../../constraint'\nimport type { Source } from '../../types'\nimport { locateTomlKey, parseToml } from '../shared'\n\n/**\n * `.python-version`: one source per non-comment line (pyenv reads several versions; every one is a\n * pin the repo declares). A line that is not a version (`pypy3.10-7.3.15`, `miniconda3-latest`)\n * becomes an `unknown` source.\n */\nexport function pythonVersionFile(file: string, text: string): Source[] {\n const out: Source[] = []\n text.split(/\\r?\\n/).forEach((line, i) => {\n const body = line.replace(/(^|\\s)#.*$/, '').trim()\n if (body === '') return\n out.push({\n runtime: 'python',\n file,\n line: i + 1,\n column: line.indexOf(body) + 1,\n raw: body,\n kind: 'python-version',\n constraint: parseConstraint(body, 'python'),\n })\n })\n return out\n}\n\n/** `runtime.txt` (Heroku): `python-3.7.6`. Only a first line that starts with `python-` is a Python pin. */\nexport function runtimeTxtSources(file: string, text: string): Source[] {\n const lines = text.split(/\\r?\\n/)\n const index = lines.findIndex((l) => l.trim() !== '')\n if (index < 0) return []\n const body = (lines[index] as string).trim()\n if (!/^python-/i.test(body)) return []\n return [\n {\n runtime: 'python',\n file,\n line: index + 1,\n column: (lines[index] as string).indexOf(body) + 1,\n raw: body,\n kind: 'runtime-txt',\n constraint: parseConstraint(body, 'python'),\n },\n ]\n}\n\n/**\n * Finds a key that `locateTomlKey` cannot (an inline table such as `project = { requires-python = \">=3.9\" }`):\n * the line holding `key = \"value\"`, else the line of the table's own key, else line 1.\n */\nfunction fallbackLocation(text: string, key: string, tableKey: string): { line: number; column: number; raw: string } {\n const lines = text.split(/\\r?\\n/)\n const escaped = key.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n const re = new RegExp(`(^|[\\\\s{,])\"?${escaped}\"?\\\\s*=\\\\s*([\"'])`)\n for (let i = 0; i < lines.length; i++) {\n const m = re.exec(lines[i] as string)\n if (m) {\n const column = (m.index as number) + (m[0] as string).length + 1\n return { line: i + 1, column, raw: (lines[i] as string).slice(column - 1) }\n }\n }\n const owner = locateTomlKey(text, [], tableKey)\n return { line: owner?.line ?? 1, column: owner?.column ?? 1, raw: '' }\n}\n\nfunction tomlString(raw: string): { text: string; quoted: boolean } | undefined {\n const m = /^([\"'])(.*)\\1$/.exec(raw.trim())\n return m ? { text: m[2] as string, quoted: true } : undefined\n}\n\n/**\n * `pyproject.toml`: `project.requires-python` (PEP 440) and Poetry's `tool.poetry.dependencies.python`.\n * A file that is not valid TOML gives no sources: the syntax error is reported once, as a\n * diagnostic, by `diagnoseFile`.\n */\nexport function pyprojectSources(file: string, text: string): Source[] {\n const data = parseToml(text)\n // A file that is not valid TOML has no readable fields: `diagnoseFile` reports the syntax error and\n // nothing is guessed from the text (a second, partial report would contradict it).\n if (data === undefined) return []\n const out: Source[] = []\n const fields: { table: string[]; key: string; kind: string; value: unknown }[] = [\n { table: ['project'], key: 'requires-python', kind: 'requires-python', value: (data?.project as Record<string, unknown> | undefined)?.['requires-python'] },\n {\n table: ['tool', 'poetry', 'dependencies'],\n key: 'python',\n kind: 'poetry-python',\n value: ((data?.tool as Record<string, unknown> | undefined)?.poetry as Record<string, unknown> | undefined)?.dependencies\n ? (((data?.tool as Record<string, unknown>).poetry as Record<string, unknown>).dependencies as Record<string, unknown>).python\n : undefined,\n },\n ]\n for (const f of fields) {\n if (f.value === undefined) continue\n const located = locateTomlKey(text, f.table, f.key)\n const where = located ?? fallbackLocation(text, f.key, f.table[0] as string)\n if (!where) continue\n const written = tomlString(where.raw)\n const raw = written ? written.text : where.raw\n const column = located ? where.column + (written ? 1 : 0) : where.column\n const base = { runtime: 'python', file, line: where.line, column, raw, kind: f.kind } as const\n if (typeof f.value !== 'string') {\n out.push({ ...base, constraint: { kind: 'unknown', reason: `${f.table.join('.')}.${f.key} is not a plain string` } })\n } else {\n out.push({ ...base, raw: f.value, constraint: parseConstraint(f.value, 'python') })\n }\n }\n return out\n}\n","/**\n * Python version pins (docs/TASKS.md, Extractors): `.python-version`, `pyproject.toml`\n * (`project.requires-python`, Poetry `tool.poetry.dependencies.python`), `.tool-versions`\n * (`python`), `mise.toml`, `Dockerfile*` (`FROM python:`), `actions/setup-python`, `runtime.txt`.\n * Not read in v1: `Pipfile`, `setup.py`/`setup.cfg`, `tox.ini`, and actions other than\n * `actions/setup-python` (for example `astral-sh/setup-uv`).\n */\nimport type { Source } from '../../types'\nimport { baseName, dockerfileSources, gitlabSources, isGitlabCi, guardColumns, isDockerfile, isMiseFile, isToolVersions, isWorkflowFile, miseSources, toolVersionsSources, workflowSources } from './adapters'\nimport { pythonVersionFile, pyprojectSources, runtimeTxtSources } from './files'\n\nfunction dispatch(file: string, text: string): Source[] {\n const name = baseName(file)\n if (name === '.python-version') return pythonVersionFile(file, text)\n if (name === 'pyproject.toml') return pyprojectSources(file, text)\n if (name === 'runtime.txt') return runtimeTxtSources(file, text)\n if (isToolVersions(file)) return toolVersionsSources(file, text, 'python', ['python'])\n if (isMiseFile(file)) return miseSources(file, text, 'python', ['python'])\n if (isDockerfile(file)) return dockerfileSources(file, text, 'python')\n if (isGitlabCi(file)) return gitlabSources(file, text, 'python')\n if (isWorkflowFile(file)) return workflowSources(file, text, 'python', 'actions/setup-python', 'python-version')\n return []\n}\n\n/**\n * Extracts the Python pins of one file. Returns [] for files it does not handle. Pure; never throws.\n *\n * @param file - Repo-relative path with `/` separators.\n * @param text - The file's content.\n */\nexport function extractPython(file: string, text: string): Source[] {\n try {\n return guardColumns(text, dispatch(file, text))\n } catch {\n return []\n }\n}\n","/**\n * `--fix` (docs/TASKS.md, CLI, constraint 10): move pins to one version without damaging anything else.\n *\n * Pure: no file access. The caller reads the files, calls `planFix`, then writes `plan.files` (or\n * prints `unifiedDiff` for `--dry-run`). Four rules keep the edit safe:\n *\n * 1. A source is rewritten only when its syntax is fully understood: an exact or partial version\n * (any precision) and, with `fixRanges`, a range. Matrix entries, aliases, unreadable values,\n * Docker references pinned by digest, files that hold several versions on purpose, lockfiles and\n * sources whose `line`/`column` do not point at `raw` are never touched; each is reported in\n * `plan.skipped` with the reason. Nothing is guessed.\n * 2. Only the bytes of `raw` change. Everything else, including line endings, a byte-order mark and\n * a missing final newline, stays as it was.\n * 3. Each rewritten file is read again with the extractors: every edited source must now read as the\n * new value at the same place and every other source must be unchanged. If not, that file is left\n * alone (`reread`).\n * 4. A range that already allows the whole target is left as it is; rewriting it would only narrow it.\n */\nimport semver from 'semver'\nimport { parseConstraint, toRange } from './constraint'\nimport { extractGo } from './extract/go/index'\nimport { extractNode } from './extract/node/index'\nimport { extractPython } from './extract/python/index'\nimport type { Constraint, Runtime, Source } from './types'\n\n/** Why a source was not rewritten. */\nexport type SkipReason =\n | 'matrix' // a CI matrix entry is a deliberate multi-version test\n | 'alias' // `lts/*`, `latest`, an image variant: no version to move\n | 'unparseable' // the extractor could not read the value\n | 'range' // a range, and `--fix-ranges` was not given\n | 'range-allows-target' // the range already allows the whole target\n | 'digest' // a Docker reference pinned by `@sha256:...`: a new tag would no longer match it\n | 'syntax' // the new text would be invalid where the old one is written (an unquoted YAML value starting with `>`)\n | 'multi-version-file' // several versions in one version file, on purpose\n | 'precision' // `--to` has fewer parts than this pin needs\n | 'no-column' // the extractor gave no column, so the position is unknown\n | 'raw-not-at-column' // the text at line:column is not `raw` (stale or wrong source)\n | 'lockfile' // lockfiles are never edited\n | 'file-unreadable' // the caller did not supply this file's text\n | 'conflict' // two sources want different values for the same bytes\n | 'reread' // the rewritten file did not read back as expected\n\n/** One source that was left alone, with the reason. */\nexport interface SkippedSource {\n source: Source\n reason: SkipReason\n /** A sentence for the user. */\n detail: string\n}\n\n/** One replacement of `raw` by a new version text, at a known place. */\nexport interface FixEdit {\n file: string\n /** 1-based line of the value. */\n line: number\n /** 1-based column of the value (UTF-16 units from the start of the line). */\n column: number\n /** The text now at that place. */\n from: string\n /** The text to put there. */\n to: string\n /** The sources this edit moves (more than one when several share the same bytes). */\n sources: Source[]\n}\n\n/** What `planFix` decided. */\nexport interface FixPlan {\n /** The target as given. */\n target: string\n edits: FixEdit[]\n /** Sources already at the target: nothing to do. */\n unchanged: Source[]\n skipped: SkippedSource[]\n /** The new text of every file that changes (only files with at least one edit). */\n files: Map<string, string>\n}\n\n/** Options of `planFix`. */\nexport interface FixOptions {\n /** Every pin found in the repo (from the extractors). */\n sources: readonly Source[]\n /** The current text of each file named by a source, keyed by the same repo-relative path. */\n files: ReadonlyMap<string, string>\n /** The version to move to: `24` or `24.1.0` (exact or partial; never a range or an alias). */\n to: string\n /** Fix only this runtime. Needed when pins of more than one runtime could be fixed. */\n runtime?: Runtime\n /** Also rewrite range sources, to `>=<unit of --to>`. Default false. */\n fixRanges?: boolean\n}\n\n/** Thrown for a request that cannot be carried out; the CLI prints the message and exits 2. */\nexport class FixError extends Error {\n override name = 'FixError'\n}\n\nconst LOCKFILES = new Set([\n 'package-lock.json',\n 'npm-shrinkwrap.json',\n 'yarn.lock',\n 'pnpm-lock.yaml',\n 'bun.lock',\n 'bun.lockb',\n 'poetry.lock',\n 'uv.lock',\n 'pdm.lock',\n 'Pipfile.lock',\n 'go.sum',\n 'go.work.sum',\n])\n\n/** True for a lockfile (never edited). */\nexport function isLockfile(file: string): boolean {\n const base = file.slice(file.lastIndexOf('/') + 1)\n return LOCKFILES.has(base) || /\\.lock$|-lock\\.(json|ya?ml)$/i.test(base)\n}\n\n/**\n * Version files that list several versions on purpose (pyenv reads every line of `.python-version`).\n * Moving each line to one version would produce duplicates, so such a file is left alone.\n */\nconst MULTI_VERSION_KINDS = new Set(['python-version', 'nvmrc', 'node-version'])\n\n/** `prefix` + version tokens + `suffix` of a pin text, e.g. `v` `22.22.3` ``, `` `18.18.2` `-slim`. */\ninterface Shape {\n prefix: string\n /** Numeric tokens, e.g. ['22', '11'] for `22.11.x`. */\n numbers: string[]\n /** The wildcard tail kept as written, e.g. `.x` in `22.x`; '' when none. */\n wildcard: string\n suffix: string\n}\n\nconst SHAPE = /^([A-Za-z-]*)(\\d+(?:\\.\\d+){0,2})(\\.[xX*])?(.*)$/s\n\nfunction shapeOf(raw: string): Shape | undefined {\n const m = SHAPE.exec(raw)\n if (!m) return undefined\n return { prefix: m[1] as string, numbers: (m[2] as string).split('.'), wildcard: m[3] ?? '', suffix: m[4] as string }\n}\n\n/** The parts of the target as numbers text: `24.1.0` -> ['24', '1', '0']. */\nfunction targetParts(to: Constraint): string[] {\n return to.kind === 'exact' || to.kind === 'partial' ? to.version.split('.') : []\n}\n\n/**\n * The new text for one exact/partial pin: its own prefix, suffix and wildcard kept, its version\n * rewritten to as many parts of the target as it had. Undefined when the target has fewer parts.\n */\nfunction restyle(raw: string, target: string[]): string | undefined {\n const shape = shapeOf(raw)\n if (!shape || shape.numbers.length > target.length) return undefined\n return `${shape.prefix}${target.slice(0, shape.numbers.length).join('.')}${shape.wildcard}${shape.suffix}`\n}\n\n/** `>=` plus the unit a range is moved to: the major for Node, major.minor for Python and Go. */\nfunction rangeText(runtime: Runtime, target: string[]): string | undefined {\n const parts = runtime === 'node' ? 1 : 2\n return target.length < parts ? undefined : `>=${target.slice(0, parts).join('.')}`\n}\n\n/** Why an unquoted YAML value with this text would not read as written, or undefined when it is safe. */\nfunction yamlHazard(text: string): string | undefined {\n if (text.startsWith('>') || text.startsWith('|')) return 'cannot start with \">\" or \"|\" in unquoted YAML (it opens a block scalar)'\n // A plain number is read as a number: `3.10` becomes 3.1 and loses its zero.\n if (/^\\d+\\.\\d+$/.test(text) && String(Number(text)) !== text) return `would be read by YAML as the number ${Number(text)}`\n return undefined\n}\n\ntype Decision = { edit: string } | { same: true } | { skip: SkipReason; detail: string }\n\nfunction decide(source: Source, to: Constraint, target: string[], toText: string, fixRanges: boolean): Decision {\n if (source.matrix === true) {\n return { skip: 'matrix', detail: 'a CI matrix entry is a deliberate multi-version test; edit it by hand' }\n }\n const c = source.constraint\n switch (c.kind) {\n case 'alias':\n return { skip: 'alias', detail: `\"${source.raw}\" names no fixed version` }\n case 'unknown':\n return { skip: 'unparseable', detail: `the value could not be read (${c.reason})` }\n case 'exact':\n case 'partial': {\n const next = restyle(source.raw, target)\n if (next === undefined) {\n const need = c.kind === 'exact' ? 'a full version such as 24.1.0' : 'major.minor such as 24.1'\n return { skip: 'precision', detail: `\"${source.raw}\" needs --to to be ${need}` }\n }\n // An exact pin needs the full target; a 1-part --to cannot make one (restyle returned undefined).\n return next === source.raw ? { same: true } : { edit: next }\n }\n case 'range': {\n if (!fixRanges) return { skip: 'range', detail: `\"${source.raw}\" is a range; pass --fix-ranges to rewrite it` }\n const targetRange = toRange(to)\n if (targetRange !== undefined && semver.subset(targetRange, c.range)) {\n return { skip: 'range-allows-target', detail: `\"${source.raw}\" already allows ${toText}` }\n }\n // The go.mod directive is a bare minimum version, not a range expression.\n const text = source.kind === 'go-mod' ? restyle(source.raw, target) : rangeText(source.runtime, target)\n if (text === undefined) {\n return { skip: 'precision', detail: `\"${source.raw}\" needs --to to have more parts (for example 1.27)` }\n }\n return text === source.raw ? { same: true } : { edit: text }\n }\n }\n}\n\n/** Start offset of every line (lines end at '\\n'; a '\\r' before it stays part of the line). */\nfunction lineStarts(text: string): number[] {\n const starts = [0]\n for (let i = 0; i < text.length; i++) if (text.charCodeAt(i) === 10) starts.push(i + 1)\n return starts\n}\n\n/** Offset of `line`:`column` in `text`, or undefined when the position does not exist. */\nfunction offsetOf(starts: readonly number[], text: string, line: number, column: number): number | undefined {\n const start = starts[line - 1]\n if (start === undefined || column < 1) return undefined\n const end = line < starts.length ? (starts[line] as number) - 1 : text.length\n const at = start + column - 1\n return at <= end ? at : undefined\n}\n\nfunction extractAll(file: string, text: string): Source[] {\n return [...extractNode(file, text), ...extractPython(file, text), ...extractGo(file, text)]\n}\n\nconst keyOf = (s: { file: string; line: number; column?: number | undefined; kind: string; runtime: string }): string =>\n `${s.file}\\0${s.line}\\0${s.column ?? ''}\\0${s.kind}\\0${s.runtime}`\n\n/**\n * Applies edits to one file's text. Only the replaced bytes change.\n *\n * @param text - The file as it is now.\n * @param edits - Edits for this file; their positions refer to `text`.\n * @throws RangeError when an edit's position does not hold its `from` text, or two edits overlap.\n */\nexport function applyEdits(text: string, edits: readonly Pick<FixEdit, 'line' | 'column' | 'from' | 'to'>[]): string {\n const starts = lineStarts(text)\n const placed = edits\n .map((e) => {\n const at = offsetOf(starts, text, e.line, e.column)\n if (at === undefined || !text.startsWith(e.from, at) || e.from.includes('\\n')) {\n throw new RangeError(`line ${e.line}, column ${e.column} does not hold \"${e.from}\"`)\n }\n return { at, e }\n })\n .sort((a, b) => a.at - b.at)\n for (let i = 1; i < placed.length; i++) {\n const before = placed[i - 1] as (typeof placed)[number]\n if (before.at + before.e.from.length > (placed[i] as (typeof placed)[number]).at) {\n throw new RangeError(`edits at line ${before.e.line} overlap`)\n }\n }\n let out = ''\n let cursor = 0\n for (const { at, e } of placed) {\n out += text.slice(cursor, at) + e.to\n cursor = at + e.from.length\n }\n return out + text.slice(cursor)\n}\n\n/** True when the string is not a version the fixer can move to. */\nfunction parseTarget(to: string): { constraint: Constraint; parts: string[] } {\n const constraint = parseConstraint(to.trim(), 'node')\n const parts = targetParts(constraint)\n if (parts.length === 0) {\n throw new FixError(`--to must be a version such as 24 or 24.1.0, got \"${to}\"`)\n }\n return { constraint, parts }\n}\n\n/**\n * Plans the rewrite of every pin to `options.to`. Nothing is written; see the module comment for\n * what is rewritten and what is skipped.\n *\n * @param options - The pins, the file texts, the target and the switches.\n * @returns The edits, the pins already at the target, the skipped pins with reasons, and the new\n * text of every changed file.\n * @throws FixError when `to` is not a version, or pins of several runtimes could be fixed and no\n * `runtime` was given.\n */\nexport function planFix(options: FixOptions): FixPlan {\n const { constraint: to, parts } = parseTarget(options.to)\n const toText = options.to.trim()\n const fixRanges = options.fixRanges === true\n const considered = options.sources.filter((s) => options.runtime === undefined || s.runtime === options.runtime)\n\n const skipped: SkippedSource[] = []\n const skip = (source: Source, reason: SkipReason, detail: string): void => {\n skipped.push({ source, reason, detail })\n }\n\n // Which runtimes have something this run could change? Several means --to is ambiguous.\n if (options.runtime === undefined) {\n const fixable = new Set(\n considered\n .filter((s) => s.matrix !== true && (s.constraint.kind === 'exact' || s.constraint.kind === 'partial' || (fixRanges && s.constraint.kind === 'range')))\n .map((s) => s.runtime),\n )\n if (fixable.size > 1) {\n throw new FixError(`pins of several runtimes (${[...fixable].sort().join(', ')}) could be fixed: --to ${toText} cannot fit all of them; pass --runtime <one>`)\n }\n }\n\n // How many version sources does each multi-version-capable file hold?\n const perFile = new Map<string, number>()\n for (const s of considered) perFile.set(`${s.file}\\0${s.kind}`, (perFile.get(`${s.file}\\0${s.kind}`) ?? 0) + 1)\n\n const unchanged: Source[] = []\n const wanted = new Map<string, { source: Source; to: string; sources: Source[] }>()\n const textStarts = new Map<string, number[]>()\n\n for (const source of considered) {\n if (isLockfile(source.file)) {\n skip(source, 'lockfile', 'lockfiles are never edited')\n continue\n }\n const text = options.files.get(source.file)\n if (text === undefined) {\n skip(source, 'file-unreadable', 'the file could not be read as UTF-8 text')\n continue\n }\n if (MULTI_VERSION_KINDS.has(source.kind) && (perFile.get(`${source.file}\\0${source.kind}`) ?? 0) > 1) {\n skip(source, 'multi-version-file', 'the file lists several versions on purpose; edit it by hand')\n continue\n }\n const decision = decide(source, to, parts, toText, fixRanges)\n if ('same' in decision) {\n unchanged.push(source)\n continue\n }\n if ('skip' in decision) {\n skip(source, decision.skip, decision.detail)\n continue\n }\n // The position must really hold `raw`; a source with no column or a stale one is never guessed.\n if (source.column === undefined) {\n skip(source, 'no-column', 'the extractor gave no column, so the exact position is unknown')\n continue\n }\n let starts = textStarts.get(source.file)\n if (!starts) {\n starts = lineStarts(text)\n textStarts.set(source.file, starts)\n }\n const at = offsetOf(starts, text, source.line, source.column)\n if (at === undefined || source.raw === '' || !text.startsWith(source.raw, at) || source.raw.includes('\\n')) {\n skip(source, 'raw-not-at-column', `\"${source.raw}\" is not at line ${source.line}, column ${source.column}`)\n continue\n }\n // A digest after the tag pins the exact image; a new tag with the old digest would not match.\n if (text.charAt(at + source.raw.length) === '@') {\n skip(source, 'digest', 'the reference is pinned by a digest (@sha256:...); a new version needs a new digest')\n continue\n }\n // Unquoted YAML does not always read as the text written: `>=24` opens a block scalar and `3.10`\n // is the number 3.1. Such a value must be quoted first; the edit would change its meaning.\n const quoted = text.charAt(at - 1) === '\"' || text.charAt(at - 1) === \"'\"\n if (/\\.ya?ml$/i.test(source.file) && !quoted) {\n const hazard = yamlHazard(decision.edit)\n if (hazard !== undefined) {\n skip(source, 'syntax', `\"${decision.edit}\" ${hazard}; quote the value first, then run --fix again`)\n continue\n }\n }\n const key = `${source.file}\\0${source.line}\\0${source.column}`\n const known = wanted.get(key)\n if (known === undefined) wanted.set(key, { source, to: decision.edit, sources: [source] })\n else if (known.to === decision.edit && known.source.raw === source.raw) known.sources.push(source)\n else {\n skip(source, 'conflict', 'two pins at the same place want different values')\n skip(known.source, 'conflict', 'two pins at the same place want different values')\n wanted.delete(key)\n }\n }\n\n // Group edits by file, verify each file by reading it again, then build the plan.\n const byFile = new Map<string, FixEdit[]>()\n for (const { source, to: next, sources } of wanted.values()) {\n const edit: FixEdit = { file: source.file, line: source.line, column: source.column as number, from: source.raw, to: next, sources }\n byFile.set(source.file, [...(byFile.get(source.file) ?? []), edit])\n }\n\n const edits: FixEdit[] = []\n const files = new Map<string, string>()\n for (const [file, fileEdits] of [...byFile].sort(([a], [b]) => a.localeCompare(b))) {\n const before = options.files.get(file) as string\n let after: string\n try {\n after = applyEdits(before, fileEdits)\n } catch (err) {\n for (const e of fileEdits) for (const s of e.sources) skip(s, 'conflict', (err as Error).message)\n continue\n }\n const problem = rereadProblem(file, before, after, fileEdits)\n if (problem !== undefined) {\n for (const e of fileEdits) for (const s of e.sources) skip(s, 'reread', problem)\n continue\n }\n edits.push(...fileEdits.sort((a, b) => a.line - b.line || a.column - b.column))\n files.set(file, after)\n }\n\n skipped.sort((a, b) => a.source.file.localeCompare(b.source.file) || a.source.line - b.source.line)\n return { target: toText, edits, unchanged, skipped, files }\n}\n\n/**\n * (Exported for tests.) Reads the rewritten file with the extractors and compares: edited sources show the new value at\n * the same place, every other source is identical, and no source appeared or disappeared.\n * Returns a sentence describing the first difference, or undefined when all is as expected.\n */\nexport function rereadProblem(file: string, before: string, after: string, edits: readonly FixEdit[]): string | undefined {\n const was = extractAll(file, before)\n const now = extractAll(file, after)\n if (was.length !== now.length) return `the file read as ${was.length} pins before and ${now.length} after the edit`\n const edited = new Map<string, FixEdit>()\n for (const e of edits) for (const s of e.sources) edited.set(keyOf(s), e)\n const nowByKey = new Map(now.map((s) => [keyOf(s), s] as const))\n for (const s of was) {\n const key = keyOf(s)\n const found = nowByKey.get(key)\n if (found === undefined) return `the pin at line ${s.line} was no longer found after the edit`\n const edit = edited.get(key)\n if (edit === undefined) {\n if (found.raw !== s.raw || found.constraint.kind !== s.constraint.kind) return `the pin at line ${s.line} changed although it was not edited`\n } else if (found.raw !== edit.to) {\n return `line ${s.line} reads as \"${found.raw}\" after the edit, not \"${edit.to}\"`\n } else if (found.constraint.kind !== s.constraint.kind) {\n // The text is as intended but the file no longer means a version there (for example YAML\n // reading an unquoted number differently).\n const why = found.constraint.kind === 'unknown' ? `: ${found.constraint.reason}` : ''\n return `line ${s.line} still reads \"${found.raw}\" after the edit, but no longer as a ${s.constraint.kind} version (now ${found.constraint.kind}${why})`\n }\n }\n return undefined\n}\n\n/** The UTF-8 byte-order mark as a character (3 bytes in the file). */\nexport const BOM = '\\uFEFF'\n\n/**\n * Splits off ONE leading byte-order mark (Windows editors write one), so the rest has the line and\n * column numbers an editor shows. A second BOM is not stripped: it is content, and is not guessed\n * away. `bom + body` is always the original text.\n */\nexport function splitBom(text: string): { bom: string; body: string } {\n return text.startsWith(BOM) ? { bom: BOM, body: text.slice(1) } : { bom: '', body: text }\n}\n\n/**\n * Decodes a file only when it survives a round trip through UTF-8, so writing it back cannot\n * change a byte outside the edits. Returns undefined for a file that is not valid UTF-8.\n */\nexport function exactUtf8(bytes: Buffer): string | undefined {\n const text = bytes.toString('utf8')\n return Buffer.from(text, 'utf8').equals(bytes) ? text : undefined\n}\n\n/** Lines of a text without the empty piece after a final newline, and whether it ended in one. */\nfunction linesOf(text: string): { lines: string[]; finalNewline: boolean } {\n const lines = text.split('\\n')\n const finalNewline = lines.length > 1 && lines[lines.length - 1] === ''\n if (finalNewline) lines.pop()\n return { lines, finalNewline }\n}\n\n/**\n * A unified diff (`diff -u` style, 3 lines of context) between two versions of one file that have\n * the same number of lines, which is true of every `--fix` edit (a value is replaced in place).\n *\n * @param file - Repo-relative path, shown as `a/<file>` and `b/<file>`.\n * @throws RangeError when the texts have a different number of lines.\n */\nexport function unifiedDiff(file: string, before: string, after: string, context = 3): string {\n const a = linesOf(before)\n const b = linesOf(after)\n if (a.lines.length !== b.lines.length) throw new RangeError('unifiedDiff compares texts with the same number of lines')\n const changed: number[] = []\n a.lines.forEach((line, i) => {\n if (line !== b.lines[i]) changed.push(i)\n })\n if (changed.length === 0) return ''\n\n // Group changes whose context would touch or overlap into one hunk.\n const groups: [number, number][] = []\n for (const i of changed) {\n const last = groups[groups.length - 1]\n if (last && i - last[1] <= 2 * context) last[1] = i\n else groups.push([i, i])\n }\n const noEol = '\\\'\n const out = [`--- a/${file}`, `+++ b/${file}`]\n const total = a.lines.length\n const range = (start: number, len: number): string => (len === 1 ? `${start}` : `${start},${len}`)\n for (const [first, lastChange] of groups) {\n const from = Math.max(0, first - context)\n const to = Math.min(total - 1, lastChange + context)\n const len = to - from + 1\n out.push(`@@ -${range(from + 1, len)} +${range(from + 1, len)} @@`)\n for (let i = from; i <= to; ) {\n if (a.lines[i] === b.lines[i]) {\n out.push(` ${a.lines[i] as string}`)\n if (i === total - 1 && !a.finalNewline) out.push(noEol)\n i++\n continue\n }\n // A run of changed lines: all the removed lines, then all the added ones, as diff -u prints them.\n let end = i\n while (end + 1 <= to && a.lines[end + 1] !== b.lines[end + 1]) end++\n const endsFile = end === total - 1 && !a.finalNewline\n for (let k = i; k <= end; k++) out.push(`-${a.lines[k] as string}`)\n if (endsFile) out.push(noEol)\n for (let k = i; k <= end; k++) out.push(`+${b.lines[k] as string}`)\n if (endsFile) out.push(noEol)\n i = end + 1\n }\n }\n return `${out.join('\\n')}\\n`\n}\n","/**\n * Output of the CLI: a plain-text report grouped by project root, a JSON document, and GitHub\n * Actions annotations. Pure functions over the findings; the CLI decides where they are written.\n */\nimport { describeConstraint, isFloatingAlias } from './constraint'\nimport type { AliasResolver, Diagnostic, Finding, Runtime, Severity, Source } from './types'\n\n/** Everything one check produced, as the report needs it. */\nexport interface CheckReport {\n /** The scanned directory as the user gave it. */\n directory: string\n /** `YYYY-MM-DD` the EOL checks and alias resolution used. */\n date: string\n /** `YYYY-MM-DD` the bundled EOL data was fetched. */\n dataDate: string\n roots: string[]\n sources: Source[]\n findings: Finding[]\n /** Scopes (root + runtime) with exactly one source: listed, never a finding (SINGLE_SOURCE). */\n singleSource: { root: string; runtime: Runtime; file: string; line: number; raw: string }[]\n /** Files skipped by the fixture rule or `--exclude` (docs/TASKS.md A10). */\n excludedFiles: number\n /** Files with a YAML/TOML/JSON syntax error: read as far as possible and reported, never silent. */\n diagnostics: Diagnostic[]\n /** Resolves `lts/*` style aliases on `date`, for explaining them in the report. */\n resolveAlias: AliasResolver\n}\n\nconst RANK: Record<Severity, number> = { error: 0, warning: 1, info: 2 }\n\n/** True when at least one finding is at or above `failOn` (the CLI's exit code 1 rule). */\nexport function failsAt(findings: readonly Finding[], failOn: Severity): boolean {\n return findings.some((f) => RANK[f.severity] <= RANK[failOn])\n}\n\n/** Counts of findings per severity. */\nexport function countBySeverity(findings: readonly Finding[]): Record<Severity, number> {\n const counts: Record<Severity, number> = { error: 0, warning: 0, info: 0 }\n for (const f of findings) counts[f.severity]++\n return counts\n}\n\n/** A semver range as people say it: `>=26.0.0 <27.0.0-0` → `26.x`, `>=3.12.0 <3.13.0-0` → `3.12.x`. */\nexport function humanRange(range: string): string {\n const major = /^>=(\\d+)\\.0\\.0 <(\\d+)\\.0\\.0-0$/.exec(range)\n if (major && Number(major[2]) === Number(major[1]) + 1) return `${major[1]}.x`\n const minor = /^>=(\\d+)\\.(\\d+)\\.0 <(\\d+)\\.(\\d+)\\.0-0$/.exec(range)\n if (minor && minor[1] === minor[3] && Number(minor[4]) === Number(minor[2]) + 1) return `${minor[1]}.${minor[2]}.x`\n return range\n}\n\n/**\n * Why an alias pin compared the way it did: `lts/*` on 2026-11-25 means Node 26.x. Aliases move\n * with new releases, so a pin that agreed last month can conflict today; the note makes that visible.\n */\nexport function aliasNote(runtime: Runtime, alias: string, date: string, resolve: AliasResolver): string | undefined {\n if (isFloatingAlias(alias)) return undefined\n const range = resolve(runtime, alias)\n if (!range) return undefined\n return `${alias} means ${runtime} ${humanRange(range)} on ${date}, per the bundled release data; it moves when a new line becomes LTS`\n}\n\nfunction scopeLabel(scopes: readonly string[], roots: readonly string[]): string {\n if (scopes.length === 0) return 'not tied to a project'\n if (roots.length > 1 && scopes.length === roots.length) return 'every project root'\n return scopes.map((s) => (s === '.' ? '. (repo root)' : s)).join(', ')\n}\n\nfunction pad(text: string, width: number): string {\n return text.length >= width ? `${text} ` : text + ' '.repeat(width - text.length)\n}\n\n/** Sources `bindSources` left UNBOUND (docs/TASKS.md A12), in file order. */\nexport function unboundSources(sources: readonly Source[]): Source[] {\n return sources\n .filter((s) => s.boundTo !== undefined && s.boundTo.length === 0)\n .sort((a, b) => (a.file === b.file ? a.line - b.line : a.file < b.file ? -1 : 1))\n}\n\n/** The human-readable report. Deterministic for a given input (no colours, no timings). */\nexport function formatText(report: CheckReport): string {\n const lines: string[] = []\n const counts = countBySeverity(report.findings)\n const pins = report.sources.length\n lines.push(\n `runtime-pin-check: ${pins} pin${pins === 1 ? '' : 's'} in ${report.roots.length} project root${report.roots.length === 1 ? '' : 's'}, ` +\n `checked on ${report.date} (end-of-life data from ${report.dataDate})`,\n )\n lines.push('')\n\n if (report.findings.length === 0) {\n lines.push(pins === 0 ? 'No Node, Python or Go version pins found.' : 'No problems found.')\n } else {\n const groups = new Map<string, Finding[]>()\n for (const f of report.findings) {\n const key = scopeLabel(f.scopes, report.roots)\n const list = groups.get(key)\n if (list) list.push(f)\n else groups.set(key, [f])\n }\n for (const [label, findings] of groups) {\n lines.push(label)\n for (const f of findings) {\n lines.push(` ${pad(f.severity, 8)}${pad(f.code, 19)}${f.runtime}`)\n lines.push(` ${f.message}`)\n const width = Math.max(...f.sources.map((s) => `${s.file}:${s.line}`.length)) + 2\n for (const s of f.sources) {\n lines.push(` ${pad(`${s.file}:${s.line}`, width)}${s.raw}`)\n if (s.constraint.kind === 'alias') {\n const note = aliasNote(f.runtime, s.constraint.alias, report.date, report.resolveAlias)\n if (note) lines.push(` ${' '.repeat(width)}(${note})`)\n }\n }\n }\n lines.push('')\n }\n if (lines[lines.length - 1] === '') lines.pop()\n }\n\n const unbound = unboundSources(report.sources)\n if (unbound.length > 0) {\n lines.push('')\n lines.push('Not tied to a project (no working-directory, no root manifest, no path naming a project; compared with nothing):')\n for (const s of unbound) lines.push(` ${s.runtime} ${s.raw} ${s.file}:${s.line}`)\n }\n\n if (report.singleSource.length > 0) {\n lines.push('')\n lines.push('Pinned in one place only (nothing to compare):')\n for (const s of report.singleSource) {\n lines.push(` ${s.root === '.' ? '. (repo root)' : s.root} ${s.runtime} ${s.raw} ${s.file}:${s.line}`)\n }\n }\n\n if (report.diagnostics.length > 0) {\n lines.push('')\n lines.push('Could not fully read (syntax errors; they do not change the exit code):')\n for (const d of report.diagnostics) lines.push(` ${d.file}:${d.line}${d.column === undefined ? '' : `:${d.column}`} ${d.message}`)\n }\n\n lines.push('')\n lines.push(`${counts.error} error${counts.error === 1 ? '' : 's'}, ${counts.warning} warning${counts.warning === 1 ? '' : 's'}, ${counts.info} info`)\n if (report.excludedFiles > 0) {\n const n = report.excludedFiles\n lines.push(`${n} file${n === 1 ? '' : 's'} skipped by exclusion (fixture folders and --exclude; --include-fixtures scans fixtures)`)\n }\n return `${lines.join('\\n')}\\n`\n}\n\n/** The `--json` document. Stable field names; `schema` changes only on a breaking change. */\nexport function formatJson(report: CheckReport): string {\n const counts = countBySeverity(report.findings)\n const doc = {\n schema: 1,\n directory: report.directory,\n date: report.date,\n eolDataDate: report.dataDate,\n roots: report.roots,\n summary: {\n ...counts,\n sources: report.sources.length,\n excludedFiles: report.excludedFiles,\n singleSource: report.singleSource,\n unbound: unboundSources(report.sources).map((s) => ({ runtime: s.runtime, file: s.file, line: s.line, raw: s.raw })),\n unreadable: report.diagnostics.length,\n },\n diagnostics: report.diagnostics,\n findings: report.findings.map((f) => ({\n ...f,\n sources: f.sources.map((s) => {\n const note = s.constraint.kind === 'alias' ? aliasNote(f.runtime, s.constraint.alias, report.date, report.resolveAlias) : undefined\n return note ? { ...s, note } : s\n }),\n })),\n sources: report.sources.map((s) => ({ ...s, constraintText: describeConstraint(s.constraint) })),\n }\n return `${JSON.stringify(doc, null, 2)}\\n`\n}\n\n/** Escapes text for a workflow command message (GitHub's rules for `%`, CR and LF). */\nfunction escapeData(text: string): string {\n return text.replace(/%/g, '%25').replace(/\\r/g, '%0D').replace(/\\n/g, '%0A')\n}\n\n/** Escapes a workflow command property value (also `:` and `,`). */\nfunction escapeProperty(text: string): string {\n return escapeData(text).replace(/:/g, '%3A').replace(/,/g, '%2C')\n}\n\nconst COMMAND: Record<Severity, string> = { error: 'error', warning: 'warning', info: 'notice' }\n\n/**\n * GitHub Actions annotations, one per finding, placed on its first source:\n * `::error file=.nvmrc,line=1,title=OUTSIDE_RANGE::…`. Info findings become `::notice`.\n *\n * @param pathOf - Maps a repo-relative path to the path GitHub expects (relative to the workspace).\n */\nexport function formatAnnotations(findings: readonly Finding[], pathOf: (file: string) => string = (f) => f): string {\n const lines = findings.map((f) => {\n const first = f.sources[0]\n const props = first ? `file=${escapeProperty(pathOf(first.file))},line=${first.line},title=${escapeProperty(f.code)}` : `title=${escapeProperty(f.code)}`\n return `::${COMMAND[f.severity]} ${props}::${escapeData(f.message)}`\n })\n return lines.length > 0 ? `${lines.join('\\n')}\\n` : ''\n}\n\n/**\n * One `::warning` per file that could not be fully read, on the line of its syntax error:\n * `::warning file=.github/workflows/ci.yml,line=12,col=5,title=UNREADABLE_FILE::YAML syntax error: …`.\n */\nexport function formatDiagnosticAnnotations(diagnostics: readonly Diagnostic[], pathOf: (file: string) => string = (f) => f): string {\n const lines = diagnostics.map((d) => {\n const col = d.column === undefined ? '' : `,col=${d.column}`\n return `::warning file=${escapeProperty(pathOf(d.file))},line=${d.line}${col},title=UNREADABLE_FILE::${escapeData(d.message)}`\n })\n return lines.length > 0 ? `${lines.join('\\n')}\\n` : ''\n}\n","{\n \"name\": \"runtime-pin-check\",\n \"version\": \"0.1.1\",\n \"description\": \"Find Node, Python and Go version pins that disagree across a repo's files, with file and line.\",\n \"license\": \"MIT\",\n \"type\": \"module\",\n \"engines\": {\n \"node\": \">=22\"\n },\n \"files\": [\n \"dist\"\n ],\n \"bin\": {\n \"runtime-pin-check\": \"dist/cli.js\"\n },\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"sideEffects\": false,\n \"scripts\": {\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run\",\n \"build\": \"tsup\",\n \"prepublishOnly\": \"npm run typecheck && npm test && npm run build\"\n },\n \"keywords\": [\n \"node-version\",\n \"nvmrc\",\n \"engines\",\n \"python-version\",\n \"go-version\",\n \"ci\",\n \"monorepo\"\n ],\n \"dependencies\": {\n \"semver\": \"7.7.2\",\n \"smol-toml\": \"1.9.1\",\n \"yaml\": \"2.9.1\"\n },\n \"devDependencies\": {\n \"@types/node\": \"22.20.5\",\n \"@types/semver\": \"7.7.0\",\n \"tsup\": \"8.5.0\",\n \"typescript\": \"5.9.3\",\n \"vitest\": \"3.2.4\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/Mammost1/runtime-pin-check.git\"\n },\n \"homepage\": \"https://github.com/Mammost1/runtime-pin-check#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/Mammost1/runtime-pin-check/issues\"\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAUA,SAAS,oBAAoB;AAC7B,SAAS,UAAU,MAAM,iBAAiB;AAC1C,SAAS,UAAU,SAAS,WAAW;AACvC,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;;;ACH1B,OAAO,YAAY;;;ACXnB;AAAA,EACE,QAAU;AAAA,EACV,WAAa;AAAA,EACb,aAAe;AAAA,EACf,SAAW;AAAA,IACT;AAAA,MACE,MAAQ;AAAA,MACR,KAAO;AAAA,MACP,SAAW;AAAA,MACX,WAAa;AAAA,MACb,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,KAAO;AAAA,MACP,SAAW;AAAA,MACX,WAAa;AAAA,MACb,SAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,UAAY;AAAA,IACV,MAAQ;AAAA,MACN;AAAA,QACE,OAAS;AAAA,QACT,SAAW;AAAA,QACX,SAAW;AAAA,QACX,QAAU;AAAA,QACV,UAAY;AAAA,MACd;AAAA,MACA;AAAA,QACE,OAAS;AAAA,QACT,SAAW;AAAA,QACX,SAAW;AAAA,QACX,QAAU;AAAA,QACV,UAAY;AAAA,MACd;AAAA,MACA;AAAA,QACE,OAAS;AAAA,QACT,SAAW;AAAA,QACX,SAAW;AAAA,QACX,QAAU;AAAA,QACV,UAAY;AAAA,MACd;AAAA,MACA;AAAA,QACE,OAAS;AAAA,QACT,SAAW;AAAA,QACX,SAAW;AAAA,QACX,QAAU;AAAA,QACV,UAAY;AAAA,MACd;AAAA,MACA;AAAA,QACE,OAAS;AAAA,QACT,SAAW;AAAA,QACX,SAAW;AAAA,QACX,QAAU;AAAA,QACV,UAAY;AAAA,MACd;AAAA,MACA;AAAA,QACE,OAA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text","text","text","text","text","text","column","ref","text","text","text","text","dispatch","text","semver","text","semver","resolve","text","list","RUNTIMES","RANK","list","text"]}
|