// Re-export ecosystem packs
export { COMPILED_NODEJS_BASELINE } from './baseline-nodejs-security.js';
export { COMPILED_SHELL_BASELINE } from './baseline-shell-posix.js';
export { NEW_TYPESCRIPT_RULES } from './baseline-typescript-new.js';
export const COMPILED_BASELINE_RULES = [
    {
        lessonHash: 'ddaf220dedf132ef',
        lessonHeading: 'Runtime crashes from missing environment variables',
        pattern: '\\bprocess\\.env\\b',
        message: 'Directly accessing process.env is discouraged. Use a validated environment schema (e.g., Zod, envalid) to access variables safely and prevent runtime crashes.',
        engine: 'regex',
        compiledAt: '2026-03-17T18:14:10.976Z',
        createdAt: '2026-03-17T18:14:10.976Z',
        fileGlobs: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx', '!**/*.test.ts', '!**/*.spec.ts'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'bbbda6f562ce4ee1',
        lessonHeading: 'Hardcoded localhost URLs in production code',
        pattern: '(https?|wss?):\\/\\/(localhost|127\\.0\\.0\\.1)',
        message: 'Do not hardcode localhost or 127.0.0.1 URLs. Use environment variables or configuration to ensure production compatibility.',
        engine: 'regex',
        compiledAt: '2026-03-17T18:14:37.559Z',
        createdAt: '2026-03-17T18:14:37.559Z',
        fileGlobs: [
            '**/*.ts',
            '**/*.tsx',
            '**/*.js',
            '**/*.jsx',
            '!**/*.test.ts',
            '!**/*.test.js',
            '!**/*.spec.ts',
            '!**/*.spec.js',
        ],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: '9bd6203030d2f3b7',
        lessonHeading: 'Type assertions (as) bypass safety checks',
        pattern: '\\bas\\s+(any|unknown\\s+as)\\b',
        message: "Type assertions ('as any' or 'as unknown as') bypass safety checks and can lead to runtime crashes. Use type guards or schema validation (like Zod) instead.",
        engine: 'regex',
        compiledAt: '2026-03-17T18:15:01.099Z',
        createdAt: '2026-03-17T18:15:01.099Z',
        fileGlobs: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts', '!*.test.ts', '!*.spec.ts'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: '6390023e121617a4',
        lessonHeading: 'Environment-specific URL handling leaking across boundaries',
        pattern: '(file|turbopack)://',
        message: 'Environment-specific protocols (file://, turbopack://) detected. Normalize these URIs at the environment boundary to prevent broken paths in production.',
        engine: 'regex',
        compiledAt: '2026-03-17T18:16:07.721Z',
        createdAt: '2026-03-17T18:16:07.721Z',
        fileGlobs: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: '4c8993b2461cd7c3',
        lessonHeading: 'Internal modules establishing cyclic dependencies on ambient type declarations',
        pattern: 'import\\s+.*[\'"].*next-env\\.d\\.ts[\'"]',
        message: 'Internal modules should not import from auto-generated ambient type declarations (e.g., next-env.d.ts) to avoid cyclic dependencies.',
        engine: 'regex',
        compiledAt: '2026-03-17T18:16:52.046Z',
        createdAt: '2026-03-17T18:16:52.046Z',
        fileGlobs: ['**/*.ts', '**/*.tsx'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: '535f68dae04e4f49',
        lessonHeading: 'Style injection breaking modular chunk loading',
        pattern: 'document\\.createElement\\([\'"]style[\'"]\\)',
        message: "Avoid manual style tag injection. Use CSS modules or your bundler's style loader to prevent race conditions and duplicate styles in modular chunks (see vercel/next.js#9306).",
        engine: 'regex',
        compiledAt: '2026-03-17T18:17:23.385Z',
        createdAt: '2026-03-17T18:17:23.385Z',
        fileGlobs: [
            '**/*.js',
            '**/*.jsx',
            '**/*.ts',
            '**/*.tsx',
            '!**/*.test.ts',
            '!**/*.test.tsx',
            '!**/*.test.js',
            '!**/*.test.jsx',
        ],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'ef918c7c21575fd9',
        lessonHeading: 'Hook rules violation inside memoization callbacks',
        pattern: '\\b(useMemo|useCallback|React\\.memo)\\s*\\(.*\\buse[A-Z]\\w+\\s*\\(',
        message: 'Never call a React Hook (e.g., useContext, useState) inside the callback function passed to useMemo, useCallback, or React.memo. This breaks the fundamental rule of hooks because the memoized function is executed unpredictably.',
        engine: 'regex',
        compiledAt: '2026-03-17T18:18:09.532Z',
        createdAt: '2026-03-17T18:18:09.532Z',
        fileGlobs: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'fc0f02f699fd9bac',
        lessonHeading: 'Serialization failures when passing complex objects to devtools',
        pattern: '\\buseDebugValue\\s*\\(\\s*[^,)]+\\s*\\)',
        message: 'Use useDebugValue with a formatter function as the second argument. Complex objects with circular references, functions, or Symbols can crash the DevTools bridge if passed directly without a formatter (Source: facebook/react#18070).',
        engine: 'regex',
        compiledAt: '2026-03-17T18:19:24.693Z',
        createdAt: '2026-03-17T18:19:24.693Z',
        fileGlobs: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'baee974c0245ff71',
        lessonHeading: 'Bypassing standard synthetic event systems for performance',
        pattern: '\\.addEventListener\\s*\\(',
        message: "Avoid bypassing the synthetic event system with raw 'addEventListener' calls. This can break event pooling, batching, and cross-platform compatibility.",
        engine: 'regex',
        compiledAt: '2026-03-17T18:19:30.253Z',
        createdAt: '2026-03-17T18:19:30.253Z',
        fileGlobs: [
            '**/*.ts',
            '**/*.tsx',
            '**/*.js',
            '**/*.jsx',
            '!**/*.test.ts',
            '!**/*.test.tsx',
            '!**/*.spec.ts',
            '!**/*.spec.tsx',
        ],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: '36c20eba9ea118cc',
        lessonHeading: 'Type loss across SQL aggregate boundaries',
        pattern: '\\bsql(?:\\.raw)?(?!\\s*<).*?\\b(count|sum|avg|min|max)\\s*\\(',
        message: 'SQL aggregates (count, sum, avg, min, max) in raw SQL must be explicitly cast to a type (e.g., sql<number>`...`) to prevent type loss where drivers return them as strings.',
        engine: 'regex',
        compiledAt: '2026-03-17T18:21:33.065Z',
        createdAt: '2026-03-17T18:21:33.065Z',
        fileGlobs: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: '16b8ff4e52b754cb',
        lessonHeading: 'Hardcoded component logic inside top-level layout files',
        pattern: '(\\b(useState|useEffect|useMemo|useCallback|useReducer)\\s*\\(|<(Modal|Dialog|SplashScreen))',
        message: 'Root layouts and _app files should remain thin. Extract complex logic (hooks) and UI components (Modals, SplashScreens) into separate component files.',
        engine: 'regex',
        compiledAt: '2026-03-17T18:22:34.402Z',
        createdAt: '2026-03-17T18:22:34.402Z',
        fileGlobs: [
            '**/app/layout.tsx',
            '**/app/layout.jsx',
            '**/pages/_app.tsx',
            '**/pages/_app.jsx',
            '**/src/app/layout.tsx',
            '**/src/app/layout.jsx',
            '**/src/pages/_app.tsx',
            '**/src/pages/_app.jsx',
        ],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: '26eb3b217bf8d015',
        lessonHeading: 'Specificity overrides breaking AST/string serialization',
        pattern: '(\\$\\{.*\\}|\\+\\s*[\'"].*)\\s*!important',
        message: "Avoid manual string concatenation of '!important'. Use AST-aware transformations to ensure correct spacing and placement to prevent malformed CSS serialization.",
        engine: 'regex',
        compiledAt: '2026-03-17T18:23:09.519Z',
        createdAt: '2026-03-17T18:23:09.519Z',
        fileGlobs: ['**/*.ts', '**/*.js', '!**/*.test.ts'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: '978e5631393a945c',
        lessonHeading: 'Silent failures and "TODO" placeholders',
        pattern: '//\\s*TODO:\\s*implement',
        message: 'TODO: implement stubs ship incomplete features. Either implement the function or remove it entirely.',
        engine: 'regex',
        compiledAt: '2026-03-18T03:00:00.000Z',
        createdAt: '2026-03-18T03:00:00.000Z',
        fileGlobs: [
            '**/*.ts',
            '**/*.tsx',
            '**/*.js',
            '**/*.jsx',
            '!**/*.test.ts',
            '!**/*.spec.ts',
            '!**/__mocks__/**',
        ],
        severity: 'error',
        category: 'architecture',
    },
    {
        lessonHash: 'guardrail-not-implemented',
        lessonHeading: 'Not-implemented error stubs ship broken code',
        pattern: 'throw\\s+new\\s+Error\\(\\s*[\'"`]Not implemented',
        message: 'Not-implemented error stubs will crash at runtime. Either implement the function or remove it.',
        engine: 'regex',
        compiledAt: '2026-03-18T03:00:00.000Z',
        createdAt: '2026-03-18T03:00:00.000Z',
        fileGlobs: [
            '**/*.ts',
            '**/*.tsx',
            '**/*.js',
            '**/*.jsx',
            '!**/*.test.ts',
            '!**/*.spec.ts',
            '!**/__mocks__/**',
        ],
        severity: 'error',
        category: 'architecture',
    },
    {
        lessonHash: 'guardrail-empty-catch',
        lessonHeading: 'Empty catch blocks silently swallow errors',
        pattern: 'catch\\s*(?:\\([^)]*\\))?\\s*\\{\\s*\\}',
        message: 'Empty catch blocks hide failures. At minimum, log the error or add a comment explaining why it is safe to ignore.',
        engine: 'regex',
        compiledAt: '2026-03-18T03:00:00.000Z',
        createdAt: '2026-03-18T03:00:00.000Z',
        fileGlobs: [
            '**/*.ts',
            '**/*.tsx',
            '**/*.js',
            '**/*.jsx',
            '!**/*.test.ts',
            '!**/*.spec.ts',
            '!**/__mocks__/**',
        ],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'b9e4125e6a31f2cf',
        lessonHeading: 'Use path.relative(process.cwd(),',
        pattern: '',
        message: 'Use path.relative() instead of string replace on process.cwd()',
        engine: 'ast-grep',
        astGrepPattern: '$OBJ.replace(process.cwd(), $REPLACEMENT)',
        compiledAt: '2026-03-22T00:00:00.000Z',
        createdAt: '2026-03-22T00:00:00.000Z',
        fileGlobs: ['**/*.ts', '**/*.js'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'd487264e210913a4',
        lessonHeading: "Prefer Vitest's expect().rejects.toHaveProperty()",
        pattern: '',
        message: "Prefer Vitest's expect().rejects.toHaveProperty()",
        engine: 'ast-grep',
        astGrepPattern: 'try { $$$PRE; expect.fail($$$ARGS); $$$POST } catch ($ERR) { $$$CATCH }',
        compiledAt: '2026-03-22T00:00:00.000Z',
        createdAt: '2026-03-22T00:00:00.000Z',
        fileGlobs: ['**/*.test.ts', '**/*.spec.ts'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'a5697f86bb23901e',
        lessonHeading: "Check for the presence of the 'g' flag before appending it",
        pattern: '',
        message: "Check for the presence of the 'g' flag before appending it",
        engine: 'ast-grep',
        astGrepPattern: "new RegExp($SRC, $FLAGS + 'g')",
        compiledAt: '2026-03-22T00:00:00.000Z',
        createdAt: '2026-03-22T00:00:00.000Z',
        fileGlobs: ['**/*.ts', '**/*.js', '!**/*.test.ts'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: '3b48ad1c3c382306',
        lessonHeading: "When manually parsing CLI arguments, verify that a flag's",
        pattern: '',
        message: "When manually parsing CLI arguments, verify that a flag's",
        engine: 'ast-grep',
        astGrepPattern: '$A[$A.indexOf($B) + 1]',
        compiledAt: '2026-03-22T00:00:00.000Z',
        createdAt: '2026-03-22T00:00:00.000Z',
        fileGlobs: ['**/*.ts', '**/*.js', '!**/*.test.ts'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'dd4542e69ec3d5a1',
        lessonHeading: 'The shell option in spawn() calls should be omitted',
        pattern: '',
        message: 'Omit shell:true when spawn args are an array. Note: only catches inline array literals, not variable args or two-arg form.',
        engine: 'ast-grep',
        astGrepPattern: 'spawn($CMD, [$$$ARGS], { $$$BEFORE, shell: true, $$$AFTER })',
        compiledAt: '2026-03-22T00:00:00.000Z',
        createdAt: '2026-03-22T00:00:00.000Z',
        fileGlobs: ['**/*.ts', '**/*.js'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'c0f2a3fd2956184e',
        lessonHeading: 'PID-based process liveness checks (process.kill(pid, 0))',
        pattern: '',
        message: 'PID-based process liveness checks (process.kill(pid, 0))',
        engine: 'ast-grep',
        astGrepPattern: 'process.kill($PID, 0)',
        compiledAt: '2026-03-22T00:00:00.000Z',
        createdAt: '2026-03-22T00:00:00.000Z',
        fileGlobs: ['**/*.ts', '**/*.js'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'b84fb92bc2313a47',
        lessonHeading: 'Perform explicit null and type checks on the results',
        pattern: '',
        message: 'Perform explicit null and type checks on the results',
        engine: 'ast-grep',
        astGrepPattern: 'JSON.parse($A) as $B',
        compiledAt: '2026-03-22T00:00:00.000Z',
        createdAt: '2026-03-22T00:00:00.000Z',
        fileGlobs: ['**/*.ts', '**/*.tsx', '!**/registry.ts'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: '5cbf4ee7e76975d4',
        lessonHeading: 'The @ast-grep/napi findAll method accepts both string',
        pattern: '',
        message: 'The @ast-grep/napi findAll method accepts both string',
        engine: 'ast-grep',
        astGrepPattern: "$NODE.findAll(typeof $X === 'string' ? $Y : $Z)",
        compiledAt: '2026-03-22T00:00:00.000Z',
        createdAt: '2026-03-22T00:00:00.000Z',
        fileGlobs: ['**/*.ts', '**/*.js'],
        severity: 'warning',
        category: 'style',
    },
];
// ─── Python Baseline ────────────────────────────────
export const COMPILED_PYTHON_BASELINE = [
    {
        lessonHash: 'a1b2c3d4e5f60001',
        lessonHeading: 'Bare except clauses hide real errors',
        pattern: '\\bexcept\\s*:',
        message: 'Bare `except:` catches all exceptions including KeyboardInterrupt and SystemExit. Use `except Exception:` or catch specific exception types.',
        engine: 'regex',
        compiledAt: '2026-03-31T00:00:00.000Z',
        createdAt: '2026-03-31T00:00:00.000Z',
        fileGlobs: ['**/*.py', '!**/*test*.py', '!**/test_*.py'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'a1b2c3d4e5f60002',
        lessonHeading: 'Mutable default arguments persist across function calls',
        pattern: 'def\\s+\\w+\\s*\\([^)]*=\\s*(\\[\\]|\\{\\})',
        message: 'Mutable default arguments ([] or {}) are created once and shared across all calls. Use None as default and create the mutable object inside the function body.',
        engine: 'regex',
        compiledAt: '2026-03-31T00:00:00.000Z',
        createdAt: '2026-03-31T00:00:00.000Z',
        fileGlobs: ['**/*.py'],
        severity: 'warning',
        category: 'style',
    },
];
// ─── Rust Baseline ──────────────────────────────────
export const COMPILED_RUST_BASELINE = [
    {
        lessonHash: 'b2c3d4e5f6a70001',
        lessonHeading: 'Unwrap in production code causes unrecoverable panics',
        pattern: '\\.unwrap\\(\\)',
        message: 'Using .unwrap() in production code causes an unrecoverable panic on None/Err. Use .expect() with context, or handle the error with ? or match.',
        engine: 'regex',
        compiledAt: '2026-03-31T00:00:00.000Z',
        createdAt: '2026-03-31T00:00:00.000Z',
        fileGlobs: ['**/*.rs', '!**/tests/**', '!**/*test*.rs'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'b2c3d4e5f6a70002',
        lessonHeading: 'Unsafe blocks require safety invariant documentation',
        pattern: '\\bunsafe\\b',
        message: 'Every unsafe block must have a preceding `// SAFETY:` comment documenting why the invariants are upheld.',
        engine: 'regex',
        compiledAt: '2026-03-31T00:00:00.000Z',
        createdAt: '2026-03-31T00:00:00.000Z',
        fileGlobs: ['**/*.rs'],
        severity: 'warning',
        category: 'style',
    },
];
// ─── Go Baseline ────────────────────────────────────
export const COMPILED_GO_BASELINE = [
    {
        lessonHash: 'c3d4e5f6a7b80001',
        lessonHeading: 'Error strings should not be capitalized',
        pattern: 'errors\\.New\\(\\s*"[A-Z]',
        message: 'Go convention: error strings should not be capitalized. Use lowercase: errors.New("something failed").',
        engine: 'regex',
        compiledAt: '2026-03-31T00:00:00.000Z',
        createdAt: '2026-03-31T00:00:00.000Z',
        fileGlobs: ['**/*.go', '!**/*_test.go'],
        severity: 'warning',
        category: 'style',
    },
    {
        lessonHash: 'c3d4e5f6a7b80002',
        lessonHeading: 'Error strings should not end with punctuation',
        pattern: 'errors\\.New\\([^)]*[.!]\\s*"\\s*\\)',
        message: 'Go convention: error strings should not end with punctuation.',
        engine: 'regex',
        compiledAt: '2026-03-31T00:00:00.000Z',
        createdAt: '2026-03-31T00:00:00.000Z',
        fileGlobs: ['**/*.go', '!**/*_test.go'],
        severity: 'warning',
        category: 'style',
    },
];
//# sourceMappingURL=compiled-baseline.js.map