@titan-design/style-checker 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -5,6 +5,8 @@ import { Observation } from '@titan-design/style-analyzer';
5
5
  interface CheckDiagnostic {
6
6
  file: string;
7
7
  line: number;
8
+ /** Last line of the flagged range, when the tool reports one. */
9
+ endLine?: number;
8
10
  column: number;
9
11
  severity: Exclude<Severity, "off">;
10
12
  message: string;
@@ -82,9 +84,30 @@ interface RuffConfig {
82
84
  };
83
85
  };
84
86
  "line-length"?: number;
87
+ preview?: boolean;
85
88
  }
86
89
  declare function generateRuffConfig(profile: Profile): RuffConfig;
87
90
 
91
+ /** The audit's pinned ruff selection: complexity, size, dead code, and defensive-bloat signals. */
92
+ declare const AUDIT_RUFF_RULES: readonly string[];
93
+ /** Preview is on because ruff 0.16.8 silently skips PLR0904, PLR0914, PLR0916 and PLR1702 without it. */
94
+ declare function generateRuffAuditConfig(): RuffConfig;
95
+
96
+ interface RunnerResult {
97
+ diagnostics: CheckDiagnostic[];
98
+ exitCode: number | null;
99
+ failures: ToolFailure[];
100
+ skippedRules: SkippedRule[];
101
+ }
102
+ interface RunnerOptions {
103
+ fix?: boolean;
104
+ cwd?: string;
105
+ timeout?: number;
106
+ }
107
+
108
+ /** Runs the pinned audit rule set; diagnostics carry paths relative to `cwd`, since ruff reports absolute ones. */
109
+ declare function runRuffAudit(files: string[], options?: Omit<RunnerOptions, "fix">): Promise<RunnerResult>;
110
+
88
111
  declare function parseEslintJsonOutput(jsonStr: string): CheckDiagnostic[];
89
112
  declare function parseRuffJsonOutput(jsonStr: string): CheckDiagnostic[];
90
113
  declare function formatDiagnostic(d: CheckDiagnostic): string;
@@ -107,4 +130,4 @@ interface DiffResult {
107
130
  }
108
131
  declare function diffAgainstProfile(profile: Profile, observations: Observation[]): DiffResult;
109
132
 
