@lyse-labs/lyse 0.1.0-alpha.2
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 +45 -0
- package/PRIVACY.md +181 -0
- package/README.md +34 -0
- package/SECURITY.md +43 -0
- package/dist/bench/evidence-pack/anti-dummy.d.ts +11 -0
- package/dist/bench/evidence-pack/anti-dummy.js +20 -0
- package/dist/bench/evidence-pack/anti-dummy.js.map +1 -0
- package/dist/bench/evidence-pack/builder.d.ts +14 -0
- package/dist/bench/evidence-pack/builder.js +77 -0
- package/dist/bench/evidence-pack/builder.js.map +1 -0
- package/dist/bench/evidence-pack/histograms.d.ts +2 -0
- package/dist/bench/evidence-pack/histograms.js +131 -0
- package/dist/bench/evidence-pack/histograms.js.map +1 -0
- package/dist/bench/evidence-pack/manifest-detector.d.ts +2 -0
- package/dist/bench/evidence-pack/manifest-detector.js +65 -0
- package/dist/bench/evidence-pack/manifest-detector.js.map +1 -0
- package/dist/bench/evidence-pack/package-json-digest.d.ts +2 -0
- package/dist/bench/evidence-pack/package-json-digest.js +51 -0
- package/dist/bench/evidence-pack/package-json-digest.js.map +1 -0
- package/dist/bench/evidence-pack/sampler.d.ts +2 -0
- package/dist/bench/evidence-pack/sampler.js +140 -0
- package/dist/bench/evidence-pack/sampler.js.map +1 -0
- package/dist/bench/evidence-pack/types.d.ts +127 -0
- package/dist/bench/evidence-pack/types.js +2 -0
- package/dist/bench/evidence-pack/types.js.map +1 -0
- package/dist/bench/evidence-pack/verifier-corpus.d.ts +5 -0
- package/dist/bench/evidence-pack/verifier-corpus.js +13 -0
- package/dist/bench/evidence-pack/verifier-corpus.js.map +1 -0
- package/dist/bench/taxonomy-loader.d.ts +20 -0
- package/dist/bench/taxonomy-loader.js +28 -0
- package/dist/bench/taxonomy-loader.js.map +1 -0
- package/dist/bench/taxonomy.v3.json +20 -0
- package/dist/cli/__tests__/version-migration.test.d.ts +1 -0
- package/dist/cli/__tests__/version-migration.test.js +69 -0
- package/dist/cli/__tests__/version-migration.test.js.map +1 -0
- package/dist/cli/output/__tests__/eslint-style.test.d.ts +1 -0
- package/dist/cli/output/__tests__/eslint-style.test.js +205 -0
- package/dist/cli/output/__tests__/eslint-style.test.js.map +1 -0
- package/dist/cli/output/__tests__/limit.test.d.ts +1 -0
- package/dist/cli/output/__tests__/limit.test.js +65 -0
- package/dist/cli/output/__tests__/limit.test.js.map +1 -0
- package/dist/cli/output/eslint-style.d.ts +18 -0
- package/dist/cli/output/eslint-style.js +42 -0
- package/dist/cli/output/eslint-style.js.map +1 -0
- package/dist/cli/output/limit.d.ts +5 -0
- package/dist/cli/output/limit.js +32 -0
- package/dist/cli/output/limit.js.map +1 -0
- package/dist/cli/output/score-gauge.d.ts +4 -0
- package/dist/cli/output/score-gauge.js +15 -0
- package/dist/cli/output/score-gauge.js.map +1 -0
- package/dist/cli/version-migration.d.ts +18 -0
- package/dist/cli/version-migration.js +49 -0
- package/dist/cli/version-migration.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +856 -0
- package/dist/cli.js.map +1 -0
- package/dist/codemods/diff.d.ts +17 -0
- package/dist/codemods/diff.js +77 -0
- package/dist/codemods/diff.js.map +1 -0
- package/dist/codemods/git-helpers.d.ts +10 -0
- package/dist/codemods/git-helpers.js +75 -0
- package/dist/codemods/git-helpers.js.map +1 -0
- package/dist/codemods/index.d.ts +27 -0
- package/dist/codemods/index.js +40 -0
- package/dist/codemods/index.js.map +1 -0
- package/dist/codemods/naming-component-pascalcase.d.ts +13 -0
- package/dist/codemods/naming-component-pascalcase.js +106 -0
- package/dist/codemods/naming-component-pascalcase.js.map +1 -0
- package/dist/codemods/naming-hook-prefix.d.ts +13 -0
- package/dist/codemods/naming-hook-prefix.js +86 -0
- package/dist/codemods/naming-hook-prefix.js.map +1 -0
- package/dist/codemods/safety.d.ts +50 -0
- package/dist/codemods/safety.js +109 -0
- package/dist/codemods/safety.js.map +1 -0
- package/dist/codemods/safety.test.d.ts +1 -0
- package/dist/codemods/safety.test.js +154 -0
- package/dist/codemods/safety.test.js.map +1 -0
- package/dist/codemods/shadow-native.d.ts +2 -0
- package/dist/codemods/shadow-native.js +103 -0
- package/dist/codemods/shadow-native.js.map +1 -0
- package/dist/codemods/tokens-color.d.ts +2 -0
- package/dist/codemods/tokens-color.js +69 -0
- package/dist/codemods/tokens-color.js.map +1 -0
- package/dist/codemods/tokens-spacing.d.ts +2 -0
- package/dist/codemods/tokens-spacing.js +66 -0
- package/dist/codemods/tokens-spacing.js.map +1 -0
- package/dist/commands/__tests__/email-prompt.test.d.ts +1 -0
- package/dist/commands/__tests__/email-prompt.test.js +126 -0
- package/dist/commands/__tests__/email-prompt.test.js.map +1 -0
- package/dist/commands/__tests__/explain-score.test.d.ts +1 -0
- package/dist/commands/__tests__/explain-score.test.js +88 -0
- package/dist/commands/__tests__/explain-score.test.js.map +1 -0
- package/dist/commands/__tests__/feedback.test.d.ts +1 -0
- package/dist/commands/__tests__/feedback.test.js +186 -0
- package/dist/commands/__tests__/feedback.test.js.map +1 -0
- package/dist/commands/audit-flags.d.ts +49 -0
- package/dist/commands/audit-flags.js +17 -0
- package/dist/commands/audit-flags.js.map +1 -0
- package/dist/commands/audit-pipeline.d.ts +31 -0
- package/dist/commands/audit-pipeline.js +342 -0
- package/dist/commands/audit-pipeline.js.map +1 -0
- package/dist/commands/bench-pack.d.ts +5 -0
- package/dist/commands/bench-pack.js +61 -0
- package/dist/commands/bench-pack.js.map +1 -0
- package/dist/commands/ci-setup.d.ts +9 -0
- package/dist/commands/ci-setup.js +42 -0
- package/dist/commands/ci-setup.js.map +1 -0
- package/dist/commands/email-prompt.d.ts +36 -0
- package/dist/commands/email-prompt.js +160 -0
- package/dist/commands/email-prompt.js.map +1 -0
- package/dist/commands/explain-score.d.ts +35 -0
- package/dist/commands/explain-score.js +137 -0
- package/dist/commands/explain-score.js.map +1 -0
- package/dist/commands/explain.d.ts +6 -0
- package/dist/commands/explain.js +93 -0
- package/dist/commands/explain.js.map +1 -0
- package/dist/commands/feedback.d.ts +31 -0
- package/dist/commands/feedback.js +155 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/fix.d.ts +48 -0
- package/dist/commands/fix.js +191 -0
- package/dist/commands/fix.js.map +1 -0
- package/dist/commands/init-detect.d.ts +20 -0
- package/dist/commands/init-detect.js +124 -0
- package/dist/commands/init-detect.js.map +1 -0
- package/dist/commands/init-write-agents-md.d.ts +14 -0
- package/dist/commands/init-write-agents-md.js +71 -0
- package/dist/commands/init-write-agents-md.js.map +1 -0
- package/dist/commands/init-write-lyse-md.d.ts +14 -0
- package/dist/commands/init-write-lyse-md.js +253 -0
- package/dist/commands/init-write-lyse-md.js.map +1 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.js +147 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mcp-entry.d.ts +33 -0
- package/dist/commands/mcp-entry.js +47 -0
- package/dist/commands/mcp-entry.js.map +1 -0
- package/dist/commands/mcp-setup.d.ts +10 -0
- package/dist/commands/mcp-setup.js +74 -0
- package/dist/commands/mcp-setup.js.map +1 -0
- package/dist/commands/share.d.ts +4 -0
- package/dist/commands/share.js +60 -0
- package/dist/commands/share.js.map +1 -0
- package/dist/commands/telemetry.d.ts +4 -0
- package/dist/commands/telemetry.js +27 -0
- package/dist/commands/telemetry.js.map +1 -0
- package/dist/commands/templates/lyse-workflow.yml.template +30 -0
- package/dist/config/schema.d.ts +158 -0
- package/dist/config/schema.js +136 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/credentials/keychain.d.ts +20 -0
- package/dist/credentials/keychain.js +35 -0
- package/dist/credentials/keychain.js.map +1 -0
- package/dist/credentials/keychain.test.d.ts +1 -0
- package/dist/credentials/keychain.test.js +32 -0
- package/dist/credentials/keychain.test.js.map +1 -0
- package/dist/credentials/paths.d.ts +1 -0
- package/dist/credentials/paths.js +6 -0
- package/dist/credentials/paths.js.map +1 -0
- package/dist/credentials/store.d.ts +17 -0
- package/dist/credentials/store.js +60 -0
- package/dist/credentials/store.js.map +1 -0
- package/dist/credentials/store.test.d.ts +1 -0
- package/dist/credentials/store.test.js +48 -0
- package/dist/credentials/store.test.js.map +1 -0
- package/dist/detection/from-filesystem.d.ts +2 -0
- package/dist/detection/from-filesystem.js +26 -0
- package/dist/detection/from-filesystem.js.map +1 -0
- package/dist/detection/from-git.d.ts +2 -0
- package/dist/detection/from-git.js +53 -0
- package/dist/detection/from-git.js.map +1 -0
- package/dist/detection/from-package-json.d.ts +2 -0
- package/dist/detection/from-package-json.js +194 -0
- package/dist/detection/from-package-json.js.map +1 -0
- package/dist/detection/pre-flight.d.ts +5 -0
- package/dist/detection/pre-flight.js +47 -0
- package/dist/detection/pre-flight.js.map +1 -0
- package/dist/detection/types.d.ts +27 -0
- package/dist/detection/types.js +2 -0
- package/dist/detection/types.js.map +1 -0
- package/dist/entitlement/check.d.ts +7 -0
- package/dist/entitlement/check.js +37 -0
- package/dist/entitlement/check.js.map +1 -0
- package/dist/entitlement/index.d.ts +1 -0
- package/dist/entitlement/index.js +2 -0
- package/dist/entitlement/index.js.map +1 -0
- package/dist/entitlement/keys.d.ts +10 -0
- package/dist/entitlement/keys.js +14 -0
- package/dist/entitlement/keys.js.map +1 -0
- package/dist/history/ndjson-store.d.ts +70 -0
- package/dist/history/ndjson-store.js +102 -0
- package/dist/history/ndjson-store.js.map +1 -0
- package/dist/identity/index.d.ts +1 -0
- package/dist/identity/index.js +2 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/identity/repo-bucket.d.ts +22 -0
- package/dist/identity/repo-bucket.js +78 -0
- package/dist/identity/repo-bucket.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/layer4-stage.d.ts +18 -0
- package/dist/llm/layer4-stage.js +12 -0
- package/dist/llm/layer4-stage.js.map +1 -0
- package/dist/loaders/components.d.ts +26 -0
- package/dist/loaders/components.js +285 -0
- package/dist/loaders/components.js.map +1 -0
- package/dist/loaders/stories.d.ts +2 -0
- package/dist/loaders/stories.js +231 -0
- package/dist/loaders/stories.js.map +1 -0
- package/dist/loaders/token-graph.d.ts +39 -0
- package/dist/loaders/token-graph.js +146 -0
- package/dist/loaders/token-graph.js.map +1 -0
- package/dist/loaders/tokens.d.ts +2 -0
- package/dist/loaders/tokens.js +521 -0
- package/dist/loaders/tokens.js.map +1 -0
- package/dist/mcp/_find-root.d.ts +12 -0
- package/dist/mcp/_find-root.js +28 -0
- package/dist/mcp/_find-root.js.map +1 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +42 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/audit-file.d.ts +25 -0
- package/dist/mcp/tools/audit-file.js +147 -0
- package/dist/mcp/tools/audit-file.js.map +1 -0
- package/dist/mcp/tools/suggest-fix.d.ts +13 -0
- package/dist/mcp/tools/suggest-fix.js +100 -0
- package/dist/mcp/tools/suggest-fix.js.map +1 -0
- package/dist/menu/action-menu.d.ts +6 -0
- package/dist/menu/action-menu.js +15 -0
- package/dist/menu/action-menu.js.map +1 -0
- package/dist/menu/prompts.d.ts +7 -0
- package/dist/menu/prompts.js +30 -0
- package/dist/menu/prompts.js.map +1 -0
- package/dist/menu/repl.d.ts +17 -0
- package/dist/menu/repl.js +77 -0
- package/dist/menu/repl.js.map +1 -0
- package/dist/parsers/css-in-js.d.ts +2 -0
- package/dist/parsers/css-in-js.js +69 -0
- package/dist/parsers/css-in-js.js.map +1 -0
- package/dist/parsers/css.d.ts +2 -0
- package/dist/parsers/css.js +32 -0
- package/dist/parsers/css.js.map +1 -0
- package/dist/parsers/scss-transform.d.ts +25 -0
- package/dist/parsers/scss-transform.js +55 -0
- package/dist/parsers/scss-transform.js.map +1 -0
- package/dist/parsers/tailwind-v4.d.ts +8 -0
- package/dist/parsers/tailwind-v4.js +90 -0
- package/dist/parsers/tailwind-v4.js.map +1 -0
- package/dist/parsers/ts-morph-project.d.ts +16 -0
- package/dist/parsers/ts-morph-project.js +77 -0
- package/dist/parsers/ts-morph-project.js.map +1 -0
- package/dist/parsers/ts.d.ts +2 -0
- package/dist/parsers/ts.js +61 -0
- package/dist/parsers/ts.js.map +1 -0
- package/dist/reliability/__tests__/types.test.d.ts +1 -0
- package/dist/reliability/__tests__/types.test.js +14 -0
- package/dist/reliability/__tests__/types.test.js.map +1 -0
- package/dist/reliability/catalogue/__tests__/promotion.test.d.ts +1 -0
- package/dist/reliability/catalogue/__tests__/promotion.test.js +23 -0
- package/dist/reliability/catalogue/__tests__/promotion.test.js.map +1 -0
- package/dist/reliability/catalogue/__tests__/sub-axes.test.d.ts +1 -0
- package/dist/reliability/catalogue/__tests__/sub-axes.test.js +27 -0
- package/dist/reliability/catalogue/__tests__/sub-axes.test.js.map +1 -0
- package/dist/reliability/catalogue/promotion.d.ts +8 -0
- package/dist/reliability/catalogue/promotion.js +25 -0
- package/dist/reliability/catalogue/promotion.js.map +1 -0
- package/dist/reliability/catalogue/sub-axes.d.ts +3 -0
- package/dist/reliability/catalogue/sub-axes.js +18 -0
- package/dist/reliability/catalogue/sub-axes.js.map +1 -0
- package/dist/reliability/confidence/__tests__/manifest-loader.test.d.ts +1 -0
- package/dist/reliability/confidence/__tests__/manifest-loader.test.js +103 -0
- package/dist/reliability/confidence/__tests__/manifest-loader.test.js.map +1 -0
- package/dist/reliability/confidence/bundled-manifest.d.ts +2 -0
- package/dist/reliability/confidence/bundled-manifest.js +8 -0
- package/dist/reliability/confidence/bundled-manifest.js.map +1 -0
- package/dist/reliability/confidence/index.d.ts +3 -0
- package/dist/reliability/confidence/index.js +3 -0
- package/dist/reliability/confidence/index.js.map +1 -0
- package/dist/reliability/confidence/manifest-loader.d.ts +8 -0
- package/dist/reliability/confidence/manifest-loader.js +53 -0
- package/dist/reliability/confidence/manifest-loader.js.map +1 -0
- package/dist/reliability/feedback/__tests__/interactive.test.d.ts +1 -0
- package/dist/reliability/feedback/__tests__/interactive.test.js +85 -0
- package/dist/reliability/feedback/__tests__/interactive.test.js.map +1 -0
- package/dist/reliability/feedback/__tests__/repo-bucket.test.d.ts +1 -0
- package/dist/reliability/feedback/__tests__/repo-bucket.test.js +18 -0
- package/dist/reliability/feedback/__tests__/repo-bucket.test.js.map +1 -0
- package/dist/reliability/feedback/__tests__/sender.test.d.ts +1 -0
- package/dist/reliability/feedback/__tests__/sender.test.js +101 -0
- package/dist/reliability/feedback/__tests__/sender.test.js.map +1 -0
- package/dist/reliability/feedback/interactive.d.ts +20 -0
- package/dist/reliability/feedback/interactive.js +150 -0
- package/dist/reliability/feedback/interactive.js.map +1 -0
- package/dist/reliability/feedback/repo-bucket.d.ts +2 -0
- package/dist/reliability/feedback/repo-bucket.js +9 -0
- package/dist/reliability/feedback/repo-bucket.js.map +1 -0
- package/dist/reliability/feedback/sender.d.ts +16 -0
- package/dist/reliability/feedback/sender.js +28 -0
- package/dist/reliability/feedback/sender.js.map +1 -0
- package/dist/reliability/index.d.ts +1 -0
- package/dist/reliability/index.js +2 -0
- package/dist/reliability/index.js.map +1 -0
- package/dist/reliability/llm-eval/__tests__/budget.test.d.ts +1 -0
- package/dist/reliability/llm-eval/__tests__/budget.test.js +39 -0
- package/dist/reliability/llm-eval/__tests__/budget.test.js.map +1 -0
- package/dist/reliability/llm-eval/budget.d.ts +14 -0
- package/dist/reliability/llm-eval/budget.js +43 -0
- package/dist/reliability/llm-eval/budget.js.map +1 -0
- package/dist/reliability/score/__tests__/formula-v1.test.d.ts +1 -0
- package/dist/reliability/score/__tests__/formula-v1.test.js +29 -0
- package/dist/reliability/score/__tests__/formula-v1.test.js.map +1 -0
- package/dist/reliability/score/formula-v1.d.ts +13 -0
- package/dist/reliability/score/formula-v1.js +19 -0
- package/dist/reliability/score/formula-v1.js.map +1 -0
- package/dist/reliability/score/version-pin.d.ts +1 -0
- package/dist/reliability/score/version-pin.js +2 -0
- package/dist/reliability/score/version-pin.js.map +1 -0
- package/dist/reliability/score/weight.d.ts +1 -0
- package/dist/reliability/score/weight.js +5 -0
- package/dist/reliability/score/weight.js.map +1 -0
- package/dist/reliability/types.d.ts +39 -0
- package/dist/reliability/types.js +2 -0
- package/dist/reliability/types.js.map +1 -0
- package/dist/reporters/coverage-footer.d.ts +2 -0
- package/dist/reporters/coverage-footer.js +7 -0
- package/dist/reporters/coverage-footer.js.map +1 -0
- package/dist/reporters/json.d.ts +5 -0
- package/dist/reporters/json.js +51 -0
- package/dist/reporters/json.js.map +1 -0
- package/dist/reporters/markdown.d.ts +7 -0
- package/dist/reporters/markdown.js +35 -0
- package/dist/reporters/markdown.js.map +1 -0
- package/dist/reporters/sarif.d.ts +5 -0
- package/dist/reporters/sarif.js +109 -0
- package/dist/reporters/sarif.js.map +1 -0
- package/dist/reporters/terminal-format.d.ts +34 -0
- package/dist/reporters/terminal-format.js +97 -0
- package/dist/reporters/terminal-format.js.map +1 -0
- package/dist/reporters/terminal.d.ts +4 -0
- package/dist/reporters/terminal.js +201 -0
- package/dist/reporters/terminal.js.map +1 -0
- package/dist/rule-runner.d.ts +8 -0
- package/dist/rule-runner.js +22 -0
- package/dist/rule-runner.js.map +1 -0
- package/dist/rules/_codemod-adapter.d.ts +16 -0
- package/dist/rules/_codemod-adapter.js +49 -0
- package/dist/rules/_codemod-adapter.js.map +1 -0
- package/dist/rules/_exclude.d.ts +11 -0
- package/dist/rules/_exclude.js +17 -0
- package/dist/rules/_exclude.js.map +1 -0
- package/dist/rules/_function-body-analysis.d.ts +82 -0
- package/dist/rules/_function-body-analysis.js +379 -0
- package/dist/rules/_function-body-analysis.js.map +1 -0
- package/dist/rules/_rule-module.d.ts +31 -0
- package/dist/rules/_rule-module.js +32 -0
- package/dist/rules/_rule-module.js.map +1 -0
- package/dist/rules/_skip-context.d.ts +36 -0
- package/dist/rules/_skip-context.js +128 -0
- package/dist/rules/_skip-context.js.map +1 -0
- package/dist/rules/a11y-essentials.d.ts +1 -0
- package/dist/rules/a11y-essentials.js +140 -0
- package/dist/rules/a11y-essentials.js.map +1 -0
- package/dist/rules/ai-surface-agents-md-quality.d.ts +22 -0
- package/dist/rules/ai-surface-agents-md-quality.js +233 -0
- package/dist/rules/ai-surface-agents-md-quality.js.map +1 -0
- package/dist/rules/ai-surface-component-manifest-json.d.ts +19 -0
- package/dist/rules/ai-surface-component-manifest-json.js +232 -0
- package/dist/rules/ai-surface-component-manifest-json.js.map +1 -0
- package/dist/rules/ai-surface-ds-index-exported.d.ts +19 -0
- package/dist/rules/ai-surface-ds-index-exported.js +239 -0
- package/dist/rules/ai-surface-ds-index-exported.js.map +1 -0
- package/dist/rules/components-shadow-native.d.ts +2 -0
- package/dist/rules/components-shadow-native.js +118 -0
- package/dist/rules/components-shadow-native.js.map +1 -0
- package/dist/rules/manifest.d.ts +5 -0
- package/dist/rules/manifest.js +20 -0
- package/dist/rules/manifest.js.map +1 -0
- package/dist/rules/naming-component-pascalcase.d.ts +7 -0
- package/dist/rules/naming-component-pascalcase.js +197 -0
- package/dist/rules/naming-component-pascalcase.js.map +1 -0
- package/dist/rules/naming-hook-prefix.d.ts +6 -0
- package/dist/rules/naming-hook-prefix.js +185 -0
- package/dist/rules/naming-hook-prefix.js.map +1 -0
- package/dist/rules/pack-loader.d.ts +30 -0
- package/dist/rules/pack-loader.js +60 -0
- package/dist/rules/pack-loader.js.map +1 -0
- package/dist/rules/pack-validator.d.ts +8 -0
- package/dist/rules/pack-validator.js +97 -0
- package/dist/rules/pack-validator.js.map +1 -0
- package/dist/rules/registry.d.ts +3 -0
- package/dist/rules/registry.js +28 -0
- package/dist/rules/registry.js.map +1 -0
- package/dist/rules/storybook-coverage.d.ts +1 -0
- package/dist/rules/storybook-coverage.js +49 -0
- package/dist/rules/storybook-coverage.js.map +1 -0
- package/dist/rules/templates/_regex-utils.d.ts +5 -0
- package/dist/rules/templates/_regex-utils.js +8 -0
- package/dist/rules/templates/_regex-utils.js.map +1 -0
- package/dist/rules/templates/a11y-jsx-template.d.ts +15 -0
- package/dist/rules/templates/a11y-jsx-template.js +69 -0
- package/dist/rules/templates/a11y-jsx-template.js.map +1 -0
- package/dist/rules/templates/css-property-token-compliance.d.ts +18 -0
- package/dist/rules/templates/css-property-token-compliance.js +56 -0
- package/dist/rules/templates/css-property-token-compliance.js.map +1 -0
- package/dist/rules/templates/import-source-restriction.d.ts +18 -0
- package/dist/rules/templates/import-source-restriction.js +60 -0
- package/dist/rules/templates/import-source-restriction.js.map +1 -0
- package/dist/rules/templates/js-call-token-compliance.d.ts +18 -0
- package/dist/rules/templates/js-call-token-compliance.js +61 -0
- package/dist/rules/templates/js-call-token-compliance.js.map +1 -0
- package/dist/rules/templates/js-prop-token-compliance.d.ts +21 -0
- package/dist/rules/templates/js-prop-token-compliance.js +56 -0
- package/dist/rules/templates/js-prop-token-compliance.js.map +1 -0
- package/dist/rules/templates/naming-convention.d.ts +18 -0
- package/dist/rules/templates/naming-convention.js +76 -0
- package/dist/rules/templates/naming-convention.js.map +1 -0
- package/dist/rules/templates/registry.d.ts +5 -0
- package/dist/rules/templates/registry.js +30 -0
- package/dist/rules/templates/registry.js.map +1 -0
- package/dist/rules/templates/storybook-coverage-template.d.ts +15 -0
- package/dist/rules/templates/storybook-coverage-template.js +58 -0
- package/dist/rules/templates/storybook-coverage-template.js.map +1 -0
- package/dist/rules/templates/tailwind-utility-class-compliance.d.ts +15 -0
- package/dist/rules/templates/tailwind-utility-class-compliance.js +70 -0
- package/dist/rules/templates/tailwind-utility-class-compliance.js.map +1 -0
- package/dist/rules/templates/types.d.ts +16 -0
- package/dist/rules/templates/types.js +2 -0
- package/dist/rules/templates/types.js.map +1 -0
- package/dist/rules/tokens-description-coverage.d.ts +15 -0
- package/dist/rules/tokens-description-coverage.js +193 -0
- package/dist/rules/tokens-description-coverage.js.map +1 -0
- package/dist/rules/tokens-dtcg-conformance.d.ts +47 -0
- package/dist/rules/tokens-dtcg-conformance.js +363 -0
- package/dist/rules/tokens-dtcg-conformance.js.map +1 -0
- package/dist/rules/tokens-no-hardcoded-color.d.ts +18 -0
- package/dist/rules/tokens-no-hardcoded-color.js +436 -0
- package/dist/rules/tokens-no-hardcoded-color.js.map +1 -0
- package/dist/rules/tokens-no-hardcoded-spacing.d.ts +8 -0
- package/dist/rules/tokens-no-hardcoded-spacing.js +193 -0
- package/dist/rules/tokens-no-hardcoded-spacing.js.map +1 -0
- package/dist/scorer.d.ts +38 -0
- package/dist/scorer.js +126 -0
- package/dist/scorer.js.map +1 -0
- package/dist/share/clipboard.d.ts +26 -0
- package/dist/share/clipboard.js +76 -0
- package/dist/share/clipboard.js.map +1 -0
- package/dist/suppression/__tests__/inline.test.d.ts +1 -0
- package/dist/suppression/__tests__/inline.test.js +25 -0
- package/dist/suppression/__tests__/inline.test.js.map +1 -0
- package/dist/suppression/__tests__/lyseignore.test.d.ts +1 -0
- package/dist/suppression/__tests__/lyseignore.test.js +32 -0
- package/dist/suppression/__tests__/lyseignore.test.js.map +1 -0
- package/dist/suppression/defaults.d.ts +1 -0
- package/dist/suppression/defaults.js +14 -0
- package/dist/suppression/defaults.js.map +1 -0
- package/dist/suppression/inline.d.ts +7 -0
- package/dist/suppression/inline.js +32 -0
- package/dist/suppression/inline.js.map +1 -0
- package/dist/suppression/lyseignore.d.ts +2 -0
- package/dist/suppression/lyseignore.js +22 -0
- package/dist/suppression/lyseignore.js.map +1 -0
- package/dist/telemetry/consent.d.ts +48 -0
- package/dist/telemetry/consent.js +139 -0
- package/dist/telemetry/consent.js.map +1 -0
- package/dist/telemetry/index.d.ts +2 -0
- package/dist/telemetry/index.js +3 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/local-log.d.ts +64 -0
- package/dist/telemetry/local-log.js +123 -0
- package/dist/telemetry/local-log.js.map +1 -0
- package/dist/tokens/dtcg-model.d.ts +53 -0
- package/dist/tokens/dtcg-model.js +18 -0
- package/dist/tokens/dtcg-model.js.map +1 -0
- package/dist/tokens/normalizer.d.ts +17 -0
- package/dist/tokens/normalizer.js +360 -0
- package/dist/tokens/normalizer.js.map +1 -0
- package/dist/types.d.ts +300 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/util/git.d.ts +6 -0
- package/dist/util/git.js +40 -0
- package/dist/util/git.js.map +1 -0
- package/dist/util/git.test.d.ts +5 -0
- package/dist/util/git.test.js +42 -0
- package/dist/util/git.test.js.map +1 -0
- package/dist/util/gitignore.d.ts +9 -0
- package/dist/util/gitignore.js +39 -0
- package/dist/util/gitignore.js.map +1 -0
- package/dist/util/hash-deps.d.ts +6 -0
- package/dist/util/hash-deps.js +24 -0
- package/dist/util/hash-deps.js.map +1 -0
- package/dist/util/spinner.d.ts +41 -0
- package/dist/util/spinner.js +126 -0
- package/dist/util/spinner.js.map +1 -0
- package/dist/util/with-spinner.d.ts +11 -0
- package/dist/util/with-spinner.js +19 -0
- package/dist/util/with-spinner.js.map +1 -0
- package/dist/walker.d.ts +14 -0
- package/dist/walker.js +91 -0
- package/dist/walker.js.map +1 -0
- package/package.json +83 -0
- package/rules-manifest.json +289 -0
- package/schemas/v1/lyse-config.json +82 -0
- package/schemas/v1/lyse-event.json +68 -0
- package/schemas/v1/lyse-license.json +19 -0
- package/schemas/v1/lyse-llm-payload.json +53 -0
- package/schemas/v1/lyse-llm-response.json +45 -0
- package/schemas/v1/lyse-result.json +98 -0
- package/schemas/v1/lyse-rules.json +42 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"rulesVersion": "0.1.0",
|
|
4
|
+
"rules": [
|
|
5
|
+
{
|
|
6
|
+
"id": "tokens/no-hardcoded-color",
|
|
7
|
+
"axis": "tokens",
|
|
8
|
+
"defaultSeverity": "warning",
|
|
9
|
+
"shortDescription": "Disallow hardcoded color values",
|
|
10
|
+
"fullDescription": "Hardcoded color values (#hex, rgb(), hsl(), oklch(), Tailwind arbitrary `bg-[#fff]`) bypass the design system. They survive token changes silently (a brand refresh becomes a manual hunt) and break dark-mode propagation through CSS variables.",
|
|
11
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/tokens-no-hardcoded-color.md",
|
|
12
|
+
"rationale": "Why it matters\n\nHardcoded colors are the #1 signal that an AI agent ignored the design contract. They silently fork the design system: each #2563eb that should be color.action.primary is a token-rename bomb waiting to detonate.\n\nWhen the rule fires, the suggestion includes the matching token from the project's TokenMap when the reverse-lookup yields exactly one candidate. When multiple tokens map to the same color value (common with primitive vs semantic token layers), all candidates are listed — the agent or human picks.",
|
|
13
|
+
"examples": [
|
|
14
|
+
{
|
|
15
|
+
"good": "<div className=\"bg-action-primary text-on-action\">",
|
|
16
|
+
"bad": "<div style={{ background: \"#2563eb\", color: \"#fff\" }}>"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"good": "<div className=\"bg-action-primary\">",
|
|
20
|
+
"bad": "<div className=\"bg-[#2563eb]\">"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"good": "color: var(--color-action-primary);",
|
|
24
|
+
"bad": "color: hsl(214, 86%, 53%);"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"allowlist": [
|
|
28
|
+
"currentColor",
|
|
29
|
+
"transparent",
|
|
30
|
+
"inherit",
|
|
31
|
+
"initial",
|
|
32
|
+
"unset",
|
|
33
|
+
"none",
|
|
34
|
+
"auto"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "tokens/no-hardcoded-spacing",
|
|
39
|
+
"axis": "tokens",
|
|
40
|
+
"defaultSeverity": "warning",
|
|
41
|
+
"shortDescription": "Disallow off-scale spacing values",
|
|
42
|
+
"fullDescription": "Padding, margin, gap, and similar properties using raw px/rem/em values outside the documented spacing scale (Tailwind config, DTCG dimension tokens, or CSS variables) produce inconsistent rhythm and break theming.",
|
|
43
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/tokens-no-hardcoded-spacing.md",
|
|
44
|
+
"rationale": "Why it matters\n\nThe spacing scale encodes the rhythm of the product. A one-off `padding: 7px` survives every design-pass and slowly desynchronizes layouts. When the rule fires, the suggestion includes the matching scale step when the value maps to exactly one token.\n\nThe allowlist accommodates 1px borders (`border: 1px solid`), zero, and full-viewport keywords — these are not design-system tokens but pragmatic primitives.",
|
|
45
|
+
"examples": [
|
|
46
|
+
{
|
|
47
|
+
"good": "<div className=\"p-2\">",
|
|
48
|
+
"bad": "<div style={{ padding: \"7px\" }}>"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"good": "gap: var(--spacing-4);",
|
|
52
|
+
"bad": "gap: 13px;"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"allowlist": [
|
|
56
|
+
"0",
|
|
57
|
+
"auto",
|
|
58
|
+
"100%",
|
|
59
|
+
"100vh",
|
|
60
|
+
"100vw"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "tokens/dtcg-conformance",
|
|
65
|
+
"axis": "tokens",
|
|
66
|
+
"defaultSeverity": "warning",
|
|
67
|
+
"shortDescription": "DTCG v2025.10 conformance for token JSON files",
|
|
68
|
+
"fullDescription": "Validates token JSON files (`*.tokens.json`, files under `tokens/**`) against the W3C Design Tokens Community Group spec (DTCG v2025.10). Flags tokens missing `$type` when it can be inferred from the value, broken aliases (`{group.token}` references that don't resolve), and composite tokens (shadow, typography, border) with the wrong shape.",
|
|
69
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/tokens-dtcg-conformance.md",
|
|
70
|
+
"rationale": "Why it matters\n\nDTCG conformance is the contract between design and code. Non-conformant token files don't survive round-trips through Style Dictionary, Tokens Studio, or Figma Tokens plugins — they silently corrupt theming and break dark-mode propagation.\n\nThe most common drift modes are: tokens with `$value` but no `$type` (Style Dictionary can't infer the right transform), aliases that point to renamed paths after a refactor, and composite shadow tokens with legacy string shapes that no longer parse.",
|
|
71
|
+
"examples": [
|
|
72
|
+
{
|
|
73
|
+
"good": "{ \"color\": { \"brand\": { \"$value\": \"#2563eb\", \"$type\": \"color\" } } }",
|
|
74
|
+
"bad": "{ \"color\": { \"brand\": { \"$value\": \"#2563eb\" } } }"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"good": "{ \"shadow\": { \"sm\": { \"$type\": \"shadow\", \"$value\": { \"offsetX\": \"0\", \"offsetY\": \"1px\", \"blur\": \"2px\", \"color\": \"rgba(0,0,0,0.1)\" } } } }",
|
|
78
|
+
"bad": "{ \"shadow\": { \"sm\": { \"$type\": \"shadow\", \"$value\": \"0 1px 2px rgba(0,0,0,0.1)\" } } }"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"good": "{ \"semantic\": { \"primary\": { \"$value\": \"{color.brand}\", \"$type\": \"color\" } } } (when color.brand exists)",
|
|
82
|
+
"bad": "{ \"semantic\": { \"primary\": { \"$value\": \"{color.brandd}\", \"$type\": \"color\" } } } (typo, no such path)"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"allowlist": [
|
|
86
|
+
"files matching `*.tokens.json` heuristic but containing only $-prefixed metadata (no $value anywhere) — skipped, not flagged",
|
|
87
|
+
"files larger than 1 MB — skipped to avoid pathological cases",
|
|
88
|
+
"files matching `ctx.excludePaths` config"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "tokens/description-coverage",
|
|
93
|
+
"axis": "tokens",
|
|
94
|
+
"defaultSeverity": "info",
|
|
95
|
+
"shortDescription": "Semantic tokens should declare a $description",
|
|
96
|
+
"fullDescription": "Measures the fraction of semantic-layer tokens (`action.*`, `surface.*`, `text.*`, `background.*`, `border.*`, `feedback.*`, `state.*`, `interactive.*`, `link.*`, or any token under a `semantic` group) that declare a non-empty `$description`. Emits a single summary finding when coverage falls below 80%.",
|
|
97
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/tokens-description-coverage.md",
|
|
98
|
+
"rationale": "Why it matters\n\nSemantic tokens are the contract surface between design and code. Their primitive counterparts (`color.blue.500`, `spacing.16`) are self-explanatory — a number or a hex. But `action.primary` only makes sense if the token explains *what* it's for: \"the default action color for primary buttons, brand surfaces, and emphasized text\".\n\nUndocumented semantic tokens cause AI agents and humans alike to pick the wrong token. `$description` is the cheapest documentation surface in a DS — and the one most often skipped.\n\nThe rule is intentionally informational (severity: info) and computes coverage on the semantic layer only. Primitive tokens are excluded from the denominator.",
|
|
99
|
+
"examples": [
|
|
100
|
+
{
|
|
101
|
+
"good": "{ \"action\": { \"primary\": { \"$value\": \"{color.brand.500}\", \"$type\": \"color\", \"$description\": \"Default action color for primary CTAs and emphasized text\" } } }",
|
|
102
|
+
"bad": "{ \"action\": { \"primary\": { \"$value\": \"{color.brand.500}\", \"$type\": \"color\" } } }"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"allowlist": [
|
|
106
|
+
"primitive tokens — `color.blue.500`, `spacing.16`, `radius.md` — excluded from the denominator",
|
|
107
|
+
"repos with no DTCG file — rule is N/A (opportunities = 0)"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "components/no-native-shadows",
|
|
112
|
+
"axis": "components",
|
|
113
|
+
"defaultSeverity": "warning",
|
|
114
|
+
"shortDescription": "Disallow native HTML elements when a DS component exists",
|
|
115
|
+
"fullDescription": "Native `<button>`, `<input>`, `<select>`, `<textarea>`, `<a>` used in a file that ALREADY imports from the configured DS module signals an intentional bypass of the design system's component primitives. Polymorphic `as=` props and `excludePaths` are honored.",
|
|
116
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/components-shadow-native.md",
|
|
117
|
+
"rationale": "Why it matters\n\nDS components encapsulate accessibility, theming, focus-management, and brand-consistent variants. Replacing them with native HTML on a per-component basis fragments these guarantees and creates inconsistent UX.\n\nThe rule only flags when the file already imports from the DS module — this is high-signal (the team uses the DS in this file but bypassed it for this element). Files that don't use the DS at all are skipped.",
|
|
118
|
+
"examples": [
|
|
119
|
+
{
|
|
120
|
+
"good": "<Button variant=\"primary\" onClick={save}>Save</Button>",
|
|
121
|
+
"bad": "<button onClick={save}>Save</button>"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"good": "<Link href=\"/about\">About</Link>",
|
|
125
|
+
"bad": "<a href=\"/about\">About</a>"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"allowlist": [
|
|
129
|
+
"polymorphic `as=\"button\"` in `<Box as=\"button\">`",
|
|
130
|
+
"files matching `designSystem.excludePaths` config"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": "naming/component-pascalcase",
|
|
135
|
+
"axis": "components",
|
|
136
|
+
"defaultSeverity": "warning",
|
|
137
|
+
"shortDescription": "Exported React/Vue/Solid components must be PascalCase",
|
|
138
|
+
"fullDescription": "Exported component functions or const arrow-function components (those returning JSX) that are not named in PascalCase violate React/Vue/Solid component naming conventions. Non-PascalCase names are silently treated as plain elements in JSX, causing components to render as unknown DOM elements and breaking the React component model.",
|
|
139
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/naming-component-pascalcase.md",
|
|
140
|
+
"rationale": "Why it matters\n\nReact, Vue, and Solid distinguish between HTML element types and component types by case: `<myButton>` creates an unknown HTML element whereas `<MyButton>` invokes the component. A component named `myButton` instead of `MyButton` is silently broken when used as JSX — it renders nothing useful.\n\nAuto-fix renames the declaration and internal same-file references. Cross-file imports must be updated separately (the suggestion includes a warning when the name is exported).",
|
|
141
|
+
"examples": [
|
|
142
|
+
{
|
|
143
|
+
"good": "export function MyButton() { return <button>Click</button>; }",
|
|
144
|
+
"bad": "export function myButton() { return <button>Click</button>; }"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"good": "export const MyCard = () => <div className=\"card\" />;",
|
|
148
|
+
"bad": "export const my_card = () => <div className=\"card\" />;"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"allowlist": [
|
|
152
|
+
"HOC patterns (withRouter, withTheme — start with `with` lowercase)",
|
|
153
|
+
"test utilities in .test.tsx / .spec.tsx files",
|
|
154
|
+
"hooks starting with `use` (handled by naming/hook-prefix)"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"id": "naming/hook-prefix",
|
|
159
|
+
"axis": "components",
|
|
160
|
+
"defaultSeverity": "warning",
|
|
161
|
+
"shortDescription": "Custom hooks must start with `use` + uppercase letter",
|
|
162
|
+
"fullDescription": "Exported functions that call other React hooks internally (useState, useEffect, useMemo, useCallback, useRef, useContext, useReducer, useLayoutEffect, and custom use* hooks) are custom hooks by definition. React's rules-of-hooks linter and runtime depend on the `use` prefix to detect hooks — a function named `getMyData` that calls `useState` internally breaks lint, ESLint plugin react-hooks, and can cause subtle hook order violations.",
|
|
163
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/naming-hook-prefix.md",
|
|
164
|
+
"rationale": "Why it matters\n\nReact's rules of hooks use the `use` prefix to determine if a function is a hook. A misnamed hook (`getMyData` calling `useState`) bypasses this detection, so:\n1. `eslint-plugin-react-hooks` won't apply its rules (silently broken)\n2. Calling the function conditionally becomes valid from ESLint's perspective — but will still crash at runtime\n3. Other developers don't know the function has hook semantics and may call it in non-hook contexts\n\nAuto-fix renames the declaration to `use<CapitalizedName>`. Cross-file callers must be updated separately.",
|
|
165
|
+
"examples": [
|
|
166
|
+
{
|
|
167
|
+
"good": "export function useMyData() { const [d, setD] = useState(null); return d; }",
|
|
168
|
+
"bad": "export function getMyData() { const [d, setD] = useState(null); return d; }"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"good": "export const useAuth = () => { const ctx = useContext(AuthCtx); return ctx; };",
|
|
172
|
+
"bad": "export const fetchAuth = () => { const ctx = useContext(AuthCtx); return ctx; };"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"allowlist": [
|
|
176
|
+
"PascalCase components that happen to call hooks (those are components, not hooks)",
|
|
177
|
+
"test utilities in .test.ts / .spec.ts files",
|
|
178
|
+
"non-exported functions (internal helpers)"
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "a11y/essentials",
|
|
183
|
+
"axis": "a11y",
|
|
184
|
+
"defaultSeverity": "warning",
|
|
185
|
+
"shortDescription": "Essential accessibility checks (jsx-a11y subset)",
|
|
186
|
+
"fullDescription": "Wraps the canonical `eslint-plugin-jsx-a11y` rules: `alt-text`, `anchor-has-content`, `label-has-associated-control`, `role-has-required-aria-props`, `aria-role`. Surface-level accessibility failures that AI agents most frequently introduce.",
|
|
187
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/a11y-essentials.md",
|
|
188
|
+
"rationale": "Why it matters\n\nMissing alt text, empty anchors, unlabeled inputs, and invalid ARIA are the most common a11y regressions in AI-generated UI. They block screen-reader users and violate WCAG 2.1 SC 1.1.1, 2.4.4, 1.3.1, 4.1.2.\n\nLyse depends on the canonical `eslint-plugin-jsx-a11y` rather than re-porting these rules — the upstream impl is battle-tested across millions of repos.",
|
|
189
|
+
"examples": [
|
|
190
|
+
{
|
|
191
|
+
"good": "<img src=\"/logo.png\" alt=\"Lyse logo\" />",
|
|
192
|
+
"bad": "<img src=\"/logo.png\" />"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"good": "<label htmlFor=\"email\">Email</label><input id=\"email\" />",
|
|
196
|
+
"bad": "<label>Email</label><input />"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"allowlist": [
|
|
200
|
+
"jsx-a11y allowlists per-rule (e.g., decorative `alt=\"\"` for purely-presentational images)"
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "stories/coverage",
|
|
205
|
+
"axis": "stories",
|
|
206
|
+
"defaultSeverity": "warning",
|
|
207
|
+
"shortDescription": "DS components without Storybook stories",
|
|
208
|
+
"fullDescription": "DS components in the inventory (imported elsewhere in the codebase) that have no matching Storybook story are flagged. A DS component without a story is undocumented and untested for the team.",
|
|
209
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/storybook-coverage.md",
|
|
210
|
+
"rationale": "Why it matters\n\nStorybook is the canonical documentation surface for a DS. Components without stories are invisible to designers, untestable visually, and an onboarding hazard for new engineers.\n\nThe rule scans `storybook-static/index.json` first (build output), falling back to filesystem scan of `**/*.stories.{ts,tsx,js,jsx}`. Coverage is computed per `componentInventory` entry — a DS component used N times in the codebase but with no story counts as one finding.",
|
|
211
|
+
"examples": [
|
|
212
|
+
{
|
|
213
|
+
"good": "Button.tsx + Button.stories.tsx",
|
|
214
|
+
"bad": "Button.tsx (no Button.stories.tsx)"
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"allowlist": [
|
|
218
|
+
"components not in `componentInventory` (i.e., never imported)"
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"id": "ai-surface/agents-md-quality",
|
|
223
|
+
"axis": "ai-surface",
|
|
224
|
+
"defaultSeverity": "warning",
|
|
225
|
+
"shortDescription": "AGENTS.md should be command-first and machine-actionable",
|
|
226
|
+
"fullDescription": "Reads `AGENTS.md` at the repo root (with `.github/AGENTS.md` and `docs/AGENTS.md` fallbacks) and verifies three quality signals: (1) at least one fenced code block whose first line is a runnable shell command (pnpm/npm/yarn/bun/python/cargo/make/bash/sh/node/tsx/deno/...), (2) at least one mention of exit codes / status codes / return codes, (3) at least one reference to a toolchain config file the repo actually has (package.json, tsconfig.json, pyproject.toml, Makefile, .lyse.yaml, etc.). Each failing signal emits one warning; absence of AGENTS.md emits one info finding.",
|
|
227
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/ai-surface-agents-md-quality.md",
|
|
228
|
+
"rationale": "Why it matters\n\nCoding agents (Claude Code, Cursor, Copilot Workspace, etc.) consume AGENTS.md as their bootstrap context. Research from the kodustech/agent-readiness study (Stream 2) shows that command-first AGENTS.md sections — containing runnable commands and explicit exit-code semantics — shift agent task success by 35–55%.\n\nMere presence is not enough. A prose-only AGENTS.md that explains the project in English without listing a single `pnpm test` block leaves the agent guessing at the toolchain. Worse, per Gloaguen et al. (2026), long unstructured context files *reduce* task success and *increase* token cost by 20%.\n\nThe rule enforces the cheapest, highest-leverage discipline: at least one runnable command, at least one explicit exit-code expectation, and at least one reference to the toolchain config the agent will encounter.",
|
|
229
|
+
"examples": [
|
|
230
|
+
{
|
|
231
|
+
"good": "## Build\\n\\n\\`\\`\\`bash\\npnpm install && pnpm test\\n\\`\\`\\`\\n\\nExit code 0 means clean. Uses package.json.",
|
|
232
|
+
"bad": "# Welcome\\n\\nThis repo is a TypeScript project. Please read the README before contributing."
|
|
233
|
+
}
|
|
234
|
+
],
|
|
235
|
+
"allowlist": [
|
|
236
|
+
"files larger than 500 KB — skipped to avoid pathological cases",
|
|
237
|
+
"repos with no AGENTS.md anywhere — emit a single info finding, not a warning"
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"id": "ai-surface/component-manifest-json",
|
|
242
|
+
"axis": "ai-surface",
|
|
243
|
+
"defaultSeverity": "info",
|
|
244
|
+
"shortDescription": "Component manifest JSON for MCP cost reduction",
|
|
245
|
+
"fullDescription": "Looks for a component manifest at the repo root (`components.json`, `lyse.components.json`) or in a monorepo (`apps/*/components.json`, `packages/*/components.json`). When found, validates the file is parseable JSON, has a top-level `components` array or object, and each entry has `{ name, sourceFile }` or `{ name, import }`. Absence emits an info finding; malformed manifests emit warnings. shadcn/ui-style `components.json` (the CLI config file, not a manifest) is detected and not counted as a lyse manifest.",
|
|
246
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/ai-surface-component-manifest-json.md",
|
|
247
|
+
"rationale": "Why it matters\n\nThe Indeed MCP cost study (Stream 1) and the broader manifest-pattern literature (Stream 2) show that a static component manifest reduces MCP tool cost by ~5× compared to reading the underlying source files at lookup time. Agents calling `lyse_components` or equivalent get a deterministic, low-token list of components instead of paging through tsx files.\n\nThe manifest is also the source of truth for component discovery in code-connect and MCP-driven design-to-code workflows — without it, tools must heuristically scan exports or rely on conventions that break across monorepos.\n\nSeverity is intentionally informational for absence (the absence is a missed optimisation, not a bug). Malformed manifests are warnings because they will silently break consumers.",
|
|
248
|
+
"examples": [
|
|
249
|
+
{
|
|
250
|
+
"good": "{ \"components\": [ { \"name\": \"Button\", \"sourceFile\": \"packages/ui/src/button.tsx\" } ] }",
|
|
251
|
+
"bad": "{ \"stuff\": [] }"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"good": "{ \"components\": { \"Button\": { \"import\": \"@acme/ui\" } } }",
|
|
255
|
+
"bad": "{ \"components\": [ { \"sourceFile\": \"x.tsx\" } ] }"
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
"allowlist": [
|
|
259
|
+
"shadcn/ui `components.json` (the CLI config file) — detected via `$schema` or `aliases` and skipped",
|
|
260
|
+
"files larger than 2 MB — skipped to avoid pathological cases",
|
|
261
|
+
"files matching `ctx.excludePaths` config"
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"id": "ai-surface/ds-index-exported",
|
|
266
|
+
"axis": "ai-surface",
|
|
267
|
+
"defaultSeverity": "warning",
|
|
268
|
+
"shortDescription": "DS package must export a discoverable index entry",
|
|
269
|
+
"fullDescription": "When `ctx.componentsModule` is configured (or auto-detected) and resolves to a workspace package, verifies that the package has an `src/index.ts` (or `src/index.tsx` / `index.ts` / `index.tsx`) file containing `export` statements (named, type, or `export * from`), with a meaningful surface (≥3 distinct named exports unless `export * from` is used). Rule is N/A when no DS module is configured or when the module is an external library (not a workspace package).",
|
|
270
|
+
"helpUri": "https://github.com/lyse-labs/lyse/blob/main/docs/rules/ai-surface-ds-index-exported.md",
|
|
271
|
+
"rationale": "Why it matters\n\nA single, discoverable index entry point is the contract surface for MCP servers, code-connect tools, and humans alike. Without it, agents and IDEs must page through arbitrary file structures, guessing at where `Button` lives.\n\nThe rule is intentionally conservative: it accepts `export * from './components'` as an opaque-but-valid surface (we don't recursively follow it) and requires ≥3 distinct named exports only when no star re-exports are present. This avoids false positives on packages that legitimately re-export a single barrel module.\n\nWhen the configured DS module is external (e.g., `@mui/material`), the rule is N/A — there's nothing in the user's repo to fix.",
|
|
272
|
+
"examples": [
|
|
273
|
+
{
|
|
274
|
+
"good": "// packages/ui/src/index.ts\\nexport { Button } from './button';\\nexport { Card } from './card';\\nexport { Modal } from './modal';",
|
|
275
|
+
"bad": "// packages/ui/src/index.ts is missing entirely"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"good": "// packages/ui/src/index.ts\\nexport * from './components';",
|
|
279
|
+
"bad": "// packages/ui/src/index.ts\\nconst internal = 1;"
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
"allowlist": [
|
|
283
|
+
"external libraries (componentsModule not resolvable to a workspace package) — rule is N/A",
|
|
284
|
+
"repos with no `componentsModule` configured or auto-detected — rule is N/A",
|
|
285
|
+
"indexes using `export * from ...` — accepted without counting named exports"
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/lyse-labs/lyse/raw/main/schemas/v1/lyse-config.json",
|
|
4
|
+
"title": "Lyse .lyse.yaml config",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" },
|
|
9
|
+
"designSystem": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"properties": {
|
|
13
|
+
"componentsModule": { "type": "string" },
|
|
14
|
+
"elements": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
15
|
+
"excludePaths": { "type": "array", "items": { "type": "string" } },
|
|
16
|
+
"intentMap": { "type": "object", "additionalProperties": { "type": "string" } }
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"rules": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"properties": {
|
|
25
|
+
"severity": { "type": "string", "enum": ["error", "warning", "info", "off"] },
|
|
26
|
+
"ignore": { "type": "array", "items": { "type": "string" } }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"output": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"properties": {
|
|
34
|
+
"deterministic": { "type": "boolean" },
|
|
35
|
+
"format": { "type": "string", "enum": ["json", "sarif", "text"] }
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"license": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"properties": {
|
|
42
|
+
"key": { "type": ["string", "null"] }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"telemetry": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"properties": {
|
|
49
|
+
"enabled": { "type": "boolean" },
|
|
50
|
+
"endpoint": { "type": "string", "format": "uri" }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"mcp": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"properties": {
|
|
57
|
+
"enabled": { "type": "boolean" },
|
|
58
|
+
"meterPath": { "type": "string" }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"llm": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"properties": {
|
|
65
|
+
"provider": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"enum": ["anthropic", "openai", "openai-compatible", "mcp", "auto"],
|
|
68
|
+
"description": "LLM provider. Note: 'none' was removed in v0.1 — use staticOnly: true instead."
|
|
69
|
+
},
|
|
70
|
+
"model": { "type": "string" },
|
|
71
|
+
"endpoint": { "type": "string" },
|
|
72
|
+
"connector": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": ["auto", "mcp-host", "openrouter", "direct-api-key", "ollama"]
|
|
75
|
+
},
|
|
76
|
+
"costCapUsd": { "type": "number", "exclusiveMinimum": 0 },
|
|
77
|
+
"cacheMaxAgeDays": { "type": "number", "exclusiveMinimum": 0 },
|
|
78
|
+
"staticOnly": { "type": "boolean" }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/lyse-labs/lyse/raw/main/schemas/v1/lyse-event.json",
|
|
4
|
+
"title": "Lyse telemetry event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["schema_version", "event_id", "event_type", "ts", "session_id", "repo_bucket", "sdk_version"],
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema_version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" },
|
|
10
|
+
"source": { "type": "string", "enum": ["user", "bench"], "default": "user" },
|
|
11
|
+
"event_id": { "type": "string", "minLength": 16, "maxLength": 32 },
|
|
12
|
+
"event_type": { "type": "string", "enum": ["audit.started", "audit.completed", "finding.discovered"] },
|
|
13
|
+
"ts": { "type": "string", "format": "date-time" },
|
|
14
|
+
"session_id": { "type": "string", "minLength": 16, "maxLength": 32 },
|
|
15
|
+
"repo_bucket": { "type": "string", "pattern": "^[a-f0-9]{16}$" },
|
|
16
|
+
"sdk_version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+" },
|
|
17
|
+
"rules_version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" },
|
|
18
|
+
"stack": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": true,
|
|
21
|
+
"properties": {
|
|
22
|
+
"framework": { "type": "string" },
|
|
23
|
+
"ds_detected": { "type": "string" }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"audit": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"properties": {
|
|
30
|
+
"duration_ms": { "type": "integer", "minimum": 0 },
|
|
31
|
+
"score": {
|
|
32
|
+
"oneOf": [
|
|
33
|
+
{ "type": "integer", "minimum": 0, "maximum": 100 },
|
|
34
|
+
{ "type": "null" }
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"axes": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": {
|
|
40
|
+
"oneOf": [
|
|
41
|
+
{ "type": "integer", "minimum": 0, "maximum": 100 },
|
|
42
|
+
{ "type": "string", "const": "N/A" }
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"violations": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"properties": {
|
|
50
|
+
"error": { "type": "integer", "minimum": 0 },
|
|
51
|
+
"warning": { "type": "integer", "minimum": 0 },
|
|
52
|
+
"info": { "type": "integer", "minimum": 0 }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"finding": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"required": ["rule_id", "severity", "file_hash"],
|
|
61
|
+
"properties": {
|
|
62
|
+
"rule_id": { "type": "string" },
|
|
63
|
+
"severity": { "type": "string", "enum": ["error", "warning", "info"] },
|
|
64
|
+
"file_hash": { "type": "string", "pattern": "^[a-f0-9]{8}$" }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/lyse-labs/lyse/raw/main/schemas/v1/lyse-license.json",
|
|
4
|
+
"title": "Lyse license JWT claims",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["iss", "sub", "iat", "exp", "plan", "features", "schema_version"],
|
|
7
|
+
"additionalProperties": true,
|
|
8
|
+
"properties": {
|
|
9
|
+
"iss": { "const": "lyse-labs/lyse" },
|
|
10
|
+
"sub": { "type": "string" },
|
|
11
|
+
"iat": { "type": "integer" },
|
|
12
|
+
"exp": { "type": "integer" },
|
|
13
|
+
"plan": { "type": "string", "enum": ["free", "team", "enterprise"] },
|
|
14
|
+
"features": { "type": "array", "items": { "type": "string" } },
|
|
15
|
+
"seats": { "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] },
|
|
16
|
+
"repos": { "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] },
|
|
17
|
+
"schema_version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/lyse-labs/lyse/raw/main/schemas/v1/lyse-llm-payload.json",
|
|
4
|
+
"title": "Lyse LLM Augmentation Request",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["staticFindings", "sampleFiles", "packageJson", "lyseVersion", "dimensionsToAnalyze"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"staticFindings": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"required": ["ruleId", "axis", "severity", "location", "message"],
|
|
13
|
+
"additionalProperties": true,
|
|
14
|
+
"properties": {
|
|
15
|
+
"ruleId": { "type": "string" },
|
|
16
|
+
"axis": { "type": "string", "enum": ["tokens", "a11y", "components", "stories", "ai-surface"] },
|
|
17
|
+
"severity": { "type": "string", "enum": ["error", "warning", "info"] },
|
|
18
|
+
"location": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"required": ["file", "line"],
|
|
21
|
+
"properties": {
|
|
22
|
+
"file": { "type": "string" },
|
|
23
|
+
"line": { "type": "integer", "minimum": 0 },
|
|
24
|
+
"column": { "type": "integer", "minimum": 0 }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"message": { "type": "string" }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"sampleFiles": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"maxItems": 15,
|
|
34
|
+
"items": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"required": ["path", "content", "bytes"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"path": { "type": "string" },
|
|
39
|
+
"content": { "type": "string" },
|
|
40
|
+
"bytes": { "type": "integer", "minimum": 0 }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"packageJson": { "type": "object" },
|
|
45
|
+
"lyseVersion": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+" },
|
|
46
|
+
"dimensionsToAnalyze": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"enum": ["tokens", "components", "a11y", "stories", "themes", "motion", "patterns", "naming", "documentation"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/lyse-labs/lyse/raw/main/schemas/v1/lyse-llm-response.json",
|
|
4
|
+
"title": "Lyse LLM Augmentation Response",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["findings", "tokensConsumed", "usdSpent", "modelUsed", "llmQuality"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"findings": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"required": ["ruleId", "axis", "severity", "location", "message", "codeSnippet", "llmConfidence"],
|
|
13
|
+
"additionalProperties": true,
|
|
14
|
+
"properties": {
|
|
15
|
+
"ruleId": { "type": "string" },
|
|
16
|
+
"axis": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Either a legacy 4-axis value or one of the 9 v0.1 DS dimensions, or a custom value the LLM coined for an unforeseen pattern."
|
|
19
|
+
},
|
|
20
|
+
"severity": { "type": "string", "enum": ["error", "warning", "info"] },
|
|
21
|
+
"location": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"required": ["file", "line"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"file": { "type": "string" },
|
|
26
|
+
"line": { "type": "integer", "minimum": 0 },
|
|
27
|
+
"column": { "type": "integer", "minimum": 0 }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"message": { "type": "string" },
|
|
31
|
+
"codeSnippet": { "type": "string" },
|
|
32
|
+
"llmConfidence": { "enum": ["high", "medium", "low"] }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"tokensConsumed": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"required": ["input", "output"],
|
|
39
|
+
"properties": { "input": { "type": "integer" }, "output": { "type": "integer" } }
|
|
40
|
+
},
|
|
41
|
+
"usdSpent": { "type": "number", "minimum": 0 },
|
|
42
|
+
"modelUsed": { "type": "string" },
|
|
43
|
+
"llmQuality": { "enum": ["higher", "lower"] }
|
|
44
|
+
}
|
|
45
|
+
}
|