110
- export { type CheckDiagnostic, type CheckResult, type Deviation, type DiffResult, type EslintFlatConfigEntry, type OrchestratorOptions, type OrchestratorResult, type RuffConfig, type SkippedRule, type ToolFailure, type ToolFailureKind, type ToolName, diffAgainstProfile, formatDiagnostic, generateEslintConfig, generateRuffConfig, orchestrate, parseEslintJsonOutput, parseRuffJsonOutput };
133
+ export { AUDIT_RUFF_RULES, type CheckDiagnostic, type CheckResult, type Deviation, type DiffResult, type EslintFlatConfigEntry, type OrchestratorOptions, type OrchestratorResult, type RuffConfig, type RunnerOptions, type RunnerResult, type SkippedRule, type ToolFailure, type ToolFailureKind, type ToolName, diffAgainstProfile, formatDiagnostic, generateEslintConfig, generateRuffAuditConfig, generateRuffConfig, orchestrate, parseEslintJsonOutput, parseRuffJsonOutput, runRuffAudit };
package/dist/index.js CHANGED
@@ -350,6 +350,7 @@ ${jsonStr.slice(0, 500)}`
350
350
  return entries.flatMap((entry) => isRuffSyntaxError(entry.code) ? [] : [{
351
351
  file: entry.filename,
352
352
  line: entry.location.row,
353
+ endLine: entry.end_location.row,
353
354
  column: entry.location.column,
354
355
  severity: "warn",
355
356
  message: entry.message,
@@ -440,6 +441,7 @@ function toToml(config) {
440
441
  if (config["line-length"]) {
441
442
  lines.push(`line-length = ${config["line-length"]}`);
442
443
  }
444
+ if (config.preview) lines.push("preview = true");
443
445
  if (config.lint) {
444
446
  lines.push("[lint]", ...lintSelectionLines(config.lint), ...lintSubsectionLines(config.lint));
445
447
  }
@@ -534,6 +536,47 @@ async function orchestrate(options) {
534
536
  };
535
537
  }
536
538
 
539
+ // src/generators/ruff-audit.ts
540
+ var AUDIT_RUFF_RULES = [
541
+ "C901",
542
+ "PLR0904",
543
+ "PLR0911",
544
+ "PLR0912",
545
+ "PLR0913",
546
+ "PLR0914",
547
+ "PLR0915",
548
+ "PLR0916",
549
+ "PLR0917",
550
+ "PLR1702",
551
+ "ARG",
552
+ "FBT",
553
+ "ERA001",
554
+ "BLE001",
555
+ "S110",
556
+ "TRY203",
557
+ "SIM105",
558
+ "F401",
559
+ "F841",
560
+ "PIE790",
561
+ "RUF100"
562
+ ];
563
+ function generateRuffAuditConfig() {
564
+ return { preview: true, lint: { select: [...AUDIT_RUFF_RULES] } };
565
+ }
566
+
567
+ // src/runners/ruff-audit.ts
568
+ import { realpathSync } from "fs";
569
+ import { isAbsolute, relative } from "path";
570
+ async function runRuffAudit(files, options) {
571
+ const result = await runRuff(generateRuffAuditConfig(), files, options);
572
+ const root = realpathSync(options?.cwd ?? process.cwd());
573
+ const diagnostics = result.diagnostics.map((d) => ({ ...d, file: relativeTo(root, d.file) }));
574
+ return { ...result, diagnostics };
575
+ }
576
+ function relativeTo(root, file) {
577
+ return isAbsolute(file) ? relative(root, file) : file;
578
+ }
579
+
537
580
  // src/profile-diff/diff-against-profile.ts
538
581
  import { PROFILE_CATEGORIES } from "@titan-design/style-profile";
539
582
  function getSeverity(confidence, thresholds) {
@@ -587,12 +630,15 @@ function diffAgainstProfile(profile, observations) {
587
630
  };
588
631
  }
589
632
  export {
633
+ AUDIT_RUFF_RULES,
590
634
  diffAgainstProfile,
591
635
  formatDiagnostic,
592
636
  generateEslintConfig,
637
+ generateRuffAuditConfig,
593
638
  generateRuffConfig,
594
639
  orchestrate,
595
640
  parseEslintJsonOutput,
596
- parseRuffJsonOutput
641
+ parseRuffJsonOutput,
642
+ runRuffAudit
597
643
  };
598
644
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/generators/eslint.ts","../src/generators/ruff.ts","../src/runners/eslint-runner.ts","../src/runners/tool-runner.ts","../src/runners/failures.ts","../src/runners/eslint-plugins.ts","../src/runners/eslint-config-module.ts","../src/formatters/unified.ts","../src/runners/ruff-runner.ts","../src/orchestrator/orchestrate.ts","../src/profile-diff/diff-against-profile.ts"],"sourcesContent":["import type { Profile } from \"@titan-design/style-profile\";\nimport {\n buildNamingConventionRule,\n buildImportOrderRule,\n buildFunctionLengthRule,\n buildFileNamingRule,\n buildJsdocRules,\n} from \"@titan-design/style-profile\";\n\nexport interface EslintFlatConfigEntry {\n plugins?: Record<string, unknown>;\n rules?: Record<string, unknown>;\n files?: string[];\n}\n\n// ESLint accepts only off, warn and error; style-profile's \"info\" tier becomes warn, as its own exporter does.\nfunction withEslintSeverity(value: unknown): unknown {\n if (Array.isArray(value) && value[0] === \"info\") return [\"warn\", ...value.slice(1)];\n return value === \"info\" ? \"warn\" : value;\n}\n\nfunction collectRules(profile: Profile): Record<string, unknown> {\n const rules: Record<string, unknown> = {};\n\n const namingRule = buildNamingConventionRule(profile);\n if (namingRule) rules[namingRule[0]] = namingRule[1];\n\n const importRule = buildImportOrderRule(profile);\n if (importRule) rules[importRule[0]] = importRule[1];\n\n const fnLengthRule = buildFunctionLengthRule(profile);\n if (fnLengthRule) rules[fnLengthRule[0]] = fnLengthRule[1];\n\n const fileNamingRule = buildFileNamingRule(profile);\n if (fileNamingRule) rules[fileNamingRule[0]] = fileNamingRule[1];\n\n const jsdocRules = buildJsdocRules(profile);\n for (const [name, value] of jsdocRules) {\n rules[name] = value;\n }\n\n for (const name of Object.keys(rules)) rules[name] = withEslintSeverity(rules[name]);\n return rules;\n}\n\nexport function generateEslintConfig(profile: Profile): EslintFlatConfigEntry[] {\n const entries: EslintFlatConfigEntry[] = [];\n const rules = collectRules(profile);\n\n if (Object.keys(rules).length > 0) {\n entries.push({\n files: [\"**/*.ts\", \"**/*.tsx\"],\n rules,\n });\n }\n\n return entries;\n}\n","import type { Profile } from \"@titan-design/style-profile\";\n\nexport interface RuffConfig {\n lint?: {\n select?: string[];\n ignore?: string[];\n fixable?: string[];\n \"per-file-ignores\"?: Record<string, string[]>;\n mccabe?: { \"max-complexity\"?: number };\n pydocstyle?: { convention?: string };\n isort?: {\n \"known-first-party\"?: string[];\n \"section-order\"?: string[];\n };\n };\n \"line-length\"?: number;\n}\n\ntype RuffLint = NonNullable<RuffConfig[\"lint\"]> & { select: string[] };\n\nfunction addNaming(profile: Profile, lint: RuffLint): void {\n if (profile.naming) {\n const hasNamingRules = Object.values(profile.naming).some(\n (rule) => rule.confidence >= profile.severityThresholds.info,\n );\n if (hasNamingRules) lint.select.push(\"N\");\n }\n}\n\nfunction addImportOrder(profile: Profile, lint: RuffLint): void {\n const importOrder = profile.structure?.importOrder;\n if (importOrder && importOrder.confidence >= profile.severityThresholds.info) {\n lint.select.push(\"I\");\n if (Array.isArray(importOrder.convention)) {\n lint.isort = {\n \"section-order\": importOrder.convention as string[],\n };\n }\n }\n}\n\nfunction addFunctionDocs(profile: Profile, lint: RuffLint): void {\n const functionDocs = profile.documentation?.functionDocs;\n if (functionDocs && functionDocs.confidence >= profile.severityThresholds.info) {\n lint.select.push(\"D\");\n const conv = functionDocs.convention;\n if (\n typeof conv === \"string\" &&\n conv !== \"jsdoc-selective\" &&\n conv !== \"jsdoc-all\"\n ) {\n lint.pydocstyle = { convention: conv };\n }\n }\n}\n\nfunction addComplexity(profile: Profile, lint: RuffLint): void {\n const maxLines = profile.structure?.functionMaxLines;\n if (\n maxLines &&\n maxLines.confidence >= profile.severityThresholds.info &&\n typeof maxLines.convention === \"number\"\n ) {\n lint.select.push(\"C90\");\n lint.mccabe = { \"max-complexity\": maxLines.convention };\n }\n}\n\nexport function generateRuffConfig(profile: Profile): RuffConfig {\n const lint: RuffLint = { select: [] };\n const config: RuffConfig = { lint };\n\n addNaming(profile, lint);\n addImportOrder(profile, lint);\n addFunctionDocs(profile, lint);\n addComplexity(profile, lint);\n\n const lineLength = profile.formatting?.lineLength;\n if (lineLength && typeof lineLength.convention === \"number\") {\n config[\"line-length\"] = lineLength.convention;\n }\n\n return config;\n}\n","import { writeFileSync, mkdtempSync, rmSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { tmpdir } from \"node:os\";\nimport { runAndClassify, parseOrFail } from \"./failures.js\";\nimport { buildEslintConfigModule } from \"./eslint-config-module.js\";\nimport { parseEslintJsonOutput } from \"../formatters/unified.js\";\nimport type { CheckDiagnostic, ToolFailure } from \"../orchestrator/types.js\";\nimport type { EslintFlatConfigEntry } from \"../generators/eslint.js\";\nimport type { RunnerOptions, RunnerResult } from \"./types.js\";\n\ninterface EslintJsonMessage {\n ruleId: string | null;\n fatal?: boolean;\n message: string;\n}\n\n// ESLint reports a file it could not lint as a rule-less message: a fatal parse error, or \"File ignored ...\".\nfunction uncheckedFiles(stdout: string): ToolFailure[] {\n const entries = JSON.parse(stdout) as Array<{ filePath: string; messages: EslintJsonMessage[] }>;\n return entries.flatMap((entry) =>\n entry.messages\n .filter((m) => m.ruleId === null && (m.fatal === true || m.message.startsWith(\"File ignored\")))\n .map((m) => ({ tool: \"eslint\" as const, kind: \"file-not-checked\" as const, file: entry.filePath, message: m.message })),\n );\n}\n\nfunction readEslintOutput(stdout: string): { diagnostics: CheckDiagnostic[]; failures: ToolFailure[] } {\n const parsed = parseOrFail(\"eslint\", () => ({\n diagnostics: parseEslintJsonOutput(stdout),\n failures: uncheckedFiles(stdout),\n }));\n return parsed.ok ? parsed.value : { diagnostics: [], failures: [parsed.failure] };\n}\n\nfunction eslintArgs(configPath: string, files: string[], fix?: boolean): string[] {\n // --no stops npx from downloading an ESLint the project has not installed.\n return [\"--no\", \"--\", \"eslint\", \"--config\", configPath, \"--format\", \"json\", ...(fix ? [\"--fix\"] : []), ...files];\n}\n\nexport async function runEslint(\n config: EslintFlatConfigEntry[],\n files: string[],\n options?: RunnerOptions,\n): Promise<RunnerResult> {\n const cwd = options?.cwd ?? process.cwd();\n const built = buildEslintConfigModule(config, cwd);\n if (!built.ok) return { diagnostics: [], exitCode: null, failures: [built.failure], skippedRules: [] };\n const { skippedRules } = built;\n if (built.ruleCount === 0) return { diagnostics: [], exitCode: null, failures: [], skippedRules };\n\n const tempDir = mkdtempSync(join(tmpdir(), \"codewatch-eslint-\"));\n const configPath = join(tempDir, \"eslint.config.mjs\");\n try {\n writeFileSync(configPath, built.source, \"utf-8\");\n const run = await runAndClassify(\"eslint\", \"npx\", eslintArgs(configPath, files, options?.fix), {\n cwd,\n timeout: options?.timeout,\n });\n if (!run.ok) return { diagnostics: [], exitCode: run.exitCode, failures: [run.failure], skippedRules };\n return { ...readEslintOutput(run.stdout), exitCode: run.exitCode, skippedRules };\n } finally {\n rmSync(tempDir, { recursive: true, force: true });\n }\n}\n","import { spawn } from \"node:child_process\";\n\nexport interface ToolRunResult {\n stdout: string;\n stderr: string;\n /** Null when the child was killed by a signal; see `signal`. */\n exitCode: number | null;\n signal: NodeJS.Signals | null;\n timedOut: boolean;\n}\n\nexport function runTool(\n command: string,\n args: string[],\n options?: { cwd?: string; timeout?: number },\n): Promise<ToolRunResult> {\n return new Promise((resolve, reject) => {\n const child = spawn(command, args, {\n cwd: options?.cwd,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n const chunks: Buffer[] = [];\n const errChunks: Buffer[] = [];\n let timedOut = false;\n // Our own timer, because spawn's `timeout` option kills without telling us it did.\n const timer = setTimeout(() => {\n timedOut = true;\n child.kill(\"SIGKILL\");\n }, options?.timeout ?? 60_000);\n\n child.stdout.on(\"data\", (chunk: Buffer) => chunks.push(chunk));\n child.stderr.on(\"data\", (chunk: Buffer) => errChunks.push(chunk));\n\n child.on(\"error\", (err) => {\n clearTimeout(timer);\n reject(new Error(`Failed to spawn ${command}: ${err.message}`));\n });\n\n child.on(\"close\", (code, signal) => {\n clearTimeout(timer);\n resolve({\n stdout: Buffer.concat(chunks).toString(\"utf-8\"),\n stderr: Buffer.concat(errChunks).toString(\"utf-8\"),\n exitCode: code,\n signal,\n timedOut,\n });\n });\n });\n}\n","import { runTool } from \"./tool-runner.js\";\nimport type { ToolRunResult } from \"./tool-runner.js\";\nimport type { ToolFailure, ToolName } from \"../orchestrator/types.js\";\n\n// ESLint and ruff both document 0 (clean) and 1 (problems found) as successful runs.\nconst SUCCESS_EXIT_CODES = new Set([0, 1]);\n\nexport type ToolRun =\n | { ok: true; stdout: string; stderr: string; exitCode: number }\n | { ok: false; failure: ToolFailure; exitCode: number | null };\n\nfunction excerpt(text: string): string {\n const trimmed = text.trim();\n return trimmed.length > 500 ? `${trimmed.slice(0, 500)}…` : trimmed;\n}\n\nfunction withStderr(message: string, stderr: string): string {\n const detail = excerpt(stderr);\n return detail ? `${message}: ${detail}` : message;\n}\n\nexport function classifyRun(tool: ToolName, run: ToolRunResult): ToolRun {\n const fail = (kind: ToolFailure[\"kind\"], message: string): ToolRun => ({\n ok: false,\n failure: { tool, kind, message: withStderr(message, run.stderr) },\n exitCode: run.exitCode,\n });\n if (run.timedOut) return fail(\"timeout\", `${tool} timed out and was killed`);\n if (run.exitCode === null) {\n return fail(\"signal\", `${tool} was killed by ${run.signal ?? \"a signal\"}`);\n }\n if (!SUCCESS_EXIT_CODES.has(run.exitCode)) {\n return fail(\"exit-code\", `${tool} exited with code ${run.exitCode}`);\n }\n if (!run.stdout.trim()) {\n return fail(\"unparseable-output\", `${tool} exited ${run.exitCode} with no output`);\n }\n return { ok: true, stdout: run.stdout, stderr: run.stderr, exitCode: run.exitCode };\n}\n\nexport async function runAndClassify(\n tool: ToolName,\n command: string,\n args: string[],\n options?: { cwd?: string; timeout?: number },\n): Promise<ToolRun> {\n try {\n return classifyRun(tool, await runTool(command, args, options));\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { ok: false, failure: { tool, kind: \"spawn-failed\", message }, exitCode: null };\n }\n}\n\nexport function parseOrFail<T>(\n tool: ToolName,\n parse: () => T,\n): { ok: true; value: T } | { ok: false; failure: ToolFailure } {\n try {\n return { ok: true, value: parse() };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { ok: false, failure: { tool, kind: \"unparseable-output\", message } };\n }\n}\n","import { createRequire } from \"node:module\";\nimport { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\nexport interface ModuleSource {\n specifier: string;\n member?: \"plugin\" | \"parser\";\n}\n\nexport interface ResolvedModule {\n url: string;\n member?: \"plugin\" | \"parser\";\n}\n\n// The typescript-eslint meta-package is the fallback because under pnpm it is often the only one a project can resolve.\nexport const PLUGIN_SOURCES: Record<string, ModuleSource[]> = {\n \"@typescript-eslint\": [\n { specifier: \"@typescript-eslint/eslint-plugin\" },\n { specifier: \"typescript-eslint\", member: \"plugin\" },\n ],\n perfectionist: [{ specifier: \"eslint-plugin-perfectionist\" }],\n unicorn: [{ specifier: \"eslint-plugin-unicorn\" }],\n jsdoc: [{ specifier: \"eslint-plugin-jsdoc\" }],\n};\n\nexport const PARSER_SOURCES: ModuleSource[] = [\n { specifier: \"@typescript-eslint/parser\" },\n { specifier: \"typescript-eslint\", member: \"parser\" },\n];\n\nexport function pluginNamespace(rule: string): string | null {\n const slash = rule.lastIndexOf(\"/\");\n return slash === -1 ? null : rule.slice(0, slash);\n}\n\nexport function describeSources(sources: ModuleSource[]): string {\n return sources.map((s) => s.specifier).join(\" or \");\n}\n\nexport function resolveModule(\n sources: ModuleSource[],\n fromDir: string,\n): ResolvedModule | null {\n // Resolve from the project, not from this package: ESLint runs there and loads plugins from there.\n const require = createRequire(join(fromDir, \"package.json\"));\n for (const source of sources) {\n try {\n const url = pathToFileURL(require.resolve(source.specifier)).href;\n return { url, member: source.member };\n } catch {\n continue;\n }\n }\n return null;\n}\n","import {\n PARSER_SOURCES,\n PLUGIN_SOURCES,\n describeSources,\n pluginNamespace,\n resolveModule,\n} from \"./eslint-plugins.js\";\nimport type { ResolvedModule } from \"./eslint-plugins.js\";\nimport type { EslintFlatConfigEntry } from \"../generators/eslint.js\";\nimport type { SkippedRule, ToolFailure } from \"../orchestrator/types.js\";\n\nexport type EslintConfigModule =\n | { ok: true; source: string; ruleCount: number; skippedRules: SkippedRule[] }\n | { ok: false; failure: ToolFailure };\n\ninterface ModuleContext {\n fromDir: string;\n imports: string[];\n ids: Map<string, string>;\n plugins: Map<string, ResolvedModule | null>;\n}\n\nfunction importExpr(ctx: ModuleContext, mod: ResolvedModule): string {\n let id = ctx.ids.get(mod.url);\n if (!id) {\n id = `m${ctx.ids.size}`;\n ctx.ids.set(mod.url, id);\n ctx.imports.push(`import ${id} from ${JSON.stringify(mod.url)};`);\n }\n return mod.member ? `${id}.${mod.member}` : id;\n}\n\nfunction resolvePlugin(ctx: ModuleContext, namespace: string): ResolvedModule | null {\n if (!ctx.plugins.has(namespace)) {\n const sources = PLUGIN_SOURCES[namespace];\n ctx.plugins.set(namespace, sources ? resolveModule(sources, ctx.fromDir) : null);\n }\n return ctx.plugins.get(namespace) ?? null;\n}\n\nfunction skipReason(ctx: ModuleContext, namespace: string): string {\n const sources = PLUGIN_SOURCES[namespace];\n if (!sources) return `no known package provides the ESLint plugin \"${namespace}\"`;\n return `${describeSources(sources)} is not installed in ${ctx.fromDir}`;\n}\n\nfunction renderEntry(\n ctx: ModuleContext,\n entry: EslintFlatConfigEntry,\n parserExpr: string,\n skipped: SkippedRule[],\n): { text: string; ruleCount: number } {\n const rules: Record<string, unknown> = {};\n const plugins: string[] = [];\n for (const [rule, value] of Object.entries(entry.rules ?? {})) {\n const namespace = pluginNamespace(rule);\n const plugin = namespace === null ? null : resolvePlugin(ctx, namespace);\n if (namespace !== null && !plugin) {\n skipped.push({ tool: \"eslint\", rule, plugin: namespace, reason: skipReason(ctx, namespace) });\n continue;\n }\n rules[rule] = value;\n if (namespace !== null && plugin) plugins.push(`${JSON.stringify(namespace)}: ${importExpr(ctx, plugin)}`);\n }\n const data = JSON.stringify({ files: entry.files, rules });\n const text = `{ ...${data}, languageOptions: { parser: ${parserExpr} }, plugins: { ${[...new Set(plugins)].join(\", \")} } }`;\n return { text, ruleCount: Object.keys(rules).length };\n}\n\nexport function buildEslintConfigModule(\n config: EslintFlatConfigEntry[],\n fromDir: string,\n): EslintConfigModule {\n const parser = resolveModule(PARSER_SOURCES, fromDir);\n if (!parser) {\n const message = `${describeSources(PARSER_SOURCES)} is not installed in ${fromDir}, so ESLint cannot parse TypeScript`;\n return { ok: false, failure: { tool: \"eslint\", kind: \"missing-dependency\", message } };\n }\n const ctx: ModuleContext = { fromDir, imports: [], ids: new Map(), plugins: new Map() };\n const parserExpr = importExpr(ctx, parser);\n const skippedRules: SkippedRule[] = [];\n const entries = config.map((entry) => renderEntry(ctx, entry, parserExpr, skippedRules));\n const ruleCount = entries.reduce((sum, e) => sum + e.ruleCount, 0);\n const body = entries.map((e) => e.text).join(\",\\n \");\n const source = `${ctx.imports.join(\"\\n\")}\\n\\nexport default [\\n ${body},\\n];\\n`;\n return { ok: true, source, ruleCount, skippedRules };\n}\n","import type { CheckDiagnostic } from \"../orchestrator/types.js\";\n\nconst RUFF_CODE_CATEGORY: Record<string, string> = {\n N: \"naming\",\n I: \"imports\",\n D: \"documentation\",\n C: \"complexity\",\n E: \"formatting\",\n W: \"formatting\",\n F: \"errors\",\n};\n\nconst ESLINT_RULE_CATEGORY: Record<string, string> = {\n \"@typescript-eslint/naming-convention\": \"naming\",\n \"unicorn/filename-case\": \"naming\",\n \"perfectionist/sort-imports\": \"imports\",\n \"import/order\": \"imports\",\n \"max-lines-per-function\": \"structure\",\n \"max-depth\": \"structure\",\n \"jsdoc/require-jsdoc\": \"documentation\",\n};\n\nfunction eslintSeverityToSeverity(eslintSeverity: number): \"error\" | \"warn\" {\n return eslintSeverity === 2 ? \"error\" : \"warn\";\n}\n\nfunction categorizeEslintRule(ruleId: string): string {\n if (ESLINT_RULE_CATEGORY[ruleId]) return ESLINT_RULE_CATEGORY[ruleId];\n if (ruleId.startsWith(\"@typescript-eslint/\")) return \"typescript\";\n if (ruleId.startsWith(\"jsdoc/\")) return \"documentation\";\n if (ruleId.startsWith(\"unicorn/\")) return \"style\";\n if (ruleId.startsWith(\"import/\")) return \"imports\";\n return \"other\";\n}\n\nfunction categorizeRuffCode(code: string): string {\n const prefix = code.replace(/[0-9]/g, \"\");\n return RUFF_CODE_CATEGORY[prefix] ?? \"other\";\n}\n\ninterface EslintJsonEntry {\n filePath: string;\n messages: Array<{\n ruleId: string | null;\n severity: number;\n message: string;\n line: number;\n column: number;\n fix?: { range: [number, number]; text: string } | null;\n }>;\n}\n\ninterface RuffJsonEntry {\n code: string | null;\n message: string;\n filename: string;\n location: { row: number; column: number };\n end_location: { row: number; column: number };\n fix?: {\n edits: Array<{\n content: string;\n location: { row: number; column: number };\n end_location: { row: number; column: number };\n }>;\n } | null;\n}\n\nexport function parseEslintJsonOutput(jsonStr: string): CheckDiagnostic[] {\n let entries: EslintJsonEntry[];\n try {\n entries = JSON.parse(jsonStr);\n } catch {\n throw new Error(\n `Failed to parse ESLint JSON output. Raw output:\\n${jsonStr.slice(0, 500)}`,\n );\n }\n const diagnostics: CheckDiagnostic[] = [];\n\n for (const entry of entries) {\n for (const msg of entry.messages) {\n if (!msg.ruleId) continue;\n diagnostics.push({\n file: entry.filePath,\n line: msg.line,\n column: msg.column,\n severity: eslintSeverityToSeverity(msg.severity),\n message: msg.message,\n category: categorizeEslintRule(msg.ruleId),\n rule: msg.ruleId,\n fixable: msg.fix != null,\n fix: msg.fix ?? undefined,\n });\n }\n }\n\n return diagnostics;\n}\n\n// ruff 0.16.8 reports a syntax error as code \"invalid-syntax\"; 0.9.10 used a null code.\nexport function isRuffSyntaxError(code: string | null): code is \"invalid-syntax\" | null {\n return code === null || code === \"invalid-syntax\";\n}\n\nexport function parseRuffJsonOutput(jsonStr: string): CheckDiagnostic[] {\n let entries: RuffJsonEntry[];\n try {\n entries = JSON.parse(jsonStr);\n } catch {\n throw new Error(\n `Failed to parse Ruff JSON output. Raw output:\\n${jsonStr.slice(0, 500)}`,\n );\n }\n return entries.flatMap((entry) => isRuffSyntaxError(entry.code) ? [] : [{\n file: entry.filename,\n line: entry.location.row,\n column: entry.location.column,\n severity: \"warn\" as const,\n message: entry.message,\n category: categorizeRuffCode(entry.code),\n rule: entry.code,\n fixable: entry.fix != null,\n }]);\n}\n\nexport function formatDiagnostic(d: CheckDiagnostic): string {\n return `${d.file}:${d.line}:${d.column} ${d.severity} ${d.message} [${d.category}.${d.rule}]`;\n}\n","import { writeFileSync, mkdtempSync, rmSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { tmpdir } from \"node:os\";\nimport { runAndClassify, parseOrFail } from \"./failures.js\";\nimport { isRuffSyntaxError, parseRuffJsonOutput } from \"../formatters/unified.js\";\nimport type { CheckDiagnostic, ToolFailure } from \"../orchestrator/types.js\";\nimport type { RunnerOptions, RunnerResult } from \"./types.js\";\nimport type { RuffConfig } from \"../generators/ruff.js\";\n\ntype RuffLint = NonNullable<RuffConfig[\"lint\"]>;\n\nfunction quoteList(values: string[]): string {\n return `[${values.map((s) => `\"${s}\"`).join(\", \")}]`;\n}\n\nfunction lintSelectionLines(lint: RuffLint): string[] {\n const lines: string[] = [];\n if (lint.select) lines.push(`select = ${quoteList(lint.select)}`);\n if (lint.ignore) lines.push(`ignore = ${quoteList(lint.ignore)}`);\n return lines;\n}\n\nfunction lintSubsectionLines(lint: RuffLint): string[] {\n const lines: string[] = [];\n if (lint.mccabe) {\n lines.push(\"[lint.mccabe]\");\n if (lint.mccabe[\"max-complexity\"]) {\n lines.push(`max-complexity = ${lint.mccabe[\"max-complexity\"]}`);\n }\n }\n if (lint.pydocstyle) {\n lines.push(\"[lint.pydocstyle]\");\n if (lint.pydocstyle.convention) {\n lines.push(`convention = \"${lint.pydocstyle.convention}\"`);\n }\n }\n if (lint.isort) {\n lines.push(\"[lint.isort]\");\n if (lint.isort[\"section-order\"]) {\n lines.push(`section-order = ${quoteList(lint.isort[\"section-order\"])}`);\n }\n }\n return lines;\n}\n\nfunction toToml(config: RuffConfig): string {\n const lines: string[] = [];\n\n if (config[\"line-length\"]) {\n lines.push(`line-length = ${config[\"line-length\"]}`);\n }\n\n if (config.lint) {\n lines.push(\"[lint]\", ...lintSelectionLines(config.lint), ...lintSubsectionLines(config.lint));\n }\n\n return lines.join(\"\\n\") + \"\\n\";\n}\n\ninterface RuffJsonMessage {\n code: string | null;\n filename: string;\n message: string;\n}\n\nfunction notChecked(file: string, message: string): ToolFailure {\n return { tool: \"ruff\", kind: \"file-not-checked\", file, message };\n}\n\n// ruff emits one entry per syntax error; a file that fails to parse is reported once.\nfunction unparsedFiles(stdout: string): ToolFailure[] {\n const byFile = new Map<string, string[]>();\n for (const e of JSON.parse(stdout) as RuffJsonMessage[]) {\n if (!isRuffSyntaxError(e.code)) continue;\n byFile.set(e.filename, [...(byFile.get(e.filename) ?? []), e.message]);\n }\n return [...byFile].map(([file, messages]) => notChecked(file, messages.join(\"; \")));\n}\n\n// ruff 0.16.8 flags an unreadable path (exit 0, \"[]\") only in this stderr wording; if ruff rewords it, the case goes silent again.\nfunction unreadFiles(stderr: string): ToolFailure[] {\n return [...stderr.matchAll(/^warning: Failed to lint (.+?): (.+)$/gm)].map((m) => notChecked(m[1]!, m[2]!));\n}\n\nfunction readRuffOutput(stdout: string, stderr: string): { diagnostics: CheckDiagnostic[]; failures: ToolFailure[] } {\n const parsed = parseOrFail(\"ruff\", () => ({\n diagnostics: parseRuffJsonOutput(stdout),\n failures: [...unparsedFiles(stdout), ...unreadFiles(stderr)],\n }));\n return parsed.ok ? parsed.value : { diagnostics: [], failures: [parsed.failure] };\n}\n\nexport async function runRuff(\n config: RuffConfig,\n files: string[],\n options?: RunnerOptions,\n): Promise<RunnerResult> {\n const tempDir = mkdtempSync(join(tmpdir(), \"codewatch-ruff-\"));\n const configPath = join(tempDir, \"ruff.toml\");\n\n try {\n writeFileSync(configPath, toToml(config), \"utf-8\");\n\n const args = [\n \"check\",\n \"--config\",\n configPath,\n \"--output-format\",\n \"json\",\n ...(options?.fix ? [\"--fix\"] : []),\n ...files,\n ];\n\n const run = await runAndClassify(\"ruff\", \"ruff\", args, { cwd: options?.cwd, timeout: options?.timeout });\n if (!run.ok) return { diagnostics: [], exitCode: run.exitCode, failures: [run.failure], skippedRules: [] };\n return { ...readRuffOutput(run.stdout, run.stderr), exitCode: run.exitCode, skippedRules: [] };\n } finally {\n rmSync(tempDir, { recursive: true, force: true });\n }\n}\n","import { generateEslintConfig } from \"../generators/eslint.js\";\nimport { generateRuffConfig } from \"../generators/ruff.js\";\nimport { runEslint } from \"../runners/eslint-runner.js\";\nimport { runRuff } from \"../runners/ruff-runner.js\";\nimport type { RunnerResult } from \"../runners/types.js\";\nimport type {\n OrchestratorOptions,\n OrchestratorResult,\n CheckDiagnostic,\n} from \"./types.js\";\n\nfunction detectLanguage(files: string[]): \"typescript\" | \"python\" | \"mixed\" {\n const tsFiles = files.filter((f) => /\\.[tj]sx?$/.test(f));\n const pyFiles = files.filter((f) => /\\.py$/.test(f));\n if (tsFiles.length > 0 && pyFiles.length === 0) return \"typescript\";\n if (pyFiles.length > 0 && tsFiles.length === 0) return \"python\";\n return \"mixed\";\n}\n\nfunction buildSummary(\n diagnostics: CheckDiagnostic[],\n): OrchestratorResult[\"summary\"] {\n return {\n total: diagnostics.length,\n errors: diagnostics.filter((d) => d.severity === \"error\").length,\n warnings: diagnostics.filter((d) => d.severity === \"warn\").length,\n infos: diagnostics.filter((d) => d.severity === \"info\").length,\n fixed: 0,\n };\n}\n\nasync function runTools(options: OrchestratorOptions): Promise<RunnerResult[]> {\n const { profile, files, fix } = options;\n const language = options.language ?? detectLanguage(files);\n const tsFiles = files.filter((f) => /\\.[tj]sx?$/.test(f));\n const pyFiles = files.filter((f) => /\\.py$/.test(f));\n const results: RunnerResult[] = [];\n\n if ((language === \"typescript\" || language === \"mixed\") && tsFiles.length > 0) {\n const eslintConfig = generateEslintConfig(profile);\n if (eslintConfig.length > 0) results.push(await runEslint(eslintConfig, tsFiles, { fix }));\n }\n\n if ((language === \"python\" || language === \"mixed\") && pyFiles.length > 0) {\n const ruffConfig = generateRuffConfig(profile);\n if (ruffConfig.lint?.select && ruffConfig.lint.select.length > 0) {\n results.push(await runRuff(ruffConfig, pyFiles, { fix }));\n }\n }\n return results;\n}\n\nexport async function orchestrate(\n options: OrchestratorOptions,\n): Promise<OrchestratorResult> {\n const results = await runTools(options);\n const diagnostics = results.flatMap((r) => r.diagnostics);\n return {\n diagnostics,\n failures: results.flatMap((r) => r.failures),\n skippedRules: results.flatMap((r) => r.skippedRules),\n summary: buildSummary(diagnostics),\n };\n}\n","import { PROFILE_CATEGORIES } from \"@titan-design/style-profile\";\nimport type { Profile, ProfileCategory } from \"@titan-design/style-profile\";\nimport type { Observation } from \"@titan-design/style-analyzer\";\n\nexport interface Deviation {\n file: string;\n line: number;\n rule: string;\n expected: string;\n found: string;\n severity: \"error\" | \"warn\" | \"info\";\n}\n\nexport interface DiffResult {\n deviations: Deviation[];\n summary: {\n total: number;\n matching: number;\n deviating: number;\n };\n}\n\nfunction getSeverity(\n confidence: number,\n thresholds: Profile[\"severityThresholds\"],\n): \"error\" | \"warn\" | \"info\" {\n if (confidence >= thresholds.error) return \"error\";\n if (confidence >= thresholds.warn) return \"warn\";\n return \"info\";\n}\n\nfunction resolveProfileRule(\n profile: Profile,\n observationType: string,\n): { convention: unknown; confidence: number } | undefined {\n const [category, rule] = observationType.split(\".\");\n if (!PROFILE_CATEGORIES.includes(category as ProfileCategory)) return undefined;\n const section = profile[category as ProfileCategory];\n if (!section || typeof section !== \"object\") return undefined;\n const ruleObj = rule === undefined ? undefined : section[rule];\n if (!ruleObj || typeof ruleObj !== \"object\") return undefined;\n if (ruleObj.convention === undefined || ruleObj.confidence === undefined) {\n return undefined;\n }\n return { convention: ruleObj.convention, confidence: ruleObj.confidence };\n}\n\nexport function diffAgainstProfile(\n profile: Profile,\n observations: Observation[],\n): DiffResult {\n const deviations: Deviation[] = [];\n let matching = 0;\n\n for (const obs of observations) {\n const profileRule = resolveProfileRule(profile, obs.type);\n if (!profileRule) continue;\n\n const expected = String(profileRule.convention);\n const found = String(obs.value);\n\n if (found === expected) {\n matching++;\n } else {\n deviations.push({\n file: obs.file,\n line: obs.line,\n rule: obs.type,\n expected,\n found,\n severity: getSeverity(\n profileRule.confidence,\n profile.severityThresholds,\n ),\n });\n }\n }\n\n return {\n deviations,\n summary: {\n total: observations.length,\n matching,\n deviating: deviations.length,\n },\n };\n}\n"],"mappings":";AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP,SAAS,mBAAmB,OAAyB;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Q,IAAI;AAC7D,MAAI,CAAC,WAAW,OAAO,YAAY,SAAU,QAAO;AACpD,MAAI,QAAQ,eAAe,UAAa,QAAQ,eAAe,QAAW;AACxE,WAAO;AAAA,EACT;AACA,SAAO,EAAE,YAAY,QAAQ,YAAY,YAAY,QAAQ,WAAW;AAC1E;AAEO,SAAS,mBACd,SACA,cACY;AACZ,QAAM,aAA0B,CAAC;AACjC,MAAI,WAAW;AAEf,aAAW,OAAO,cAAc;AAC9B,UAAM,cAAc,mBAAmB,SAAS,IAAI,IAAI;AACxD,QAAI,CAAC,YAAa;AAElB,UAAM,WAAW,OAAO,YAAY,UAAU;AAC9C,UAAM,QAAQ,OAAO,IAAI,KAAK;AAE9B,QAAI,UAAU,UAAU;AACtB;AAAA,IACF,OAAO;AACL,iBAAW,KAAK;AAAA,QACd,MAAM,IAAI;AAAA,QACV,MAAM,IAAI;AAAA,QACV,MAAM,IAAI;AAAA,QACV;AAAA,QACA;AAAA,QACA,UAAU;AAAA,UACR,YAAY;AAAA,UACZ,QAAQ;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA,SAAS;AAAA,MACP,OAAO,aAAa;AAAA,MACpB;AAAA,MACA,WAAW,WAAW;AAAA,IACxB;AAAA,EACF;AACF;","names":["join","require","join","writeFileSync","mkdtempSync","rmSync","join","tmpdir","mkdtempSync","join","tmpdir","writeFileSync","rmSync"]}
1
+ {"version":3,"sources":["../src/generators/eslint.ts","../src/generators/ruff.ts","../src/runners/eslint-runner.ts","../src/runners/tool-runner.ts","../src/runners/failures.ts","../src/runners/eslint-plugins.ts","../src/runners/eslint-config-module.ts","../src/formatters/unified.ts","../src/runners/ruff-runner.ts","../src/orchestrator/orchestrate.ts","../src/generators/ruff-audit.ts","../src/runners/ruff-audit.ts","../src/profile-diff/diff-against-profile.ts"],"sourcesContent":["import type { Profile } from \"@titan-design/style-profile\";\nimport {\n buildNamingConventionRule,\n buildImportOrderRule,\n buildFunctionLengthRule,\n buildFileNamingRule,\n buildJsdocRules,\n} from \"@titan-design/style-profile\";\n\nexport interface EslintFlatConfigEntry {\n plugins?: Record<string, unknown>;\n rules?: Record<string, unknown>;\n files?: string[];\n}\n\n// ESLint accepts only off, warn and error; style-profile's \"info\" tier becomes warn, as its own exporter does.\nfunction withEslintSeverity(value: unknown): unknown {\n if (Array.isArray(value) && value[0] === \"info\") return [\"warn\", ...value.slice(1)];\n return value === \"info\" ? \"warn\" : value;\n}\n\nfunction collectRules(profile: Profile): Record<string, unknown> {\n const rules: Record<string, unknown> = {};\n\n const namingRule = buildNamingConventionRule(profile);\n if (namingRule) rules[namingRule[0]] = namingRule[1];\n\n const importRule = buildImportOrderRule(profile);\n if (importRule) rules[importRule[0]] = importRule[1];\n\n const fnLengthRule = buildFunctionLengthRule(profile);\n if (fnLengthRule) rules[fnLengthRule[0]] = fnLengthRule[1];\n\n const fileNamingRule = buildFileNamingRule(profile);\n if (fileNamingRule) rules[fileNamingRule[0]] = fileNamingRule[1];\n\n const jsdocRules = buildJsdocRules(profile);\n for (const [name, value] of jsdocRules) {\n rules[name] = value;\n }\n\n for (const name of Object.keys(rules)) rules[name] = withEslintSeverity(rules[name]);\n return rules;\n}\n\nexport function generateEslintConfig(profile: Profile): EslintFlatConfigEntry[] {\n const entries: EslintFlatConfigEntry[] = [];\n const rules = collectRules(profile);\n\n if (Object.keys(rules).length > 0) {\n entries.push({\n files: [\"**/*.ts\", \"**/*.tsx\"],\n rules,\n });\n }\n\n return entries;\n}\n","import type { Profile } from \"@titan-design/style-profile\";\n\nexport interface RuffConfig {\n lint?: {\n select?: string[];\n ignore?: string[];\n fixable?: string[];\n \"per-file-ignores\"?: Record<string, string[]>;\n mccabe?: { \"max-complexity\"?: number };\n pydocstyle?: { convention?: string };\n isort?: {\n \"known-first-party\"?: string[];\n \"section-order\"?: string[];\n };\n };\n \"line-length\"?: number;\n preview?: boolean;\n}\n\ntype RuffLint = NonNullable<RuffConfig[\"lint\"]> & { select: string[] };\n\nfunction addNaming(profile: Profile, lint: RuffLint): void {\n if (profile.naming) {\n const hasNamingRules = Object.values(profile.naming).some(\n (rule) => rule.confidence >= profile.severityThresholds.info,\n );\n if (hasNamingRules) lint.select.push(\"N\");\n }\n}\n\nfunction addImportOrder(profile: Profile, lint: RuffLint): void {\n const importOrder = profile.structure?.importOrder;\n if (importOrder && importOrder.confidence >= profile.severityThresholds.info) {\n lint.select.push(\"I\");\n if (Array.isArray(importOrder.convention)) {\n lint.isort = {\n \"section-order\": importOrder.convention as string[],\n };\n }\n }\n}\n\nfunction addFunctionDocs(profile: Profile, lint: RuffLint): void {\n const functionDocs = profile.documentation?.functionDocs;\n if (functionDocs && functionDocs.confidence >= profile.severityThresholds.info) {\n lint.select.push(\"D\");\n const conv = functionDocs.convention;\n if (\n typeof conv === \"string\" &&\n conv !== \"jsdoc-selective\" &&\n conv !== \"jsdoc-all\"\n ) {\n lint.pydocstyle = { convention: conv };\n }\n }\n}\n\nfunction addComplexity(profile: Profile, lint: RuffLint): void {\n const maxLines = profile.structure?.functionMaxLines;\n if (\n maxLines &&\n maxLines.confidence >= profile.severityThresholds.info &&\n typeof maxLines.convention === \"number\"\n ) {\n lint.select.push(\"C90\");\n lint.mccabe = { \"max-complexity\": maxLines.convention };\n }\n}\n\nexport function generateRuffConfig(profile: Profile): RuffConfig {\n const lint: RuffLint = { select: [] };\n const config: RuffConfig = { lint };\n\n addNaming(profile, lint);\n addImportOrder(profile, lint);\n addFunctionDocs(profile, lint);\n addComplexity(profile, lint);\n\n const lineLength = profile.formatting?.lineLength;\n if (lineLength && typeof lineLength.convention === \"number\") {\n config[\"line-length\"] = lineLength.convention;\n }\n\n return config;\n}\n","import { writeFileSync, mkdtempSync, rmSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { tmpdir } from \"node:os\";\nimport { runAndClassify, parseOrFail } from \"./failures.js\";\nimport { buildEslintConfigModule } from \"./eslint-config-module.js\";\nimport { parseEslintJsonOutput } from \"../formatters/unified.js\";\nimport type { CheckDiagnostic, ToolFailure } from \"../orchestrator/types.js\";\nimport type { EslintFlatConfigEntry } from \"../generators/eslint.js\";\nimport type { RunnerOptions, RunnerResult } from \"./types.js\";\n\ninterface EslintJsonMessage {\n ruleId: string | null;\n fatal?: boolean;\n message: string;\n}\n\n// ESLint reports a file it could not lint as a rule-less message: a fatal parse error, or \"File ignored ...\".\nfunction uncheckedFiles(stdout: string): ToolFailure[] {\n const entries = JSON.parse(stdout) as Array<{ filePath: string; messages: EslintJsonMessage[] }>;\n return entries.flatMap((entry) =>\n entry.messages\n .filter((m) => m.ruleId === null && (m.fatal === true || m.message.startsWith(\"File ignored\")))\n .map((m) => ({ tool: \"eslint\" as const, kind: \"file-not-checked\" as const, file: entry.filePath, message: m.message })),\n );\n}\n\nfunction readEslintOutput(stdout: string): { diagnostics: CheckDiagnostic[]; failures: ToolFailure[] } {\n const parsed = parseOrFail(\"eslint\", () => ({\n diagnostics: parseEslintJsonOutput(stdout),\n failures: uncheckedFiles(stdout),\n }));\n return parsed.ok ? parsed.value : { diagnostics: [], failures: [parsed.failure] };\n}\n\nfunction eslintArgs(configPath: string, files: string[], fix?: boolean): string[] {\n // --no stops npx from downloading an ESLint the project has not installed.\n return [\"--no\", \"--\", \"eslint\", \"--config\", configPath, \"--format\", \"json\", ...(fix ? [\"--fix\"] : []), ...files];\n}\n\nexport async function runEslint(\n config: EslintFlatConfigEntry[],\n files: string[],\n options?: RunnerOptions,\n): Promise<RunnerResult> {\n const cwd = options?.cwd ?? process.cwd();\n const built = buildEslintConfigModule(config, cwd);\n if (!built.ok) return { diagnostics: [], exitCode: null, failures: [built.failure], skippedRules: [] };\n const { skippedRules } = built;\n if (built.ruleCount === 0) return { diagnostics: [], exitCode: null, failures: [], skippedRules };\n\n const tempDir = mkdtempSync(join(tmpdir(), \"codewatch-eslint-\"));\n const configPath = join(tempDir, \"eslint.config.mjs\");\n try {\n writeFileSync(configPath, built.source, \"utf-8\");\n const run = await runAndClassify(\"eslint\", \"npx\", eslintArgs(configPath, files, options?.fix), {\n cwd,\n timeout: options?.timeout,\n });\n if (!run.ok) return { diagnostics: [], exitCode: run.exitCode, failures: [run.failure], skippedRules };\n return { ...readEslintOutput(run.stdout), exitCode: run.exitCode, skippedRules };\n } finally {\n rmSync(tempDir, { recursive: true, force: true });\n }\n}\n","import { spawn } from \"node:child_process\";\n\nexport interface ToolRunResult {\n stdout: string;\n stderr: string;\n /** Null when the child was killed by a signal; see `signal`. */\n exitCode: number | null;\n signal: NodeJS.Signals | null;\n timedOut: boolean;\n}\n\nexport function runTool(\n command: string,\n args: string[],\n options?: { cwd?: string; timeout?: number },\n): Promise<ToolRunResult> {\n return new Promise((resolve, reject) => {\n const child = spawn(command, args, {\n cwd: options?.cwd,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n const chunks: Buffer[] = [];\n const errChunks: Buffer[] = [];\n let timedOut = false;\n // Our own timer, because spawn's `timeout` option kills without telling us it did.\n const timer = setTimeout(() => {\n timedOut = true;\n child.kill(\"SIGKILL\");\n }, options?.timeout ?? 60_000);\n\n child.stdout.on(\"data\", (chunk: Buffer) => chunks.push(chunk));\n child.stderr.on(\"data\", (chunk: Buffer) => errChunks.push(chunk));\n\n child.on(\"error\", (err) => {\n clearTimeout(timer);\n reject(new Error(`Failed to spawn ${command}: ${err.message}`));\n });\n\n child.on(\"close\", (code, signal) => {\n clearTimeout(timer);\n resolve({\n stdout: Buffer.concat(chunks).toString(\"utf-8\"),\n stderr: Buffer.concat(errChunks).toString(\"utf-8\"),\n exitCode: code,\n signal,\n timedOut,\n });\n });\n });\n}\n","import { runTool } from \"./tool-runner.js\";\nimport type { ToolRunResult } from \"./tool-runner.js\";\nimport type { ToolFailure, ToolName } from \"../orchestrator/types.js\";\n\n// ESLint and ruff both document 0 (clean) and 1 (problems found) as successful runs.\nconst SUCCESS_EXIT_CODES = new Set([0, 1]);\n\nexport type ToolRun =\n | { ok: true; stdout: string; stderr: string; exitCode: number }\n | { ok: false; failure: ToolFailure; exitCode: number | null };\n\nfunction excerpt(text: string): string {\n const trimmed = text.trim();\n return trimmed.length > 500 ? `${trimmed.slice(0, 500)}…` : trimmed;\n}\n\nfunction withStderr(message: string, stderr: string): string {\n const detail = excerpt(stderr);\n return detail ? `${message}: ${detail}` : message;\n}\n\nexport function classifyRun(tool: ToolName, run: ToolRunResult): ToolRun {\n const fail = (kind: ToolFailure[\"kind\"], message: string): ToolRun => ({\n ok: false,\n failure: { tool, kind, message: withStderr(message, run.stderr) },\n exitCode: run.exitCode,\n });\n if (run.timedOut) return fail(\"timeout\", `${tool} timed out and was killed`);\n if (run.exitCode === null) {\n return fail(\"signal\", `${tool} was killed by ${run.signal ?? \"a signal\"}`);\n }\n if (!SUCCESS_EXIT_CODES.has(run.exitCode)) {\n return fail(\"exit-code\", `${tool} exited with code ${run.exitCode}`);\n }\n if (!run.stdout.trim()) {\n return fail(\"unparseable-output\", `${tool} exited ${run.exitCode} with no output`);\n }\n return { ok: true, stdout: run.stdout, stderr: run.stderr, exitCode: run.exitCode };\n}\n\nexport async function runAndClassify(\n tool: ToolName,\n command: string,\n args: string[],\n options?: { cwd?: string; timeout?: number },\n): Promise<ToolRun> {\n try {\n return classifyRun(tool, await runTool(command, args, options));\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { ok: false, failure: { tool, kind: \"spawn-failed\", message }, exitCode: null };\n }\n}\n\nexport function parseOrFail<T>(\n tool: ToolName,\n parse: () => T,\n): { ok: true; value: T } | { ok: false; failure: ToolFailure } {\n try {\n return { ok: true, value: parse() };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { ok: false, failure: { tool, kind: \"unparseable-output\", message } };\n }\n}\n","import { createRequire } from \"node:module\";\nimport { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\nexport interface ModuleSource {\n specifier: string;\n member?: \"plugin\" | \"parser\";\n}\n\nexport interface ResolvedModule {\n url: string;\n member?: \"plugin\" | \"parser\";\n}\n\n// The typescript-eslint meta-package is the fallback because under pnpm it is often the only one a project can resolve.\nexport const PLUGIN_SOURCES: Record<string, ModuleSource[]> = {\n \"@typescript-eslint\": [\n { specifier: \"@typescript-eslint/eslint-plugin\" },\n { specifier: \"typescript-eslint\", member: \"plugin\" },\n ],\n perfectionist: [{ specifier: \"eslint-plugin-perfectionist\" }],\n unicorn: [{ specifier: \"eslint-plugin-unicorn\" }],\n jsdoc: [{ specifier: \"eslint-plugin-jsdoc\" }],\n};\n\nexport const PARSER_SOURCES: ModuleSource[] = [\n { specifier: \"@typescript-eslint/parser\" },\n { specifier: \"typescript-eslint\", member: \"parser\" },\n];\n\nexport function pluginNamespace(rule: string): string | null {\n const slash = rule.lastIndexOf(\"/\");\n return slash === -1 ? null : rule.slice(0, slash);\n}\n\nexport function describeSources(sources: ModuleSource[]): string {\n return sources.map((s) => s.specifier).join(\" or \");\n}\n\nexport function resolveModule(\n sources: ModuleSource[],\n fromDir: string,\n): ResolvedModule | null {\n // Resolve from the project, not from this package: ESLint runs there and loads plugins from there.\n const require = createRequire(join(fromDir, \"package.json\"));\n for (const source of sources) {\n try {\n const url = pathToFileURL(require.resolve(source.specifier)).href;\n return { url, member: source.member };\n } catch {\n continue;\n }\n }\n return null;\n}\n","import {\n PARSER_SOURCES,\n PLUGIN_SOURCES,\n describeSources,\n pluginNamespace,\n resolveModule,\n} from \"./eslint-plugins.js\";\nimport type { ResolvedModule } from \"./eslint-plugins.js\";\nimport type { EslintFlatConfigEntry } from \"../generators/eslint.js\";\nimport type { SkippedRule, ToolFailure } from \"../orchestrator/types.js\";\n\nexport type EslintConfigModule =\n | { ok: true; source: string; ruleCount: number; skippedRules: SkippedRule[] }\n | { ok: false; failure: ToolFailure };\n\ninterface ModuleContext {\n fromDir: string;\n imports: string[];\n ids: Map<string, string>;\n plugins: Map<string, ResolvedModule | null>;\n}\n\nfunction importExpr(ctx: ModuleContext, mod: ResolvedModule): string {\n let id = ctx.ids.get(mod.url);\n if (!id) {\n id = `m${ctx.ids.size}`;\n ctx.ids.set(mod.url, id);\n ctx.imports.push(`import ${id} from ${JSON.stringify(mod.url)};`);\n }\n return mod.member ? `${id}.${mod.member}` : id;\n}\n\nfunction resolvePlugin(ctx: ModuleContext, namespace: string): ResolvedModule | null {\n if (!ctx.plugins.has(namespace)) {\n const sources = PLUGIN_SOURCES[namespace];\n ctx.plugins.set(namespace, sources ? resolveModule(sources, ctx.fromDir) : null);\n }\n return ctx.plugins.get(namespace) ?? null;\n}\n\nfunction skipReason(ctx: ModuleContext, namespace: string): string {\n const sources = PLUGIN_SOURCES[namespace];\n if (!sources) return `no known package provides the ESLint plugin \"${namespace}\"`;\n return `${describeSources(sources)} is not installed in ${ctx.fromDir}`;\n}\n\nfunction renderEntry(\n ctx: ModuleContext,\n entry: EslintFlatConfigEntry,\n parserExpr: string,\n skipped: SkippedRule[],\n): { text: string; ruleCount: number } {\n const rules: Record<string, unknown> = {};\n const plugins: string[] = [];\n for (const [rule, value] of Object.entries(entry.rules ?? {})) {\n const namespace = pluginNamespace(rule);\n const plugin = namespace === null ? null : resolvePlugin(ctx, namespace);\n if (namespace !== null && !plugin) {\n skipped.push({ tool: \"eslint\", rule, plugin: namespace, reason: skipReason(ctx, namespace) });\n continue;\n }\n rules[rule] = value;\n if (namespace !== null && plugin) plugins.push(`${JSON.stringify(namespace)}: ${importExpr(ctx, plugin)}`);\n }\n const data = JSON.stringify({ files: entry.files, rules });\n const text = `{ ...${data}, languageOptions: { parser: ${parserExpr} }, plugins: { ${[...new Set(plugins)].join(\", \")} } }`;\n return { text, ruleCount: Object.keys(rules).length };\n}\n\nexport function buildEslintConfigModule(\n config: EslintFlatConfigEntry[],\n fromDir: string,\n): EslintConfigModule {\n const parser = resolveModule(PARSER_SOURCES, fromDir);\n if (!parser) {\n const message = `${describeSources(PARSER_SOURCES)} is not installed in ${fromDir}, so ESLint cannot parse TypeScript`;\n return { ok: false, failure: { tool: \"eslint\", kind: \"missing-dependency\", message } };\n }\n const ctx: ModuleContext = { fromDir, imports: [], ids: new Map(), plugins: new Map() };\n const parserExpr = importExpr(ctx, parser);\n const skippedRules: SkippedRule[] = [];\n const entries = config.map((entry) => renderEntry(ctx, entry, parserExpr, skippedRules));\n const ruleCount = entries.reduce((sum, e) => sum + e.ruleCount, 0);\n const body = entries.map((e) => e.text).join(\",\\n \");\n const source = `${ctx.imports.join(\"\\n\")}\\n\\nexport default [\\n ${body},\\n];\\n`;\n return { ok: true, source, ruleCount, skippedRules };\n}\n","import type { CheckDiagnostic } from \"../orchestrator/types.js\";\n\nconst RUFF_CODE_CATEGORY: Record<string, string> = {\n N: \"naming\",\n I: \"imports\",\n D: \"documentation\",\n C: \"complexity\",\n E: \"formatting\",\n W: \"formatting\",\n F: \"errors\",\n};\n\nconst ESLINT_RULE_CATEGORY: Record<string, string> = {\n \"@typescript-eslint/naming-convention\": \"naming\",\n \"unicorn/filename-case\": \"naming\",\n \"perfectionist/sort-imports\": \"imports\",\n \"import/order\": \"imports\",\n \"max-lines-per-function\": \"structure\",\n \"max-depth\": \"structure\",\n \"jsdoc/require-jsdoc\": \"documentation\",\n};\n\nfunction eslintSeverityToSeverity(eslintSeverity: number): \"error\" | \"warn\" {\n return eslintSeverity === 2 ? \"error\" : \"warn\";\n}\n\nfunction categorizeEslintRule(ruleId: string): string {\n if (ESLINT_RULE_CATEGORY[ruleId]) return ESLINT_RULE_CATEGORY[ruleId];\n if (ruleId.startsWith(\"@typescript-eslint/\")) return \"typescript\";\n if (ruleId.startsWith(\"jsdoc/\")) return \"documentation\";\n if (ruleId.startsWith(\"unicorn/\")) return \"style\";\n if (ruleId.startsWith(\"import/\")) return \"imports\";\n return \"other\";\n}\n\nfunction categorizeRuffCode(code: string): string {\n const prefix = code.replace(/[0-9]/g, \"\");\n return RUFF_CODE_CATEGORY[prefix] ?? \"other\";\n}\n\ninterface EslintJsonEntry {\n filePath: string;\n messages: Array<{\n ruleId: string | null;\n severity: number;\n message: string;\n line: number;\n column: number;\n fix?: { range: [number, number]; text: string } | null;\n }>;\n}\n\ninterface RuffJsonEntry {\n code: string | null;\n message: string;\n filename: string;\n location: { row: number; column: number };\n end_location: { row: number; column: number };\n fix?: {\n edits: Array<{\n content: string;\n location: { row: number; column: number };\n end_location: { row: number; column: number };\n }>;\n } | null;\n}\n\nexport function parseEslintJsonOutput(jsonStr: string): CheckDiagnostic[] {\n let entries: EslintJsonEntry[];\n try {\n entries = JSON.parse(jsonStr);\n } catch {\n throw new Error(\n `Failed to parse ESLint JSON output. Raw output:\\n${jsonStr.slice(0, 500)}`,\n );\n }\n const diagnostics: CheckDiagnostic[] = [];\n\n for (const entry of entries) {\n for (const msg of entry.messages) {\n if (!msg.ruleId) continue;\n diagnostics.push({\n file: entry.filePath,\n line: msg.line,\n column: msg.column,\n severity: eslintSeverityToSeverity(msg.severity),\n message: msg.message,\n category: categorizeEslintRule(msg.ruleId),\n rule: msg.ruleId,\n fixable: msg.fix != null,\n fix: msg.fix ?? undefined,\n });\n }\n }\n\n return diagnostics;\n}\n\n// ruff 0.16.8 reports a syntax error as code \"invalid-syntax\"; 0.9.10 used a null code.\nexport function isRuffSyntaxError(code: string | null): code is \"invalid-syntax\" | null {\n return code === null || code === \"invalid-syntax\";\n}\n\nexport function parseRuffJsonOutput(jsonStr: string): CheckDiagnostic[] {\n let entries: RuffJsonEntry[];\n try {\n entries = JSON.parse(jsonStr);\n } catch {\n throw new Error(\n `Failed to parse Ruff JSON output. Raw output:\\n${jsonStr.slice(0, 500)}`,\n );\n }\n return entries.flatMap((entry) => isRuffSyntaxError(entry.code) ? [] : [{\n file: entry.filename,\n line: entry.location.row,\n endLine: entry.end_location.row,\n column: entry.location.column,\n severity: \"warn\" as const,\n message: entry.message,\n category: categorizeRuffCode(entry.code),\n rule: entry.code,\n fixable: entry.fix != null,\n }]);\n}\n\nexport function formatDiagnostic(d: CheckDiagnostic): string {\n return `${d.file}:${d.line}:${d.column} ${d.severity} ${d.message} [${d.category}.${d.rule}]`;\n}\n","import { writeFileSync, mkdtempSync, rmSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { tmpdir } from \"node:os\";\nimport { runAndClassify, parseOrFail } from \"./failures.js\";\nimport { isRuffSyntaxError, parseRuffJsonOutput } from \"../formatters/unified.js\";\nimport type { CheckDiagnostic, ToolFailure } from \"../orchestrator/types.js\";\nimport type { RunnerOptions, RunnerResult } from \"./types.js\";\nimport type { RuffConfig } from \"../generators/ruff.js\";\n\ntype RuffLint = NonNullable<RuffConfig[\"lint\"]>;\n\nfunction quoteList(values: string[]): string {\n return `[${values.map((s) => `\"${s}\"`).join(\", \")}]`;\n}\n\nfunction lintSelectionLines(lint: RuffLint): string[] {\n const lines: string[] = [];\n if (lint.select) lines.push(`select = ${quoteList(lint.select)}`);\n if (lint.ignore) lines.push(`ignore = ${quoteList(lint.ignore)}`);\n return lines;\n}\n\nfunction lintSubsectionLines(lint: RuffLint): string[] {\n const lines: string[] = [];\n if (lint.mccabe) {\n lines.push(\"[lint.mccabe]\");\n if (lint.mccabe[\"max-complexity\"]) {\n lines.push(`max-complexity = ${lint.mccabe[\"max-complexity\"]}`);\n }\n }\n if (lint.pydocstyle) {\n lines.push(\"[lint.pydocstyle]\");\n if (lint.pydocstyle.convention) {\n lines.push(`convention = \"${lint.pydocstyle.convention}\"`);\n }\n }\n if (lint.isort) {\n lines.push(\"[lint.isort]\");\n if (lint.isort[\"section-order\"]) {\n lines.push(`section-order = ${quoteList(lint.isort[\"section-order\"])}`);\n }\n }\n return lines;\n}\n\nfunction toToml(config: RuffConfig): string {\n const lines: string[] = [];\n\n if (config[\"line-length\"]) {\n lines.push(`line-length = ${config[\"line-length\"]}`);\n }\n if (config.preview) lines.push(\"preview = true\");\n\n if (config.lint) {\n lines.push(\"[lint]\", ...lintSelectionLines(config.lint), ...lintSubsectionLines(config.lint));\n }\n\n return lines.join(\"\\n\") + \"\\n\";\n}\n\ninterface RuffJsonMessage {\n code: string | null;\n filename: string;\n message: string;\n}\n\nfunction notChecked(file: string, message: string): ToolFailure {\n return { tool: \"ruff\", kind: \"file-not-checked\", file, message };\n}\n\n// ruff emits one entry per syntax error; a file that fails to parse is reported once.\nfunction unparsedFiles(stdout: string): ToolFailure[] {\n const byFile = new Map<string, string[]>();\n for (const e of JSON.parse(stdout) as RuffJsonMessage[]) {\n if (!isRuffSyntaxError(e.code)) continue;\n byFile.set(e.filename, [...(byFile.get(e.filename) ?? []), e.message]);\n }\n return [...byFile].map(([file, messages]) => notChecked(file, messages.join(\"; \")));\n}\n\n// ruff 0.16.8 flags an unreadable path (exit 0, \"[]\") only in this stderr wording; if ruff rewords it, the case goes silent again.\nfunction unreadFiles(stderr: string): ToolFailure[] {\n return [...stderr.matchAll(/^warning: Failed to lint (.+?): (.+)$/gm)].map((m) => notChecked(m[1]!, m[2]!));\n}\n\nfunction readRuffOutput(stdout: string, stderr: string): { diagnostics: CheckDiagnostic[]; failures: ToolFailure[] } {\n const parsed = parseOrFail(\"ruff\", () => ({\n diagnostics: parseRuffJsonOutput(stdout),\n failures: [...unparsedFiles(stdout), ...unreadFiles(stderr)],\n }));\n return parsed.ok ? parsed.value : { diagnostics: [], failures: [parsed.failure] };\n}\n\nexport async function runRuff(\n config: RuffConfig,\n files: string[],\n options?: RunnerOptions,\n): Promise<RunnerResult> {\n const tempDir = mkdtempSync(join(tmpdir(), \"codewatch-ruff-\"));\n const configPath = join(tempDir, \"ruff.toml\");\n\n try {\n writeFileSync(configPath, toToml(config), \"utf-8\");\n\n const args = [\n \"check\",\n \"--config\",\n configPath,\n \"--output-format\",\n \"json\",\n ...(options?.fix ? [\"--fix\"] : []),\n ...files,\n ];\n\n const run = await runAndClassify(\"ruff\", \"ruff\", args, { cwd: options?.cwd, timeout: options?.timeout });\n if (!run.ok) return { diagnostics: [], exitCode: run.exitCode, failures: [run.failure], skippedRules: [] };\n return { ...readRuffOutput(run.stdout, run.stderr), exitCode: run.exitCode, skippedRules: [] };\n } finally {\n rmSync(tempDir, { recursive: true, force: true });\n }\n}\n","import { generateEslintConfig } from \"../generators/eslint.js\";\nimport { generateRuffConfig } from \"../generators/ruff.js\";\nimport { runEslint } from \"../runners/eslint-runner.js\";\nimport { runRuff } from \"../runners/ruff-runner.js\";\nimport type { RunnerResult } from \"../runners/types.js\";\nimport type {\n OrchestratorOptions,\n OrchestratorResult,\n CheckDiagnostic,\n} from \"./types.js\";\n\nfunction detectLanguage(files: string[]): \"typescript\" | \"python\" | \"mixed\" {\n const tsFiles = files.filter((f) => /\\.[tj]sx?$/.test(f));\n const pyFiles = files.filter((f) => /\\.py$/.test(f));\n if (tsFiles.length > 0 && pyFiles.length === 0) return \"typescript\";\n if (pyFiles.length > 0 && tsFiles.length === 0) return \"python\";\n return \"mixed\";\n}\n\nfunction buildSummary(\n diagnostics: CheckDiagnostic[],\n): OrchestratorResult[\"summary\"] {\n return {\n total: diagnostics.length,\n errors: diagnostics.filter((d) => d.severity === \"error\").length,\n warnings: diagnostics.filter((d) => d.severity === \"warn\").length,\n infos: diagnostics.filter((d) => d.severity === \"info\").length,\n fixed: 0,\n };\n}\n\nasync function runTools(options: OrchestratorOptions): Promise<RunnerResult[]> {\n const { profile, files, fix } = options;\n const language = options.language ?? detectLanguage(files);\n const tsFiles = files.filter((f) => /\\.[tj]sx?$/.test(f));\n const pyFiles = files.filter((f) => /\\.py$/.test(f));\n const results: RunnerResult[] = [];\n\n if ((language === \"typescript\" || language === \"mixed\") && tsFiles.length > 0) {\n const eslintConfig = generateEslintConfig(profile);\n if (eslintConfig.length > 0) results.push(await runEslint(eslintConfig, tsFiles, { fix }));\n }\n\n if ((language === \"python\" || language === \"mixed\") && pyFiles.length > 0) {\n const ruffConfig = generateRuffConfig(profile);\n if (ruffConfig.lint?.select && ruffConfig.lint.select.length > 0) {\n results.push(await runRuff(ruffConfig, pyFiles, { fix }));\n }\n }\n return results;\n}\n\nexport async function orchestrate(\n options: OrchestratorOptions,\n): Promise<OrchestratorResult> {\n const results = await runTools(options);\n const diagnostics = results.flatMap((r) => r.diagnostics);\n return {\n diagnostics,\n failures: results.flatMap((r) => r.failures),\n skippedRules: results.flatMap((r) => r.skippedRules),\n summary: buildSummary(diagnostics),\n };\n}\n","import type { RuffConfig } from \"./ruff.js\";\n\n/** The audit's pinned ruff selection: complexity, size, dead code, and defensive-bloat signals. */\nexport const AUDIT_RUFF_RULES: readonly string[] = [\n \"C901\",\n \"PLR0904\",\n \"PLR0911\",\n \"PLR0912\",\n \"PLR0913\",\n \"PLR0914\",\n \"PLR0915\",\n \"PLR0916\",\n \"PLR0917\",\n \"PLR1702\",\n \"ARG\",\n \"FBT\",\n \"ERA001\",\n \"BLE001\",\n \"S110\",\n \"TRY203\",\n \"SIM105\",\n \"F401\",\n \"F841\",\n \"PIE790\",\n \"RUF100\",\n];\n\n/** Preview is on because ruff 0.16.8 silently skips PLR0904, PLR0914, PLR0916 and PLR1702 without it. */\nexport function generateRuffAuditConfig(): RuffConfig {\n return { preview: true, lint: { select: [...AUDIT_RUFF_RULES] } };\n}\n","import { realpathSync } from \"node:fs\";\nimport { isAbsolute, relative } from \"node:path\";\nimport { generateRuffAuditConfig } from \"../generators/ruff-audit.js\";\nimport { runRuff } from \"./ruff-runner.js\";\nimport type { RunnerOptions, RunnerResult } from \"./types.js\";\n\n/** Runs the pinned audit rule set; diagnostics carry paths relative to `cwd`, since ruff reports absolute ones. */\nexport async function runRuffAudit(files: string[], options?: Omit<RunnerOptions, \"fix\">): Promise<RunnerResult> {\n const result = await runRuff(generateRuffAuditConfig(), files, options);\n const root = realpathSync(options?.cwd ?? process.cwd());\n const diagnostics = result.diagnostics.map((d) => ({ ...d, file: relativeTo(root, d.file) }));\n return { ...result, diagnostics };\n}\n\nfunction relativeTo(root: string, file: string): string {\n return isAbsolute(file) ? relative(root, file) : file;\n}\n","import { PROFILE_CATEGORIES } from \"@titan-design/style-profile\";\nimport type { Profile, ProfileCategory } from \"@titan-design/style-profile\";\nimport type { Observation } from \"@titan-design/style-analyzer\";\n\nexport interface Deviation {\n file: string;\n line: number;\n rule: string;\n expected: string;\n found: string;\n severity: \"error\" | \"warn\" | \"info\";\n}\n\nexport interface DiffResult {\n deviations: Deviation[];\n summary: {\n total: number;\n matching: number;\n deviating: number;\n };\n}\n\nfunction getSeverity(\n confidence: number,\n thresholds: Profile[\"severityThresholds\"],\n): \"error\" | \"warn\" | \"info\" {\n if (confidence >= thresholds.error) return \"error\";\n if (confidence >= thresholds.warn) return \"warn\";\n return \"info\";\n}\n\nfunction resolveProfileRule(\n profile: Profile,\n observationType: string,\n): { convention: unknown; confidence: number } | undefined {\n const [category, rule] = observationType.split(\".\");\n if (!PROFILE_CATEGORIES.includes(category as ProfileCategory)) return undefined;\n const section = profile[category as ProfileCategory];\n if (!section || typeof section !== \"object\") return undefined;\n const ruleObj = rule === undefined ? undefined : section[rule];\n if (!ruleObj || typeof ruleObj !== \"object\") return undefined;\n if (ruleObj.convention === undefined || ruleObj.confidence === undefined) {\n return undefined;\n }\n return { convention: ruleObj.convention, confidence: ruleObj.confidence };\n}\n\nexport function diffAgainstProfile(\n profile: Profile,\n observations: Observation[],\n): DiffResult {\n const deviations: Deviation[] = [];\n let matching = 0;\n\n for (const obs of observations) {\n const profileRule = resolveProfileRule(profile, obs.type);\n if (!profileRule) continue;\n\n const expected = String(profileRule.convention);\n const found = String(obs.value);\n\n if (found === expected) {\n matching++;\n } else {\n deviations.push({\n file: obs.file,\n line: obs.line,\n rule: obs.type,\n expected,\n found,\n severity: getSeverity(\n profileRule.confidence,\n profile.severityThresholds,\n ),\n });\n }\n }\n\n return {\n deviations,\n summary: {\n total: observations.length,\n matching,\n deviating: deviations.length,\n },\n };\n}\n"],"mappings":";AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP,SAAS,mBAAmB,OAAyB;AACnD,MAAI,MAAM,QAAQ,KAAK,KAAK,MAAM,CAAC,MAAM,OAAQ,QAAO,CAAC,QAAQ,GAAG,MAAM,MAAM,CAAC,CAAC;AAClF,SAA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AA,IACF,OAAO;AACL,iBAAW,KAAK;AAAA,QACd,MAAM,IAAI;AAAA,QACV,MAAM,IAAI;AAAA,QACV,MAAM,IAAI;AAAA,QACV;AAAA,QACA;AAAA,QACA,UAAU;AAAA,UACR,YAAY;AAAA,UACZ,QAAQ;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA,SAAS;AAAA,MACP,OAAO,aAAa;AAAA,MACpB;AAAA,MACA,WAAW,WAAW;AAAA,IACxB;AAAA,EACF;AACF;","names":["join","require","join","writeFileSync","mkdtempSync","rmSync","join","tmpdir","mkdtempSync","join","tmpdir","writeFileSync","rmSync"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titan-design/style-checker",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Run external lint tools (ruff, ESLint) against configs generated from a style profile, normalize their output into one diagnostic shape, and diff observations against a profile",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",